mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-07 16:05:05 -05:00
Compare commits
106 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba336122c0 | ||
|
|
591744174c | ||
|
|
fc85017948 | ||
|
|
24f541a0dd | ||
|
|
f552577e71 | ||
|
|
a06ec06e8b | ||
|
|
96833d4790 | ||
|
|
5611ae9a30 | ||
|
|
72c8404d18 | ||
|
|
bc128d11d9 | ||
|
|
ff13675d31 | ||
|
|
4b682b6633 | ||
|
|
879e160ba3 | ||
|
|
9a6b8594f3 | ||
|
|
a354e9d217 | ||
|
|
950b5fa75e | ||
|
|
9f66d59c0a | ||
|
|
9d99fef52e | ||
|
|
3b22f1704f | ||
|
|
c89ad6b36d | ||
|
|
45300f1ff5 | ||
|
|
847d08cdbc | ||
|
|
81af1e964d | ||
|
|
3662e45435 | ||
|
|
f06e30e343 | ||
|
|
34d4aa4012 | ||
|
|
3e4bf8cd6c | ||
|
|
206b675892 | ||
|
|
00b4ae9c36 | ||
|
|
8d5ea745bb | ||
|
|
cac48cdd27 | ||
|
|
c20010ed54 | ||
|
|
5926dee354 | ||
|
|
b78b0b5c6b | ||
|
|
43afa437e4 | ||
|
|
050568a4ab | ||
|
|
8bf40cea36 | ||
|
|
ae3ff0f570 | ||
|
|
0addf91a70 | ||
|
|
abb78302b8 | ||
|
|
e5579d8635 | ||
|
|
3986c43fa5 | ||
|
|
838cc08680 | ||
|
|
a0fe49f946 | ||
|
|
70dbe8562c | ||
|
|
41fcd1e49a | ||
|
|
90195caa1d | ||
|
|
cdb6287d89 | ||
|
|
32e9b7e34a | ||
|
|
6484bbb716 | ||
|
|
e59806d6ae | ||
|
|
299b180b28 | ||
|
|
1acd88ed39 | ||
|
|
109c088e8a | ||
|
|
bb18239642 | ||
|
|
ccded7cc0a | ||
|
|
5bc89fdc8b | ||
|
|
70c7f33a20 | ||
|
|
1ec185a3a0 | ||
|
|
6aa4eeefbb | ||
|
|
10ea567084 | ||
|
|
028d6503aa | ||
|
|
51346c2b2b | ||
|
|
ca535c7813 | ||
|
|
ba80e27349 | ||
|
|
bd8cf54a0b | ||
|
|
e0eed7d5d6 | ||
|
|
8dff08f15f | ||
|
|
47d68b068b | ||
|
|
a648a8b9be | ||
|
|
7eefccc6bc | ||
|
|
1bf159d1e8 | ||
|
|
bf46cb8684 | ||
|
|
72c385c870 | ||
|
|
c83429c55c | ||
|
|
e5a2689052 | ||
|
|
b665d2d865 | ||
|
|
e06a76ef1c | ||
|
|
f523fddbfd | ||
|
|
30165ce4be | ||
|
|
83a10cce8c | ||
|
|
71cc486553 | ||
|
|
2eaf8edf0e | ||
|
|
3d740e81a2 | ||
|
|
ef475d98da | ||
|
|
5e92acab34 | ||
|
|
935b8a1106 | ||
|
|
c371a7a2bb | ||
|
|
4fe011b469 | ||
|
|
bf32802a82 | ||
|
|
ccfbba94f2 | ||
|
|
70d7fe9b59 | ||
|
|
34a5c89ee2 | ||
|
|
39ed25cf7b | ||
|
|
26c2200af3 | ||
|
|
aa5a7c3c13 | ||
|
|
08ca51ec4c | ||
|
|
bbd9945866 | ||
|
|
59313d9cc3 | ||
|
|
2da5d31a5d | ||
|
|
5724d8beb6 | ||
|
|
03e9797b92 | ||
|
|
74bd9460d7 | ||
|
|
f033cb7f46 | ||
|
|
38cf5b6324 | ||
|
|
89e6998054 |
39
CHANGELOG.md
39
CHANGELOG.md
@@ -1,3 +1,42 @@
|
|||||||
|
# v6.3.3
|
||||||
|
- [#1817](https://github.com/xmrig/xmrig/pull/1817) Fixed self-select login sequence.
|
||||||
|
- Added brand new [build from source](https://xmrig.com/docs/miner/build) documentation.
|
||||||
|
- New binary downloads for macOS (`macos-x64`), FreeBSD (`freebsd-static-x64`), Linux (`linux-static-x64`), Ubuntu 18.04 (`bionic-x64`), Ubuntu 20.04 (`focal-x64`).
|
||||||
|
- Generic Linux download `xenial-x64` renamed to `linux-x64`.
|
||||||
|
- Builds without SSL/TLS support are no longer provided.
|
||||||
|
- Improved CUDA loader error reporting and fixed plugin load on Linux.
|
||||||
|
- Fixed build warnings with Clang compiler.
|
||||||
|
- Fixed colors on macOS.
|
||||||
|
|
||||||
|
# v6.3.2
|
||||||
|
- [#1794](https://github.com/xmrig/xmrig/pull/1794) More robust 1 GB pages handling.
|
||||||
|
- Don't allocate 1 GB per thread if 1 GB is the default huge page size.
|
||||||
|
- Try to allocate scratchpad from dataset's 1 GB huge pages, if normal huge pages are not available.
|
||||||
|
- Correctly initialize RandomX cache if 1 GB pages fail to allocate on a first NUMA node.
|
||||||
|
- [#1806](https://github.com/xmrig/xmrig/pull/1806) Fixed macOS battery detection.
|
||||||
|
- [#1809](https://github.com/xmrig/xmrig/issues/1809) Improved auto configuration on ARM CPUs.
|
||||||
|
- Added retrieving ARM CPU names, based on lscpu code and database.
|
||||||
|
|
||||||
|
# v6.3.1
|
||||||
|
- [#1786](https://github.com/xmrig/xmrig/pull/1786) Added `pause-on-battery` option, supported on Windows and Linux.
|
||||||
|
- Added command line options `--randomx-cache-qos` and `--argon2-impl`.
|
||||||
|
|
||||||
|
# v6.3.0
|
||||||
|
- [#1771](https://github.com/xmrig/xmrig/pull/1771) Adopted new SSE2NEON and reduced ARM-specific changes.
|
||||||
|
- [#1774](https://github.com/xmrig/xmrig/pull/1774) RandomX: Added new option `cache_qos` in `randomx` object for cache QoS support.
|
||||||
|
- [#1777](https://github.com/xmrig/xmrig/pull/1777) Added support for upcoming Haven offshore fork.
|
||||||
|
- [#1780](https://github.com/xmrig/xmrig/pull/1780) CryptoNight OpenCL: fix for long input data.
|
||||||
|
|
||||||
|
# v6.2.3
|
||||||
|
- [#1745](https://github.com/xmrig/xmrig/pull/1745) AstroBWT: fixed OpenCL compilation on some systems.
|
||||||
|
- [#1749](https://github.com/xmrig/xmrig/pull/1749) KawPow: optimized CPU share verification.
|
||||||
|
- [#1752](https://github.com/xmrig/xmrig/pull/1752) RandomX: added error message when MSR mod fails.
|
||||||
|
- [#1754](https://github.com/xmrig/xmrig/issues/1754) Fixed GPU health readings for pre Vega GPUs on Linux.
|
||||||
|
- [#1756](https://github.com/xmrig/xmrig/issues/1756) Added results and connection reports.
|
||||||
|
- [#1759](https://github.com/xmrig/xmrig/pull/1759) KawPow: fixed DAG initialization on slower AMD GPUs.
|
||||||
|
- [#1763](https://github.com/xmrig/xmrig/pull/1763) KawPow: fixed rare duplicate share errors.
|
||||||
|
- [#1766](https://github.com/xmrig/xmrig/pull/1766) RandomX: small speedup on Ryzen CPUs.
|
||||||
|
|
||||||
# v6.2.2
|
# v6.2.2
|
||||||
- [#1742](https://github.com/xmrig/xmrig/issues/1742) Fixed crash when use HTTP API.
|
- [#1742](https://github.com/xmrig/xmrig/issues/1742) Fixed crash when use HTTP API.
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ elseif (XMRIG_OS_APPLE)
|
|||||||
src/App_unix.cpp
|
src/App_unix.cpp
|
||||||
src/crypto/common/VirtualMemory_unix.cpp
|
src/crypto/common/VirtualMemory_unix.cpp
|
||||||
)
|
)
|
||||||
|
find_library(IOKIT_LIBRARY IOKit)
|
||||||
|
set(EXTRA_LIBS ${IOKIT_LIBRARY})
|
||||||
else()
|
else()
|
||||||
list(APPEND SOURCES_OS
|
list(APPEND SOURCES_OS
|
||||||
src/App_unix.cpp
|
src/App_unix.cpp
|
||||||
@@ -196,10 +198,6 @@ include_directories(src)
|
|||||||
include_directories(src/3rdparty)
|
include_directories(src/3rdparty)
|
||||||
include_directories(${UV_INCLUDE_DIR})
|
include_directories(${UV_INCLUDE_DIR})
|
||||||
|
|
||||||
if (BUILD_STATIC)
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS " -static")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WITH_DEBUG_LOG)
|
if (WITH_DEBUG_LOG)
|
||||||
add_definitions(/DAPP_DEBUG)
|
add_definitions(/DAPP_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
@@ -211,3 +209,7 @@ if (WIN32)
|
|||||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
|
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_PROJECT_NAME})
|
||||||
|
endif()
|
||||||
|
|||||||
121
README.md
121
README.md
@@ -2,130 +2,35 @@
|
|||||||
|
|
||||||
[](https://github.com/xmrig/xmrig/releases)
|
[](https://github.com/xmrig/xmrig/releases)
|
||||||
[](https://github.com/xmrig/xmrig/releases)
|
[](https://github.com/xmrig/xmrig/releases)
|
||||||
[](https://github.com/xmrig/xmrig/releases)
|
[](https://github.com/xmrig/xmrig/releases)
|
||||||
[](https://github.com/xmrig/xmrig/blob/master/LICENSE)
|
[](https://github.com/xmrig/xmrig/blob/master/LICENSE)
|
||||||
[](https://github.com/xmrig/xmrig/stargazers)
|
[](https://github.com/xmrig/xmrig/stargazers)
|
||||||
[](https://github.com/xmrig/xmrig/network)
|
[](https://github.com/xmrig/xmrig/network)
|
||||||
|
|
||||||
XMRig High performance, open source, cross platform RandomX, KawPow, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows.
|
XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner. Official binaries are available for Windows, Linux, macOS and FreeBSD.
|
||||||
|
|
||||||
## Mining backends
|
## Mining backends
|
||||||
- **CPU** (x64/x86/ARM)
|
- **CPU** (x64/ARMv8)
|
||||||
- **OpenCL** for AMD GPUs.
|
- **OpenCL** for AMD GPUs.
|
||||||
- **CUDA** for NVIDIA GPUs via external [CUDA plugin](https://github.com/xmrig/xmrig-cuda).
|
- **CUDA** for NVIDIA GPUs via external [CUDA plugin](https://github.com/xmrig/xmrig-cuda).
|
||||||
|
|
||||||
<img src="doc/screenshot_v5_2_0.png" width="833" >
|
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
* Binary releases: https://github.com/xmrig/xmrig/releases
|
* **[Binary releases](https://github.com/xmrig/xmrig/releases)**
|
||||||
* Git tree: https://github.com/xmrig/xmrig.git
|
* **[Build from source](https://xmrig.com/docs/miner/build)**
|
||||||
* Clone with `git clone https://github.com/xmrig/xmrig.git` :hammer: [Build instructions](https://github.com/xmrig/xmrig/wiki/Build).
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The command line interface does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls.
|
The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The [command line interface](https://xmrig.com/docs/miner/command-line-options) does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls.
|
||||||
|
|
||||||
* **[xmrig.com/wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner.
|
* **[Wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner.
|
||||||
* **[workers.xmrig.info](http://workers.xmrig.info)** helps manage your miners via HTTP API.
|
* **[Workers](http://workers.xmrig.info)** helps manage your miners via HTTP API.
|
||||||
|
|
||||||
### Command line options
|
|
||||||
```
|
|
||||||
Network:
|
|
||||||
-o, --url=URL URL of mining server
|
|
||||||
-a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms
|
|
||||||
--coin=COIN specify coin instead of algorithm
|
|
||||||
-u, --user=USERNAME username for mining server
|
|
||||||
-p, --pass=PASSWORD password for mining server
|
|
||||||
-O, --userpass=U:P username:password pair for mining server
|
|
||||||
-x, --proxy=HOST:PORT connect through a SOCKS5 proxy
|
|
||||||
-k, --keepalive send keepalive packet for prevent timeout (needs pool support)
|
|
||||||
--nicehash enable nicehash.com support
|
|
||||||
--rig-id=ID rig identifier for pool-side statistics (needs pool support)
|
|
||||||
--tls enable SSL/TLS support (needs pool support)
|
|
||||||
--tls-fingerprint=HEX pool TLS certificate fingerprint for strict certificate pinning
|
|
||||||
--daemon use daemon RPC instead of pool for solo mining
|
|
||||||
--daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)
|
|
||||||
-r, --retries=N number of times to retry before switch to backup server (default: 5)
|
|
||||||
-R, --retry-pause=N time to pause between retries (default: 5)
|
|
||||||
--user-agent set custom user-agent string for pool
|
|
||||||
--donate-level=N donate level, default 5%% (5 minutes in 100 minutes)
|
|
||||||
--donate-over-proxy=N control donate over xmrig-proxy feature
|
|
||||||
|
|
||||||
CPU backend:
|
|
||||||
--no-cpu disable CPU mining backend
|
|
||||||
-t, --threads=N number of CPU threads
|
|
||||||
-v, --av=N algorithm variation, 0 auto select
|
|
||||||
--cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1
|
|
||||||
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)
|
|
||||||
--cpu-max-threads-hint=N maximum CPU threads count (in percentage) hint for autoconfig
|
|
||||||
--cpu-memory-pool=N number of 2 MB pages for persistent memory pool, -1 (auto), 0 (disable)
|
|
||||||
--cpu-no-yield prefer maximum hashrate rather than system response/stability
|
|
||||||
--no-huge-pages disable huge pages support
|
|
||||||
--asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer
|
|
||||||
--randomx-init=N thread count to initialize RandomX dataset
|
|
||||||
--randomx-no-numa disable NUMA support for RandomX
|
|
||||||
--randomx-mode=MODE RandomX mode: auto, fast, light
|
|
||||||
--randomx-1gb-pages use 1GB hugepages for dataset (Linux only)
|
|
||||||
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
|
|
||||||
--randomx-no-rdmsr disable reverting initial MSR values on exit
|
|
||||||
--astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200
|
|
||||||
--astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm
|
|
||||||
|
|
||||||
API:
|
|
||||||
--api-worker-id=ID custom worker-id for API
|
|
||||||
--api-id=ID custom instance ID for API
|
|
||||||
--http-host=HOST bind host for HTTP API (default: 127.0.0.1)
|
|
||||||
--http-port=N bind port for HTTP API
|
|
||||||
--http-access-token=T access token for HTTP API
|
|
||||||
--http-no-restricted enable full remote access to HTTP API (only if access token set)
|
|
||||||
|
|
||||||
OpenCL backend:
|
|
||||||
--opencl enable OpenCL mining backend
|
|
||||||
--opencl-devices=N comma separated list of OpenCL devices to use
|
|
||||||
--opencl-platform=N OpenCL platform index or name
|
|
||||||
--opencl-loader=PATH path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)
|
|
||||||
--opencl-no-cache disable OpenCL cache
|
|
||||||
--print-platforms print available OpenCL platforms and exit
|
|
||||||
|
|
||||||
CUDA backend:
|
|
||||||
--cuda enable CUDA mining backend
|
|
||||||
--cuda-loader=PATH path to CUDA plugin (xmrig-cuda.dll or libxmrig-cuda.so)
|
|
||||||
--cuda-devices=N comma separated list of CUDA devices to use
|
|
||||||
--cuda-bfactor-hint=N bfactor hint for autoconfig (0-12)
|
|
||||||
--cuda-bsleep-hint=N bsleep hint for autoconfig
|
|
||||||
--no-nvml disable NVML (NVIDIA Management Library) support
|
|
||||||
|
|
||||||
TLS:
|
|
||||||
--tls-gen=HOSTNAME generate TLS certificate for specific hostname
|
|
||||||
--tls-cert=FILE load TLS certificate chain from a file in the PEM format
|
|
||||||
--tls-cert-key=FILE load TLS certificate private key from a file in the PEM format
|
|
||||||
--tls-dhparam=FILE load DH parameters for DHE ciphers from a file in the PEM format
|
|
||||||
--tls-protocols=N enable specified TLS protocols, example: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
|
|
||||||
--tls-ciphers=S set list of available ciphers (TLSv1.2 and below)
|
|
||||||
--tls-ciphersuites=S set list of available TLSv1.3 ciphersuites
|
|
||||||
|
|
||||||
Logging:
|
|
||||||
-S, --syslog use system log for output messages
|
|
||||||
-l, --log-file=FILE log all output to a file
|
|
||||||
--print-time=N print hashrate report every N seconds
|
|
||||||
--health-print-time=N print health report every N seconds
|
|
||||||
--no-color disable colored output
|
|
||||||
--verbose verbose output
|
|
||||||
|
|
||||||
Misc:
|
|
||||||
-c, --config=FILE load a JSON-format configuration file
|
|
||||||
-B, --background run the miner in the background
|
|
||||||
-V, --version output version information and exit
|
|
||||||
-h, --help display this help and exit
|
|
||||||
--dry-run test configuration and exit
|
|
||||||
--export-topology export hwloc topology to a XML file and exit
|
|
||||||
--title set custom console window title
|
|
||||||
--no-title disable setting console window title
|
|
||||||
```
|
|
||||||
|
|
||||||
## Donations
|
## Donations
|
||||||
* Default donation 5% (5 minutes in 100 minutes) can be reduced to 1% via option `donate-level` or disabled in source code.
|
* Default donation 1% (1 minute in 100 minutes) can be increased via option `donate-level` or disabled in source code.
|
||||||
* XMR: `48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD`
|
* XMR: `48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD`
|
||||||
* BTC: `1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT`
|
|
||||||
|
## Developers
|
||||||
|
* **[xmrig](https://github.com/xmrig)**
|
||||||
|
* **[sech1](https://github.com/SChernykh)**
|
||||||
|
|
||||||
## Contacts
|
## Contacts
|
||||||
* support@xmrig.com
|
* support@xmrig.com
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ if (WITH_TLS)
|
|||||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (BUILD_STATIC)
|
||||||
|
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
find_package(OpenSSL)
|
find_package(OpenSSL)
|
||||||
|
|
||||||
if (OPENSSL_FOUND)
|
if (OPENSSL_FOUND)
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
|||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (BUILD_STATIC)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(/D_GNU_SOURCE)
|
add_definitions(/D_GNU_SOURCE)
|
||||||
|
|
||||||
if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
|
if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
|
||||||
@@ -60,6 +64,9 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
|||||||
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
|
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
|
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Ob1 /GL")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ob1 /GL")
|
||||||
|
|
||||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
||||||
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
|
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
|
||||||
add_definitions(/DNOMINMAX)
|
add_definitions(/DNOMINMAX)
|
||||||
@@ -89,6 +96,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (BUILD_STATIC)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ mkdir -p deps/lib
|
|||||||
|
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
|
|
||||||
wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.bz2 -O hwloc-${HWLOC_VERSION}.tar.bz2
|
wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz
|
||||||
tar -xjf hwloc-${HWLOC_VERSION}.tar.bz2
|
tar -xzf hwloc-${HWLOC_VERSION}.tar.gz
|
||||||
|
|
||||||
cd hwloc-${HWLOC_VERSION}
|
cd hwloc-${HWLOC_VERSION}
|
||||||
./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2
|
./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2
|
||||||
make -j$(nproc)
|
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
|
||||||
cp -fr include/ ../../deps
|
cp -fr include ../../deps
|
||||||
cp hwloc/.libs/libhwloc.a ../../deps/lib
|
cp hwloc/.libs/libhwloc.a ../../deps/lib
|
||||||
cd ..
|
cd ..
|
||||||
19
scripts/build.hwloc1.sh
Executable file
19
scripts/build.hwloc1.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
HWLOC_VERSION="1.11.13"
|
||||||
|
|
||||||
|
mkdir -p deps
|
||||||
|
mkdir -p deps/include
|
||||||
|
mkdir -p deps/lib
|
||||||
|
|
||||||
|
mkdir -p build && cd build
|
||||||
|
|
||||||
|
wget https://download.open-mpi.org/release/hwloc/v1.11/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz
|
||||||
|
tar -xzf hwloc-${HWLOC_VERSION}.tar.gz
|
||||||
|
|
||||||
|
cd hwloc-${HWLOC_VERSION}
|
||||||
|
./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2
|
||||||
|
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
|
||||||
|
cp -fr include ../../deps
|
||||||
|
cp src/.libs/libhwloc.a ../../deps/lib
|
||||||
|
cd ..
|
||||||
@@ -13,8 +13,8 @@ tar -xzf libressl-${LIBRESSL_VERSION}.tar.gz
|
|||||||
|
|
||||||
cd libressl-${LIBRESSL_VERSION}
|
cd libressl-${LIBRESSL_VERSION}
|
||||||
./configure --disable-shared
|
./configure --disable-shared
|
||||||
make -j$(nproc)
|
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
|
||||||
cp -fr include/ ../../deps
|
cp -fr include ../../deps
|
||||||
cp crypto/.libs/libcrypto.a ../../deps/lib
|
cp crypto/.libs/libcrypto.a ../../deps/lib
|
||||||
cp ssl/.libs/libssl.a ../../deps/lib
|
cp ssl/.libs/libssl.a ../../deps/lib
|
||||||
cd ..
|
cd ..
|
||||||
@@ -13,8 +13,8 @@ tar -xzf openssl-${OPENSSL_VERSION}.tar.gz
|
|||||||
|
|
||||||
cd openssl-${OPENSSL_VERSION}
|
cd openssl-${OPENSSL_VERSION}
|
||||||
./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms
|
./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms
|
||||||
make -j$(nproc)
|
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
|
||||||
cp -fr include/ ../../deps
|
cp -fr include ../../deps
|
||||||
cp libcrypto.a ../../deps/lib
|
cp libcrypto.a ../../deps/lib
|
||||||
cp libssl.a ../../deps/lib
|
cp libssl.a ../../deps/lib
|
||||||
cd ..
|
cd ..
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
UV_VERSION="1.38.0"
|
UV_VERSION="1.38.1"
|
||||||
|
|
||||||
mkdir -p deps
|
mkdir -p deps
|
||||||
mkdir -p deps/include
|
mkdir -p deps/include
|
||||||
@@ -14,7 +14,7 @@ tar -xzf v${UV_VERSION}.tar.gz
|
|||||||
cd libuv-${UV_VERSION}
|
cd libuv-${UV_VERSION}
|
||||||
sh autogen.sh
|
sh autogen.sh
|
||||||
./configure --disable-shared
|
./configure --disable-shared
|
||||||
make -j$(nproc)
|
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
|
||||||
cp -fr include/ ../../deps
|
cp -fr include ../../deps
|
||||||
cp .libs/libuv.a ../../deps/lib
|
cp .libs/libuv.a ../../deps/lib
|
||||||
cd ..
|
cd ..
|
||||||
81
src/3rdparty/libethash/ethash_internal.c
vendored
81
src/3rdparty/libethash/ethash_internal.c
vendored
@@ -33,6 +33,18 @@
|
|||||||
#include "data_sizes.h"
|
#include "data_sizes.h"
|
||||||
#include "base/crypto/sha3.h"
|
#include "base/crypto/sha3.h"
|
||||||
|
|
||||||
|
#if defined(_M_X64) || defined(__x86_64__) || defined(__SSE2__)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#include <x86intrin.h>
|
||||||
|
#else
|
||||||
|
#include <intrin.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define kp_prefetch(x) _mm_prefetch((x), _MM_HINT_T0);
|
||||||
|
#else
|
||||||
|
#define kp_prefetch(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SHA3_256(a, b, c) sha3_HashBuffer(256, SHA3_FLAGS_KECCAK, b, c, a, 32)
|
#define SHA3_256(a, b, c) sha3_HashBuffer(256, SHA3_FLAGS_KECCAK, b, c, a, 32)
|
||||||
#define SHA3_512(a, b, c) sha3_HashBuffer(512, SHA3_FLAGS_KECCAK, b, c, a, 64)
|
#define SHA3_512(a, b, c) sha3_HashBuffer(512, SHA3_FLAGS_KECCAK, b, c, a, 64)
|
||||||
|
|
||||||
@@ -157,46 +169,53 @@ void ethash_calculate_dag_item_opt(
|
|||||||
memcpy(ret, init, sizeof(node));
|
memcpy(ret, init, sizeof(node));
|
||||||
ret->words[0] ^= node_index;
|
ret->words[0] ^= node_index;
|
||||||
SHA3_512(ret->bytes, ret->bytes, sizeof(node));
|
SHA3_512(ret->bytes, ret->bytes, sizeof(node));
|
||||||
#if defined(_M_X64) && ENABLE_SSE
|
|
||||||
__m128i const fnv_prime = _mm_set1_epi32(FNV_PRIME);
|
|
||||||
__m128i xmm0 = ret->xmm[0];
|
|
||||||
__m128i xmm1 = ret->xmm[1];
|
|
||||||
__m128i xmm2 = ret->xmm[2];
|
|
||||||
__m128i xmm3 = ret->xmm[3];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i != num_parents; ++i) {
|
for (uint32_t i = 0; i != num_parents; ++i) {
|
||||||
uint32_t parent_index = fast_mod(fnv_hash(node_index ^ i, ret->words[i % NODE_WORDS]), light->num_parent_nodes, light->reciprocal, light->increment, light->shift);
|
uint32_t parent_index = fast_mod(fnv_hash(node_index ^ i, ret->words[i % NODE_WORDS]), light->num_parent_nodes, light->reciprocal, light->increment, light->shift);
|
||||||
node const* parent = &cache_nodes[parent_index];
|
node const* parent = &cache_nodes[parent_index];
|
||||||
|
for (unsigned w = 0; w != NODE_WORDS; ++w) {
|
||||||
#if defined(_M_X64) && ENABLE_SSE
|
ret->words[w] = fnv_hash(ret->words[w], parent->words[w]);
|
||||||
{
|
|
||||||
xmm0 = _mm_mullo_epi32(xmm0, fnv_prime);
|
|
||||||
xmm1 = _mm_mullo_epi32(xmm1, fnv_prime);
|
|
||||||
xmm2 = _mm_mullo_epi32(xmm2, fnv_prime);
|
|
||||||
xmm3 = _mm_mullo_epi32(xmm3, fnv_prime);
|
|
||||||
xmm0 = _mm_xor_si128(xmm0, parent->xmm[0]);
|
|
||||||
xmm1 = _mm_xor_si128(xmm1, parent->xmm[1]);
|
|
||||||
xmm2 = _mm_xor_si128(xmm2, parent->xmm[2]);
|
|
||||||
xmm3 = _mm_xor_si128(xmm3, parent->xmm[3]);
|
|
||||||
|
|
||||||
// have to write to ret as values are used to compute index
|
|
||||||
ret->xmm[0] = xmm0;
|
|
||||||
ret->xmm[1] = xmm1;
|
|
||||||
ret->xmm[2] = xmm2;
|
|
||||||
ret->xmm[3] = xmm3;
|
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
{
|
|
||||||
for (unsigned w = 0; w != NODE_WORDS; ++w) {
|
|
||||||
ret->words[w] = fnv_hash(ret->words[w], parent->words[w]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
SHA3_512(ret->bytes, ret->bytes, sizeof(node));
|
SHA3_512(ret->bytes, ret->bytes, sizeof(node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ethash_calculate_dag_item4_opt(
|
||||||
|
node* ret,
|
||||||
|
uint32_t node_index,
|
||||||
|
uint32_t num_parents,
|
||||||
|
ethash_light_t const light
|
||||||
|
)
|
||||||
|
{
|
||||||
|
node const* cache_nodes = (node const*)light->cache;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < 4; ++i) {
|
||||||
|
node const* init = &cache_nodes[fast_mod(node_index + i, light->num_parent_nodes, light->reciprocal, light->increment, light->shift)];
|
||||||
|
memcpy(ret + i, init, sizeof(node));
|
||||||
|
ret[i].words[0] ^= node_index + i;
|
||||||
|
SHA3_512(ret[i].bytes, ret[i].bytes, sizeof(node));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i != num_parents; ++i) {
|
||||||
|
node const* parent[4];
|
||||||
|
|
||||||
|
for (uint32_t j = 0; j < 4; ++j) {
|
||||||
|
const uint32_t parent_index = fast_mod(fnv_hash((node_index + j) ^ i, ret[j].words[i % NODE_WORDS]), light->num_parent_nodes, light->reciprocal, light->increment, light->shift);
|
||||||
|
parent[j] = &cache_nodes[parent_index];
|
||||||
|
kp_prefetch(parent[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned w = 0; w != NODE_WORDS; ++w) ret[0].words[w] = fnv_hash(ret[0].words[w], parent[0]->words[w]);
|
||||||
|
for (unsigned w = 0; w != NODE_WORDS; ++w) ret[1].words[w] = fnv_hash(ret[1].words[w], parent[1]->words[w]);
|
||||||
|
for (unsigned w = 0; w != NODE_WORDS; ++w) ret[2].words[w] = fnv_hash(ret[2].words[w], parent[2]->words[w]);
|
||||||
|
for (unsigned w = 0; w != NODE_WORDS; ++w) ret[3].words[w] = fnv_hash(ret[3].words[w], parent[3]->words[w]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < 4; ++i) {
|
||||||
|
SHA3_512(ret[i].bytes, ret[i].bytes, sizeof(node));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool ethash_compute_full_data(
|
bool ethash_compute_full_data(
|
||||||
void* mem,
|
void* mem,
|
||||||
uint64_t full_size,
|
uint64_t full_size,
|
||||||
|
|||||||
7
src/3rdparty/libethash/ethash_internal.h
vendored
7
src/3rdparty/libethash/ethash_internal.h
vendored
@@ -161,6 +161,13 @@ void ethash_calculate_dag_item_opt(
|
|||||||
ethash_light_t const cache
|
ethash_light_t const cache
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void ethash_calculate_dag_item4_opt(
|
||||||
|
node* ret,
|
||||||
|
uint32_t node_index,
|
||||||
|
uint32_t num_parents,
|
||||||
|
ethash_light_t const cache
|
||||||
|
);
|
||||||
|
|
||||||
void ethash_quick_hash(
|
void ethash_quick_hash(
|
||||||
ethash_h256_t* return_hash,
|
ethash_h256_t* return_hash,
|
||||||
ethash_h256_t const* header_hash,
|
ethash_h256_t const* header_hash,
|
||||||
|
|||||||
@@ -37,8 +37,6 @@
|
|||||||
#include "base/kernel/Platform.h"
|
#include "base/kernel/Platform.h"
|
||||||
#include "core/config/Config.h"
|
#include "core/config/Config.h"
|
||||||
#include "core/Controller.h"
|
#include "core/Controller.h"
|
||||||
#include "core/Miner.h"
|
|
||||||
#include "net/Network.h"
|
|
||||||
#include "Summary.h"
|
#include "Summary.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
@@ -107,7 +105,7 @@ void xmrig::App::onConsoleCommand(char command)
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_controller->miner()->execCommand(command);
|
m_controller->execCommand(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,11 +161,14 @@ static void print_commands(Config *)
|
|||||||
{
|
{
|
||||||
if (Log::isColors()) {
|
if (Log::isColors()) {
|
||||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BG(WHITE_BOLD_S "h") WHITE_BOLD("ashrate, ")
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BG(WHITE_BOLD_S "h") WHITE_BOLD("ashrate, ")
|
||||||
MAGENTA_BG(WHITE_BOLD_S "p") WHITE_BOLD("ause, ")
|
MAGENTA_BG(WHITE_BOLD_S "p") WHITE_BOLD("ause, ")
|
||||||
MAGENTA_BG(WHITE_BOLD_S "r") WHITE_BOLD("esume"));
|
MAGENTA_BG(WHITE_BOLD_S "r") WHITE_BOLD("esume, ")
|
||||||
|
WHITE_BOLD("re") MAGENTA_BG(WHITE_BOLD_S "s") WHITE_BOLD("ults, ")
|
||||||
|
MAGENTA_BG(WHITE_BOLD_S "c") WHITE_BOLD("onnection")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log::print(" * COMMANDS 'h' hashrate, 'p' pause, 'r' resume");
|
Log::print(" * COMMANDS 'h' hashrate, 'p' pause, 'r' resume, 's' results, 'c' connection");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,11 +47,6 @@ const char *cuda_tag();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef XMRIG_ALGO_RANDOMX
|
|
||||||
const char *rx_tag();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -139,11 +139,24 @@ inline bool xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Increment higher 32 bits of a 64-bit nonce when lower 32 bits overflow
|
// Increment higher 32 bits of a 64-bit nonce when lower 32 bits overflow
|
||||||
if (!currentJob().isNicehash() && (nonceSize() == sizeof(uint64_t)) && (*n < prev_nonce)) {
|
if (!currentJob().isNicehash() && (nonceSize() == sizeof(uint64_t))) {
|
||||||
++n[1];
|
const bool wrapped = (*n < prev_nonce);
|
||||||
|
const bool wraps_this_round = (static_cast<uint64_t>(*n) + roundSize > (1ULL << 32));
|
||||||
|
|
||||||
Job& job = m_jobs[index()];
|
// Account for the case when starting nonce hasn't wrapped yet, but some nonces in the current round will wrap
|
||||||
memcpy(job.blob(), blob(), job.size());
|
if (wrapped || wraps_this_round) {
|
||||||
|
// Set lower 32 bits to 0 when higher 32 bits change
|
||||||
|
Nonce::reset(index());
|
||||||
|
|
||||||
|
// Sets *n to 0 and Nonce::m_nonce[index] to the correct next value
|
||||||
|
*n = 0;
|
||||||
|
Nonce::next(index(), *n, rounds * roundSize, currentJob().isNicehash(), &ok);
|
||||||
|
|
||||||
|
++n[1];
|
||||||
|
|
||||||
|
Job& job = m_jobs[index()];
|
||||||
|
memcpy(job.blob(), blob(), job.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "crypto/common/Nonce.h"
|
#include "crypto/common/Nonce.h"
|
||||||
#include "crypto/common/VirtualMemory.h"
|
#include "crypto/common/VirtualMemory.h"
|
||||||
#include "crypto/rx/Rx.h"
|
#include "crypto/rx/Rx.h"
|
||||||
|
#include "crypto/rx/RxDataset.h"
|
||||||
#include "crypto/rx/RxVm.h"
|
#include "crypto/rx/RxVm.h"
|
||||||
#include "net/JobResults.h"
|
#include "net/JobResults.h"
|
||||||
|
|
||||||
@@ -118,7 +119,9 @@ void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_vm) {
|
if (!m_vm) {
|
||||||
m_vm = RxVm::create(dataset, m_memory->scratchpad(), !m_hwAES, m_assembly, m_node);
|
// Try to allocate scratchpad from dataset's 1 GB huge pages, if normal huge pages are not available
|
||||||
|
uint8_t* scratchpad = m_memory->isHugePages() ? m_memory->scratchpad() : dataset->tryAllocateScrathpad();
|
||||||
|
m_vm = RxVm::create(dataset, scratchpad ? scratchpad : m_memory->scratchpad(), !m_hwAES, m_assembly, m_node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ endif()
|
|||||||
|
|
||||||
if (XMRIG_ARM)
|
if (XMRIG_ARM)
|
||||||
list(APPEND SOURCES_CPUID src/backend/cpu/platform/BasicCpuInfo_arm.cpp)
|
list(APPEND SOURCES_CPUID src/backend/cpu/platform/BasicCpuInfo_arm.cpp)
|
||||||
|
|
||||||
|
if (XMRIG_OS_UNIX)
|
||||||
|
list(APPEND SOURCES_CPUID src/backend/cpu/platform/lscpu_arm.cpp)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
list(APPEND SOURCES_CPUID src/backend/cpu/platform/BasicCpuInfo.cpp)
|
list(APPEND SOURCES_CPUID src/backend/cpu/platform/BasicCpuInfo.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "backend/cpu/CpuThreads.h"
|
#include "backend/cpu/CpuThreads.h"
|
||||||
#include "base/crypto/Algorithm.h"
|
#include "base/crypto/Algorithm.h"
|
||||||
|
#include "base/tools/Object.h"
|
||||||
#include "crypto/common/Assembly.h"
|
#include "crypto/common/Assembly.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +38,8 @@ namespace xmrig {
|
|||||||
class ICpuInfo
|
class ICpuInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
XMRIG_DISABLE_COPY_MOVE(ICpuInfo)
|
||||||
|
|
||||||
enum Vendor : uint32_t {
|
enum Vendor : uint32_t {
|
||||||
VENDOR_UNKNOWN,
|
VENDOR_UNKNOWN,
|
||||||
VENDOR_INTEL,
|
VENDOR_INTEL,
|
||||||
@@ -62,9 +65,11 @@ public:
|
|||||||
FLAG_SSSE3,
|
FLAG_SSSE3,
|
||||||
FLAG_XOP,
|
FLAG_XOP,
|
||||||
FLAG_POPCNT,
|
FLAG_POPCNT,
|
||||||
|
FLAG_CAT_L3,
|
||||||
FLAG_MAX
|
FLAG_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ICpuInfo() = default;
|
||||||
virtual ~ICpuInfo() = default;
|
virtual ~ICpuInfo() = default;
|
||||||
|
|
||||||
# if defined(__x86_64__) || defined(_M_AMD64) || defined (__arm64__) || defined (__aarch64__)
|
# if defined(__x86_64__) || defined(_M_AMD64) || defined (__arm64__) || defined (__aarch64__)
|
||||||
@@ -79,6 +84,7 @@ public:
|
|||||||
virtual bool hasAVX2() const = 0;
|
virtual bool hasAVX2() const = 0;
|
||||||
virtual bool hasBMI2() const = 0;
|
virtual bool hasBMI2() const = 0;
|
||||||
virtual bool hasOneGbPages() const = 0;
|
virtual bool hasOneGbPages() const = 0;
|
||||||
|
virtual bool hasCatL3() const = 0;
|
||||||
virtual const char *backend() const = 0;
|
virtual const char *backend() const = 0;
|
||||||
virtual const char *brand() const = 0;
|
virtual const char *brand() const = 0;
|
||||||
virtual CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const = 0;
|
virtual CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const = 0;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
static const std::array<const char *, ICpuInfo::FLAG_MAX> flagNames = { "aes", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "xop", "popcnt" };
|
static const std::array<const char *, ICpuInfo::FLAG_MAX> flagNames = { "aes", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "xop", "popcnt", "cat_l3" };
|
||||||
static const std::array<const char *, ICpuInfo::MSR_MOD_MAX> msrNames = { "none", "ryzen", "intel", "custom" };
|
static const std::array<const char *, ICpuInfo::MSR_MOD_MAX> msrNames = { "none", "ryzen", "intel", "custom" };
|
||||||
|
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ static inline void cpuid(uint32_t level, int32_t output[4])
|
|||||||
memset(output, 0, sizeof(int32_t) * 4);
|
memset(output, 0, sizeof(int32_t) * 4);
|
||||||
|
|
||||||
# ifdef _MSC_VER
|
# ifdef _MSC_VER
|
||||||
__cpuid(output, static_cast<int>(level));
|
__cpuidex(output, static_cast<int>(level), 0);
|
||||||
# else
|
# else
|
||||||
__cpuid_count(level, 0, output[0], output[1], output[2], output[3]);
|
__cpuid_count(level, 0, output[0], output[1], output[2], output[3]);
|
||||||
# endif
|
# endif
|
||||||
@@ -143,6 +143,7 @@ static inline bool has_sse2() { return has_feature(PROCESSOR_INFO,
|
|||||||
static inline bool has_ssse3() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 9); }
|
static inline bool has_ssse3() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 9); }
|
||||||
static inline bool has_xop() { return has_feature(0x80000001, ECX_Reg, 1 << 11); }
|
static inline bool has_xop() { return has_feature(0x80000001, ECX_Reg, 1 << 11); }
|
||||||
static inline bool has_popcnt() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 23); }
|
static inline bool has_popcnt() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 23); }
|
||||||
|
static inline bool has_cat_l3() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 15) && has_feature(0x10, EBX_Reg, 1 << 1); }
|
||||||
|
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
@@ -178,6 +179,7 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
|
|||||||
m_flags.set(FLAG_SSSE3, has_ssse3());
|
m_flags.set(FLAG_SSSE3, has_ssse3());
|
||||||
m_flags.set(FLAG_XOP, has_xop());
|
m_flags.set(FLAG_XOP, has_xop());
|
||||||
m_flags.set(FLAG_POPCNT, has_popcnt());
|
m_flags.set(FLAG_POPCNT, has_popcnt());
|
||||||
|
m_flags.set(FLAG_CAT_L3, has_cat_l3());
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_ASM
|
# ifdef XMRIG_FEATURE_ASM
|
||||||
if (hasAES()) {
|
if (hasAES()) {
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ protected:
|
|||||||
inline bool hasAVX2() const override { return has(FLAG_AVX2); }
|
inline bool hasAVX2() const override { return has(FLAG_AVX2); }
|
||||||
inline bool hasBMI2() const override { return has(FLAG_BMI2); }
|
inline bool hasBMI2() const override { return has(FLAG_BMI2); }
|
||||||
inline bool hasOneGbPages() const override { return has(FLAG_PDPE1GB); }
|
inline bool hasOneGbPages() const override { return has(FLAG_PDPE1GB); }
|
||||||
|
inline bool hasCatL3() const override { return has(FLAG_CAT_L3); }
|
||||||
inline const char *brand() const override { return m_brand; }
|
inline const char *brand() const override { return m_brand; }
|
||||||
inline MsrMod msrMod() const override { return m_msrMod; }
|
inline MsrMod msrMod() const override { return m_msrMod; }
|
||||||
inline size_t cores() const override { return 0; }
|
inline size_t cores() const override { return 0; }
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
|
||||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
|
||||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
|
||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||||
*
|
*
|
||||||
@@ -22,6 +16,10 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "base/tools/String.h"
|
||||||
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
@@ -37,6 +35,15 @@
|
|||||||
#include "3rdparty/rapidjson/document.h"
|
#include "3rdparty/rapidjson/document.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_OS_UNIX
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
extern String cpu_name_arm();
|
||||||
|
|
||||||
|
} // namespace xmrig
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
xmrig::BasicCpuInfo::BasicCpuInfo() :
|
xmrig::BasicCpuInfo::BasicCpuInfo() :
|
||||||
m_threads(std::thread::hardware_concurrency())
|
m_threads(std::thread::hardware_concurrency())
|
||||||
{
|
{
|
||||||
@@ -53,6 +60,13 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
|
|||||||
m_flags.set(FLAG_AES, true);
|
m_flags.set(FLAG_AES, true);
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_OS_UNIX
|
||||||
|
auto name = cpu_name_arm();
|
||||||
|
if (!name.isNull()) {
|
||||||
|
strncpy(m_brand, name, sizeof(m_brand) - 1);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -218,10 +218,11 @@ xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint3
|
|||||||
{
|
{
|
||||||
# ifdef XMRIG_ALGO_ASTROBWT
|
# ifdef XMRIG_ALGO_ASTROBWT
|
||||||
if (algorithm == Algorithm::ASTROBWT_DERO) {
|
if (algorithm == Algorithm::ASTROBWT_DERO) {
|
||||||
return BasicCpuInfo::threads(algorithm, limit);
|
return allThreads(algorithm, limit);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifndef XMRIG_ARM
|
||||||
if (L2() == 0 && L3() == 0) {
|
if (L2() == 0 && L3() == 0) {
|
||||||
return BasicCpuInfo::threads(algorithm, limit);
|
return BasicCpuInfo::threads(algorithm, limit);
|
||||||
}
|
}
|
||||||
@@ -263,11 +264,35 @@ xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint3
|
|||||||
}
|
}
|
||||||
|
|
||||||
return threads;
|
return threads;
|
||||||
|
# else
|
||||||
|
return allThreads(algorithm, limit);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xmrig::CpuThreads xmrig::HwlocCpuInfo::allThreads(const Algorithm &algorithm, uint32_t limit) const
|
||||||
|
{
|
||||||
|
CpuThreads threads;
|
||||||
|
threads.reserve(m_threads);
|
||||||
|
|
||||||
|
hwloc_obj_t pu = nullptr;
|
||||||
|
|
||||||
|
while ((pu = hwloc_get_next_obj_by_type(m_topology, HWLOC_OBJ_PU, pu)) != nullptr) {
|
||||||
|
threads.add(pu->os_index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (threads.isEmpty()) {
|
||||||
|
return BasicCpuInfo::threads(algorithm, limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
return threads;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const
|
void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const
|
||||||
{
|
{
|
||||||
|
# ifndef XMRIG_ARM
|
||||||
constexpr size_t oneMiB = 1024U * 1024U;
|
constexpr size_t oneMiB = 1024U * 1024U;
|
||||||
|
|
||||||
size_t PUs = countByType(cache, HWLOC_OBJ_PU);
|
size_t PUs = countByType(cache, HWLOC_OBJ_PU);
|
||||||
@@ -366,4 +391,5 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
|||||||
|
|
||||||
pu_id++;
|
pu_id++;
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ protected:
|
|||||||
inline size_t packages() const override { return m_packages; }
|
inline size_t packages() const override { return m_packages; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CpuThreads allThreads(const Algorithm &algorithm, uint32_t limit) const;
|
||||||
void processTopLevelCache(hwloc_obj_t obj, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const;
|
void processTopLevelCache(hwloc_obj_t obj, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
314
src/backend/cpu/platform/lscpu_arm.cpp
Normal file
314
src/backend/cpu/platform/lscpu_arm.cpp
Normal file
@@ -0,0 +1,314 @@
|
|||||||
|
/* XMRig
|
||||||
|
* Copyright 2018 Riku Voipio <riku.voipio@iki.fi>
|
||||||
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
|
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "base/tools/String.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
struct lscpu_desc
|
||||||
|
{
|
||||||
|
String vendor;
|
||||||
|
String model;
|
||||||
|
|
||||||
|
inline bool isReady() const { return !vendor.isNull() && !model.isNull(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct id_part {
|
||||||
|
const int id;
|
||||||
|
const char *name;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct hw_impl {
|
||||||
|
const int id;
|
||||||
|
const id_part *parts;
|
||||||
|
const char *name;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const id_part arm_part[] = {
|
||||||
|
{ 0x810, "ARM810" },
|
||||||
|
{ 0x920, "ARM920" },
|
||||||
|
{ 0x922, "ARM922" },
|
||||||
|
{ 0x926, "ARM926" },
|
||||||
|
{ 0x940, "ARM940" },
|
||||||
|
{ 0x946, "ARM946" },
|
||||||
|
{ 0x966, "ARM966" },
|
||||||
|
{ 0xa20, "ARM1020" },
|
||||||
|
{ 0xa22, "ARM1022" },
|
||||||
|
{ 0xa26, "ARM1026" },
|
||||||
|
{ 0xb02, "ARM11 MPCore" },
|
||||||
|
{ 0xb36, "ARM1136" },
|
||||||
|
{ 0xb56, "ARM1156" },
|
||||||
|
{ 0xb76, "ARM1176" },
|
||||||
|
{ 0xc05, "Cortex-A5" },
|
||||||
|
{ 0xc07, "Cortex-A7" },
|
||||||
|
{ 0xc08, "Cortex-A8" },
|
||||||
|
{ 0xc09, "Cortex-A9" },
|
||||||
|
{ 0xc0d, "Cortex-A17" }, /* Originally A12 */
|
||||||
|
{ 0xc0f, "Cortex-A15" },
|
||||||
|
{ 0xc0e, "Cortex-A17" },
|
||||||
|
{ 0xc14, "Cortex-R4" },
|
||||||
|
{ 0xc15, "Cortex-R5" },
|
||||||
|
{ 0xc17, "Cortex-R7" },
|
||||||
|
{ 0xc18, "Cortex-R8" },
|
||||||
|
{ 0xc20, "Cortex-M0" },
|
||||||
|
{ 0xc21, "Cortex-M1" },
|
||||||
|
{ 0xc23, "Cortex-M3" },
|
||||||
|
{ 0xc24, "Cortex-M4" },
|
||||||
|
{ 0xc27, "Cortex-M7" },
|
||||||
|
{ 0xc60, "Cortex-M0+" },
|
||||||
|
{ 0xd01, "Cortex-A32" },
|
||||||
|
{ 0xd03, "Cortex-A53" },
|
||||||
|
{ 0xd04, "Cortex-A35" },
|
||||||
|
{ 0xd05, "Cortex-A55" },
|
||||||
|
{ 0xd07, "Cortex-A57" },
|
||||||
|
{ 0xd08, "Cortex-A72" },
|
||||||
|
{ 0xd09, "Cortex-A73" },
|
||||||
|
{ 0xd0a, "Cortex-A75" },
|
||||||
|
{ 0xd0b, "Cortex-A76" },
|
||||||
|
{ 0xd0c, "Neoverse-N1" },
|
||||||
|
{ 0xd13, "Cortex-R52" },
|
||||||
|
{ 0xd20, "Cortex-M23" },
|
||||||
|
{ 0xd21, "Cortex-M33" },
|
||||||
|
{ 0xd4a, "Neoverse-E1" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part brcm_part[] = {
|
||||||
|
{ 0x0f, "Brahma B15" },
|
||||||
|
{ 0x100, "Brahma B53" },
|
||||||
|
{ 0x516, "ThunderX2" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part dec_part[] = {
|
||||||
|
{ 0xa10, "SA110" },
|
||||||
|
{ 0xa11, "SA1100" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part cavium_part[] = {
|
||||||
|
{ 0x0a0, "ThunderX" },
|
||||||
|
{ 0x0a1, "ThunderX 88XX" },
|
||||||
|
{ 0x0a2, "ThunderX 81XX" },
|
||||||
|
{ 0x0a3, "ThunderX 83XX" },
|
||||||
|
{ 0x0af, "ThunderX2 99xx" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part apm_part[] = {
|
||||||
|
{ 0x000, "X-Gene" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part qcom_part[] = {
|
||||||
|
{ 0x00f, "Scorpion" },
|
||||||
|
{ 0x02d, "Scorpion" },
|
||||||
|
{ 0x04d, "Krait" },
|
||||||
|
{ 0x06f, "Krait" },
|
||||||
|
{ 0x201, "Kryo" },
|
||||||
|
{ 0x205, "Kryo" },
|
||||||
|
{ 0x211, "Kryo" },
|
||||||
|
{ 0x800, "Falkor V1/Kryo" },
|
||||||
|
{ 0x801, "Kryo V2" },
|
||||||
|
{ 0xc00, "Falkor" },
|
||||||
|
{ 0xc01, "Saphira" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part samsung_part[] = {
|
||||||
|
{ 0x001, "exynos-m1" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part nvidia_part[] = {
|
||||||
|
{ 0x000, "Denver" },
|
||||||
|
{ 0x003, "Denver 2" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part marvell_part[] = {
|
||||||
|
{ 0x131, "Feroceon 88FR131" },
|
||||||
|
{ 0x581, "PJ4/PJ4b" },
|
||||||
|
{ 0x584, "PJ4B-MP" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part faraday_part[] = {
|
||||||
|
{ 0x526, "FA526" },
|
||||||
|
{ 0x626, "FA626" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part intel_part[] = {
|
||||||
|
{ 0x200, "i80200" },
|
||||||
|
{ 0x210, "PXA250A" },
|
||||||
|
{ 0x212, "PXA210A" },
|
||||||
|
{ 0x242, "i80321-400" },
|
||||||
|
{ 0x243, "i80321-600" },
|
||||||
|
{ 0x290, "PXA250B/PXA26x" },
|
||||||
|
{ 0x292, "PXA210B" },
|
||||||
|
{ 0x2c2, "i80321-400-B0" },
|
||||||
|
{ 0x2c3, "i80321-600-B0" },
|
||||||
|
{ 0x2d0, "PXA250C/PXA255/PXA26x" },
|
||||||
|
{ 0x2d2, "PXA210C" },
|
||||||
|
{ 0x411, "PXA27x" },
|
||||||
|
{ 0x41c, "IPX425-533" },
|
||||||
|
{ 0x41d, "IPX425-400" },
|
||||||
|
{ 0x41f, "IPX425-266" },
|
||||||
|
{ 0x682, "PXA32x" },
|
||||||
|
{ 0x683, "PXA930/PXA935" },
|
||||||
|
{ 0x688, "PXA30x" },
|
||||||
|
{ 0x689, "PXA31x" },
|
||||||
|
{ 0xb11, "SA1110" },
|
||||||
|
{ 0xc12, "IPX1200" },
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
static const id_part hisi_part[] = {
|
||||||
|
{ 0xd01, "Kunpeng-920" }, /* aka tsv110 */
|
||||||
|
{ -1, nullptr },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const hw_impl hw_implementer[] = {
|
||||||
|
{ 0x41, arm_part, "ARM" },
|
||||||
|
{ 0x42, brcm_part, "Broadcom" },
|
||||||
|
{ 0x43, cavium_part, "Cavium" },
|
||||||
|
{ 0x44, dec_part, "DEC" },
|
||||||
|
{ 0x48, hisi_part, "HiSilicon" },
|
||||||
|
{ 0x4e, nvidia_part, "Nvidia" },
|
||||||
|
{ 0x50, apm_part, "APM" },
|
||||||
|
{ 0x51, qcom_part, "Qualcomm" },
|
||||||
|
{ 0x53, samsung_part, "Samsung" },
|
||||||
|
{ 0x56, marvell_part, "Marvell" },
|
||||||
|
{ 0x66, faraday_part, "Faraday" },
|
||||||
|
{ 0x69, intel_part, "Intel" }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static bool lookup(char *line, const char *pattern, String &value)
|
||||||
|
{
|
||||||
|
if (!*line || !value.isNull()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *p;
|
||||||
|
int len = strlen(pattern);
|
||||||
|
|
||||||
|
if (strncmp(line, pattern, len) != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = line + len; isspace(*p); p++);
|
||||||
|
|
||||||
|
if (*p != ':') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (++p; isspace(*p); p++);
|
||||||
|
|
||||||
|
if (!*p) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *v = p;
|
||||||
|
|
||||||
|
len = strlen(line) - 1;
|
||||||
|
for (p = line + len; isspace(*(p-1)); p--);
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
value = v;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool read_basicinfo(lscpu_desc *desc)
|
||||||
|
{
|
||||||
|
auto fp = fopen("/proc/cpuinfo", "r");
|
||||||
|
if (!fp) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
char buf[BUFSIZ];
|
||||||
|
while (fgets(buf, sizeof(buf), fp) != nullptr) {
|
||||||
|
if (!lookup(buf, "CPU implementer", desc->vendor)) {
|
||||||
|
lookup(buf, "CPU part", desc->model);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (desc->isReady()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
|
return desc->isReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool arm_cpu_decode(lscpu_desc *desc)
|
||||||
|
{
|
||||||
|
if ((strncmp(desc->vendor, "0x", 2) != 0 || strncmp(desc->model, "0x", 2) != 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int vendor = strtol(desc->vendor, nullptr, 0);
|
||||||
|
const int model = strtol(desc->model, nullptr, 0);
|
||||||
|
|
||||||
|
for (const auto &impl : hw_implementer) {
|
||||||
|
if (impl.id != vendor) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; impl.parts[i].id != -1; ++i) {
|
||||||
|
if (impl.parts[i].id == model) {
|
||||||
|
desc->model = impl.parts[i].name;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String cpu_name_arm()
|
||||||
|
{
|
||||||
|
lscpu_desc desc;
|
||||||
|
if (read_basicinfo(&desc) && arm_cpu_decode(&desc)) {
|
||||||
|
return desc.model;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace xmrig
|
||||||
@@ -152,7 +152,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!CudaLib::init(cuda.loader())) {
|
if (!CudaLib::init(cuda.loader())) {
|
||||||
return printDisabled(kLabel, RED_S " (failed to load CUDA plugin)");
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled ") RED("(%s)"), kLabel, CudaLib::lastError());
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeVersion = CudaLib::runtimeVersion();
|
runtimeVersion = CudaLib::runtimeVersion();
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_CUDA)
|
||||||
|
message(WARNING "CUDA backend is not compatible with static build, use -DWITH_CUDA=OFF to suppress this warning")
|
||||||
|
|
||||||
|
set(WITH_CUDA OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WITH_CUDA)
|
if (WITH_CUDA)
|
||||||
add_definitions(/DXMRIG_FEATURE_CUDA)
|
add_definitions(/DXMRIG_FEATURE_CUDA)
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "backend/cuda/wrappers/CudaLib.h"
|
#include "backend/cuda/wrappers/CudaLib.h"
|
||||||
#include "base/io/Env.h"
|
#include "base/io/Env.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
|
#include "base/kernel/Process.h"
|
||||||
#include "crypto/rx/RxAlgo.h"
|
#include "crypto/rx/RxAlgo.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -46,6 +47,14 @@ enum Version : uint32_t
|
|||||||
|
|
||||||
static uv_lib_t cudaLib;
|
static uv_lib_t cudaLib;
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
static String defaultLoader = "/System/Library/Frameworks/OpenCL.framework/OpenCL";
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
static String defaultLoader = "xmrig-cuda.dll";
|
||||||
|
#else
|
||||||
|
static String defaultLoader = "libxmrig-cuda.so";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const char *kAlloc = "alloc";
|
static const char *kAlloc = "alloc";
|
||||||
static const char *kAstroBWTHash = "astroBWTHash";
|
static const char *kAstroBWTHash = "astroBWTHash";
|
||||||
@@ -125,11 +134,12 @@ static setJob_v2_t pSetJob_v2 = nullptr;
|
|||||||
static version_t pVersion = nullptr;
|
static version_t pVersion = nullptr;
|
||||||
|
|
||||||
|
|
||||||
#define DLSYM(x) if (uv_dlsym(&cudaLib, k##x, reinterpret_cast<void**>(&p##x)) == -1) { throw std::runtime_error("symbol not found (" #x ")"); }
|
#define DLSYM(x) if (uv_dlsym(&cudaLib, k##x, reinterpret_cast<void**>(&p##x)) == -1) { throw std::runtime_error(std::string("symbol not found: ") + k##x); }
|
||||||
|
|
||||||
|
|
||||||
bool CudaLib::m_initialized = false;
|
bool CudaLib::m_initialized = false;
|
||||||
bool CudaLib::m_ready = false;
|
bool CudaLib::m_ready = false;
|
||||||
|
String CudaLib::m_error;
|
||||||
String CudaLib::m_loader;
|
String CudaLib::m_loader;
|
||||||
|
|
||||||
|
|
||||||
@@ -139,9 +149,22 @@ String CudaLib::m_loader;
|
|||||||
bool xmrig::CudaLib::init(const char *fileName)
|
bool xmrig::CudaLib::init(const char *fileName)
|
||||||
{
|
{
|
||||||
if (!m_initialized) {
|
if (!m_initialized) {
|
||||||
m_loader = fileName == nullptr ? defaultLoader() : Env::expand(fileName);
|
|
||||||
m_ready = uv_dlopen(m_loader, &cudaLib) == 0 && load();
|
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
|
m_loader = fileName == nullptr ? defaultLoader : Env::expand(fileName);
|
||||||
|
|
||||||
|
if (!open()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
load();
|
||||||
|
} catch (std::exception &ex) {
|
||||||
|
m_error = (std::string(m_loader) + ": " + ex.what()).c_str();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_ready;
|
return m_ready;
|
||||||
@@ -150,7 +173,7 @@ bool xmrig::CudaLib::init(const char *fileName)
|
|||||||
|
|
||||||
const char *xmrig::CudaLib::lastError() noexcept
|
const char *xmrig::CudaLib::lastError() noexcept
|
||||||
{
|
{
|
||||||
return uv_dlerror(&cudaLib);
|
return m_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -344,66 +367,70 @@ void xmrig::CudaLib::release(nvid_ctx *ctx) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::CudaLib::load()
|
bool xmrig::CudaLib::open()
|
||||||
{
|
{
|
||||||
if (uv_dlsym(&cudaLib, kVersion, reinterpret_cast<void**>(&pVersion)) == -1) {
|
m_error = nullptr;
|
||||||
|
|
||||||
|
if (uv_dlopen(m_loader, &cudaLib) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_OS_LINUX
|
||||||
|
if (m_loader == defaultLoader) {
|
||||||
|
m_loader = Process::location(Process::ExeLocation, m_loader);
|
||||||
|
}
|
||||||
|
else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (uv_dlopen(m_loader, &cudaLib) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
m_error = uv_dlerror(&cudaLib);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void xmrig::CudaLib::load()
|
||||||
|
{
|
||||||
|
DLSYM(Version);
|
||||||
|
|
||||||
if (pVersion(ApiVersion) != 3U) {
|
if (pVersion(ApiVersion) != 3U) {
|
||||||
return false;
|
throw std::runtime_error("API version mismatch");
|
||||||
}
|
}
|
||||||
|
|
||||||
uv_dlsym(&cudaLib, kDeviceInfo_v2, reinterpret_cast<void**>(&pDeviceInfo_v2));
|
DLSYM(Alloc);
|
||||||
uv_dlsym(&cudaLib, kSetJob_v2, reinterpret_cast<void**>(&pSetJob_v2));
|
DLSYM(CnHash);
|
||||||
|
DLSYM(DeviceCount);
|
||||||
|
DLSYM(DeviceInit);
|
||||||
|
DLSYM(DeviceInt);
|
||||||
|
DLSYM(DeviceName);
|
||||||
|
DLSYM(DeviceUint);
|
||||||
|
DLSYM(DeviceUlong);
|
||||||
|
DLSYM(Init);
|
||||||
|
DLSYM(LastError);
|
||||||
|
DLSYM(PluginVersion);
|
||||||
|
DLSYM(Release);
|
||||||
|
DLSYM(RxHash);
|
||||||
|
DLSYM(RxPrepare);
|
||||||
|
DLSYM(AstroBWTHash);
|
||||||
|
DLSYM(AstroBWTPrepare);
|
||||||
|
DLSYM(KawPowHash);
|
||||||
|
DLSYM(KawPowPrepare_v2);
|
||||||
|
DLSYM(KawPowStopHash);
|
||||||
|
|
||||||
try {
|
uv_dlsym(&cudaLib, kDeviceInfo_v2, reinterpret_cast<void**>(&pDeviceInfo_v2));
|
||||||
DLSYM(Alloc);
|
if (!pDeviceInfo_v2) {
|
||||||
DLSYM(CnHash);
|
DLSYM(DeviceInfo);
|
||||||
DLSYM(DeviceCount);
|
}
|
||||||
DLSYM(DeviceInit);
|
|
||||||
DLSYM(DeviceInt);
|
|
||||||
DLSYM(DeviceName);
|
|
||||||
DLSYM(DeviceUint);
|
|
||||||
DLSYM(DeviceUlong);
|
|
||||||
DLSYM(Init);
|
|
||||||
DLSYM(LastError);
|
|
||||||
DLSYM(PluginVersion);
|
|
||||||
DLSYM(Release);
|
|
||||||
DLSYM(RxHash);
|
|
||||||
DLSYM(RxPrepare);
|
|
||||||
DLSYM(AstroBWTHash);
|
|
||||||
DLSYM(AstroBWTPrepare);
|
|
||||||
DLSYM(KawPowHash);
|
|
||||||
DLSYM(KawPowPrepare_v2);
|
|
||||||
DLSYM(KawPowStopHash);
|
|
||||||
DLSYM(Version);
|
|
||||||
|
|
||||||
if (!pDeviceInfo_v2) {
|
uv_dlsym(&cudaLib, kSetJob_v2, reinterpret_cast<void**>(&pSetJob_v2));
|
||||||
DLSYM(DeviceInfo);
|
if (!pSetJob_v2) {
|
||||||
}
|
DLSYM(SetJob);
|
||||||
|
|
||||||
if (!pSetJob_v2) {
|
|
||||||
DLSYM(SetJob);
|
|
||||||
}
|
|
||||||
} catch (std::exception &ex) {
|
|
||||||
LOG_ERR("Error loading CUDA library: %s", ex.what());
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pInit();
|
pInit();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
xmrig::String xmrig::CudaLib::defaultLoader()
|
|
||||||
{
|
|
||||||
# if defined(__APPLE__)
|
|
||||||
return "/System/Library/Frameworks/OpenCL.framework/OpenCL"; // FIXME
|
|
||||||
# elif defined(_WIN32)
|
|
||||||
return "xmrig-cuda.dll";
|
|
||||||
# else
|
|
||||||
return "libxmrig-cuda.so";
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,11 +99,12 @@ public:
|
|||||||
static void release(nvid_ctx *ctx) noexcept;
|
static void release(nvid_ctx *ctx) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool load();
|
static bool open();
|
||||||
static String defaultLoader();
|
static void load();
|
||||||
|
|
||||||
static bool m_initialized;
|
static bool m_initialized;
|
||||||
static bool m_ready;
|
static bool m_ready;
|
||||||
|
static String m_error;
|
||||||
static String m_loader;
|
static String m_loader;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ __kernel void filter(uint32_t nonce, uint32_t bwt_max_size, __global const uint3
|
|||||||
|
|
||||||
filtered_hashes[index] = nonce + global_id;
|
filtered_hashes[index] = nonce + global_id;
|
||||||
|
|
||||||
#pragma unroll(8)
|
#pragma unroll 8
|
||||||
for (uint32_t i = 0; i < 8; ++i)
|
for (uint32_t i = 0; i < 8; ++i)
|
||||||
filtered_hashes[index + i + 1] = hash[i];
|
filtered_hashes[index + i + 1] = hash[i];
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ __kernel void prepare_batch2(__global uint32_t* hashes, __global uint32_t* filte
|
|||||||
const uint32_t stage2_size = STAGE1_SIZE + (filtered_hash[1] & 0xfffff);
|
const uint32_t stage2_size = STAGE1_SIZE + (filtered_hash[1] & 0xfffff);
|
||||||
data_sizes[global_id] = stage2_size;
|
data_sizes[global_id] = stage2_size;
|
||||||
|
|
||||||
#pragma unroll(8)
|
#pragma unroll 8
|
||||||
for (uint32_t i = 0; i < 8; ++i)
|
for (uint32_t i = 0; i < 8; ++i)
|
||||||
hash[i] = filtered_hash[i + 1];
|
hash[i] = filtered_hash[i + 1];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
static const char astrobwt_cl[12440] = {
|
static const char astrobwt_cl[12434] = {
|
||||||
0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,
|
0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,
|
||||||
0x73,0x68,0x6f,0x72,0x74,0x20,0x75,0x69,0x6e,0x74,0x31,0x36,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x69,0x6e,0x74,0x20,0x75,0x69,0x6e,
|
0x73,0x68,0x6f,0x72,0x74,0x20,0x75,0x69,0x6e,0x74,0x31,0x36,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x69,0x6e,0x74,0x20,0x75,0x69,0x6e,
|
||||||
0x74,0x33,0x32,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6c,0x6f,0x6e,0x67,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x3b,0x0a,0x74,
|
0x74,0x33,0x32,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6c,0x6f,0x6e,0x67,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x3b,0x0a,0x74,
|
||||||
@@ -119,279 +119,279 @@ static const char astrobwt_cl[12440] = {
|
|||||||
0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x2c,0x31,0x29,0x2a,0x28,0x33,0x36,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,
|
0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x2c,0x31,0x29,0x2a,0x28,0x33,0x36,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,
|
||||||
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x29,0x2b,0x31,0x3b,0x0a,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x69,0x6e,0x64,
|
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x29,0x2b,0x31,0x3b,0x0a,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x69,0x6e,0x64,
|
||||||
0x65,0x78,0x5d,0x3d,0x6e,0x6f,0x6e,0x63,0x65,0x2b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,
|
0x65,0x78,0x5d,0x3d,0x6e,0x6f,0x6e,0x63,0x65,0x2b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,
|
||||||
0x6f,0x6c,0x6c,0x28,0x38,0x29,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x38,0x3b,0x20,0x2b,
|
0x6f,0x6c,0x6c,0x20,0x38,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x38,0x3b,0x20,0x2b,0x2b,
|
||||||
0x2b,0x69,0x29,0x0a,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x69,0x6e,0x64,0x65,0x78,0x2b,0x69,0x2b,0x31,0x5d,0x3d,0x68,
|
0x69,0x29,0x0a,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x69,0x6e,0x64,0x65,0x78,0x2b,0x69,0x2b,0x31,0x5d,0x3d,0x68,0x61,
|
||||||
0x61,0x73,0x68,0x5b,0x69,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x70,0x72,0x65,0x70,0x61,0x72,
|
0x73,0x68,0x5b,0x69,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x70,0x72,0x65,0x70,0x61,0x72,0x65,
|
||||||
0x65,0x5f,0x62,0x61,0x74,0x63,0x68,0x32,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,
|
0x5f,0x62,0x61,0x74,0x63,0x68,0x32,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,
|
||||||
0x65,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,
|
0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,
|
||||||
0x61,0x73,0x68,0x65,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x64,0x61,0x74,0x61,0x5f,0x73,0x69,
|
0x73,0x68,0x65,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x64,0x61,0x74,0x61,0x5f,0x73,0x69,0x7a,
|
||||||
0x7a,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x3d,
|
0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x3d,0x67,
|
||||||
0x67,0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
0x20,0x4e,0x3d,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x30,0x5d,0x2d,0x67,0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
0x4e,0x3d,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x30,0x5d,0x2d,0x67,0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,
|
||||||
0x5f,0x73,0x69,0x7a,0x65,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x3d,0x3d,0x30,0x29,0x0a,0x66,0x69,0x6c,0x74,0x65,
|
0x73,0x69,0x7a,0x65,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x3d,0x3d,0x30,0x29,0x0a,0x66,0x69,0x6c,0x74,0x65,0x72,
|
||||||
0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x30,0x5d,0x3d,0x4e,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,
|
0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x30,0x5d,0x3d,0x4e,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
||||||
0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x3d,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x2a,0x38,0x3b,0x0a,0x5f,0x5f,0x67,
|
0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x3d,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x2a,0x38,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,
|
||||||
0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x3d,0x66,0x69,
|
0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x3d,0x66,0x69,0x6c,
|
||||||
0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x28,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x2b,0x4e,0x29,0x2a,0x39,0x2b,0x31,0x3b,
|
0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x28,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x2b,0x4e,0x29,0x2a,0x39,0x2b,0x31,0x3b,0x0a,
|
||||||
0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x32,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x53,0x54,0x41,0x47,
|
0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x32,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x53,0x54,0x41,0x47,0x45,
|
||||||
0x45,0x31,0x5f,0x53,0x49,0x5a,0x45,0x2b,0x28,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x5b,0x31,0x5d,0x26,0x30,0x78,0x66,0x66,0x66,0x66,
|
0x31,0x5f,0x53,0x49,0x5a,0x45,0x2b,0x28,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x5b,0x31,0x5d,0x26,0x30,0x78,0x66,0x66,0x66,0x66,0x66,
|
||||||
0x66,0x29,0x3b,0x0a,0x64,0x61,0x74,0x61,0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x5d,0x3d,0x73,0x74,0x61,0x67,0x65,0x32,
|
0x29,0x3b,0x0a,0x64,0x61,0x74,0x61,0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x5d,0x3d,0x73,0x74,0x61,0x67,0x65,0x32,0x5f,
|
||||||
0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x28,0x38,0x29,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,
|
0x73,0x69,0x7a,0x65,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x38,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,
|
||||||
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x38,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x68,0x61,0x73,0x68,0x5b,0x69,0x5d,0x3d,0x66,0x69,
|
0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x38,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x68,0x61,0x73,0x68,0x5b,0x69,0x5d,0x3d,0x66,0x69,0x6c,0x74,
|
||||||
0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x5b,0x69,0x2b,0x31,0x5d,0x3b,0x0a,0x7d,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,
|
0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x5b,0x69,0x2b,0x31,0x5d,0x3b,0x0a,0x7d,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,
|
||||||
0x64,0x20,0x66,0x69,0x6e,0x64,0x5f,0x73,0x68,0x61,0x72,0x65,0x73,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,
|
0x66,0x69,0x6e,0x64,0x5f,0x73,0x68,0x61,0x72,0x65,0x73,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,
|
||||||
0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,
|
0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,
|
||||||
0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,
|
0x32,0x5f,0x74,0x2a,0x20,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x74,0x61,
|
||||||
0x74,0x61,0x72,0x67,0x65,0x74,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x73,0x68,0x61,0x72,0x65,0x73,
|
0x72,0x67,0x65,0x74,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x73,0x68,0x61,0x72,0x65,0x73,0x29,0x0a,
|
||||||
0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3d,
|
0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3d,0x67,0x65,
|
||||||
0x67,0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x67,0x6c,0x6f,0x62,
|
0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
||||||
0x61,0x6c,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2a,0x34,0x2b,0x33,0x5d,0x3c,0x74,0x61,0x72,0x67,0x65,0x74,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
0x5f,0x69,0x6e,0x64,0x65,0x78,0x2a,0x34,0x2b,0x33,0x5d,0x3c,0x74,0x61,0x72,0x67,0x65,0x74,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x64,0x78,0x3d,0x61,0x74,0x6f,0x6d,0x69,0x63,0x5f,0x69,0x6e,0x63,0x28,0x73,0x68,0x61,0x72,0x65,0x73,0x2b,0x30,0x78,0x46,
|
0x33,0x32,0x5f,0x74,0x20,0x69,0x64,0x78,0x3d,0x61,0x74,0x6f,0x6d,0x69,0x63,0x5f,0x69,0x6e,0x63,0x28,0x73,0x68,0x61,0x72,0x65,0x73,0x2b,0x30,0x78,0x46,0x46,0x29,
|
||||||
0x46,0x29,0x3b,0x0a,0x69,0x66,0x28,0x69,0x64,0x78,0x3c,0x30,0x78,0x46,0x46,0x29,0x0a,0x73,0x68,0x61,0x72,0x65,0x73,0x5b,0x69,0x64,0x78,0x5d,0x3d,0x66,0x69,0x6c,
|
0x3b,0x0a,0x69,0x66,0x28,0x69,0x64,0x78,0x3c,0x30,0x78,0x46,0x46,0x29,0x0a,0x73,0x68,0x61,0x72,0x65,0x73,0x5b,0x69,0x64,0x78,0x5d,0x3d,0x66,0x69,0x6c,0x74,0x65,
|
||||||
0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x28,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x30,0x5d,
|
0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x28,0x66,0x69,0x6c,0x74,0x65,0x72,0x65,0x64,0x5f,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x30,0x5d,0x2b,0x67,
|
||||||
0x2b,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x6e,0x64,0x65,0x78,0x29,0x2a,0x39,0x2b,0x31,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,
|
0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x6e,0x64,0x65,0x78,0x29,0x2a,0x39,0x2b,0x31,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,
|
||||||
0x20,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x76,0x2c,0x63,0x29,0x20,0x28,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x76,0x2c,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
0x4f,0x54,0x41,0x54,0x45,0x28,0x76,0x2c,0x63,0x29,0x20,0x28,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x76,0x2c,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x63,
|
||||||
0x29,0x63,0x29,0x29,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x58,0x4f,0x52,0x28,0x76,0x2c,0x77,0x29,0x20,0x28,0x28,0x76,0x29,0x20,0x5e,0x20,0x28,0x77,0x29,
|
0x29,0x29,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x58,0x4f,0x52,0x28,0x76,0x2c,0x77,0x29,0x20,0x28,0x28,0x76,0x29,0x20,0x5e,0x20,0x28,0x77,0x29,0x29,0x0a,
|
||||||
0x29,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x50,0x4c,0x55,0x53,0x28,0x76,0x2c,0x77,0x29,0x20,0x28,0x28,0x76,0x29,0x20,0x2b,0x20,0x28,0x77,0x29,0x29,0x0a,
|
0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x50,0x4c,0x55,0x53,0x28,0x76,0x2c,0x77,0x29,0x20,0x28,0x28,0x76,0x29,0x20,0x2b,0x20,0x28,0x77,0x29,0x29,0x0a,0x5f,0x5f,
|
||||||
0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,
|
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,
|
||||||
0x69,0x7a,0x65,0x28,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,
|
0x65,0x28,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,
|
||||||
0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x53,0x61,0x6c,0x73,0x61,0x32,0x30,0x5f,0x58,0x4f,0x52,0x4b,0x65,0x79,0x53,0x74,0x72,0x65,0x61,0x6d,
|
0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x53,0x61,0x6c,0x73,0x61,0x32,0x30,0x5f,0x58,0x4f,0x52,0x4b,0x65,0x79,0x53,0x74,0x72,0x65,0x61,0x6d,0x28,0x5f,
|
||||||
0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6b,0x65,0x79,0x73,0x2c,0x5f,
|
0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6b,0x65,0x79,0x73,0x2c,0x5f,0x5f,0x67,
|
||||||
0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,
|
0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
||||||
0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,
|
0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
||||||
0x5f,0x74,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,
|
0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
||||||
|
0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,
|
||||||
|
0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
||||||
|
0x36,0x34,0x5f,0x74,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x3d,0x67,0x2a,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,
|
||||||
|
0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x2b,0x31,0x32,0x38,0x3b,0x0a,0x7b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,
|
||||||
|
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2b,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,
|
||||||
|
0x74,0x2d,0x31,0x32,0x38,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,
|
||||||
|
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x74,0x3b,0x20,0x69,0x3c,0x31,0x32,0x38,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
||||||
|
0x74,0x29,0x3b,0x20,0x69,0x2b,0x3d,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x29,0x0a,0x70,0x5b,0x69,0x5d,0x3d,
|
||||||
|
0x30,0x3b,0x0a,0x7d,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6b,0x3d,
|
||||||
|
0x6b,0x65,0x79,0x73,0x2b,0x67,0x2a,0x38,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6f,0x75,0x74,
|
||||||
|
0x70,0x75,0x74,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2b,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x28,0x74,0x2a,0x36,0x34,
|
||||||
|
0x29,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,
|
||||||
|
0x32,0x5f,0x74,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,0x5d,0x3b,
|
||||||
|
0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x3d,0x6b,0x5b,0x30,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,
|
||||||
|
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x32,0x3d,0x6b,0x5b,0x31,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
|
0x6a,0x33,0x3d,0x6b,0x5b,0x32,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x34,0x3d,0x6b,0x5b,0x33,0x5d,0x3b,
|
||||||
|
0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x31,0x3d,0x6b,0x5b,0x34,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,
|
||||||
|
0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x32,0x3d,0x6b,0x5b,0x35,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
||||||
|
0x74,0x20,0x6a,0x31,0x33,0x3d,0x6b,0x5b,0x36,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x34,0x3d,0x6b,
|
||||||
|
0x5b,0x37,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x30,0x3d,0x30,0x78,0x36,0x31,0x37,0x30,0x37,0x38,0x36,
|
||||||
|
0x35,0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x35,0x3d,0x30,0x78,0x33,0x33,0x32,0x30,0x36,0x34,0x36,0x45,
|
||||||
|
0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x30,0x3d,0x30,0x78,0x37,0x39,0x36,0x32,0x32,0x44,0x33,0x32,
|
||||||
|
0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x35,0x3d,0x30,0x78,0x36,0x42,0x32,0x30,0x36,0x35,0x37,0x34,
|
||||||
|
0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x36,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
||||||
|
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x37,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x38,0x3d,0x30,
|
||||||
|
0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x39,0x3d,0x30,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,
|
||||||
|
0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x74,0x2a,0x36,0x34,0x3b,0x20,0x69,0x3c,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x20,0x69,0x2b,0x3d,0x53,
|
||||||
|
0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x2a,0x36,0x34,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
||||||
|
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x38,0x5f,0x31,0x3d,0x6a,0x38,0x2b,0x28,0x69,0x2f,0x36,0x34,0x29,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
|
0x78,0x30,0x3d,0x6a,0x30,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x3d,0x6a,0x31,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
|
0x78,0x32,0x3d,0x6a,0x32,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x33,0x3d,0x6a,0x33,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
|
0x78,0x34,0x3d,0x6a,0x34,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x35,0x3d,0x6a,0x35,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
|
0x78,0x36,0x3d,0x6a,0x36,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x37,0x3d,0x6a,0x37,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
||||||
|
0x78,0x38,0x3d,0x6a,0x38,0x5f,0x31,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x39,0x3d,0x6a,0x39,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
||||||
|
0x74,0x20,0x78,0x31,0x30,0x3d,0x6a,0x31,0x30,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x31,0x3d,0x6a,0x31,0x31,0x3b,0x0a,0x75,0x69,0x6e,
|
||||||
|
0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x32,0x3d,0x6a,0x31,0x32,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x33,0x3d,0x6a,0x31,0x33,0x3b,
|
||||||
|
0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x34,0x3d,0x6a,0x31,0x34,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x35,0x3d,
|
||||||
|
0x6a,0x31,0x35,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x35,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,
|
||||||
|
0x32,0x5f,0x74,0x20,0x6a,0x3d,0x30,0x3b,0x20,0x6a,0x3c,0x31,0x30,0x3b,0x20,0x2b,0x2b,0x6a,0x29,0x0a,0x7b,0x0a,0x78,0x34,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x34,
|
||||||
|
0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x30,0x2c,0x78,0x31,0x32,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x38,0x3d,0x58,0x4f,
|
||||||
|
0x52,0x28,0x20,0x78,0x38,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x34,0x2c,0x78,0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,
|
||||||
|
0x31,0x32,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x38,0x2c,0x78,0x34,0x29,0x2c,0x31,
|
||||||
|
0x33,0x29,0x29,0x3b,0x0a,0x78,0x30,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x32,0x2c,
|
||||||
|
0x78,0x38,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x39,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x39,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,
|
||||||
|
0x28,0x20,0x78,0x35,0x2c,0x78,0x31,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x31,0x33,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x33,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,
|
||||||
|
0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x39,0x2c,0x78,0x35,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x31,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x31,0x2c,0x52,0x4f,
|
||||||
|
0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x33,0x2c,0x78,0x39,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x35,0x3d,0x58,0x4f,0x52,0x28,0x20,
|
||||||
|
0x78,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x31,0x2c,0x78,0x31,0x33,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x31,
|
||||||
|
0x34,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x34,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x30,0x2c,0x78,0x36,0x29,0x2c,0x37,0x29,
|
||||||
|
0x29,0x3b,0x0a,0x78,0x32,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x34,0x2c,0x78,0x31,
|
||||||
|
0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x36,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x36,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,
|
||||||
|
0x78,0x32,0x2c,0x78,0x31,0x34,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x31,0x30,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,
|
||||||
|
0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x36,0x2c,0x78,0x32,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x33,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x33,0x2c,0x52,
|
||||||
|
0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x35,0x2c,0x78,0x31,0x31,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x37,0x3d,0x58,0x4f,0x52,0x28,
|
||||||
|
0x20,0x78,0x37,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x33,0x2c,0x78,0x31,0x35,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x31,
|
||||||
|
0x31,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x31,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x37,0x2c,0x78,0x33,0x29,0x2c,0x31,0x33,
|
||||||
|
0x29,0x29,0x3b,0x0a,0x78,0x31,0x35,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x31,0x2c,
|
||||||
|
0x78,0x37,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x31,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x31,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,
|
||||||
|
0x28,0x20,0x78,0x30,0x2c,0x78,0x33,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x32,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,
|
||||||
|
0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x31,0x2c,0x78,0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x33,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x33,0x2c,0x52,0x4f,0x54,
|
||||||
|
0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x32,0x2c,0x78,0x31,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x30,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,
|
||||||
|
0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x33,0x2c,0x78,0x32,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x36,0x3d,0x58,
|
||||||
|
0x4f,0x52,0x28,0x20,0x78,0x36,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x35,0x2c,0x78,0x34,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,
|
||||||
|
0x78,0x37,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x37,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x36,0x2c,0x78,0x35,0x29,0x2c,0x39,
|
||||||
|
0x29,0x29,0x3b,0x0a,0x78,0x34,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x34,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x37,0x2c,0x78,
|
||||||
|
0x36,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x35,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,
|
||||||
|
0x20,0x78,0x34,0x2c,0x78,0x37,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x31,0x31,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x31,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,
|
||||||
|
0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x30,0x2c,0x78,0x39,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x38,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x38,0x2c,0x52,0x4f,
|
||||||
|
0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x31,0x2c,0x78,0x31,0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x39,0x3d,0x58,0x4f,0x52,0x28,0x20,
|
||||||
|
0x78,0x39,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x38,0x2c,0x78,0x31,0x31,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x31,
|
||||||
|
0x30,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x39,0x2c,0x78,0x38,0x29,0x2c,0x31,0x38,
|
||||||
|
0x29,0x29,0x3b,0x0a,0x78,0x31,0x32,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x35,0x2c,
|
||||||
|
0x78,0x31,0x34,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x31,0x33,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x33,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,
|
||||||
|
0x53,0x28,0x78,0x31,0x32,0x2c,0x78,0x31,0x35,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x31,0x34,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x34,0x2c,0x52,0x4f,0x54,0x41,
|
||||||
|
0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x33,0x2c,0x78,0x31,0x32,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x31,0x35,0x3d,0x58,0x4f,0x52,0x28,0x78,
|
||||||
|
0x31,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x34,0x2c,0x78,0x31,0x33,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,
|
||||||
|
0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x30,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x30,0x2c,0x6a,0x30,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x5d,
|
||||||
|
0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x2c,0x6a,0x31,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x32,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x32,0x2c,
|
||||||
|
0x6a,0x32,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x33,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x33,0x2c,0x6a,0x33,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,
|
||||||
|
0x75,0x74,0x5b,0x34,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x34,0x2c,0x6a,0x34,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x35,0x5d,0x3d,0x50,0x4c,0x55,
|
||||||
|
0x53,0x28,0x78,0x35,0x2c,0x6a,0x35,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x36,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x36,0x2c,0x6a,0x36,0x29,0x3b,
|
||||||
|
0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x37,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x37,0x2c,0x6a,0x37,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x38,
|
||||||
|
0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x38,0x2c,0x6a,0x38,0x5f,0x31,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x39,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,
|
||||||
|
0x78,0x39,0x2c,0x6a,0x39,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x30,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x30,0x2c,0x6a,0x31,0x30,0x29,
|
||||||
|
0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x31,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x31,0x2c,0x6a,0x31,0x31,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,
|
||||||
|
0x75,0x74,0x5b,0x31,0x32,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x32,0x2c,0x6a,0x31,0x32,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x33,0x5d,
|
||||||
|
0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x33,0x2c,0x6a,0x31,0x33,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x34,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,
|
||||||
|
0x78,0x31,0x34,0x2c,0x6a,0x31,0x34,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x35,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x35,0x2c,0x6a,0x31,
|
||||||
|
0x35,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x2b,0x3d,0x28,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x2a,
|
||||||
|
0x36,0x34,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x7d,0x0a,0x62,0x61,0x72,0x72,0x69,0x65,0x72,0x28,
|
||||||
|
0x43,0x4c,0x4b,0x5f,0x47,0x4c,0x4f,0x42,0x41,0x4c,0x5f,0x4d,0x45,0x4d,0x5f,0x46,0x45,0x4e,0x43,0x45,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3c,0x31,0x36,0x29,0x0a,
|
||||||
|
0x7b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2b,0x28,
|
||||||
|
0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2b,0x33,0x29,0x2f,0x73,0x69,0x7a,
|
||||||
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x70,0x5b,0x74,0x5d,0x3d,0x30,0x3b,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x28,0x74,0x3d,0x3d,
|
||||||
|
0x30,0x29,0x26,0x26,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x26,0x33,0x29,0x29,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x5b,0x28,0x6f,0x75,
|
||||||
|
0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,
|
||||||
|
0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x5d,0x20,0x26,0x3d,0x20,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x3e,0x3e,0x28,0x28,0x34,0x2d,0x28,
|
||||||
|
0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x26,0x33,0x29,0x29,0x3c,0x3c,0x33,0x29,0x3b,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,
|
||||||
|
0x4f,0x55,0x4e,0x44,0x53,0x20,0x32,0x34,0x20,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x36,0x34,0x28,0x61,0x2c,0x62,0x2c,0x63,0x29,0x20,0x28,0x28,0x28,
|
||||||
|
0x61,0x29,0x20,0x3c,0x3c,0x20,0x62,0x29,0x20,0x7c,0x20,0x28,0x28,0x61,0x29,0x20,0x3e,0x3e,0x20,0x63,0x29,0x29,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,
|
||||||
|
0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x72,0x63,0x5b,0x32,0x5d,0x5b,0x52,0x4f,0x55,0x4e,0x44,0x53,0x5d,0x3d,0x7b,
|
||||||
|
0x0a,0x7b,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x41,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x41,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x38,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x41,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x39,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x33,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,
|
||||||
|
0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
|
0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x38,0x55,0x4c,
|
||||||
|
0x7d,0x2c,0x0a,0x7b,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,
|
||||||
|
0x30,0x55,0x4c,0x2c,0x0a,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,
|
||||||
|
0x2c,0x30,0x55,0x4c,0x2c,0x0a,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,
|
||||||
|
0x4c,0x2c,0x30,0x55,0x4c,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x72,
|
||||||
|
0x6f,0x5b,0x32,0x35,0x5d,0x5b,0x32,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x36,0x34,0x7d,0x2c,0x7b,0x34,0x34,0x2c,0x32,0x30,0x7d,0x2c,0x7b,0x34,0x33,0x2c,0x32,
|
||||||
|
0x31,0x7d,0x2c,0x7b,0x32,0x31,0x2c,0x34,0x33,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x35,0x30,0x7d,0x2c,0x0a,0x7b,0x20,0x31,0x2c,0x36,0x33,0x7d,0x2c,0x7b,0x20,0x36,0x2c,
|
||||||
|
0x35,0x38,0x7d,0x2c,0x7b,0x32,0x35,0x2c,0x33,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x35,0x36,0x7d,0x2c,0x7b,0x31,0x38,0x2c,0x34,0x36,0x7d,0x2c,0x0a,0x7b,0x36,0x32,
|
||||||
|
0x2c,0x32,0x7d,0x2c,0x7b,0x35,0x35,0x2c,0x39,0x7d,0x2c,0x7b,0x33,0x39,0x2c,0x32,0x35,0x7d,0x2c,0x7b,0x34,0x31,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x20,0x32,0x2c,0x36,
|
||||||
|
0x32,0x7d,0x2c,0x0a,0x7b,0x32,0x38,0x2c,0x33,0x36,0x7d,0x2c,0x7b,0x32,0x30,0x2c,0x34,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x36,0x31,0x7d,0x2c,0x7b,0x34,0x35,0x2c,
|
||||||
|
0x31,0x39,0x7d,0x2c,0x7b,0x36,0x31,0x2c,0x33,0x7d,0x2c,0x0a,0x7b,0x32,0x37,0x2c,0x33,0x37,0x7d,0x2c,0x7b,0x33,0x36,0x2c,0x32,0x38,0x7d,0x2c,0x7b,0x31,0x30,0x2c,
|
||||||
|
0x35,0x34,0x7d,0x2c,0x7b,0x31,0x35,0x2c,0x34,0x39,0x7d,0x2c,0x7b,0x35,0x36,0x2c,0x38,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,
|
||||||
|
0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x61,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x36,0x2c,0x31,0x32,0x2c,0x31,0x38,0x2c,0x32,0x34,0x2c,
|
||||||
|
0x0a,0x31,0x2c,0x37,0x2c,0x31,0x33,0x2c,0x31,0x39,0x2c,0x32,0x30,0x2c,0x0a,0x32,0x2c,0x38,0x2c,0x31,0x34,0x2c,0x31,0x35,0x2c,0x32,0x31,0x2c,0x0a,0x33,0x2c,0x39,
|
||||||
|
0x2c,0x31,0x30,0x2c,0x31,0x36,0x2c,0x32,0x32,0x2c,0x0a,0x34,0x2c,0x35,0x2c,0x31,0x31,0x2c,0x31,0x37,0x2c,0x32,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,
|
||||||
|
0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x62,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,
|
||||||
|
0x34,0x2c,0x0a,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x0a,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x0a,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,
|
||||||
|
0x2c,0x32,0x2c,0x0a,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,
|
||||||
|
0x74,0x20,0x69,0x6e,0x74,0x20,0x63,0x5b,0x32,0x35,0x5d,0x5b,0x33,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x31,0x2c,0x32,0x7d,0x2c,0x7b,0x20,0x31,0x2c,0x32,0x2c,
|
||||||
|
0x33,0x7d,0x2c,0x7b,0x20,0x32,0x2c,0x33,0x2c,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x34,0x2c,0x30,0x7d,0x2c,0x7b,0x20,0x34,0x2c,0x30,0x2c,0x31,0x7d,0x2c,0x0a,0x7b,
|
||||||
|
0x20,0x35,0x2c,0x36,0x2c,0x37,0x7d,0x2c,0x7b,0x20,0x36,0x2c,0x37,0x2c,0x38,0x7d,0x2c,0x7b,0x20,0x37,0x2c,0x38,0x2c,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x39,0x2c,
|
||||||
|
0x35,0x7d,0x2c,0x7b,0x20,0x39,0x2c,0x35,0x2c,0x36,0x7d,0x2c,0x0a,0x7b,0x31,0x30,0x2c,0x31,0x31,0x2c,0x31,0x32,0x7d,0x2c,0x7b,0x31,0x31,0x2c,0x31,0x32,0x2c,0x31,
|
||||||
|
0x33,0x7d,0x2c,0x7b,0x31,0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x7d,0x2c,0x7b,0x31,0x33,0x2c,0x31,0x34,0x2c,0x31,0x30,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x31,0x30,0x2c,
|
||||||
|
0x31,0x31,0x7d,0x2c,0x0a,0x7b,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x7d,0x2c,0x7b,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x7d,0x2c,0x7b,0x31,0x37,0x2c,0x31,
|
||||||
|
0x38,0x2c,0x31,0x39,0x7d,0x2c,0x7b,0x31,0x38,0x2c,0x31,0x39,0x2c,0x31,0x35,0x7d,0x2c,0x7b,0x31,0x39,0x2c,0x31,0x35,0x2c,0x31,0x36,0x7d,0x2c,0x0a,0x7b,0x32,0x30,
|
||||||
|
0x2c,0x32,0x31,0x2c,0x32,0x32,0x7d,0x2c,0x7b,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x7d,0x2c,0x7b,0x32,
|
||||||
|
0x33,0x2c,0x32,0x34,0x2c,0x32,0x30,0x7d,0x2c,0x7b,0x32,0x34,0x2c,0x32,0x30,0x2c,0x32,0x31,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,
|
||||||
|
0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x64,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x0a,0x31,
|
||||||
|
0x30,0x2c,0x31,0x31,0x2c,0x31,0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x2c,0x0a,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x2c,0x0a,0x35,
|
||||||
|
0x2c,0x36,0x2c,0x37,0x2c,0x38,0x2c,0x39,0x2c,0x0a,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x61,0x74,
|
||||||
|
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x28,
|
||||||
|
0x33,0x32,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x28,0x5f,0x5f,0x67,
|
||||||
|
0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x73,0x2c,0x5f,0x5f,0x67,0x6c,
|
||||||
|
0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,
|
||||||
|
0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,
|
||||||
|
0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,
|
||||||
0x5f,0x74,0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
0x5f,0x74,0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x33,0x32,0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
0x33,0x32,0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,0x35,
|
||||||
0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x3d,0x67,0x2a,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,
|
0x29,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,0x35,
|
||||||
0x74,0x29,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x2b,0x31,0x32,0x38,0x3b,0x0a,0x7b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x3d,0x28,0x28,
|
||||||
0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2b,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,
|
0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x2a,0x67,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,
|
||||||
0x73,0x65,0x74,0x2d,0x31,0x32,0x38,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,
|
0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,
|
||||||
0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x74,0x3b,0x20,0x69,0x3c,0x31,0x32,0x38,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,
|
0x74,0x36,0x34,0x5f,0x74,0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x73,0x2b,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x3b,0x0a,0x63,0x6f,
|
||||||
0x32,0x5f,0x74,0x29,0x3b,0x20,0x69,0x2b,0x3d,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x29,0x0a,0x70,0x5b,0x69,
|
0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,
|
||||||
0x5d,0x3d,0x30,0x3b,0x0a,0x7d,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,
|
0x7a,0x65,0x73,0x5b,0x67,0x5d,0x2b,0x31,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,
|
||||||
0x6b,0x3d,0x6b,0x65,0x79,0x73,0x2b,0x67,0x2a,0x38,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6f,
|
0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,
|
||||||
0x75,0x74,0x70,0x75,0x74,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x2b,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x28,0x74,0x2a,
|
0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,
|
||||||
0x36,0x34,0x29,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,
|
0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,
|
||||||
0x74,0x33,0x32,0x5f,0x74,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,
|
0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x5f,
|
||||||
0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x3d,0x6b,0x5b,0x30,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,
|
0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,
|
||||||
0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x32,0x3d,0x6b,0x5b,0x31,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x74,0x29,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,
|
||||||
0x74,0x20,0x6a,0x33,0x3d,0x6b,0x5b,0x32,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x34,0x3d,0x6b,0x5b,0x33,
|
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x77,0x6f,0x72,0x64,0x73,0x3b,0x20,0x2b,0x2b,0x69,0x2c,0x2b,0x2b,0x69,0x6e,0x70,0x75,
|
||||||
0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x31,0x3d,0x6b,0x5b,0x34,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,
|
0x74,0x29,0x0a,0x7b,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x2a,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x2b,0x2b,0x77,
|
||||||
0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x32,0x3d,0x6b,0x5b,0x35,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,
|
0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3b,0x0a,0x69,0x66,0x28,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x3d,0x31,0x37,0x29,0x0a,0x7b,0x0a,0x23,0x70,
|
||||||
0x32,0x5f,0x74,0x20,0x6a,0x31,0x33,0x3d,0x6b,0x5b,0x36,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x34,
|
0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,
|
||||||
0x3d,0x6b,0x5b,0x37,0x5d,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x30,0x3d,0x30,0x78,0x36,0x31,0x37,0x30,0x37,
|
0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,
|
||||||
0x38,0x36,0x35,0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x35,0x3d,0x30,0x78,0x33,0x33,0x32,0x30,0x36,0x34,
|
0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,
|
||||||
0x36,0x45,0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x30,0x3d,0x30,0x78,0x37,0x39,0x36,0x32,0x32,0x44,
|
0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,
|
||||||
0x33,0x32,0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x31,0x35,0x3d,0x30,0x78,0x36,0x42,0x32,0x30,0x36,0x35,
|
0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,
|
||||||
0x37,0x34,0x55,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x36,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,
|
0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,
|
||||||
0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x37,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x38,
|
0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,
|
||||||
0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x39,0x3d,0x30,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,
|
0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,0x77,0x6f,0x72,0x64,
|
||||||
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x74,0x2a,0x36,0x34,0x3b,0x20,0x69,0x3c,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x20,0x69,0x2b,
|
0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x3d,0x30,0x3b,0x0a,0x5f,0x5f,
|
||||||
0x3d,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,0x5a,0x45,0x2a,0x36,0x34,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,
|
0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,
|
||||||
0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x38,0x5f,0x31,0x3d,0x6a,0x38,0x2b,0x28,0x69,0x2f,0x36,0x34,0x29,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x29,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,
|
||||||
0x74,0x20,0x78,0x30,0x3d,0x6a,0x30,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x3d,0x6a,0x31,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x74,
|
||||||
0x74,0x20,0x78,0x32,0x3d,0x6a,0x32,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x33,0x3d,0x6a,0x33,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x61,0x69,0x6c,0x7c,0x3d,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x70,0x5b,0x69,0x5d,0x29,0x3c,0x3c,0x28,0x69,0x2a,0x38,0x29,0x3b,0x0a,0x7d,0x0a,
|
||||||
0x74,0x20,0x78,0x34,0x3d,0x6a,0x34,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x35,0x3d,0x6a,0x35,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x74,0x61,0x69,0x6c,0x5e,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,
|
||||||
0x74,0x20,0x78,0x36,0x3d,0x6a,0x36,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x37,0x3d,0x6a,0x37,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x28,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,0x28,0x74,0x61,0x69,
|
||||||
0x74,0x20,0x78,0x38,0x3d,0x6a,0x38,0x5f,0x31,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x39,0x3d,0x6a,0x39,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,
|
0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,0x38,0x29,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
0x32,0x5f,0x74,0x20,0x78,0x31,0x30,0x3d,0x6a,0x31,0x30,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x31,0x3d,0x6a,0x31,0x31,0x3b,0x0a,0x75,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x31,0x0a,0x66,0x6f,0x72,
|
||||||
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x32,0x3d,0x6a,0x31,0x32,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x33,0x3d,0x6a,0x31,
|
0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,
|
||||||
0x33,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,0x34,0x3d,0x6a,0x31,0x34,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x78,0x31,
|
0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,
|
||||||
0x35,0x3d,0x6a,0x31,0x35,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x28,0x35,0x29,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,
|
0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,
|
||||||
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6a,0x3d,0x30,0x3b,0x20,0x6a,0x3c,0x31,0x30,0x3b,0x20,0x2b,0x2b,0x6a,0x29,0x0a,0x7b,0x0a,0x78,0x34,0x3d,0x58,0x4f,0x52,0x28,
|
0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,
|
||||||
0x20,0x78,0x34,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x30,0x2c,0x78,0x31,0x32,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x38,
|
0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,
|
||||||
0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x38,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x34,0x2c,0x78,0x30,0x29,0x2c,0x39,0x29,0x29,
|
0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,
|
||||||
0x3b,0x0a,0x78,0x31,0x32,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x38,0x2c,0x78,0x34,
|
0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,
|
||||||
0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x30,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,
|
0x3b,0x20,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,0x32,0x2f,0x73,0x69,0x7a,
|
||||||
0x31,0x32,0x2c,0x78,0x38,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x39,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x39,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x74,0x5d,0x3b,0x0a,
|
||||||
0x4c,0x55,0x53,0x28,0x20,0x78,0x35,0x2c,0x78,0x31,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x31,0x33,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x33,0x2c,0x52,0x4f,0x54,
|
0x7d,0x0a,0x7d,0x0a,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,
|
||||||
0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x39,0x2c,0x78,0x35,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x31,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x31,
|
0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x28,0x33,0x32,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,
|
||||||
0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x33,0x2c,0x78,0x39,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x35,0x3d,0x58,0x4f,
|
0x73,0x68,0x61,0x33,0x5f,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x52,0x28,0x20,0x78,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x31,0x2c,0x78,0x31,0x33,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,
|
0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,
|
||||||
0x0a,0x78,0x31,0x34,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x34,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x30,0x2c,0x78,0x36,0x29,
|
0x69,0x7a,0x65,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x32,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x34,
|
0x36,0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,
|
||||||
0x2c,0x78,0x31,0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x36,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x36,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,
|
0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
||||||
0x53,0x28,0x20,0x78,0x32,0x2c,0x78,0x31,0x34,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x31,0x30,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x30,0x2c,0x52,0x4f,0x54,
|
0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,0x35,0x29,0x0a,0x72,0x65,
|
||||||
0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x36,0x2c,0x78,0x32,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x33,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,
|
0x74,0x75,0x72,0x6e,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,0x35,0x3b,0x0a,0x5f,0x5f,
|
||||||
0x33,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x35,0x2c,0x78,0x31,0x31,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x37,0x3d,0x58,
|
0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
||||||
0x4f,0x52,0x28,0x20,0x78,0x37,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x33,0x2c,0x78,0x31,0x35,0x29,0x2c,0x39,0x29,0x29,0x3b,
|
0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x29,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,
|
||||||
0x0a,0x78,0x31,0x31,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x31,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x37,0x2c,0x78,0x33,0x29,
|
0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,
|
||||||
0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x31,0x35,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,
|
0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,
|
||||||
0x31,0x31,0x2c,0x78,0x37,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x31,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x31,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,
|
0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x28,0x74,0x3c,0x31,0x36,0x29,0x3f,0x69,0x6e,0x70,0x75,0x74,0x5b,0x74,0x5d,0x3a,0x30,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,
|
||||||
0x4c,0x55,0x53,0x28,0x20,0x78,0x30,0x2c,0x78,0x33,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x32,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x32,0x2c,0x52,0x4f,0x54,0x41,
|
0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x3d,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,
|
||||||
0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x31,0x2c,0x78,0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x33,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x33,0x2c,
|
0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x29,0x28,0x41,0x29,0x2b,0x39,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x2b,0x3d,0x67,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,
|
||||||
0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x32,0x2c,0x78,0x31,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x30,0x3d,0x58,0x4f,0x52,
|
0x6f,0x73,0x5b,0x30,0x5d,0x3d,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,0x26,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x29,0x7c,0x28,
|
||||||
0x28,0x20,0x78,0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x33,0x2c,0x78,0x32,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,
|
0x28,0x6e,0x6f,0x6e,0x63,0x65,0x26,0x30,0x78,0x46,0x46,0x29,0x3c,0x3c,0x32,0x34,0x29,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x31,0x5d,0x3d,
|
||||||
0x36,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x36,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x35,0x2c,0x78,0x34,0x29,0x2c,0x37,0x29,
|
0x28,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x31,0x5d,0x26,0x30,0x78,0x46,0x46,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x29,0x7c,0x28,0x6e,0x6f,0x6e,0x63,
|
||||||
0x29,0x3b,0x0a,0x78,0x37,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x37,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x36,0x2c,0x78,0x35,
|
0x65,0x3e,0x3e,0x38,0x29,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,
|
||||||
0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x34,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x34,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,
|
0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,
|
||||||
0x37,0x2c,0x78,0x36,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x35,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,
|
0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,
|
||||||
0x55,0x53,0x28,0x20,0x78,0x34,0x2c,0x78,0x37,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x31,0x31,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x31,0x2c,0x52,0x4f,0x54,
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x28,
|
||||||
0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x30,0x2c,0x78,0x39,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x38,0x3d,0x58,0x4f,0x52,0x28,0x20,0x78,0x38,
|
0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,
|
||||||
0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x31,0x2c,0x78,0x31,0x30,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x39,0x3d,0x58,0x4f,
|
0x29,0x29,0x29,0x3c,0x3c,0x28,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,0x38,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,
|
||||||
0x52,0x28,0x20,0x78,0x39,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x38,0x2c,0x78,0x31,0x31,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,
|
0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,
|
||||||
0x0a,0x78,0x31,0x30,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x30,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x20,0x78,0x39,0x2c,0x78,0x38,0x29,
|
0x6c,0x6c,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,
|
||||||
0x2c,0x31,0x38,0x29,0x29,0x3b,0x0a,0x78,0x31,0x32,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x32,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,
|
0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,
|
||||||
0x31,0x35,0x2c,0x78,0x31,0x34,0x29,0x2c,0x37,0x29,0x29,0x3b,0x0a,0x78,0x31,0x33,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x33,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,
|
0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,
|
||||||
0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x32,0x2c,0x78,0x31,0x35,0x29,0x2c,0x39,0x29,0x29,0x3b,0x0a,0x78,0x31,0x34,0x3d,0x58,0x4f,0x52,0x28,0x78,0x31,0x34,0x2c,0x52,
|
0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,
|
||||||
0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x33,0x2c,0x78,0x31,0x32,0x29,0x2c,0x31,0x33,0x29,0x29,0x3b,0x0a,0x78,0x31,0x35,0x3d,0x58,0x4f,
|
0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,
|
||||||
0x52,0x28,0x78,0x31,0x35,0x2c,0x52,0x4f,0x54,0x41,0x54,0x45,0x28,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x34,0x2c,0x78,0x31,0x33,0x29,0x2c,0x31,0x38,0x29,0x29,0x3b,
|
0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,
|
||||||
0x0a,0x7d,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x30,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x30,0x2c,0x6a,0x30,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,
|
0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,
|
||||||
0x5b,0x31,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x2c,0x6a,0x31,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x32,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,
|
0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,
|
||||||
0x78,0x32,0x2c,0x6a,0x32,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x33,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x33,0x2c,0x6a,0x33,0x29,0x3b,0x0a,0x6f,
|
0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,0x32,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,
|
||||||
0x75,0x74,0x70,0x75,0x74,0x5b,0x34,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x34,0x2c,0x6a,0x34,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x35,0x5d,0x3d,
|
0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x00
|
||||||
0x50,0x4c,0x55,0x53,0x28,0x78,0x35,0x2c,0x6a,0x35,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x36,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x36,0x2c,0x6a,
|
|
||||||
0x36,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x37,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x37,0x2c,0x6a,0x37,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,
|
|
||||||
0x74,0x5b,0x38,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x38,0x2c,0x6a,0x38,0x5f,0x31,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x39,0x5d,0x3d,0x50,0x4c,
|
|
||||||
0x55,0x53,0x28,0x78,0x39,0x2c,0x6a,0x39,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x30,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x30,0x2c,0x6a,
|
|
||||||
0x31,0x30,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x31,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x31,0x2c,0x6a,0x31,0x31,0x29,0x3b,0x0a,0x6f,
|
|
||||||
0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x32,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x32,0x2c,0x6a,0x31,0x32,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,
|
|
||||||
0x31,0x33,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x33,0x2c,0x6a,0x31,0x33,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x34,0x5d,0x3d,0x50,0x4c,
|
|
||||||
0x55,0x53,0x28,0x78,0x31,0x34,0x2c,0x6a,0x31,0x34,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x5b,0x31,0x35,0x5d,0x3d,0x50,0x4c,0x55,0x53,0x28,0x78,0x31,0x35,
|
|
||||||
0x2c,0x6a,0x31,0x35,0x29,0x3b,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x2b,0x3d,0x28,0x53,0x41,0x4c,0x53,0x41,0x32,0x30,0x5f,0x47,0x52,0x4f,0x55,0x50,0x5f,0x53,0x49,
|
|
||||||
0x5a,0x45,0x2a,0x36,0x34,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x7d,0x0a,0x62,0x61,0x72,0x72,0x69,
|
|
||||||
0x65,0x72,0x28,0x43,0x4c,0x4b,0x5f,0x47,0x4c,0x4f,0x42,0x41,0x4c,0x5f,0x4d,0x45,0x4d,0x5f,0x46,0x45,0x4e,0x43,0x45,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3c,0x31,
|
|
||||||
0x36,0x29,0x0a,0x7b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x6f,0x75,0x74,0x70,0x75,0x74,
|
|
||||||
0x73,0x2b,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2b,0x33,0x29,0x2f,
|
|
||||||
0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x3b,0x0a,0x70,0x5b,0x74,0x5d,0x3d,0x30,0x3b,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x28,
|
|
||||||
0x74,0x3d,0x3d,0x30,0x29,0x26,0x26,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x26,0x33,0x29,0x29,0x0a,0x6f,0x75,0x74,0x70,0x75,0x74,0x73,0x5b,
|
|
||||||
0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x29,0x2f,0x73,0x69,0x7a,0x65,
|
|
||||||
0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x29,0x5d,0x20,0x26,0x3d,0x20,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x3e,0x3e,0x28,0x28,
|
|
||||||
0x34,0x2d,0x28,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x26,0x33,0x29,0x29,0x3c,0x3c,0x33,0x29,0x3b,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,
|
|
||||||
0x65,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,0x20,0x32,0x34,0x20,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x36,0x34,0x28,0x61,0x2c,0x62,0x2c,0x63,0x29,0x20,
|
|
||||||
0x28,0x28,0x28,0x61,0x29,0x20,0x3c,0x3c,0x20,0x62,0x29,0x20,0x7c,0x20,0x28,0x28,0x61,0x29,0x20,0x3e,0x3e,0x20,0x63,0x29,0x29,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,
|
|
||||||
0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x72,0x63,0x5b,0x32,0x5d,0x5b,0x52,0x4f,0x55,0x4e,0x44,0x53,
|
|
||||||
0x5d,0x3d,0x7b,0x0a,0x7b,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,
|
|
||||||
0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,
|
|
||||||
0x31,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,
|
|
||||||
0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x38,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,
|
|
||||||
0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,
|
|
||||||
0x39,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x33,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,
|
|
||||||
0x30,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,
|
|
||||||
0x31,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,
|
|
||||||
0x38,0x55,0x4c,0x7d,0x2c,0x0a,0x7b,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,
|
|
||||||
0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x0a,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,
|
|
||||||
0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x0a,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,
|
|
||||||
0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,
|
|
||||||
0x74,0x20,0x72,0x6f,0x5b,0x32,0x35,0x5d,0x5b,0x32,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x36,0x34,0x7d,0x2c,0x7b,0x34,0x34,0x2c,0x32,0x30,0x7d,0x2c,0x7b,0x34,
|
|
||||||
0x33,0x2c,0x32,0x31,0x7d,0x2c,0x7b,0x32,0x31,0x2c,0x34,0x33,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x35,0x30,0x7d,0x2c,0x0a,0x7b,0x20,0x31,0x2c,0x36,0x33,0x7d,0x2c,0x7b,
|
|
||||||
0x20,0x36,0x2c,0x35,0x38,0x7d,0x2c,0x7b,0x32,0x35,0x2c,0x33,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x35,0x36,0x7d,0x2c,0x7b,0x31,0x38,0x2c,0x34,0x36,0x7d,0x2c,0x0a,
|
|
||||||
0x7b,0x36,0x32,0x2c,0x32,0x7d,0x2c,0x7b,0x35,0x35,0x2c,0x39,0x7d,0x2c,0x7b,0x33,0x39,0x2c,0x32,0x35,0x7d,0x2c,0x7b,0x34,0x31,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x20,
|
|
||||||
0x32,0x2c,0x36,0x32,0x7d,0x2c,0x0a,0x7b,0x32,0x38,0x2c,0x33,0x36,0x7d,0x2c,0x7b,0x32,0x30,0x2c,0x34,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x36,0x31,0x7d,0x2c,0x7b,
|
|
||||||
0x34,0x35,0x2c,0x31,0x39,0x7d,0x2c,0x7b,0x36,0x31,0x2c,0x33,0x7d,0x2c,0x0a,0x7b,0x32,0x37,0x2c,0x33,0x37,0x7d,0x2c,0x7b,0x33,0x36,0x2c,0x32,0x38,0x7d,0x2c,0x7b,
|
|
||||||
0x31,0x30,0x2c,0x35,0x34,0x7d,0x2c,0x7b,0x31,0x35,0x2c,0x34,0x39,0x7d,0x2c,0x7b,0x35,0x36,0x2c,0x38,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,
|
|
||||||
0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x61,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x36,0x2c,0x31,0x32,0x2c,0x31,0x38,0x2c,
|
|
||||||
0x32,0x34,0x2c,0x0a,0x31,0x2c,0x37,0x2c,0x31,0x33,0x2c,0x31,0x39,0x2c,0x32,0x30,0x2c,0x0a,0x32,0x2c,0x38,0x2c,0x31,0x34,0x2c,0x31,0x35,0x2c,0x32,0x31,0x2c,0x0a,
|
|
||||||
0x33,0x2c,0x39,0x2c,0x31,0x30,0x2c,0x31,0x36,0x2c,0x32,0x32,0x2c,0x0a,0x34,0x2c,0x35,0x2c,0x31,0x31,0x2c,0x31,0x37,0x2c,0x32,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,
|
|
||||||
0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x62,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,
|
|
||||||
0x2c,0x33,0x2c,0x34,0x2c,0x0a,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x0a,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x0a,0x33,0x2c,0x34,0x2c,
|
|
||||||
0x30,0x2c,0x31,0x2c,0x32,0x2c,0x0a,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,
|
|
||||||
0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x63,0x5b,0x32,0x35,0x5d,0x5b,0x33,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x31,0x2c,0x32,0x7d,0x2c,0x7b,0x20,0x31,
|
|
||||||
0x2c,0x32,0x2c,0x33,0x7d,0x2c,0x7b,0x20,0x32,0x2c,0x33,0x2c,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x34,0x2c,0x30,0x7d,0x2c,0x7b,0x20,0x34,0x2c,0x30,0x2c,0x31,0x7d,
|
|
||||||
0x2c,0x0a,0x7b,0x20,0x35,0x2c,0x36,0x2c,0x37,0x7d,0x2c,0x7b,0x20,0x36,0x2c,0x37,0x2c,0x38,0x7d,0x2c,0x7b,0x20,0x37,0x2c,0x38,0x2c,0x39,0x7d,0x2c,0x7b,0x20,0x38,
|
|
||||||
0x2c,0x39,0x2c,0x35,0x7d,0x2c,0x7b,0x20,0x39,0x2c,0x35,0x2c,0x36,0x7d,0x2c,0x0a,0x7b,0x31,0x30,0x2c,0x31,0x31,0x2c,0x31,0x32,0x7d,0x2c,0x7b,0x31,0x31,0x2c,0x31,
|
|
||||||
0x32,0x2c,0x31,0x33,0x7d,0x2c,0x7b,0x31,0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x7d,0x2c,0x7b,0x31,0x33,0x2c,0x31,0x34,0x2c,0x31,0x30,0x7d,0x2c,0x7b,0x31,0x34,0x2c,
|
|
||||||
0x31,0x30,0x2c,0x31,0x31,0x7d,0x2c,0x0a,0x7b,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x7d,0x2c,0x7b,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x7d,0x2c,0x7b,0x31,
|
|
||||||
0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x7d,0x2c,0x7b,0x31,0x38,0x2c,0x31,0x39,0x2c,0x31,0x35,0x7d,0x2c,0x7b,0x31,0x39,0x2c,0x31,0x35,0x2c,0x31,0x36,0x7d,0x2c,0x0a,
|
|
||||||
0x7b,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,0x32,0x7d,0x2c,0x7b,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x7d,
|
|
||||||
0x2c,0x7b,0x32,0x33,0x2c,0x32,0x34,0x2c,0x32,0x30,0x7d,0x2c,0x7b,0x32,0x34,0x2c,0x32,0x30,0x2c,0x32,0x31,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,
|
|
||||||
0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x64,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,
|
|
||||||
0x2c,0x0a,0x31,0x30,0x2c,0x31,0x31,0x2c,0x31,0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x2c,0x0a,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,
|
|
||||||
0x2c,0x0a,0x35,0x2c,0x36,0x2c,0x37,0x2c,0x38,0x2c,0x39,0x2c,0x0a,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x0a,0x7d,0x3b,0x0a,0x5f,
|
|
||||||
0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,
|
|
||||||
0x7a,0x65,0x28,0x33,0x32,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x28,
|
|
||||||
0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x73,0x2c,0x5f,
|
|
||||||
0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,
|
|
||||||
0x7a,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,
|
|
||||||
0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,
|
|
||||||
0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,
|
|
||||||
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,
|
|
||||||
0x3d,0x32,0x35,0x29,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,
|
|
||||||
0x25,0x20,0x35,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,
|
|
||||||
0x3d,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x2a,0x67,0x3b,0x0a,0x5f,0x5f,0x67,
|
|
||||||
0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,
|
|
||||||
0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x73,0x2b,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x3b,
|
|
||||||
0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,
|
|
||||||
0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,0x5d,0x2b,0x31,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,
|
|
||||||
0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,
|
|
||||||
0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,
|
|
||||||
0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,
|
|
||||||
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,
|
|
||||||
0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,
|
|
||||||
0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,0x3b,0x0a,0x66,0x6f,0x72,
|
|
||||||
0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x77,0x6f,0x72,0x64,0x73,0x3b,0x20,0x2b,0x2b,0x69,0x2c,0x2b,0x2b,0x69,
|
|
||||||
0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x2a,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,
|
|
||||||
0x2b,0x2b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3b,0x0a,0x69,0x66,0x28,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x3d,0x31,0x37,0x29,0x0a,0x7b,
|
|
||||||
0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x28,0x52,0x4f,0x55,0x4e,0x44,0x53,0x29,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,
|
|
||||||
0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,
|
|
||||||
0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,
|
|
||||||
0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,
|
|
||||||
0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,
|
|
||||||
0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,
|
|
||||||
0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,
|
|
||||||
0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,
|
|
||||||
0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x3d,0x30,
|
|
||||||
0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x28,0x5f,0x5f,0x67,
|
|
||||||
0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x29,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x66,0x6f,0x72,0x20,
|
|
||||||
0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x20,0x2b,0x2b,0x69,0x29,
|
|
||||||
0x0a,0x7b,0x0a,0x74,0x61,0x69,0x6c,0x7c,0x3d,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x70,0x5b,0x69,0x5d,0x29,0x3c,0x3c,0x28,0x69,0x2a,0x38,0x29,
|
|
||||||
0x3b,0x0a,0x7d,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x74,0x61,0x69,0x6c,0x5e,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,
|
|
||||||
0x34,0x5f,0x74,0x29,0x28,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,
|
|
||||||
0x28,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,0x38,0x29,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,
|
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x28,0x31,
|
|
||||||
0x29,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,
|
|
||||||
0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,
|
|
||||||
0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,
|
|
||||||
0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,
|
|
||||||
0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,
|
|
||||||
0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,
|
|
||||||
0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,
|
|
||||||
0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,
|
|
||||||
0x32,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,
|
|
||||||
0x5b,0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,
|
|
||||||
0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x28,0x33,0x32,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,
|
|
||||||
0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x5f,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,
|
|
||||||
0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,
|
|
||||||
0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
|
||||||
0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,
|
|
||||||
0x32,0x5f,0x74,0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,
|
|
||||||
0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,
|
|
||||||
0x35,0x29,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,
|
|
||||||
0x35,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,
|
|
||||||
0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x29,0x3b,0x0a,0x5f,0x5f,
|
|
||||||
0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,
|
|
||||||
0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x44,
|
|
||||||
0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x28,0x74,0x3c,0x31,0x36,0x29,0x3f,0x69,0x6e,0x70,0x75,0x74,0x5b,0x74,0x5d,0x3a,0x30,0x3b,0x0a,0x5f,0x5f,
|
|
||||||
0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x3d,0x28,0x5f,0x5f,0x6c,0x6f,0x63,
|
|
||||||
0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x29,0x28,0x41,0x29,0x2b,0x39,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x2b,0x3d,0x67,0x3b,0x0a,0x6e,0x6f,
|
|
||||||
0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,0x3d,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,0x26,0x30,0x78,0x46,0x46,0x46,0x46,0x46,
|
|
||||||
0x46,0x55,0x29,0x7c,0x28,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x26,0x30,0x78,0x46,0x46,0x29,0x3c,0x3c,0x32,0x34,0x29,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,
|
|
||||||
0x73,0x5b,0x31,0x5d,0x3d,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x31,0x5d,0x26,0x30,0x78,0x46,0x46,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x29,0x7c,
|
|
||||||
0x28,0x6e,0x6f,0x6e,0x63,0x65,0x3e,0x3e,0x38,0x29,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x69,
|
|
||||||
0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,
|
|
||||||
0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,
|
|
||||||
0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,
|
|
||||||
0x20,0x5e,0x3d,0x20,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,
|
|
||||||
0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,0x28,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,0x38,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,
|
|
||||||
0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,
|
|
||||||
0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x28,0x52,0x4f,0x55,0x4e,0x44,0x53,0x29,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,
|
|
||||||
0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,
|
|
||||||
0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,
|
|
||||||
0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,
|
|
||||||
0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,
|
|
||||||
0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,
|
|
||||||
0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,
|
|
||||||
0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,
|
|
||||||
0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,0x32,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,
|
|
||||||
0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x00
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ __kernel void Salsa20_XORKeyStream(__global const uint32_t* keys, __global uint3
|
|||||||
uint32_t x14 = j14;
|
uint32_t x14 = j14;
|
||||||
uint32_t x15 = j15;
|
uint32_t x15 = j15;
|
||||||
|
|
||||||
#pragma unroll(5)
|
#pragma unroll 5
|
||||||
for (uint32_t j = 0; j < 10; ++j)
|
for (uint32_t j = 0; j < 10; ++j)
|
||||||
{
|
{
|
||||||
x4 = XOR( x4,ROTATE(PLUS( x0,x12), 7));
|
x4 = XOR( x4,ROTATE(PLUS( x0,x12), 7));
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ __kernel void sha3(__global const uint8_t* inputs, __global const uint32_t* inpu
|
|||||||
++wordIndex;
|
++wordIndex;
|
||||||
if (wordIndex == 17)
|
if (wordIndex == 17)
|
||||||
{
|
{
|
||||||
#pragma unroll(ROUNDS)
|
#pragma unroll ROUNDS
|
||||||
for (int i = 0; i < ROUNDS; ++i)
|
for (int i = 0; i < ROUNDS; ++i)
|
||||||
{
|
{
|
||||||
C[t] = A[s] ^ A[s+5] ^ A[s+10] ^ A[s+15] ^ A[s+20];
|
C[t] = A[s] ^ A[s+5] ^ A[s+10] ^ A[s+15] ^ A[s+20];
|
||||||
@@ -133,7 +133,7 @@ __kernel void sha3(__global const uint8_t* inputs, __global const uint32_t* inpu
|
|||||||
A[wordIndex] ^= tail ^ ((uint64_t)(((uint64_t)(0x02 | (1 << 2))) << (tail_size * 8)));
|
A[wordIndex] ^= tail ^ ((uint64_t)(((uint64_t)(0x02 | (1 << 2))) << (tail_size * 8)));
|
||||||
A[16] ^= 0x8000000000000000UL;
|
A[16] ^= 0x8000000000000000UL;
|
||||||
|
|
||||||
#pragma unroll(1)
|
#pragma unroll 1
|
||||||
for (int i = 0; i < ROUNDS; ++i)
|
for (int i = 0; i < ROUNDS; ++i)
|
||||||
{
|
{
|
||||||
C[t] = A[s] ^ A[s+5] ^ A[s+10] ^ A[s+15] ^ A[s+20];
|
C[t] = A[s] ^ A[s+5] ^ A[s+10] ^ A[s+15] ^ A[s+20];
|
||||||
@@ -180,7 +180,7 @@ __kernel void sha3_initial(__global const uint8_t* input_data, uint32_t input_si
|
|||||||
A[wordIndex] ^= (uint64_t)(((uint64_t)(0x02 | (1 << 2))) << (tail_size * 8));
|
A[wordIndex] ^= (uint64_t)(((uint64_t)(0x02 | (1 << 2))) << (tail_size * 8));
|
||||||
A[16] ^= 0x8000000000000000UL;
|
A[16] ^= 0x8000000000000000UL;
|
||||||
|
|
||||||
#pragma unroll(ROUNDS)
|
#pragma unroll ROUNDS
|
||||||
for (int i = 0; i < ROUNDS; ++i)
|
for (int i = 0; i < ROUNDS; ++i)
|
||||||
{
|
{
|
||||||
C[t] = A[s] ^ A[s+5] ^ A[s+10] ^ A[s+15] ^ A[s+20];
|
C[t] = A[s] ^ A[s+5] ^ A[s+10] ^ A[s+15] ^ A[s+20];
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ inline ulong getIdx()
|
|||||||
|
|
||||||
|
|
||||||
__attribute__((reqd_work_group_size(8, 8, 1)))
|
__attribute__((reqd_work_group_size(8, 8, 1)))
|
||||||
__kernel void cn0(__global ulong *input, __global uint4 *Scratchpad, __global ulong *states, uint Threads)
|
__kernel void cn0(__global ulong *input, int inlen, __global uint4 *Scratchpad, __global ulong *states, uint Threads)
|
||||||
{
|
{
|
||||||
uint ExpandedKey1[40];
|
uint ExpandedKey1[40];
|
||||||
__local uint AES0[256], AES1[256], AES2[256], AES3[256];
|
__local uint AES0[256], AES1[256], AES2[256], AES3[256];
|
||||||
@@ -109,34 +109,25 @@ __kernel void cn0(__global ulong *input, __global uint4 *Scratchpad, __global ul
|
|||||||
if (get_local_id(1) == 0) {
|
if (get_local_id(1) == 0) {
|
||||||
__local ulong* State = State_buf + get_local_id(0) * 25;
|
__local ulong* State = State_buf + get_local_id(0) * 25;
|
||||||
|
|
||||||
((__local ulong8 *)State)[0] = vload8(0, input);
|
#pragma unroll
|
||||||
State[8] = input[8];
|
for (int i = 0; i < 25; ++i) {
|
||||||
State[9] = input[9];
|
State[i] = 0;
|
||||||
State[10] = input[10];
|
|
||||||
State[11] = input[11];
|
|
||||||
State[12] = input[12];
|
|
||||||
State[13] = input[13];
|
|
||||||
State[14] = input[14];
|
|
||||||
State[15] = input[15];
|
|
||||||
|
|
||||||
((__local uint *)State)[9] &= 0x00FFFFFFU;
|
|
||||||
((__local uint *)State)[9] |= (((uint)get_global_id(0)) & 0xFF) << 24;
|
|
||||||
((__local uint *)State)[10] &= 0xFF000000U;
|
|
||||||
/* explicit cast to `uint` is required because some OpenCL implementations (e.g. NVIDIA)
|
|
||||||
* handle get_global_id and get_global_offset as signed long long int and add
|
|
||||||
* 0xFFFFFFFF... to `get_global_id` if we set on host side a 32bit offset where the first bit is `1`
|
|
||||||
* (even if it is correct casted to unsigned on the host)
|
|
||||||
*/
|
|
||||||
((__local uint *)State)[10] |= (((uint)get_global_id(0) >> 8));
|
|
||||||
|
|
||||||
// Last bit of padding
|
|
||||||
State[16] = 0x8000000000000000UL;
|
|
||||||
|
|
||||||
for (int i = 17; i < 25; ++i) {
|
|
||||||
State[i] = 0x00UL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
keccakf1600_2(State);
|
// Input length must be a multiple of 136 and padded on the host side
|
||||||
|
for (int i = 0; inlen > 0; i += 17, inlen -= 136) {
|
||||||
|
#pragma unroll
|
||||||
|
for (int j = 0; j < 17; ++j) {
|
||||||
|
State[j] ^= input[i + j];
|
||||||
|
}
|
||||||
|
if (i == 0) {
|
||||||
|
((__local uint *)State)[9] &= 0x00FFFFFFU;
|
||||||
|
((__local uint *)State)[9] |= (((uint)get_global_id(0)) & 0xFF) << 24;
|
||||||
|
((__local uint *)State)[10] &= 0xFF000000U;
|
||||||
|
((__local uint *)State)[10] |= (((uint)get_global_id(0) >> 8));
|
||||||
|
}
|
||||||
|
keccakf1600_2(State);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma unroll 1
|
#pragma unroll 1
|
||||||
for (int i = 0; i < 25; ++i) {
|
for (int i = 0; i < 25; ++i) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -38,10 +38,11 @@ void xmrig::Cn0Kernel::enqueue(cl_command_queue queue, uint32_t nonce, size_t th
|
|||||||
|
|
||||||
|
|
||||||
// __kernel void cn0(__global ulong *input, __global uint4 *Scratchpad, __global ulong *states, uint Threads)
|
// __kernel void cn0(__global ulong *input, __global uint4 *Scratchpad, __global ulong *states, uint Threads)
|
||||||
void xmrig::Cn0Kernel::setArgs(cl_mem input, cl_mem scratchpads, cl_mem states, uint32_t threads)
|
void xmrig::Cn0Kernel::setArgs(cl_mem input, int inlen, cl_mem scratchpads, cl_mem states, uint32_t threads)
|
||||||
{
|
{
|
||||||
setArg(0, sizeof(cl_mem), &input);
|
setArg(0, sizeof(cl_mem), &input);
|
||||||
setArg(1, sizeof(cl_mem), &scratchpads);
|
setArg(1, sizeof(int), &inlen);
|
||||||
setArg(2, sizeof(cl_mem), &states);
|
setArg(2, sizeof(cl_mem), &scratchpads);
|
||||||
setArg(3, sizeof(uint32_t), &threads);
|
setArg(3, sizeof(cl_mem), &states);
|
||||||
|
setArg(4, sizeof(uint32_t), &threads);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
inline Cn0Kernel(cl_program program) : OclKernel(program, "cn0") {}
|
inline Cn0Kernel(cl_program program) : OclKernel(program, "cn0") {}
|
||||||
|
|
||||||
void enqueue(cl_command_queue queue, uint32_t nonce, size_t threads);
|
void enqueue(cl_command_queue queue, uint32_t nonce, size_t threads);
|
||||||
void setArgs(cl_mem input, cl_mem scratchpads, cl_mem states, uint32_t threads);
|
void setArgs(cl_mem input, int inlen, cl_mem scratchpads, cl_mem states, uint32_t threads);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_OPENCL)
|
||||||
|
message(WARNING "OpenCL backend is not compatible with static build, use -DWITH_OPENCL=OFF to suppress this warning")
|
||||||
|
|
||||||
|
set(WITH_OPENCL OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WITH_OPENCL)
|
if (WITH_OPENCL)
|
||||||
add_definitions(/DCL_TARGET_OPENCL_VERSION=200)
|
add_definitions(/DCL_TARGET_OPENCL_VERSION=200)
|
||||||
add_definitions(/DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
|
add_definitions(/DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
|
||||||
|
|||||||
@@ -122,10 +122,16 @@ void xmrig::OclCnRunner::set(const Job &job, uint8_t *blob)
|
|||||||
throw std::length_error("job size too big");
|
throw std::length_error("job size too big");
|
||||||
}
|
}
|
||||||
|
|
||||||
blob[job.size()] = 0x01;
|
const int inlen = static_cast<int>(job.size() + 136 - (job.size() % 136));
|
||||||
memset(blob + job.size() + 1, 0, Job::kMaxBlobSize - job.size() - 1);
|
|
||||||
|
|
||||||
enqueueWriteBuffer(m_input, CL_TRUE, 0, Job::kMaxBlobSize, blob);
|
blob[job.size()] = 0x01;
|
||||||
|
memset(blob + job.size() + 1, 0, inlen - job.size() - 1);
|
||||||
|
|
||||||
|
blob[inlen - 1] |= 0x80;
|
||||||
|
|
||||||
|
enqueueWriteBuffer(m_input, CL_TRUE, 0, inlen, blob);
|
||||||
|
|
||||||
|
m_cn0->setArg(1, sizeof(int), &inlen);
|
||||||
|
|
||||||
if (m_algorithm == Algorithm::CN_R && m_height != job.height()) {
|
if (m_algorithm == Algorithm::CN_R && m_height != job.height()) {
|
||||||
delete m_cn1;
|
delete m_cn1;
|
||||||
@@ -152,7 +158,7 @@ void xmrig::OclCnRunner::build()
|
|||||||
OclBaseRunner::build();
|
OclBaseRunner::build();
|
||||||
|
|
||||||
m_cn0 = new Cn0Kernel(m_program);
|
m_cn0 = new Cn0Kernel(m_program);
|
||||||
m_cn0->setArgs(m_input, m_scratchpads, m_states, m_intensity);
|
m_cn0->setArgs(m_input, 0, m_scratchpads, m_states, m_intensity);
|
||||||
|
|
||||||
m_cn2 = new Cn2Kernel(m_program);
|
m_cn2 = new Cn2Kernel(m_program);
|
||||||
m_cn2->setArgs(m_scratchpads, m_states, m_branches, m_intensity);
|
m_cn2->setArgs(m_scratchpads, m_states, m_branches, m_intensity);
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void OclKawPowRunner::set(const Job &job, uint8_t *blob)
|
|||||||
const uint32_t dag_words = dag_size / sizeof(node);
|
const uint32_t dag_words = dag_size / sizeof(node);
|
||||||
m_calculateDagKernel->setArgs(0, m_lightCache, m_dag, dag_words, m_lightCacheSize / sizeof(node));
|
m_calculateDagKernel->setArgs(0, m_lightCache, m_dag, dag_words, m_lightCacheSize / sizeof(node));
|
||||||
|
|
||||||
constexpr uint32_t N = 1 << 20;
|
constexpr uint32_t N = 1 << 18;
|
||||||
|
|
||||||
for (uint32_t start = 0; start < dag_words; start += N) {
|
for (uint32_t start = 0; start < dag_words; start += N) {
|
||||||
m_calculateDagKernel->setArg(0, sizeof(start), &start);
|
m_calculateDagKernel->setArg(0, sizeof(start), &start);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
|
* Copyright 2020 Patrick Bollinger <https://github.com/pjbollinger>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -82,7 +83,7 @@ static inline std::string sysfs_prefix(const PciTopology &topology)
|
|||||||
|
|
||||||
for (uint32_t i = 1; i < 10; ++i) {
|
for (uint32_t i = 1; i < 10; ++i) {
|
||||||
const std::string prefix = path + std::to_string(i) + "/";
|
const std::string prefix = path + std::to_string(i) + "/";
|
||||||
if (sysfs_is_amdgpu(prefix + "name") && sysfs_read(prefix + "freq1_input")) {
|
if (sysfs_is_amdgpu(prefix + "name") && (sysfs_read(prefix + "temp1_input") || sysfs_read(prefix + "power1_average"))) {
|
||||||
return prefix;
|
return prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,6 +117,7 @@ void xmrig::AdlLib::close()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
|
||||||
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
||||||
{
|
{
|
||||||
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
|
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
|
||||||
@@ -134,6 +136,10 @@ AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
|||||||
health.rpm = sysfs_read(prefix + "fan1_input");
|
health.rpm = sysfs_read(prefix + "fan1_input");
|
||||||
health.temperature = sysfs_read(prefix + "temp2_input") / 1000;
|
health.temperature = sysfs_read(prefix + "temp2_input") / 1000;
|
||||||
|
|
||||||
|
if (!health.temperature) {
|
||||||
|
health.temperature = sysfs_read(prefix + "temp1_input") / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
return health;
|
return health;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
static uv_lib_t oclLib;
|
static uv_lib_t oclLib;
|
||||||
|
|
||||||
static const char *kErrorTemplate = MAGENTA_BG_BOLD(WHITE_BOLD_S " ocl ") RED(" error ") RED_BOLD("%s") RED(" when calling ") RED_BOLD("%s");
|
static const char *kErrorTemplate = MAGENTA_BG_BOLD(WHITE_BOLD_S " opencl ") RED(" error ") RED_BOLD("%s") RED(" when calling ") RED_BOLD("%s");
|
||||||
|
|
||||||
static const char *kBuildProgram = "clBuildProgram";
|
static const char *kBuildProgram = "clBuildProgram";
|
||||||
static const char *kCreateBuffer = "clCreateBuffer";
|
static const char *kCreateBuffer = "clCreateBuffer";
|
||||||
|
|||||||
@@ -135,6 +135,12 @@ static AlgoName const algorithm_names[] = {
|
|||||||
} /* namespace xmrig */
|
} /* namespace xmrig */
|
||||||
|
|
||||||
|
|
||||||
|
xmrig::Algorithm::Algorithm(const rapidjson::Value &value) :
|
||||||
|
m_id(parse(value.GetString()))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rapidjson::Value xmrig::Algorithm::toJSON() const
|
rapidjson::Value xmrig::Algorithm::toJSON() const
|
||||||
{
|
{
|
||||||
using namespace rapidjson;
|
using namespace rapidjson;
|
||||||
@@ -143,6 +149,12 @@ rapidjson::Value xmrig::Algorithm::toJSON() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rapidjson::Value xmrig::Algorithm::toJSON(rapidjson::Document &) const
|
||||||
|
{
|
||||||
|
return toJSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t xmrig::Algorithm::l2() const
|
size_t xmrig::Algorithm::l2() const
|
||||||
{
|
{
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public:
|
|||||||
inline Algorithm() = default;
|
inline Algorithm() = default;
|
||||||
inline Algorithm(const char *algo) : m_id(parse(algo)) {}
|
inline Algorithm(const char *algo) : m_id(parse(algo)) {}
|
||||||
inline Algorithm(Id id) : m_id(id) {}
|
inline Algorithm(Id id) : m_id(id) {}
|
||||||
|
Algorithm(const rapidjson::Value &value);
|
||||||
|
|
||||||
inline bool isCN() const { auto f = family(); return f == CN || f == CN_LITE || f == CN_HEAVY || f == CN_PICO; }
|
inline bool isCN() const { auto f = family(); return f == CN || f == CN_LITE || f == CN_HEAVY || f == CN_PICO; }
|
||||||
inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; }
|
inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; }
|
||||||
@@ -108,6 +109,7 @@ public:
|
|||||||
inline operator Algorithm::Id() const { return m_id; }
|
inline operator Algorithm::Id() const { return m_id; }
|
||||||
|
|
||||||
rapidjson::Value toJSON() const;
|
rapidjson::Value toJSON() const;
|
||||||
|
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||||
size_t l2() const;
|
size_t l2() const;
|
||||||
size_t l3() const;
|
size_t l3() const;
|
||||||
uint32_t maxIntensity() const;
|
uint32_t maxIntensity() const;
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ static const rapidjson::Value kNullValue;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xmrig::JsonChain::JsonChain()
|
xmrig::JsonChain::JsonChain() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::JsonChain::add(rapidjson::Document &&doc)
|
bool xmrig::JsonChain::add(rapidjson::Document &&doc)
|
||||||
@@ -66,8 +64,10 @@ bool xmrig::JsonChain::addFile(const char *fileName)
|
|||||||
if (doc.HasParseError()) {
|
if (doc.HasParseError()) {
|
||||||
const size_t offset = doc.GetErrorOffset();
|
const size_t offset = doc.GetErrorOffset();
|
||||||
|
|
||||||
size_t line, pos;
|
size_t line;
|
||||||
|
size_t pos;
|
||||||
std::vector<std::string> s;
|
std::vector<std::string> s;
|
||||||
|
|
||||||
if (Json::convertOffset(fileName, offset, line, pos, s)) {
|
if (Json::convertOffset(fileName, offset, line, pos, s)) {
|
||||||
for (const auto& t : s) {
|
for (const auto& t : s) {
|
||||||
LOG_ERR("%s", t.c_str());
|
LOG_ERR("%s", t.c_str());
|
||||||
|
|||||||
@@ -81,7 +81,13 @@ private:
|
|||||||
#define CLEAR CSI "0m" // all attributes off
|
#define CLEAR CSI "0m" // all attributes off
|
||||||
#define BRIGHT_BLACK_S CSI "0;90m" // somewhat MD.GRAY
|
#define BRIGHT_BLACK_S CSI "0;90m" // somewhat MD.GRAY
|
||||||
#define BLACK_S CSI "0;30m"
|
#define BLACK_S CSI "0;30m"
|
||||||
#define BLACK_BOLD_S CSI "1;30m" // another name for GRAY
|
|
||||||
|
#ifdef XMRIG_OS_APPLE
|
||||||
|
# define BLACK_BOLD_S CSI "0;37m"
|
||||||
|
#else
|
||||||
|
# define BLACK_BOLD_S CSI "1;30m" // another name for GRAY
|
||||||
|
#endif
|
||||||
|
|
||||||
#define RED_S CSI "0;31m"
|
#define RED_S CSI "0;31m"
|
||||||
#define RED_BOLD_S CSI "1;31m"
|
#define RED_BOLD_S CSI "1;31m"
|
||||||
#define GREEN_S CSI "0;32m"
|
#define GREEN_S CSI "0;32m"
|
||||||
|
|||||||
@@ -73,6 +73,16 @@ const char *xmrig::Tags::randomx()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_PROXY_PROJECT
|
||||||
|
const char *xmrig::Tags::proxy()
|
||||||
|
{
|
||||||
|
static const char *tag = MAGENTA_BG_BOLD(WHITE_BOLD_S " proxy ");
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_CUDA
|
#ifdef XMRIG_FEATURE_CUDA
|
||||||
const char *xmrig::Tags::nvidia()
|
const char *xmrig::Tags::nvidia()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ public:
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_PROXY_PROJECT
|
||||||
|
static const char *proxy();
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_CUDA
|
# ifdef XMRIG_FEATURE_CUDA
|
||||||
static const char *nvidia();
|
static const char *nvidia();
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ static int showVersion()
|
|||||||
# if defined(LIBRESSL_VERSION_TEXT)
|
# if defined(LIBRESSL_VERSION_TEXT)
|
||||||
printf("LibreSSL/%s\n", LIBRESSL_VERSION_TEXT + 9);
|
printf("LibreSSL/%s\n", LIBRESSL_VERSION_TEXT + 9);
|
||||||
# elif defined(OPENSSL_VERSION_TEXT)
|
# elif defined(OPENSSL_VERSION_TEXT)
|
||||||
constexpr const char *v = OPENSSL_VERSION_TEXT + 8;
|
constexpr const char *v = &OPENSSL_VERSION_TEXT[8];
|
||||||
printf("OpenSSL/%.*s\n", static_cast<int>(strchr(v, ' ') - v), v);
|
printf("OpenSSL/%.*s\n", static_cast<int>(strchr(v, ' ') - v), v);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ public:
|
|||||||
|
|
||||||
static inline const char *userAgent() { return m_userAgent; }
|
static inline const char *userAgent() { return m_userAgent; }
|
||||||
|
|
||||||
|
static bool isOnBatteryPower();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static char *createUserAgent();
|
static char *createUserAgent();
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <IOKit/IOKitLib.h>
|
||||||
|
#include <IOKit/ps/IOPowerSources.h>
|
||||||
#include <mach/thread_act.h>
|
#include <mach/thread_act.h>
|
||||||
#include <mach/thread_policy.h>
|
#include <mach/thread_policy.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -29,6 +31,7 @@
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
#include "base/kernel/Platform.h"
|
#include "base/kernel/Platform.h"
|
||||||
@@ -107,3 +110,8 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||||||
setpriority(PRIO_PROCESS, 0, prio);
|
setpriority(PRIO_PROCESS, 0, prio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool xmrig::Platform::isOnBatteryPower()
|
||||||
|
{
|
||||||
|
return IOPSGetTimeRemainingEstimate() != kIOPSTimeRemainingUnlimited;
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
#include "base/kernel/Platform.h"
|
#include "base/kernel/Platform.h"
|
||||||
@@ -146,3 +147,19 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool xmrig::Platform::isOnBatteryPower()
|
||||||
|
{
|
||||||
|
for (int i = 0; i <= 1; ++i) {
|
||||||
|
char buf[64];
|
||||||
|
snprintf(buf, 64, "/sys/class/power_supply/BAT%d/status", i);
|
||||||
|
std::ifstream f(buf);
|
||||||
|
if (f.is_open()) {
|
||||||
|
std::string status;
|
||||||
|
f >> status;
|
||||||
|
return (status == "Discharging");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -157,3 +157,12 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||||||
SetThreadPriority(GetCurrentThread(), prio);
|
SetThreadPriority(GetCurrentThread(), prio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool xmrig::Platform::isOnBatteryPower()
|
||||||
|
{
|
||||||
|
SYSTEM_POWER_STATUS st;
|
||||||
|
if (GetSystemPowerStatus(&st)) {
|
||||||
|
return (st.ACLineStatus == 0);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ const char *BaseConfig::kColors = "colors";
|
|||||||
const char *BaseConfig::kDryRun = "dry-run";
|
const char *BaseConfig::kDryRun = "dry-run";
|
||||||
const char *BaseConfig::kHttp = "http";
|
const char *BaseConfig::kHttp = "http";
|
||||||
const char *BaseConfig::kLogFile = "log-file";
|
const char *BaseConfig::kLogFile = "log-file";
|
||||||
|
const char *BaseConfig::kPauseOnBattery = "pause-on-battery";
|
||||||
const char *BaseConfig::kPrintTime = "print-time";
|
const char *BaseConfig::kPrintTime = "print-time";
|
||||||
const char *BaseConfig::kSyslog = "syslog";
|
const char *BaseConfig::kSyslog = "syslog";
|
||||||
const char *BaseConfig::kTitle = "title";
|
const char *BaseConfig::kTitle = "title";
|
||||||
@@ -85,15 +86,16 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_autoSave = reader.getBool(kAutosave, m_autoSave);
|
m_autoSave = reader.getBool(kAutosave, m_autoSave);
|
||||||
m_background = reader.getBool(kBackground, m_background);
|
m_background = reader.getBool(kBackground, m_background);
|
||||||
m_dryRun = reader.getBool(kDryRun, m_dryRun);
|
m_dryRun = reader.getBool(kDryRun, m_dryRun);
|
||||||
m_syslog = reader.getBool(kSyslog, m_syslog);
|
m_syslog = reader.getBool(kSyslog, m_syslog);
|
||||||
m_watch = reader.getBool(kWatch, m_watch);
|
m_watch = reader.getBool(kWatch, m_watch);
|
||||||
m_logFile = reader.getString(kLogFile);
|
m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery);
|
||||||
m_userAgent = reader.getString(kUserAgent);
|
m_logFile = reader.getString(kLogFile);
|
||||||
m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U);
|
m_userAgent = reader.getString(kUserAgent);
|
||||||
m_title = reader.getValue(kTitle);
|
m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U);
|
||||||
|
m_title = reader.getValue(kTitle);
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_TLS
|
# ifdef XMRIG_FEATURE_TLS
|
||||||
m_tls = reader.getValue(kTls);
|
m_tls = reader.getValue(kTls);
|
||||||
@@ -155,7 +157,7 @@ void xmrig::BaseConfig::printVersions()
|
|||||||
snprintf(buf, sizeof buf, "LibreSSL/%s ", LIBRESSL_VERSION_TEXT + 9);
|
snprintf(buf, sizeof buf, "LibreSSL/%s ", LIBRESSL_VERSION_TEXT + 9);
|
||||||
libs += buf;
|
libs += buf;
|
||||||
# elif defined(OPENSSL_VERSION_TEXT)
|
# elif defined(OPENSSL_VERSION_TEXT)
|
||||||
constexpr const char *v = OPENSSL_VERSION_TEXT + 8;
|
constexpr const char *v = &OPENSSL_VERSION_TEXT[8];
|
||||||
snprintf(buf, sizeof buf, "OpenSSL/%.*s ", static_cast<int>(strchr(v, ' ') - v), v);
|
snprintf(buf, sizeof buf, "OpenSSL/%.*s ", static_cast<int>(strchr(v, ' ') - v), v);
|
||||||
libs += buf;
|
libs += buf;
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public:
|
|||||||
static const char *kDryRun;
|
static const char *kDryRun;
|
||||||
static const char *kHttp;
|
static const char *kHttp;
|
||||||
static const char *kLogFile;
|
static const char *kLogFile;
|
||||||
|
static const char *kPauseOnBattery;
|
||||||
static const char *kPrintTime;
|
static const char *kPrintTime;
|
||||||
static const char *kSyslog;
|
static const char *kSyslog;
|
||||||
static const char *kTitle;
|
static const char *kTitle;
|
||||||
@@ -71,6 +72,7 @@ public:
|
|||||||
inline bool isAutoSave() const { return m_autoSave; }
|
inline bool isAutoSave() const { return m_autoSave; }
|
||||||
inline bool isBackground() const { return m_background; }
|
inline bool isBackground() const { return m_background; }
|
||||||
inline bool isDryRun() const { return m_dryRun; }
|
inline bool isDryRun() const { return m_dryRun; }
|
||||||
|
inline bool isPauseOnBattery() const { return m_pauseOnBattery; }
|
||||||
inline bool isSyslog() const { return m_syslog; }
|
inline bool isSyslog() const { return m_syslog; }
|
||||||
inline const char *logFile() const { return m_logFile.data(); }
|
inline const char *logFile() const { return m_logFile.data(); }
|
||||||
inline const char *userAgent() const { return m_userAgent.data(); }
|
inline const char *userAgent() const { return m_userAgent.data(); }
|
||||||
@@ -95,12 +97,13 @@ public:
|
|||||||
void printVersions();
|
void printVersions();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_autoSave = true;
|
bool m_autoSave = true;
|
||||||
bool m_background = false;
|
bool m_background = false;
|
||||||
bool m_dryRun = false;
|
bool m_dryRun = false;
|
||||||
bool m_syslog = false;
|
bool m_pauseOnBattery = false;
|
||||||
bool m_upgrade = false;
|
bool m_syslog = false;
|
||||||
bool m_watch = true;
|
bool m_upgrade = false;
|
||||||
|
bool m_watch = true;
|
||||||
Http m_http;
|
Http m_http;
|
||||||
Pools m_pools;
|
Pools m_pools;
|
||||||
String m_apiId;
|
String m_apiId;
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
|||||||
case IConfig::HttpEnabledKey: /* --http-enabled */
|
case IConfig::HttpEnabledKey: /* --http-enabled */
|
||||||
case IConfig::DaemonKey: /* --daemon */
|
case IConfig::DaemonKey: /* --daemon */
|
||||||
case IConfig::VerboseKey: /* --verbose */
|
case IConfig::VerboseKey: /* --verbose */
|
||||||
|
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
|
||||||
return transformBoolean(doc, key, true);
|
return transformBoolean(doc, key, true);
|
||||||
|
|
||||||
case IConfig::ColorKey: /* --no-color */
|
case IConfig::ColorKey: /* --no-color */
|
||||||
@@ -305,6 +306,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
|
|||||||
case IConfig::NoTitleKey: /* --no-title */
|
case IConfig::NoTitleKey: /* --no-title */
|
||||||
return set(doc, BaseConfig::kTitle, enable);
|
return set(doc, BaseConfig::kTitle, enable);
|
||||||
|
|
||||||
|
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
|
||||||
|
return set(doc, BaseConfig::kPauseOnBattery, enable);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public:
|
|||||||
DataDirKey = 1035,
|
DataDirKey = 1035,
|
||||||
TitleKey = 1037,
|
TitleKey = 1037,
|
||||||
NoTitleKey = 1038,
|
NoTitleKey = 1038,
|
||||||
|
PauseOnBatteryKey = 1041,
|
||||||
|
|
||||||
// xmrig common
|
// xmrig common
|
||||||
CPUPriorityKey = 1021,
|
CPUPriorityKey = 1021,
|
||||||
@@ -101,6 +102,8 @@ public:
|
|||||||
YieldKey = 1030,
|
YieldKey = 1030,
|
||||||
AstroBWTMaxSizeKey = 1034,
|
AstroBWTMaxSizeKey = 1034,
|
||||||
AstroBWTAVX2Key = 1036,
|
AstroBWTAVX2Key = 1036,
|
||||||
|
Argon2ImplKey = 1039,
|
||||||
|
RandomXCacheQoSKey = 1040,
|
||||||
|
|
||||||
// xmrig amd
|
// xmrig amd
|
||||||
OclPlatformKey = 1400,
|
OclPlatformKey = 1400,
|
||||||
|
|||||||
@@ -126,6 +126,10 @@ bool xmrig::HttpContext::isRequest() const
|
|||||||
|
|
||||||
size_t xmrig::HttpContext::parse(const char *data, size_t size)
|
size_t xmrig::HttpContext::parse(const char *data, size_t size)
|
||||||
{
|
{
|
||||||
|
if (size == 0) {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
return http_parser_execute(m_parser, &http_settings, data, size);
|
return http_parser_execute(m_parser, &http_settings, data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,13 +29,20 @@ namespace xmrig {
|
|||||||
class HttpListener : public IHttpListener
|
class HttpListener : public IHttpListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline HttpListener(IHttpListener *listener, const char *tag = nullptr) : m_tag(tag), m_listener(listener) {}
|
inline HttpListener(IHttpListener *listener, const char *tag = nullptr) :
|
||||||
|
# ifdef APP_DEBUG
|
||||||
|
m_tag(tag),
|
||||||
|
# endif
|
||||||
|
m_listener(listener)
|
||||||
|
{}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onHttpData(const HttpData &data) override;
|
void onHttpData(const HttpData &data) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
# ifdef APP_DEBUG
|
||||||
const char *m_tag;
|
const char *m_tag;
|
||||||
|
# endif
|
||||||
IHttpListener *m_listener;
|
IHttpListener *m_listener;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ class Job
|
|||||||
public:
|
public:
|
||||||
// Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk.
|
// Max blob size is 84 (75 fixed + 9 variable), aligned to 96. https://github.com/xmrig/xmrig/issues/1 Thanks fireice-uk.
|
||||||
// SECOR increase requirements for blob size: https://github.com/xmrig/xmrig/issues/913
|
// SECOR increase requirements for blob size: https://github.com/xmrig/xmrig/issues/913
|
||||||
static constexpr const size_t kMaxBlobSize = 128;
|
// Haven (XHV) offshore increases requirements by adding pricing_record struct (192 bytes) to block_header.
|
||||||
|
// Round it up to 408 (136*3) for a convenient keccak calculation in OpenCL
|
||||||
|
static constexpr const size_t kMaxBlobSize = 408;
|
||||||
static constexpr const size_t kMaxSeedSize = 32;
|
static constexpr const size_t kMaxSeedSize = 32;
|
||||||
|
|
||||||
Job() = default;
|
Job() = default;
|
||||||
@@ -63,7 +65,7 @@ public:
|
|||||||
void setDiff(uint64_t diff);
|
void setDiff(uint64_t diff);
|
||||||
|
|
||||||
inline bool isNicehash() const { return m_nicehash; }
|
inline bool isNicehash() const { return m_nicehash; }
|
||||||
inline bool isValid() const { return m_size > 0 && m_diff > 0; }
|
inline bool isValid() const { return (m_size > 0 && m_diff > 0) || !m_poolWallet.isEmpty(); }
|
||||||
inline bool setId(const char *id) { return m_id = id; }
|
inline bool setId(const char *id) { return m_id = id; }
|
||||||
inline const Algorithm &algorithm() const { return m_algorithm; }
|
inline const Algorithm &algorithm() const { return m_algorithm; }
|
||||||
inline const Buffer &seed() const { return m_seed; }
|
inline const Buffer &seed() const { return m_seed; }
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "base/net/stratum/NetworkState.h"
|
#include "base/net/stratum/NetworkState.h"
|
||||||
#include "3rdparty/rapidjson/document.h"
|
#include "3rdparty/rapidjson/document.h"
|
||||||
|
#include "base/io/log/Log.h"
|
||||||
#include "base/kernel/interfaces/IClient.h"
|
#include "base/kernel/interfaces/IClient.h"
|
||||||
#include "base/kernel/interfaces/IStrategy.h"
|
#include "base/kernel/interfaces/IStrategy.h"
|
||||||
#include "base/net/stratum/Job.h"
|
#include "base/net/stratum/Job.h"
|
||||||
@@ -40,6 +41,80 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
inline static void printCount(uint64_t accepted, uint64_t rejected)
|
||||||
|
{
|
||||||
|
float percent = 100.0;
|
||||||
|
int color = 2;
|
||||||
|
|
||||||
|
if (!accepted) {
|
||||||
|
percent = 0.0;
|
||||||
|
color = 1;
|
||||||
|
}
|
||||||
|
else if (rejected) {
|
||||||
|
percent = static_cast<float>(accepted) / (accepted + rejected) * 100.0;
|
||||||
|
color = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CSI "1;3%dm%" PRIu64 CLEAR CSI "0;3%dm (%1.1f%%)", "accepted", color, accepted, color, percent);
|
||||||
|
|
||||||
|
if (rejected) {
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") RED_BOLD("%" PRIu64), "rejected", rejected);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline static void printHashes(uint64_t accepted, uint64_t hashes)
|
||||||
|
{
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CYAN_BOLD("%" PRIu64) " avg " CYAN("%1.0f"),
|
||||||
|
"pool-side hashes", hashes, static_cast<double>(hashes) / accepted);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline static void printAvgTime(uint64_t time)
|
||||||
|
{
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CSI "1;3%dm%1.1fs", "avg result time", (time < 10000 ? 3 : 2), time / 1000.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void printDiff(uint64_t diff)
|
||||||
|
{
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CYAN_BOLD("%s"), "difficulty", NetworkState::humanDiff(diff).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline static void printDiff(size_t i, uint64_t diff, uint64_t hashes)
|
||||||
|
{
|
||||||
|
if (!diff) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const double effort = static_cast<double>(hashes) / diff * 100.0;
|
||||||
|
const double target = (i + 1) * 100.0;
|
||||||
|
const int color = effort > (target + 100.0) ? 1 : (effort > target ? 3 : 2);
|
||||||
|
|
||||||
|
Log::print("%3zu | %10s | " CSI "0;3%dm%8.2f" CLEAR " |", i + 1, NetworkState::humanDiff(diff).c_str(), color, effort);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline static void printLatency(uint32_t latency)
|
||||||
|
{
|
||||||
|
if (!latency) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int color = latency < 100 ? 2 : (latency > 500 ? 1 : 3);
|
||||||
|
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CSI "1;3%dm%ums", "ping time", color, latency);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xmrig::NetworkState::NetworkState(IStrategyListener *listener) : StrategyProxy(listener)
|
xmrig::NetworkState::NetworkState(IStrategyListener *listener) : StrategyProxy(listener)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -54,7 +129,8 @@ rapidjson::Value xmrig::NetworkState::getConnection(rapidjson::Document &doc, in
|
|||||||
Value connection(kObjectType);
|
Value connection(kObjectType);
|
||||||
connection.AddMember("pool", StringRef(m_pool), allocator);
|
connection.AddMember("pool", StringRef(m_pool), allocator);
|
||||||
connection.AddMember("ip", m_ip.toJSON(), allocator);
|
connection.AddMember("ip", m_ip.toJSON(), allocator);
|
||||||
connection.AddMember("uptime", connectionTime(), allocator);
|
connection.AddMember("uptime", connectionTime() / 1000, allocator);
|
||||||
|
connection.AddMember("uptime_ms", connectionTime(), allocator);
|
||||||
connection.AddMember("ping", latency(), allocator);
|
connection.AddMember("ping", latency(), allocator);
|
||||||
connection.AddMember("failures", m_failures, allocator);
|
connection.AddMember("failures", m_failures, allocator);
|
||||||
connection.AddMember("tls", m_tls.toJSON(), allocator);
|
connection.AddMember("tls", m_tls.toJSON(), allocator);
|
||||||
@@ -64,7 +140,8 @@ rapidjson::Value xmrig::NetworkState::getConnection(rapidjson::Document &doc, in
|
|||||||
connection.AddMember("diff", m_diff, allocator);
|
connection.AddMember("diff", m_diff, allocator);
|
||||||
connection.AddMember("accepted", m_accepted, allocator);
|
connection.AddMember("accepted", m_accepted, allocator);
|
||||||
connection.AddMember("rejected", m_rejected, allocator);
|
connection.AddMember("rejected", m_rejected, allocator);
|
||||||
connection.AddMember("avg_time", avgTime(), allocator);
|
connection.AddMember("avg_time", avgTime() / 1000, allocator);
|
||||||
|
connection.AddMember("avg_time_ms", avgTime(), allocator);
|
||||||
connection.AddMember("hashes_total", m_hashes, allocator);
|
connection.AddMember("hashes_total", m_hashes, allocator);
|
||||||
|
|
||||||
if (version == 1) {
|
if (version == 1) {
|
||||||
@@ -85,11 +162,14 @@ rapidjson::Value xmrig::NetworkState::getResults(rapidjson::Document &doc, int v
|
|||||||
results.AddMember("diff_current", m_diff, allocator);
|
results.AddMember("diff_current", m_diff, allocator);
|
||||||
results.AddMember("shares_good", m_accepted, allocator);
|
results.AddMember("shares_good", m_accepted, allocator);
|
||||||
results.AddMember("shares_total", m_accepted + m_rejected, allocator);
|
results.AddMember("shares_total", m_accepted + m_rejected, allocator);
|
||||||
results.AddMember("avg_time", avgTime(), allocator);
|
results.AddMember("avg_time", avgTime() / 1000, allocator);
|
||||||
|
results.AddMember("avg_time_ms", avgTime(), allocator);
|
||||||
results.AddMember("hashes_total", m_hashes, allocator);
|
results.AddMember("hashes_total", m_hashes, allocator);
|
||||||
|
|
||||||
Value best(kArrayType);
|
Value best(kArrayType);
|
||||||
for (uint64_t i : topDiff) {
|
best.Reserve(m_topDiff.size(), allocator);
|
||||||
|
|
||||||
|
for (uint64_t i : m_topDiff) {
|
||||||
best.PushBack(i, allocator);
|
best.PushBack(i, allocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +184,84 @@ rapidjson::Value xmrig::NetworkState::getResults(rapidjson::Document &doc, int v
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void xmrig::NetworkState::printConnection() const
|
||||||
|
{
|
||||||
|
if (!m_active) {
|
||||||
|
LOG_NOTICE(YELLOW_BOLD_S "no active connection");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::print(MAGENTA_BOLD_S " - CONNECTION");
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CYAN_BOLD("%s ") BLACK_BOLD("(%s) ") GREEN_BOLD("%s"),
|
||||||
|
"pool address", m_pool, m_ip.data(), m_tls.isNull() ? "" : m_tls.data());
|
||||||
|
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") WHITE_BOLD("%s"), "algorithm", m_algorithm.shortName());
|
||||||
|
printDiff(m_diff);
|
||||||
|
printLatency(latency());
|
||||||
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-17s") CYAN_BOLD("%" PRIu64 "s"), "connection time", connectionTime() / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void xmrig::NetworkState::printResults() const
|
||||||
|
{
|
||||||
|
if (!m_hashes) {
|
||||||
|
LOG_NOTICE(YELLOW_BOLD_S "no any results yet");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::print(MAGENTA_BOLD_S " - RESULTS");
|
||||||
|
|
||||||
|
printCount(m_accepted, m_rejected);
|
||||||
|
printHashes(m_accepted, m_hashes);
|
||||||
|
printDiff(m_diff);
|
||||||
|
|
||||||
|
if (m_active && !m_latency.empty()) {
|
||||||
|
printAvgTime(avgTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::print(MAGENTA_BOLD_S " - TOP 10");
|
||||||
|
Log::print(WHITE_BOLD_S " # | DIFFICULTY | EFFORT %% |");
|
||||||
|
|
||||||
|
for (size_t i = 0; i < m_topDiff.size(); ++i) {
|
||||||
|
printDiff(i, m_topDiff[i], m_hashes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char *xmrig::NetworkState::scaleDiff(uint64_t &diff)
|
||||||
|
{
|
||||||
|
if (diff >= 100000000000) {
|
||||||
|
diff /= 1000000000;
|
||||||
|
|
||||||
|
return "G";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diff >= 100000000) {
|
||||||
|
diff /= 1000000;
|
||||||
|
|
||||||
|
return "M";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diff >= 1000000) {
|
||||||
|
diff /= 1000;
|
||||||
|
|
||||||
|
return "K";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string xmrig::NetworkState::humanDiff(uint64_t diff)
|
||||||
|
{
|
||||||
|
const char *scale = scaleDiff(diff);
|
||||||
|
|
||||||
|
return std::to_string(diff) + scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void xmrig::NetworkState::onActive(IStrategy *strategy, IClient *client)
|
void xmrig::NetworkState::onActive(IStrategy *strategy, IClient *client)
|
||||||
{
|
{
|
||||||
snprintf(m_pool, sizeof(m_pool) - 1, "%s:%d", client->pool().host().data(), client->pool().port());
|
snprintf(m_pool, sizeof(m_pool) - 1, "%s:%d", client->pool().host().data(), client->pool().port());
|
||||||
@@ -145,16 +303,6 @@ void xmrig::NetworkState::onResultAccepted(IStrategy *strategy, IClient *client,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t xmrig::NetworkState::avgTime() const
|
|
||||||
{
|
|
||||||
if (m_latency.empty()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return connectionTime() / (uint32_t)m_latency.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t xmrig::NetworkState::latency() const
|
uint32_t xmrig::NetworkState::latency() const
|
||||||
{
|
{
|
||||||
const size_t calls = m_latency.size();
|
const size_t calls = m_latency.size();
|
||||||
@@ -169,9 +317,19 @@ uint32_t xmrig::NetworkState::latency() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint64_t xmrig::NetworkState::avgTime() const
|
||||||
|
{
|
||||||
|
if (m_latency.empty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return connectionTime() / m_latency.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t xmrig::NetworkState::connectionTime() const
|
uint64_t xmrig::NetworkState::connectionTime() const
|
||||||
{
|
{
|
||||||
return m_active ? ((Chrono::steadyMSecs() - m_connectionTime) / 1000) : 0;
|
return m_active ? ((Chrono::steadyMSecs() - m_connectionTime)) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -185,10 +343,10 @@ void xmrig::NetworkState::add(const SubmitResult &result, const char *error)
|
|||||||
m_accepted++;
|
m_accepted++;
|
||||||
m_hashes += result.diff;
|
m_hashes += result.diff;
|
||||||
|
|
||||||
const size_t ln = topDiff.size() - 1;
|
const size_t ln = m_topDiff.size() - 1;
|
||||||
if (result.actualDiff > topDiff[ln]) {
|
if (result.actualDiff > m_topDiff[ln]) {
|
||||||
topDiff[ln] = result.actualDiff;
|
m_topDiff[ln] = result.actualDiff;
|
||||||
std::sort(topDiff.rbegin(), topDiff.rend());
|
std::sort(m_topDiff.rbegin(), m_topDiff.rend());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_latency.push_back(result.elapsed > 0xFFFF ? 0xFFFF : static_cast<uint16_t>(result.elapsed));
|
m_latency.push_back(result.elapsed > 0xFFFF ? 0xFFFF : static_cast<uint16_t>(result.elapsed));
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +53,12 @@ public:
|
|||||||
rapidjson::Value getResults(rapidjson::Document &doc, int version) const;
|
rapidjson::Value getResults(rapidjson::Document &doc, int version) const;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
void printConnection() const;
|
||||||
|
void printResults() const;
|
||||||
|
|
||||||
|
static const char *scaleDiff(uint64_t &diff);
|
||||||
|
static std::string humanDiff(uint64_t diff);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onActive(IStrategy *strategy, IClient *client) override;
|
void onActive(IStrategy *strategy, IClient *client) override;
|
||||||
void onJob(IStrategy *strategy, IClient *client, const Job &job, const rapidjson::Value ¶ms) override;
|
void onJob(IStrategy *strategy, IClient *client, const Job &job, const rapidjson::Value ¶ms) override;
|
||||||
@@ -59,8 +66,8 @@ protected:
|
|||||||
void onResultAccepted(IStrategy *strategy, IClient *client, const SubmitResult &result, const char *error) override;
|
void onResultAccepted(IStrategy *strategy, IClient *client, const SubmitResult &result, const char *error) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t avgTime() const;
|
|
||||||
uint32_t latency() const;
|
uint32_t latency() const;
|
||||||
|
uint64_t avgTime() const;
|
||||||
uint64_t connectionTime() const;
|
uint64_t connectionTime() const;
|
||||||
void add(const SubmitResult &result, const char *error);
|
void add(const SubmitResult &result, const char *error);
|
||||||
void stop();
|
void stop();
|
||||||
@@ -68,7 +75,7 @@ private:
|
|||||||
Algorithm m_algorithm;
|
Algorithm m_algorithm;
|
||||||
bool m_active = false;
|
bool m_active = false;
|
||||||
char m_pool[256]{};
|
char m_pool[256]{};
|
||||||
std::array<uint64_t, 10> topDiff { { } };
|
std::array<uint64_t, 10> m_topDiff { { } };
|
||||||
std::vector<uint16_t> m_latency;
|
std::vector<uint16_t> m_latency;
|
||||||
String m_fingerprint;
|
String m_fingerprint;
|
||||||
String m_ip;
|
String m_ip;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
"1gb-pages": false,
|
"1gb-pages": false,
|
||||||
"rdmsr": true,
|
"rdmsr": true,
|
||||||
"wrmsr": true,
|
"wrmsr": true,
|
||||||
|
"cache_qos": false,
|
||||||
"numa": true
|
"numa": true
|
||||||
},
|
},
|
||||||
"cpu": {
|
"cpu": {
|
||||||
@@ -90,5 +91,6 @@
|
|||||||
},
|
},
|
||||||
"user-agent": null,
|
"user-agent": null,
|
||||||
"verbose": 0,
|
"verbose": 0,
|
||||||
"watch": true
|
"watch": true,
|
||||||
|
"pause-on-battery": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,3 +98,10 @@ xmrig::Network *xmrig::Controller::network() const
|
|||||||
|
|
||||||
return m_network;
|
return m_network;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void xmrig::Controller::execCommand(char command)
|
||||||
|
{
|
||||||
|
miner()->execCommand(command);
|
||||||
|
network()->execCommand(command);
|
||||||
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
|
|
||||||
Miner *miner() const;
|
Miner *miner() const;
|
||||||
Network *network() const;
|
Network *network() const;
|
||||||
|
void execCommand(char command);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Miner *m_miner = nullptr;
|
Miner *m_miner = nullptr;
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ public:
|
|||||||
bool active = false;
|
bool active = false;
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
bool reset = true;
|
bool reset = true;
|
||||||
|
bool battery_power = false;
|
||||||
Controller *controller;
|
Controller *controller;
|
||||||
Job job;
|
Job job;
|
||||||
mutable std::map<Algorithm::Id, double> maxHashrate;
|
mutable std::map<Algorithm::Id, double> maxHashrate;
|
||||||
@@ -429,13 +430,24 @@ void xmrig::Miner::setEnabled(bool enabled)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (d_ptr->battery_power && enabled) {
|
||||||
|
LOG_INFO("%s " YELLOW_BOLD("can't resume while on battery power"), Tags::miner());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
d_ptr->enabled = enabled;
|
d_ptr->enabled = enabled;
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
LOG_INFO(GREEN_BOLD("resumed"));
|
LOG_INFO("%s " GREEN_BOLD("resumed"), Tags::miner());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG_INFO(YELLOW_BOLD("paused") ", press " MAGENTA_BG_BOLD(" r ") " to resume");
|
if (d_ptr->battery_power) {
|
||||||
|
LOG_INFO("%s " YELLOW_BOLD("paused"), Tags::miner());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LOG_INFO("%s " YELLOW_BOLD("paused") ", press " MAGENTA_BG_BOLD(" r ") " to resume", Tags::miner());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!d_ptr->active) {
|
if (!d_ptr->active) {
|
||||||
@@ -538,6 +550,20 @@ void xmrig::Miner::onTimer(const Timer *)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d_ptr->ticks++;
|
d_ptr->ticks++;
|
||||||
|
|
||||||
|
if (d_ptr->controller->config()->isPauseOnBattery()) {
|
||||||
|
const bool battery_power = Platform::isOnBatteryPower();
|
||||||
|
if (battery_power && d_ptr->enabled) {
|
||||||
|
LOG_INFO("%s " YELLOW_BOLD("on battery power"), Tags::miner());
|
||||||
|
d_ptr->battery_power = true;
|
||||||
|
setEnabled(false);
|
||||||
|
}
|
||||||
|
else if (!battery_power && !d_ptr->enabled && d_ptr->battery_power) {
|
||||||
|
LOG_INFO("%s " GREEN_BOLD("on AC power"), Tags::miner());
|
||||||
|
d_ptr->battery_power = false;
|
||||||
|
setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -252,4 +252,5 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
|||||||
doc.AddMember(StringRef(kUserAgent), m_userAgent.toJSON(), allocator);
|
doc.AddMember(StringRef(kUserAgent), m_userAgent.toJSON(), allocator);
|
||||||
doc.AddMember(StringRef(kVerbose), Log::verbose(), allocator);
|
doc.AddMember(StringRef(kVerbose), Log::verbose(), allocator);
|
||||||
doc.AddMember(StringRef(kWatch), m_watch, allocator);
|
doc.AddMember(StringRef(kWatch), m_watch, allocator);
|
||||||
|
doc.AddMember(StringRef(kPauseOnBattery), isPauseOnBattery(), allocator);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -151,6 +151,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||||||
case IConfig::YieldKey: /* --cpu-no-yield */
|
case IConfig::YieldKey: /* --cpu-no-yield */
|
||||||
return set(doc, kCpu, "yield", false);
|
return set(doc, kCpu, "yield", false);
|
||||||
|
|
||||||
|
case IConfig::Argon2ImplKey: /* --argon2-impl */
|
||||||
|
return set(doc, kCpu, "argon2-impl", arg);
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_ASM
|
# ifdef XMRIG_FEATURE_ASM
|
||||||
case IConfig::AssemblyKey: /* --asm */
|
case IConfig::AssemblyKey: /* --asm */
|
||||||
return set(doc, kCpu, "asm", arg);
|
return set(doc, kCpu, "asm", arg);
|
||||||
@@ -186,6 +189,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||||||
|
|
||||||
case IConfig::RandomXRdmsrKey: /* --randomx-no-rdmsr */
|
case IConfig::RandomXRdmsrKey: /* --randomx-no-rdmsr */
|
||||||
return set(doc, kRandomX, "rdmsr", false);
|
return set(doc, kRandomX, "rdmsr", false);
|
||||||
|
|
||||||
|
case IConfig::RandomXCacheQoSKey: /* --cache-qos */
|
||||||
|
return set(doc, kRandomX, "cache_qos", true);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_OPENCL
|
# ifdef XMRIG_FEATURE_OPENCL
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ R"===(
|
|||||||
"retry-pause": 5,
|
"retry-pause": 5,
|
||||||
"syslog": false,
|
"syslog": false,
|
||||||
"user-agent": null,
|
"user-agent": null,
|
||||||
"watch": true
|
"watch": true,
|
||||||
|
"pause-on-battery": false
|
||||||
}
|
}
|
||||||
)===";
|
)===";
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -87,11 +87,15 @@ static const option options[] = {
|
|||||||
{ "cpu-max-threads-hint", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
{ "cpu-max-threads-hint", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
||||||
{ "cpu-memory-pool", 1, nullptr, IConfig::MemoryPoolKey },
|
{ "cpu-memory-pool", 1, nullptr, IConfig::MemoryPoolKey },
|
||||||
{ "cpu-no-yield", 0, nullptr, IConfig::YieldKey },
|
{ "cpu-no-yield", 0, nullptr, IConfig::YieldKey },
|
||||||
|
{ "no-yield", 0, nullptr, IConfig::YieldKey },
|
||||||
|
{ "cpu-argon2-impl", 1, nullptr, IConfig::Argon2ImplKey },
|
||||||
|
{ "argon2-impl", 1, nullptr, IConfig::Argon2ImplKey },
|
||||||
{ "verbose", 0, nullptr, IConfig::VerboseKey },
|
{ "verbose", 0, nullptr, IConfig::VerboseKey },
|
||||||
{ "proxy", 1, nullptr, IConfig::ProxyKey },
|
{ "proxy", 1, nullptr, IConfig::ProxyKey },
|
||||||
{ "data-dir", 1, nullptr, IConfig::DataDirKey },
|
{ "data-dir", 1, nullptr, IConfig::DataDirKey },
|
||||||
{ "title", 1, nullptr, IConfig::TitleKey },
|
{ "title", 1, nullptr, IConfig::TitleKey },
|
||||||
{ "no-title", 0, nullptr, IConfig::NoTitleKey },
|
{ "no-title", 0, nullptr, IConfig::NoTitleKey },
|
||||||
|
{ "pause-on-battery", 0, nullptr, IConfig::PauseOnBatteryKey },
|
||||||
# ifdef XMRIG_FEATURE_TLS
|
# ifdef XMRIG_FEATURE_TLS
|
||||||
{ "tls", 0, nullptr, IConfig::TlsKey },
|
{ "tls", 0, nullptr, IConfig::TlsKey },
|
||||||
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },
|
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },
|
||||||
@@ -116,6 +120,8 @@ static const option options[] = {
|
|||||||
{ "wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey },
|
{ "wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey },
|
||||||
{ "randomx-no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
{ "randomx-no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
||||||
{ "no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
{ "no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
||||||
|
{ "randomx-cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey },
|
||||||
|
{ "cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey },
|
||||||
# endif
|
# endif
|
||||||
#ifdef XMRIG_ALGO_ASTROBWT
|
#ifdef XMRIG_ALGO_ASTROBWT
|
||||||
{ "astrobwt-max-size", 1, nullptr, IConfig::AstroBWTMaxSizeKey },
|
{ "astrobwt-max-size", 1, nullptr, IConfig::AstroBWTMaxSizeKey },
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ static inline const std::string &usage()
|
|||||||
u += " -r, --retries=N number of times to retry before switch to backup server (default: 5)\n";
|
u += " -r, --retries=N number of times to retry before switch to backup server (default: 5)\n";
|
||||||
u += " -R, --retry-pause=N time to pause between retries (default: 5)\n";
|
u += " -R, --retry-pause=N time to pause between retries (default: 5)\n";
|
||||||
u += " --user-agent set custom user-agent string for pool\n";
|
u += " --user-agent set custom user-agent string for pool\n";
|
||||||
u += " --donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n";
|
u += " --donate-level=N donate level, default 1%% (1 minute in 100 minutes)\n";
|
||||||
u += " --donate-over-proxy=N control donate over xmrig-proxy feature\n";
|
u += " --donate-over-proxy=N control donate over xmrig-proxy feature\n";
|
||||||
|
|
||||||
u += "\nCPU backend:\n";
|
u += "\nCPU backend:\n";
|
||||||
@@ -85,13 +85,18 @@ static inline const std::string &usage()
|
|||||||
u += " --no-huge-pages disable huge pages support\n";
|
u += " --no-huge-pages disable huge pages support\n";
|
||||||
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";
|
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";
|
||||||
|
|
||||||
|
# if defined(__x86_64__) || defined(_M_AMD64)
|
||||||
|
u += " --argon2-impl=IMPL argon2 implementation: x86_64, SSE2, SSSE3, XOP, AVX2, AVX-512F\n";
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
u += " --randomx-init=N threads count to initialize RandomX dataset\n";
|
u += " --randomx-init=N threads count to initialize RandomX dataset\n";
|
||||||
u += " --randomx-no-numa disable NUMA support for RandomX\n";
|
u += " --randomx-no-numa disable NUMA support for RandomX\n";
|
||||||
u += " --randomx-mode=MODE RandomX mode: auto, fast, light\n";
|
u += " --randomx-mode=MODE RandomX mode: auto, fast, light\n";
|
||||||
u += " --randomx-1gb-pages use 1GB hugepages for dataset (Linux only)\n";
|
u += " --randomx-1gb-pages use 1GB hugepages for RandomX dataset (Linux only)\n";
|
||||||
u += " --randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)\n";
|
u += " --randomx-wrmsr=N write custom value(s) to MSR registers or disable MSR mod (-1)\n";
|
||||||
u += " --randomx-no-rdmsr disable reverting initial MSR values on exit\n";
|
u += " --randomx-no-rdmsr disable reverting initial MSR values on exit\n";
|
||||||
|
u += " --randomx-cache-qos enable Cache QoS\n";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_ASTROBWT
|
# ifdef XMRIG_ALGO_ASTROBWT
|
||||||
@@ -99,16 +104,6 @@ static inline const std::string &usage()
|
|||||||
u += " --astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm";
|
u += " --astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_HTTP
|
|
||||||
u += "\nAPI:\n";
|
|
||||||
u += " --api-worker-id=ID custom worker-id for API\n";
|
|
||||||
u += " --api-id=ID custom instance ID for API\n";
|
|
||||||
u += " --http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n";
|
|
||||||
u += " --http-port=N bind port for HTTP API\n";
|
|
||||||
u += " --http-access-token=T access token for HTTP API\n";
|
|
||||||
u += " --http-no-restricted enable full remote access to HTTP API (only if access token set)\n";
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_OPENCL
|
# ifdef XMRIG_FEATURE_OPENCL
|
||||||
u += "\nOpenCL backend:\n";
|
u += "\nOpenCL backend:\n";
|
||||||
u += " --opencl enable OpenCL mining backend\n";
|
u += " --opencl enable OpenCL mining backend\n";
|
||||||
@@ -131,6 +126,16 @@ static inline const std::string &usage()
|
|||||||
u += " --no-nvml disable NVML (NVIDIA Management Library) support\n";
|
u += " --no-nvml disable NVML (NVIDIA Management Library) support\n";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_HTTP
|
||||||
|
u += "\nAPI:\n";
|
||||||
|
u += " --api-worker-id=ID custom worker-id for API\n";
|
||||||
|
u += " --api-id=ID custom instance ID for API\n";
|
||||||
|
u += " --http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n";
|
||||||
|
u += " --http-port=N bind port for HTTP API\n";
|
||||||
|
u += " --http-access-token=T access token for HTTP API\n";
|
||||||
|
u += " --http-no-restricted enable full remote access to HTTP API (only if access token set)\n";
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_TLS
|
# ifdef XMRIG_FEATURE_TLS
|
||||||
u += "\nTLS:\n";
|
u += "\nTLS:\n";
|
||||||
u += " --tls-gen=HOSTNAME generate TLS certificate for specific hostname\n";
|
u += " --tls-gen=HOSTNAME generate TLS certificate for specific hostname\n";
|
||||||
@@ -172,6 +177,7 @@ static inline const std::string &usage()
|
|||||||
u += " --title set custom console window title\n";
|
u += " --title set custom console window title\n";
|
||||||
u += " --no-title disable setting console window title\n";
|
u += " --no-title disable setting console window title\n";
|
||||||
# endif
|
# endif
|
||||||
|
u += " --pause-on-battery pause mine on battery power\n";
|
||||||
|
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ bool xmrig::argon2::Impl::select(const String &nameHint, bool benchmark)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hint.isEmpty() || argon2_select_impl_by_name(hint) == 0) {
|
if (!hint.isEmpty()) {
|
||||||
argon2_select_impl();
|
argon2_select_impl_by_name(hint);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "crypto/cn/CryptoNight_monero.h"
|
#include "crypto/cn/CryptoNight_monero.h"
|
||||||
#include "crypto/cn/CryptoNight.h"
|
#include "crypto/cn/CryptoNight.h"
|
||||||
#include "crypto/cn/soft_aes.h"
|
#include "crypto/cn/soft_aes.h"
|
||||||
#include "crypto/common/portable/mm_malloc.h"
|
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
@@ -68,34 +67,6 @@ static inline void do_skein_hash(const uint8_t *input, size_t len, uint8_t *outp
|
|||||||
void (* const extra_hashes[4])(const uint8_t *, size_t, uint8_t *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
|
void (* const extra_hashes[4])(const uint8_t *, size_t, uint8_t *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
|
||||||
|
|
||||||
|
|
||||||
static inline __attribute__((always_inline)) __m128i _mm_set_epi64x(const uint64_t a, const uint64_t b)
|
|
||||||
{
|
|
||||||
return vcombine_u64(vcreate_u64(b), vcreate_u64(a));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if __ARM_FEATURE_CRYPTO
|
|
||||||
static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v, __m128i rkey)
|
|
||||||
{
|
|
||||||
alignas(16) const __m128i zero = { 0 };
|
|
||||||
return veorq_u8(vaesmcq_u8(vaeseq_u8(v, zero)), rkey );
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static inline __attribute__((always_inline)) __m128i _mm_aesenc_si128(__m128i v, __m128i rkey)
|
|
||||||
{
|
|
||||||
alignas(16) const __m128i zero = { 0 };
|
|
||||||
return zero;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* this one was not implemented yet so here it is */
|
|
||||||
static inline __attribute__((always_inline)) uint64_t _mm_cvtsi128_si64(__m128i a)
|
|
||||||
{
|
|
||||||
return vgetq_lane_u64(a, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined (__arm64__) || defined (__aarch64__)
|
#if defined (__arm64__) || defined (__aarch64__)
|
||||||
static inline uint64_t __umul128(uint64_t a, uint64_t b, uint64_t* hi)
|
static inline uint64_t __umul128(uint64_t a, uint64_t b, uint64_t* hi)
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(XMRIG_ARM)
|
#if defined(XMRIG_ARM)
|
||||||
# include "crypto/cn/SSE2NEON.h"
|
# include "crypto/cn/sse2neon.h"
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# include <x86intrin.h>
|
# include <x86intrin.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
4151
src/crypto/cn/sse2neon.h
Normal file
4151
src/crypto/cn/sse2neon.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -51,6 +51,7 @@ static std::mutex mutex;
|
|||||||
|
|
||||||
xmrig::VirtualMemory::VirtualMemory(size_t size, bool hugePages, bool oneGbPages, bool usePool, uint32_t node, size_t alignSize) :
|
xmrig::VirtualMemory::VirtualMemory(size_t size, bool hugePages, bool oneGbPages, bool usePool, uint32_t node, size_t alignSize) :
|
||||||
m_size(align(size)),
|
m_size(align(size)),
|
||||||
|
m_capacity(m_size),
|
||||||
m_node(node)
|
m_node(node)
|
||||||
{
|
{
|
||||||
if (usePool) {
|
if (usePool) {
|
||||||
@@ -69,6 +70,7 @@ xmrig::VirtualMemory::VirtualMemory(size_t size, bool hugePages, bool oneGbPages
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oneGbPages && allocateOneGbPagesMemory()) {
|
if (oneGbPages && allocateOneGbPagesMemory()) {
|
||||||
|
m_capacity = align(size, 1ULL << 30);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
inline bool isHugePages() const { return m_flags.test(FLAG_HUGEPAGES); }
|
inline bool isHugePages() const { return m_flags.test(FLAG_HUGEPAGES); }
|
||||||
inline bool isOneGbPages() const { return m_flags.test(FLAG_1GB_PAGES); }
|
inline bool isOneGbPages() const { return m_flags.test(FLAG_1GB_PAGES); }
|
||||||
inline size_t size() const { return m_size; }
|
inline size_t size() const { return m_size; }
|
||||||
|
inline size_t capacity() const { return m_capacity; }
|
||||||
inline uint8_t *raw() const { return m_scratchpad; }
|
inline uint8_t *raw() const { return m_scratchpad; }
|
||||||
inline uint8_t *scratchpad() const { return m_scratchpad; }
|
inline uint8_t *scratchpad() const { return m_scratchpad; }
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ private:
|
|||||||
void freeLargePagesMemory();
|
void freeLargePagesMemory();
|
||||||
|
|
||||||
const size_t m_size;
|
const size_t m_size;
|
||||||
|
size_t m_capacity;
|
||||||
const uint32_t m_node;
|
const uint32_t m_node;
|
||||||
std::bitset<FLAG_MAX> m_flags;
|
std::bitset<FLAG_MAX> m_flags;
|
||||||
uint8_t *m_scratchpad = nullptr;
|
uint8_t *m_scratchpad = nullptr;
|
||||||
|
|||||||
@@ -82,7 +82,17 @@ void *xmrig::VirtualMemory::allocateLargePagesMemory(size_t size)
|
|||||||
# elif defined(__FreeBSD__)
|
# elif defined(__FreeBSD__)
|
||||||
void *mem = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_ALIGNED_SUPER | MAP_PREFAULT_READ, -1, 0);
|
void *mem = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_ALIGNED_SUPER | MAP_PREFAULT_READ, -1, 0);
|
||||||
# else
|
# else
|
||||||
void *mem = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0);
|
|
||||||
|
# if defined(MAP_HUGE_2MB)
|
||||||
|
constexpr int flag_2mb = MAP_HUGE_2MB;
|
||||||
|
# elif defined(MAP_HUGE_SHIFT)
|
||||||
|
constexpr int flag_2mb = (21 << MAP_HUGE_SHIFT);
|
||||||
|
# else
|
||||||
|
constexpr int flag_2mb = 0;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
void *mem = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE | flag_2mb, 0, 0);
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
return mem == MAP_FAILED ? nullptr : mem;
|
return mem == MAP_FAILED ? nullptr : mem;
|
||||||
|
|||||||
@@ -91,10 +91,10 @@ bool KPCache::init(uint32_t epoch)
|
|||||||
const uint32_t a = (cache_nodes * i) / n;
|
const uint32_t a = (cache_nodes * i) / n;
|
||||||
const uint32_t b = (cache_nodes * (i + 1)) / n;
|
const uint32_t b = (cache_nodes * (i + 1)) / n;
|
||||||
|
|
||||||
threads.emplace_back([this, a, b, cache_nodes, &cache]() {
|
threads.emplace_back([this, a, b, &cache]() {
|
||||||
for (uint32_t j = a; j < b; ++j) {
|
uint32_t j = a;
|
||||||
ethash_calculate_dag_item_opt(((node*)m_DAGCache.data()) + j, j, num_dataset_parents, &cache);
|
for (; j + 4 <= b; j += 4) ethash_calculate_dag_item4_opt(((node*)m_DAGCache.data()) + j, j, num_dataset_parents, &cache);
|
||||||
}
|
for (; j < b; ++j) ethash_calculate_dag_item_opt(((node*)m_DAGCache.data()) + j, j, num_dataset_parents, &cache);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -285,10 +285,7 @@ void KPHash::calculate(const KPCache& light_cache, uint32_t block_height, const
|
|||||||
uint32_t item_index = (mix[r % LANES][0] % num_items) * 4;
|
uint32_t item_index = (mix[r % LANES][0] % num_items) * 4;
|
||||||
|
|
||||||
node item[4];
|
node item[4];
|
||||||
ethash_calculate_dag_item_opt(item + 0, item_index + 0, KPCache::num_dataset_parents, &cache);
|
ethash_calculate_dag_item4_opt(item, item_index, KPCache::num_dataset_parents, &cache);
|
||||||
ethash_calculate_dag_item_opt(item + 1, item_index + 1, KPCache::num_dataset_parents, &cache);
|
|
||||||
ethash_calculate_dag_item_opt(item + 2, item_index + 2, KPCache::num_dataset_parents, &cache);
|
|
||||||
ethash_calculate_dag_item_opt(item + 3, item_index + 3, KPCache::num_dataset_parents, &cache);
|
|
||||||
|
|
||||||
uint32_t dst_counter = 0;
|
uint32_t dst_counter = 0;
|
||||||
uint32_t src_counter = 0;
|
uint32_t src_counter = 0;
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
mov rcx, rbp ;# ecx = ma
|
mov rcx, rbp ;# ecx = ma
|
||||||
shr rcx, 32
|
shr rcx, 32
|
||||||
and ecx, RANDOMX_DATASET_BASE_MASK
|
and ecx, RANDOMX_DATASET_BASE_MASK
|
||||||
|
xor r8, qword ptr [rdi+rcx]
|
||||||
xor rbp, rax ;# modify "mx"
|
xor rbp, rax ;# modify "mx"
|
||||||
mov rax, qword ptr [rdi+rcx]
|
|
||||||
mov edx, ebp ;# edx = mx
|
mov edx, ebp ;# edx = mx
|
||||||
and edx, RANDOMX_DATASET_BASE_MASK
|
and edx, RANDOMX_DATASET_BASE_MASK
|
||||||
prefetchnta byte ptr [rdi+rdx]
|
prefetchnta byte ptr [rdi+rdx]
|
||||||
ror rbp, 32 ;# swap "ma" and "mx"
|
ror rbp, 32 ;# swap "ma" and "mx"
|
||||||
xor r8, rax
|
|
||||||
xor r9, qword ptr [rdi+rcx+8]
|
xor r9, qword ptr [rdi+rcx+8]
|
||||||
xor r10, qword ptr [rdi+rcx+16]
|
xor r10, qword ptr [rdi+rcx+16]
|
||||||
xor r11, qword ptr [rdi+rcx+24]
|
xor r11, qword ptr [rdi+rcx+24]
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace randomx {
|
|||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (src != dst) {
|
if (src != dst) {
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ibc.isrc = &zero;
|
ibc.isrc = &zero;
|
||||||
@@ -142,7 +142,7 @@ namespace randomx {
|
|||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (src != dst) {
|
if (src != dst) {
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ibc.isrc = &zero;
|
ibc.isrc = &zero;
|
||||||
@@ -176,7 +176,7 @@ namespace randomx {
|
|||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (src != dst) {
|
if (src != dst) {
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ibc.isrc = &zero;
|
ibc.isrc = &zero;
|
||||||
@@ -204,7 +204,7 @@ namespace randomx {
|
|||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (src != dst) {
|
if (src != dst) {
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ibc.isrc = &zero;
|
ibc.isrc = &zero;
|
||||||
@@ -232,7 +232,7 @@ namespace randomx {
|
|||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (src != dst) {
|
if (src != dst) {
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ibc.isrc = &zero;
|
ibc.isrc = &zero;
|
||||||
@@ -290,7 +290,7 @@ namespace randomx {
|
|||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (src != dst) {
|
if (src != dst) {
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ibc.isrc = &zero;
|
ibc.isrc = &zero;
|
||||||
@@ -373,7 +373,7 @@ namespace randomx {
|
|||||||
ibc.type = InstructionType::FADD_M;
|
ibc.type = InstructionType::FADD_M;
|
||||||
ibc.fdst = &nreg->f[dst];
|
ibc.fdst = &nreg->f[dst];
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ namespace randomx {
|
|||||||
ibc.type = InstructionType::FSUB_M;
|
ibc.type = InstructionType::FSUB_M;
|
||||||
ibc.fdst = &nreg->f[dst];
|
ibc.fdst = &nreg->f[dst];
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -420,7 +420,7 @@ namespace randomx {
|
|||||||
ibc.type = InstructionType::FDIV_M;
|
ibc.type = InstructionType::FDIV_M;
|
||||||
ibc.fdst = &nreg->e[dst];
|
ibc.fdst = &nreg->e[dst];
|
||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -466,7 +466,7 @@ namespace randomx {
|
|||||||
ibc.isrc = &nreg->r[src];
|
ibc.isrc = &nreg->r[src];
|
||||||
ibc.imm = signExtend2sCompl(instr.getImm32());
|
ibc.imm = signExtend2sCompl(instr.getImm32());
|
||||||
if (instr.getModCond() < StoreL3Condition)
|
if (instr.getModCond() < StoreL3Condition)
|
||||||
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
|
ibc.memMask = AddressMask[instr.getModMem()];
|
||||||
else
|
else
|
||||||
ibc.memMask = ScratchpadL3Mask;
|
ibc.memMask = ScratchpadL3Mask;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -126,10 +126,7 @@ namespace randomx {
|
|||||||
double hi;
|
double hi;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ScratchpadL1Mask RandomX_CurrentConfig.ScratchpadL1Mask_Calculated
|
#define AddressMask RandomX_CurrentConfig.AddressMask_Calculated
|
||||||
#define ScratchpadL1Mask16 RandomX_CurrentConfig.ScratchpadL1Mask16_Calculated
|
|
||||||
#define ScratchpadL2Mask RandomX_CurrentConfig.ScratchpadL2Mask_Calculated
|
|
||||||
#define ScratchpadL2Mask16 RandomX_CurrentConfig.ScratchpadL2Mask16_Calculated
|
|
||||||
#define ScratchpadL3Mask RandomX_CurrentConfig.ScratchpadL3Mask_Calculated
|
#define ScratchpadL3Mask RandomX_CurrentConfig.ScratchpadL3Mask_Calculated
|
||||||
#define ScratchpadL3Mask64 RandomX_CurrentConfig.ScratchpadL3Mask64_Calculated
|
#define ScratchpadL3Mask64 RandomX_CurrentConfig.ScratchpadL3Mask64_Calculated
|
||||||
constexpr int RegistersCount = 8;
|
constexpr int RegistersCount = 8;
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ FORCE_INLINE void rx_store_vec_f128(double* mem_addr, rx_vec_f128 val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE rx_vec_f128 rx_swap_vec_f128(rx_vec_f128 a) {
|
FORCE_INLINE rx_vec_f128 rx_swap_vec_f128(rx_vec_f128 a) {
|
||||||
float64x2_t temp;
|
float64x2_t temp{};
|
||||||
temp = vcopyq_laneq_f64(temp, 1, a, 1);
|
temp = vcopyq_laneq_f64(temp, 1, a, 1);
|
||||||
a = vcopyq_laneq_f64(a, 1, a, 0);
|
a = vcopyq_laneq_f64(a, 1, a, 0);
|
||||||
return vcopyq_laneq_f64(a, 0, temp, 1);
|
return vcopyq_laneq_f64(a, 0, temp, 1);
|
||||||
@@ -505,7 +505,7 @@ FORCE_INLINE void rx_store_vec_i128(rx_vec_i128* mem_addr, rx_vec_i128 val) {
|
|||||||
FORCE_INLINE rx_vec_f128 rx_cvt_packed_int_vec_f128(const void* addr) {
|
FORCE_INLINE rx_vec_f128 rx_cvt_packed_int_vec_f128(const void* addr) {
|
||||||
double lo = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 0));
|
double lo = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 0));
|
||||||
double hi = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 4));
|
double hi = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 4));
|
||||||
rx_vec_f128 x;
|
rx_vec_f128 x{};
|
||||||
x = vsetq_lane_f64(lo, x, 0);
|
x = vsetq_lane_f64(lo, x, 0);
|
||||||
x = vsetq_lane_f64(hi, x, 1);
|
x = vsetq_lane_f64(hi, x, 1);
|
||||||
return x;
|
return x;
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ namespace randomx {
|
|||||||
*(uint32_t*)(code + codePos) = 0xe181;
|
*(uint32_t*)(code + codePos) = 0xe181;
|
||||||
codePos += 2;
|
codePos += 2;
|
||||||
}
|
}
|
||||||
emit32(instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask, code, codePos);
|
emit32(AddressMask[instr.getModMem()], code, codePos);
|
||||||
}
|
}
|
||||||
|
|
||||||
template void JitCompilerX86::genAddressReg<false>(const Instruction& instr, const uint32_t src, uint8_t* code, uint32_t& codePos);
|
template void JitCompilerX86::genAddressReg<false>(const Instruction& instr, const uint32_t src, uint8_t* code, uint32_t& codePos);
|
||||||
@@ -522,7 +522,7 @@ namespace randomx {
|
|||||||
emit32(instr.getImm32(), code, codePos);
|
emit32(instr.getImm32(), code, codePos);
|
||||||
emitByte(0x25, code, codePos);
|
emitByte(0x25, code, codePos);
|
||||||
if (instr.getModCond() < StoreL3Condition) {
|
if (instr.getModCond() < StoreL3Condition) {
|
||||||
emit32(instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask, code, codePos);
|
emit32(AddressMask[instr.getModMem()], code, codePos);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
emit32(ScratchpadL3Mask, code, codePos);
|
emit32(ScratchpadL3Mask, code, codePos);
|
||||||
|
|||||||
@@ -165,45 +165,62 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
|||||||
fillAes4Rx4_Key[6] = rx_set_int_vec_i128(0xf63befa7, 0x2ba9660a, 0xf765a38b, 0xf273c9e7);
|
fillAes4Rx4_Key[6] = rx_set_int_vec_i128(0xf63befa7, 0x2ba9660a, 0xf765a38b, 0xf273c9e7);
|
||||||
fillAes4Rx4_Key[7] = rx_set_int_vec_i128(0xc0b0762d, 0x0c06d1fd, 0x915839de, 0x7a7cd609);
|
fillAes4Rx4_Key[7] = rx_set_int_vec_i128(0xc0b0762d, 0x0c06d1fd, 0x915839de, 0x7a7cd609);
|
||||||
|
|
||||||
#if defined(_M_X64) || defined(__x86_64__)
|
# if defined(_M_X64) || defined(__x86_64__)
|
||||||
|
// Workaround for Visual Studio placing trampoline in debug builds.
|
||||||
|
auto addr = [](void (*func)()) {
|
||||||
|
const uint8_t* p = reinterpret_cast<const uint8_t*>(func);
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
if (p[0] == 0xE9) {
|
||||||
|
p += *(const int32_t*)(p + 1) + 5;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
return p;
|
||||||
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
const uint8_t* a = (const uint8_t*)&randomx_sshash_prefetch;
|
const uint8_t* a = addr(randomx_sshash_prefetch);
|
||||||
const uint8_t* b = (const uint8_t*)&randomx_sshash_end;
|
const uint8_t* b = addr(randomx_sshash_end);
|
||||||
memcpy(codeShhPrefetchTweaked, a, b - a);
|
memcpy(codeShhPrefetchTweaked, a, b - a);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const uint8_t* a = (const uint8_t*)&randomx_program_read_dataset;
|
const uint8_t* a = addr(randomx_program_read_dataset);
|
||||||
const uint8_t* b = (const uint8_t*)&randomx_program_read_dataset_ryzen;
|
const uint8_t* b = addr(randomx_program_read_dataset_ryzen);
|
||||||
memcpy(codeReadDatasetTweaked, a, b - a);
|
memcpy(codeReadDatasetTweaked, a, b - a);
|
||||||
codeReadDatasetTweakedSize = b - a;
|
codeReadDatasetTweakedSize = b - a;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const uint8_t* a = (const uint8_t*)&randomx_program_read_dataset_ryzen;
|
const uint8_t* a = addr(randomx_program_read_dataset_ryzen);
|
||||||
const uint8_t* b = (const uint8_t*)&randomx_program_read_dataset_sshash_init;
|
const uint8_t* b = addr(randomx_program_read_dataset_sshash_init);
|
||||||
memcpy(codeReadDatasetRyzenTweaked, a, b - a);
|
memcpy(codeReadDatasetRyzenTweaked, a, b - a);
|
||||||
codeReadDatasetRyzenTweakedSize = b - a;
|
codeReadDatasetRyzenTweakedSize = b - a;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const uint8_t* a = (const uint8_t*)&randomx_program_read_dataset_sshash_init;
|
const uint8_t* a = addr(randomx_program_read_dataset_sshash_init);
|
||||||
const uint8_t* b = (const uint8_t*)&randomx_program_read_dataset_sshash_fin;
|
const uint8_t* b = addr(randomx_program_read_dataset_sshash_fin);
|
||||||
memcpy(codeReadDatasetLightSshInitTweaked, a, b - a);
|
memcpy(codeReadDatasetLightSshInitTweaked, a, b - a);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const uint8_t* a = (const uint8_t*)&randomx_prefetch_scratchpad;
|
const uint8_t* a = addr(randomx_prefetch_scratchpad);
|
||||||
const uint8_t* b = (const uint8_t*)&randomx_prefetch_scratchpad_end;
|
const uint8_t* b = addr(randomx_prefetch_scratchpad_end);
|
||||||
memcpy(codePrefetchScratchpadTweaked, a, b - a);
|
memcpy(codePrefetchScratchpadTweaked, a, b - a);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef XMRIG_ARMv8
|
||||||
static uint32_t Log2(size_t value) { return (value > 1) ? (Log2(value / 2) + 1) : 0; }
|
static uint32_t Log2(size_t value) { return (value > 1) ? (Log2(value / 2) + 1) : 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
void RandomX_ConfigurationBase::Apply()
|
void RandomX_ConfigurationBase::Apply()
|
||||||
{
|
{
|
||||||
ScratchpadL1Mask_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) - 1) * 8;
|
const uint32_t ScratchpadL1Mask_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) - 1) * 8;
|
||||||
ScratchpadL1Mask16_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) / 2 - 1) * 16;
|
const uint32_t ScratchpadL2Mask_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) - 1) * 8;
|
||||||
ScratchpadL2Mask_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) - 1) * 8;
|
|
||||||
ScratchpadL2Mask16_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) / 2 - 1) * 16;
|
AddressMask_Calculated[0] = ScratchpadL2Mask_Calculated;
|
||||||
|
AddressMask_Calculated[1] = ScratchpadL1Mask_Calculated;
|
||||||
|
AddressMask_Calculated[2] = ScratchpadL1Mask_Calculated;
|
||||||
|
AddressMask_Calculated[3] = ScratchpadL1Mask_Calculated;
|
||||||
|
|
||||||
ScratchpadL3Mask_Calculated = (((ScratchpadL3_Size / sizeof(uint64_t)) - 1) * 8);
|
ScratchpadL3Mask_Calculated = (((ScratchpadL3_Size / sizeof(uint64_t)) - 1) * 8);
|
||||||
ScratchpadL3Mask64_Calculated = ((ScratchpadL3_Size / sizeof(uint64_t)) / 8 - 1) * 64;
|
ScratchpadL3Mask64_Calculated = ((ScratchpadL3_Size / sizeof(uint64_t)) / 8 - 1) * 64;
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ struct RandomX_ConfigurationBase
|
|||||||
uint8_t codeShhPrefetchTweaked[20];
|
uint8_t codeShhPrefetchTweaked[20];
|
||||||
uint8_t codeReadDatasetTweaked[64];
|
uint8_t codeReadDatasetTweaked[64];
|
||||||
uint32_t codeReadDatasetTweakedSize;
|
uint32_t codeReadDatasetTweakedSize;
|
||||||
uint8_t codeReadDatasetRyzenTweaked[76];
|
uint8_t codeReadDatasetRyzenTweaked[72];
|
||||||
uint32_t codeReadDatasetRyzenTweakedSize;
|
uint32_t codeReadDatasetRyzenTweakedSize;
|
||||||
uint8_t codeReadDatasetLightSshInitTweaked[68];
|
uint8_t codeReadDatasetLightSshInitTweaked[68];
|
||||||
uint8_t codePrefetchScratchpadTweaked[32];
|
uint8_t codePrefetchScratchpadTweaked[32];
|
||||||
@@ -129,10 +129,7 @@ struct RandomX_ConfigurationBase
|
|||||||
uint32_t CacheLineAlignMask_Calculated;
|
uint32_t CacheLineAlignMask_Calculated;
|
||||||
uint32_t DatasetExtraItems_Calculated;
|
uint32_t DatasetExtraItems_Calculated;
|
||||||
|
|
||||||
uint32_t ScratchpadL1Mask_Calculated;
|
uint32_t AddressMask_Calculated[4];
|
||||||
uint32_t ScratchpadL1Mask16_Calculated;
|
|
||||||
uint32_t ScratchpadL2Mask_Calculated;
|
|
||||||
uint32_t ScratchpadL2Mask16_Calculated;
|
|
||||||
uint32_t ScratchpadL3Mask_Calculated;
|
uint32_t ScratchpadL3Mask_Calculated;
|
||||||
uint32_t ScratchpadL3Mask64_Calculated;
|
uint32_t ScratchpadL3Mask64_Calculated;
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
#include "crypto/rx/Rx.h"
|
#include "crypto/rx/Rx.h"
|
||||||
#include "backend/common/Tags.h"
|
#include "backend/common/Tags.h"
|
||||||
#include "backend/cpu/CpuConfig.h"
|
#include "backend/cpu/CpuConfig.h"
|
||||||
|
#include "backend/cpu/CpuThreads.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
#include "base/io/log/Tags.h"
|
|
||||||
#include "crypto/rx/RxConfig.h"
|
#include "crypto/rx/RxConfig.h"
|
||||||
#include "crypto/rx/RxQueue.h"
|
#include "crypto/rx/RxQueue.h"
|
||||||
|
|
||||||
@@ -57,48 +57,6 @@ public:
|
|||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
const char *xmrig::rx_tag()
|
|
||||||
{
|
|
||||||
return Tags::randomx();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::Rx::init(const Job &job, const RxConfig &config, const CpuConfig &cpu)
|
|
||||||
{
|
|
||||||
if (job.algorithm().family() != Algorithm::RANDOM_X) {
|
|
||||||
if (msrInitialized) {
|
|
||||||
msrDestroy();
|
|
||||||
msrInitialized = false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isReady(job)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!msrInitialized) {
|
|
||||||
msrInit(config);
|
|
||||||
msrInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!osInitialized) {
|
|
||||||
setupMainLoopExceptionFrame();
|
|
||||||
osInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
d_ptr->queue.enqueue(job, config.nodeset(), config.threads(cpu.limit()), cpu.isHugePages(), config.isOneGbPages(), config.mode(), cpu.priority());
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::Rx::isReady(const Job &job)
|
|
||||||
{
|
|
||||||
return d_ptr->queue.isReady(job);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
xmrig::HugePagesInfo xmrig::Rx::hugePages()
|
xmrig::HugePagesInfo xmrig::Rx::hugePages()
|
||||||
{
|
{
|
||||||
return d_ptr->queue.hugePages();
|
return d_ptr->queue.hugePages();
|
||||||
@@ -129,8 +87,47 @@ void xmrig::Rx::init(IRxListener *listener)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool xmrig::Rx::init(const T &seed, const RxConfig &config, const CpuConfig &cpu)
|
||||||
|
{
|
||||||
|
if (seed.algorithm().family() != Algorithm::RANDOM_X) {
|
||||||
|
if (msrInitialized) {
|
||||||
|
msrDestroy();
|
||||||
|
msrInitialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isReady(seed)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!msrInitialized) {
|
||||||
|
msrInit(config, cpu.threads().get(seed.algorithm()).data());
|
||||||
|
msrInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!osInitialized) {
|
||||||
|
setupMainLoopExceptionFrame();
|
||||||
|
osInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
d_ptr->queue.enqueue(seed, config.nodeset(), config.threads(cpu.limit()), cpu.isHugePages(), config.isOneGbPages(), config.mode(), cpu.priority());
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool xmrig::Rx::isReady(const T &seed)
|
||||||
|
{
|
||||||
|
return d_ptr->queue.isReady(seed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef XMRIG_FEATURE_MSR
|
#ifndef XMRIG_FEATURE_MSR
|
||||||
void xmrig::Rx::msrInit(const RxConfig &)
|
void xmrig::Rx::msrInit(const RxConfig &, const std::vector<CpuThread> &)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,3 +143,15 @@ void xmrig::Rx::setupMainLoopExceptionFrame()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
template bool Rx::init(const RxSeed &seed, const RxConfig &config, const CpuConfig &cpu);
|
||||||
|
template bool Rx::isReady(const RxSeed &seed);
|
||||||
|
template bool Rx::init(const Job &seed, const RxConfig &config, const CpuConfig &cpu);
|
||||||
|
template bool Rx::isReady(const Job &seed);
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace xmrig
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
#include "crypto/common/HugePagesInfo.h"
|
#include "crypto/common/HugePagesInfo.h"
|
||||||
@@ -41,6 +42,7 @@ namespace xmrig
|
|||||||
|
|
||||||
class Algorithm;
|
class Algorithm;
|
||||||
class CpuConfig;
|
class CpuConfig;
|
||||||
|
class CpuThread;
|
||||||
class IRxListener;
|
class IRxListener;
|
||||||
class Job;
|
class Job;
|
||||||
class RxConfig;
|
class RxConfig;
|
||||||
@@ -50,19 +52,19 @@ class RxDataset;
|
|||||||
class Rx
|
class Rx
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool init(const Job &job, const RxConfig &config, const CpuConfig &cpu);
|
|
||||||
static bool isReady(const Job &job);
|
|
||||||
static HugePagesInfo hugePages();
|
static HugePagesInfo hugePages();
|
||||||
static RxDataset *dataset(const Job &job, uint32_t nodeId);
|
static RxDataset *dataset(const Job &job, uint32_t nodeId);
|
||||||
static void destroy();
|
static void destroy();
|
||||||
static void init(IRxListener *listener);
|
static void init(IRxListener *listener);
|
||||||
|
template<typename T> static bool init(const T &seed, const RxConfig &config, const CpuConfig &cpu);
|
||||||
|
template<typename T> static bool isReady(const T &seed);
|
||||||
|
|
||||||
# ifdef XMRIG_FIX_RYZEN
|
# ifdef XMRIG_FIX_RYZEN
|
||||||
static void setMainLoopBounds(const std::pair<const void*, const void*>& bounds);
|
static void setMainLoopBounds(const std::pair<const void*, const void*>& bounds);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void msrInit(const RxConfig &config);
|
static void msrInit(const RxConfig &config, const std::vector<CpuThread>& threads);
|
||||||
static void msrDestroy();
|
static void msrDestroy();
|
||||||
static void setupMainLoopExceptionFrame();
|
static void setupMainLoopExceptionFrame();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "crypto/rx/RxBasicStorage.h"
|
#include "crypto/rx/RxBasicStorage.h"
|
||||||
#include "backend/common/Tags.h"
|
#include "backend/common/Tags.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
|
#include "base/io/log/Tags.h"
|
||||||
#include "base/tools/Chrono.h"
|
#include "base/tools/Chrono.h"
|
||||||
#include "base/tools/Object.h"
|
#include "base/tools/Object.h"
|
||||||
#include "crypto/rx/RxAlgo.h"
|
#include "crypto/rx/RxAlgo.h"
|
||||||
@@ -75,7 +76,7 @@ public:
|
|||||||
if (!m_dataset->cache()->get()) {
|
if (!m_dataset->cache()->get()) {
|
||||||
deleteDataset();
|
deleteDataset();
|
||||||
|
|
||||||
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -93,7 +94,7 @@ public:
|
|||||||
m_ready = m_dataset->init(m_seed.data(), threads, priority);
|
m_ready = m_dataset->init(m_seed.data(), threads, priority);
|
||||||
|
|
||||||
if (m_ready) {
|
if (m_ready) {
|
||||||
LOG_INFO("%s" GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
LOG_INFO("%s" GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ private:
|
|||||||
const auto pages = m_dataset->hugePages();
|
const auto pages = m_dataset->hugePages();
|
||||||
|
|
||||||
LOG_INFO("%s" GREEN_BOLD("allocated") CYAN_BOLD(" %zu MB") BLACK_BOLD(" (%zu+%zu)") " huge pages %s%1.0f%% %u/%u" CLEAR " %sJIT" BLACK_BOLD(" (%" PRIu64 " ms)"),
|
LOG_INFO("%s" GREEN_BOLD("allocated") CYAN_BOLD(" %zu MB") BLACK_BOLD(" (%zu+%zu)") " huge pages %s%1.0f%% %u/%u" CLEAR " %sJIT" BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||||
rx_tag(),
|
Tags::randomx(),
|
||||||
pages.size / oneMiB,
|
pages.size / oneMiB,
|
||||||
RxDataset::maxSize() / oneMiB,
|
RxDataset::maxSize() / oneMiB,
|
||||||
RxCache::maxSize() / oneMiB,
|
RxCache::maxSize() / oneMiB,
|
||||||
@@ -118,7 +119,7 @@ private:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX dataset, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX dataset, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ static const char *kMode = "mode";
|
|||||||
static const char *kOneGbPages = "1gb-pages";
|
static const char *kOneGbPages = "1gb-pages";
|
||||||
static const char *kRdmsr = "rdmsr";
|
static const char *kRdmsr = "rdmsr";
|
||||||
static const char *kWrmsr = "wrmsr";
|
static const char *kWrmsr = "wrmsr";
|
||||||
|
static const char *kCacheQoS = "cache_qos";
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_HWLOC
|
#ifdef XMRIG_FEATURE_HWLOC
|
||||||
static const char *kNUMA = "numa";
|
static const char *kNUMA = "numa";
|
||||||
@@ -89,6 +90,8 @@ bool xmrig::RxConfig::read(const rapidjson::Value &value)
|
|||||||
readMSR(Json::getValue(value, kWrmsr));
|
readMSR(Json::getValue(value, kWrmsr));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
m_cacheQoS = Json::getBool(value, kCacheQoS, m_cacheQoS);
|
||||||
|
|
||||||
# ifdef XMRIG_OS_LINUX
|
# ifdef XMRIG_OS_LINUX
|
||||||
m_oneGbPages = Json::getBool(value, kOneGbPages, m_oneGbPages);
|
m_oneGbPages = Json::getBool(value, kOneGbPages, m_oneGbPages);
|
||||||
# endif
|
# endif
|
||||||
@@ -151,6 +154,8 @@ rapidjson::Value xmrig::RxConfig::toJSON(rapidjson::Document &doc) const
|
|||||||
obj.AddMember(StringRef(kWrmsr), false, allocator);
|
obj.AddMember(StringRef(kWrmsr), false, allocator);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
obj.AddMember(StringRef(kCacheQoS), m_cacheQoS, allocator);
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_HWLOC
|
# ifdef XMRIG_FEATURE_HWLOC
|
||||||
if (!m_nodeset.empty()) {
|
if (!m_nodeset.empty()) {
|
||||||
Value numa(kArrayType);
|
Value numa(kArrayType);
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public:
|
|||||||
inline bool isOneGbPages() const { return m_oneGbPages; }
|
inline bool isOneGbPages() const { return m_oneGbPages; }
|
||||||
inline bool rdmsr() const { return m_rdmsr; }
|
inline bool rdmsr() const { return m_rdmsr; }
|
||||||
inline bool wrmsr() const { return m_wrmsr; }
|
inline bool wrmsr() const { return m_wrmsr; }
|
||||||
|
inline bool cacheQoS() const { return m_cacheQoS; }
|
||||||
inline Mode mode() const { return m_mode; }
|
inline Mode mode() const { return m_mode; }
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_MSR
|
# ifdef XMRIG_FEATURE_MSR
|
||||||
@@ -83,6 +84,8 @@ private:
|
|||||||
bool m_wrmsr = false;
|
bool m_wrmsr = false;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
bool m_cacheQoS = false;
|
||||||
|
|
||||||
Mode readMode(const rapidjson::Value &value) const;
|
Mode readMode(const rapidjson::Value &value) const;
|
||||||
|
|
||||||
bool m_numa = true;
|
bool m_numa = true;
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "crypto/rx/RxDataset.h"
|
#include "crypto/rx/RxDataset.h"
|
||||||
#include "backend/common/Tags.h"
|
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
|
#include "base/io/log/Tags.h"
|
||||||
#include "base/kernel/Platform.h"
|
#include "base/kernel/Platform.h"
|
||||||
#include "crypto/common/VirtualMemory.h"
|
#include "crypto/common/VirtualMemory.h"
|
||||||
#include "crypto/rx/RxAlgo.h"
|
#include "crypto/rx/RxAlgo.h"
|
||||||
@@ -181,23 +181,45 @@ void xmrig::RxDataset::setRaw(const void *raw)
|
|||||||
void xmrig::RxDataset::allocate(bool hugePages, bool oneGbPages)
|
void xmrig::RxDataset::allocate(bool hugePages, bool oneGbPages)
|
||||||
{
|
{
|
||||||
if (m_mode == RxConfig::LightMode) {
|
if (m_mode == RxConfig::LightMode) {
|
||||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "fast RandomX mode disabled by config", rx_tag());
|
LOG_ERR(CLEAR "%s" RED_BOLD_S "fast RandomX mode disabled by config", Tags::randomx());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_mode == RxConfig::AutoMode && uv_get_total_memory() < (maxSize() + RxCache::maxSize())) {
|
if (m_mode == RxConfig::AutoMode && uv_get_total_memory() < (maxSize() + RxCache::maxSize())) {
|
||||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "not enough memory for RandomX dataset", rx_tag());
|
LOG_ERR(CLEAR "%s" RED_BOLD_S "not enough memory for RandomX dataset", Tags::randomx());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_memory = new VirtualMemory(maxSize(), hugePages, oneGbPages, false, m_node);
|
m_memory = new VirtualMemory(maxSize(), hugePages, oneGbPages, false, m_node);
|
||||||
|
|
||||||
|
if (m_memory->isOneGbPages()) {
|
||||||
|
m_scratchpadOffset = maxSize() + RANDOMX_CACHE_MAX_SIZE;
|
||||||
|
m_scratchpadLimit = m_memory->capacity();
|
||||||
|
}
|
||||||
|
|
||||||
m_dataset = randomx_create_dataset(m_memory->raw());
|
m_dataset = randomx_create_dataset(m_memory->raw());
|
||||||
|
|
||||||
# ifdef XMRIG_OS_LINUX
|
# ifdef XMRIG_OS_LINUX
|
||||||
if (oneGbPages && !isOneGbPages()) {
|
if (oneGbPages && !isOneGbPages()) {
|
||||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "failed to allocate RandomX dataset using 1GB pages", rx_tag());
|
LOG_ERR(CLEAR "%s" RED_BOLD_S "failed to allocate RandomX dataset using 1GB pages", Tags::randomx());
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t* xmrig::RxDataset::tryAllocateScrathpad()
|
||||||
|
{
|
||||||
|
uint8_t* p = reinterpret_cast<uint8_t*>(raw());
|
||||||
|
if (!p) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const size_t offset = m_scratchpadOffset.fetch_add(RANDOMX_SCRATCHPAD_L3_MAX_SIZE);
|
||||||
|
if (offset + RANDOMX_SCRATCHPAD_L3_MAX_SIZE > m_scratchpadLimit) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p + offset;
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,12 +29,15 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "base/crypto/Algorithm.h"
|
#include "base/crypto/Algorithm.h"
|
||||||
|
#include "base/tools/Buffer.h"
|
||||||
#include "base/tools/Object.h"
|
#include "base/tools/Object.h"
|
||||||
#include "crypto/common/HugePagesInfo.h"
|
#include "crypto/common/HugePagesInfo.h"
|
||||||
#include "crypto/randomx/configuration.h"
|
#include "crypto/randomx/configuration.h"
|
||||||
#include "crypto/randomx/randomx.h"
|
#include "crypto/randomx/randomx.h"
|
||||||
#include "crypto/rx/RxConfig.h"
|
#include "crypto/rx/RxConfig.h"
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
|
|
||||||
struct randomx_dataset;
|
struct randomx_dataset;
|
||||||
|
|
||||||
@@ -43,7 +46,6 @@ namespace xmrig
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
class Buffer;
|
|
||||||
class RxCache;
|
class RxCache;
|
||||||
class VirtualMemory;
|
class VirtualMemory;
|
||||||
|
|
||||||
@@ -69,6 +71,8 @@ public:
|
|||||||
void *raw() const;
|
void *raw() const;
|
||||||
void setRaw(const void *raw);
|
void setRaw(const void *raw);
|
||||||
|
|
||||||
|
uint8_t *tryAllocateScrathpad();
|
||||||
|
|
||||||
static inline constexpr size_t maxSize() { return RANDOMX_DATASET_MAX_SIZE; }
|
static inline constexpr size_t maxSize() { return RANDOMX_DATASET_MAX_SIZE; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -79,6 +83,9 @@ private:
|
|||||||
randomx_dataset *m_dataset = nullptr;
|
randomx_dataset *m_dataset = nullptr;
|
||||||
RxCache *m_cache = nullptr;
|
RxCache *m_cache = nullptr;
|
||||||
VirtualMemory *m_memory = nullptr;
|
VirtualMemory *m_memory = nullptr;
|
||||||
|
|
||||||
|
std::atomic<size_t> m_scratchpadOffset;
|
||||||
|
size_t m_scratchpadLimit = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,10 +26,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "crypto/rx/RxNUMAStorage.h"
|
#include "crypto/rx/RxNUMAStorage.h"
|
||||||
#include "backend/common/Tags.h"
|
|
||||||
#include "backend/cpu/Cpu.h"
|
#include "backend/cpu/Cpu.h"
|
||||||
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
|
#include "base/io/log/Tags.h"
|
||||||
#include "base/kernel/Platform.h"
|
#include "base/kernel/Platform.h"
|
||||||
#include "base/tools/Chrono.h"
|
#include "base/tools/Chrono.h"
|
||||||
#include "base/tools/Object.h"
|
#include "base/tools/Object.h"
|
||||||
@@ -72,13 +72,13 @@ static bool bindToNUMANode(uint32_t nodeId)
|
|||||||
|
|
||||||
static inline void printSkipped(uint32_t nodeId, const char *reason)
|
static inline void printSkipped(uint32_t nodeId, const char *reason)
|
||||||
{
|
{
|
||||||
LOG_WARN("%s" CYAN_BOLD("#%u ") RED_BOLD("skipped") YELLOW(" (%s)"), rx_tag(), nodeId, reason);
|
LOG_WARN("%s" CYAN_BOLD("#%u ") RED_BOLD("skipped") YELLOW(" (%s)"), Tags::randomx(), nodeId, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void printDatasetReady(uint32_t nodeId, uint64_t ts)
|
static inline void printDatasetReady(uint32_t nodeId, uint64_t ts)
|
||||||
{
|
{
|
||||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), nodeId, Chrono::steadyMSecs() - ts);
|
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), nodeId, Chrono::steadyMSecs() - ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ public:
|
|||||||
if (m_datasets.empty()) {
|
if (m_datasets.empty()) {
|
||||||
m_datasets.insert({ m_nodeset.front(), new RxDataset(m_cache) });
|
m_datasets.insert({ m_nodeset.front(), new RxDataset(m_cache) });
|
||||||
|
|
||||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX datasets, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX datasets, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_cache) {
|
if (m_cache) {
|
||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto kv : m_datasets) {
|
for (const auto &kv : m_datasets) {
|
||||||
if (kv.second->isOneGbPages()) {
|
if (kv.second->isOneGbPages()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -176,10 +176,16 @@ public:
|
|||||||
|
|
||||||
inline void initDatasets(uint32_t threads, int priority)
|
inline void initDatasets(uint32_t threads, int priority)
|
||||||
{
|
{
|
||||||
uint64_t ts = Chrono::steadyMSecs();
|
uint64_t ts = Chrono::steadyMSecs();
|
||||||
auto id = m_nodeset.front();
|
uint32_t id = 0;
|
||||||
auto primary = dataset(id);
|
|
||||||
|
|
||||||
|
for (const auto &kv : m_datasets) {
|
||||||
|
if (kv.second->cache()) {
|
||||||
|
id = kv.first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto primary = dataset(id);
|
||||||
primary->init(m_seed.data(), threads, priority);
|
primary->init(m_seed.data(), threads, priority);
|
||||||
|
|
||||||
printDatasetReady(id, ts);
|
printDatasetReady(id, ts);
|
||||||
@@ -246,7 +252,7 @@ private:
|
|||||||
if (!cache->get()) {
|
if (!cache->get()) {
|
||||||
delete cache;
|
delete cache;
|
||||||
|
|
||||||
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -272,7 +278,7 @@ private:
|
|||||||
const auto pages = dataset->hugePages();
|
const auto pages = dataset->hugePages();
|
||||||
|
|
||||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("allocated") CYAN_BOLD(" %zu MB") " huge pages %s%3.0f%%" CLEAR BLACK_BOLD(" (%" PRIu64 " ms)"),
|
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("allocated") CYAN_BOLD(" %zu MB") " huge pages %s%3.0f%%" CLEAR BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||||
rx_tag(),
|
Tags::randomx(),
|
||||||
nodeId,
|
nodeId,
|
||||||
pages.size / oneMiB,
|
pages.size / oneMiB,
|
||||||
(pages.isFullyAllocated() ? GREEN_BOLD_S : RED_BOLD_S),
|
(pages.isFullyAllocated() ? GREEN_BOLD_S : RED_BOLD_S),
|
||||||
@@ -287,7 +293,7 @@ private:
|
|||||||
const auto pages = cache->hugePages();
|
const auto pages = cache->hugePages();
|
||||||
|
|
||||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("allocated") CYAN_BOLD(" %4zu MB") " huge pages %s%3.0f%%" CLEAR " %sJIT" BLACK_BOLD(" (%" PRIu64 " ms)"),
|
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("allocated") CYAN_BOLD(" %4zu MB") " huge pages %s%3.0f%%" CLEAR " %sJIT" BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||||
rx_tag(),
|
Tags::randomx(),
|
||||||
nodeId,
|
nodeId,
|
||||||
cache->size() / oneMiB,
|
cache->size() / oneMiB,
|
||||||
(pages.isFullyAllocated() ? GREEN_BOLD_S : RED_BOLD_S),
|
(pages.isFullyAllocated() ? GREEN_BOLD_S : RED_BOLD_S),
|
||||||
@@ -303,7 +309,7 @@ private:
|
|||||||
auto pages = hugePages();
|
auto pages = hugePages();
|
||||||
|
|
||||||
LOG_INFO("%s" CYAN_BOLD("-- ") GREEN_BOLD("allocated") CYAN_BOLD(" %4zu MB") " huge pages %s%3.0f%% %u/%u" CLEAR BLACK_BOLD(" (%" PRIu64 " ms)"),
|
LOG_INFO("%s" CYAN_BOLD("-- ") GREEN_BOLD("allocated") CYAN_BOLD(" %4zu MB") " huge pages %s%3.0f%% %u/%u" CLEAR BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||||
rx_tag(),
|
Tags::randomx(),
|
||||||
pages.size / oneMiB,
|
pages.size / oneMiB,
|
||||||
(pages.isFullyAllocated() ? GREEN_BOLD_S : (pages.allocated == 0 ? RED_BOLD_S : YELLOW_BOLD_S)),
|
(pages.isFullyAllocated() ? GREEN_BOLD_S : (pages.allocated == 0 ? RED_BOLD_S : YELLOW_BOLD_S)),
|
||||||
pages.percent(),
|
pages.percent(),
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user