diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt
index b78056b..42e6ed7 100644
--- a/buildSrc/src/main/kotlin/Deps.kt
+++ b/buildSrc/src/main/kotlin/Deps.kt
@@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
*/
object Versions {
diff --git a/crypto/build.gradle.kts b/crypto-core/build.gradle.kts
similarity index 100%
rename from crypto/build.gradle.kts
rename to crypto-core/build.gradle.kts
diff --git a/crypto/gradle/wrapper/gradle-wrapper.properties b/crypto-core/gradle/wrapper/gradle-wrapper.properties
similarity index 96%
rename from crypto/gradle/wrapper/gradle-wrapper.properties
rename to crypto-core/gradle/wrapper/gradle-wrapper.properties
index b1bf760..e501ab5 100644
--- a/crypto/gradle/wrapper/gradle-wrapper.properties
+++ b/crypto-core/gradle/wrapper/gradle-wrapper.properties
@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-#
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
diff --git a/crypto-core/node_modules/.bin/_mocha b/crypto-core/node_modules/.bin/_mocha
new file mode 120000
index 0000000..f2a54ff
--- /dev/null
+++ b/crypto-core/node_modules/.bin/_mocha
@@ -0,0 +1 @@
+../mocha/bin/_mocha
\ No newline at end of file
diff --git a/crypto-core/node_modules/.bin/he b/crypto-core/node_modules/.bin/he
new file mode 120000
index 0000000..2a8eb5e
--- /dev/null
+++ b/crypto-core/node_modules/.bin/he
@@ -0,0 +1 @@
+../he/bin/he
\ No newline at end of file
diff --git a/crypto-core/node_modules/.bin/mkdirp b/crypto-core/node_modules/.bin/mkdirp
new file mode 120000
index 0000000..017896c
--- /dev/null
+++ b/crypto-core/node_modules/.bin/mkdirp
@@ -0,0 +1 @@
+../mkdirp/bin/cmd.js
\ No newline at end of file
diff --git a/crypto-core/node_modules/.bin/mocha b/crypto-core/node_modules/.bin/mocha
new file mode 120000
index 0000000..43c668d
--- /dev/null
+++ b/crypto-core/node_modules/.bin/mocha
@@ -0,0 +1 @@
+../mocha/bin/mocha
\ No newline at end of file
diff --git a/crypto-core/node_modules/balanced-match/.npmignore b/crypto-core/node_modules/balanced-match/.npmignore
new file mode 100644
index 0000000..ae5d8c3
--- /dev/null
+++ b/crypto-core/node_modules/balanced-match/.npmignore
@@ -0,0 +1,5 @@
+test
+.gitignore
+.travis.yml
+Makefile
+example.js
diff --git a/crypto-core/node_modules/balanced-match/LICENSE.md b/crypto-core/node_modules/balanced-match/LICENSE.md
new file mode 100644
index 0000000..2cdc8e4
--- /dev/null
+++ b/crypto-core/node_modules/balanced-match/LICENSE.md
@@ -0,0 +1,21 @@
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/crypto-core/node_modules/balanced-match/README.md b/crypto-core/node_modules/balanced-match/README.md
new file mode 100644
index 0000000..08e918c
--- /dev/null
+++ b/crypto-core/node_modules/balanced-match/README.md
@@ -0,0 +1,91 @@
+# balanced-match
+
+Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well!
+
+[](http://travis-ci.org/juliangruber/balanced-match)
+[](https://www.npmjs.org/package/balanced-match)
+
+[](https://ci.testling.com/juliangruber/balanced-match)
+
+## Example
+
+Get the first matching pair of braces:
+
+```js
+var balanced = require('balanced-match');
+
+console.log(balanced('{', '}', 'pre{in{nested}}post'));
+console.log(balanced('{', '}', 'pre{first}between{second}post'));
+console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
+```
+
+The matches are:
+
+```bash
+$ node example.js
+{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
+{ start: 3,
+ end: 9,
+ pre: 'pre',
+ body: 'first',
+ post: 'between{second}post' }
+{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
+```
+
+## API
+
+### var m = balanced(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+object with those keys:
+
+* **start** the index of the first match of `a`
+* **end** the index of the matching `b`
+* **pre** the preamble, `a` and `b` not included
+* **body** the match, `a` and `b` not included
+* **post** the postscript, `a` and `b` not included
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
+
+### var r = balanced.range(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+array with indexes: `[ , ]`.
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install balanced-match
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/crypto-core/node_modules/balanced-match/index.js b/crypto-core/node_modules/balanced-match/index.js
new file mode 100644
index 0000000..1685a76
--- /dev/null
+++ b/crypto-core/node_modules/balanced-match/index.js
@@ -0,0 +1,59 @@
+'use strict';
+module.exports = balanced;
+function balanced(a, b, str) {
+ if (a instanceof RegExp) a = maybeMatch(a, str);
+ if (b instanceof RegExp) b = maybeMatch(b, str);
+
+ var r = range(a, b, str);
+
+ return r && {
+ start: r[0],
+ end: r[1],
+ pre: str.slice(0, r[0]),
+ body: str.slice(r[0] + a.length, r[1]),
+ post: str.slice(r[1] + b.length)
+ };
+}
+
+function maybeMatch(reg, str) {
+ var m = str.match(reg);
+ return m ? m[0] : null;
+}
+
+balanced.range = range;
+function range(a, b, str) {
+ var begs, beg, left, right, result;
+ var ai = str.indexOf(a);
+ var bi = str.indexOf(b, ai + 1);
+ var i = ai;
+
+ if (ai >= 0 && bi > 0) {
+ begs = [];
+ left = str.length;
+
+ while (i >= 0 && !result) {
+ if (i == ai) {
+ begs.push(i);
+ ai = str.indexOf(a, i + 1);
+ } else if (begs.length == 1) {
+ result = [ begs.pop(), bi ];
+ } else {
+ beg = begs.pop();
+ if (beg < left) {
+ left = beg;
+ right = bi;
+ }
+
+ bi = str.indexOf(b, i + 1);
+ }
+
+ i = ai < bi && ai >= 0 ? ai : bi;
+ }
+
+ if (begs.length) {
+ result = [ left, right ];
+ }
+ }
+
+ return result;
+}
diff --git a/crypto-core/node_modules/balanced-match/package.json b/crypto-core/node_modules/balanced-match/package.json
new file mode 100644
index 0000000..8a7a0f5
--- /dev/null
+++ b/crypto-core/node_modules/balanced-match/package.json
@@ -0,0 +1,77 @@
+{
+ "_from": "balanced-match@^1.0.0",
+ "_id": "balanced-match@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "_location": "/balanced-match",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "balanced-match@^1.0.0",
+ "name": "balanced-match",
+ "escapedName": "balanced-match",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/brace-expansion"
+ ],
+ "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
+ "_spec": "balanced-match@^1.0.0",
+ "_where": "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/jsMain/npm/node_modules/brace-expansion",
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "bugs": {
+ "url": "https://github.com/juliangruber/balanced-match/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Match balanced character pairs, like \"{\" and \"}\"",
+ "devDependencies": {
+ "matcha": "^0.7.0",
+ "tape": "^4.6.0"
+ },
+ "homepage": "https://github.com/juliangruber/balanced-match",
+ "keywords": [
+ "match",
+ "regexp",
+ "test",
+ "balanced",
+ "parse"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "balanced-match",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/balanced-match.git"
+ },
+ "scripts": {
+ "bench": "make bench",
+ "test": "make test"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ },
+ "version": "1.0.0"
+}
diff --git a/crypto-core/node_modules/bignum.js b/crypto-core/node_modules/bignum.js
new file mode 100644
index 0000000..59687f5
--- /dev/null
+++ b/crypto-core/node_modules/bignum.js
@@ -0,0 +1,7282 @@
+(function (_, Kotlin) {
+ 'use strict';
+ var $$importsForInline$$ = _.$$importsForInline$$ || (_.$$importsForInline$$ = {});
+ var Kind_INTERFACE = Kotlin.Kind.INTERFACE;
+ var Kind_CLASS = Kotlin.Kind.CLASS;
+ var L0 = Kotlin.Long.ZERO;
+ var equals = Kotlin.equals;
+ var ArithmeticException = Kotlin.kotlin.ArithmeticException;
+ var contains = Kotlin.kotlin.text.contains_sgbm27$;
+ var unboxChar = Kotlin.unboxChar;
+ var split = Kotlin.kotlin.text.split_o64adg$;
+ var ensureNotNull = Kotlin.ensureNotNull;
+ var Kind_OBJECT = Kotlin.Kind.OBJECT;
+ var L6 = Kotlin.Long.fromInt(6);
+ var Long$Companion$MAX_VALUE = Kotlin.Long.MAX_VALUE;
+ var Pair = Kotlin.kotlin.Pair;
+ var RuntimeException_init = Kotlin.kotlin.RuntimeException_init_pdl1vj$;
+ var Triple = Kotlin.kotlin.Triple;
+ var toString = Kotlin.toString;
+ var until = Kotlin.kotlin.ranges.until_dqglrj$;
+ var substring = Kotlin.kotlin.text.substring_fc3b62$;
+ var toBoxedChar = Kotlin.toBoxedChar;
+ var Comparable = Kotlin.kotlin.Comparable;
+ var get_lastIndex = Kotlin.kotlin.text.get_lastIndex_gw00vp$;
+ var get_indices = Kotlin.kotlin.text.get_indices_gw00vp$;
+ var reversed = Kotlin.kotlin.ranges.reversed_zf1xzc$;
+ var abs = Kotlin.kotlin.math.abs_s8cxhz$;
+ var hashCode = Kotlin.hashCode;
+ var Enum = Kotlin.kotlin.Enum;
+ var throwISE = Kotlin.throwISE;
+ var NumberFormatException = Kotlin.kotlin.NumberFormatException;
+ var getKClass = Kotlin.getKClass;
+ var throwCCE = Kotlin.throwCCE;
+ var Long = Kotlin.Long;
+ var PrimitiveClasses$intClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.intClass;
+ var PrimitiveClasses$shortClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.shortClass;
+ var PrimitiveClasses$byteClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.byteClass;
+ var numberToInt = Kotlin.numberToInt;
+ var ULong = Kotlin.kotlin.ULong;
+ var UInt = Kotlin.kotlin.UInt;
+ var UShort = Kotlin.kotlin.UShort;
+ var UByte = Kotlin.kotlin.UByte;
+ var numberToDouble = Kotlin.numberToDouble;
+ var numberToLong = Kotlin.numberToLong;
+ var contentHashCode = Kotlin.kotlin.collections.contentHashCode_rnn80q$;
+ var StringBuilder_init = Kotlin.kotlin.text.StringBuilder_init;
+ var kotlin_js_internal_ByteCompanionObject = Kotlin.kotlin.js.internal.ByteCompanionObject;
+ var kotlin_js_internal_ShortCompanionObject = Kotlin.kotlin.js.internal.ShortCompanionObject;
+ var kotlin_js_internal_FloatCompanionObject = Kotlin.kotlin.js.internal.FloatCompanionObject;
+ var kotlin_js_internal_DoubleCompanionObject = Kotlin.kotlin.js.internal.DoubleCompanionObject;
+ var toDouble = Kotlin.kotlin.text.toDouble_pdl1vz$;
+ var ClosedRange = Kotlin.kotlin.ranges.ClosedRange;
+ var Iterable = Kotlin.kotlin.collections.Iterable;
+ var Iterator = Kotlin.kotlin.collections.Iterator;
+ var Int = Number;
+ var Math_0 = Math;
+ var copyOf = Kotlin.kotlin.collections.copyOf_se6h4x$;
+ var ULongArray_init = Kotlin.kotlin.ULongArray;
+ var toByte = Kotlin.toByte;
+ var toShort = Kotlin.toShort;
+ var UIntArray = Kotlin.kotlin.UIntArray;
+ var UIntArray_init = Kotlin.kotlin.UIntArray_init_za3lpa$;
+ var L1 = Kotlin.Long.ONE;
+ var until_0 = Kotlin.kotlin.ranges.until_ebnic$;
+ var toString_0 = Kotlin.kotlin.text.toString_k13f4a$;
+ var IndexOutOfBoundsException = Kotlin.kotlin.IndexOutOfBoundsException;
+ var joinToString = Kotlin.kotlin.collections.joinToString_fmv235$;
+ var NotImplementedError_init = Kotlin.kotlin.NotImplementedError;
+ var wrapFunction = Kotlin.wrapFunction;
+ var get_indices_0 = Kotlin.kotlin.collections.get_indices_tmsbgo$;
+ var copyOfRange = Kotlin.kotlin.collections.copyOfRange_6pxxqk$;
+ var uintCompare = Kotlin.kotlin.uintCompare_vux9f0$;
+ var L4294967295 = new Kotlin.Long(-1, 0);
+ var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_287e2$;
+ var uintDivide = Kotlin.kotlin.uintDivide_oqfnby$;
+ var uintRemainder = Kotlin.kotlin.uintRemainder_oqfnby$;
+ var ulongDivide = Kotlin.kotlin.ulongDivide_jpm79w$;
+ var ulongCompare = Kotlin.kotlin.ulongCompare_3pjtqy$;
+ var minOf = Kotlin.kotlin.comparisons.minOf_jpm79w$;
+ var iterator = Kotlin.kotlin.text.iterator_gw00vp$;
+ var reversed_0 = Kotlin.kotlin.text.reversed_gw00vp$;
+ var abs_0 = Kotlin.kotlin.math.abs_za3lpa$;
+ var ULongArray_init_0 = Kotlin.kotlin.ULongArray_init_za3lpa$;
+ var toString_1 = Kotlin.kotlin.text.toString_hc3rh$;
+ var get_indices_1 = Kotlin.kotlin.collections.get_indices_se6h4x$;
+ var copyOfRange_0 = Kotlin.kotlin.collections.copyOfRange_2n8m0j$;
+ var ulongRemainder = Kotlin.kotlin.ulongRemainder_jpm79w$;
+ var L65535 = Kotlin.Long.fromInt(65535);
+ var L255 = Kotlin.Long.fromInt(255);
+ var listOf = Kotlin.kotlin.collections.listOf_mh5how$;
+ var listOf_0 = Kotlin.kotlin.collections.listOf_i5x0yv$;
+ var toMutableList = Kotlin.kotlin.collections.toMutableList_4c7yge$;
+ var minus = Kotlin.kotlin.collections.minus_q4559j$;
+ var plus = Kotlin.kotlin.collections.plus_mydzjv$;
+ var ArrayList_init_0 = Kotlin.kotlin.collections.ArrayList_init_ww73n8$;
+ var emptyList = Kotlin.kotlin.collections.emptyList_287e2$;
+ var checkIndexOverflow = Kotlin.kotlin.collections.checkIndexOverflow_za3lpa$;
+ var toChar = Kotlin.toChar;
+ var CharRange = Kotlin.kotlin.ranges.CharRange;
+ var L2147483647 = Kotlin.Long.fromInt(2147483647);
+ RoundingMode.prototype = Object.create(Enum.prototype);
+ RoundingMode.prototype.constructor = RoundingMode;
+ Sign.prototype = Object.create(Enum.prototype);
+ Sign.prototype.constructor = Sign;
+ function BigNumber() {
+ }
+ function BigNumber$Creator() {
+ }
+ BigNumber$Creator.prototype.parseString_bm4lxs$ = function (string, base, callback$default) {
+ if (base === void 0)
+ base = 10;
+ return callback$default ? callback$default(string, base) : this.parseString_bm4lxs$$default(string, base);
+ };
+ BigNumber$Creator.prototype.tryFromFloat_8ca0d4$ = function (float, exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(float, exactRequired) : this.tryFromFloat_8ca0d4$$default(float, exactRequired);
+ };
+ BigNumber$Creator.prototype.tryFromDouble_8555vt$ = function (double, exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(double, exactRequired) : this.tryFromDouble_8555vt$$default(double, exactRequired);
+ };
+ BigNumber$Creator.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'Creator',
+ interfaces: []
+ };
+ function BigNumber$Util() {
+ }
+ BigNumber$Util.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'Util',
+ interfaces: []
+ };
+ BigNumber.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'BigNumber',
+ interfaces: []
+ };
+ function NarrowingOperations() {
+ }
+ NarrowingOperations.prototype.intValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.intValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.longValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.longValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.byteValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.byteValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.shortValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.shortValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.uintValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.uintValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.ulongValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.ulongValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.ubyteValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.ubyteValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.ushortValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.ushortValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.floatValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.floatValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.prototype.doubleValue_6taknv$ = function (exactRequired, callback$default) {
+ if (exactRequired === void 0)
+ exactRequired = false;
+ return callback$default ? callback$default(exactRequired) : this.doubleValue_6taknv$$default(exactRequired);
+ };
+ NarrowingOperations.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'NarrowingOperations',
+ interfaces: []
+ };
+ function CommonBigNumberOperations() {
+ }
+ CommonBigNumberOperations.prototype.plus_k9hq86$ = function (other) {
+ return this.getInstance().add_k9hq86$(other);
+ };
+ CommonBigNumberOperations.prototype.minus_k9hq86$ = function (other) {
+ return this.getInstance().subtract_k9hq86$(other);
+ };
+ CommonBigNumberOperations.prototype.times_k9hq86$ = function (other) {
+ return this.getInstance().multiply_k9hq86$(other);
+ };
+ CommonBigNumberOperations.prototype.div_k9hq86$ = function (other) {
+ return this.getInstance().divide_k9hq86$(other);
+ };
+ CommonBigNumberOperations.prototype.rem_k9hq86$ = function (other) {
+ return this.getInstance().remainder_k9hq86$(other);
+ };
+ CommonBigNumberOperations.prototype.plus_za3lpa$ = function (int) {
+ return this.getInstance().add_k9hq86$(this.getCreator().fromInt_za3lpa$(int));
+ };
+ CommonBigNumberOperations.prototype.plus_s8cxhz$ = function (long) {
+ return this.getInstance().add_k9hq86$(this.getCreator().fromLong_s8cxhz$(long));
+ };
+ CommonBigNumberOperations.prototype.plus_mq22fl$ = function (short) {
+ return this.getInstance().add_k9hq86$(this.getCreator().fromShort_mq22fl$(short));
+ };
+ CommonBigNumberOperations.prototype.plus_s8j3t7$ = function (byte) {
+ return this.getInstance().add_k9hq86$(this.getCreator().fromByte_s8j3t7$(byte));
+ };
+ CommonBigNumberOperations.prototype.times_za3lpa$ = function (int) {
+ return this.getInstance().multiply_k9hq86$(this.getCreator().fromInt_za3lpa$(int));
+ };
+ CommonBigNumberOperations.prototype.times_s8cxhz$ = function (long) {
+ return this.getInstance().multiply_k9hq86$(this.getCreator().fromLong_s8cxhz$(long));
+ };
+ CommonBigNumberOperations.prototype.times_mq22fl$ = function (short) {
+ return this.getInstance().multiply_k9hq86$(this.getCreator().fromShort_mq22fl$(short));
+ };
+ CommonBigNumberOperations.prototype.times_s8j3t7$ = function (byte) {
+ return this.getInstance().multiply_k9hq86$(this.getCreator().fromByte_s8j3t7$(byte));
+ };
+ CommonBigNumberOperations.prototype.minus_za3lpa$ = function (int) {
+ return this.getInstance().subtract_k9hq86$(this.getCreator().fromInt_za3lpa$(int));
+ };
+ CommonBigNumberOperations.prototype.minus_s8cxhz$ = function (long) {
+ return this.getInstance().subtract_k9hq86$(this.getCreator().fromLong_s8cxhz$(long));
+ };
+ CommonBigNumberOperations.prototype.minus_mq22fl$ = function (short) {
+ return this.getInstance().subtract_k9hq86$(this.getCreator().fromShort_mq22fl$(short));
+ };
+ CommonBigNumberOperations.prototype.minus_s8j3t7$ = function (byte) {
+ return this.getInstance().subtract_k9hq86$(this.getCreator().fromByte_s8j3t7$(byte));
+ };
+ CommonBigNumberOperations.prototype.div_za3lpa$ = function (int) {
+ return this.getInstance().divide_k9hq86$(this.getCreator().fromInt_za3lpa$(int));
+ };
+ CommonBigNumberOperations.prototype.div_s8cxhz$ = function (long) {
+ return this.getInstance().divide_k9hq86$(this.getCreator().fromLong_s8cxhz$(long));
+ };
+ CommonBigNumberOperations.prototype.div_mq22fl$ = function (short) {
+ return this.getInstance().divide_k9hq86$(this.getCreator().fromShort_mq22fl$(short));
+ };
+ CommonBigNumberOperations.prototype.div_s8j3t7$ = function (byte) {
+ return this.getInstance().divide_k9hq86$(this.getCreator().fromByte_s8j3t7$(byte));
+ };
+ CommonBigNumberOperations.prototype.rem_za3lpa$ = function (int) {
+ return this.getInstance().remainder_k9hq86$(this.getCreator().fromInt_za3lpa$(int));
+ };
+ CommonBigNumberOperations.prototype.rem_s8cxhz$ = function (long) {
+ return this.getInstance().remainder_k9hq86$(this.getCreator().fromLong_s8cxhz$(long));
+ };
+ CommonBigNumberOperations.prototype.rem_mq22fl$ = function (short) {
+ return this.getInstance().remainder_k9hq86$(this.getCreator().fromShort_mq22fl$(short));
+ };
+ CommonBigNumberOperations.prototype.rem_s8j3t7$ = function (byte) {
+ return this.getInstance().remainder_k9hq86$(this.getCreator().fromByte_s8j3t7$(byte));
+ };
+ CommonBigNumberOperations.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'CommonBigNumberOperations',
+ interfaces: []
+ };
+ function BitwiseCapable() {
+ }
+ BitwiseCapable.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'BitwiseCapable',
+ interfaces: []
+ };
+ function QuotientAndRemainder(quotient, remainder) {
+ this.quotient = quotient;
+ this.remainder = remainder;
+ }
+ QuotientAndRemainder.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'QuotientAndRemainder',
+ interfaces: []
+ };
+ QuotientAndRemainder.prototype.component1 = function () {
+ return this.quotient;
+ };
+ QuotientAndRemainder.prototype.component2 = function () {
+ return this.remainder;
+ };
+ QuotientAndRemainder.prototype.copy_5qoi38$ = function (quotient, remainder) {
+ return new QuotientAndRemainder(quotient === void 0 ? this.quotient : quotient, remainder === void 0 ? this.remainder : remainder);
+ };
+ QuotientAndRemainder.prototype.toString = function () {
+ return 'QuotientAndRemainder(quotient=' + Kotlin.toString(this.quotient) + (', remainder=' + Kotlin.toString(this.remainder)) + ')';
+ };
+ QuotientAndRemainder.prototype.hashCode = function () {
+ var result = 0;
+ result = result * 31 + Kotlin.hashCode(this.quotient) | 0;
+ result = result * 31 + Kotlin.hashCode(this.remainder) | 0;
+ return result;
+ };
+ QuotientAndRemainder.prototype.equals = function (other) {
+ return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.quotient, other.quotient) && Kotlin.equals(this.remainder, other.remainder)))));
+ };
+ function ModularQuotientAndRemainder(quotient, remainder) {
+ this.quotient = quotient;
+ this.remainder = remainder;
+ }
+ ModularQuotientAndRemainder.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'ModularQuotientAndRemainder',
+ interfaces: []
+ };
+ ModularQuotientAndRemainder.prototype.component1 = function () {
+ return this.quotient;
+ };
+ ModularQuotientAndRemainder.prototype.component2 = function () {
+ return this.remainder;
+ };
+ ModularQuotientAndRemainder.prototype.copy_hsjfr0$ = function (quotient, remainder) {
+ return new ModularQuotientAndRemainder(quotient === void 0 ? this.quotient : quotient, remainder === void 0 ? this.remainder : remainder);
+ };
+ ModularQuotientAndRemainder.prototype.toString = function () {
+ return 'ModularQuotientAndRemainder(quotient=' + Kotlin.toString(this.quotient) + (', remainder=' + Kotlin.toString(this.remainder)) + ')';
+ };
+ ModularQuotientAndRemainder.prototype.hashCode = function () {
+ var result = 0;
+ result = result * 31 + Kotlin.hashCode(this.quotient) | 0;
+ result = result * 31 + Kotlin.hashCode(this.remainder) | 0;
+ return result;
+ };
+ ModularQuotientAndRemainder.prototype.equals = function (other) {
+ return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.quotient, other.quotient) && Kotlin.equals(this.remainder, other.remainder)))));
+ };
+ function BigDecimal(significand, exponent, decimalMode) {
+ BigDecimal$Companion_getInstance();
+ if (exponent === void 0)
+ exponent = BigInteger$Companion_getInstance().ZERO;
+ if (decimalMode === void 0)
+ decimalMode = null;
+ this.significand = significand;
+ this.exponent = exponent;
+ this.decimalMode = decimalMode;
+ this.precision = this.significand.numberOfDecimalDigits();
+ this.isExponentLong = this.exponent.numberOfWords === 0;
+ this.longExponent = this.exponent.magnitude_8be2vx$.get_za3lpa$(0);
+ }
+ function BigDecimal$Companion() {
+ BigDecimal$Companion_instance = this;
+ this.ZERO = new BigDecimal(BigInteger$Companion_getInstance().ZERO);
+ this.ONE = new BigDecimal(BigInteger$Companion_getInstance().ONE);
+ this.TWO = new BigDecimal(BigInteger$Companion_getInstance().TWO);
+ }
+ BigDecimal$Companion.prototype.roundOrDont_0 = function (significand, exponent, decimalMode) {
+ var tmp$;
+ if (!equals(decimalMode.decimalPrecision, L0) && decimalMode.roundingMode !== RoundingMode$NONE_getInstance()) {
+ tmp$ = this.round_0(significand, exponent, decimalMode);
+ }
+ else {
+ tmp$ = new BigDecimal(significand, exponent);
+ }
+ return tmp$;
+ };
+ BigDecimal$Companion.prototype.roundDiscarded_0 = function (significand, discarded, decimalMode) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9;
+ var toDiscard = significand.numberOfDecimalDigits().subtract(decimalMode.decimalPrecision);
+ if (toDiscard.toNumber() > 0) {
+ tmp$ = significand.divrem_sao9k6$(BigInteger$Companion_getInstance().TEN.pow_s8cxhz$(toDiscard)).quotient;
+ }
+ else {
+ tmp$ = significand;
+ }
+ var result = tmp$;
+ if (significand != null ? significand.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ tmp$_0 = discarded.sign;
+ }
+ else {
+ tmp$_0 = significand.sign;
+ }
+ var sign = tmp$_0;
+ if (toDiscard.toNumber() > 0) {
+ if (discarded != null ? discarded.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ tmp$_1 = BigInteger$Companion_getInstance().ZERO;
+ }
+ else {
+ tmp$_1 = discarded.div_s8cxhz$(discarded.numberOfDecimalDigits()).abs().plus_k9hq86$(significand.divrem_sao9k6$(BigInteger$Companion_getInstance().TEN.pow_s8cxhz$(toDiscard)).remainder.times_k9hq86$(BigInteger$Companion_getInstance().TEN.pow_s8cxhz$(toDiscard)));
+ }
+ }
+ else {
+ if (discarded != null ? discarded.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ tmp$_1 = BigInteger$Companion_getInstance().ZERO;
+ }
+ else {
+ tmp$_1 = discarded.div_s8cxhz$(discarded.numberOfDecimalDigits()).abs();
+ }
+ }
+ var significantRemainderDigit = tmp$_1;
+ switch (decimalMode.roundingMode.name) {
+ case 'AWAY_FROM_ZERO':
+ if (sign === Sign$POSITIVE_getInstance()) {
+ result = result.inc();
+ }
+ else {
+ result = result.dec();
+ }
+
+ break;
+ case 'TOWARDS_ZERO':
+ break;
+ case 'CEILING':
+ if (sign === Sign$POSITIVE_getInstance()) {
+ result = result.inc();
+ }
+
+ break;
+ case 'FLOOR':
+ if (sign !== Sign$POSITIVE_getInstance()) {
+ result = result.dec();
+ }
+
+ break;
+ case 'ROUND_HALF_AWAY_FROM_ZERO':
+ switch (sign.name) {
+ case 'POSITIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) >= 0) {
+ tmp$_2 = result, result = tmp$_2.inc();
+ }
+
+ break;
+ case 'NEGATIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) >= 0) {
+ tmp$_3 = result, result = tmp$_3.dec();
+ }
+
+ break;
+ case 'ZERO':
+ break;
+ }
+
+ break;
+ case 'ROUND_HALF_TOWARDS_ZERO':
+ switch (sign.name) {
+ case 'POSITIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) > 0) {
+ tmp$_4 = result, result = tmp$_4.inc();
+ }
+
+ break;
+ case 'NEGATIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) > 0) {
+ tmp$_5 = result, result = tmp$_5.dec();
+ }
+
+ break;
+ case 'ZERO':
+ break;
+ }
+
+ break;
+ case 'ROUND_HALF_CEILING':
+ switch (sign.name) {
+ case 'POSITIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) >= 0) {
+ tmp$_6 = result, result = tmp$_6.inc();
+ }
+
+ break;
+ case 'NEGATIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) > 0) {
+ tmp$_7 = result, result = tmp$_7.dec();
+ }
+
+ break;
+ case 'ZERO':
+ break;
+ }
+
+ break;
+ case 'ROUND_HALF_FLOOR':
+ switch (sign.name) {
+ case 'POSITIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) > 0) {
+ tmp$_8 = result, result = tmp$_8.inc();
+ }
+
+ break;
+ case 'NEGATIVE':
+ if (significantRemainderDigit.compareTo_za3rmp$(5) >= 0) {
+ tmp$_9 = result, result = tmp$_9.dec();
+ }
+
+ break;
+ case 'ZERO':
+ break;
+ }
+
+ break;
+ case 'NONE':
+ throw new ArithmeticException('Non-terminating result of division operation. Specify decimalPrecision');
+ default:Kotlin.noWhenBranchMatched();
+ break;
+ }
+ return result;
+ };
+ BigDecimal$Companion.prototype.round_1 = function (bigDecimal, decimalMode) {
+ return this.round_0(bigDecimal.significand, bigDecimal.exponent, decimalMode);
+ };
+ BigDecimal$Companion.prototype.round_0 = function (significand, exponent, decimalMode) {
+ var tmp$;
+ if (significand != null ? significand.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ return new BigDecimal(BigInteger$Companion_getInstance().ZERO, exponent, decimalMode);
+ }
+ var significandDigits = significand.numberOfDecimalDigits();
+ var desiredPrecision = decimalMode.decimalPrecision;
+ if (desiredPrecision.compareTo_11rb$(significandDigits) > 0) {
+ var extendedSignificand = significand.times_k9hq86$(BigInteger$Companion_getInstance().TEN.pow_s8cxhz$(desiredPrecision.subtract(significandDigits)));
+ tmp$ = new BigDecimal(extendedSignificand, exponent, decimalMode);
+ }
+ else if (desiredPrecision.compareTo_11rb$(significandDigits) < 0) {
+ var divRem = significand.divrem_sao9k6$(BigInteger$Companion_getInstance().TEN.pow_s8cxhz$(significandDigits.subtract(desiredPrecision)));
+ var newSignificand = this.roundDiscarded_0(divRem.quotient, divRem.remainder, decimalMode);
+ tmp$ = new BigDecimal(newSignificand, exponent, decimalMode);
+ }
+ else {
+ tmp$ = new BigDecimal(significand, exponent, decimalMode);
+ }
+ return tmp$;
+ };
+ BigDecimal$Companion.prototype.fromBigInteger_xl224a$ = function (bigInteger, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return (new BigDecimal(bigInteger, toBigInteger(bigInteger.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromLong_ii251z$ = function (long, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromLong_s8cxhz$(long);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromULong_az5pgk$ = function (uLong, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromULong_mpgczg$(uLong);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromInt_dv7oxq$ = function (int, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromInt_za3lpa$(int);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromUInt_lgbxwn$ = function (uInt, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromUInt_s87ys9$(uInt);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromUShort_4gowic$ = function (uShort, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromUShort_6hrhkk$(uShort);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromShort_e1ec8f$ = function (short, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromShort_mq22fl$(short);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromUByte_d47ids$ = function (uByte, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromUByte_mpmjao$(uByte);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromByte_sfop2t$ = function (byte, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromByte_s8j3t7$(byte);
+ return (new BigDecimal(bigint, toBigInteger(bigint.numberOfDecimalDigits()).minus_za3lpa$(1), decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromLongAsSignificand_ii251z$ = function (long, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return (new BigDecimal(BigInteger$Companion_getInstance().fromLong_s8cxhz$(long), BigInteger$Companion_getInstance().ZERO, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromIntAsSignificand_dv7oxq$ = function (int, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return (new BigDecimal(BigInteger$Companion_getInstance().fromInt_za3lpa$(int), BigInteger$Companion_getInstance().ZERO, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromShortAsSignificand_e1ec8f$ = function (short, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return (new BigDecimal(BigInteger$Companion_getInstance().fromShort_mq22fl$(short), BigInteger$Companion_getInstance().ZERO, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromByteAsSignificand_sfop2t$ = function (byte, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return (new BigDecimal(BigInteger$Companion_getInstance().fromByte_s8j3t7$(byte), BigInteger$Companion_getInstance().ZERO, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromFloat_v8byof$ = function (float, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ var floatString = float.toString();
+ if (contains(floatString, 46)) {
+ var dropLastWhile$result;
+ dropLastWhile$break: do {
+ for (var index = get_lastIndex(floatString); index >= 0; index--) {
+ if (!(unboxChar(toBoxedChar(floatString.charCodeAt(index))) === 48)) {
+ dropLastWhile$result = floatString.substring(0, index + 1 | 0);
+ break dropLastWhile$break;
+ }
+ }
+ dropLastWhile$result = '';
+ }
+ while (false);
+ tmp$ = this.parseStringWithMode_evghcu$(dropLastWhile$result, decimalMode);
+ }
+ else {
+ tmp$ = this.parseStringWithMode_evghcu$(floatString, decimalMode);
+ }
+ return tmp$;
+ };
+ BigDecimal$Companion.prototype.fromDouble_p9jqea$ = function (double, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ var doubleString = double.toString();
+ if (contains(doubleString, 46)) {
+ var dropLastWhile$result;
+ dropLastWhile$break: do {
+ for (var index = get_lastIndex(doubleString); index >= 0; index--) {
+ if (!(unboxChar(toBoxedChar(doubleString.charCodeAt(index))) === 48)) {
+ dropLastWhile$result = doubleString.substring(0, index + 1 | 0);
+ break dropLastWhile$break;
+ }
+ }
+ dropLastWhile$result = '';
+ }
+ while (false);
+ tmp$ = this.parseStringWithMode_evghcu$(dropLastWhile$result, decimalMode);
+ }
+ else {
+ tmp$ = this.parseStringWithMode_evghcu$(doubleString, decimalMode);
+ }
+ return tmp$;
+ };
+ BigDecimal$Companion.prototype.fromBigIntegerWithExponent_sf313g$ = function (bigInteger, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return (new BigDecimal(bigInteger, exponent, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromLongWithExponent_da22o3$ = function (long, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromLong_s8cxhz$(long);
+ return (new BigDecimal(bigint, exponent, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromIntWithExponent_m8btdw$ = function (int, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromInt_za3lpa$(int);
+ return (new BigDecimal(bigint, exponent, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromShortWithExponent_mtpo3b$ = function (short, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromShort_mq22fl$(short);
+ return (new BigDecimal(bigint, exponent, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromByteWithExponent_4mtc3z$ = function (byte, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var bigint = BigInteger$Companion_getInstance().fromByte_s8j3t7$(byte);
+ return (new BigDecimal(bigint, exponent, decimalMode)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromLongWithExponent_s5c29x$ = function (long, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return this.fromLongWithExponent_da22o3$(long, toBigInteger_0(exponent), decimalMode).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromIntWithExponent_w80u9g$ = function (int, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return this.fromIntWithExponent_m8btdw$(int, toBigInteger_0(exponent)).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromShortWithExponent_ocl8le$ = function (short, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = new DecimalMode();
+ return this.fromShortWithExponent_mtpo3b$(short, toBigInteger_0(exponent), decimalMode).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromByteWithExponent_7lggef$ = function (byte, exponent, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return this.fromByteWithExponent_4mtc3z$(byte, toBigInteger_0(exponent), decimalMode).round_q5qf04$(decimalMode);
+ };
+ BigDecimal$Companion.prototype.fromBigInteger_sao9k6$ = function (bigInteger) {
+ return this.fromBigInteger_xl224a$(bigInteger, null);
+ };
+ BigDecimal$Companion.prototype.fromULong_mpgczg$ = function (uLong) {
+ return this.fromULong_az5pgk$(uLong, null);
+ };
+ BigDecimal$Companion.prototype.fromUInt_s87ys9$ = function (uInt) {
+ return this.fromUInt_lgbxwn$(uInt, null);
+ };
+ BigDecimal$Companion.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ return this.fromUShort_4gowic$(uShort, null);
+ };
+ BigDecimal$Companion.prototype.fromUByte_mpmjao$ = function (uByte) {
+ return this.fromUByte_d47ids$(uByte, null);
+ };
+ BigDecimal$Companion.prototype.fromLong_s8cxhz$ = function (long) {
+ return this.fromLong_ii251z$(long, null);
+ };
+ BigDecimal$Companion.prototype.fromInt_za3lpa$ = function (int) {
+ return this.fromInt_dv7oxq$(int, null);
+ };
+ BigDecimal$Companion.prototype.fromShort_mq22fl$ = function (short) {
+ return this.fromShort_e1ec8f$(short, null);
+ };
+ BigDecimal$Companion.prototype.fromByte_s8j3t7$ = function (byte) {
+ return this.fromByte_sfop2t$(byte, null);
+ };
+ BigDecimal$Companion.prototype.tryFromFloat_8ca0d4$$default = function (float, exactRequired) {
+ return this.fromFloat_v8byof$(float, null);
+ };
+ BigDecimal$Companion.prototype.tryFromDouble_8555vt$$default = function (double, exactRequired) {
+ return this.fromDouble_p9jqea$(double, null);
+ };
+ BigDecimal$Companion.prototype.parseString_bm4lxs$$default = function (string, base) {
+ return this.parseStringWithMode_evghcu$(string, null);
+ };
+ BigDecimal$Companion.prototype.parseStringWithMode_evghcu$ = function (floatingPointString, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
+ if (floatingPointString.length === 0) {
+ return this.ZERO;
+ }
+ if (contains(floatingPointString, 69) || contains(floatingPointString, 101)) {
+ var split_0 = split(floatingPointString, Kotlin.charArrayOf(46));
+ if (split_0.size === 2) {
+ var signPresent = floatingPointString.charCodeAt(0) === 45 || floatingPointString.charCodeAt(0) === 43;
+ if (signPresent) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = 0;
+ }
+ var leftStart = tmp$;
+ if (signPresent) {
+ if (floatingPointString.charCodeAt(0) === 45) {
+ tmp$_0 = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$_0 = Sign$POSITIVE_getInstance();
+ }
+ }
+ else {
+ tmp$_0 = Sign$POSITIVE_getInstance();
+ }
+ var sign = tmp$_0;
+ var left = split_0.get_za3lpa$(0).substring(leftStart);
+ var rightSplit = split(split_0.get_za3lpa$(1), Kotlin.charArrayOf(69, 101));
+ var right = rightSplit.get_za3lpa$(0);
+ var exponentSplit = rightSplit.get_za3lpa$(1);
+ var exponentSignPresent = exponentSplit.charCodeAt(0) === 45 || exponentSplit.charCodeAt(0) === 43;
+ if (exponentSplit.charCodeAt(0) === 45) {
+ tmp$_1 = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$_1 = Sign$POSITIVE_getInstance();
+ }
+ var exponentSign = tmp$_1;
+ if (exponentSignPresent) {
+ tmp$_2 = 1;
+ }
+ else {
+ tmp$_2 = 0;
+ }
+ var skipSignIfPresent = tmp$_2;
+ var exponentString = exponentSplit.substring(skipSignIfPresent);
+ if (exponentSign === Sign$POSITIVE_getInstance()) {
+ tmp$_3 = BigInteger$Companion_getInstance().parseString_bm4lxs$(exponentString, 10);
+ }
+ else {
+ tmp$_3 = BigInteger$Companion_getInstance().parseString_bm4lxs$(exponentString, 10).negate();
+ }
+ var exponent = tmp$_3;
+ var indexOfFirst$result;
+ indexOfFirst$break: do {
+ var tmp$_7, tmp$_0_0, tmp$_1_0, tmp$_2_0;
+ tmp$_7 = get_indices(left);
+ tmp$_0_0 = tmp$_7.first;
+ tmp$_1_0 = tmp$_7.last;
+ tmp$_2_0 = tmp$_7.step;
+ for (var index = tmp$_0_0; index <= tmp$_1_0; index += tmp$_2_0) {
+ if (unboxChar(toBoxedChar(left.charCodeAt(index))) !== 48) {
+ indexOfFirst$result = index;
+ break indexOfFirst$break;
+ }
+ }
+ indexOfFirst$result = -1;
+ }
+ while (false);
+ var leftFirstNonZero = indexOfFirst$result;
+ if (leftFirstNonZero === -1) {
+ leftFirstNonZero = 0;
+ }
+ var indexOfLast$result;
+ indexOfLast$break: do {
+ var tmp$_8;
+ tmp$_8 = reversed(get_indices(right)).iterator();
+ while (tmp$_8.hasNext()) {
+ var index_0 = tmp$_8.next();
+ if (unboxChar(toBoxedChar(right.charCodeAt(index_0))) !== 48) {
+ indexOfLast$result = index_0;
+ break indexOfLast$break;
+ }
+ }
+ indexOfLast$result = -1;
+ }
+ while (false);
+ var rightLastNonZero = indexOfLast$result;
+ if (rightLastNonZero === -1) {
+ rightLastNonZero = right.length - 1 | 0;
+ }
+ var startIndex = leftFirstNonZero;
+ var endIndex = left.length;
+ var leftTruncated = left.substring(startIndex, endIndex);
+ var endIndex_0 = rightLastNonZero + 1 | 0;
+ var rightTruncated = right.substring(0, endIndex_0);
+ var significand = BigInteger$Companion_getInstance().parseString_bm4lxs$(leftTruncated + rightTruncated, 10);
+ if (significand != null ? significand.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ sign = Sign$ZERO_getInstance();
+ }
+ if (sign === Sign$NEGATIVE_getInstance()) {
+ significand = significand.negate();
+ }
+ return new BigDecimal(significand, exponent, decimalMode);
+ }
+ else
+ throw new ArithmeticException('Invalid (or unsupported) floating point number format: ' + floatingPointString);
+ }
+ else {
+ if (contains(floatingPointString, 46)) {
+ var split_1 = split(floatingPointString, Kotlin.charArrayOf(46));
+ if (split_1.size === 2) {
+ var signPresent_0 = floatingPointString.charCodeAt(0) === 45 || floatingPointString.charCodeAt(0) === 43;
+ if (signPresent_0) {
+ tmp$_4 = 1;
+ }
+ else {
+ tmp$_4 = 0;
+ }
+ var leftStart_0 = tmp$_4;
+ if (signPresent_0) {
+ if (floatingPointString.charCodeAt(0) === 45) {
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ }
+ }
+ else {
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ }
+ var sign_0 = tmp$_5;
+ var left_0 = split_1.get_za3lpa$(0).substring(leftStart_0);
+ var right_0 = split_1.get_za3lpa$(1);
+ var indexOfFirst$result_0;
+ indexOfFirst$break: do {
+ var tmp$_9, tmp$_0_1, tmp$_1_1, tmp$_2_1;
+ tmp$_9 = get_indices(left_0);
+ tmp$_0_1 = tmp$_9.first;
+ tmp$_1_1 = tmp$_9.last;
+ tmp$_2_1 = tmp$_9.step;
+ for (var index_1 = tmp$_0_1; index_1 <= tmp$_1_1; index_1 += tmp$_2_1) {
+ if (unboxChar(toBoxedChar(left_0.charCodeAt(index_1))) !== 48) {
+ indexOfFirst$result_0 = index_1;
+ break indexOfFirst$break;
+ }
+ }
+ indexOfFirst$result_0 = -1;
+ }
+ while (false);
+ var leftFirstNonZero_0 = indexOfFirst$result_0;
+ if (leftFirstNonZero_0 === -1) {
+ leftFirstNonZero_0 = 0;
+ }
+ var indexOfLast$result_0;
+ indexOfLast$break: do {
+ var tmp$_10;
+ tmp$_10 = reversed(get_indices(right_0)).iterator();
+ while (tmp$_10.hasNext()) {
+ var index_2 = tmp$_10.next();
+ if (unboxChar(toBoxedChar(right_0.charCodeAt(index_2))) !== 48) {
+ indexOfLast$result_0 = index_2;
+ break indexOfLast$break;
+ }
+ }
+ indexOfLast$result_0 = -1;
+ }
+ while (false);
+ var rightLastNonZero_0 = indexOfLast$result_0;
+ if (rightLastNonZero_0 === -1) {
+ rightLastNonZero_0 = right_0.length - 1 | 0;
+ }
+ var startIndex_0 = leftFirstNonZero_0;
+ var endIndex_1 = left_0.length;
+ var leftTruncated_0 = left_0.substring(startIndex_0, endIndex_1);
+ var endIndex_2 = rightLastNonZero_0 + 1 | 0;
+ var rightTruncated_0 = right_0.substring(0, endIndex_2);
+ var significand_0 = BigInteger$Companion_getInstance().parseString_bm4lxs$(leftTruncated_0 + rightTruncated_0, 10);
+ if (leftTruncated_0.length >= 1 && leftTruncated_0.charCodeAt(0) !== 48) {
+ tmp$_6 = BigInteger$Companion_getInstance().fromInt_za3lpa$(leftTruncated_0.length - 1 | 0);
+ }
+ else {
+ var tmp$_11 = BigInteger$Companion_getInstance();
+ var indexOfFirst$result_1;
+ indexOfFirst$break: do {
+ var tmp$_12, tmp$_0_2, tmp$_1_2, tmp$_2_2;
+ tmp$_12 = get_indices(rightTruncated_0);
+ tmp$_0_2 = tmp$_12.first;
+ tmp$_1_2 = tmp$_12.last;
+ tmp$_2_2 = tmp$_12.step;
+ for (var index_3 = tmp$_0_2; index_3 <= tmp$_1_2; index_3 += tmp$_2_2) {
+ if (unboxChar(toBoxedChar(rightTruncated_0.charCodeAt(index_3))) !== 48) {
+ indexOfFirst$result_1 = index_3;
+ break indexOfFirst$break;
+ }
+ }
+ indexOfFirst$result_1 = -1;
+ }
+ while (false);
+ tmp$_6 = tmp$_11.fromInt_za3lpa$(indexOfFirst$result_1 + 1 | 0).negate();
+ }
+ var exponent_0 = tmp$_6;
+ if (significand_0 != null ? significand_0.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ sign_0 = Sign$ZERO_getInstance();
+ }
+ if (sign_0 === Sign$NEGATIVE_getInstance()) {
+ significand_0 = significand_0.negate();
+ }
+ return new BigDecimal(significand_0, exponent_0, decimalMode);
+ }
+ else
+ throw new ArithmeticException('Invalid (or unsupported) floating point number format: ' + floatingPointString);
+ }
+ else {
+ var significand_1 = BigInteger$Companion_getInstance().parseString_bm4lxs$(floatingPointString, 10);
+ return new BigDecimal(significand_1, BigInteger$Companion_getInstance().fromLong_s8cxhz$(significand_1.numberOfDecimalDigits().subtract(Kotlin.Long.fromInt(1))), decimalMode);
+ }
+ }
+ };
+ BigDecimal$Companion.prototype.resolveDecimalMode_0 = function (firstDecimalMode, secondDecimalMode, suppliedDecimalMode) {
+ var tmp$, tmp$_0;
+ if (suppliedDecimalMode != null) {
+ tmp$_0 = suppliedDecimalMode;
+ }
+ else {
+ if (firstDecimalMode == null && secondDecimalMode == null) {
+ return new DecimalMode();
+ }
+ if (firstDecimalMode == null && secondDecimalMode != null) {
+ return secondDecimalMode;
+ }
+ if (secondDecimalMode == null && firstDecimalMode != null) {
+ return firstDecimalMode;
+ }
+ if (ensureNotNull(firstDecimalMode).roundingMode !== ensureNotNull(secondDecimalMode).roundingMode) {
+ throw new ArithmeticException('Different rounding modes! This: ' + firstDecimalMode.roundingMode + ' Other: ' + secondDecimalMode.roundingMode);
+ }
+ if (firstDecimalMode.decimalPrecision.compareTo_11rb$(secondDecimalMode.decimalPrecision) >= 0) {
+ tmp$ = firstDecimalMode;
+ }
+ else {
+ tmp$ = secondDecimalMode;
+ }
+ var unifiedDecimalMode = tmp$;
+ tmp$_0 = unifiedDecimalMode;
+ }
+ return tmp$_0;
+ };
+ BigDecimal$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: [BigNumber$Creator]
+ };
+ var BigDecimal$Companion_instance = null;
+ function BigDecimal$Companion_getInstance() {
+ if (BigDecimal$Companion_instance === null) {
+ new BigDecimal$Companion();
+ }
+ return BigDecimal$Companion_instance;
+ }
+ BigDecimal.prototype.getCreator = function () {
+ return BigDecimal$Companion_getInstance();
+ };
+ BigDecimal.prototype.getInstance = function () {
+ return this;
+ };
+ BigDecimal.prototype.add_k9hq86$ = function (other) {
+ return this.add_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.add_vm9rja$ = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var tmp$_0 = this.bringSignificandToSameExponent_0(this, other);
+ var first = tmp$_0.component1()
+ , second = tmp$_0.component2();
+ var firstNumOfDigits = first.numberOfDecimalDigits();
+ var secondNumOfDigits = second.numberOfDecimalDigits();
+ var newSignificand = first.plus_k9hq86$(second);
+ var newSignificandNumOfDigit = newSignificand.numberOfDecimalDigits();
+ if (firstNumOfDigits.compareTo_11rb$(secondNumOfDigits) > 0) {
+ tmp$ = firstNumOfDigits;
+ }
+ else {
+ tmp$ = secondNumOfDigits;
+ }
+ var largerOperand = tmp$;
+ var carryDetected = newSignificandNumOfDigit.subtract(largerOperand);
+ var newExponent = BigInteger$Companion_getInstance().max_xwzc9q$(this.exponent, other.exponent).plus_s8cxhz$(carryDetected);
+ return BigDecimal$Companion_getInstance().roundOrDont_0(newSignificand, newExponent, resolvedDecimalMode);
+ };
+ BigDecimal.prototype.subtract_k9hq86$ = function (other) {
+ return this.subtract_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.subtract_vm9rja$ = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var tmp$_0 = this.bringSignificandToSameExponent_0(this, other);
+ var first = tmp$_0.component1()
+ , second = tmp$_0.component2();
+ var firstNumOfDigits = first.numberOfDecimalDigits();
+ var secondNumOfDigits = second.numberOfDecimalDigits();
+ var newSignificand = first.minus_k9hq86$(second);
+ var newSignificandNumOfDigit = newSignificand.numberOfDecimalDigits();
+ if (firstNumOfDigits.compareTo_11rb$(secondNumOfDigits) > 0) {
+ tmp$ = firstNumOfDigits;
+ }
+ else {
+ tmp$ = secondNumOfDigits;
+ }
+ var largerOperand = tmp$;
+ var borrowDetected = newSignificandNumOfDigit.subtract(largerOperand);
+ var newExponent = BigInteger$Companion_getInstance().max_xwzc9q$(this.exponent, other.exponent).plus_s8cxhz$(borrowDetected);
+ return BigDecimal$Companion_getInstance().roundOrDont_0(newSignificand, newExponent, resolvedDecimalMode);
+ };
+ BigDecimal.prototype.multiply_k9hq86$ = function (other) {
+ return this.multiply_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.multiply_vm9rja$ = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var firstNumOfDigits = this.significand.numberOfDecimalDigits();
+ var secondNumOfDigits = other.significand.numberOfDecimalDigits();
+ var newSignificand = this.significand.times_k9hq86$(other.significand);
+ var newSignificandNumOfDigit = newSignificand.numberOfDecimalDigits();
+ var moveExponent = newSignificandNumOfDigit.subtract(firstNumOfDigits.add(secondNumOfDigits));
+ var newExponent = this.exponent.plus_k9hq86$(other.exponent).plus_s8cxhz$(moveExponent).plus_za3lpa$(1);
+ return BigDecimal$Companion_getInstance().roundOrDont_0(newSignificand, newExponent, resolvedDecimalMode);
+ };
+ BigDecimal.prototype.divide_k9hq86$ = function (other) {
+ return this.divide_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.divide_vm9rja$ = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$, tmp$_0, tmp$_1;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var newExponent = this.exponent.minus_k9hq86$(other.exponent).minus_za3lpa$(1);
+ if (equals(resolvedDecimalMode.decimalPrecision, L0)) {
+ var a = L6;
+ var b = this.precision.add(other.precision);
+ var precisionSum = a.compareTo_11rb$(b) >= 0 ? a : b;
+ if (precisionSum.compareTo_11rb$(this.precision) < 0) {
+ tmp$ = Long$Companion$MAX_VALUE;
+ }
+ else {
+ tmp$ = precisionSum;
+ }
+ }
+ else {
+ tmp$ = resolvedDecimalMode.decimalPrecision;
+ }
+ var desiredPrecision = tmp$;
+ var power = desiredPrecision.subtract(this.precision).add(other.precision);
+ if (power.toNumber() > 0)
+ tmp$_0 = this.significand.times_k9hq86$(toBigInteger_0(10).pow_s8cxhz$(power));
+ else if (power.toNumber() < 0) {
+ tmp$_0 = this.significand.div_k9hq86$(toBigInteger_0(10).pow_s8cxhz$(abs(power)));
+ }
+ else
+ tmp$_0 = this.significand;
+ var thisPrepared = tmp$_0;
+ var divRem = thisPrepared.divrem_sao9k6$(other.significand);
+ var result = divRem.quotient;
+ if (result != null ? result.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ newExponent = newExponent.dec();
+ }
+ var exponentModifier = result.numberOfDecimalDigits().subtract(resolvedDecimalMode.decimalPrecision);
+ if (!((tmp$_1 = divRem.remainder) != null ? tmp$_1.equals(BigInteger$Companion_getInstance().ZERO) : null) && equals(resolvedDecimalMode.decimalPrecision, L0) && resolvedDecimalMode.roundingMode === RoundingMode$NONE_getInstance()) {
+ throw new ArithmeticException('Non-terminating result of division operation. Specify decimalPrecision');
+ }
+ return new BigDecimal(BigDecimal$Companion_getInstance().roundDiscarded_0(result, divRem.remainder, resolvedDecimalMode), newExponent.plus_s8cxhz$(exponentModifier), resolvedDecimalMode);
+ };
+ BigDecimal.prototype.remainder_k9hq86$ = function (other) {
+ return this.divideAndRemainder_k9hq86$(other).second;
+ };
+ BigDecimal.prototype.divideAndRemainder_k9hq86$ = function (other) {
+ var tmp$;
+ var resolvedRoundingMode = (tmp$ = this.decimalMode) != null ? tmp$ : new DecimalMode(this.exponent.longValue_6taknv$(true).add(Kotlin.Long.fromInt(1)), RoundingMode$FLOOR_getInstance());
+ var quotient = this.divide_vm9rja$(other, resolvedRoundingMode);
+ var quotientInfinitePrecision = quotient.copy_sf313g$(void 0, void 0, DecimalMode$Companion_getInstance().DEFAULT);
+ var remainder = this.minus_k9hq86$(quotientInfinitePrecision.times_k9hq86$(other));
+ return new Pair(quotient, remainder);
+ };
+ BigDecimal.prototype.isZero = function () {
+ return this.significand.isZero();
+ };
+ BigDecimal.prototype.copy_sf313g$ = function (significand, exponent, decimalMode) {
+ if (significand === void 0)
+ significand = this.significand;
+ if (exponent === void 0)
+ exponent = this.exponent;
+ if (decimalMode === void 0)
+ decimalMode = this.decimalMode;
+ return new BigDecimal(significand, exponent, decimalMode);
+ };
+ BigDecimal.prototype.pow_za3lpa$ = function (exponent) {
+ return this.pow_s8cxhz$(Kotlin.Long.fromInt(exponent));
+ };
+ BigDecimal.prototype.floor = function () {
+ return this.round_q5qf04$(new DecimalMode(this.exponent.longValue_6taknv$(true).add(Kotlin.Long.fromInt(1)), RoundingMode$FLOOR_getInstance()));
+ };
+ BigDecimal.prototype.ceil = function () {
+ return this.round_q5qf04$(new DecimalMode(this.exponent.longValue_6taknv$(true).add(Kotlin.Long.fromInt(1)), RoundingMode$CEILING_getInstance()));
+ };
+ BigDecimal.prototype.toBigInteger = function () {
+ var tmp$;
+ if (this.exponent.sign === Sign$NEGATIVE_getInstance()) {
+ return BigInteger$Companion_getInstance().ZERO;
+ }
+ var precisionExponentDiff = this.exponent.minus_s8cxhz$(this.precision);
+ if (precisionExponentDiff.compareTo_za3rmp$(0) > 0)
+ tmp$ = this.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(precisionExponentDiff.plus_za3lpa$(1)));
+ else if (precisionExponentDiff.compareTo_za3rmp$(0) < 0)
+ tmp$ = this.significand.div_k9hq86$(toBigInteger_0(10).pow_sao9k6$(precisionExponentDiff.plus_za3lpa$(1)));
+ else {
+ tmp$ = this.significand;
+ }
+ return tmp$;
+ };
+ BigDecimal.prototype.numberOfDecimalDigits = function () {
+ return this.significand.numberOfDecimalDigits();
+ };
+ BigDecimal.prototype.toString_za3lpa$ = function (base) {
+ if (base !== 10) {
+ throw RuntimeException_init('BigDecimal in base other than 10 is not supported yet');
+ }
+ return this.toString();
+ };
+ BigDecimal.prototype.integerDiv_0 = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var newExponent = this.exponent.minus_k9hq86$(other.exponent);
+ var newSignificand = this.significand.div_k9hq86$(other.significand);
+ return BigDecimal$Companion_getInstance().roundOrDont_0(newSignificand, newExponent, resolvedDecimalMode);
+ };
+ BigDecimal.prototype.rem_0 = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var newExponent = this.exponent.minus_k9hq86$(other.exponent);
+ var newSignificand = this.significand.rem_k9hq86$(other.significand);
+ return BigDecimal$Companion_getInstance().roundOrDont_0(newSignificand, newExponent, resolvedDecimalMode);
+ };
+ BigDecimal.prototype.divrem_0 = function (other, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var resolvedDecimalMode = BigDecimal$Companion_getInstance().resolveDecimalMode_0(this.decimalMode, other.decimalMode, decimalMode);
+ var newExponent = BigInteger$Companion_getInstance().max_xwzc9q$(this.exponent, other.exponent);
+ var newSignificand = this.significand.div_k9hq86$(other.significand);
+ var newRemainderSignificand = this.significand.rem_k9hq86$(other.significand);
+ return new Pair(BigDecimal$Companion_getInstance().roundOrDont_0(newSignificand, newExponent, resolvedDecimalMode), BigDecimal$Companion_getInstance().roundOrDont_0(newRemainderSignificand, newExponent, resolvedDecimalMode));
+ };
+ BigDecimal.prototype.divrem_phjccm$ = function (other) {
+ return this.divideAndRemainder_k9hq86$(other);
+ };
+ BigDecimal.prototype.plus_k9hq86$ = function (other) {
+ return this.add_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.minus_k9hq86$ = function (other) {
+ return this.subtract_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.times_k9hq86$ = function (other) {
+ return this.multiply_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.div_k9hq86$ = function (other) {
+ return this.divide_vm9rja$(other, null);
+ };
+ BigDecimal.prototype.rem_k9hq86$ = function (other) {
+ return this.rem_0(other, null);
+ };
+ BigDecimal.prototype.unaryMinus = function () {
+ return new BigDecimal(this.significand.negate(), this.exponent);
+ };
+ BigDecimal.prototype.inc = function () {
+ return this.plus_za3lpa$(1);
+ };
+ BigDecimal.prototype.dec = function () {
+ return this.minus_za3lpa$(1);
+ };
+ BigDecimal.prototype.abs = function () {
+ return new BigDecimal(this.significand.abs(), this.exponent);
+ };
+ BigDecimal.prototype.negate = function () {
+ return new BigDecimal(this.significand.negate(), this.exponent);
+ };
+ BigDecimal.prototype.pow_s8cxhz$ = function (exponent) {
+ var tmp$, tmp$_0, tmp$_1;
+ var result = BigDecimal$Companion_getInstance().ONE;
+ if (exponent.toNumber() > 0) {
+ tmp$ = Kotlin.Long.fromInt(1).rangeTo(exponent).iterator();
+ while (tmp$.hasNext()) {
+ var i = tmp$.next();
+ result = result.times_k9hq86$(result);
+ }
+ tmp$_1 = result;
+ }
+ else if (exponent.toNumber() < 0) {
+ tmp$_0 = Kotlin.Long.fromInt(1).rangeTo(abs(exponent)).iterator();
+ while (tmp$_0.hasNext()) {
+ var i_0 = tmp$_0.next();
+ result = result.div_k9hq86$(result);
+ }
+ tmp$_1 = result;
+ }
+ else {
+ tmp$_1 = BigDecimal$Companion_getInstance().ONE;
+ }
+ return tmp$_1;
+ };
+ BigDecimal.prototype.signum = function () {
+ return this.significand.signum();
+ };
+ BigDecimal.prototype.round_q5qf04$ = function (decimalMode) {
+ if (decimalMode == null) {
+ return this;
+ }
+ return BigDecimal$Companion_getInstance().round_0(this.significand, this.exponent, decimalMode);
+ };
+ BigDecimal.prototype.getRidOfRadix_0 = function (bigDecimal) {
+ var precision = bigDecimal.significand.numberOfDecimalDigits();
+ var newExponent = bigDecimal.exponent.minus_s8cxhz$(precision).plus_za3lpa$(1);
+ return new BigDecimal(bigDecimal.significand, newExponent);
+ };
+ BigDecimal.prototype.bringSignificandToSameExponent_0 = function (first, second) {
+ var tmp$, tmp$_0, tmp$_1;
+ var firstPrepared = this.getRidOfRadix_0(first);
+ var secondPrepared = this.getRidOfRadix_0(second);
+ var firstPreparedExponent = firstPrepared.exponent;
+ var secondPreparedExponent = secondPrepared.exponent;
+ if (first.exponent.compareTo_za3rmp$(second.exponent) > 0) {
+ var moveFirstBy = firstPreparedExponent.minus_k9hq86$(secondPreparedExponent);
+ if (moveFirstBy.compareTo_za3rmp$(0) >= 0) {
+ var movedFirst = firstPrepared.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(moveFirstBy));
+ return new Triple(movedFirst, second.significand, secondPreparedExponent);
+ }
+ else {
+ var movedSecond = secondPrepared.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(moveFirstBy.negate()));
+ tmp$_1 = new Triple(first.significand, movedSecond, firstPreparedExponent);
+ }
+ }
+ else if (first.exponent.compareTo_za3rmp$(second.exponent) < 0) {
+ var moveSecondBy = secondPreparedExponent.minus_k9hq86$(firstPreparedExponent);
+ if (moveSecondBy.compareTo_za3rmp$(0) >= 0) {
+ var movedSecond_0 = secondPrepared.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(moveSecondBy));
+ tmp$ = new Triple(first.significand, movedSecond_0, firstPreparedExponent);
+ }
+ else {
+ var movedFirst_0 = firstPrepared.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(moveSecondBy.negate()));
+ tmp$ = new Triple(movedFirst_0, second.significand, firstPreparedExponent);
+ }
+ return tmp$;
+ }
+ else {
+ var tmp$_2;
+ if ((tmp$_2 = first.exponent) != null ? tmp$_2.equals(second.exponent) : null) {
+ var delta = firstPreparedExponent.minus_k9hq86$(secondPreparedExponent);
+ if (delta.compareTo_za3rmp$(0) > 0) {
+ var movedFirst_1 = first.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(delta));
+ tmp$_0 = new Triple(movedFirst_1, second.significand, firstPreparedExponent);
+ }
+ else if (delta.compareTo_za3rmp$(0) < 0) {
+ var movedSecond_1 = second.significand.times_k9hq86$(toBigInteger_0(10).pow_sao9k6$(delta.negate()));
+ tmp$_0 = new Triple(first.significand, movedSecond_1, firstPreparedExponent);
+ }
+ else if (delta.compareTo_za3rmp$(0) === 0)
+ tmp$_0 = new Triple(first.significand, second.significand, firstPreparedExponent);
+ else
+ throw RuntimeException_init('Invalid delta: ' + delta);
+ return tmp$_0;
+ }
+ else {
+ throw RuntimeException_init('Invalid comparison state BigInteger: ' + first.exponent + ', ' + second.exponent);
+ }
+ }
+ return tmp$_1;
+ };
+ BigDecimal.prototype.compare_phjccm$ = function (other) {
+ var tmp$;
+ if ((tmp$ = this.exponent) != null ? tmp$.equals(other.exponent) : null) {
+ return this.significand.compare_sao9k6$(other.significand);
+ }
+ var tmp$_0 = this.bringSignificandToSameExponent_0(this, other);
+ var preparedFirst = tmp$_0.component1()
+ , preparedSecond = tmp$_0.component2();
+ return preparedFirst.compare_sao9k6$(preparedSecond);
+ };
+ BigDecimal.prototype.compareTo_za3rmp$ = function (other) {
+ var tmp$;
+ if (Kotlin.isType(other, BigDecimal))
+ tmp$ = this.compare_phjccm$(other);
+ else if (Kotlin.isType(other, Kotlin.Long))
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromLongAsSignificand_ii251z$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromIntAsSignificand_dv7oxq$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromShortAsSignificand_e1ec8f$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromByteAsSignificand_sfop2t$(other));
+ else
+ throw RuntimeException_init('Invalid comparison type for BigDecimal: ' + toString(Kotlin.getKClassFromExpression(other).simpleName));
+ return tmp$;
+ };
+ BigDecimal.prototype.equals = function (other) {
+ var tmp$;
+ if (Kotlin.isType(other, BigDecimal))
+ tmp$ = this.compare_phjccm$(other);
+ else if (Kotlin.isType(other, Kotlin.Long))
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromLongAsSignificand_ii251z$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromIntAsSignificand_dv7oxq$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromShortAsSignificand_e1ec8f$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_phjccm$(BigDecimal$Companion_getInstance().fromByteAsSignificand_sfop2t$(other));
+ else
+ tmp$ = -1;
+ var comparison = tmp$;
+ return comparison === 0;
+ };
+ BigDecimal.prototype.hashCode = function () {
+ var $receiver = this.decimalMode;
+ var tmp$;
+ return this.significand.hashCode() + this.exponent.hashCode() + ((tmp$ = $receiver != null ? hashCode($receiver) : null) != null ? tmp$ : 0) | 0;
+ };
+ BigDecimal.prototype.toString = function () {
+ var tmp$, tmp$_0, tmp$_1;
+ var significandString = this.significand.toString_za3lpa$(10);
+ if (this.significand.compareTo_za3rmp$(0) < 0) {
+ tmp$ = 2;
+ }
+ else {
+ tmp$ = 1;
+ }
+ var modifier = tmp$;
+ var $receiver = this.significand.toString();
+ var dropLastWhile$result;
+ dropLastWhile$break: do {
+ for (var index = get_lastIndex($receiver); index >= 0; index--) {
+ if (!(unboxChar(toBoxedChar($receiver.charCodeAt(index))) === 48)) {
+ dropLastWhile$result = $receiver.substring(0, index + 1 | 0);
+ break dropLastWhile$break;
+ }
+ }
+ dropLastWhile$result = '';
+ }
+ while (false);
+ if (dropLastWhile$result.length === 1) {
+ tmp$_0 = '0';
+ }
+ else {
+ tmp$_0 = '';
+ }
+ var expand = tmp$_0;
+ if (this.exponent.compareTo_za3rmp$(0) > 0)
+ tmp$_1 = this.placeADotInString_0(significandString, significandString.length - modifier | 0) + expand + 'E+' + this.exponent;
+ else if (this.exponent.compareTo_za3rmp$(0) < 0)
+ tmp$_1 = this.placeADotInString_0(significandString, significandString.length - modifier | 0) + expand + 'E' + this.exponent;
+ else {
+ var tmp$_2;
+ if ((tmp$_2 = this.exponent) != null ? tmp$_2.equals(BigInteger$Companion_getInstance().ZERO) : null)
+ tmp$_1 = this.placeADotInString_0(significandString, significandString.length - modifier | 0) + expand;
+ else
+ throw RuntimeException_init('Invalid state, please report a bug (Integer compareTo invalid)');
+ }
+ return tmp$_1;
+ };
+ BigDecimal.prototype.toStringExpanded = function () {
+ var tmp$;
+ var digits = this.significand.numberOfDecimalDigits();
+ if (this.exponent.compareTo_za3rmp$(2147483647) > 0) {
+ throw RuntimeException_init('Invalid toStringExpanded request (exponent > Int.MAX_VALUE)');
+ }
+ var significandString = this.significand.toString_za3lpa$(10);
+ if (this.exponent.compareTo_za3rmp$(0) > 0) {
+ var diffBigInt = this.exponent.minus_s8cxhz$(digits).plus_za3lpa$(1);
+ if (diffBigInt.compareTo_za3rmp$(0) > 0) {
+ var expandZeroes = diffBigInt.times_s8itvh$(48);
+ tmp$ = significandString + expandZeroes;
+ }
+ else {
+ tmp$ = this.placeADotInString_0(significandString, significandString.length - this.exponent.magnitude_8be2vx$.get_za3lpa$(0).data.toInt() - 1 | 0);
+ }
+ }
+ else if (this.exponent.compareTo_za3rmp$(0) < 0) {
+ var diffInt = this.exponent.magnitude_8be2vx$.get_za3lpa$(0).data.toInt();
+ if (diffInt > 0) {
+ var expandZeroes_0 = this.exponent.abs().times_s8itvh$(48);
+ tmp$ = this.placeADotInString_0(expandZeroes_0 + significandString, diffInt + significandString.length - 1 | 0);
+ }
+ else {
+ tmp$ = this.placeADotInString_0(significandString, significandString.length - 1 | 0);
+ }
+ }
+ else {
+ var tmp$_0;
+ if ((tmp$_0 = this.exponent) != null ? tmp$_0.equals(BigInteger$Companion_getInstance().ZERO) : null)
+ tmp$ = this.placeADotInString_0(significandString, significandString.length - 1 | 0);
+ else
+ throw RuntimeException_init('Invalid state, please report a bug (Integer compareTo invalid)');
+ }
+ return tmp$;
+ };
+ BigDecimal.prototype.noExponentStringtoScientificNotation_0 = function (input) {
+ return this.placeADotInString_0(input, input.length - 1 | 0) + ('E+' + (input.length - 1 | 0));
+ };
+ BigDecimal.prototype.placeADotInString_0 = function (input, position) {
+ var prefix = substring(input, until(0, input.length - position | 0));
+ var suffix = substring(input, until(input.length - position | 0, input.length));
+ var prepared = prefix + String.fromCharCode(toBoxedChar(46)) + suffix;
+ var dropLastWhile$result;
+ dropLastWhile$break: do {
+ for (var index = get_lastIndex(prepared); index >= 0; index--) {
+ if (!(unboxChar(toBoxedChar(prepared.charCodeAt(index))) === 48)) {
+ dropLastWhile$result = prepared.substring(0, index + 1 | 0);
+ break dropLastWhile$break;
+ }
+ }
+ dropLastWhile$result = '';
+ }
+ while (false);
+ return dropLastWhile$result;
+ };
+ BigDecimal.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'BigDecimal',
+ interfaces: [Comparable, CommonBigNumberOperations, BigNumber]
+ };
+ function toBigDecimal($receiver, exponent, decimalMode) {
+ if (exponent === void 0)
+ exponent = null;
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ if (exponent != null) {
+ tmp$ = BigDecimal$Companion_getInstance().fromLongWithExponent_da22o3$($receiver, exponent, decimalMode);
+ }
+ else {
+ tmp$ = BigDecimal$Companion_getInstance().fromLongAsSignificand_ii251z$($receiver, decimalMode);
+ }
+ return tmp$;
+ }
+ function toBigDecimal_0($receiver, exponent, decimalMode) {
+ if (exponent === void 0)
+ exponent = null;
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ if (exponent != null) {
+ tmp$ = BigDecimal$Companion_getInstance().fromIntWithExponent_m8btdw$($receiver, exponent, decimalMode);
+ }
+ else {
+ tmp$ = BigDecimal$Companion_getInstance().fromIntAsSignificand_dv7oxq$($receiver, decimalMode);
+ }
+ return tmp$;
+ }
+ function toBigDecimal_1($receiver, exponent, decimalMode) {
+ if (exponent === void 0)
+ exponent = null;
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ if (exponent != null) {
+ tmp$ = BigDecimal$Companion_getInstance().fromShortWithExponent_mtpo3b$($receiver, exponent, decimalMode);
+ }
+ else {
+ tmp$ = BigDecimal$Companion_getInstance().fromShortAsSignificand_e1ec8f$($receiver, decimalMode);
+ }
+ return tmp$;
+ }
+ function toBigDecimal_2($receiver, exponent, decimalMode) {
+ if (exponent === void 0)
+ exponent = null;
+ if (decimalMode === void 0)
+ decimalMode = null;
+ var tmp$;
+ if (exponent != null) {
+ tmp$ = BigDecimal$Companion_getInstance().fromByteWithExponent_4mtc3z$($receiver, exponent, decimalMode);
+ }
+ else {
+ tmp$ = BigDecimal$Companion_getInstance().fromByteAsSignificand_sfop2t$($receiver, decimalMode);
+ }
+ return tmp$;
+ }
+ function toBigDecimal_3($receiver, exponent, decimalMode) {
+ if (exponent === void 0)
+ exponent = null;
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return BigDecimal$Companion_getInstance().parseStringWithMode_evghcu$($receiver, decimalMode);
+ }
+ function toBigDecimal_4($receiver, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return BigDecimal$Companion_getInstance().fromFloat_v8byof$($receiver, decimalMode);
+ }
+ function toBigDecimal_5($receiver, decimalMode) {
+ if (decimalMode === void 0)
+ decimalMode = null;
+ return BigDecimal$Companion_getInstance().fromDouble_p9jqea$($receiver, decimalMode);
+ }
+ function RoundingMode(name, ordinal) {
+ Enum.call(this);
+ this.name$ = name;
+ this.ordinal$ = ordinal;
+ }
+ function RoundingMode_initFields() {
+ RoundingMode_initFields = function () {
+ };
+ RoundingMode$FLOOR_instance = new RoundingMode('FLOOR', 0);
+ RoundingMode$CEILING_instance = new RoundingMode('CEILING', 1);
+ RoundingMode$AWAY_FROM_ZERO_instance = new RoundingMode('AWAY_FROM_ZERO', 2);
+ RoundingMode$TOWARDS_ZERO_instance = new RoundingMode('TOWARDS_ZERO', 3);
+ RoundingMode$NONE_instance = new RoundingMode('NONE', 4);
+ RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_instance = new RoundingMode('ROUND_HALF_AWAY_FROM_ZERO', 5);
+ RoundingMode$ROUND_HALF_TOWARDS_ZERO_instance = new RoundingMode('ROUND_HALF_TOWARDS_ZERO', 6);
+ RoundingMode$ROUND_HALF_CEILING_instance = new RoundingMode('ROUND_HALF_CEILING', 7);
+ RoundingMode$ROUND_HALF_FLOOR_instance = new RoundingMode('ROUND_HALF_FLOOR', 8);
+ }
+ var RoundingMode$FLOOR_instance;
+ function RoundingMode$FLOOR_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$FLOOR_instance;
+ }
+ var RoundingMode$CEILING_instance;
+ function RoundingMode$CEILING_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$CEILING_instance;
+ }
+ var RoundingMode$AWAY_FROM_ZERO_instance;
+ function RoundingMode$AWAY_FROM_ZERO_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$AWAY_FROM_ZERO_instance;
+ }
+ var RoundingMode$TOWARDS_ZERO_instance;
+ function RoundingMode$TOWARDS_ZERO_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$TOWARDS_ZERO_instance;
+ }
+ var RoundingMode$NONE_instance;
+ function RoundingMode$NONE_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$NONE_instance;
+ }
+ var RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_instance;
+ function RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_instance;
+ }
+ var RoundingMode$ROUND_HALF_TOWARDS_ZERO_instance;
+ function RoundingMode$ROUND_HALF_TOWARDS_ZERO_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$ROUND_HALF_TOWARDS_ZERO_instance;
+ }
+ var RoundingMode$ROUND_HALF_CEILING_instance;
+ function RoundingMode$ROUND_HALF_CEILING_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$ROUND_HALF_CEILING_instance;
+ }
+ var RoundingMode$ROUND_HALF_FLOOR_instance;
+ function RoundingMode$ROUND_HALF_FLOOR_getInstance() {
+ RoundingMode_initFields();
+ return RoundingMode$ROUND_HALF_FLOOR_instance;
+ }
+ RoundingMode.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'RoundingMode',
+ interfaces: [Enum]
+ };
+ function RoundingMode$values() {
+ return [RoundingMode$FLOOR_getInstance(), RoundingMode$CEILING_getInstance(), RoundingMode$AWAY_FROM_ZERO_getInstance(), RoundingMode$TOWARDS_ZERO_getInstance(), RoundingMode$NONE_getInstance(), RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_getInstance(), RoundingMode$ROUND_HALF_TOWARDS_ZERO_getInstance(), RoundingMode$ROUND_HALF_CEILING_getInstance(), RoundingMode$ROUND_HALF_FLOOR_getInstance()];
+ }
+ RoundingMode.values = RoundingMode$values;
+ function RoundingMode$valueOf(name) {
+ switch (name) {
+ case 'FLOOR':
+ return RoundingMode$FLOOR_getInstance();
+ case 'CEILING':
+ return RoundingMode$CEILING_getInstance();
+ case 'AWAY_FROM_ZERO':
+ return RoundingMode$AWAY_FROM_ZERO_getInstance();
+ case 'TOWARDS_ZERO':
+ return RoundingMode$TOWARDS_ZERO_getInstance();
+ case 'NONE':
+ return RoundingMode$NONE_getInstance();
+ case 'ROUND_HALF_AWAY_FROM_ZERO':
+ return RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_getInstance();
+ case 'ROUND_HALF_TOWARDS_ZERO':
+ return RoundingMode$ROUND_HALF_TOWARDS_ZERO_getInstance();
+ case 'ROUND_HALF_CEILING':
+ return RoundingMode$ROUND_HALF_CEILING_getInstance();
+ case 'ROUND_HALF_FLOOR':
+ return RoundingMode$ROUND_HALF_FLOOR_getInstance();
+ default:throwISE('No enum constant com.ionspin.kotlin.bignum.decimal.RoundingMode.' + name);
+ }
+ }
+ RoundingMode.valueOf_61zpoe$ = RoundingMode$valueOf;
+ function DecimalMode(decimalPrecision, roundingMode) {
+ DecimalMode$Companion_getInstance();
+ if (decimalPrecision === void 0)
+ decimalPrecision = L0;
+ if (roundingMode === void 0)
+ roundingMode = RoundingMode$NONE_getInstance();
+ this.decimalPrecision = decimalPrecision;
+ this.roundingMode = roundingMode;
+ if (equals(this.decimalPrecision, L0) && this.roundingMode !== RoundingMode$NONE_getInstance()) {
+ throw new ArithmeticException('Rounding mode with 0 digits precision.');
+ }
+ }
+ function DecimalMode$Companion() {
+ DecimalMode$Companion_instance = this;
+ this.DEFAULT = new DecimalMode();
+ }
+ DecimalMode$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: []
+ };
+ var DecimalMode$Companion_instance = null;
+ function DecimalMode$Companion_getInstance() {
+ if (DecimalMode$Companion_instance === null) {
+ new DecimalMode$Companion();
+ }
+ return DecimalMode$Companion_instance;
+ }
+ DecimalMode.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'DecimalMode',
+ interfaces: []
+ };
+ DecimalMode.prototype.component1 = function () {
+ return this.decimalPrecision;
+ };
+ DecimalMode.prototype.component2 = function () {
+ return this.roundingMode;
+ };
+ DecimalMode.prototype.copy_t5vvlp$ = function (decimalPrecision, roundingMode) {
+ return new DecimalMode(decimalPrecision === void 0 ? this.decimalPrecision : decimalPrecision, roundingMode === void 0 ? this.roundingMode : roundingMode);
+ };
+ DecimalMode.prototype.toString = function () {
+ return 'DecimalMode(decimalPrecision=' + Kotlin.toString(this.decimalPrecision) + (', roundingMode=' + Kotlin.toString(this.roundingMode)) + ')';
+ };
+ DecimalMode.prototype.hashCode = function () {
+ var result = 0;
+ result = result * 31 + Kotlin.hashCode(this.decimalPrecision) | 0;
+ result = result * 31 + Kotlin.hashCode(this.roundingMode) | 0;
+ return result;
+ };
+ DecimalMode.prototype.equals = function (other) {
+ return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.decimalPrecision, other.decimalPrecision) && Kotlin.equals(this.roundingMode, other.roundingMode)))));
+ };
+ function Sign(name, ordinal) {
+ Enum.call(this);
+ this.name$ = name;
+ this.ordinal$ = ordinal;
+ }
+ function Sign_initFields() {
+ Sign_initFields = function () {
+ };
+ Sign$POSITIVE_instance = new Sign('POSITIVE', 0);
+ Sign$NEGATIVE_instance = new Sign('NEGATIVE', 1);
+ Sign$ZERO_instance = new Sign('ZERO', 2);
+ }
+ var Sign$POSITIVE_instance;
+ function Sign$POSITIVE_getInstance() {
+ Sign_initFields();
+ return Sign$POSITIVE_instance;
+ }
+ var Sign$NEGATIVE_instance;
+ function Sign$NEGATIVE_getInstance() {
+ Sign_initFields();
+ return Sign$NEGATIVE_instance;
+ }
+ var Sign$ZERO_instance;
+ function Sign$ZERO_getInstance() {
+ Sign_initFields();
+ return Sign$ZERO_instance;
+ }
+ Sign.prototype.not = function () {
+ var tmp$;
+ switch (this.name) {
+ case 'POSITIVE':
+ tmp$ = Sign$NEGATIVE_getInstance();
+ break;
+ case 'NEGATIVE':
+ tmp$ = Sign$POSITIVE_getInstance();
+ break;
+ case 'ZERO':
+ tmp$ = Sign$ZERO_getInstance();
+ break;
+ default:tmp$ = Kotlin.noWhenBranchMatched();
+ break;
+ }
+ return tmp$;
+ };
+ Sign.prototype.toInt = function () {
+ var tmp$;
+ switch (this.name) {
+ case 'POSITIVE':
+ tmp$ = 1;
+ break;
+ case 'NEGATIVE':
+ tmp$ = -1;
+ break;
+ case 'ZERO':
+ tmp$ = 0;
+ break;
+ default:tmp$ = Kotlin.noWhenBranchMatched();
+ break;
+ }
+ return tmp$;
+ };
+ Sign.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'Sign',
+ interfaces: [Enum]
+ };
+ function Sign$values() {
+ return [Sign$POSITIVE_getInstance(), Sign$NEGATIVE_getInstance(), Sign$ZERO_getInstance()];
+ }
+ Sign.values = Sign$values;
+ function Sign$valueOf(name) {
+ switch (name) {
+ case 'POSITIVE':
+ return Sign$POSITIVE_getInstance();
+ case 'NEGATIVE':
+ return Sign$NEGATIVE_getInstance();
+ case 'ZERO':
+ return Sign$ZERO_getInstance();
+ default:throwISE('No enum constant com.ionspin.kotlin.bignum.integer.Sign.' + name);
+ }
+ }
+ Sign.valueOf_61zpoe$ = Sign$valueOf;
+ function BigInteger(wordArray, sign) {
+ BigInteger$Companion_getInstance();
+ this.sign = sign;
+ this.magnitude_8be2vx$ = wordArray;
+ this.numberOfWords = this.magnitude_8be2vx$.size;
+ this.stringRepresentation = null;
+ }
+ BigInteger.prototype.getCreator = function () {
+ return BigInteger$Companion_getInstance();
+ };
+ BigInteger.prototype.getInstance = function () {
+ return this;
+ };
+ function BigInteger$Companion() {
+ BigInteger$Companion_instance = this;
+ this.arithmetic_0 = chosenArithmetic;
+ this.ZERO = new BigInteger(this.arithmetic_0.ZERO, Sign$ZERO_getInstance());
+ this.ONE = new BigInteger(this.arithmetic_0.ONE, Sign$POSITIVE_getInstance());
+ this.TWO = new BigInteger(this.arithmetic_0.ONE, Sign$POSITIVE_getInstance());
+ this.TEN = new BigInteger(this.arithmetic_0.TEN, Sign$POSITIVE_getInstance());
+ this.LOG_10_OF_2 = Math_0.log10(2.0);
+ }
+ BigInteger$Companion.prototype.parseString_bm4lxs$$default = function (string, base) {
+ var tmp$, tmp$_0;
+ var decimal = contains(string, 46);
+ if (decimal) {
+ var bigDecimal = BigDecimal$Companion_getInstance().parseString_bm4lxs$(string);
+ var isActuallyDecimal = bigDecimal.minus_k9hq86$(bigDecimal.floor()).compareTo_za3rmp$(0) > 0;
+ if (isActuallyDecimal) {
+ throw new NumberFormatException('Supplied string is decimal, which cannot be converted to BigInteger without precision loss.');
+ }
+ return bigDecimal.toBigInteger();
+ }
+ var signed = string.charCodeAt(0) === 45 || string.charCodeAt(0) === 43;
+ if (signed) {
+ if (string.length === 1) {
+ throw new NumberFormatException('Invalid big integer: ' + string);
+ }
+ if (string.charCodeAt(0) === 45) {
+ tmp$ = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ var isNegative = tmp$;
+ if (string.length === 2 && string.charCodeAt(1) === 48) {
+ return this.ZERO;
+ }
+ var tmp$_1 = this.arithmetic_0;
+ var endIndex = string.length;
+ tmp$_0 = new BigInteger(tmp$_1.parseForBase_bm4lxs$(string.substring(1, endIndex), base), isNegative);
+ }
+ else {
+ if (string.length === 1 && string.charCodeAt(0) === 48) {
+ return this.ZERO;
+ }
+ tmp$_0 = new BigInteger(this.arithmetic_0.parseForBase_bm4lxs$(string, base), Sign$POSITIVE_getInstance());
+ }
+ return tmp$_0;
+ };
+ BigInteger$Companion.prototype.fromWordArray_an6103$ = function (wordArray, sign) {
+ return new BigInteger(wordArray, sign);
+ };
+ BigInteger$Companion.prototype.determinSignFromNumber_0 = function (T_0, isT, number) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
+ tmp$ = getKClass(T_0);
+ if (equals(tmp$, getKClass(Long))) {
+ Kotlin.isType(tmp$_0 = number, Kotlin.Long) ? tmp$_0 : throwCCE();
+ if (number.toNumber() < 0)
+ tmp$_4 = Sign$NEGATIVE_getInstance();
+ else if (number.toNumber() > 0)
+ tmp$_4 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_4 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$, PrimitiveClasses$intClass)) {
+ typeof (tmp$_1 = number) === 'number' ? tmp$_1 : throwCCE();
+ if (number < 0)
+ tmp$_4 = Sign$NEGATIVE_getInstance();
+ else if (number > 0)
+ tmp$_4 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_4 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$, PrimitiveClasses$shortClass)) {
+ typeof (tmp$_2 = number) === 'number' ? tmp$_2 : throwCCE();
+ if (number < 0)
+ tmp$_4 = Sign$NEGATIVE_getInstance();
+ else if (number > 0)
+ tmp$_4 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_4 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$, PrimitiveClasses$byteClass)) {
+ typeof (tmp$_3 = number) === 'number' ? tmp$_3 : throwCCE();
+ if (number < 0)
+ tmp$_4 = Sign$NEGATIVE_getInstance();
+ else if (number > 0)
+ tmp$_4 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_4 = Sign$ZERO_getInstance();
+ }
+ else
+ throw RuntimeException_init('Unsupported type ' + toString(getKClass(T_0).simpleName));
+ return tmp$_4;
+ };
+ BigInteger$Companion.prototype.fromBigInteger_sao9k6$ = function (bigInteger) {
+ return bigInteger;
+ };
+ BigInteger$Companion.prototype.fromULong_mpgczg$ = function (uLong) {
+ return new BigInteger(this.arithmetic_0.fromULong_mpgczg$(uLong), Sign$POSITIVE_getInstance());
+ };
+ BigInteger$Companion.prototype.fromUInt_s87ys9$ = function (uInt) {
+ return new BigInteger(this.arithmetic_0.fromUInt_s87ys9$(uInt), Sign$POSITIVE_getInstance());
+ };
+ BigInteger$Companion.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ return new BigInteger(this.arithmetic_0.fromUShort_6hrhkk$(uShort), Sign$POSITIVE_getInstance());
+ };
+ BigInteger$Companion.prototype.fromUByte_mpmjao$ = function (uByte) {
+ return new BigInteger(this.arithmetic_0.fromUByte_mpmjao$(uByte), Sign$POSITIVE_getInstance());
+ };
+ BigInteger$Companion.prototype.fromLong_s8cxhz$ = function (long) {
+ return BigInteger_init(long);
+ };
+ BigInteger$Companion.prototype.fromInt_za3lpa$ = function (int) {
+ return BigInteger_init_0(int);
+ };
+ BigInteger$Companion.prototype.fromShort_mq22fl$ = function (short) {
+ return BigInteger_init_1(short);
+ };
+ BigInteger$Companion.prototype.fromByte_s8j3t7$ = function (byte) {
+ return BigInteger_init_2(byte);
+ };
+ BigInteger$Companion.prototype.tryFromFloat_8ca0d4$$default = function (float, exactRequired) {
+ var floatDecimalPart = float - Math_0.floor(float);
+ var bigDecimal = BigDecimal$Companion_getInstance().fromFloat_v8byof$(Math_0.floor(float), null);
+ if (exactRequired) {
+ if (floatDecimalPart > 0) {
+ throw new ArithmeticException('Cant create BigInteger without precision loss, and exact value was required');
+ }
+ }
+ return bigDecimal.toBigInteger();
+ };
+ BigInteger$Companion.prototype.tryFromDouble_8555vt$$default = function (double, exactRequired) {
+ var doubleDecimalPart = double - Math_0.floor(double);
+ var bigDecimal = BigDecimal$Companion_getInstance().fromDouble_p9jqea$(Math_0.floor(double), null);
+ if (exactRequired) {
+ if (doubleDecimalPart > 0) {
+ throw new ArithmeticException('Cant create BigInteger without precision loss, and exact value was required');
+ }
+ }
+ return bigDecimal.toBigInteger();
+ };
+ BigInteger$Companion.prototype.max_xwzc9q$ = function (first, second) {
+ var tmp$;
+ if (first.compareTo_za3rmp$(second) > 0) {
+ tmp$ = first;
+ }
+ else {
+ tmp$ = second;
+ }
+ return tmp$;
+ };
+ BigInteger$Companion.prototype.min_xwzc9q$ = function (first, second) {
+ var tmp$;
+ if (first.compareTo_za3rmp$(second) < 0) {
+ tmp$ = first;
+ }
+ else {
+ tmp$ = second;
+ }
+ return tmp$;
+ };
+ BigInteger$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: [BigNumber$Util, BigNumber$Creator]
+ };
+ var BigInteger$Companion_instance = null;
+ function BigInteger$Companion_getInstance() {
+ if (BigInteger$Companion_instance === null) {
+ new BigInteger$Companion();
+ }
+ return BigInteger$Companion_instance;
+ }
+ BigInteger.prototype.isResultZero_0 = function (resultMagnitude) {
+ return BigInteger$Companion_getInstance().arithmetic_0.compare_xwzc9q$(resultMagnitude, BigInteger$Companion_getInstance().arithmetic_0.ZERO) === 0;
+ };
+ BigInteger.prototype.add_k9hq86$ = function (other) {
+ var tmp$;
+ var comparison = BigInteger$Companion_getInstance().arithmetic_0.compare_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$);
+ if (other.sign === this.sign) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.add_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ }
+ else {
+ if (comparison > 0)
+ tmp$ = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.substract_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ else if (comparison < 0)
+ tmp$ = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.substract_xwzc9q$(other.magnitude_8be2vx$, this.magnitude_8be2vx$), other.sign);
+ else {
+ tmp$ = BigInteger$Companion_getInstance().ZERO;
+ }
+ }
+ return tmp$;
+ };
+ BigInteger.prototype.subtract_k9hq86$ = function (other) {
+ var tmp$;
+ var comparison = BigInteger$Companion_getInstance().arithmetic_0.compare_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$);
+ if (this != null ? this.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ return other.negate();
+ }
+ if (other != null ? other.equals(BigInteger$Companion_getInstance().ZERO) : null) {
+ return this;
+ }
+ if (other.sign === this.sign) {
+ if (comparison > 0)
+ tmp$ = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.substract_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ else if (comparison < 0)
+ tmp$ = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.substract_xwzc9q$(other.magnitude_8be2vx$, this.magnitude_8be2vx$), this.sign.not());
+ else {
+ tmp$ = BigInteger$Companion_getInstance().ZERO;
+ }
+ }
+ else {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.add_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ }
+ return tmp$;
+ };
+ BigInteger.prototype.multiply_k9hq86$ = function (other) {
+ var tmp$, tmp$_0;
+ if (this.isZero() || other.isZero()) {
+ return BigInteger$Companion_getInstance().ZERO;
+ }
+ if (this.sign !== other.sign) {
+ tmp$ = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ var sign = tmp$;
+ if (sign === Sign$POSITIVE_getInstance()) {
+ tmp$_0 = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.multiply_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), sign);
+ }
+ else {
+ tmp$_0 = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.multiply_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), sign);
+ }
+ return tmp$_0;
+ };
+ BigInteger.prototype.divide_k9hq86$ = function (other) {
+ var tmp$, tmp$_0;
+ if (other.isZero()) {
+ throw new ArithmeticException('Division by zero! ' + this + ' / ' + other);
+ }
+ var result = BigInteger$Companion_getInstance().arithmetic_0.divide_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$).first;
+ if (result != null ? result.equals(BigInteger$Companion_getInstance().arithmetic_0.ZERO) : null) {
+ tmp$_0 = BigInteger$Companion_getInstance().ZERO;
+ }
+ else {
+ if (this.sign !== other.sign) {
+ tmp$ = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ var sign = tmp$;
+ tmp$_0 = new BigInteger(result, sign);
+ }
+ return tmp$_0;
+ };
+ BigInteger.prototype.remainder_k9hq86$ = function (other) {
+ var tmp$;
+ if (other.isZero()) {
+ throw new ArithmeticException('Division by zero! ' + this + ' / ' + other);
+ }
+ if (this.sign !== other.sign) {
+ tmp$ = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ var sign = tmp$;
+ var result = BigInteger$Companion_getInstance().arithmetic_0.divide_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$).second;
+ if (result != null ? result.equals(BigInteger$Companion_getInstance().arithmetic_0.ZERO) : null) {
+ sign = Sign$ZERO_getInstance();
+ }
+ return new BigInteger(result, sign);
+ };
+ BigInteger.prototype.divideAndRemainder_k9hq86$ = function (other) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
+ if (other.isZero()) {
+ throw new ArithmeticException('Division by zero! ' + this + ' / ' + other);
+ }
+ if (this.sign !== other.sign) {
+ tmp$ = Sign$NEGATIVE_getInstance();
+ }
+ else {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ var sign = tmp$;
+ var result = BigInteger$Companion_getInstance().arithmetic_0.divide_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$);
+ if ((tmp$_0 = result.first) != null ? tmp$_0.equals(BigInteger$Companion_getInstance().arithmetic_0.ZERO) : null) {
+ tmp$_1 = BigInteger$Companion_getInstance().ZERO;
+ }
+ else {
+ tmp$_1 = new BigInteger(result.first, sign);
+ }
+ var quotient = tmp$_1;
+ if ((tmp$_2 = result.second) != null ? tmp$_2.equals(BigInteger$Companion_getInstance().arithmetic_0.ZERO) : null) {
+ tmp$_3 = BigInteger$Companion_getInstance().ZERO;
+ }
+ else {
+ tmp$_3 = new BigInteger(result.second, this.sign);
+ }
+ var remainder = tmp$_3;
+ return new Pair(quotient, remainder);
+ };
+ BigInteger.prototype.d1reciprocalRecursive_0 = function () {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.reciprocal_11rb$(this.magnitude_8be2vx$).first, this.sign);
+ };
+ BigInteger.prototype.sqrt = function () {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.sqrt_11rb$(this.magnitude_8be2vx$).first, this.sign);
+ };
+ BigInteger.prototype.sqrtAndRemainder = function () {
+ return new BigInteger$SqareRootAndRemainder(new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.sqrt_11rb$(this.magnitude_8be2vx$).first, this.sign), new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.sqrt_11rb$(this.magnitude_8be2vx$).second, this.sign));
+ };
+ BigInteger.prototype.gcd_sao9k6$ = function (other) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.gcd_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), Sign$POSITIVE_getInstance());
+ };
+ BigInteger.prototype.naiveGcd_0 = function (other) {
+ var u = this;
+ var v = other;
+ while (!(v != null ? v.equals(BigInteger$Companion_getInstance().ZERO) : null)) {
+ var tmpU = u;
+ u = v;
+ v = tmpU.rem_k9hq86$(v);
+ }
+ return u;
+ };
+ BigInteger.prototype.modInverse_sao9k6$ = function (modulo) {
+ var tmp$;
+ if (!((tmp$ = this.gcd_sao9k6$(modulo)) != null ? tmp$.equals(BigInteger$Companion_getInstance().ONE) : null)) {
+ throw new ArithmeticException('BigInteger is not invertible. This and modulus are not relatively prime (coprime)');
+ }
+ var u = BigInteger$Companion_getInstance().ONE;
+ var w = BigInteger$Companion_getInstance().ZERO;
+ var b = this;
+ var c = modulo;
+ while (!(c != null ? c.equals(BigInteger$Companion_getInstance().ZERO) : null)) {
+ var tmp$_0 = b.divrem_sao9k6$(c);
+ var q = tmp$_0.component1()
+ , r = tmp$_0.component2();
+ b = c;
+ c = r;
+ var tmpU = u;
+ u = w;
+ w = tmpU.minus_k9hq86$(q.times_k9hq86$(w));
+ }
+ return u;
+ };
+ BigInteger.prototype.mod_sao9k6$ = function (modulo) {
+ var tmp$;
+ var result = this.rem_k9hq86$(modulo);
+ if (result.compareTo_za3rmp$(0) < 0) {
+ tmp$ = result.plus_k9hq86$(modulo);
+ }
+ else {
+ tmp$ = result;
+ }
+ return tmp$;
+ };
+ BigInteger.prototype.compare_sao9k6$ = function (other) {
+ if (this.isZero() && other.isZero())
+ return 0;
+ if (other.isZero() && this.sign === Sign$POSITIVE_getInstance())
+ return 1;
+ if (other.isZero() && this.sign === Sign$NEGATIVE_getInstance())
+ return -1;
+ if (this.isZero() && other.sign === Sign$POSITIVE_getInstance())
+ return -1;
+ if (this.isZero() && other.sign === Sign$NEGATIVE_getInstance())
+ return 1;
+ if (this.sign !== other.sign)
+ return this.sign === Sign$POSITIVE_getInstance() ? 1 : -1;
+ return BigInteger$Companion_getInstance().arithmetic_0.compare_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$);
+ };
+ BigInteger.prototype.isZero = function () {
+ return this.sign === Sign$ZERO_getInstance();
+ };
+ BigInteger.prototype.negate = function () {
+ return new BigInteger(new ULongArray_init(copyOf(this.magnitude_8be2vx$.storage)), this.sign.not());
+ };
+ BigInteger.prototype.abs = function () {
+ return new BigInteger(new ULongArray_init(copyOf(this.magnitude_8be2vx$.storage)), Sign$POSITIVE_getInstance());
+ };
+ BigInteger.prototype.pow_sao9k6$ = function (exponent) {
+ if (exponent.compareTo_za3rmp$(Long$Companion$MAX_VALUE) <= 0) {
+ return this.pow_s8cxhz$(exponent.magnitude_8be2vx$.get_za3lpa$(0).data);
+ }
+ var counter = exponent;
+ var result = BigInteger$Companion_getInstance().ONE;
+ while (counter.compareTo_za3rmp$(0) > 0) {
+ counter = counter.dec();
+ result = result.times_k9hq86$(this);
+ }
+ return result;
+ };
+ BigInteger.prototype.pow_s8cxhz$ = function (exponent) {
+ var tmp$, tmp$_0;
+ if (exponent.toNumber() < 0) {
+ throw new ArithmeticException('Negative exponent not supported with BigInteger');
+ }
+ if (equals(this, BigInteger$Companion_getInstance().ZERO))
+ tmp$_0 = BigInteger$Companion_getInstance().ZERO;
+ else if (equals(this, BigInteger$Companion_getInstance().ONE))
+ tmp$_0 = BigInteger$Companion_getInstance().ONE;
+ else {
+ if (this.sign === Sign$NEGATIVE_getInstance()) {
+ if (equals(exponent.modulo(Kotlin.Long.fromInt(2)), L0)) {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ else {
+ tmp$ = Sign$NEGATIVE_getInstance();
+ }
+ }
+ else {
+ tmp$ = Sign$POSITIVE_getInstance();
+ }
+ var sign = tmp$;
+ tmp$_0 = new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.pow_19wkf8$(this.magnitude_8be2vx$, exponent), sign);
+ }
+ return tmp$_0;
+ };
+ BigInteger.prototype.pow_za3lpa$ = function (exponent) {
+ return this.pow_s8cxhz$(Kotlin.Long.fromInt(exponent));
+ };
+ BigInteger.prototype.signum = function () {
+ switch (this.sign.name) {
+ case 'POSITIVE':
+ return 1;
+ case 'NEGATIVE':
+ return -1;
+ case 'ZERO':
+ return 0;
+ default:return Kotlin.noWhenBranchMatched();
+ }
+ };
+ BigInteger.prototype.bitAt_s8cxhz$ = function (position) {
+ return BigInteger$Companion_getInstance().arithmetic_0.bitAt_19wkf8$(this.magnitude_8be2vx$, position);
+ };
+ BigInteger.prototype.setBitAt_2gd3um$ = function (position, bit) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.setBitAt_xjejkt$(this.magnitude_8be2vx$, position, bit), this.sign);
+ };
+ BigInteger.prototype.numberOfDecimalDigits = function () {
+ var bitLenght = BigInteger$Companion_getInstance().arithmetic_0.bitLength_11rb$(this.magnitude_8be2vx$);
+ var x = (bitLenght - 1 | 0) * BigInteger$Companion_getInstance().LOG_10_OF_2;
+ var minDigit = Math_0.ceil(x);
+ var tmp = this.div_k9hq86$(toBigInteger_0(10).pow_za3lpa$(numberToInt(minDigit)));
+ var counter = L0;
+ while (tmp.compareTo_za3rmp$(0) !== 0) {
+ tmp = tmp.div_za3lpa$(10);
+ counter = counter.inc();
+ }
+ return counter.add(Kotlin.Long.fromInt(numberToInt(minDigit)));
+ };
+ BigInteger.prototype.shl_za3lpa$ = function (places) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.shiftLeft_dpg1yx$(this.magnitude_8be2vx$, places), this.sign);
+ };
+ BigInteger.prototype.shr_za3lpa$ = function (places) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.shiftRight_dpg1yx$(this.magnitude_8be2vx$, places), this.sign);
+ };
+ BigInteger.prototype.unaryMinus = function () {
+ return this.negate();
+ };
+ BigInteger.prototype.dec = function () {
+ return this.minus_k9hq86$(BigInteger$Companion_getInstance().ONE);
+ };
+ BigInteger.prototype.inc = function () {
+ return this.plus_k9hq86$(BigInteger$Companion_getInstance().ONE);
+ };
+ BigInteger.prototype.divrem_sao9k6$ = function (other) {
+ var result = this.divideAndRemainder_k9hq86$(other);
+ return new BigInteger$QuotientAndRemainder(result.first, result.second);
+ };
+ BigInteger.prototype.and_11rb$ = function (other) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.and_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ };
+ BigInteger.prototype.or_11rb$ = function (other) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.or_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ };
+ BigInteger.prototype.xor_11rb$ = function (other) {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.xor_xwzc9q$(this.magnitude_8be2vx$, other.magnitude_8be2vx$), this.sign);
+ };
+ BigInteger.prototype.not = function () {
+ return new BigInteger(BigInteger$Companion_getInstance().arithmetic_0.not_11rb$(this.magnitude_8be2vx$), this.sign);
+ };
+ function BigInteger$compareTo$lambda(this$BigInteger) {
+ return function (it) {
+ return this$BigInteger.compare_sao9k6$(it);
+ };
+ }
+ function BigInteger$compareTo$lambda_0(this$BigInteger) {
+ return function (it) {
+ return this$BigInteger.compare_sao9k6$(it);
+ };
+ }
+ BigInteger.prototype.compareTo_za3rmp$ = function (other) {
+ var tmp$;
+ if (Kotlin.isNumber(other)) {
+ if (ComparisonWorkaround_getInstance().isSpecialHandlingForFloatNeeded_3p81yu$(other)) {
+ return this.javascriptNumberComparison_0(other);
+ }
+ }
+ if (Kotlin.isType(other, BigInteger))
+ tmp$ = this.compare_sao9k6$(other);
+ else if (Kotlin.isType(other, Kotlin.Long))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromLong_s8cxhz$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromInt_za3lpa$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromShort_mq22fl$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromByte_s8j3t7$(other));
+ else if (Kotlin.isType(other, ULong))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromULong_mpgczg$(other));
+ else if (Kotlin.isType(other, UInt))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromUInt_s87ys9$(other));
+ else if (Kotlin.isType(other, UShort))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromUShort_6hrhkk$(other));
+ else if (Kotlin.isType(other, UByte))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromUByte_mpmjao$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compareFloatAndBigInt_xq8bqh$(other, BigInteger$compareTo$lambda(this));
+ else if (typeof other === 'number')
+ tmp$ = this.compareDoubleAndBigInt_ehfbyw$(other, BigInteger$compareTo$lambda_0(this));
+ else
+ throw RuntimeException_init('Invalid comparison type for BigInteger: ' + toString(Kotlin.getKClassFromExpression(other).simpleName));
+ return tmp$;
+ };
+ function BigInteger$javascriptNumberComparison$lambda(this$BigInteger) {
+ return function (it) {
+ return this$BigInteger.compare_sao9k6$(it);
+ };
+ }
+ BigInteger.prototype.javascriptNumberComparison_0 = function (number) {
+ var tmp$;
+ var float = numberToDouble(number);
+ if (float % 1 === 0.0)
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromLong_s8cxhz$(numberToLong(number)));
+ else
+ tmp$ = this.compareFloatAndBigInt_xq8bqh$(numberToDouble(number), BigInteger$javascriptNumberComparison$lambda(this));
+ return tmp$;
+ };
+ BigInteger.prototype.compareFloatAndBigInt_xq8bqh$ = function (float, comparisonBlock) {
+ var tmp$;
+ var withoutDecimalPart = Math_0.floor(float);
+ var hasDecimalPart = float % 1 !== 0.0;
+ if (hasDecimalPart) {
+ var comparisonResult = comparisonBlock(BigInteger$Companion_getInstance().tryFromFloat_8ca0d4$(withoutDecimalPart + 1));
+ if (comparisonResult === 0) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = comparisonResult;
+ }
+ }
+ else {
+ tmp$ = comparisonBlock(BigInteger$Companion_getInstance().tryFromFloat_8ca0d4$(withoutDecimalPart));
+ }
+ return tmp$;
+ };
+ BigInteger.prototype.compareDoubleAndBigInt_ehfbyw$ = function (double, comparisonBlock) {
+ var tmp$;
+ var withoutDecimalPart = Math_0.floor(double);
+ var hasDecimalPart = double % 1 !== 0.0;
+ if (hasDecimalPart) {
+ var comparisonResult = comparisonBlock(BigInteger$Companion_getInstance().tryFromDouble_8555vt$(withoutDecimalPart + 1));
+ if (comparisonResult === 0) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = comparisonResult;
+ }
+ }
+ else {
+ tmp$ = comparisonBlock(BigInteger$Companion_getInstance().tryFromDouble_8555vt$(withoutDecimalPart));
+ }
+ return tmp$;
+ };
+ BigInteger.prototype.equals = function (other) {
+ var tmp$;
+ if (Kotlin.isType(other, BigInteger))
+ tmp$ = this.compare_sao9k6$(other);
+ else if (Kotlin.isType(other, Kotlin.Long))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromLong_s8cxhz$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromInt_za3lpa$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromShort_mq22fl$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromByte_s8j3t7$(other));
+ else if (Kotlin.isType(other, ULong))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromULong_mpgczg$(other));
+ else if (Kotlin.isType(other, UInt))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromUInt_s87ys9$(other));
+ else if (Kotlin.isType(other, UShort))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromUShort_6hrhkk$(other));
+ else if (Kotlin.isType(other, UByte))
+ tmp$ = this.compare_sao9k6$(BigInteger$Companion_getInstance().fromUByte_mpmjao$(other));
+ else
+ tmp$ = -1;
+ var comparison = tmp$;
+ return comparison === 0;
+ };
+ BigInteger.prototype.hashCode = function () {
+ return contentHashCode(this.magnitude_8be2vx$) + this.sign.hashCode() | 0;
+ };
+ BigInteger.prototype.toString = function () {
+ return this.toString_za3lpa$(10);
+ };
+ BigInteger.prototype.toString_za3lpa$ = function (base) {
+ var tmp$;
+ if (this.sign === Sign$NEGATIVE_getInstance()) {
+ tmp$ = '-';
+ }
+ else {
+ tmp$ = '';
+ }
+ var sign = tmp$;
+ return sign + BigInteger$Companion_getInstance().arithmetic_0.toString_dpg1yx$(this.magnitude_8be2vx$, base);
+ };
+ function BigInteger$QuotientAndRemainder(quotient, remainder) {
+ this.quotient = quotient;
+ this.remainder = remainder;
+ }
+ BigInteger$QuotientAndRemainder.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'QuotientAndRemainder',
+ interfaces: []
+ };
+ BigInteger$QuotientAndRemainder.prototype.component1 = function () {
+ return this.quotient;
+ };
+ BigInteger$QuotientAndRemainder.prototype.component2 = function () {
+ return this.remainder;
+ };
+ BigInteger$QuotientAndRemainder.prototype.copy_5qoi38$ = function (quotient, remainder) {
+ return new BigInteger$QuotientAndRemainder(quotient === void 0 ? this.quotient : quotient, remainder === void 0 ? this.remainder : remainder);
+ };
+ BigInteger$QuotientAndRemainder.prototype.toString = function () {
+ return 'QuotientAndRemainder(quotient=' + Kotlin.toString(this.quotient) + (', remainder=' + Kotlin.toString(this.remainder)) + ')';
+ };
+ BigInteger$QuotientAndRemainder.prototype.hashCode = function () {
+ var result = 0;
+ result = result * 31 + Kotlin.hashCode(this.quotient) | 0;
+ result = result * 31 + Kotlin.hashCode(this.remainder) | 0;
+ return result;
+ };
+ BigInteger$QuotientAndRemainder.prototype.equals = function (other) {
+ return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.quotient, other.quotient) && Kotlin.equals(this.remainder, other.remainder)))));
+ };
+ function BigInteger$SqareRootAndRemainder(squareRoot, remainder) {
+ this.squareRoot = squareRoot;
+ this.remainder = remainder;
+ }
+ BigInteger$SqareRootAndRemainder.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'SqareRootAndRemainder',
+ interfaces: []
+ };
+ BigInteger$SqareRootAndRemainder.prototype.component1 = function () {
+ return this.squareRoot;
+ };
+ BigInteger$SqareRootAndRemainder.prototype.component2 = function () {
+ return this.remainder;
+ };
+ BigInteger$SqareRootAndRemainder.prototype.copy_5qoi38$ = function (squareRoot, remainder) {
+ return new BigInteger$SqareRootAndRemainder(squareRoot === void 0 ? this.squareRoot : squareRoot, remainder === void 0 ? this.remainder : remainder);
+ };
+ BigInteger$SqareRootAndRemainder.prototype.toString = function () {
+ return 'SqareRootAndRemainder(squareRoot=' + Kotlin.toString(this.squareRoot) + (', remainder=' + Kotlin.toString(this.remainder)) + ')';
+ };
+ BigInteger$SqareRootAndRemainder.prototype.hashCode = function () {
+ var result = 0;
+ result = result * 31 + Kotlin.hashCode(this.squareRoot) | 0;
+ result = result * 31 + Kotlin.hashCode(this.remainder) | 0;
+ return result;
+ };
+ BigInteger$SqareRootAndRemainder.prototype.equals = function (other) {
+ return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.squareRoot, other.squareRoot) && Kotlin.equals(this.remainder, other.remainder)))));
+ };
+ BigInteger.prototype.times_s8itvh$ = function (char) {
+ if (this.compareTo_za3rmp$(0) < 0) {
+ throw RuntimeException_init('Char cannot be multiplied with negative number');
+ }
+ var counter = this;
+ var stringBuilder = StringBuilder_init();
+ while (counter.compareTo_za3rmp$(0) > 0) {
+ stringBuilder.append_s8itvh$(char);
+ counter = counter.dec();
+ }
+ return stringBuilder.toString();
+ };
+ BigInteger.prototype.toModularBigInteger_sao9k6$ = function (modulo) {
+ var creator = ModularBigInteger$Companion_getInstance().creatorForModulo_sao9k6$(modulo);
+ return creator.fromBigInteger_sao9k6$(this);
+ };
+ BigInteger.prototype.intValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(2147483647)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to int and provide exact value');
+ }
+ return this.magnitude_8be2vx$.get_za3lpa$(0).data.toInt();
+ };
+ BigInteger.prototype.longValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(Long$Companion$MAX_VALUE.toInt())) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to long and provide exact value');
+ }
+ return this.magnitude_8be2vx$.get_za3lpa$(0).data;
+ };
+ BigInteger.prototype.byteValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(kotlin_js_internal_ByteCompanionObject.MAX_VALUE)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to byte and provide exact value');
+ }
+ return toByte(this.magnitude_8be2vx$.get_za3lpa$(0).data.toInt());
+ };
+ BigInteger.prototype.shortValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(kotlin_js_internal_ShortCompanionObject.MAX_VALUE)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to short and provide exact value');
+ }
+ return toShort(this.magnitude_8be2vx$.get_za3lpa$(0).data.toInt());
+ };
+ BigInteger.prototype.uintValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(UInt.Companion.MAX_VALUE) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned int and provide exact value');
+ }
+ return new UInt(this.magnitude_8be2vx$.get_za3lpa$(0).data.toInt());
+ };
+ BigInteger.prototype.ulongValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(ULong.Companion.MAX_VALUE.data.toInt())) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned long and provide exact value');
+ }
+ return this.magnitude_8be2vx$.get_za3lpa$(0);
+ };
+ BigInteger.prototype.ubyteValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(UByte.Companion.MAX_VALUE.data & 255)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned byte and provide exact value');
+ }
+ return new UByte(toByte(this.magnitude_8be2vx$.get_za3lpa$(0).data.toInt()));
+ };
+ BigInteger.prototype.ushortValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.compareTo_za3rmp$(new UInt(UShort.Companion.MAX_VALUE.data & 65535)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned short and provide exact value');
+ }
+ return new UShort(toShort(this.magnitude_8be2vx$.get_za3lpa$(0).data.toInt()));
+ };
+ BigInteger.prototype.floatValue_6taknv$$default = function (exactRequired) {
+ if (exactRequired && this.compareTo_za3rmp$(kotlin_js_internal_FloatCompanionObject.MAX_VALUE) > 0) {
+ throw new ArithmeticException('Cannot convert to float and provide exact value');
+ }
+ return toDouble(this.toString());
+ };
+ BigInteger.prototype.doubleValue_6taknv$$default = function (exactRequired) {
+ if (exactRequired && this.compareTo_za3rmp$(kotlin_js_internal_DoubleCompanionObject.MAX_VALUE) > 0) {
+ throw new ArithmeticException('Cannot convert to float and provide exact value');
+ }
+ return toDouble(this.toString());
+ };
+ BigInteger.prototype.rangeTo_sao9k6$ = function (other) {
+ return new BigInteger$BigIntegerRange(this, other);
+ };
+ function BigInteger$BigIntegerRange(start, endInclusive) {
+ this.start_332k9n$_0 = start;
+ this.endInclusive_21m922$_0 = endInclusive;
+ }
+ Object.defineProperty(BigInteger$BigIntegerRange.prototype, 'start', {
+ get: function () {
+ return this.start_332k9n$_0;
+ }
+ });
+ Object.defineProperty(BigInteger$BigIntegerRange.prototype, 'endInclusive', {
+ get: function () {
+ return this.endInclusive_21m922$_0;
+ }
+ });
+ BigInteger$BigIntegerRange.prototype.iterator = function () {
+ return new BigInteger$BigIntegerIterator(this.start, this.endInclusive);
+ };
+ BigInteger$BigIntegerRange.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'BigIntegerRange',
+ interfaces: [Iterable, ClosedRange]
+ };
+ function BigInteger$BigIntegerIterator(start, endInclusive) {
+ this.endInclusive_0 = endInclusive;
+ this.current_0 = start;
+ }
+ BigInteger$BigIntegerIterator.prototype.hasNext = function () {
+ return this.current_0.compareTo_za3rmp$(this.endInclusive_0) <= 0;
+ };
+ BigInteger$BigIntegerIterator.prototype.next = function () {
+ var tmp$;
+ return tmp$ = this.current_0, this.current_0 = tmp$.inc(), tmp$;
+ };
+ BigInteger$BigIntegerIterator.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'BigIntegerIterator',
+ interfaces: [Iterator]
+ };
+ BigInteger.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'BigInteger',
+ interfaces: [Comparable, BitwiseCapable, NarrowingOperations, CommonBigNumberOperations, BigNumber]
+ };
+ function BigInteger_init(long, $this) {
+ $this = $this || Object.create(BigInteger.prototype);
+ var tmp$ = BigInteger$Companion_getInstance().arithmetic_0.fromLong_s8cxhz$(long);
+ var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
+ tmp$_0 = getKClass(Long);
+ if (equals(tmp$_0, getKClass(Long))) {
+ Kotlin.isType(tmp$_1 = long, Kotlin.Long) ? tmp$_1 : throwCCE();
+ if (long.toNumber() < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (long.toNumber() > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$intClass)) {
+ typeof (tmp$_2 = long) === 'number' ? tmp$_2 : throwCCE();
+ if (long < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (long > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$shortClass)) {
+ typeof (tmp$_3 = long) === 'number' ? tmp$_3 : throwCCE();
+ if (long < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (long > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$byteClass)) {
+ typeof (tmp$_4 = long) === 'number' ? tmp$_4 : throwCCE();
+ if (long < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (long > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else
+ throw RuntimeException_init('Unsupported type ' + toString(getKClass(Long).simpleName));
+ BigInteger.call($this, tmp$, tmp$_5);
+ return $this;
+ }
+ function BigInteger_init_0(int, $this) {
+ $this = $this || Object.create(BigInteger.prototype);
+ var tmp$ = BigInteger$Companion_getInstance().arithmetic_0.fromInt_za3lpa$(int);
+ var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
+ tmp$_0 = getKClass(Int);
+ if (equals(tmp$_0, getKClass(Long))) {
+ Kotlin.isType(tmp$_1 = int, Kotlin.Long) ? tmp$_1 : throwCCE();
+ if (int.toNumber() < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (int.toNumber() > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$intClass)) {
+ typeof (tmp$_2 = int) === 'number' ? tmp$_2 : throwCCE();
+ if (int < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (int > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$shortClass)) {
+ typeof (tmp$_3 = int) === 'number' ? tmp$_3 : throwCCE();
+ if (int < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (int > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$byteClass)) {
+ typeof (tmp$_4 = int) === 'number' ? tmp$_4 : throwCCE();
+ if (int < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (int > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else
+ throw RuntimeException_init('Unsupported type ' + toString(getKClass(Int).simpleName));
+ BigInteger.call($this, tmp$, tmp$_5);
+ return $this;
+ }
+ function BigInteger_init_1(short, $this) {
+ $this = $this || Object.create(BigInteger.prototype);
+ var tmp$ = BigInteger$Companion_getInstance().arithmetic_0.fromShort_mq22fl$(short);
+ var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
+ tmp$_0 = getKClass(Int);
+ if (equals(tmp$_0, getKClass(Long))) {
+ Kotlin.isType(tmp$_1 = short, Kotlin.Long) ? tmp$_1 : throwCCE();
+ if (short.toNumber() < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (short.toNumber() > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$intClass)) {
+ typeof (tmp$_2 = short) === 'number' ? tmp$_2 : throwCCE();
+ if (short < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (short > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$shortClass)) {
+ typeof (tmp$_3 = short) === 'number' ? tmp$_3 : throwCCE();
+ if (short < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (short > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$byteClass)) {
+ typeof (tmp$_4 = short) === 'number' ? tmp$_4 : throwCCE();
+ if (short < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (short > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else
+ throw RuntimeException_init('Unsupported type ' + toString(getKClass(Int).simpleName));
+ BigInteger.call($this, tmp$, tmp$_5);
+ return $this;
+ }
+ function BigInteger_init_2(byte, $this) {
+ $this = $this || Object.create(BigInteger.prototype);
+ var tmp$ = BigInteger$Companion_getInstance().arithmetic_0.fromByte_s8j3t7$(byte);
+ var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
+ tmp$_0 = getKClass(Int);
+ if (equals(tmp$_0, getKClass(Long))) {
+ Kotlin.isType(tmp$_1 = byte, Kotlin.Long) ? tmp$_1 : throwCCE();
+ if (byte.toNumber() < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (byte.toNumber() > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$intClass)) {
+ typeof (tmp$_2 = byte) === 'number' ? tmp$_2 : throwCCE();
+ if (byte < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (byte > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$shortClass)) {
+ typeof (tmp$_3 = byte) === 'number' ? tmp$_3 : throwCCE();
+ if (byte < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (byte > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else if (equals(tmp$_0, PrimitiveClasses$byteClass)) {
+ typeof (tmp$_4 = byte) === 'number' ? tmp$_4 : throwCCE();
+ if (byte < 0)
+ tmp$_5 = Sign$NEGATIVE_getInstance();
+ else if (byte > 0)
+ tmp$_5 = Sign$POSITIVE_getInstance();
+ else
+ tmp$_5 = Sign$ZERO_getInstance();
+ }
+ else
+ throw RuntimeException_init('Unsupported type ' + toString(getKClass(Int).simpleName));
+ BigInteger.call($this, tmp$, tmp$_5);
+ return $this;
+ }
+ function BigIntegerArithmetic() {
+ }
+ BigIntegerArithmetic.$metadata$ = {
+ kind: Kind_INTERFACE,
+ simpleName: 'BigIntegerArithmetic',
+ interfaces: []
+ };
+ function toBigInteger($receiver) {
+ return BigInteger$Companion_getInstance().fromLong_s8cxhz$($receiver);
+ }
+ function toBigInteger_0($receiver) {
+ return BigInteger$Companion_getInstance().fromInt_za3lpa$($receiver);
+ }
+ function toBigInteger_1($receiver) {
+ return BigInteger$Companion_getInstance().fromShort_mq22fl$($receiver);
+ }
+ function toBigInteger_2($receiver) {
+ return BigInteger$Companion_getInstance().fromByte_s8j3t7$($receiver);
+ }
+ function toBigInteger_3($receiver, base) {
+ if (base === void 0)
+ base = 10;
+ return BigInteger$Companion_getInstance().parseString_bm4lxs$($receiver, base);
+ }
+ function plus_0($receiver, other) {
+ return toBigInteger($receiver).plus_k9hq86$(other);
+ }
+ function plus_1($receiver, other) {
+ return toBigInteger_0($receiver).plus_k9hq86$(other);
+ }
+ function plus_2($receiver, other) {
+ return toBigInteger_1($receiver).plus_k9hq86$(other);
+ }
+ function plus_3($receiver, other) {
+ return toBigInteger_2($receiver).plus_k9hq86$(other);
+ }
+ function minus_0($receiver, other) {
+ return toBigInteger($receiver).minus_k9hq86$(other);
+ }
+ function minus_1($receiver, other) {
+ return toBigInteger_0($receiver).minus_k9hq86$(other);
+ }
+ function minus_2($receiver, other) {
+ return toBigInteger_1($receiver).minus_k9hq86$(other);
+ }
+ function minus_3($receiver, other) {
+ return toBigInteger_2($receiver).minus_k9hq86$(other);
+ }
+ function times($receiver, other) {
+ return toBigInteger($receiver).times_k9hq86$(other);
+ }
+ function times_0($receiver, other) {
+ return toBigInteger_0($receiver).times_k9hq86$(other);
+ }
+ function times_1($receiver, other) {
+ return toBigInteger_1($receiver).times_k9hq86$(other);
+ }
+ function times_2($receiver, other) {
+ return toBigInteger_2($receiver).times_k9hq86$(other);
+ }
+ function div($receiver, other) {
+ return toBigInteger($receiver).div_k9hq86$(other);
+ }
+ function div_0($receiver, other) {
+ return toBigInteger_0($receiver).div_k9hq86$(other);
+ }
+ function div_1($receiver, other) {
+ return toBigInteger_1($receiver).div_k9hq86$(other);
+ }
+ function div_2($receiver, other) {
+ return toBigInteger_2($receiver).div_k9hq86$(other);
+ }
+ function rem($receiver, other) {
+ return toBigInteger($receiver).rem_k9hq86$(other);
+ }
+ function rem_0($receiver, other) {
+ return toBigInteger_0($receiver).rem_k9hq86$(other);
+ }
+ function rem_1($receiver, other) {
+ return toBigInteger_1($receiver).rem_k9hq86$(other);
+ }
+ function rem_2($receiver, other) {
+ return toBigInteger_2($receiver).rem_k9hq86$(other);
+ }
+ var chosenArithmetic;
+ function Quadruple(a, b, c, d) {
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ this.d = d;
+ }
+ Quadruple.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'Quadruple',
+ interfaces: []
+ };
+ Quadruple.prototype.component1 = function () {
+ return this.a;
+ };
+ Quadruple.prototype.component2 = function () {
+ return this.b;
+ };
+ Quadruple.prototype.component3 = function () {
+ return this.c;
+ };
+ Quadruple.prototype.component4 = function () {
+ return this.d;
+ };
+ Quadruple.prototype.copy_18alr2$ = function (a, b, c, d) {
+ return new Quadruple(a === void 0 ? this.a : a, b === void 0 ? this.b : b, c === void 0 ? this.c : c, d === void 0 ? this.d : d);
+ };
+ Quadruple.prototype.toString = function () {
+ return 'Quadruple(a=' + Kotlin.toString(this.a) + (', b=' + Kotlin.toString(this.b)) + (', c=' + Kotlin.toString(this.c)) + (', d=' + Kotlin.toString(this.d)) + ')';
+ };
+ Quadruple.prototype.hashCode = function () {
+ var result = 0;
+ result = result * 31 + Kotlin.hashCode(this.a) | 0;
+ result = result * 31 + Kotlin.hashCode(this.b) | 0;
+ result = result * 31 + Kotlin.hashCode(this.c) | 0;
+ result = result * 31 + Kotlin.hashCode(this.d) | 0;
+ return result;
+ };
+ Quadruple.prototype.equals = function (other) {
+ return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.a, other.a) && Kotlin.equals(this.b, other.b) && Kotlin.equals(this.c, other.c) && Kotlin.equals(this.d, other.d)))));
+ };
+ function UIntArray$lambda(closure$init) {
+ return function (index) {
+ return closure$init(index).data;
+ };
+ }
+ var indexOfLast$lambda = wrapFunction(function () {
+ var UInt_init = Kotlin.kotlin.UInt;
+ return function (closure$predicate) {
+ return function (it) {
+ return closure$predicate(new UInt_init(it));
+ };
+ };
+ });
+ function BigInteger32Arithmetic() {
+ BigInteger32Arithmetic_instance = this;
+ this.baseMask = new ULong(new Kotlin.Long(-1, 0));
+ this.baseMaskInt = new UInt(-1);
+ this.overflowMask = new ULong(new Kotlin.Long(0, 1));
+ this.lowerMask = new ULong(Kotlin.Long.fromInt(65535));
+ this.base = new UInt(-1);
+ this.basePowerOfTwo_fx4hik$_0 = 32;
+ this.wordSizeInBits = 32;
+ this.ZERO_9ymz9v$_0 = UIntArray_init(0);
+ this.ONE_brbwn$_0 = new UIntArray(Kotlin.fillArray(new Int32Array(1), UIntArray$lambda(BigInteger32Arithmetic$ONE$lambda)));
+ this.TWO_bny25$_0 = new UIntArray(Kotlin.fillArray(new Int32Array(1), UIntArray$lambda(BigInteger32Arithmetic$TWO$lambda)));
+ this.TEN_bobfi$_0 = new UIntArray(Kotlin.fillArray(new Int32Array(1), UIntArray$lambda(BigInteger32Arithmetic$TEN$lambda)));
+ }
+ Object.defineProperty(BigInteger32Arithmetic.prototype, 'basePowerOfTwo', {
+ get: function () {
+ return this.basePowerOfTwo_fx4hik$_0;
+ }
+ });
+ Object.defineProperty(BigInteger32Arithmetic.prototype, 'ZERO', {
+ get: function () {
+ return this.ZERO_9ymz9v$_0;
+ }
+ });
+ Object.defineProperty(BigInteger32Arithmetic.prototype, 'ONE', {
+ get: function () {
+ return this.ONE_brbwn$_0;
+ }
+ });
+ Object.defineProperty(BigInteger32Arithmetic.prototype, 'TWO', {
+ get: function () {
+ return this.TWO_bny25$_0;
+ }
+ });
+ Object.defineProperty(BigInteger32Arithmetic.prototype, 'TEN', {
+ get: function () {
+ return this.TEN_bobfi$_0;
+ }
+ });
+ BigInteger32Arithmetic.prototype.numberOfLeadingZeroes_11rc$ = function (value) {
+ var x = value;
+ var y;
+ var n = this.basePowerOfTwo;
+ y = new UInt(x.data >>> 16);
+ if (!(y != null ? y.equals(new UInt(0)) : null)) {
+ n = n - 16 | 0;
+ x = y;
+ }
+ y = new UInt(x.data >>> 8);
+ if (!(y != null ? y.equals(new UInt(0)) : null)) {
+ n = n - 8 | 0;
+ x = y;
+ }
+ y = new UInt(x.data >>> 4);
+ if (!(y != null ? y.equals(new UInt(0)) : null)) {
+ n = n - 4 | 0;
+ x = y;
+ }
+ y = new UInt(x.data >>> 2);
+ if (!(y != null ? y.equals(new UInt(0)) : null)) {
+ n = n - 2 | 0;
+ x = y;
+ }
+ y = new UInt(x.data >>> 1);
+ if (!(y != null ? y.equals(new UInt(0)) : null)) {
+ return n - 2 | 0;
+ }
+ return n - x.data | 0;
+ };
+ BigInteger32Arithmetic.prototype.bitLength_11rb$ = function (value) {
+ var mostSignificant = value.get_za3lpa$(value.size - 1 | 0);
+ return this.bitLength_s87ys9$(mostSignificant) + Kotlin.imul(value.size - 1 | 0, this.basePowerOfTwo) | 0;
+ };
+ BigInteger32Arithmetic.prototype.bitLength_s87ys9$ = function (value) {
+ return this.basePowerOfTwo - this.numberOfLeadingZeroes_11rc$(value) | 0;
+ };
+ BigInteger32Arithmetic.prototype.trailingZeroBits_11rb$ = function (value) {
+ throw new NotImplementedError_init();
+ };
+ BigInteger32Arithmetic.prototype.removeLeadingZeroes_rsvixa$ = function (bigInteger) {
+ var $receiver_0 = bigInteger.storage;
+ var indexOfLast$result;
+ indexOfLast$break: do {
+ var tmp$;
+ tmp$ = reversed(get_indices_0($receiver_0)).iterator();
+ while (tmp$.hasNext()) {
+ var index = tmp$.next();
+ var it = new UInt($receiver_0[index]);
+ if (!(it != null ? it.equals(new UInt(0)) : null)) {
+ indexOfLast$result = index;
+ break indexOfLast$break;
+ }
+ }
+ indexOfLast$result = -1;
+ }
+ while (false);
+ var firstEmpty = indexOfLast$result + 1 | 0;
+ if (firstEmpty === -1 || firstEmpty === 0) {
+ return this.ZERO;
+ }
+ return new UIntArray(copyOfRange(bigInteger.storage, 0, firstEmpty));
+ };
+ function BigInteger32Arithmetic$shiftLeft$lambda(closure$shiftWords, closure$operand) {
+ return function (it) {
+ if (0 <= it && it < closure$shiftWords)
+ return new UInt(0);
+ else
+ return closure$operand.get_za3lpa$(it - closure$shiftWords | 0);
+ };
+ }
+ function BigInteger32Arithmetic$shiftLeft$lambda_0(closure$shiftWords, closure$operand, closure$shiftBits, this$BigInteger32Arithmetic, closure$originalSize, closure$wordsNeeded) {
+ return function (it) {
+ if (0 <= it && it < closure$shiftWords)
+ return new UInt(0);
+ else if (it === closure$shiftWords) {
+ var $this = closure$operand.get_za3lpa$(it - closure$shiftWords | 0);
+ var bitCount = closure$shiftBits;
+ return new UInt($this.data << bitCount);
+ }
+ else if ((closure$shiftWords + 1 | 0) <= it && it < (closure$originalSize + closure$shiftWords | 0)) {
+ var $this_0 = closure$operand.get_za3lpa$(it - closure$shiftWords | 0);
+ var bitCount_0 = closure$shiftBits;
+ var tmp$ = new UInt($this_0.data << bitCount_0);
+ var $this_1 = closure$operand.get_za3lpa$(it - closure$shiftWords - 1 | 0);
+ var bitCount_1 = this$BigInteger32Arithmetic.basePowerOfTwo - closure$shiftBits | 0;
+ var other = new UInt($this_1.data >>> bitCount_1);
+ return new UInt(tmp$.data | other.data);
+ }
+ else if (it === (closure$originalSize + closure$wordsNeeded - 1 | 0)) {
+ var $this_2 = closure$operand.get_za3lpa$(it - closure$wordsNeeded | 0);
+ var bitCount_2 = this$BigInteger32Arithmetic.basePowerOfTwo - closure$shiftBits | 0;
+ return new UInt($this_2.data >>> bitCount_2);
+ }
+ else {
+ throw RuntimeException_init('Invalid case ' + it);
+ }
+ };
+ }
+ BigInteger32Arithmetic.prototype.shiftLeft_dpg1yx$ = function (operand, places) {
+ var tmp$;
+ if (operand.isEmpty() || places === 0) {
+ return operand;
+ }
+ var originalSize = operand.size;
+ var leadingZeroes = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ var shiftWords = places / this.basePowerOfTwo | 0;
+ var shiftBits = places % this.basePowerOfTwo;
+ if (shiftBits > leadingZeroes) {
+ tmp$ = shiftWords + 1 | 0;
+ }
+ else {
+ tmp$ = shiftWords;
+ }
+ var wordsNeeded = tmp$;
+ if (shiftBits === 0) {
+ var size = operand.size + wordsNeeded | 0;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$shiftLeft$lambda(shiftWords, operand))));
+ }
+ var size_0 = operand.size + wordsNeeded | 0;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size_0), UIntArray$lambda(BigInteger32Arithmetic$shiftLeft$lambda_0(shiftWords, operand, shiftBits, this, originalSize, wordsNeeded))));
+ };
+ function BigInteger32Arithmetic$shiftRight$lambda(closure$operand, closure$wordsToDiscard, closure$shiftBits, this$BigInteger32Arithmetic) {
+ return function (it) {
+ var tmp$;
+ tmp$ = closure$operand.size - 1 - closure$wordsToDiscard | 0;
+ if (0 <= it && it < tmp$) {
+ var $this = closure$operand.get_za3lpa$(it + closure$wordsToDiscard | 0);
+ var bitCount = closure$shiftBits;
+ var tmp$_0 = new UInt($this.data >>> bitCount);
+ var $this_0 = closure$operand.get_za3lpa$(it + closure$wordsToDiscard + 1 | 0);
+ var bitCount_0 = this$BigInteger32Arithmetic.basePowerOfTwo - closure$shiftBits | 0;
+ var other = new UInt($this_0.data << bitCount_0);
+ return new UInt(tmp$_0.data | other.data);
+ }
+ else if (it === (closure$operand.size - 1 - closure$wordsToDiscard | 0)) {
+ var $this_1 = closure$operand.get_za3lpa$(it + closure$wordsToDiscard | 0);
+ var bitCount_1 = closure$shiftBits;
+ return new UInt($this_1.data >>> bitCount_1);
+ }
+ else {
+ throw RuntimeException_init('Invalid case ' + it);
+ }
+ };
+ }
+ BigInteger32Arithmetic.prototype.shiftRight_dpg1yx$ = function (operand, places) {
+ if (operand.isEmpty() || places === 0) {
+ return operand;
+ }
+ var shiftBits = places % this.basePowerOfTwo;
+ var wordsToDiscard = places / this.basePowerOfTwo | 0;
+ if (wordsToDiscard >= operand.size) {
+ return this.ZERO;
+ }
+ if (shiftBits === 0) {
+ var toIndex = operand.size;
+ return new UIntArray(copyOfRange(operand.storage, wordsToDiscard, toIndex));
+ }
+ if (operand.size > 1 && (operand.size - wordsToDiscard | 0) === 1) {
+ return new UIntArray(new Int32Array([(new UInt(operand.get_za3lpa$(operand.size - 1 | 0).data >>> shiftBits)).toInt()]));
+ }
+ var size = operand.size - wordsToDiscard | 0;
+ var result = new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$shiftRight$lambda(operand, wordsToDiscard, shiftBits, this))));
+ return result;
+ };
+ BigInteger32Arithmetic.prototype.normalize_uzv4wk$ = function (dividend, divisor) {
+ var divisorSize = divisor.size;
+ var normalizationShift = this.numberOfLeadingZeroes_11rc$(divisor.get_za3lpa$(divisorSize - 1 | 0));
+ var divisorNormalized = this.shl_ap2q72$(divisor, normalizationShift);
+ var dividendNormalized = this.shl_ap2q72$(dividend, normalizationShift);
+ return new Triple(dividendNormalized, divisorNormalized, normalizationShift);
+ };
+ BigInteger32Arithmetic.prototype.normalize_rsvixa$ = function (operand) {
+ var normalizationShift = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ return new Pair(this.shl_ap2q72$(operand, normalizationShift), normalizationShift);
+ };
+ BigInteger32Arithmetic.prototype.denormalize_vxzh8$ = function (remainderNormalized, normalizationShift) {
+ var remainder = this.shr_ap2q72$(remainderNormalized, normalizationShift);
+ return remainder;
+ };
+ BigInteger32Arithmetic.prototype.compare_xwzc9q$ = function (first, second) {
+ if (first.size > second.size) {
+ return 1;
+ }
+ if (second.size > first.size) {
+ return -1;
+ }
+ var counter = first.size - 1 | 0;
+ var firstIsLarger = false;
+ var bothAreEqual = true;
+ while (counter >= 0) {
+ var $this = first.get_za3lpa$(counter);
+ var other = second.get_za3lpa$(counter);
+ if (uintCompare($this.data, other.data) > 0) {
+ firstIsLarger = true;
+ bothAreEqual = false;
+ break;
+ }
+ var $this_0 = first.get_za3lpa$(counter);
+ var other_0 = second.get_za3lpa$(counter);
+ if (uintCompare($this_0.data, other_0.data) < 0) {
+ firstIsLarger = false;
+ bothAreEqual = false;
+ break;
+ }
+ counter = counter - 1 | 0;
+ }
+ if (bothAreEqual) {
+ return 0;
+ }
+ if (firstIsLarger) {
+ return 1;
+ }
+ else {
+ return -1;
+ }
+ };
+ function BigInteger32Arithmetic$add$lambda(it) {
+ return new UInt(0);
+ }
+ BigInteger32Arithmetic.prototype.add_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
+ if (first.size === 1 && ((tmp$ = first.get_za3lpa$(0)) != null ? tmp$.equals(new UInt(0)) : null))
+ return second;
+ if (second.size === 1 && ((tmp$_0 = second.get_za3lpa$(0)) != null ? tmp$_0.equals(new UInt(0)) : null))
+ return first;
+ if (first.size > second.size) {
+ tmp$_1 = new Quadruple(first.size, second.size, first, second);
+ }
+ else {
+ tmp$_1 = new Quadruple(second.size, first.size, second, first);
+ }
+ var tmp$_4 = tmp$_1;
+ var maxLength = tmp$_4.component1()
+ , minLength = tmp$_4.component2()
+ , largerData = tmp$_4.component3()
+ , smallerData = tmp$_4.component4();
+ var size = maxLength + 1 | 0;
+ var result = new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$add$lambda)));
+ var i = 0;
+ var sum = new ULong(Kotlin.Long.ZERO);
+ while (i < minLength) {
+ var $this = sum;
+ var other = largerData.get_za3lpa$(i);
+ var $this_0 = new ULong($this.data.add((new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295))).data));
+ var other_0 = smallerData.get_za3lpa$(i);
+ sum = new ULong($this_0.data.add((new ULong(Kotlin.Long.fromInt(other_0.data).and(L4294967295))).data));
+ var tmp$_5 = i;
+ var $this_1 = sum;
+ var other_1 = this.baseMask;
+ result.set_6sqrdv$(tmp$_5, new UInt((new ULong($this_1.data.and(other_1.data))).data.toInt()));
+ var $this_2 = sum;
+ var bitCount = this.basePowerOfTwo;
+ sum = new ULong($this_2.data.shiftRightUnsigned(bitCount));
+ i = i + 1 | 0;
+ }
+ while (true) {
+ if (sum != null ? sum.equals(new ULong(Kotlin.Long.ZERO)) : null) {
+ while (i < maxLength) {
+ result.set_6sqrdv$(i, largerData.get_za3lpa$(i));
+ i = i + 1 | 0;
+ }
+ if ((tmp$_2 = result.get_za3lpa$(result.size - 1 | 0)) != null ? tmp$_2.equals(new UInt(0)) : null) {
+ var toIndex = result.size - 1 | 0;
+ tmp$_3 = new UIntArray(copyOfRange(result.storage, 0, toIndex));
+ }
+ else {
+ tmp$_3 = result;
+ }
+ return tmp$_3;
+ }
+ if (i === maxLength) {
+ result.set_6sqrdv$(maxLength, new UInt(sum.data.toInt()));
+ return result;
+ }
+ var $this_3 = sum;
+ var other_2 = largerData.get_za3lpa$(i);
+ sum = new ULong($this_3.data.add((new ULong(Kotlin.Long.fromInt(other_2.data).and(L4294967295))).data));
+ var tmp$_6 = i;
+ var $this_4 = sum;
+ var other_3 = this.baseMask;
+ result.set_6sqrdv$(tmp$_6, new UInt((new ULong($this_4.data.and(other_3.data))).data.toInt()));
+ var $this_5 = sum;
+ var bitCount_0 = this.basePowerOfTwo;
+ sum = new ULong($this_5.data.shiftRightUnsigned(bitCount_0));
+ i = i + 1 | 0;
+ }
+ };
+ function BigInteger32Arithmetic$substract$lambda(it) {
+ return new UInt(0);
+ }
+ BigInteger32Arithmetic.prototype.substract_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0;
+ var firstIsLarger = this.compare_xwzc9q$(first, second) === 1;
+ if (firstIsLarger) {
+ tmp$ = new Quadruple(first.size, second.size, first, second);
+ }
+ else {
+ tmp$ = new Quadruple(second.size, first.size, second, first);
+ }
+ var tmp$_1 = tmp$;
+ var largerLength = tmp$_1.component1()
+ , smallerLength = tmp$_1.component2()
+ , largerData = tmp$_1.component3()
+ , smallerData = tmp$_1.component4();
+ var size = largerLength + 1 | 0;
+ var result = new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$substract$lambda)));
+ var i = 0;
+ var diff = new ULong(Kotlin.Long.ZERO);
+ while (i < smallerLength) {
+ var $this = largerData.get_za3lpa$(i);
+ var $this_0 = new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295));
+ var other = smallerData.get_za3lpa$(i);
+ var $this_1 = new ULong($this_0.data.subtract((new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295))).data));
+ var other_0 = diff;
+ diff = new ULong($this_1.data.subtract(other_0.data));
+ result.set_6sqrdv$(i, new UInt(diff.data.toInt()));
+ var $this_2 = diff;
+ var other_1 = this.overflowMask;
+ var $this_3 = new ULong($this_2.data.and(other_1.data));
+ var bitCount = this.basePowerOfTwo;
+ diff = new ULong($this_3.data.shiftRightUnsigned(bitCount));
+ i = i + 1 | 0;
+ }
+ while (!(diff != null ? diff.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ var $this_4 = largerData.get_za3lpa$(i);
+ var $this_5 = new ULong(Kotlin.Long.fromInt($this_4.data).and(L4294967295));
+ var other_2 = diff;
+ diff = new ULong($this_5.data.subtract(other_2.data));
+ var $this_6 = diff;
+ var other_3 = this.overflowMask;
+ var $this_7 = new ULong($this_6.data.and(other_3.data));
+ var bitCount_0 = this.basePowerOfTwo;
+ if ((tmp$_0 = new ULong($this_7.data.shiftRightUnsigned(bitCount_0))) != null ? tmp$_0.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ var tmp$_2 = i;
+ var $this_8 = diff;
+ var other_4 = new ULong(Kotlin.Long.ONE);
+ result.set_6sqrdv$(tmp$_2, new UInt((new ULong($this_8.data.subtract(other_4.data))).data.toInt()));
+ }
+ else {
+ result.set_6sqrdv$(i, new UInt(diff.data.toInt()));
+ diff = new ULong(Kotlin.Long.ZERO);
+ }
+ diff = new ULong(diff.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (i < largerLength) {
+ result.set_6sqrdv$(i, largerData.get_za3lpa$(i));
+ i = i + 1 | 0;
+ }
+ var destination = ArrayList_init();
+ var tmp$_3;
+ tmp$_3 = result.iterator();
+ while (tmp$_3.hasNext()) {
+ var element = tmp$_3.next();
+ if (element != null ? element.equals(new UInt(0)) : null)
+ destination.add_11rb$(element);
+ }
+ if (destination.isEmpty()) {
+ return this.ZERO;
+ }
+ var $receiver_0 = result.storage;
+ var indexOfLast$result;
+ indexOfLast$break: do {
+ var tmp$_4;
+ tmp$_4 = reversed(get_indices_0($receiver_0)).iterator();
+ while (tmp$_4.hasNext()) {
+ var index = tmp$_4.next();
+ var it = new UInt($receiver_0[index]);
+ if (!(it != null ? it.equals(new UInt(0)) : null)) {
+ indexOfLast$result = index;
+ break indexOfLast$break;
+ }
+ }
+ indexOfLast$result = -1;
+ }
+ while (false);
+ var firstEmpty = indexOfLast$result + 1 | 0;
+ return new UIntArray(copyOfRange(result.storage, 0, firstEmpty));
+ };
+ BigInteger32Arithmetic.prototype.multiply_oqfnby$ = function (first, second) {
+ var result = new UInt(Kotlin.imul(first.data, second.data));
+ var bitCount = this.basePowerOfTwo;
+ var high = new UInt(result.data >>> bitCount);
+ var low = result;
+ return this.removeLeadingZeroes_rsvixa$(new UIntArray(new Int32Array([low.toInt(), high.toInt()])));
+ };
+ BigInteger32Arithmetic.prototype.multiply_rigg6l$ = function (first, second) {
+ var tmp$;
+ var result = UIntArray_init(first.size + 1 | 0);
+ var product;
+ var sum;
+ tmp$ = first.size;
+ for (var i = 0; i < tmp$; i++) {
+ var $this = first.get_za3lpa$(i);
+ product = new ULong((new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295))).data.multiply((new ULong(Kotlin.Long.fromInt(second.data).and(L4294967295))).data));
+ var $this_0 = result.get_za3lpa$(i);
+ var tmp$_0 = new ULong(Kotlin.Long.fromInt($this_0.data).and(L4294967295));
+ var other = this.baseMask;
+ var other_0 = new UInt((new ULong(product.data.and(other.data))).data.toInt());
+ sum = new ULong(tmp$_0.data.add((new ULong(Kotlin.Long.fromInt(other_0.data).and(L4294967295))).data));
+ var $this_1 = sum;
+ var other_1 = this.baseMask;
+ result.set_6sqrdv$(i, new UInt((new ULong($this_1.data.and(other_1.data))).data.toInt()));
+ var $this_2 = sum;
+ var bitCount = this.basePowerOfTwo;
+ sum = new ULong($this_2.data.shiftRightUnsigned(bitCount));
+ var tmp$_1 = i + 1 | 0;
+ var bitCount_0 = this.basePowerOfTwo;
+ var tmp$_2 = new UInt((new ULong(product.data.shiftRightUnsigned(bitCount_0))).data.toInt());
+ var other_2 = new UInt(sum.data.toInt());
+ result.set_6sqrdv$(tmp$_1, new UInt(tmp$_2.data + other_2.data | 0));
+ }
+ return this.removeLeadingZeroes_rsvixa$(result);
+ };
+ BigInteger32Arithmetic.prototype.multiply_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0;
+ var index = 0;
+ var accumulator = this.ZERO;
+ tmp$ = second.iterator();
+ while (tmp$.hasNext()) {
+ var element = tmp$.next();
+ var index_0 = (tmp$_0 = index, index = tmp$_0 + 1 | 0, tmp$_0);
+ accumulator = this.plus_daxkpa$(accumulator, this.shl_ap2q72$(this.multiply_rigg6l$(first, element), Kotlin.imul(index_0, this.basePowerOfTwo)));
+ }
+ return accumulator;
+ };
+ BigInteger32Arithmetic.prototype.pow_19wkf8$ = function (base, exponent) {
+ if (equals(exponent, L0)) {
+ return this.ONE;
+ }
+ if (equals(exponent, L1)) {
+ return base;
+ }
+ var $receiver = until_0(0, exponent);
+ var tmp$;
+ var accumulator = this.ONE;
+ tmp$ = $receiver.iterator();
+ while (tmp$.hasNext()) {
+ var element = tmp$.next();
+ accumulator = this.times_daxkpa$(accumulator, base);
+ }
+ return accumulator;
+ };
+ BigInteger32Arithmetic.prototype.divide_xwzc9q$ = function (first, second) {
+ return this.basicDivide_uzv4wk$(first, second);
+ };
+ BigInteger32Arithmetic.prototype.basicDivide_uzv4wk$ = function (unnormalizedDividend, unnormalizedDivisor) {
+ var tmp$, tmp$_0;
+ if (this.compareTo_daxkpa$(unnormalizedDivisor, unnormalizedDividend) > 0) {
+ return new Pair(this.ZERO, unnormalizedDividend);
+ }
+ if (unnormalizedDivisor.size === 1 && unnormalizedDividend.size === 1) {
+ return new Pair(this.removeLeadingZeroes_rsvixa$(new UIntArray(new Int32Array([uintDivide(unnormalizedDividend.get_za3lpa$(0), unnormalizedDivisor.get_za3lpa$(0)).toInt()]))), this.removeLeadingZeroes_rsvixa$(new UIntArray(new Int32Array([uintRemainder(unnormalizedDividend.get_za3lpa$(0), unnormalizedDivisor.get_za3lpa$(0)).toInt()]))));
+ }
+ var bitPrecision = this.bitLength_11rb$(unnormalizedDividend) - this.bitLength_11rb$(unnormalizedDivisor) | 0;
+ if (bitPrecision === 0) {
+ return new Pair(new UIntArray(new Int32Array([(new UInt(1)).toInt()])), this.minus_daxkpa$(unnormalizedDividend, unnormalizedDivisor));
+ }
+ var tmp$_1 = this.normalize_uzv4wk$(unnormalizedDividend, unnormalizedDivisor);
+ var dividend = tmp$_1.component1()
+ , divisor = tmp$_1.component2()
+ , normalizationShift = tmp$_1.component3();
+ var dividendSize = dividend.size;
+ var divisorSize = divisor.size;
+ var wordPrecision = dividendSize - divisorSize | 0;
+ var qjhat;
+ var reconstructedQuotient;
+ var quotient = UIntArray_init(wordPrecision);
+ var divisorTimesBaseToPowerOfM = this.shl_ap2q72$(divisor, Kotlin.imul(wordPrecision, this.basePowerOfTwo));
+ if (this.compareTo_daxkpa$(dividend, divisorTimesBaseToPowerOfM) >= 0) {
+ quotient = UIntArray_init(wordPrecision + 1 | 0);
+ quotient.set_6sqrdv$(wordPrecision, new UInt(1));
+ dividend = this.minus_daxkpa$(dividend, divisorTimesBaseToPowerOfM);
+ }
+ for (var j = wordPrecision - 1 | 0; j >= 0; j--) {
+ if ((divisorSize + j | 0) < dividend.size) {
+ var $this = dividend.get_za3lpa$(divisorSize + j | 0);
+ var $this_0 = new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295));
+ var bitCount = this.basePowerOfTwo;
+ var $this_1 = new ULong($this_0.data.shiftLeft(bitCount));
+ var other = dividend.get_za3lpa$(divisorSize + j - 1 | 0);
+ var $this_2 = new ULong($this_1.data.add((new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295))).data));
+ var other_0 = divisor.get_za3lpa$(divisorSize - 1 | 0);
+ tmp$ = ulongDivide($this_2, new ULong(Kotlin.Long.fromInt(other_0.data).and(L4294967295)));
+ }
+ else {
+ if ((divisorSize + j | 0) === dividend.size) {
+ var $this_3 = uintDivide(dividend.get_za3lpa$(divisorSize + j - 1 | 0), divisor.get_za3lpa$(divisorSize - 1 | 0));
+ tmp$ = new ULong(Kotlin.Long.fromInt($this_3.data).and(L4294967295));
+ }
+ else {
+ tmp$ = new ULong(Kotlin.Long.ZERO);
+ }
+ }
+ qjhat = tmp$;
+ var $this_4 = this.base;
+ var other_1 = new ULong(Kotlin.Long.ONE);
+ var other_2 = new ULong((new ULong(Kotlin.Long.fromInt($this_4.data).and(L4294967295))).data.subtract(other_1.data));
+ if (ulongCompare(qjhat.data, other_2.data) < 0) {
+ tmp$_0 = new UInt(qjhat.data.toInt());
+ }
+ else {
+ var $this_5 = this.base;
+ var other_3 = new UInt(1);
+ tmp$_0 = new UInt($this_5.data - other_3.data | 0);
+ }
+ quotient.set_6sqrdv$(j, tmp$_0);
+ reconstructedQuotient = this.shl_ap2q72$(this.times_nkem5j$(divisor, quotient.get_za3lpa$(j)), Kotlin.imul(j, this.basePowerOfTwo));
+ while (this.compareTo_daxkpa$(reconstructedQuotient, dividend) > 0) {
+ var tmp$_2 = quotient;
+ var $this_6 = quotient.get_za3lpa$(j);
+ var other_4 = new UInt(1);
+ tmp$_2.set_6sqrdv$(j, new UInt($this_6.data - other_4.data | 0));
+ reconstructedQuotient = this.shl_ap2q72$(this.times_nkem5j$(divisor, quotient.get_za3lpa$(j)), Kotlin.imul(j, this.basePowerOfTwo));
+ }
+ dividend = this.minus_daxkpa$(dividend, reconstructedQuotient);
+ }
+ while (this.compareTo_daxkpa$(dividend, divisor) >= 0) {
+ quotient = this.plus_nkem5j$(quotient, new UInt(1));
+ dividend = this.minus_daxkpa$(dividend, divisor);
+ }
+ var denormRemainder = this.denormalize_vxzh8$(dividend, normalizationShift);
+ return new Pair(this.removeLeadingZeroes_rsvixa$(quotient), denormRemainder);
+ };
+ function BigInteger32Arithmetic$basicDivide2$lambda(it) {
+ return new UInt(0);
+ }
+ BigInteger32Arithmetic.prototype.basicDivide2_uzv4wk$ = function (unnormalizedDividend, unnormalizedDivisor) {
+ var tmp$ = this.normalize_uzv4wk$(unnormalizedDividend, unnormalizedDivisor);
+ var a = tmp$.component1()
+ , b = tmp$.component2()
+ , shift = tmp$.component3();
+ var m = a.size - b.size | 0;
+ var bmb = this.shl_ap2q72$(b, Kotlin.imul(m, this.wordSizeInBits));
+ var size = m + 1 | 0;
+ var q = new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$basicDivide2$lambda)));
+ if (this.compareTo_daxkpa$(a, bmb) > 0) {
+ q.set_6sqrdv$(m, new UInt(1));
+ a = this.minus_daxkpa$(a, bmb);
+ }
+ var qjhat = this.ZERO;
+ var qjhatULong = new ULong(Kotlin.Long.ZERO);
+ var bjb = this.ZERO;
+ var delta = this.ZERO;
+ for (var j = m - 1 | 0; j >= 0; j--) {
+ var $receiver = a;
+ var fromIndex = b.size - 1 | 0;
+ var toIndex = b.size + 1 | 0;
+ var $this = this.toULongExact_rsvixa$(new UIntArray(copyOfRange($receiver.storage, fromIndex, toIndex)));
+ var other = b.get_za3lpa$(b.size - 1 | 0);
+ qjhatULong = ulongDivide($this, new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295)));
+ q.set_6sqrdv$(j, new UInt(minOf(qjhatULong, this.baseMask).data.toInt()));
+ bjb = this.shl_ap2q72$(b, Kotlin.imul(j, this.wordSizeInBits));
+ var qjBjb = this.shl_ap2q72$(this.times_nkem5j$(b, q.get_za3lpa$(j)), Kotlin.imul(j, this.wordSizeInBits));
+ if (this.compareTo_daxkpa$(qjBjb, a) > 0) {
+ delta = this.minus_daxkpa$(qjBjb, a);
+ while (this.compareTo_daxkpa$(delta, qjBjb) > 0) {
+ var $this_0 = q.get_za3lpa$(j);
+ var other_0 = new UInt(1);
+ q.set_6sqrdv$(j, new UInt($this_0.data - other_0.data | 0));
+ delta = this.minus_daxkpa$(delta, bjb);
+ }
+ a = this.shl_ap2q72$(this.minus_daxkpa$(a, this.times_nkem5j$(b, q.get_za3lpa$(j))), Kotlin.imul(j, this.wordSizeInBits));
+ }
+ else {
+ a = this.minus_daxkpa$(a, qjBjb);
+ }
+ }
+ var denormRemainder = this.denormalize_vxzh8$(a, shift);
+ return new Pair(this.removeLeadingZeroes_rsvixa$(q), denormRemainder);
+ };
+ BigInteger32Arithmetic.prototype.d1ReciprocalRecursiveWordVersion_rsvixa$ = function (a) {
+ var tmp$, tmp$_0;
+ var n = a.size - 1 | 0;
+ if (n <= 2) {
+ if (n === 0) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = n;
+ }
+ var corrected = tmp$;
+ var rhoPowered = this.shl_ap2q72$(this.ONE, Kotlin.imul(corrected * 2 | 0, this.wordSizeInBits));
+ var x = this.div_daxkpa$(rhoPowered, a);
+ var r = this.minus_daxkpa$(rhoPowered, this.times_daxkpa$(x, a));
+ return new Pair(x, r);
+ }
+ var x_0 = (n - 1 | 0) / 2;
+ var l = numberToInt(Math_0.floor(x_0));
+ var h = n - l | 0;
+ var fromIndex = a.size - h - 1 | 0;
+ var toIndex = a.size;
+ var ah = new UIntArray(copyOfRange(a.storage, fromIndex, toIndex));
+ var al = new UIntArray(copyOfRange(a.storage, 0, l));
+ var tmp$_1 = this.d1ReciprocalRecursiveWordVersion_rsvixa$(ah);
+ var xh = tmp$_1.component1()
+ , rh = tmp$_1.component2();
+ var s = this.times_daxkpa$(al, xh);
+ var rhRhoL = this.shl_ap2q72$(rh, Kotlin.imul(l, this.wordSizeInBits));
+ if (this.compareTo_daxkpa$(rhRhoL, s) >= 0) {
+ tmp$_0 = this.minus_daxkpa$(rhRhoL, s);
+ }
+ else {
+ xh = this.minus_daxkpa$(xh, this.ONE);
+ tmp$_0 = this.minus_daxkpa$(this.plus_daxkpa$(rhRhoL, a), s);
+ }
+ var t = tmp$_0;
+ var tm = this.shr_ap2q72$(t, Kotlin.imul(h, this.wordSizeInBits));
+ var d = this.shr_ap2q72$(this.times_daxkpa$(xh, tm), Kotlin.imul(h, this.wordSizeInBits));
+ var x_1 = this.plus_daxkpa$(this.shl_ap2q72$(xh, Kotlin.imul(l, this.wordSizeInBits)), d);
+ var r_0 = this.minus_daxkpa$(this.shl_ap2q72$(t, Kotlin.imul(l, this.wordSizeInBits)), this.times_daxkpa$(a, d));
+ if (this.compareTo_daxkpa$(r_0, a) >= 0) {
+ x_1 = this.plus_daxkpa$(x_1, this.ONE);
+ r_0 = this.minus_daxkpa$(r_0, a);
+ if (this.compareTo_daxkpa$(r_0, a) >= 0) {
+ x_1 = this.plus_daxkpa$(x_1, this.ONE);
+ r_0 = this.minus_daxkpa$(r_0, a);
+ }
+ }
+ return new Pair(x_1, r_0);
+ };
+ BigInteger32Arithmetic.prototype.reciprocalSingleWord_s87ys9$ = function (operand) {
+ var bitLength = this.bitLength_s87ys9$(operand);
+ var requiredPrecision = bitLength * 4 | 0;
+ if ((bitLength * 2 | 0) <= 63) {
+ var base = new ULong((new ULong(Kotlin.Long.ONE)).data.shiftLeft(requiredPrecision));
+ var result = ulongDivide(base, new ULong(Kotlin.Long.fromInt(operand.data).and(L4294967295)));
+ return this.checkReciprocal_0(new UIntArray(new Int32Array([operand.toInt()])), new Pair(new UIntArray(new Int32Array([(new UInt(result.data.toInt())).toInt()])), requiredPrecision));
+ }
+ else {
+ var base_0 = this.shl_ap2q72$(this.ONE, requiredPrecision);
+ var result_0 = this.div_nkem5j$(base_0, operand);
+ return this.checkReciprocal_0(new UIntArray(new Int32Array([operand.toInt()])), new Pair(result_0, requiredPrecision));
+ }
+ };
+ BigInteger32Arithmetic.prototype.checkReciprocal_0 = function (operand, reciprocal) {
+ var tmp$;
+ var product = this.times_daxkpa$(operand, reciprocal.first);
+ var check = this.shr_ap2q72$(product, reciprocal.second);
+ if (!(check != null ? check.equals(this.ONE) : null)) {
+ tmp$ = new Pair(reciprocal.first, reciprocal.second - 1 | 0);
+ }
+ else {
+ tmp$ = new Pair(reciprocal.first, reciprocal.second);
+ }
+ return tmp$;
+ };
+ BigInteger32Arithmetic.prototype.reciprocal_11rb$ = function (operand) {
+ return this.d1ReciprocalRecursiveWordVersion_rsvixa$(operand);
+ };
+ function BigInteger32Arithmetic$reciprocalDivision$lambda(closure$product) {
+ return function (it) {
+ if (it === (closure$product.v.size - 1 | 0)) {
+ var $this = closure$product.v.get_za3lpa$(closure$product.v.size - 1 | 0);
+ var other = new UInt(1);
+ return new UInt($this.data + other.data | 0);
+ }
+ else
+ return new UInt(0);
+ };
+ }
+ BigInteger32Arithmetic.prototype.reciprocalDivision_9ezw29$ = function (first, second) {
+ var reciprocalExtension = first.size - second.size | 0;
+ var precisionShift = Kotlin.imul(reciprocalExtension * 2 | 0, this.wordSizeInBits);
+ var secondHighPrecision = this.shl_ap2q72$(second, precisionShift);
+ var secondReciprocalWithRemainder = this.d1ReciprocalRecursiveWordVersion_rsvixa$(secondHighPrecision);
+ var secondReciprocal = secondReciprocalWithRemainder.first;
+ var product = {v: this.times_daxkpa$(first, secondReciprocal)};
+ if (this.compareTo_nkem5j$(product.v, new UInt(0)) === 0) {
+ return new Pair(this.ZERO, first);
+ }
+ if (product.v.size === 1) {
+ var tmp$ = product.v;
+ var $this = this.baseMaskInt;
+ var other = new UInt(1);
+ if (this.compareTo_nkem5j$(tmp$, new UInt($this.data - other.data | 0)) >= 0) {
+ product.v = this.plus_daxkpa$(product.v, this.ONE);
+ }
+ }
+ else {
+ var importantWord = product.v.get_za3lpa$(product.v.size - second.size | 0);
+ var other_0 = this.baseMask;
+ if (ulongCompare((new ULong(Kotlin.Long.fromInt(importantWord.data).and(L4294967295))).data, other_0.data) >= 0) {
+ var size = product.v.size;
+ product.v = new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$reciprocalDivision$lambda(product))));
+ }
+ }
+ var numberOfWords = product.v.size - (secondReciprocal.size * 2 | 0) + (reciprocalExtension * 2 | 0) | 0;
+ if (numberOfWords === 0) {
+ numberOfWords = 1;
+ }
+ var $receiver = product.v;
+ var fromIndex = product.v.size - numberOfWords | 0;
+ var toIndex = product.v.size;
+ var result = new UIntArray(copyOfRange($receiver.storage, fromIndex, toIndex));
+ var remainder = this.minus_daxkpa$(first, this.times_daxkpa$(result, second));
+ return new Pair(result, remainder);
+ };
+ BigInteger32Arithmetic.prototype.sqrt_11rb$ = function (operand) {
+ return this.reqursiveSqrt_0(operand);
+ };
+ BigInteger32Arithmetic.prototype.reqursiveSqrt_0 = function (operand) {
+ var n = operand.size;
+ var x = (n - 1 | 0) / 4;
+ var l = numberToInt(Math_0.floor(x));
+ if (l === 0) {
+ return this.basecaseSqrt_57d09b$(operand);
+ }
+ var step = n / 4 | 0;
+ var stepRemainder = n % 4;
+ var baseLPowerShift = 32 * l | 0;
+ var fromIndex = n - ((3 * step | 0) + stepRemainder) | 0;
+ var toIndex = n - ((2 * step | 0) + stepRemainder) | 0;
+ var a1 = new UIntArray(copyOfRange(operand.storage, fromIndex, toIndex));
+ var toIndex_0 = n - ((3 * step | 0) + stepRemainder) | 0;
+ var a0 = new UIntArray(copyOfRange(operand.storage, 0, toIndex_0));
+ var fromIndex_0 = n - ((2 * step | 0) + stepRemainder) | 0;
+ var a3a2 = new UIntArray(copyOfRange(operand.storage, fromIndex_0, n));
+ var tmp$ = this.reqursiveSqrt_0(a3a2);
+ var sPrim = tmp$.component1()
+ , rPrim = tmp$.component2();
+ var tmp$_0 = this.basicDivide2_uzv4wk$(this.plus_daxkpa$(this.shl_ap2q72$(rPrim, baseLPowerShift), a1), this.shl_ap2q72$(sPrim, 1));
+ var q = tmp$_0.component1()
+ , u = tmp$_0.component2();
+ var s = this.plus_daxkpa$(this.shl_ap2q72$(sPrim, baseLPowerShift), q);
+ var r = this.minus_daxkpa$(this.plus_daxkpa$(this.shl_ap2q72$(u, baseLPowerShift), a0), this.times_daxkpa$(q, q));
+ return new Pair(s, r);
+ };
+ BigInteger32Arithmetic.prototype.basecaseSqrt_57d09b$ = function (operand) {
+ var sqrt = this.sqrtInt_57d09b$(operand);
+ var remainder = this.minus_daxkpa$(operand, this.times_daxkpa$(sqrt, sqrt));
+ return new Pair(sqrt, remainder);
+ };
+ BigInteger32Arithmetic.prototype.sqrtInt_57d09b$ = function (operand) {
+ var u = operand;
+ var s;
+ var tmp;
+ do {
+ s = u;
+ tmp = this.plus_daxkpa$(s, this.basicDivide2_uzv4wk$(operand, s).first);
+ u = this.shr_ap2q72$(tmp, 1);
+ }
+ while (this.compareTo_daxkpa$(u, s) < 0);
+ return s;
+ };
+ BigInteger32Arithmetic.prototype.gcd_xwzc9q$ = function (first, second) {
+ return this.naiveGcd_0(first, second);
+ };
+ BigInteger32Arithmetic.prototype.naiveGcd_0 = function (first, second) {
+ var u = first;
+ var v = second;
+ while (!(v != null ? v.equals(this.ZERO) : null)) {
+ var tmpU = u;
+ u = v;
+ v = this.rem_daxkpa$(tmpU, v);
+ }
+ return u;
+ };
+ BigInteger32Arithmetic.prototype.parseForBase_bm4lxs$ = function (number, base) {
+ var parsed = {v: this.ZERO};
+ var tmp$;
+ tmp$ = iterator(number);
+ while (tmp$.hasNext()) {
+ var element = unboxChar(tmp$.next());
+ var char = toBoxedChar(element);
+ parsed.v = this.plus_nkem5j$(this.times_nkem5j$(parsed.v, new UInt(base)), new UInt(toDigit(unboxChar(char))));
+ }
+ return parsed.v;
+ };
+ BigInteger32Arithmetic.prototype.toString_dpg1yx$ = function (operand, base) {
+ var copy = new UIntArray(operand.storage.slice());
+ var baseArray = new UIntArray(new Int32Array([(new UInt(base)).toInt()]));
+ var stringBuilder = StringBuilder_init();
+ while (!(copy != null ? copy.equals(this.ZERO) : null)) {
+ var divremResult = this.divrem_daxkpa$(copy, baseArray);
+ if (divremResult.second.isEmpty()) {
+ stringBuilder.append_s8jyv4$(0);
+ }
+ else {
+ stringBuilder.append_gw00v9$(toString_0(divremResult.second.get_za3lpa$(0), base));
+ }
+ copy = divremResult.first;
+ }
+ var $receiver = stringBuilder.toString();
+ var tmp$;
+ return reversed_0(Kotlin.isCharSequence(tmp$ = $receiver) ? tmp$ : throwCCE()).toString();
+ };
+ BigInteger32Arithmetic.prototype.numberOfDecimalDigits_11rb$ = function (operand) {
+ var bitLenght = this.bitLength_11rb$(operand);
+ var x = (bitLenght - 1 | 0) * BigInteger$Companion_getInstance().LOG_10_OF_2;
+ var minDigit = Math_0.ceil(x);
+ var tmp = this.div_daxkpa$(operand, this.pow_19wkf8$(this.TEN, Kotlin.Long.fromNumber(minDigit)));
+ var counter = L0;
+ while (this.compare_xwzc9q$(tmp, this.ZERO) !== 0) {
+ tmp = this.div_daxkpa$(tmp, this.TEN);
+ counter = counter.inc();
+ }
+ return counter.add(Kotlin.Long.fromInt(numberToInt(minDigit)));
+ };
+ function BigInteger32Arithmetic$and$lambda(closure$mask, closure$operand) {
+ return function (it) {
+ if (it < closure$mask.size) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$mask.get_za3lpa$(it);
+ return new UInt($this.data & other.data);
+ }
+ else {
+ return new UInt(0);
+ }
+ };
+ }
+ BigInteger32Arithmetic.prototype.and_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$and$lambda(mask, operand))));
+ };
+ function BigInteger32Arithmetic$or$lambda(closure$mask, closure$operand) {
+ return function (it) {
+ if (it < closure$mask.size) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$mask.get_za3lpa$(it);
+ return new UInt($this.data | other.data);
+ }
+ else {
+ return closure$operand.get_za3lpa$(it);
+ }
+ };
+ }
+ BigInteger32Arithmetic.prototype.or_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$or$lambda(mask, operand))));
+ };
+ function BigInteger32Arithmetic$xor$lambda(closure$mask, closure$operand) {
+ return function (it) {
+ if (it < closure$mask.size) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$mask.get_za3lpa$(it);
+ return new UInt($this.data ^ other.data);
+ }
+ else {
+ var $this_0 = closure$operand.get_za3lpa$(it);
+ var other_0 = new UInt(0);
+ return new UInt($this_0.data ^ other_0.data);
+ }
+ };
+ }
+ BigInteger32Arithmetic.prototype.xor_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$xor$lambda(mask, operand))));
+ };
+ function BigInteger32Arithmetic$not$lambda(closure$operand) {
+ return function (it) {
+ return new UInt(~closure$operand.get_za3lpa$(it).data);
+ };
+ }
+ BigInteger32Arithmetic.prototype.not_11rb$ = function (operand) {
+ var size = operand.size;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$not$lambda(operand))));
+ };
+ BigInteger32Arithmetic.prototype.shl_ap2q72$ = function ($receiver, places) {
+ return this.shiftLeft_dpg1yx$($receiver, places);
+ };
+ BigInteger32Arithmetic.prototype.shr_ap2q72$ = function ($receiver, places) {
+ return this.shiftRight_dpg1yx$($receiver, places);
+ };
+ BigInteger32Arithmetic.prototype.bitAt_19wkf8$ = function (operand, position) {
+ var tmp$;
+ if (position.div(Kotlin.Long.fromInt(63)).toNumber() > 2147483647) {
+ throw RuntimeException_init('Invalid bit index, too large, cannot access word (Word position > Int.MAX_VALUE');
+ }
+ var wordPosition = position.div(Kotlin.Long.fromInt(63));
+ if (wordPosition.toNumber() >= operand.size) {
+ return false;
+ }
+ var bitPosition = position.modulo(Kotlin.Long.fromInt(63));
+ var word = operand.get_za3lpa$(wordPosition.toInt());
+ var $this = new UInt(1);
+ var bitCount = bitPosition.toInt();
+ var other = new UInt($this.data << bitCount);
+ return (tmp$ = new UInt(word.data & other.data)) != null ? tmp$.equals(new UInt(1)) : null;
+ };
+ function BigInteger32Arithmetic$setBitAt$lambda(closure$wordPosition, closure$bit, closure$operand, closure$setMask) {
+ return function (it) {
+ if (it === closure$wordPosition.toInt()) {
+ if (closure$bit) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$setMask;
+ return new UInt($this.data | other.data);
+ }
+ else {
+ var $this_0 = closure$operand.get_za3lpa$(it);
+ var other_0 = closure$setMask;
+ return new UInt($this_0.data ^ other_0.data);
+ }
+ }
+ else {
+ return closure$operand.get_za3lpa$(it);
+ }
+ };
+ }
+ BigInteger32Arithmetic.prototype.setBitAt_xjejkt$ = function (operand, position, bit) {
+ if (position.div(Kotlin.Long.fromInt(63)).toNumber() > 2147483647) {
+ throw RuntimeException_init('Invalid bit index, too large, cannot access word (Word position > Int.MAX_VALUE');
+ }
+ var wordPosition = position.div(Kotlin.Long.fromInt(63));
+ if (wordPosition.toNumber() >= operand.size) {
+ throw new IndexOutOfBoundsException('Invalid position, addressed word ' + wordPosition.toString() + ' larger than number of words ' + operand.size);
+ }
+ var bitPosition = position.modulo(Kotlin.Long.fromInt(63));
+ var $this = new UInt(1);
+ var bitCount = bitPosition.toInt();
+ var setMask = new UInt($this.data << bitCount);
+ var size = operand.size;
+ return new UIntArray(Kotlin.fillArray(new Int32Array(size), UIntArray$lambda(BigInteger32Arithmetic$setBitAt$lambda(wordPosition, bit, operand, setMask))));
+ };
+ BigInteger32Arithmetic.prototype.plus_daxkpa$ = function ($receiver, other) {
+ return this.add_xwzc9q$($receiver, other);
+ };
+ BigInteger32Arithmetic.prototype.minus_daxkpa$ = function ($receiver, other) {
+ return this.substract_xwzc9q$($receiver, other);
+ };
+ BigInteger32Arithmetic.prototype.times_daxkpa$ = function ($receiver, other) {
+ return this.multiply_xwzc9q$($receiver, other);
+ };
+ BigInteger32Arithmetic.prototype.plus_nkem5j$ = function ($receiver, other) {
+ return this.add_xwzc9q$($receiver, new UIntArray(new Int32Array([other.toInt()])));
+ };
+ BigInteger32Arithmetic.prototype.minus_nkem5j$ = function ($receiver, other) {
+ return this.substract_xwzc9q$($receiver, new UIntArray(new Int32Array([other.toInt()])));
+ };
+ BigInteger32Arithmetic.prototype.times_nkem5j$ = function ($receiver, other) {
+ return this.multiply_rigg6l$($receiver, other);
+ };
+ BigInteger32Arithmetic.prototype.div_nkem5j$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, new UIntArray(new Int32Array([other.toInt()]))).first;
+ };
+ BigInteger32Arithmetic.prototype.rem_nkem5j$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, new UIntArray(new Int32Array([other.toInt()]))).second;
+ };
+ BigInteger32Arithmetic.prototype.div_daxkpa$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, other).first;
+ };
+ BigInteger32Arithmetic.prototype.rem_daxkpa$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, other).second;
+ };
+ BigInteger32Arithmetic.prototype.divrem_daxkpa$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, other);
+ };
+ BigInteger32Arithmetic.prototype.compareTo_daxkpa$ = function ($receiver, other) {
+ return this.compare_xwzc9q$($receiver, other);
+ };
+ BigInteger32Arithmetic.prototype.compareTo_nkem5j$ = function ($receiver, other) {
+ return this.compare_xwzc9q$($receiver, new UIntArray(new Int32Array([other.toInt()])));
+ };
+ function BigInteger32Arithmetic$toUnsignedIntArrayCodeFormat$lambda(it) {
+ return it.toString() + 'U';
+ }
+ BigInteger32Arithmetic.prototype.toUnsignedIntArrayCodeFormat_rsvixa$ = function (array) {
+ return joinToString(array, ', ', 'uintArrayOf(', ')', void 0, void 0, BigInteger32Arithmetic$toUnsignedIntArrayCodeFormat$lambda);
+ };
+ BigInteger32Arithmetic.prototype.fromULong_mpgczg$ = function (uLong) {
+ return new UIntArray(new Int32Array([(new UInt(uLong.data.toInt())).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromUInt_s87ys9$ = function (uInt) {
+ return new UIntArray(new Int32Array([uInt.toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ return new UIntArray(new Int32Array([(new UInt(uShort.data & 65535)).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromUByte_mpmjao$ = function (uByte) {
+ return new UIntArray(new Int32Array([(new UInt(uByte.data & 255)).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromLong_s8cxhz$ = function (long) {
+ return new UIntArray(new Int32Array([(new UInt(abs(long).toInt())).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromInt_za3lpa$ = function (int) {
+ return new UIntArray(new Int32Array([(new UInt(abs_0(int))).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromShort_mq22fl$ = function (short) {
+ return new UIntArray(new Int32Array([(new UInt(abs_0(short))).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.fromByte_s8j3t7$ = function (byte) {
+ return new UIntArray(new Int32Array([(new UInt(abs_0(byte))).toInt()]));
+ };
+ BigInteger32Arithmetic.prototype.toULongExact_rsvixa$ = function (operand) {
+ if (operand.size > 2) {
+ throw new ArithmeticException('Exact conversion not possible, operand size ' + operand.size);
+ }
+ var result = new ULong(Kotlin.Long.ZERO);
+ for (var i = operand.size - 1 | 0; i >= 0; i--) {
+ var tmp$ = result;
+ var $this = operand.get_za3lpa$(i);
+ var $this_0 = new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295));
+ var bitCount = Kotlin.imul(i, this.wordSizeInBits);
+ var other = new ULong($this_0.data.shiftLeft(bitCount));
+ result = new ULong(tmp$.data.add(other.data));
+ }
+ return result;
+ };
+ function BigInteger32Arithmetic$ONE$lambda(it) {
+ return new UInt(1);
+ }
+ function BigInteger32Arithmetic$TWO$lambda(it) {
+ return new UInt(2);
+ }
+ function BigInteger32Arithmetic$TEN$lambda(it) {
+ return new UInt(10);
+ }
+ BigInteger32Arithmetic.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'BigInteger32Arithmetic',
+ interfaces: [BigIntegerArithmetic]
+ };
+ var BigInteger32Arithmetic_instance = null;
+ function BigInteger32Arithmetic_getInstance() {
+ if (BigInteger32Arithmetic_instance === null) {
+ new BigInteger32Arithmetic();
+ }
+ return BigInteger32Arithmetic_instance;
+ }
+ var indexOfLast$lambda_0 = wrapFunction(function () {
+ var ULong_init = Kotlin.kotlin.ULong;
+ return function (closure$predicate) {
+ return function (it) {
+ return closure$predicate(new ULong_init(it));
+ };
+ };
+ });
+ function ULongArray$lambda(closure$init) {
+ return function (index) {
+ return closure$init(index).data;
+ };
+ }
+ function BigInteger63Arithmetic() {
+ BigInteger63Arithmetic_instance = this;
+ this.ZERO_jghw7n$_0 = new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong()));
+ this.ONE_msbt3$_0 = new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ONE)).toLong()));
+ this.TWO_moxyl$_0 = new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(2))).toLong()));
+ this.TEN_mpbby$_0 = new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(10))).toLong()));
+ this.basePowerOfTwo_dhme3w$_0 = 63;
+ this.wordSizeInBits = 63;
+ this.baseMask = new ULong(Kotlin.Long.MAX_VALUE);
+ this.baseMaskArray = new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.MAX_VALUE)).toLong()));
+ this.lowMask = new ULong(new Kotlin.Long(-1, 0));
+ this.highMask = new ULong(new Kotlin.Long(0, 2147483647));
+ this.overflowMask = new ULong(Kotlin.Long.MIN_VALUE);
+ this.powersOf10 = [new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ONE)).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(10))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(100))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(1000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(10000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(100000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(1000000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(10000000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(100000000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(1000000000))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1410065408, 2))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1215752192, 23))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-727379968, 232))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1316134912, 2328))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(276447232, 23283))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-1530494976, 232830))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1874919424, 2328306))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1569325056, 23283064))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-1486618624, 232830643))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-1981284352, 180822788))).toLong(), (new ULong(Kotlin.Long.ONE)).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1661992960, 1808227885))).toLong(), (new ULong(Kotlin.Long.fromInt(10))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-559939584, 902409669))).toLong(), (new ULong(Kotlin.Long.fromInt(108))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-1304428544, 434162106))).toLong(), (new ULong(Kotlin.Long.fromInt(1084))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-159383552, 46653770))).toLong(), (new ULong(Kotlin.Long.fromInt(10842))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-1593835520, 466537709))).toLong(), (new ULong(Kotlin.Long.fromInt(108420))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1241513984, 370409800))).toLong(), (new ULong(Kotlin.Long.fromInt(1084202))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-469762048, 1556614354))).toLong(), (new ULong(Kotlin.Long.fromInt(10842021))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-402653184, 533758012))).toLong(), (new ULong(Kotlin.Long.fromInt(108420217))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(268435456, 1042612833))).toLong(), (new ULong(Kotlin.Long.fromInt(1084202172))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-1610612736, 1836193738))).toLong(), (new ULong(new Kotlin.Long(-2042880164, 2))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(1073741824, 1182068202))).toLong(), (new ULong(new Kotlin.Long(1046034848, 25))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(-2147483648, 1083263782))).toLong(), (new ULong(new Kotlin.Long(1870413893, 252))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 95219585))).toLong(), (new ULong(new Kotlin.Long(1524269751, 2524))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 952195850))).toLong(), (new ULong(new Kotlin.Long(-1937171674, 25243))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 932023908))).toLong(), (new ULong(new Kotlin.Long(2103119744, 252435))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 730304488))).toLong(), (new ULong(new Kotlin.Long(-443639036, 2524354))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 860593936))).toLong(), (new ULong(new Kotlin.Long(-141423061, 25243548))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 16004768))).toLong(), (new ULong(new Kotlin.Long(-1414230606, 252435489))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 160047680))).toLong(), (new ULong(new Kotlin.Long(-1257404172, 376871248))).toLong(), (new ULong(Kotlin.Long.ONE)).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1600476800))).toLong(), (new ULong(new Kotlin.Long(310860168, 1621228839))).toLong(), (new ULong(Kotlin.Long.fromInt(11))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 972382464))).toLong(), (new ULong(new Kotlin.Long(-1186365609, 1179902854))).toLong(), (new ULong(Kotlin.Long.fromInt(117))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1133890048))).toLong(), (new ULong(new Kotlin.Long(1021245802, 1061610307))).toLong(), (new ULong(Kotlin.Long.fromInt(1175))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 601482240))).toLong(), (new ULong(new Kotlin.Long(1622523433, 2026168480))).toLong(), (new ULong(Kotlin.Long.fromInt(11754))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1719855104))).toLong(), (new ULong(new Kotlin.Long(-954634852, 934331971))).toLong(), (new ULong(Kotlin.Long.fromInt(117549))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 18681856))).toLong(), (new ULong(new Kotlin.Long(-956413920, 753385125))).toLong(), (new ULong(Kotlin.Long.fromInt(1175494))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 186818560))).toLong(), (new ULong(new Kotlin.Long(-974204608, 1091400313))).toLong(), (new ULong(Kotlin.Long.fromInt(11754943))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1868185600))).toLong(), (new ULong(new Kotlin.Long(-1152111488, 176584897))).toLong(), (new ULong(Kotlin.Long.fromInt(117549435))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1501986816))).toLong(), (new ULong(new Kotlin.Long(1363787016, 1765848977))).toLong(), (new ULong(Kotlin.Long.fromInt(1175494350))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 2134966272))).toLong(), (new ULong(new Kotlin.Long(752968278, 478620589))).toLong(), (new ULong(new Kotlin.Long(-1129958380, 2))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 2022309888))).toLong(), (new ULong(new Kotlin.Long(-1060251803, 491238595))).toLong(), (new ULong(new Kotlin.Long(1585318090, 27))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 895746048))).toLong(), (new ULong(new Kotlin.Long(-2012583429, 617418661))).toLong(), (new ULong(new Kotlin.Long(-1326688282, 273))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 367525888))).toLong(), (new ULong(new Kotlin.Long(1349002194, 1879219319))).toLong(), (new ULong(new Kotlin.Long(-381980930, 2736))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1527775232))).toLong(), (new ULong(new Kotlin.Long(605120053, 1612324009))).toLong(), (new ULong(new Kotlin.Long(475158004, 27369))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 245366784))).toLong(), (new ULong(new Kotlin.Long(1756233241, 1090854555))).toLong(), (new ULong(new Kotlin.Long(456612751, 273691))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 306184192))).toLong(), (new ULong(new Kotlin.Long(382463227, 171127314))).toLong(), (new ULong(new Kotlin.Long(271160219, 2736911))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 914358272))).toLong(), (new ULong(new Kotlin.Long(-470335025, 1711273140))).toLong(), (new ULong(new Kotlin.Long(-1583365106, 27369110))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 553648128))).toLong(), (new ULong(new Kotlin.Long(-408382950, 2080345872))).toLong(), (new ULong(new Kotlin.Long(1346218131, 273691106))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1241513984))).toLong(), (new ULong(new Kotlin.Long(211137798, 1476105897))).toLong(), (new ULong(new Kotlin.Long(577279431, 589427415))).toLong(), (new ULong(Kotlin.Long.ONE)).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1677721600))).toLong(), (new ULong(new Kotlin.Long(2111377985, 1876157082))).toLong(), (new ULong(new Kotlin.Long(1477827020, 1599306855))).toLong(), (new ULong(Kotlin.Long.fromInt(12))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1744830464))).toLong(), (new ULong(new Kotlin.Long(-361056623, 1581701640))).toLong(), (new ULong(new Kotlin.Long(1893368320, 960683017))).toLong(), (new ULong(Kotlin.Long.fromInt(127))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 268435456))).toLong(), (new ULong(new Kotlin.Long(684401074, 784630873))).toLong(), (new ULong(new Kotlin.Long(1753814023, 1016895582))).toLong(), (new ULong(Kotlin.Long.fromInt(1274))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 536870912))).toLong(), (new ULong(new Kotlin.Long(-1745923851, 1403857787))).toLong(), (new ULong(new Kotlin.Long(358271049, 1579021232))).toLong(), (new ULong(Kotlin.Long.fromInt(12744))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(new Kotlin.Long(0, 1073741824))).toLong(), (new ULong(new Kotlin.Long(-279369324, 1153675987))).toLong(), (new ULong(new Kotlin.Long(-712256800, 757826784))).toLong(), (new ULong(Kotlin.Long.fromInt(127447))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1501274061, 799341639))).toLong(), (new ULong(new Kotlin.Long(1467366597, 1135816904))).toLong(), (new ULong(Kotlin.Long.fromInt(1274473))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(2127838722, 1550965449))).toLong(), (new ULong(new Kotlin.Long(1788764085, 620750803))).toLong(), (new ULong(Kotlin.Long.fromInt(12744735))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-196449260, 477268958))).toLong(), (new ULong(new Kotlin.Long(707771673, 1912540738))).toLong(), (new ULong(Kotlin.Long.fromInt(127447352))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1964492600, 477722293))).toLong(), (new ULong(new Kotlin.Long(-1512217860, 1945538197))).toLong(), (new ULong(Kotlin.Long.fromInt(1274473528))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1829910480, 482255639))).toLong(), (new ULong(new Kotlin.Long(2057690586, 128029144))).toLong(), (new ULong(new Kotlin.Long(-140166599, 2))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1119235616, 527589098))).toLong(), (new ULong(new Kotlin.Long(-897930618, 1280291444))).toLong(), (new ULong(new Kotlin.Long(-1401665990, 29))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1692545728, 980923686))).toLong(), (new ULong(new Kotlin.Long(-389371586, 2065496207))).toLong(), (new ULong(new Kotlin.Long(-1131758007, 296))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(254411904, 1219302274))).toLong(), (new ULong(new Kotlin.Long(401251440, 1327609247))).toLong(), (new ULong(new Kotlin.Long(1567321827, 2967))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1750848256, 1455604500))).toLong(), (new ULong(new Kotlin.Long(-282452891, 391190582))).toLong(), (new ULong(new Kotlin.Long(-1506650908, 29673))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-328613376, 1671143117))).toLong(), (new ULong(new Kotlin.Long(1470438392, 1764422181))).toLong(), (new ULong(new Kotlin.Long(2113360105, 296736))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1008833536, 1679045643))).toLong(), (new ULong(new Kotlin.Long(1819482039, 464352629))).toLong(), (new ULong(new Kotlin.Long(-341235422, 2967364))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1498400768, 1758070896))).toLong(), (new ULong(new Kotlin.Long(1014951213, 348558998))).toLong(), (new ULong(new Kotlin.Long(882613078, 29673649))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(2099105792, 400839779))).toLong(), (new ULong(new Kotlin.Long(1559577546, 1338106334))).toLong(), (new ULong(new Kotlin.Long(236196189, 296736492))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-483778560, 1860914146))).toLong(), (new ULong(new Kotlin.Long(-1584093723, 496161455))).toLong(), (new ULong(new Kotlin.Long(-1933005400, 819881272))).toLong(), (new ULong(Kotlin.Long.ONE)).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-542818304, 1429272284))).toLong(), (new ULong(new Kotlin.Long(1338931962, 666647260))).toLong(), (new ULong(new Kotlin.Long(2144782482, 1756361781))).toLong(), (new ULong(Kotlin.Long.fromInt(13))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1133215744, 1407820960))).toLong(), (new ULong(new Kotlin.Long(504417738, 224021659))).toLong(), (new ULong(new Kotlin.Long(-27011657, 383748630))).toLong(), (new ULong(Kotlin.Long.fromInt(138))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1552744448, 1193307719))).toLong(), (new ULong(new Kotlin.Long(749210090, 92732943))).toLong(), (new ULong(new Kotlin.Long(-270116569, 1690002661))).toLong(), (new ULong(Kotlin.Long.fromInt(1381))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1652424704, 1195658953))).toLong(), (new ULong(new Kotlin.Long(-1097833687, 927329431))).toLong(), (new ULong(new Kotlin.Long(1593801606, 1867641083))).toLong(), (new ULong(Kotlin.Long.fromInt(13817))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(655622144, 1219171296))).toLong(), (new ULong(new Kotlin.Long(1906565023, 683359725))).toLong(), (new ULong(new Kotlin.Long(-1241853120, 1496541649))).toLong(), (new ULong(Kotlin.Long.fromInt(138178))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-2033713152, 1454294721))).toLong(), (new ULong(new Kotlin.Long(1885781051, 391146310))).toLong(), (new ULong(new Kotlin.Long(466370691, 2080514609))).toLong(), (new ULong(Kotlin.Long.fromInt(1381786))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1137704960, 1658045327))).toLong(), (new ULong(new Kotlin.Long(1677941332, 1763979456))).toLong(), (new ULong(new Kotlin.Long(368739615, 1477793259))).toLong(), (new ULong(Kotlin.Long.fromInt(13817869))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1507852288, 1548067736))).toLong(), (new ULong(new Kotlin.Long(-400455857, 459925379))).toLong(), (new ULong(new Kotlin.Long(-607571138, 1893030702))).toLong(), (new ULong(Kotlin.Long.fromInt(138178696))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(2101346304, 448291830))).toLong(), (new ULong(new Kotlin.Long(290408733, 304286503))).toLong(), (new ULong(new Kotlin.Long(-1780744082, 1750437844))).toLong(), (new ULong(Kotlin.Long.fromInt(1381786968))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-461373440, 187951008))).toLong(), (new ULong(new Kotlin.Long(-1390879964, 895381382))).toLong(), (new ULong(new Kotlin.Long(-627571635, 324509261))).toLong(), (new ULong(new Kotlin.Long(932967800, 3))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-318767104, 1879510088))).toLong(), (new ULong(new Kotlin.Long(-1023897752, 363879234))).toLong(), (new ULong(new Kotlin.Long(-1980749050, 1097608970))).toLong(), (new ULong(new Kotlin.Long(739743409, 32))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1107296256, 1615231705))).toLong(), (new ULong(new Kotlin.Long(-1649042920, 1491308699))).toLong(), (new ULong(new Kotlin.Long(1667345981, 238671465))).toLong(), (new ULong(new Kotlin.Long(-1192500497, 321))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-1811939328, 1119931516))).toLong(), (new ULong(new Kotlin.Long(689439991, 2028185108))).toLong(), (new ULong(new Kotlin.Long(-506409368, 239231005))).toLong(), (new ULong(new Kotlin.Long(959896919, 3217))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-939524096, 461896925))).toLong(), (new ULong(new Kotlin.Long(-1695534677, 954498249))).toLong(), (new ULong(new Kotlin.Long(-769126375, 244826410))).toLong(), (new ULong(new Kotlin.Long(1009034599, 32172))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-805306368, 324001961))).toLong(), (new ULong(new Kotlin.Long(224522416, 955047904))).toLong(), (new ULong(new Kotlin.Long(898670846, 300780460))).toLong(), (new ULong(new Kotlin.Long(1500411399, 321722))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(536870912, 1092535970))).toLong(), (new ULong(new Kotlin.Long(-2049743135, 960544448))).toLong(), (new ULong(new Kotlin.Long(396773872, 860320954))).toLong(), (new ULong(new Kotlin.Long(2119212103, 3217223))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(1073741824, 187941461))).toLong(), (new ULong(new Kotlin.Long(977405135, 1015509893))).toLong(), (new ULong(new Kotlin.Long(-327228572, 13274948))).toLong(), (new ULong(new Kotlin.Long(-282715446, 32172234))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(-2147483648, 1879414612))).toLong(), (new ULong(new Kotlin.Long(1184116758, 1565164340))).toLong(), (new ULong(new Kotlin.Long(1022681580, 132749489))).toLong(), (new ULong(new Kotlin.Long(1467812836, 321722349))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(0, 1614276941))).toLong(), (new ULong(new Kotlin.Long(-1043734300, 619257866))).toLong(), (new ULong(new Kotlin.Long(1636881215, 1327494892))).toLong(), (new ULong(new Kotlin.Long(1793226472, 1069739845))).toLong(), (new ULong(Kotlin.Long.ONE)).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(0, 1110383874))).toLong(), (new ULong(new Kotlin.Long(-1847408401, 1897611371))).toLong(), (new ULong(new Kotlin.Long(-811057032, 390047035))).toLong(), (new ULong(new Kotlin.Long(752395542, 2107463862))).toLong(), (new ULong(Kotlin.Long.fromInt(14))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(0, 366420500))).toLong(), (new ULong(new Kotlin.Long(-1294214821, 1796244531))).toLong(), (new ULong(new Kotlin.Long(479364280, 1752986710))).toLong(), (new ULong(new Kotlin.Long(-1065979171, 1747285789))).toLong(), (new ULong(Kotlin.Long.fromInt(149))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(0, 1516721352))).toLong(), (new ULong(new Kotlin.Long(-57246321, 782576132))).toLong(), (new ULong(new Kotlin.Long(498675512, 349997917))).toLong(), (new ULong(new Kotlin.Long(-2069857110, 292988713))).toLong(), (new ULong(Kotlin.Long.fromInt(1498))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(0, 134827984))).toLong(), (new ULong(new Kotlin.Long(-572463203, 1383310385))).toLong(), (new ULong(new Kotlin.Long(691787827, 1352495523))).toLong(), (new ULong(new Kotlin.Long(776265381, 782403487))).toLong(), (new ULong(Kotlin.Long.fromInt(14981))).toLong())), new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.ZERO)).toLong(), (new ULong(new Kotlin.Long(0, 1348279840))).toLong(), (new ULong(new Kotlin.Long(-1429664734, 948201970))).toLong(), (new ULong(new Kotlin.Long(-1672056316, 640053343))).toLong(), (new ULong(new Kotlin.Long(-827280776, 1381583927))).toLong(), (new ULong(Kotlin.Long.fromInt(149813))).toLong()))];
+ }
+ Object.defineProperty(BigInteger63Arithmetic.prototype, 'ZERO', {
+ get: function () {
+ return this.ZERO_jghw7n$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63Arithmetic.prototype, 'ONE', {
+ get: function () {
+ return this.ONE_msbt3$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63Arithmetic.prototype, 'TWO', {
+ get: function () {
+ return this.TWO_moxyl$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63Arithmetic.prototype, 'TEN', {
+ get: function () {
+ return this.TEN_mpbby$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63Arithmetic.prototype, 'basePowerOfTwo', {
+ get: function () {
+ return this.basePowerOfTwo_dhme3w$_0;
+ }
+ });
+ BigInteger63Arithmetic.prototype.numberOfLeadingZeroes_11rc$ = function (value) {
+ var x = value;
+ var y;
+ var n = 63;
+ y = new ULong(x.data.shiftRightUnsigned(32));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 32 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(16));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 16 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(8));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 8 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(4));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 4 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(2));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 2 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(1));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ return n - 2 | 0;
+ }
+ return n - x.data.toInt() | 0;
+ };
+ BigInteger63Arithmetic.prototype.bitLength_11rb$ = function (value) {
+ var mostSignificant = value.get_za3lpa$(value.size - 1 | 0);
+ return this.bitLength_mpgczg$(mostSignificant) + ((value.size - 1 | 0) * 63 | 0) | 0;
+ };
+ BigInteger63Arithmetic.prototype.bitLength_mpgczg$ = function (value) {
+ return 63 - this.numberOfLeadingZeroes_11rc$(value) | 0;
+ };
+ BigInteger63Arithmetic.prototype.trailingZeroBits_mpgczg$ = function (value) {
+ var $this = new ULong(value.data.inv());
+ var other = this.baseMask;
+ return 63 - this.bitLength_mpgczg$(new ULong($this.data.and(other.data))) | 0;
+ };
+ BigInteger63Arithmetic.prototype.trailingZeroBits_11rb$ = function (value) {
+ throw new NotImplementedError_init();
+ };
+ BigInteger63Arithmetic.prototype.removeLeadingZeroes_w48dx$ = function (bigInteger) {
+ var $receiver_0 = bigInteger.storage;
+ var indexOfLast$result;
+ indexOfLast$break: do {
+ var tmp$;
+ tmp$ = reversed(get_indices_1($receiver_0)).iterator();
+ while (tmp$.hasNext()) {
+ var index = tmp$.next();
+ var it = new ULong($receiver_0[index]);
+ if (!(it != null ? it.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ indexOfLast$result = index;
+ break indexOfLast$break;
+ }
+ }
+ indexOfLast$result = -1;
+ }
+ while (false);
+ var firstEmpty = indexOfLast$result + 1 | 0;
+ if (firstEmpty === -1 || firstEmpty === 0) {
+ return this.ZERO;
+ }
+ return new ULongArray_init(copyOfRange_0(bigInteger.storage, 0, firstEmpty));
+ };
+ function BigInteger63Arithmetic$shiftLeft$lambda(closure$shiftWords, closure$operand) {
+ return function (it) {
+ if (0 <= it && it < closure$shiftWords)
+ return new ULong(Kotlin.Long.ZERO);
+ else
+ return closure$operand.get_za3lpa$(it - closure$shiftWords | 0);
+ };
+ }
+ function BigInteger63Arithmetic$shiftLeft$lambda_0(closure$shiftWords, closure$operand, closure$shiftBits, this$BigInteger63Arithmetic, closure$originalSize, closure$wordsNeeded) {
+ return function (it) {
+ if (0 <= it && it < closure$shiftWords)
+ return new ULong(Kotlin.Long.ZERO);
+ else if (it === closure$shiftWords) {
+ var $this = closure$operand.get_za3lpa$(it - closure$shiftWords | 0);
+ var bitCount = closure$shiftBits;
+ var $this_0 = new ULong($this.data.shiftLeft(bitCount));
+ var other = this$BigInteger63Arithmetic.baseMask;
+ return new ULong($this_0.data.and(other.data));
+ }
+ else if ((closure$shiftWords + 1 | 0) <= it && it < (closure$originalSize + closure$shiftWords | 0)) {
+ var $this_1 = closure$operand.get_za3lpa$(it - closure$shiftWords | 0);
+ var bitCount_0 = closure$shiftBits;
+ var $this_2 = new ULong($this_1.data.shiftLeft(bitCount_0));
+ var other_0 = this$BigInteger63Arithmetic.baseMask;
+ var tmp$ = new ULong($this_2.data.and(other_0.data));
+ var $this_3 = closure$operand.get_za3lpa$(it - closure$shiftWords - 1 | 0);
+ var bitCount_1 = this$BigInteger63Arithmetic.basePowerOfTwo - closure$shiftBits | 0;
+ var other_1 = new ULong($this_3.data.shiftRightUnsigned(bitCount_1));
+ return new ULong(tmp$.data.or(other_1.data));
+ }
+ else if (it === (closure$originalSize + closure$wordsNeeded - 1 | 0)) {
+ var $this_4 = closure$operand.get_za3lpa$(it - closure$wordsNeeded | 0);
+ var bitCount_2 = this$BigInteger63Arithmetic.basePowerOfTwo - closure$shiftBits | 0;
+ return new ULong($this_4.data.shiftRightUnsigned(bitCount_2));
+ }
+ else {
+ throw RuntimeException_init('Invalid case ' + it);
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.shiftLeft_dpg1yx$ = function (operand, places) {
+ var tmp$;
+ if (operand != null ? operand.equals(this.ZERO) : null) {
+ return operand;
+ }
+ if (operand.isEmpty() || places === 0) {
+ return operand;
+ }
+ var originalSize = operand.size;
+ var leadingZeroes = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ var shiftWords = places / this.basePowerOfTwo | 0;
+ var shiftBits = places % this.basePowerOfTwo;
+ if (shiftBits > leadingZeroes) {
+ tmp$ = shiftWords + 1 | 0;
+ }
+ else {
+ tmp$ = shiftWords;
+ }
+ var wordsNeeded = tmp$;
+ if (shiftBits === 0) {
+ var size = operand.size + wordsNeeded | 0;
+ return new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$shiftLeft$lambda(shiftWords, operand))));
+ }
+ var size_0 = operand.size + wordsNeeded | 0;
+ return new ULongArray_init(Kotlin.longArrayF(size_0, ULongArray$lambda(BigInteger63Arithmetic$shiftLeft$lambda_0(shiftWords, operand, shiftBits, this, originalSize, wordsNeeded))));
+ };
+ function BigInteger63Arithmetic$shiftRight$lambda(closure$operand, closure$wordsToDiscard, closure$shiftBits, this$BigInteger63Arithmetic) {
+ return function (it) {
+ var tmp$;
+ tmp$ = closure$operand.size - 1 - closure$wordsToDiscard | 0;
+ if (0 <= it && it < tmp$) {
+ var $this = closure$operand.get_za3lpa$(it + closure$wordsToDiscard | 0);
+ var bitCount = closure$shiftBits;
+ var tmp$_0 = new ULong($this.data.shiftRightUnsigned(bitCount));
+ var $this_0 = closure$operand.get_za3lpa$(it + closure$wordsToDiscard + 1 | 0);
+ var bitCount_0 = this$BigInteger63Arithmetic.basePowerOfTwo - closure$shiftBits | 0;
+ var $this_1 = new ULong($this_0.data.shiftLeft(bitCount_0));
+ var other = this$BigInteger63Arithmetic.baseMask;
+ var other_0 = new ULong($this_1.data.and(other.data));
+ return new ULong(tmp$_0.data.or(other_0.data));
+ }
+ else if (it === (closure$operand.size - 1 - closure$wordsToDiscard | 0)) {
+ var $this_2 = closure$operand.get_za3lpa$(it + closure$wordsToDiscard | 0);
+ var bitCount_1 = closure$shiftBits;
+ return new ULong($this_2.data.shiftRightUnsigned(bitCount_1));
+ }
+ else {
+ throw RuntimeException_init('Invalid case ' + it);
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.shiftRight_dpg1yx$ = function (operand, places) {
+ if (operand.isEmpty() || places === 0) {
+ return operand;
+ }
+ var shiftBits = places % this.basePowerOfTwo;
+ var wordsToDiscard = places / this.basePowerOfTwo | 0;
+ if (wordsToDiscard >= operand.size) {
+ return this.ZERO;
+ }
+ if (shiftBits === 0) {
+ var fromIndex = operand.size - wordsToDiscard | 0;
+ var toIndex = operand.size;
+ new ULongArray_init(copyOfRange_0(operand.storage, fromIndex, toIndex));
+ }
+ if (operand.size > 1 && (operand.size - wordsToDiscard | 0) === 1) {
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(operand.get_za3lpa$(operand.size - 1 | 0).data.shiftRightUnsigned(shiftBits))).toLong()));
+ }
+ var size = operand.size - wordsToDiscard | 0;
+ var result = new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$shiftRight$lambda(operand, wordsToDiscard, shiftBits, this))));
+ return this.removeLeadingZeroes_w48dx$(result);
+ };
+ BigInteger63Arithmetic.prototype.compare_xwzc9q$ = function (first, second) {
+ if (first.size > second.size) {
+ return 1;
+ }
+ if (second.size > first.size) {
+ return -1;
+ }
+ var counter = first.size - 1 | 0;
+ var firstIsLarger = false;
+ var bothAreEqual = true;
+ while (counter >= 0) {
+ var $this = first.get_za3lpa$(counter);
+ var other = second.get_za3lpa$(counter);
+ if (ulongCompare($this.data, other.data) > 0) {
+ firstIsLarger = true;
+ bothAreEqual = false;
+ break;
+ }
+ var $this_0 = first.get_za3lpa$(counter);
+ var other_0 = second.get_za3lpa$(counter);
+ if (ulongCompare($this_0.data, other_0.data) < 0) {
+ firstIsLarger = false;
+ bothAreEqual = false;
+ break;
+ }
+ counter = counter - 1 | 0;
+ }
+ if (bothAreEqual) {
+ return 0;
+ }
+ if (firstIsLarger) {
+ return 1;
+ }
+ else {
+ return -1;
+ }
+ };
+ BigInteger63Arithmetic.prototype.numberOfDecimalDigits_11rb$ = function (operand) {
+ var bitLenght = this.bitLength_11rb$(operand);
+ var x = (bitLenght - 1 | 0) * BigInteger$Companion_getInstance().LOG_10_OF_2;
+ var minDigit = Math_0.ceil(x);
+ var tmp = this.div_rgttk2$(operand, this.pow_19wkf8$(this.TEN, Kotlin.Long.fromNumber(minDigit)));
+ var counter = L0;
+ while (this.compare_xwzc9q$(tmp, this.ZERO) !== 0) {
+ tmp = this.div_rgttk2$(tmp, this.TEN);
+ counter = counter.inc();
+ }
+ return counter.add(Kotlin.Long.fromInt(numberToInt(minDigit)));
+ };
+ function BigInteger63Arithmetic$add$lambda(it) {
+ return new ULong(Kotlin.Long.ZERO);
+ }
+ BigInteger63Arithmetic.prototype.add_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
+ if (first.size === 1 && ((tmp$ = first.get_za3lpa$(0)) != null ? tmp$.equals(new ULong(Kotlin.Long.ZERO)) : null))
+ return second;
+ if (second.size === 1 && ((tmp$_0 = second.get_za3lpa$(0)) != null ? tmp$_0.equals(new ULong(Kotlin.Long.ZERO)) : null))
+ return first;
+ if (first.size > second.size) {
+ tmp$_1 = new Quadruple(first.size, second.size, first, second);
+ }
+ else {
+ tmp$_1 = new Quadruple(second.size, first.size, second, first);
+ }
+ var tmp$_4 = tmp$_1;
+ var maxLength = tmp$_4.component1()
+ , minLength = tmp$_4.component2()
+ , largerData = tmp$_4.component3()
+ , smallerData = tmp$_4.component4();
+ var size = maxLength + 1 | 0;
+ var result = new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$add$lambda)));
+ var i = 0;
+ var sum = new ULong(Kotlin.Long.ZERO);
+ while (i < minLength) {
+ var $this = sum;
+ var other = largerData.get_za3lpa$(i);
+ var $this_0 = new ULong($this.data.add(other.data));
+ var other_0 = smallerData.get_za3lpa$(i);
+ sum = new ULong($this_0.data.add(other_0.data));
+ var tmp$_5 = i;
+ var $this_1 = sum;
+ var other_1 = this.baseMask;
+ result.set_2ccimm$(tmp$_5, new ULong($this_1.data.and(other_1.data)));
+ sum = new ULong(sum.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (true) {
+ if (sum != null ? sum.equals(new ULong(Kotlin.Long.ZERO)) : null) {
+ while (i < maxLength) {
+ result.set_2ccimm$(i, largerData.get_za3lpa$(i));
+ i = i + 1 | 0;
+ }
+ if ((tmp$_2 = result.get_za3lpa$(result.size - 1 | 0)) != null ? tmp$_2.equals(new ULong(Kotlin.Long.ZERO)) : null) {
+ var toIndex = result.size - 1 | 0;
+ tmp$_3 = new ULongArray_init(copyOfRange_0(result.storage, 0, toIndex));
+ }
+ else {
+ tmp$_3 = result;
+ }
+ var final = tmp$_3;
+ return this.removeLeadingZeroes_w48dx$(final);
+ }
+ if (i === maxLength) {
+ result.set_2ccimm$(maxLength, sum);
+ return this.removeLeadingZeroes_w48dx$(result);
+ }
+ var $this_2 = sum;
+ var other_2 = largerData.get_za3lpa$(i);
+ sum = new ULong($this_2.data.add(other_2.data));
+ var tmp$_6 = i;
+ var $this_3 = sum;
+ var other_3 = this.baseMask;
+ result.set_2ccimm$(tmp$_6, new ULong($this_3.data.and(other_3.data)));
+ sum = new ULong(sum.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ };
+ function BigInteger63Arithmetic$substract$lambda(it) {
+ return new ULong(Kotlin.Long.ZERO);
+ }
+ BigInteger63Arithmetic.prototype.substract_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2;
+ var firstPrepared = this.removeLeadingZeroes_w48dx$(first);
+ var secondPrepared = this.removeLeadingZeroes_w48dx$(second);
+ var comparison = this.compare_xwzc9q$(firstPrepared, secondPrepared);
+ var firstIsLarger = comparison === 1;
+ if (comparison === 0)
+ return this.ZERO;
+ if (second.size === 1 && ((tmp$ = second.get_za3lpa$(0)) != null ? tmp$.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ return first;
+ }
+ if (!firstIsLarger) {
+ throw RuntimeException_init('subtract result less than zero');
+ }
+ if (firstIsLarger) {
+ tmp$_0 = new Quadruple(firstPrepared.size, secondPrepared.size, firstPrepared, secondPrepared);
+ }
+ else {
+ tmp$_0 = new Quadruple(secondPrepared.size, firstPrepared.size, secondPrepared, firstPrepared);
+ }
+ var tmp$_3 = tmp$_0;
+ var largerLength = tmp$_3.component1()
+ , smallerLength = tmp$_3.component2()
+ , largerData = tmp$_3.component3()
+ , smallerData = tmp$_3.component4();
+ var size = largerLength + 1 | 0;
+ var result = new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$substract$lambda)));
+ var i = 0;
+ var diff = new ULong(Kotlin.Long.ZERO);
+ while (i < smallerLength) {
+ var $this = largerData.get_za3lpa$(i);
+ var other = smallerData.get_za3lpa$(i);
+ var $this_0 = new ULong($this.data.subtract(other.data));
+ var other_0 = diff;
+ diff = new ULong($this_0.data.subtract(other_0.data));
+ var $this_1 = diff;
+ var other_1 = this.overflowMask;
+ if ((tmp$_1 = new ULong((new ULong($this_1.data.and(other_1.data))).data.shiftRightUnsigned(63))) != null ? tmp$_1.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ var tmp$_4 = i;
+ var $this_2 = diff;
+ var other_2 = this.baseMask;
+ result.set_2ccimm$(tmp$_4, new ULong($this_2.data.and(other_2.data)));
+ }
+ else {
+ var tmp$_5 = i;
+ var $this_3 = diff;
+ var other_3 = this.baseMask;
+ result.set_2ccimm$(tmp$_5, new ULong($this_3.data.and(other_3.data)));
+ }
+ diff = new ULong(diff.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (!(diff != null ? diff.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ var $this_4 = largerData.get_za3lpa$(i);
+ var other_4 = diff;
+ diff = new ULong($this_4.data.subtract(other_4.data));
+ var $this_5 = diff;
+ var other_5 = this.overflowMask;
+ if ((tmp$_2 = new ULong((new ULong($this_5.data.and(other_5.data))).data.shiftRightUnsigned(63))) != null ? tmp$_2.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ var tmp$_6 = i;
+ var $this_6 = diff;
+ var other_6 = this.baseMask;
+ result.set_2ccimm$(tmp$_6, new ULong($this_6.data.and(other_6.data)));
+ }
+ else {
+ var tmp$_7 = i;
+ var $this_7 = diff;
+ var other_7 = this.baseMask;
+ result.set_2ccimm$(tmp$_7, new ULong($this_7.data.and(other_7.data)));
+ diff = new ULong(Kotlin.Long.ZERO);
+ }
+ diff = new ULong(diff.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (i < largerLength) {
+ result.set_2ccimm$(i, largerData.get_za3lpa$(i));
+ i = i + 1 | 0;
+ }
+ var destination = ArrayList_init();
+ var tmp$_8;
+ tmp$_8 = result.iterator();
+ while (tmp$_8.hasNext()) {
+ var element = tmp$_8.next();
+ if (element != null ? element.equals(new ULong(Kotlin.Long.ZERO)) : null)
+ destination.add_11rb$(element);
+ }
+ if (destination.isEmpty()) {
+ return ULongArray_init_0(0);
+ }
+ return this.removeLeadingZeroes_w48dx$(result);
+ };
+ BigInteger63Arithmetic.prototype.multiply_xwzc9q$ = function (first, second) {
+ var resultArray = {v: new ULongArray_init(Kotlin.longArrayOf())};
+ var tmp$, tmp$_0;
+ var index = 0;
+ tmp$ = second.iterator();
+ while (tmp$.hasNext()) {
+ var item = tmp$.next();
+ var index_0 = (tmp$_0 = index, index = tmp$_0 + 1 | 0, tmp$_0);
+ resultArray.v = this.plus_rgttk2$(resultArray.v, this.shl_9x0255$(this.multiply_ssjnkr$(first, item), Kotlin.imul(index_0, this.basePowerOfTwo)));
+ }
+ return this.removeLeadingZeroes_w48dx$(resultArray.v);
+ };
+ BigInteger63Arithmetic.prototype.multiply_ssjnkr$ = function (first, second) {
+ var other = this.lowMask;
+ var secondLow = new ULong(second.data.and(other.data));
+ var secondHigh = new ULong(second.data.shiftRightUnsigned(32));
+ var result = ULongArray_init_0(first.size + 1 | 0);
+ var carryIntoNextRound = new ULong(Kotlin.Long.ZERO);
+ var i = 0;
+ var j = 0;
+ while (i < first.size) {
+ var $this = first.get_za3lpa$(i);
+ var other_0 = this.lowMask;
+ var firstLow = new ULong($this.data.and(other_0.data));
+ var firstHigh = new ULong(first.get_za3lpa$(i).data.shiftRightUnsigned(32));
+ i = i + 1 | 0;
+ var lowerProduct = new ULong(firstLow.data.multiply(secondLow.data));
+ var lowerCarry = new ULong(lowerProduct.data.shiftRightUnsigned(63));
+ var tmp$ = carryIntoNextRound;
+ var other_1 = this.baseMask;
+ var other_2 = new ULong(lowerProduct.data.and(other_1.data));
+ var lowResult = new ULong(tmp$.data.add(other_2.data));
+ var tmp$_0 = lowerCarry;
+ var other_3 = new ULong(lowResult.data.shiftRightUnsigned(63));
+ lowerCarry = new ULong(tmp$_0.data.add(other_3.data));
+ var $this_0 = lowResult;
+ var other_4 = this.baseMask;
+ lowResult = new ULong($this_0.data.and(other_4.data));
+ var tmp$_1 = new ULong(firstLow.data.multiply(secondHigh.data));
+ var other_5 = new ULong(secondLow.data.multiply(firstHigh.data));
+ var middleProduct = new ULong(tmp$_1.data.add(other_5.data));
+ var middleCarry = lowerCarry;
+ var tmp$_2 = middleCarry;
+ var other_6 = new ULong(middleProduct.data.shiftRightUnsigned(31));
+ middleCarry = new ULong(tmp$_2.data.add(other_6.data));
+ var tmp$_3 = lowResult;
+ var $this_1 = new ULong(middleProduct.data.shiftLeft(32));
+ var other_7 = this.baseMask;
+ var other_8 = new ULong($this_1.data.and(other_7.data));
+ lowResult = new ULong(tmp$_3.data.add(other_8.data));
+ var tmp$_4 = middleCarry;
+ var other_9 = new ULong(lowResult.data.shiftRightUnsigned(63));
+ middleCarry = new ULong(tmp$_4.data.add(other_9.data));
+ var tmp$_5 = j;
+ var $this_2 = lowResult;
+ var other_10 = this.baseMask;
+ result.set_2ccimm$(tmp$_5, new ULong($this_2.data.and(other_10.data)));
+ var highResult = middleCarry;
+ var higherProduct = new ULong((new ULong(firstHigh.data.multiply(secondHigh.data))).data.shiftLeft(1));
+ highResult = new ULong(highResult.data.add(higherProduct.data));
+ carryIntoNextRound = highResult;
+ j = j + 1 | 0;
+ }
+ if (!(carryIntoNextRound != null ? carryIntoNextRound.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ result.set_2ccimm$(j, carryIntoNextRound);
+ }
+ return this.removeLeadingZeroes_w48dx$(result);
+ };
+ BigInteger63Arithmetic.prototype.multiply_jpm79w$ = function (first, second) {
+ var other = this.lowMask;
+ var firstLow = new ULong(first.data.and(other.data));
+ var firstHigh = new ULong(first.data.shiftRightUnsigned(32));
+ var other_0 = this.lowMask;
+ var secondLow = new ULong(second.data.and(other_0.data));
+ var secondHigh = new ULong(second.data.shiftRightUnsigned(32));
+ var lowerProduct = new ULong(firstLow.data.multiply(secondLow.data));
+ var lowCarry = new ULong(lowerProduct.data.shiftRightUnsigned(63));
+ var other_1 = this.baseMask;
+ var lowResult = new ULong(lowerProduct.data.and(other_1.data));
+ var tmp$ = new ULong(firstLow.data.multiply(secondHigh.data));
+ var other_2 = new ULong(secondLow.data.multiply(firstHigh.data));
+ var middleProduct = new ULong(tmp$.data.add(other_2.data));
+ var middleCarry = lowCarry;
+ var tmp$_0 = middleCarry;
+ var other_3 = new ULong(middleProduct.data.shiftRightUnsigned(31));
+ middleCarry = new ULong(tmp$_0.data.add(other_3.data));
+ var tmp$_1 = lowResult;
+ var $this = new ULong(middleProduct.data.shiftLeft(32));
+ var other_4 = this.baseMask;
+ var other_5 = new ULong($this.data.and(other_4.data));
+ lowResult = new ULong(tmp$_1.data.add(other_5.data));
+ var tmp$_2 = middleCarry;
+ var other_6 = new ULong(lowResult.data.shiftRightUnsigned(63));
+ middleCarry = new ULong(tmp$_2.data.add(other_6.data));
+ var highResult = middleCarry;
+ var higherProduct = new ULong((new ULong(firstHigh.data.multiply(secondHigh.data))).data.shiftLeft(1));
+ highResult = new ULong(highResult.data.add(higherProduct.data));
+ var $this_0 = lowResult;
+ var other_7 = this.baseMask;
+ return this.removeLeadingZeroes_w48dx$(new ULongArray_init(Kotlin.longArrayOf((new ULong($this_0.data.and(other_7.data))).toLong(), highResult.toLong())));
+ };
+ BigInteger63Arithmetic.prototype.pow_19wkf8$ = function (base, exponent) {
+ var tmp$;
+ if (equals(exponent, L0)) {
+ return this.ONE;
+ }
+ if (equals(exponent, L1)) {
+ return base;
+ }
+ if (base.size === 1 && ((tmp$ = base.get_za3lpa$(0)) != null ? tmp$.equals(new ULong(Kotlin.Long.fromInt(10))) : null) && exponent.toNumber() < this.powersOf10.length) {
+ return this.powersOf10[exponent.toInt()];
+ }
+ var $receiver = until_0(0, exponent);
+ var tmp$_0;
+ var accumulator = this.ONE;
+ tmp$_0 = $receiver.iterator();
+ while (tmp$_0.hasNext()) {
+ var element = tmp$_0.next();
+ accumulator = this.times_rgttk2$(accumulator, base);
+ }
+ return accumulator;
+ };
+ BigInteger63Arithmetic.prototype.normalize_oyvc3i$ = function (dividend, divisor) {
+ var divisorSize = divisor.size;
+ var normalizationShift = this.numberOfLeadingZeroes_11rc$(divisor.get_za3lpa$(divisorSize - 1 | 0));
+ var divisorNormalized = this.shl_9x0255$(divisor, normalizationShift);
+ var dividendNormalized = this.shl_9x0255$(dividend, normalizationShift);
+ return new Triple(dividendNormalized, divisorNormalized, normalizationShift);
+ };
+ BigInteger63Arithmetic.prototype.normalize_w48dx$ = function (operand) {
+ var normalizationShift = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ return new Pair(this.shl_9x0255$(operand, normalizationShift), normalizationShift);
+ };
+ BigInteger63Arithmetic.prototype.denormalize_wn1fk7$ = function (remainderNormalized, normalizationShift) {
+ var remainder = this.shr_9x0255$(remainderNormalized, normalizationShift);
+ return remainder;
+ };
+ BigInteger63Arithmetic.prototype.baseDivide_oyvc3i$ = function (unnormalizedDividend, unnormalizedDivisor) {
+ var tmp$, tmp$_0;
+ if (this.compareTo_rgttk2$(unnormalizedDivisor, unnormalizedDividend) > 0) {
+ return new Pair(this.ZERO, unnormalizedDividend);
+ }
+ if (unnormalizedDivisor.size === 1 && unnormalizedDividend.size === 1) {
+ return new Pair(this.removeLeadingZeroes_w48dx$(new ULongArray_init(Kotlin.longArrayOf(ulongDivide(unnormalizedDividend.get_za3lpa$(0), unnormalizedDivisor.get_za3lpa$(0)).toLong()))), this.removeLeadingZeroes_w48dx$(new ULongArray_init(Kotlin.longArrayOf(ulongRemainder(unnormalizedDividend.get_za3lpa$(0), unnormalizedDivisor.get_za3lpa$(0)).toLong()))));
+ }
+ var bitPrecision = this.bitLength_11rb$(unnormalizedDividend) - this.bitLength_11rb$(unnormalizedDivisor) | 0;
+ if (bitPrecision === 0) {
+ return new Pair(this.ONE, this.minus_rgttk2$(unnormalizedDividend, unnormalizedDivisor));
+ }
+ var tmp$_1 = this.normalize_oyvc3i$(unnormalizedDividend, unnormalizedDivisor);
+ var dividend = tmp$_1.component1()
+ , divisor = tmp$_1.component2()
+ , normalizationShift = tmp$_1.component3();
+ var dividendSize = dividend.size;
+ var divisorSize = divisor.size;
+ var wordPrecision = dividendSize - divisorSize | 0;
+ var qjhat;
+ var reconstructedQuotient;
+ var quotient = ULongArray_init_0(wordPrecision);
+ var divisorTimesBaseToPowerOfM = this.shl_9x0255$(divisor, Kotlin.imul(wordPrecision, this.basePowerOfTwo));
+ if (this.compareTo_rgttk2$(dividend, divisorTimesBaseToPowerOfM) >= 0) {
+ quotient = ULongArray_init_0(wordPrecision + 1 | 0);
+ quotient.set_2ccimm$(wordPrecision, new ULong(Kotlin.Long.ONE));
+ dividend = this.minus_rgttk2$(dividend, divisorTimesBaseToPowerOfM);
+ }
+ for (var j = wordPrecision - 1 | 0; j >= 0; j--) {
+ if ((divisorSize + j | 0) < dividend.size) {
+ tmp$ = this.plus_bzhn23$(this.shl_9x0255$(new ULongArray_init(Kotlin.longArrayOf(dividend.get_za3lpa$(divisorSize + j | 0).toLong())), this.basePowerOfTwo), dividend.get_za3lpa$(divisorSize + j - 1 | 0));
+ }
+ else {
+ if ((divisorSize + j | 0) === dividend.size) {
+ tmp$ = new ULongArray_init(Kotlin.longArrayOf(dividend.get_za3lpa$(divisorSize + j - 1 | 0).toLong()));
+ }
+ else {
+ tmp$ = this.ZERO;
+ }
+ }
+ var twoDigit = tmp$;
+ var convertedResult = BigInteger32Arithmetic_getInstance().divide_xwzc9q$(this.to32Bit_3tx87d$(twoDigit), this.to32Bit_3tx87d$(new ULongArray_init(Kotlin.longArrayOf(divisor.get_za3lpa$(divisorSize - 1 | 0).toLong()))));
+ qjhat = this.from32Bit_j9z43k$(convertedResult.first);
+ var $this = this.baseMask;
+ var other = new ULong(Kotlin.Long.ONE);
+ if (this.compareTo_bzhn23$(qjhat, new ULong($this.data.subtract(other.data))) < 0) {
+ tmp$_0 = qjhat.get_za3lpa$(0);
+ }
+ else {
+ tmp$_0 = this.baseMask;
+ }
+ quotient.set_2ccimm$(j, tmp$_0);
+ reconstructedQuotient = this.shl_9x0255$(this.times_bzhn23$(divisor, quotient.get_za3lpa$(j)), Kotlin.imul(j, this.basePowerOfTwo));
+ while (this.compareTo_rgttk2$(reconstructedQuotient, dividend) > 0) {
+ var tmp$_2 = quotient;
+ var $this_0 = quotient.get_za3lpa$(j);
+ var other_0 = new UInt(1);
+ tmp$_2.set_2ccimm$(j, new ULong($this_0.data.subtract((new ULong(Kotlin.Long.fromInt(other_0.data).and(L4294967295))).data)));
+ reconstructedQuotient = this.shl_9x0255$(this.times_bzhn23$(divisor, quotient.get_za3lpa$(j)), Kotlin.imul(j, this.basePowerOfTwo));
+ }
+ dividend = this.minus_rgttk2$(dividend, reconstructedQuotient);
+ }
+ while (this.compareTo_rgttk2$(dividend, divisor) >= 0) {
+ quotient = this.plus_bzhn23$(quotient, new ULong(Kotlin.Long.ONE));
+ dividend = this.minus_rgttk2$(dividend, divisor);
+ }
+ var denormRemainder = this.denormalize_wn1fk7$(dividend, normalizationShift);
+ return new Pair(this.removeLeadingZeroes_w48dx$(quotient), denormRemainder);
+ };
+ function BigInteger63Arithmetic$basicDivide2$lambda(it) {
+ return new ULong(Kotlin.Long.ZERO);
+ }
+ BigInteger63Arithmetic.prototype.basicDivide2_oyvc3i$ = function (unnormalizedDividend, unnormalizedDivisor) {
+ var tmp$ = this.normalize_oyvc3i$(unnormalizedDividend, unnormalizedDivisor);
+ var a = tmp$.component1()
+ , b = tmp$.component2()
+ , shift = tmp$.component3();
+ var m = a.size - b.size | 0;
+ var bmb = this.shl_9x0255$(b, Kotlin.imul(m, this.wordSizeInBits));
+ var size = m + 1 | 0;
+ var q = new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$basicDivide2$lambda)));
+ if (this.compareTo_rgttk2$(a, bmb) > 0) {
+ q.set_2ccimm$(m, new ULong(Kotlin.Long.ONE));
+ a = this.minus_rgttk2$(a, bmb);
+ }
+ var qjhat = this.ZERO;
+ var qjhatULong = this.ZERO;
+ var bjb = this.ZERO;
+ var delta = this.ZERO;
+ for (var j = m - 1 | 0; j >= 0; j--) {
+ var tmp$_0 = BigInteger32Arithmetic_getInstance();
+ var $receiver = a;
+ var fromIndex = b.size - 1 | 0;
+ var toIndex = b.size + 1 | 0;
+ qjhatULong = this.from32Bit_j9z43k$(tmp$_0.divide_xwzc9q$(this.to32Bit_3tx87d$(new ULongArray_init(copyOfRange_0($receiver.storage, fromIndex, toIndex))), this.to32Bit_3tx87d$(new ULongArray_init(Kotlin.longArrayOf(b.get_za3lpa$(b.size - 1 | 0).toLong())))).first);
+ q.set_2ccimm$(j, this.min_oyvc3i$(qjhatULong, this.baseMaskArray).get_za3lpa$(0));
+ bjb = this.shl_9x0255$(b, Kotlin.imul(j, BigInteger32Arithmetic_getInstance().wordSizeInBits));
+ var qjBjb = this.shl_9x0255$(this.times_bzhn23$(b, q.get_za3lpa$(j)), Kotlin.imul(j, this.wordSizeInBits));
+ if (this.compareTo_rgttk2$(qjBjb, a) > 0) {
+ delta = this.minus_rgttk2$(qjBjb, a);
+ while (this.compareTo_rgttk2$(delta, qjBjb) > 0) {
+ var $this = q.get_za3lpa$(j);
+ var other = new UInt(1);
+ q.set_2ccimm$(j, new ULong($this.data.subtract((new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295))).data)));
+ delta = this.minus_rgttk2$(delta, bjb);
+ }
+ a = this.shl_9x0255$(this.minus_rgttk2$(a, this.times_bzhn23$(b, q.get_za3lpa$(j))), Kotlin.imul(j, BigInteger32Arithmetic_getInstance().wordSizeInBits));
+ }
+ else {
+ a = this.minus_rgttk2$(a, qjBjb);
+ }
+ }
+ var denormRemainder = this.denormalize_wn1fk7$(a, shift);
+ return new Pair(this.removeLeadingZeroes_w48dx$(q), denormRemainder);
+ };
+ BigInteger63Arithmetic.prototype.reciprocal_11rb$ = function (operand) {
+ return this.d1ReciprocalRecursiveWordVersion_w48dx$(operand);
+ };
+ BigInteger63Arithmetic.prototype.d1ReciprocalRecursive_w48dx$ = function (a) {
+ var tmp$, tmp$_0;
+ var fullBitLenght = this.bitLength_11rb$(a);
+ if (fullBitLenght > 63) {
+ tmp$ = fullBitLenght - 63 | 0;
+ }
+ else {
+ tmp$ = fullBitLenght;
+ }
+ var n = tmp$;
+ if (n <= 30) {
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = n * 2 | 0;
+ var rhoPowered = new ULong($this.data.shiftLeft(bitCount));
+ var longA = a.get_za3lpa$(0);
+ var x = ulongDivide(rhoPowered, longA);
+ var other = new ULong(x.data.multiply(longA.data));
+ var r = new ULong(rhoPowered.data.subtract(other.data));
+ return new Pair(new ULongArray_init(Kotlin.longArrayOf(x.toLong())), new ULongArray_init(Kotlin.longArrayOf(r.toLong())));
+ }
+ var x_0 = (n - 1 | 0) / 2;
+ var l = numberToInt(Math_0.floor(x_0));
+ var h = n - l | 0;
+ var mask = this.minus_rgttk2$(this.shl_9x0255$(this.ONE, l), this.ONE);
+ var ah = this.shr_9x0255$(a, l);
+ var al = this.and_xwzc9q$(a, mask);
+ var tmp$_1 = this.d1ReciprocalRecursive_w48dx$(ah);
+ var xh = tmp$_1.component1()
+ , rh = tmp$_1.component2();
+ var s = this.times_rgttk2$(al, xh);
+ var rhRhoL = this.shl_9x0255$(rh, l);
+ if (this.compareTo_rgttk2$(rhRhoL, s) >= 0) {
+ tmp$_0 = this.minus_rgttk2$(rhRhoL, s);
+ }
+ else {
+ xh = this.minus_rgttk2$(xh, this.ONE);
+ tmp$_0 = this.minus_rgttk2$(this.plus_rgttk2$(rhRhoL, a), s);
+ }
+ var t = tmp$_0;
+ var tm = this.shr_9x0255$(t, h);
+ var d = this.shr_9x0255$(this.times_rgttk2$(xh, tm), h);
+ var x_1 = this.plus_rgttk2$(this.shl_9x0255$(xh, l), d);
+ var r_0 = this.minus_rgttk2$(this.shl_9x0255$(t, l), this.times_rgttk2$(a, d));
+ if (this.compareTo_rgttk2$(r_0, a) >= 0) {
+ x_1 = this.plus_rgttk2$(x_1, this.ONE);
+ r_0 = this.minus_rgttk2$(r_0, a);
+ if (this.compareTo_rgttk2$(r_0, a) >= 0) {
+ x_1 = this.plus_rgttk2$(x_1, this.ONE);
+ r_0 = this.minus_rgttk2$(r_0, a);
+ }
+ }
+ return new Pair(x_1, r_0);
+ };
+ BigInteger63Arithmetic.prototype.d1ReciprocalRecursiveWordVersion_w48dx$ = function (a) {
+ var tmp$, tmp$_0;
+ var n = a.size - 1 | 0;
+ if (n <= 2) {
+ if (n === 0) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = n;
+ }
+ var corrected = tmp$;
+ var rhoPowered = this.shl_9x0255$(this.ONE, Kotlin.imul(corrected * 2 | 0, this.wordSizeInBits));
+ var x = this.div_rgttk2$(rhoPowered, a);
+ var r = this.minus_rgttk2$(rhoPowered, this.times_rgttk2$(x, a));
+ return new Pair(x, r);
+ }
+ var x_0 = (n - 1 | 0) / 2;
+ var l = numberToInt(Math_0.floor(x_0));
+ var h = n - l | 0;
+ var fromIndex = a.size - h - 1 | 0;
+ var toIndex = a.size;
+ var ah = new ULongArray_init(copyOfRange_0(a.storage, fromIndex, toIndex));
+ var al = new ULongArray_init(copyOfRange_0(a.storage, 0, l));
+ var tmp$_1 = this.d1ReciprocalRecursiveWordVersion_w48dx$(ah);
+ var xh = tmp$_1.component1()
+ , rh = tmp$_1.component2();
+ var s = this.times_rgttk2$(al, xh);
+ var rhRhoL = this.shl_9x0255$(rh, Kotlin.imul(l, this.wordSizeInBits));
+ if (this.compareTo_rgttk2$(rhRhoL, s) >= 0) {
+ tmp$_0 = this.minus_rgttk2$(rhRhoL, s);
+ }
+ else {
+ xh = this.minus_rgttk2$(xh, this.ONE);
+ tmp$_0 = this.minus_rgttk2$(this.plus_rgttk2$(rhRhoL, a), s);
+ }
+ var t = tmp$_0;
+ var tm = this.shr_9x0255$(t, Kotlin.imul(h, this.wordSizeInBits));
+ var d = this.shr_9x0255$(this.times_rgttk2$(xh, tm), Kotlin.imul(h, this.wordSizeInBits));
+ var x_1 = this.plus_rgttk2$(this.shl_9x0255$(xh, Kotlin.imul(l, this.wordSizeInBits)), d);
+ var r_0 = this.minus_rgttk2$(this.shl_9x0255$(t, Kotlin.imul(l, this.wordSizeInBits)), this.times_rgttk2$(a, d));
+ if (this.compareTo_rgttk2$(r_0, a) >= 0) {
+ x_1 = this.plus_rgttk2$(x_1, this.ONE);
+ r_0 = this.minus_rgttk2$(r_0, a);
+ if (this.compareTo_rgttk2$(r_0, a) >= 0) {
+ x_1 = this.plus_rgttk2$(x_1, this.ONE);
+ r_0 = this.minus_rgttk2$(r_0, a);
+ }
+ }
+ return new Pair(x_1, r_0);
+ };
+ BigInteger63Arithmetic.prototype.unbalancedReciprocal_0 = function (a, diff) {
+ var n = a.size - 1 - diff | 0;
+ var fromIndex = n + 1 | 0;
+ var toIndex = a.size;
+ var a0 = new ULongArray_init(copyOfRange_0(a.storage, fromIndex, toIndex));
+ var a1 = new ULongArray_init(copyOfRange_0(a.storage, 0, n));
+ var tmp$ = this.d1ReciprocalRecursiveWordVersion_w48dx$(a0);
+ var x = tmp$.component1()
+ , r = tmp$.component2();
+ if (x != null ? x.equals(this.shl_9x0255$(this.ONE, n * 63 | 0)) : null) {
+ if (this.compareTo_rgttk2$(a1, this.ZERO) === 0) {
+ r = this.ZERO;
+ }
+ else {
+ x = this.minus_rgttk2$(x, this.ONE);
+ r = this.minus_rgttk2$(a, this.shl_9x0255$(a1, n * 63 | 0));
+ }
+ }
+ else {
+ var rRhoD = this.shl_9x0255$(r, diff);
+ var a1x = this.times_rgttk2$(a1, x);
+ if (this.compareTo_rgttk2$(rRhoD, a1x) > 0) {
+ r = this.minus_rgttk2$(rRhoD, a1x);
+ }
+ else {
+ x = this.minus_rgttk2$(x, this.ONE);
+ r = this.minus_rgttk2$(rRhoD, this.times_rgttk2$(a1, x));
+ }
+ }
+ return new Pair(x, r);
+ };
+ BigInteger63Arithmetic.prototype.convertTo64BitRepresentation_tnvzeg$ = function (operand) {
+ var tmp$;
+ if (operand != null ? operand.equals(this.ZERO) : null)
+ return this.ZERO;
+ var length = this.bitLength_11rb$(operand);
+ if (length % 64 === 0) {
+ tmp$ = length / 64 | 0;
+ }
+ else {
+ tmp$ = (length / 64 | 0) + 1 | 0;
+ }
+ var requiredLength = tmp$;
+ var wordStep;
+ var shiftAmount;
+ var result = ULongArray_init_0(requiredLength);
+ for (var i = 0; i < requiredLength; i++) {
+ wordStep = i / 63 | 0;
+ shiftAmount = i % 63;
+ if ((i + wordStep + 1 | 0) < operand.size) {
+ var tmp$_0 = new ULong(operand.get_za3lpa$(i + wordStep | 0).data.shiftRightUnsigned(shiftAmount));
+ var $this = operand.get_za3lpa$(i + wordStep + 1 | 0);
+ var bitCount = 63 - shiftAmount | 0;
+ var other = new ULong($this.data.shiftLeft(bitCount));
+ result.set_2ccimm$(i, new ULong(tmp$_0.data.or(other.data)));
+ }
+ else {
+ result.set_2ccimm$(i, new ULong(operand.get_za3lpa$(i + wordStep | 0).data.shiftRightUnsigned(shiftAmount)));
+ }
+ }
+ return result;
+ };
+ BigInteger63Arithmetic.prototype.convertTo32BitRepresentation_tnvzeg$ = function (operand) {
+ var tmp$;
+ var power64Representation = this.convertTo64BitRepresentation_tnvzeg$(operand);
+ var result = UIntArray_init(power64Representation.size * 2 | 0);
+ tmp$ = power64Representation.size;
+ for (var i = 0; i < tmp$; i++) {
+ var tmp$_0 = 2 * i | 0;
+ var tmp$_1 = power64Representation.get_za3lpa$(i);
+ var $this = BigInteger32Arithmetic_getInstance().base;
+ var other = new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295));
+ result.set_6sqrdv$(tmp$_0, new UInt((new ULong(tmp$_1.data.and(other.data))).data.toInt()));
+ result.set_6sqrdv$((2 * i | 0) + 1 | 0, new UInt((new ULong(power64Representation.get_za3lpa$(i).data.shiftRightUnsigned(32))).data.toInt()));
+ }
+ return BigInteger32Arithmetic_getInstance().removeLeadingZeroes_rsvixa$(result);
+ };
+ BigInteger63Arithmetic.prototype.convertFrom32BitRepresentation_57d09b$ = function (operand) {
+ var tmp$;
+ if (operand.size === 0) {
+ return this.ZERO;
+ }
+ if (operand.size === 1) {
+ var $this = operand.get_za3lpa$(0);
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295))).toLong()));
+ }
+ var length = BigInteger32Arithmetic_getInstance().bitLength_11rb$(operand);
+ if (length % 63 === 0) {
+ tmp$ = length / 63 | 0;
+ }
+ else {
+ tmp$ = (length / 63 | 0) + 1 | 0;
+ }
+ var requiredLength = tmp$;
+ var result = ULongArray_init_0(requiredLength);
+ var skipWordCount;
+ for (var i = 0; i < requiredLength; i++) {
+ skipWordCount = i / 32 | 0;
+ var shiftAmount = i % 32;
+ var position = (i * 2 | 0) - skipWordCount | 0;
+ if (i === 0) {
+ var $this_0 = operand.get_za3lpa$(i * 2 | 0);
+ var tmp$_0 = new ULong(Kotlin.Long.fromInt($this_0.data).and(L4294967295));
+ var $this_1 = operand.get_za3lpa$((i * 2 | 0) + 1 | 0);
+ var $this_2 = new ULong((new ULong(Kotlin.Long.fromInt($this_1.data).and(L4294967295))).data.shiftLeft(32));
+ var other = this.highMask;
+ var other_0 = new ULong($this_2.data.and(other.data));
+ result.set_2ccimm$(i, new ULong(tmp$_0.data.or(other_0.data)));
+ }
+ else if (1 <= i && i < (requiredLength - 1 | 0)) {
+ var $this_3 = operand.get_za3lpa$(position - 1 | 0);
+ var $this_4 = new ULong(Kotlin.Long.fromInt($this_3.data).and(L4294967295));
+ var bitCount = 32 - shiftAmount | 0;
+ var tmp$_1 = new ULong($this_4.data.shiftRightUnsigned(bitCount));
+ var $this_5 = operand.get_za3lpa$(position);
+ var other_1 = new ULong((new ULong(Kotlin.Long.fromInt($this_5.data).and(L4294967295))).data.shiftLeft(shiftAmount));
+ var tmp$_2 = new ULong(tmp$_1.data.or(other_1.data));
+ var $this_6 = operand.get_za3lpa$(position + 1 | 0);
+ var $this_7 = new ULong(Kotlin.Long.fromInt($this_6.data).and(L4294967295));
+ var bitCount_0 = 32 + shiftAmount | 0;
+ var $this_8 = new ULong($this_7.data.shiftLeft(bitCount_0));
+ var other_2 = this.highMask;
+ var other_3 = new ULong($this_8.data.and(other_2.data));
+ result.set_2ccimm$(i, new ULong(tmp$_2.data.or(other_3.data)));
+ }
+ else if (i === (requiredLength - 1 | 0))
+ if (position < operand.size) {
+ var $this_9 = operand.get_za3lpa$(position - 1 | 0);
+ var $this_10 = new ULong(Kotlin.Long.fromInt($this_9.data).and(L4294967295));
+ var bitCount_1 = 32 - shiftAmount | 0;
+ var tmp$_3 = new ULong($this_10.data.shiftRightUnsigned(bitCount_1));
+ var $this_11 = operand.get_za3lpa$(position);
+ var other_4 = new ULong((new ULong(Kotlin.Long.fromInt($this_11.data).and(L4294967295))).data.shiftLeft(shiftAmount));
+ result.set_2ccimm$(i, new ULong(tmp$_3.data.or(other_4.data)));
+ }
+ else {
+ var $this_12 = operand.get_za3lpa$(position - 1 | 0);
+ var $this_13 = new ULong(Kotlin.Long.fromInt($this_12.data).and(L4294967295));
+ var bitCount_2 = 32 - shiftAmount | 0;
+ result.set_2ccimm$(i, new ULong($this_13.data.shiftRightUnsigned(bitCount_2)));
+ }
+ }
+ return result;
+ };
+ BigInteger63Arithmetic.prototype.divide_xwzc9q$ = function (first, second) {
+ return this.baseDivide_oyvc3i$(first, second);
+ };
+ function BigInteger63Arithmetic$reciprocalDivision$lambda(closure$second, closure$precisionExtension) {
+ return function (it) {
+ if (it >= closure$precisionExtension)
+ return closure$second.get_za3lpa$(it - closure$precisionExtension | 0);
+ else
+ return new ULong(Kotlin.Long.ZERO);
+ };
+ }
+ function BigInteger63Arithmetic$reciprocalDivision$lambda_0(closure$product) {
+ return function (it) {
+ if (it === (closure$product.v.size - 1 | 0)) {
+ var $this = closure$product.v.get_za3lpa$(closure$product.v.size - 1 | 0);
+ var other = new ULong(Kotlin.Long.ONE);
+ return new ULong($this.data.add(other.data));
+ }
+ else
+ return new ULong(Kotlin.Long.ZERO);
+ };
+ }
+ BigInteger63Arithmetic.prototype.reciprocalDivision_m02cap$ = function (first, second) {
+ var tmp$;
+ if (first.size < second.size) {
+ throw RuntimeException_init('Invalid division: ' + first.size + ' words / ' + second.size + ' words');
+ }
+ if (second.size === 1) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = second.size - 1 | 0;
+ }
+ var shift = tmp$;
+ var precisionExtension = first.size - second.size + 1 | 0;
+ var size = second.size + precisionExtension | 0;
+ var secondHigherPrecision = new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$reciprocalDivision$lambda(second, precisionExtension))));
+ var secondReciprocalWithRemainder = this.d1ReciprocalRecursiveWordVersion_w48dx$(secondHigherPrecision);
+ var secondReciprocal = secondReciprocalWithRemainder.first;
+ var product = {v: this.times_rgttk2$(first, secondReciprocal)};
+ if (this.compareTo_bzhn23$(product.v, new ULong(Kotlin.Long.ZERO)) === 0) {
+ return new Pair(this.ZERO, first);
+ }
+ if (product.v.size === 1) {
+ var tmp$_0 = product.v;
+ var $this = this.baseMask;
+ var other = new ULong(Kotlin.Long.ONE);
+ if (this.compareTo_bzhn23$(tmp$_0, new ULong($this.data.subtract(other.data))) >= 0) {
+ product.v = this.plus_rgttk2$(product.v, this.ONE);
+ }
+ }
+ else {
+ var importantWord = product.v.get_za3lpa$(product.v.size - second.size | 0);
+ var other_0 = this.baseMask;
+ if (ulongCompare(importantWord.data, other_0.data) >= 0) {
+ var size_0 = product.v.size;
+ product.v = new ULongArray_init(Kotlin.longArrayF(size_0, ULongArray$lambda(BigInteger63Arithmetic$reciprocalDivision$lambda_0(product))));
+ }
+ }
+ var $receiver = product.v;
+ var fromIndex = (2 * shift | 0) + precisionExtension | 0;
+ var toIndex = product.v.size;
+ var result = new ULongArray_init(copyOfRange_0($receiver.storage, fromIndex, toIndex));
+ var remainder = this.minus_rgttk2$(first, this.times_rgttk2$(result, second));
+ return new Pair(result, remainder);
+ };
+ BigInteger63Arithmetic.prototype.sqrt_11rb$ = function (operand) {
+ return this.reqursiveSqrt_0(operand);
+ };
+ BigInteger63Arithmetic.prototype.reqursiveSqrt_0 = function (operand) {
+ var n = operand.size;
+ var x = (n - 1 | 0) / 4;
+ var l = numberToInt(Math_0.floor(x));
+ if (l === 0) {
+ return this.basecaseSqrt_tnvzeg$(operand);
+ }
+ var step = n / 4 | 0;
+ var stepRemainder = n % 4;
+ var baseLPowerShift = 63 * l | 0;
+ var fromIndex = n - ((3 * step | 0) + stepRemainder) | 0;
+ var toIndex = n - ((2 * step | 0) + stepRemainder) | 0;
+ var a1 = new ULongArray_init(copyOfRange_0(operand.storage, fromIndex, toIndex));
+ var toIndex_0 = n - ((3 * step | 0) + stepRemainder) | 0;
+ var a0 = new ULongArray_init(copyOfRange_0(operand.storage, 0, toIndex_0));
+ var fromIndex_0 = n - ((2 * step | 0) + stepRemainder) | 0;
+ var a3a2 = new ULongArray_init(copyOfRange_0(operand.storage, fromIndex_0, n));
+ var tmp$ = this.reqursiveSqrt_0(a3a2);
+ var sPrim = tmp$.component1()
+ , rPrim = tmp$.component2();
+ var tmp$_0 = this.divrem_rgttk2$(this.plus_rgttk2$(this.shl_9x0255$(rPrim, baseLPowerShift), a1), this.shl_9x0255$(sPrim, 1));
+ var q = tmp$_0.component1()
+ , u = tmp$_0.component2();
+ var s = this.plus_rgttk2$(this.shl_9x0255$(sPrim, baseLPowerShift), q);
+ var r = this.minus_rgttk2$(this.plus_rgttk2$(this.shl_9x0255$(u, baseLPowerShift), a0), this.times_rgttk2$(q, q));
+ return new Pair(s, r);
+ };
+ BigInteger63Arithmetic.prototype.basecaseSqrt_tnvzeg$ = function (operand) {
+ var sqrt = this.sqrtInt_tnvzeg$(operand);
+ var remainder = this.minus_rgttk2$(operand, this.times_rgttk2$(sqrt, sqrt));
+ return new Pair(sqrt, remainder);
+ };
+ BigInteger63Arithmetic.prototype.sqrtInt_tnvzeg$ = function (operand) {
+ var u = operand;
+ var s = this.ZERO;
+ var tmp = this.ZERO;
+ do {
+ s = u;
+ tmp = this.plus_rgttk2$(s, this.div_rgttk2$(operand, s));
+ u = this.shr_9x0255$(tmp, 1);
+ }
+ while (this.compareTo_rgttk2$(u, s) < 0);
+ return s;
+ };
+ BigInteger63Arithmetic.prototype.gcd_xwzc9q$ = function (first, second) {
+ return this.naiveGcd_0(first, second);
+ };
+ BigInteger63Arithmetic.prototype.naiveGcd_0 = function (first, second) {
+ var u = first;
+ var v = second;
+ while (!(v != null ? v.equals(this.ZERO) : null)) {
+ var tmpU = u;
+ u = v;
+ v = this.rem_rgttk2$(tmpU, v);
+ }
+ return u;
+ };
+ BigInteger63Arithmetic.prototype.min_oyvc3i$ = function (first, second) {
+ var tmp$;
+ if (this.compareTo_rgttk2$(first, second) < 0) {
+ tmp$ = first;
+ }
+ else {
+ tmp$ = second;
+ }
+ return tmp$;
+ };
+ BigInteger63Arithmetic.prototype.max_oyvc3i$ = function (first, second) {
+ var tmp$;
+ if (this.compareTo_rgttk2$(first, second) > 0) {
+ tmp$ = first;
+ }
+ else {
+ tmp$ = second;
+ }
+ return tmp$;
+ };
+ BigInteger63Arithmetic.prototype.parseForBase_bm4lxs$ = function (number, base) {
+ var parsed = {v: this.ZERO};
+ var tmp$;
+ tmp$ = iterator(number.toLowerCase());
+ while (tmp$.hasNext()) {
+ var element = unboxChar(tmp$.next());
+ var char = toBoxedChar(element);
+ var tmp$_0 = this.times_bzhn23$(parsed.v, new ULong(Kotlin.Long.fromInt(base)));
+ var $receiver = toDigit(unboxChar(char));
+ parsed.v = this.plus_bzhn23$(tmp$_0, new ULong(Kotlin.Long.fromInt($receiver)));
+ }
+ return this.removeLeadingZeroes_w48dx$(parsed.v);
+ };
+ BigInteger63Arithmetic.prototype.toString_dpg1yx$ = function (operand, base) {
+ var copy = new ULongArray_init(copyOf(operand.storage));
+ var baseArray = new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(base))).toLong()));
+ var stringBuilder = StringBuilder_init();
+ while (!(copy != null ? copy.equals(this.ZERO) : null)) {
+ var divremResult = this.divrem_rgttk2$(copy, baseArray);
+ if (divremResult.second.isEmpty()) {
+ stringBuilder.append_s8jyv4$(0);
+ }
+ else {
+ stringBuilder.append_gw00v9$(toString_1(divremResult.second.get_za3lpa$(0), base));
+ }
+ copy = divremResult.first;
+ }
+ var $receiver = stringBuilder.toString();
+ var tmp$;
+ return reversed_0(Kotlin.isCharSequence(tmp$ = $receiver) ? tmp$ : throwCCE()).toString();
+ };
+ function BigInteger63Arithmetic$and$lambda(closure$mask, closure$operand) {
+ return function (it) {
+ if (it < closure$mask.size) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$mask.get_za3lpa$(it);
+ return new ULong($this.data.and(other.data));
+ }
+ else {
+ return new ULong(Kotlin.Long.ZERO);
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.and_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ return this.removeLeadingZeroes_w48dx$(new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$and$lambda(mask, operand)))));
+ };
+ function BigInteger63Arithmetic$or$lambda(closure$mask, closure$operand) {
+ return function (it) {
+ if (it < closure$mask.size) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$mask.get_za3lpa$(it);
+ return new ULong($this.data.or(other.data));
+ }
+ else {
+ return closure$operand.get_za3lpa$(it);
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.or_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ return this.removeLeadingZeroes_w48dx$(new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$or$lambda(mask, operand)))));
+ };
+ function BigInteger63Arithmetic$xor$lambda(closure$mask, closure$operand) {
+ return function (it) {
+ if (it < closure$mask.size) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$mask.get_za3lpa$(it);
+ return new ULong($this.data.xor(other.data));
+ }
+ else {
+ var $this_0 = closure$operand.get_za3lpa$(it);
+ var other_0 = new ULong(Kotlin.Long.ZERO);
+ return new ULong($this_0.data.xor(other_0.data));
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.xor_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ return this.removeLeadingZeroes_w48dx$(new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$xor$lambda(mask, operand)))));
+ };
+ function BigInteger63Arithmetic$not$lambda(closure$operand, this$BigInteger63Arithmetic, closure$cleanupMask) {
+ return function (it) {
+ if (it < (closure$operand.size - 2 | 0)) {
+ var $this = new ULong(closure$operand.get_za3lpa$(it).data.inv());
+ var other = this$BigInteger63Arithmetic.baseMask;
+ return new ULong($this.data.and(other.data));
+ }
+ else {
+ var $this_0 = new ULong(closure$operand.get_za3lpa$(it).data.inv());
+ var other_0 = closure$cleanupMask;
+ return new ULong($this_0.data.and(other_0.data));
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.not_11rb$ = function (operand) {
+ var leadingZeroes = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = leadingZeroes + 1 | 0;
+ var $this_0 = new ULong($this.data.shiftLeft(bitCount));
+ var other = new UInt(1);
+ var $this_1 = new ULong($this_0.data.subtract((new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295))).data));
+ var bitCount_0 = this.basePowerOfTwo - leadingZeroes | 0;
+ var cleanupMask = new ULong((new ULong($this_1.data.shiftLeft(bitCount_0))).data.inv());
+ var size = operand.size;
+ var inverted = new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$not$lambda(operand, this, cleanupMask))));
+ return inverted;
+ };
+ BigInteger63Arithmetic.prototype.shl_9x0255$ = function ($receiver, places) {
+ return this.shiftLeft_dpg1yx$($receiver, places);
+ };
+ BigInteger63Arithmetic.prototype.shr_9x0255$ = function ($receiver, places) {
+ return this.shiftRight_dpg1yx$($receiver, places);
+ };
+ BigInteger63Arithmetic.prototype.bitAt_19wkf8$ = function (operand, position) {
+ var tmp$;
+ if (position.div(Kotlin.Long.fromInt(63)).toNumber() > 2147483647) {
+ throw RuntimeException_init('Invalid bit index, too large, cannot access word (Word position > Int.MAX_VALUE');
+ }
+ var wordPosition = position.div(Kotlin.Long.fromInt(63));
+ if (wordPosition.toNumber() >= operand.size) {
+ return false;
+ }
+ var bitPosition = position.modulo(Kotlin.Long.fromInt(63));
+ var word = operand.get_za3lpa$(wordPosition.toInt());
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = bitPosition.toInt();
+ var other = new ULong($this.data.shiftLeft(bitCount));
+ return (tmp$ = new ULong(word.data.and(other.data))) != null ? tmp$.equals(new ULong(Kotlin.Long.ONE)) : null;
+ };
+ function BigInteger63Arithmetic$setBitAt$lambda(closure$wordPosition, closure$bit, closure$operand, closure$setMask) {
+ return function (it) {
+ if (it === closure$wordPosition.toInt()) {
+ if (closure$bit) {
+ var $this = closure$operand.get_za3lpa$(it);
+ var other = closure$setMask;
+ return new ULong($this.data.or(other.data));
+ }
+ else {
+ var $this_0 = closure$operand.get_za3lpa$(it);
+ var other_0 = closure$setMask;
+ return new ULong($this_0.data.xor(other_0.data));
+ }
+ }
+ else {
+ return closure$operand.get_za3lpa$(it);
+ }
+ };
+ }
+ BigInteger63Arithmetic.prototype.setBitAt_xjejkt$ = function (operand, position, bit) {
+ if (position.div(Kotlin.Long.fromInt(63)).toNumber() > 2147483647) {
+ throw RuntimeException_init('Invalid bit index, too large, cannot access word (Word position > Int.MAX_VALUE');
+ }
+ var wordPosition = position.div(Kotlin.Long.fromInt(63));
+ if (wordPosition.toNumber() >= operand.size) {
+ throw new IndexOutOfBoundsException('Invalid position, addressed word ' + wordPosition.toString() + ' larger than number of words ' + operand.size);
+ }
+ var bitPosition = position.modulo(Kotlin.Long.fromInt(63));
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = bitPosition.toInt();
+ var setMask = new ULong($this.data.shiftLeft(bitCount));
+ var size = operand.size;
+ return new ULongArray_init(Kotlin.longArrayF(size, ULongArray$lambda(BigInteger63Arithmetic$setBitAt$lambda(wordPosition, bit, operand, setMask))));
+ };
+ BigInteger63Arithmetic.prototype.plus_rgttk2$ = function ($receiver, other) {
+ return this.add_xwzc9q$($receiver, other);
+ };
+ BigInteger63Arithmetic.prototype.minus_rgttk2$ = function ($receiver, other) {
+ return this.substract_xwzc9q$($receiver, other);
+ };
+ BigInteger63Arithmetic.prototype.times_rgttk2$ = function ($receiver, other) {
+ return this.multiply_xwzc9q$($receiver, other);
+ };
+ BigInteger63Arithmetic.prototype.plus_bzhn23$ = function ($receiver, other) {
+ return this.add_xwzc9q$($receiver, new ULongArray_init(Kotlin.longArrayOf(other.toLong())));
+ };
+ BigInteger63Arithmetic.prototype.minus_bzhn23$ = function ($receiver, other) {
+ return this.substract_xwzc9q$($receiver, new ULongArray_init(Kotlin.longArrayOf(other.toLong())));
+ };
+ BigInteger63Arithmetic.prototype.times_bzhn23$ = function ($receiver, other) {
+ return this.multiply_xwzc9q$($receiver, new ULongArray_init(Kotlin.longArrayOf(other.toLong())));
+ };
+ BigInteger63Arithmetic.prototype.div_bzhn23$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, new ULongArray_init(Kotlin.longArrayOf(other.toLong()))).first;
+ };
+ BigInteger63Arithmetic.prototype.rem_bzhn23$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, new ULongArray_init(Kotlin.longArrayOf(other.toLong()))).second;
+ };
+ BigInteger63Arithmetic.prototype.div_rgttk2$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, other).first;
+ };
+ BigInteger63Arithmetic.prototype.rem_rgttk2$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, other).second;
+ };
+ BigInteger63Arithmetic.prototype.divrem_rgttk2$ = function ($receiver, other) {
+ return this.divide_xwzc9q$($receiver, other);
+ };
+ BigInteger63Arithmetic.prototype.compareTo_rgttk2$ = function ($receiver, other) {
+ return this.compare_xwzc9q$($receiver, other);
+ };
+ BigInteger63Arithmetic.prototype.compareTo_bzhn23$ = function ($receiver, other) {
+ return this.compare_xwzc9q$($receiver, new ULongArray_init(Kotlin.longArrayOf(other.toLong())));
+ };
+ BigInteger63Arithmetic.prototype.to32Bit_3tx87d$ = function ($receiver) {
+ return this.convertTo32BitRepresentation_tnvzeg$($receiver);
+ };
+ BigInteger63Arithmetic.prototype.from32Bit_j9z43k$ = function ($receiver) {
+ return this.convertFrom32BitRepresentation_57d09b$($receiver);
+ };
+ BigInteger63Arithmetic.prototype.fromULong_mpgczg$ = function (uLong) {
+ return new ULongArray_init(Kotlin.longArrayOf(uLong.toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromUInt_s87ys9$ = function (uInt) {
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(uInt.data).and(L4294967295))).toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(uShort.data).and(L65535))).toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromUByte_mpmjao$ = function (uByte) {
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt(uByte.data).and(L255))).toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromLong_s8cxhz$ = function (long) {
+ var tmp$;
+ var $this = new ULong(abs(long));
+ var other = this.overflowMask;
+ if ((tmp$ = new ULong((new ULong($this.data.and(other.data))).data.shiftRightUnsigned(63))) != null ? tmp$.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ return this.plus_bzhn23$(new ULongArray_init(Kotlin.longArrayOf(this.baseMask.toLong())), new ULong(Kotlin.Long.ONE));
+ }
+ var $this_0 = new ULong(abs(long));
+ var other_0 = this.baseMask;
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong($this_0.data.and(other_0.data))).toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromInt_za3lpa$ = function (int) {
+ var $receiver = abs_0(int);
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt($receiver))).toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromShort_mq22fl$ = function (short) {
+ var $receiver = abs_0(short);
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt($receiver))).toLong()));
+ };
+ BigInteger63Arithmetic.prototype.fromByte_s8j3t7$ = function (byte) {
+ var $receiver = abs_0(byte);
+ return new ULongArray_init(Kotlin.longArrayOf((new ULong(Kotlin.Long.fromInt($receiver))).toLong()));
+ };
+ BigInteger63Arithmetic.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'BigInteger63Arithmetic',
+ interfaces: [BigIntegerArithmetic]
+ };
+ var BigInteger63Arithmetic_instance = null;
+ function BigInteger63Arithmetic_getInstance() {
+ if (BigInteger63Arithmetic_instance === null) {
+ new BigInteger63Arithmetic();
+ }
+ return BigInteger63Arithmetic_instance;
+ }
+ function BigInteger63LinkedListArithmetic() {
+ BigInteger63LinkedListArithmetic_instance = this;
+ this.ZERO_v86p2c$_0 = listOf(new ULong(Kotlin.Long.ZERO));
+ this.ONE_a60uxu$_0 = listOf(new ULong(Kotlin.Long.ONE));
+ this.TWO_a648sc$_0 = listOf(new ULong(Kotlin.Long.ONE));
+ this.TEN_a63vez$_0 = listOf(new ULong(Kotlin.Long.fromInt(10)));
+ this.basePowerOfTwo_rggmq3$_0 = 63;
+ this.baseMask = new ULong(Kotlin.Long.MAX_VALUE);
+ this.lowMask = new ULong(new Kotlin.Long(-1, 0));
+ this.highMask = new ULong(new Kotlin.Long(0, 2147483647));
+ this.overflowMask = new ULong(Kotlin.Long.MIN_VALUE);
+ this.powersOf10 = [listOf(new ULong(Kotlin.Long.ONE)), listOf(new ULong(Kotlin.Long.fromInt(10))), listOf(new ULong(Kotlin.Long.fromInt(100))), listOf(new ULong(Kotlin.Long.fromInt(1000))), listOf(new ULong(Kotlin.Long.fromInt(10000))), listOf(new ULong(Kotlin.Long.fromInt(100000))), listOf(new ULong(Kotlin.Long.fromInt(1000000))), listOf(new ULong(Kotlin.Long.fromInt(10000000))), listOf(new ULong(Kotlin.Long.fromInt(100000000))), listOf(new ULong(Kotlin.Long.fromInt(1000000000))), listOf(new ULong(new Kotlin.Long(1410065408, 2))), listOf(new ULong(new Kotlin.Long(1215752192, 23))), listOf(new ULong(new Kotlin.Long(-727379968, 232))), listOf(new ULong(new Kotlin.Long(1316134912, 2328))), listOf(new ULong(new Kotlin.Long(276447232, 23283))), listOf(new ULong(new Kotlin.Long(-1530494976, 232830))), listOf(new ULong(new Kotlin.Long(1874919424, 2328306))), listOf(new ULong(new Kotlin.Long(1569325056, 23283064))), listOf(new ULong(new Kotlin.Long(-1486618624, 232830643))), listOf_0([new ULong(new Kotlin.Long(-1981284352, 180822788)), new ULong(Kotlin.Long.ONE)]), listOf_0([new ULong(new Kotlin.Long(1661992960, 1808227885)), new ULong(Kotlin.Long.fromInt(10))]), listOf_0([new ULong(new Kotlin.Long(-559939584, 902409669)), new ULong(Kotlin.Long.fromInt(108))]), listOf_0([new ULong(new Kotlin.Long(-1304428544, 434162106)), new ULong(Kotlin.Long.fromInt(1084))]), listOf_0([new ULong(new Kotlin.Long(-159383552, 46653770)), new ULong(Kotlin.Long.fromInt(10842))]), listOf_0([new ULong(new Kotlin.Long(-1593835520, 466537709)), new ULong(Kotlin.Long.fromInt(108420))]), listOf_0([new ULong(new Kotlin.Long(1241513984, 370409800)), new ULong(Kotlin.Long.fromInt(1084202))]), listOf_0([new ULong(new Kotlin.Long(-469762048, 1556614354)), new ULong(Kotlin.Long.fromInt(10842021))]), listOf_0([new ULong(new Kotlin.Long(-402653184, 533758012)), new ULong(Kotlin.Long.fromInt(108420217))]), listOf_0([new ULong(new Kotlin.Long(268435456, 1042612833)), new ULong(Kotlin.Long.fromInt(1084202172))]), listOf_0([new ULong(new Kotlin.Long(-1610612736, 1836193738)), new ULong(new Kotlin.Long(-2042880164, 2))]), listOf_0([new ULong(new Kotlin.Long(1073741824, 1182068202)), new ULong(new Kotlin.Long(1046034848, 25))]), listOf_0([new ULong(new Kotlin.Long(-2147483648, 1083263782)), new ULong(new Kotlin.Long(1870413893, 252))]), listOf_0([new ULong(new Kotlin.Long(0, 95219585)), new ULong(new Kotlin.Long(1524269751, 2524))]), listOf_0([new ULong(new Kotlin.Long(0, 952195850)), new ULong(new Kotlin.Long(-1937171674, 25243))]), listOf_0([new ULong(new Kotlin.Long(0, 932023908)), new ULong(new Kotlin.Long(2103119744, 252435))]), listOf_0([new ULong(new Kotlin.Long(0, 730304488)), new ULong(new Kotlin.Long(-443639036, 2524354))]), listOf_0([new ULong(new Kotlin.Long(0, 860593936)), new ULong(new Kotlin.Long(-141423061, 25243548))]), listOf_0([new ULong(new Kotlin.Long(0, 16004768)), new ULong(new Kotlin.Long(-1414230606, 252435489))]), listOf_0([new ULong(new Kotlin.Long(0, 160047680)), new ULong(new Kotlin.Long(-1257404172, 376871248)), new ULong(Kotlin.Long.ONE)]), listOf_0([new ULong(new Kotlin.Long(0, 1600476800)), new ULong(new Kotlin.Long(310860168, 1621228839)), new ULong(Kotlin.Long.fromInt(11))]), listOf_0([new ULong(new Kotlin.Long(0, 972382464)), new ULong(new Kotlin.Long(-1186365609, 1179902854)), new ULong(Kotlin.Long.fromInt(117))]), listOf_0([new ULong(new Kotlin.Long(0, 1133890048)), new ULong(new Kotlin.Long(1021245802, 1061610307)), new ULong(Kotlin.Long.fromInt(1175))]), listOf_0([new ULong(new Kotlin.Long(0, 601482240)), new ULong(new Kotlin.Long(1622523433, 2026168480)), new ULong(Kotlin.Long.fromInt(11754))]), listOf_0([new ULong(new Kotlin.Long(0, 1719855104)), new ULong(new Kotlin.Long(-954634852, 934331971)), new ULong(Kotlin.Long.fromInt(117549))]), listOf_0([new ULong(new Kotlin.Long(0, 18681856)), new ULong(new Kotlin.Long(-956413920, 753385125)), new ULong(Kotlin.Long.fromInt(1175494))]), listOf_0([new ULong(new Kotlin.Long(0, 186818560)), new ULong(new Kotlin.Long(-974204608, 1091400313)), new ULong(Kotlin.Long.fromInt(11754943))]), listOf_0([new ULong(new Kotlin.Long(0, 1868185600)), new ULong(new Kotlin.Long(-1152111488, 176584897)), new ULong(Kotlin.Long.fromInt(117549435))]), listOf_0([new ULong(new Kotlin.Long(0, 1501986816)), new ULong(new Kotlin.Long(1363787016, 1765848977)), new ULong(Kotlin.Long.fromInt(1175494350))]), listOf_0([new ULong(new Kotlin.Long(0, 2134966272)), new ULong(new Kotlin.Long(752968278, 478620589)), new ULong(new Kotlin.Long(-1129958380, 2))]), listOf_0([new ULong(new Kotlin.Long(0, 2022309888)), new ULong(new Kotlin.Long(-1060251803, 491238595)), new ULong(new Kotlin.Long(1585318090, 27))]), listOf_0([new ULong(new Kotlin.Long(0, 895746048)), new ULong(new Kotlin.Long(-2012583429, 617418661)), new ULong(new Kotlin.Long(-1326688282, 273))]), listOf_0([new ULong(new Kotlin.Long(0, 367525888)), new ULong(new Kotlin.Long(1349002194, 1879219319)), new ULong(new Kotlin.Long(-381980930, 2736))]), listOf_0([new ULong(new Kotlin.Long(0, 1527775232)), new ULong(new Kotlin.Long(605120053, 1612324009)), new ULong(new Kotlin.Long(475158004, 27369))]), listOf_0([new ULong(new Kotlin.Long(0, 245366784)), new ULong(new Kotlin.Long(1756233241, 1090854555)), new ULong(new Kotlin.Long(456612751, 273691))]), listOf_0([new ULong(new Kotlin.Long(0, 306184192)), new ULong(new Kotlin.Long(382463227, 171127314)), new ULong(new Kotlin.Long(271160219, 2736911))]), listOf_0([new ULong(new Kotlin.Long(0, 914358272)), new ULong(new Kotlin.Long(-470335025, 1711273140)), new ULong(new Kotlin.Long(-1583365106, 27369110))]), listOf_0([new ULong(new Kotlin.Long(0, 553648128)), new ULong(new Kotlin.Long(-408382950, 2080345872)), new ULong(new Kotlin.Long(1346218131, 273691106))]), listOf_0([new ULong(new Kotlin.Long(0, 1241513984)), new ULong(new Kotlin.Long(211137798, 1476105897)), new ULong(new Kotlin.Long(577279431, 589427415)), new ULong(Kotlin.Long.ONE)]), listOf_0([new ULong(new Kotlin.Long(0, 1677721600)), new ULong(new Kotlin.Long(2111377985, 1876157082)), new ULong(new Kotlin.Long(1477827020, 1599306855)), new ULong(Kotlin.Long.fromInt(12))]), listOf_0([new ULong(new Kotlin.Long(0, 1744830464)), new ULong(new Kotlin.Long(-361056623, 1581701640)), new ULong(new Kotlin.Long(1893368320, 960683017)), new ULong(Kotlin.Long.fromInt(127))]), listOf_0([new ULong(new Kotlin.Long(0, 268435456)), new ULong(new Kotlin.Long(684401074, 784630873)), new ULong(new Kotlin.Long(1753814023, 1016895582)), new ULong(Kotlin.Long.fromInt(1274))]), listOf_0([new ULong(new Kotlin.Long(0, 536870912)), new ULong(new Kotlin.Long(-1745923851, 1403857787)), new ULong(new Kotlin.Long(358271049, 1579021232)), new ULong(Kotlin.Long.fromInt(12744))]), listOf_0([new ULong(new Kotlin.Long(0, 1073741824)), new ULong(new Kotlin.Long(-279369324, 1153675987)), new ULong(new Kotlin.Long(-712256800, 757826784)), new ULong(Kotlin.Long.fromInt(127447))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1501274061, 799341639)), new ULong(new Kotlin.Long(1467366597, 1135816904)), new ULong(Kotlin.Long.fromInt(1274473))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(2127838722, 1550965449)), new ULong(new Kotlin.Long(1788764085, 620750803)), new ULong(Kotlin.Long.fromInt(12744735))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-196449260, 477268958)), new ULong(new Kotlin.Long(707771673, 1912540738)), new ULong(Kotlin.Long.fromInt(127447352))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1964492600, 477722293)), new ULong(new Kotlin.Long(-1512217860, 1945538197)), new ULong(Kotlin.Long.fromInt(1274473528))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1829910480, 482255639)), new ULong(new Kotlin.Long(2057690586, 128029144)), new ULong(new Kotlin.Long(-140166599, 2))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1119235616, 527589098)), new ULong(new Kotlin.Long(-897930618, 1280291444)), new ULong(new Kotlin.Long(-1401665990, 29))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1692545728, 980923686)), new ULong(new Kotlin.Long(-389371586, 2065496207)), new ULong(new Kotlin.Long(-1131758007, 296))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(254411904, 1219302274)), new ULong(new Kotlin.Long(401251440, 1327609247)), new ULong(new Kotlin.Long(1567321827, 2967))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1750848256, 1455604500)), new ULong(new Kotlin.Long(-282452891, 391190582)), new ULong(new Kotlin.Long(-1506650908, 29673))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-328613376, 1671143117)), new ULong(new Kotlin.Long(1470438392, 1764422181)), new ULong(new Kotlin.Long(2113360105, 296736))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1008833536, 1679045643)), new ULong(new Kotlin.Long(1819482039, 464352629)), new ULong(new Kotlin.Long(-341235422, 2967364))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1498400768, 1758070896)), new ULong(new Kotlin.Long(1014951213, 348558998)), new ULong(new Kotlin.Long(882613078, 29673649))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(2099105792, 400839779)), new ULong(new Kotlin.Long(1559577546, 1338106334)), new ULong(new Kotlin.Long(236196189, 296736492))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-483778560, 1860914146)), new ULong(new Kotlin.Long(-1584093723, 496161455)), new ULong(new Kotlin.Long(-1933005400, 819881272)), new ULong(Kotlin.Long.ONE)]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-542818304, 1429272284)), new ULong(new Kotlin.Long(1338931962, 666647260)), new ULong(new Kotlin.Long(2144782482, 1756361781)), new ULong(Kotlin.Long.fromInt(13))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1133215744, 1407820960)), new ULong(new Kotlin.Long(504417738, 224021659)), new ULong(new Kotlin.Long(-27011657, 383748630)), new ULong(Kotlin.Long.fromInt(138))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1552744448, 1193307719)), new ULong(new Kotlin.Long(749210090, 92732943)), new ULong(new Kotlin.Long(-270116569, 1690002661)), new ULong(Kotlin.Long.fromInt(1381))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1652424704, 1195658953)), new ULong(new Kotlin.Long(-1097833687, 927329431)), new ULong(new Kotlin.Long(1593801606, 1867641083)), new ULong(Kotlin.Long.fromInt(13817))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(655622144, 1219171296)), new ULong(new Kotlin.Long(1906565023, 683359725)), new ULong(new Kotlin.Long(-1241853120, 1496541649)), new ULong(Kotlin.Long.fromInt(138178))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-2033713152, 1454294721)), new ULong(new Kotlin.Long(1885781051, 391146310)), new ULong(new Kotlin.Long(466370691, 2080514609)), new ULong(Kotlin.Long.fromInt(1381786))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1137704960, 1658045327)), new ULong(new Kotlin.Long(1677941332, 1763979456)), new ULong(new Kotlin.Long(368739615, 1477793259)), new ULong(Kotlin.Long.fromInt(13817869))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1507852288, 1548067736)), new ULong(new Kotlin.Long(-400455857, 459925379)), new ULong(new Kotlin.Long(-607571138, 1893030702)), new ULong(Kotlin.Long.fromInt(138178696))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(2101346304, 448291830)), new ULong(new Kotlin.Long(290408733, 304286503)), new ULong(new Kotlin.Long(-1780744082, 1750437844)), new ULong(Kotlin.Long.fromInt(1381786968))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-461373440, 187951008)), new ULong(new Kotlin.Long(-1390879964, 895381382)), new ULong(new Kotlin.Long(-627571635, 324509261)), new ULong(new Kotlin.Long(932967800, 3))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-318767104, 1879510088)), new ULong(new Kotlin.Long(-1023897752, 363879234)), new ULong(new Kotlin.Long(-1980749050, 1097608970)), new ULong(new Kotlin.Long(739743409, 32))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1107296256, 1615231705)), new ULong(new Kotlin.Long(-1649042920, 1491308699)), new ULong(new Kotlin.Long(1667345981, 238671465)), new ULong(new Kotlin.Long(-1192500497, 321))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-1811939328, 1119931516)), new ULong(new Kotlin.Long(689439991, 2028185108)), new ULong(new Kotlin.Long(-506409368, 239231005)), new ULong(new Kotlin.Long(959896919, 3217))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-939524096, 461896925)), new ULong(new Kotlin.Long(-1695534677, 954498249)), new ULong(new Kotlin.Long(-769126375, 244826410)), new ULong(new Kotlin.Long(1009034599, 32172))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-805306368, 324001961)), new ULong(new Kotlin.Long(224522416, 955047904)), new ULong(new Kotlin.Long(898670846, 300780460)), new ULong(new Kotlin.Long(1500411399, 321722))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(536870912, 1092535970)), new ULong(new Kotlin.Long(-2049743135, 960544448)), new ULong(new Kotlin.Long(396773872, 860320954)), new ULong(new Kotlin.Long(2119212103, 3217223))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(1073741824, 187941461)), new ULong(new Kotlin.Long(977405135, 1015509893)), new ULong(new Kotlin.Long(-327228572, 13274948)), new ULong(new Kotlin.Long(-282715446, 32172234))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(-2147483648, 1879414612)), new ULong(new Kotlin.Long(1184116758, 1565164340)), new ULong(new Kotlin.Long(1022681580, 132749489)), new ULong(new Kotlin.Long(1467812836, 321722349))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(0, 1614276941)), new ULong(new Kotlin.Long(-1043734300, 619257866)), new ULong(new Kotlin.Long(1636881215, 1327494892)), new ULong(new Kotlin.Long(1793226472, 1069739845)), new ULong(Kotlin.Long.ONE)]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(0, 1110383874)), new ULong(new Kotlin.Long(-1847408401, 1897611371)), new ULong(new Kotlin.Long(-811057032, 390047035)), new ULong(new Kotlin.Long(752395542, 2107463862)), new ULong(Kotlin.Long.fromInt(14))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(0, 366420500)), new ULong(new Kotlin.Long(-1294214821, 1796244531)), new ULong(new Kotlin.Long(479364280, 1752986710)), new ULong(new Kotlin.Long(-1065979171, 1747285789)), new ULong(Kotlin.Long.fromInt(149))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(0, 1516721352)), new ULong(new Kotlin.Long(-57246321, 782576132)), new ULong(new Kotlin.Long(498675512, 349997917)), new ULong(new Kotlin.Long(-2069857110, 292988713)), new ULong(Kotlin.Long.fromInt(1498))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(0, 134827984)), new ULong(new Kotlin.Long(-572463203, 1383310385)), new ULong(new Kotlin.Long(691787827, 1352495523)), new ULong(new Kotlin.Long(776265381, 782403487)), new ULong(Kotlin.Long.fromInt(14981))]), listOf_0([new ULong(Kotlin.Long.ZERO), new ULong(new Kotlin.Long(0, 1348279840)), new ULong(new Kotlin.Long(-1429664734, 948201970)), new ULong(new Kotlin.Long(-1672056316, 640053343)), new ULong(new Kotlin.Long(-827280776, 1381583927)), new ULong(Kotlin.Long.fromInt(149813))])];
+ }
+ Object.defineProperty(BigInteger63LinkedListArithmetic.prototype, 'ZERO', {
+ get: function () {
+ return this.ZERO_v86p2c$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63LinkedListArithmetic.prototype, 'ONE', {
+ get: function () {
+ return this.ONE_a60uxu$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63LinkedListArithmetic.prototype, 'TWO', {
+ get: function () {
+ return this.TWO_a648sc$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63LinkedListArithmetic.prototype, 'TEN', {
+ get: function () {
+ return this.TEN_a63vez$_0;
+ }
+ });
+ Object.defineProperty(BigInteger63LinkedListArithmetic.prototype, 'basePowerOfTwo', {
+ get: function () {
+ return this.basePowerOfTwo_rggmq3$_0;
+ }
+ });
+ BigInteger63LinkedListArithmetic.prototype.numberOfLeadingZeroes_11rc$ = function (value) {
+ var x = value;
+ var y;
+ var n = 63;
+ y = new ULong(x.data.shiftRightUnsigned(32));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 32 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(16));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 16 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(8));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 8 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(4));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 4 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(2));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ n = n - 2 | 0;
+ x = y;
+ }
+ y = new ULong(x.data.shiftRightUnsigned(1));
+ if (!(y != null ? y.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ return n - 2 | 0;
+ }
+ return n - x.data.toInt() | 0;
+ };
+ BigInteger63LinkedListArithmetic.prototype.bitLength_11rb$ = function (value) {
+ var mostSignificant = value.get_za3lpa$(value.size - 1 | 0);
+ return this.bitLength_mpgczg$(mostSignificant) + ((value.size - 1 | 0) * 63 | 0) | 0;
+ };
+ BigInteger63LinkedListArithmetic.prototype.bitLength_mpgczg$ = function (value) {
+ return 63 - this.numberOfLeadingZeroes_11rc$(value) | 0;
+ };
+ BigInteger63LinkedListArithmetic.prototype.trailingZeroBits_mpgczg$ = function (value) {
+ var $this = new ULong(value.data.inv());
+ var other = this.baseMask;
+ return 63 - this.bitLength_mpgczg$(new ULong($this.data.and(other.data))) | 0;
+ };
+ BigInteger63LinkedListArithmetic.prototype.trailingZeroBits_11rb$ = function (value) {
+ throw new NotImplementedError_init();
+ };
+ BigInteger63LinkedListArithmetic.prototype.removeLeadingZeroes_nz1gkn$ = function (bigInteger) {
+ var indexOfLast$result;
+ indexOfLast$break: do {
+ var iterator = bigInteger.listIterator_za3lpa$(bigInteger.size);
+ while (iterator.hasPrevious()) {
+ var it = iterator.previous();
+ if (!(it != null ? it.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ indexOfLast$result = iterator.nextIndex();
+ break indexOfLast$break;
+ }
+ }
+ indexOfLast$result = -1;
+ }
+ while (false);
+ var firstEmpty = indexOfLast$result + 1 | 0;
+ if (firstEmpty === -1 || firstEmpty === 0) {
+ return this.ZERO;
+ }
+ return bigInteger.subList_vux9f0$(0, firstEmpty);
+ };
+ BigInteger63LinkedListArithmetic.prototype.shiftLeft_dpg1yx$ = function (operand, places) {
+ var tmp$;
+ if (equals(operand, this.ZERO)) {
+ return operand;
+ }
+ if (operand.isEmpty() || places === 0) {
+ return operand;
+ }
+ var originalSize = operand.size;
+ var leadingZeroes = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ var shiftWords = places / this.basePowerOfTwo | 0;
+ var shiftBits = places % this.basePowerOfTwo;
+ if (shiftBits > leadingZeroes) {
+ tmp$ = shiftWords + 1 | 0;
+ }
+ else {
+ tmp$ = shiftWords;
+ }
+ var wordsNeeded = tmp$;
+ if (shiftBits === 0) {
+ var size = operand.size + wordsNeeded | 0;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$_0 = list.add_11rb$;
+ var init$result;
+ if (0 <= index && index < shiftWords) {
+ init$result = new ULong(Kotlin.Long.ZERO);
+ }
+ else {
+ init$result = operand.get_za3lpa$(index - shiftWords | 0);
+ }
+ tmp$_0.call(list, init$result);
+ }
+ return list;
+ }
+ var size_0 = operand.size + wordsNeeded | 0;
+ var list_0 = ArrayList_init_0(size_0);
+ for (var index_0 = 0; index_0 < size_0; index_0++) {
+ var tmp$_1 = list_0.add_11rb$;
+ var init$result_0;
+ if (0 <= index_0 && index_0 < shiftWords) {
+ init$result_0 = new ULong(Kotlin.Long.ZERO);
+ }
+ else if (index_0 === shiftWords) {
+ var $this = new ULong(operand.get_za3lpa$(index_0 - shiftWords | 0).data.shiftLeft(shiftBits));
+ var other = this.baseMask;
+ init$result_0 = new ULong($this.data.and(other.data));
+ }
+ else if ((shiftWords + 1 | 0) <= index_0 && index_0 < (originalSize + shiftWords | 0)) {
+ var $this_0 = new ULong(operand.get_za3lpa$(index_0 - shiftWords | 0).data.shiftLeft(shiftBits));
+ var other_0 = this.baseMask;
+ var tmp$_2 = new ULong($this_0.data.and(other_0.data));
+ var $this_1 = operand.get_za3lpa$(index_0 - shiftWords - 1 | 0);
+ var bitCount = this.basePowerOfTwo - shiftBits | 0;
+ var other_1 = new ULong($this_1.data.shiftRightUnsigned(bitCount));
+ init$result_0 = new ULong(tmp$_2.data.or(other_1.data));
+ }
+ else if (index_0 === (originalSize + wordsNeeded - 1 | 0)) {
+ var $this_2 = operand.get_za3lpa$(index_0 - wordsNeeded | 0);
+ var bitCount_0 = this.basePowerOfTwo - shiftBits | 0;
+ init$result_0 = new ULong($this_2.data.shiftRightUnsigned(bitCount_0));
+ }
+ else {
+ throw RuntimeException_init('Invalid case ' + index_0);
+ }
+ tmp$_1.call(list_0, init$result_0);
+ }
+ return list_0;
+ };
+ BigInteger63LinkedListArithmetic.prototype.shiftRight_dpg1yx$ = function (operand, places) {
+ if (operand.isEmpty() || places === 0) {
+ return operand;
+ }
+ var shiftBits = places % this.basePowerOfTwo;
+ var wordsToDiscard = places / this.basePowerOfTwo | 0;
+ if (wordsToDiscard >= operand.size) {
+ return this.ZERO;
+ }
+ if (shiftBits === 0) {
+ operand.subList_vux9f0$(operand.size - wordsToDiscard | 0, operand.size);
+ }
+ if (operand.size > 1 && (operand.size - wordsToDiscard | 0) === 1) {
+ return listOf(new ULong(operand.get_za3lpa$(operand.size - 1 | 0).data.shiftRightUnsigned(shiftBits)));
+ }
+ var size = operand.size - wordsToDiscard | 0;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$ = list.add_11rb$;
+ var init$result;
+ var tmp$_0;
+ tmp$_0 = operand.size - 1 - wordsToDiscard | 0;
+ if (0 <= index && index < tmp$_0) {
+ var tmp$_1 = new ULong(operand.get_za3lpa$(index + wordsToDiscard | 0).data.shiftRightUnsigned(shiftBits));
+ var $this = operand.get_za3lpa$(index + wordsToDiscard + 1 | 0);
+ var bitCount = this.basePowerOfTwo - shiftBits | 0;
+ var $this_0 = new ULong($this.data.shiftLeft(bitCount));
+ var other = this.baseMask;
+ var other_0 = new ULong($this_0.data.and(other.data));
+ init$result = new ULong(tmp$_1.data.or(other_0.data));
+ }
+ else if (index === (operand.size - 1 - wordsToDiscard | 0)) {
+ init$result = new ULong(operand.get_za3lpa$(index + wordsToDiscard | 0).data.shiftRightUnsigned(shiftBits));
+ }
+ else {
+ throw RuntimeException_init('Invalid case ' + index);
+ }
+ tmp$.call(list, init$result);
+ }
+ var result = list;
+ return this.removeLeadingZeroes_nz1gkn$(result);
+ };
+ BigInteger63LinkedListArithmetic.prototype.compare_xwzc9q$ = function (first, second) {
+ var tmp$;
+ if (first.size > second.size) {
+ return 1;
+ }
+ if (second.size > first.size) {
+ return -1;
+ }
+ var counter = first.size - 1 | 0;
+ var firstIsLarger = false;
+ var bothAreEqual = true;
+ while (counter >= 0) {
+ var $this = first.get_za3lpa$(counter);
+ var other = second.get_za3lpa$(counter);
+ if (ulongCompare($this.data, other.data) > 0) {
+ firstIsLarger = true;
+ bothAreEqual = false;
+ break;
+ }
+ var $this_0 = first.get_za3lpa$(counter);
+ var other_0 = second.get_za3lpa$(counter);
+ if (ulongCompare($this_0.data, other_0.data) < 0) {
+ firstIsLarger = false;
+ bothAreEqual = false;
+ break;
+ }
+ counter = counter - 1 | 0;
+ }
+ if (bothAreEqual) {
+ return 0;
+ }
+ if (firstIsLarger) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = -1;
+ }
+ return tmp$;
+ };
+ BigInteger63LinkedListArithmetic.prototype.add_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
+ if (first.size === 1 && ((tmp$ = first.get_za3lpa$(0)) != null ? tmp$.equals(new ULong(Kotlin.Long.ZERO)) : null))
+ return second;
+ if (second.size === 1 && ((tmp$_0 = second.get_za3lpa$(0)) != null ? tmp$_0.equals(new ULong(Kotlin.Long.ZERO)) : null))
+ return first;
+ if (first.size > second.size) {
+ tmp$_1 = new Quadruple(first.size, second.size, first, second);
+ }
+ else {
+ tmp$_1 = new Quadruple(second.size, first.size, second, first);
+ }
+ var tmp$_4 = tmp$_1;
+ var maxLength = tmp$_4.component1()
+ , minLength = tmp$_4.component2()
+ , largerData = tmp$_4.component3()
+ , smallerData = tmp$_4.component4();
+ var size = maxLength + 1 | 0;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ list.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ var result = list;
+ var i = 0;
+ var sum = new ULong(Kotlin.Long.ZERO);
+ while (i < minLength) {
+ var $this = sum;
+ var other = largerData.get_za3lpa$(i);
+ var $this_0 = new ULong($this.data.add(other.data));
+ var other_0 = smallerData.get_za3lpa$(i);
+ sum = new ULong($this_0.data.add(other_0.data));
+ var tmp$_5 = i;
+ var $this_1 = sum;
+ var other_1 = this.baseMask;
+ result.set_wxm5ur$(tmp$_5, new ULong($this_1.data.and(other_1.data)));
+ sum = new ULong(sum.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (true) {
+ if (sum != null ? sum.equals(new ULong(Kotlin.Long.ZERO)) : null) {
+ while (i < maxLength) {
+ result.set_wxm5ur$(i, largerData.get_za3lpa$(i));
+ i = i + 1 | 0;
+ }
+ if ((tmp$_2 = result.get_za3lpa$(result.size - 1 | 0)) != null ? tmp$_2.equals(new ULong(Kotlin.Long.ZERO)) : null) {
+ tmp$_3 = result.subList_vux9f0$(0, result.size - 1 | 0);
+ }
+ else {
+ tmp$_3 = result;
+ }
+ var final = tmp$_3;
+ return this.removeLeadingZeroes_nz1gkn$(final);
+ }
+ if (i === maxLength) {
+ result.set_wxm5ur$(maxLength, sum);
+ return this.removeLeadingZeroes_nz1gkn$(result);
+ }
+ var $this_2 = sum;
+ var other_2 = largerData.get_za3lpa$(i);
+ sum = new ULong($this_2.data.add(other_2.data));
+ var tmp$_6 = i;
+ var $this_3 = sum;
+ var other_3 = this.baseMask;
+ result.set_wxm5ur$(tmp$_6, new ULong($this_3.data.and(other_3.data)));
+ sum = new ULong(sum.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ };
+ BigInteger63LinkedListArithmetic.prototype.substract_xwzc9q$ = function (first, second) {
+ var tmp$, tmp$_0, tmp$_1, tmp$_2;
+ var firstPrepared = this.removeLeadingZeroes_nz1gkn$(first);
+ var secondPrepared = this.removeLeadingZeroes_nz1gkn$(second);
+ var comparison = this.compare_xwzc9q$(firstPrepared, secondPrepared);
+ var firstIsLarger = comparison === 1;
+ if (comparison === 0)
+ return this.ZERO;
+ if (second.size === 1 && ((tmp$ = second.get_za3lpa$(0)) != null ? tmp$.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ return first;
+ }
+ if (!firstIsLarger) {
+ throw RuntimeException_init('subtract result less than zero');
+ }
+ if (firstIsLarger) {
+ tmp$_0 = new Quadruple(firstPrepared.size, secondPrepared.size, firstPrepared, secondPrepared);
+ }
+ else {
+ tmp$_0 = new Quadruple(secondPrepared.size, firstPrepared.size, secondPrepared, firstPrepared);
+ }
+ var tmp$_3 = tmp$_0;
+ var largerLength = tmp$_3.component1()
+ , smallerLength = tmp$_3.component2()
+ , largerData = tmp$_3.component3()
+ , smallerData = tmp$_3.component4();
+ var size = largerLength + 1 | 0;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ list.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ var result = list;
+ var i = 0;
+ var diff = new ULong(Kotlin.Long.ZERO);
+ while (i < smallerLength) {
+ var $this = largerData.get_za3lpa$(i);
+ var other = smallerData.get_za3lpa$(i);
+ var $this_0 = new ULong($this.data.subtract(other.data));
+ var other_0 = diff;
+ diff = new ULong($this_0.data.subtract(other_0.data));
+ var $this_1 = diff;
+ var other_1 = this.overflowMask;
+ if ((tmp$_1 = new ULong((new ULong($this_1.data.and(other_1.data))).data.shiftRightUnsigned(63))) != null ? tmp$_1.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ var tmp$_4 = i;
+ var $this_2 = diff;
+ var other_2 = this.baseMask;
+ result.set_wxm5ur$(tmp$_4, new ULong($this_2.data.and(other_2.data)));
+ }
+ else {
+ var tmp$_5 = i;
+ var $this_3 = diff;
+ var other_3 = this.baseMask;
+ result.set_wxm5ur$(tmp$_5, new ULong($this_3.data.and(other_3.data)));
+ }
+ diff = new ULong(diff.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (!(diff != null ? diff.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ var $this_4 = largerData.get_za3lpa$(i);
+ var other_4 = diff;
+ diff = new ULong($this_4.data.subtract(other_4.data));
+ var $this_5 = diff;
+ var other_5 = this.overflowMask;
+ if ((tmp$_2 = new ULong((new ULong($this_5.data.and(other_5.data))).data.shiftRightUnsigned(63))) != null ? tmp$_2.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ var tmp$_6 = i;
+ var $this_6 = diff;
+ var other_6 = this.baseMask;
+ result.set_wxm5ur$(tmp$_6, new ULong($this_6.data.and(other_6.data)));
+ }
+ else {
+ var tmp$_7 = i;
+ var $this_7 = diff;
+ var other_7 = this.baseMask;
+ result.set_wxm5ur$(tmp$_7, new ULong($this_7.data.and(other_7.data)));
+ diff = new ULong(Kotlin.Long.ZERO);
+ }
+ diff = new ULong(diff.data.shiftRightUnsigned(63));
+ i = i + 1 | 0;
+ }
+ while (i < largerLength) {
+ result.set_wxm5ur$(i, largerData.get_za3lpa$(i));
+ i = i + 1 | 0;
+ }
+ var destination = ArrayList_init();
+ var tmp$_8;
+ tmp$_8 = result.iterator();
+ while (tmp$_8.hasNext()) {
+ var element = tmp$_8.next();
+ if (element != null ? element.equals(new ULong(Kotlin.Long.ZERO)) : null)
+ destination.add_11rb$(element);
+ }
+ if (destination.isEmpty()) {
+ var list_0 = ArrayList_init_0(0);
+ for (var index_0 = 0; index_0 < 0; index_0++) {
+ list_0.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ return list_0;
+ }
+ return this.removeLeadingZeroes_nz1gkn$(result);
+ };
+ BigInteger63LinkedListArithmetic.prototype.multiply_xwzc9q$ = function (first, second) {
+ var resultArray = {v: emptyList()};
+ var tmp$, tmp$_0;
+ var index = 0;
+ tmp$ = second.iterator();
+ while (tmp$.hasNext()) {
+ var item = tmp$.next();
+ var index_0 = checkIndexOverflow((tmp$_0 = index, index = tmp$_0 + 1 | 0, tmp$_0));
+ resultArray.v = this.plus_g6oxea$(resultArray.v, this.shl_1xumrx$(this.multiply_26niaf$(first, item), Kotlin.imul(index_0, this.basePowerOfTwo)));
+ }
+ return this.removeLeadingZeroes_nz1gkn$(resultArray.v);
+ };
+ BigInteger63LinkedListArithmetic.prototype.multiply_26niaf$ = function (first, second) {
+ var other = this.lowMask;
+ var secondLow = new ULong(second.data.and(other.data));
+ var secondHigh = new ULong(second.data.shiftRightUnsigned(32));
+ var size = first.size + 1 | 0;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ list.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ var result = list;
+ var carryIntoNextRound = new ULong(Kotlin.Long.ZERO);
+ var i = 0;
+ var j = 0;
+ while (i < first.size) {
+ var $this = first.get_za3lpa$(i);
+ var other_0 = this.lowMask;
+ var firstLow = new ULong($this.data.and(other_0.data));
+ var firstHigh = new ULong(first.get_za3lpa$(i).data.shiftRightUnsigned(32));
+ i = i + 1 | 0;
+ var lowerProduct = new ULong(firstLow.data.multiply(secondLow.data));
+ var lowerCarry = new ULong(lowerProduct.data.shiftRightUnsigned(63));
+ var tmp$ = carryIntoNextRound;
+ var other_1 = this.baseMask;
+ var other_2 = new ULong(lowerProduct.data.and(other_1.data));
+ var lowResult = new ULong(tmp$.data.add(other_2.data));
+ var tmp$_0 = lowerCarry;
+ var other_3 = new ULong(lowResult.data.shiftRightUnsigned(63));
+ lowerCarry = new ULong(tmp$_0.data.add(other_3.data));
+ var $this_0 = lowResult;
+ var other_4 = this.baseMask;
+ lowResult = new ULong($this_0.data.and(other_4.data));
+ var tmp$_1 = new ULong(firstLow.data.multiply(secondHigh.data));
+ var other_5 = new ULong(secondLow.data.multiply(firstHigh.data));
+ var middleProduct = new ULong(tmp$_1.data.add(other_5.data));
+ var middleCarry = lowerCarry;
+ var tmp$_2 = middleCarry;
+ var other_6 = new ULong(middleProduct.data.shiftRightUnsigned(31));
+ middleCarry = new ULong(tmp$_2.data.add(other_6.data));
+ var tmp$_3 = lowResult;
+ var $this_1 = new ULong(middleProduct.data.shiftLeft(32));
+ var other_7 = this.baseMask;
+ var other_8 = new ULong($this_1.data.and(other_7.data));
+ lowResult = new ULong(tmp$_3.data.add(other_8.data));
+ var tmp$_4 = middleCarry;
+ var other_9 = new ULong(lowResult.data.shiftRightUnsigned(63));
+ middleCarry = new ULong(tmp$_4.data.add(other_9.data));
+ var tmp$_5 = j;
+ var $this_2 = lowResult;
+ var other_10 = this.baseMask;
+ result.set_wxm5ur$(tmp$_5, new ULong($this_2.data.and(other_10.data)));
+ var highResult = middleCarry;
+ var higherProduct = new ULong((new ULong(firstHigh.data.multiply(secondHigh.data))).data.shiftLeft(1));
+ highResult = new ULong(highResult.data.add(higherProduct.data));
+ carryIntoNextRound = highResult;
+ j = j + 1 | 0;
+ }
+ if (!(carryIntoNextRound != null ? carryIntoNextRound.equals(new ULong(Kotlin.Long.ZERO)) : null)) {
+ result.set_wxm5ur$(j, carryIntoNextRound);
+ }
+ return this.removeLeadingZeroes_nz1gkn$(result);
+ };
+ BigInteger63LinkedListArithmetic.prototype.multiply_jpm79w$ = function (first, second) {
+ var other = this.lowMask;
+ var firstLow = new ULong(first.data.and(other.data));
+ var firstHigh = new ULong(first.data.shiftRightUnsigned(32));
+ var other_0 = this.lowMask;
+ var secondLow = new ULong(second.data.and(other_0.data));
+ var secondHigh = new ULong(second.data.shiftRightUnsigned(32));
+ var lowerProduct = new ULong(firstLow.data.multiply(secondLow.data));
+ var lowCarry = new ULong(lowerProduct.data.shiftRightUnsigned(63));
+ var other_1 = this.baseMask;
+ var lowResult = new ULong(lowerProduct.data.and(other_1.data));
+ var tmp$ = new ULong(firstLow.data.multiply(secondHigh.data));
+ var other_2 = new ULong(secondLow.data.multiply(firstHigh.data));
+ var middleProduct = new ULong(tmp$.data.add(other_2.data));
+ var middleCarry = lowCarry;
+ var tmp$_0 = middleCarry;
+ var other_3 = new ULong(middleProduct.data.shiftRightUnsigned(31));
+ middleCarry = new ULong(tmp$_0.data.add(other_3.data));
+ var tmp$_1 = lowResult;
+ var $this = new ULong(middleProduct.data.shiftLeft(32));
+ var other_4 = this.baseMask;
+ var other_5 = new ULong($this.data.and(other_4.data));
+ lowResult = new ULong(tmp$_1.data.add(other_5.data));
+ var tmp$_2 = middleCarry;
+ var other_6 = new ULong(lowResult.data.shiftRightUnsigned(63));
+ middleCarry = new ULong(tmp$_2.data.add(other_6.data));
+ var highResult = middleCarry;
+ var higherProduct = new ULong((new ULong(firstHigh.data.multiply(secondHigh.data))).data.shiftLeft(1));
+ highResult = new ULong(highResult.data.add(higherProduct.data));
+ var $this_0 = lowResult;
+ var other_7 = this.baseMask;
+ return this.removeLeadingZeroes_nz1gkn$(listOf_0([new ULong($this_0.data.and(other_7.data)), highResult]));
+ };
+ BigInteger63LinkedListArithmetic.prototype.pow_19wkf8$ = function (base, exponent) {
+ var tmp$;
+ if (equals(exponent, L0)) {
+ return this.ONE;
+ }
+ if (equals(exponent, L1)) {
+ return base;
+ }
+ if (base.size === 1 && ((tmp$ = base.get_za3lpa$(0)) != null ? tmp$.equals(new ULong(Kotlin.Long.fromInt(10))) : null) && exponent.toNumber() < this.powersOf10.length) {
+ return this.powersOf10[exponent.toInt()];
+ }
+ var $receiver = until_0(0, exponent);
+ var tmp$_0;
+ var accumulator = this.ONE;
+ tmp$_0 = $receiver.iterator();
+ while (tmp$_0.hasNext()) {
+ var element = tmp$_0.next();
+ accumulator = this.times_g6oxea$(accumulator, base);
+ }
+ return accumulator;
+ };
+ BigInteger63LinkedListArithmetic.prototype.normalize_vvootw$ = function (dividend, divisor) {
+ var divisorSize = divisor.size;
+ var normalizationShift = this.numberOfLeadingZeroes_11rc$(divisor.get_za3lpa$(divisorSize - 1 | 0));
+ var divisorNormalized = this.shl_1xumrx$(divisor, normalizationShift);
+ var dividendNormalized = this.shl_1xumrx$(dividend, normalizationShift);
+ return new Triple(dividendNormalized, divisorNormalized, normalizationShift);
+ };
+ BigInteger63LinkedListArithmetic.prototype.normalize_nz1gkn$ = function (operand) {
+ var normalizationShift = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ return new Pair(this.shl_1xumrx$(operand, normalizationShift), normalizationShift);
+ };
+ BigInteger63LinkedListArithmetic.prototype.denormalize_vxlaex$ = function (remainderNormalized, normalizationShift) {
+ var remainder = this.shr_1xumrx$(remainderNormalized, normalizationShift);
+ return remainder;
+ };
+ BigInteger63LinkedListArithmetic.prototype.baseDivide_vvootw$ = function (unnormalizedDividend, unnormalizedDivisor) {
+ var tmp$, tmp$_0;
+ if (this.compareTo_g6oxea$(unnormalizedDivisor, unnormalizedDividend) > 0) {
+ return new Pair(this.ZERO, unnormalizedDividend);
+ }
+ if (unnormalizedDivisor.size === 1 && unnormalizedDividend.size === 1) {
+ return new Pair(this.removeLeadingZeroes_nz1gkn$(listOf(ulongDivide(unnormalizedDividend.get_za3lpa$(0), unnormalizedDivisor.get_za3lpa$(0)))), this.removeLeadingZeroes_nz1gkn$(listOf(ulongRemainder(unnormalizedDividend.get_za3lpa$(0), unnormalizedDivisor.get_za3lpa$(0)))));
+ }
+ var bitPrecision = this.bitLength_11rb$(unnormalizedDividend) - this.bitLength_11rb$(unnormalizedDivisor) | 0;
+ if (bitPrecision === 0) {
+ return new Pair(this.ONE, this.minus_g6oxea$(unnormalizedDividend, unnormalizedDivisor));
+ }
+ var tmp$_1 = this.normalize_vvootw$(unnormalizedDividend, unnormalizedDivisor);
+ var dividend = tmp$_1.component1()
+ , divisor = tmp$_1.component2()
+ , normalizationShift = tmp$_1.component3();
+ var dividendSize = dividend.size;
+ var divisorSize = divisor.size;
+ var wordPrecision = dividendSize - divisorSize | 0;
+ var qjhat;
+ var reconstructedQuotient;
+ var list = ArrayList_init_0(wordPrecision);
+ for (var index = 0; index < wordPrecision; index++) {
+ list.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ var quotient = list;
+ var divisorTimesBaseToPowerOfM = this.shl_1xumrx$(divisor, Kotlin.imul(wordPrecision, this.basePowerOfTwo));
+ if (this.compareTo_g6oxea$(dividend, divisorTimesBaseToPowerOfM) >= 0) {
+ var size = wordPrecision + 1 | 0;
+ var list_0 = ArrayList_init_0(size);
+ for (var index_0 = 0; index_0 < size; index_0++) {
+ list_0.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ quotient = list_0;
+ quotient.set_wxm5ur$(wordPrecision, new ULong(Kotlin.Long.ONE));
+ dividend = this.minus_g6oxea$(dividend, divisorTimesBaseToPowerOfM);
+ }
+ for (var j = wordPrecision - 1 | 0; j >= 0; j--) {
+ if ((divisorSize + j | 0) < dividend.size) {
+ tmp$ = this.plus_hzscfj$(this.shl_1xumrx$(listOf(dividend.get_za3lpa$(divisorSize + j | 0)), this.basePowerOfTwo), dividend.get_za3lpa$(divisorSize + j - 1 | 0));
+ }
+ else {
+ if ((divisorSize + j | 0) === dividend.size) {
+ tmp$ = listOf(dividend.get_za3lpa$(divisorSize + j - 1 | 0));
+ }
+ else {
+ tmp$ = this.ZERO;
+ }
+ }
+ var twoDigit = tmp$;
+ var convertedResult = BigInteger32Arithmetic_getInstance().divide_xwzc9q$(this.to32Bit_9i92ol$(twoDigit), this.to32Bit_9i92ol$(listOf(divisor.get_za3lpa$(divisorSize - 1 | 0))));
+ qjhat = this.from32Bit_j9z43k$(convertedResult.first);
+ var $this = this.baseMask;
+ var other = new ULong(Kotlin.Long.ONE);
+ if (this.compareTo_hzscfj$(qjhat, new ULong($this.data.subtract(other.data))) < 0) {
+ tmp$_0 = qjhat.get_za3lpa$(0);
+ }
+ else {
+ tmp$_0 = this.baseMask;
+ }
+ quotient.set_wxm5ur$(j, tmp$_0);
+ reconstructedQuotient = this.shl_1xumrx$(this.times_hzscfj$(divisor, quotient.get_za3lpa$(j)), Kotlin.imul(j, this.basePowerOfTwo));
+ while (this.compareTo_g6oxea$(reconstructedQuotient, dividend) > 0) {
+ var tmp$_2 = quotient;
+ var $this_0 = quotient.get_za3lpa$(j);
+ var other_0 = new UInt(1);
+ tmp$_2.set_wxm5ur$(j, new ULong($this_0.data.subtract((new ULong(Kotlin.Long.fromInt(other_0.data).and(L4294967295))).data)));
+ reconstructedQuotient = this.shl_1xumrx$(this.times_hzscfj$(divisor, quotient.get_za3lpa$(j)), Kotlin.imul(j, this.basePowerOfTwo));
+ }
+ dividend = this.minus_g6oxea$(dividend, reconstructedQuotient);
+ }
+ while (this.compareTo_g6oxea$(dividend, divisor) >= 0) {
+ quotient = toMutableList(this.plus_hzscfj$(quotient, new ULong(Kotlin.Long.ONE)));
+ dividend = this.minus_g6oxea$(dividend, divisor);
+ }
+ var denormRemainder = this.denormalize_vxlaex$(dividend, normalizationShift);
+ return new Pair(this.removeLeadingZeroes_nz1gkn$(quotient), denormRemainder);
+ };
+ BigInteger63LinkedListArithmetic.prototype.convertTo64BitRepresentation_nz1gkn$ = function (operand) {
+ var tmp$;
+ if (equals(operand, this.ZERO))
+ return this.ZERO;
+ var length = this.bitLength_11rb$(operand);
+ if (length % 64 === 0) {
+ tmp$ = length / 64 | 0;
+ }
+ else {
+ tmp$ = (length / 64 | 0) + 1 | 0;
+ }
+ var requiredLength = tmp$;
+ var wordStep;
+ var shiftAmount;
+ var list = ArrayList_init_0(requiredLength);
+ for (var index = 0; index < requiredLength; index++) {
+ list.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ var result = list;
+ for (var i = 0; i < requiredLength; i++) {
+ wordStep = i / 63 | 0;
+ shiftAmount = i % 63;
+ if ((i + wordStep + 1 | 0) < operand.size) {
+ var tmp$_0 = new ULong(operand.get_za3lpa$(i + wordStep | 0).data.shiftRightUnsigned(shiftAmount));
+ var $this = operand.get_za3lpa$(i + wordStep + 1 | 0);
+ var bitCount = 63 - shiftAmount | 0;
+ var other = new ULong($this.data.shiftLeft(bitCount));
+ result.set_wxm5ur$(i, new ULong(tmp$_0.data.or(other.data)));
+ }
+ else {
+ result.set_wxm5ur$(i, new ULong(operand.get_za3lpa$(i + wordStep | 0).data.shiftRightUnsigned(shiftAmount)));
+ }
+ }
+ return result;
+ };
+ BigInteger63LinkedListArithmetic.prototype.convertTo32BitRepresentation_nz1gkn$ = function (operand) {
+ var tmp$;
+ var power64Representation = this.convertTo64BitRepresentation_nz1gkn$(operand);
+ var result = UIntArray_init(power64Representation.size * 2 | 0);
+ tmp$ = power64Representation.size;
+ for (var i = 0; i < tmp$; i++) {
+ var tmp$_0 = 2 * i | 0;
+ var tmp$_1 = power64Representation.get_za3lpa$(i);
+ var $this = BigInteger32Arithmetic_getInstance().base;
+ var other = new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295));
+ result.set_6sqrdv$(tmp$_0, new UInt((new ULong(tmp$_1.data.and(other.data))).data.toInt()));
+ result.set_6sqrdv$((2 * i | 0) + 1 | 0, new UInt((new ULong(power64Representation.get_za3lpa$(i).data.shiftRightUnsigned(32))).data.toInt()));
+ }
+ return BigInteger32Arithmetic_getInstance().removeLeadingZeroes_rsvixa$(result);
+ };
+ BigInteger63LinkedListArithmetic.prototype.convertFrom32BitRepresentation_rsvixa$ = function (operand) {
+ var tmp$;
+ if (operand.size === 0) {
+ return this.ZERO;
+ }
+ if (operand.size === 1) {
+ var $this = operand.get_za3lpa$(0);
+ return listOf(new ULong(Kotlin.Long.fromInt($this.data).and(L4294967295)));
+ }
+ var length = BigInteger32Arithmetic_getInstance().bitLength_11rb$(operand);
+ if (length % 63 === 0) {
+ tmp$ = length / 63 | 0;
+ }
+ else {
+ tmp$ = (length / 63 | 0) + 1 | 0;
+ }
+ var requiredLength = tmp$;
+ var list = ArrayList_init_0(requiredLength);
+ for (var index = 0; index < requiredLength; index++) {
+ list.add_11rb$(new ULong(Kotlin.Long.ZERO));
+ }
+ var result = list;
+ var skipWordCount;
+ for (var i = 0; i < requiredLength; i++) {
+ skipWordCount = i / 32 | 0;
+ var shiftAmount = i % 32;
+ var position = (i * 2 | 0) - skipWordCount | 0;
+ if (i === 0) {
+ var $this_0 = operand.get_za3lpa$(i * 2 | 0);
+ var tmp$_0 = new ULong(Kotlin.Long.fromInt($this_0.data).and(L4294967295));
+ var $this_1 = operand.get_za3lpa$((i * 2 | 0) + 1 | 0);
+ var $this_2 = new ULong((new ULong(Kotlin.Long.fromInt($this_1.data).and(L4294967295))).data.shiftLeft(32));
+ var other = this.highMask;
+ var other_0 = new ULong($this_2.data.and(other.data));
+ result.set_wxm5ur$(i, new ULong(tmp$_0.data.or(other_0.data)));
+ }
+ else if (1 <= i && i < (requiredLength - 1 | 0)) {
+ var $this_3 = operand.get_za3lpa$(position - 1 | 0);
+ var $this_4 = new ULong(Kotlin.Long.fromInt($this_3.data).and(L4294967295));
+ var bitCount = 32 - shiftAmount | 0;
+ var tmp$_1 = new ULong($this_4.data.shiftRightUnsigned(bitCount));
+ var $this_5 = operand.get_za3lpa$(position);
+ var other_1 = new ULong((new ULong(Kotlin.Long.fromInt($this_5.data).and(L4294967295))).data.shiftLeft(shiftAmount));
+ var tmp$_2 = new ULong(tmp$_1.data.or(other_1.data));
+ var $this_6 = operand.get_za3lpa$(position + 1 | 0);
+ var $this_7 = new ULong(Kotlin.Long.fromInt($this_6.data).and(L4294967295));
+ var bitCount_0 = 32 + shiftAmount | 0;
+ var $this_8 = new ULong($this_7.data.shiftLeft(bitCount_0));
+ var other_2 = this.highMask;
+ var other_3 = new ULong($this_8.data.and(other_2.data));
+ result.set_wxm5ur$(i, new ULong(tmp$_2.data.or(other_3.data)));
+ }
+ else if (i === (requiredLength - 1 | 0))
+ if (position < operand.size) {
+ var $this_9 = operand.get_za3lpa$(position - 1 | 0);
+ var $this_10 = new ULong(Kotlin.Long.fromInt($this_9.data).and(L4294967295));
+ var bitCount_1 = 32 - shiftAmount | 0;
+ var tmp$_3 = new ULong($this_10.data.shiftRightUnsigned(bitCount_1));
+ var $this_11 = operand.get_za3lpa$(position);
+ var other_4 = new ULong((new ULong(Kotlin.Long.fromInt($this_11.data).and(L4294967295))).data.shiftLeft(shiftAmount));
+ result.set_wxm5ur$(i, new ULong(tmp$_3.data.or(other_4.data)));
+ }
+ else {
+ var $this_12 = operand.get_za3lpa$(position - 1 | 0);
+ var $this_13 = new ULong(Kotlin.Long.fromInt($this_12.data).and(L4294967295));
+ var bitCount_2 = 32 - shiftAmount | 0;
+ result.set_wxm5ur$(i, new ULong($this_13.data.shiftRightUnsigned(bitCount_2)));
+ }
+ }
+ return result;
+ };
+ BigInteger63LinkedListArithmetic.prototype.divide_xwzc9q$ = function (first, second) {
+ return this.baseDivide_vvootw$(first, second);
+ };
+ BigInteger63LinkedListArithmetic.prototype.reciprocal_11rb$ = function (operand) {
+ return this.d1ReciprocalRecursiveWordVersion_nz1gkn$(operand);
+ };
+ BigInteger63LinkedListArithmetic.prototype.d1ReciprocalRecursiveWordVersion_nz1gkn$ = function (a) {
+ var tmp$, tmp$_0;
+ var n = a.size - 1 | 0;
+ if (n <= 2) {
+ if (n === 0) {
+ tmp$ = 1;
+ }
+ else {
+ tmp$ = n;
+ }
+ var corrected = tmp$;
+ var rhoPowered = this.shl_1xumrx$(this.ONE, Kotlin.imul(corrected * 2 | 0, BigInteger63Arithmetic_getInstance().wordSizeInBits));
+ var x = this.div_g6oxea$(rhoPowered, a);
+ var r = this.minus_g6oxea$(rhoPowered, this.times_g6oxea$(x, a));
+ return new Pair(x, r);
+ }
+ var x_0 = (n - 1 | 0) / 2;
+ var l = numberToInt(Math_0.floor(x_0));
+ var h = n - l | 0;
+ var ah = a.subList_vux9f0$(a.size - h - 1 | 0, a.size);
+ var al = a.subList_vux9f0$(0, l);
+ var tmp$_1 = this.d1ReciprocalRecursiveWordVersion_nz1gkn$(ah);
+ var xh = tmp$_1.component1()
+ , rh = tmp$_1.component2();
+ var s = this.times_g6oxea$(al, xh);
+ var rhRhoL = this.shl_1xumrx$(rh, Kotlin.imul(l, BigInteger63Arithmetic_getInstance().wordSizeInBits));
+ if (this.compareTo_g6oxea$(rhRhoL, s) >= 0) {
+ tmp$_0 = this.minus_g6oxea$(rhRhoL, s);
+ }
+ else {
+ xh = minus(xh, BigInteger63Arithmetic_getInstance().ONE);
+ tmp$_0 = this.minus_g6oxea$(this.plus_g6oxea$(rhRhoL, a), s);
+ }
+ var t = tmp$_0;
+ var tm = this.shr_1xumrx$(t, Kotlin.imul(h, BigInteger63Arithmetic_getInstance().wordSizeInBits));
+ var d = this.shr_1xumrx$(this.times_g6oxea$(xh, tm), Kotlin.imul(h, BigInteger63Arithmetic_getInstance().wordSizeInBits));
+ var x_1 = this.plus_g6oxea$(this.shl_1xumrx$(xh, Kotlin.imul(l, BigInteger63Arithmetic_getInstance().wordSizeInBits)), d);
+ var r_0 = this.minus_g6oxea$(this.shl_1xumrx$(t, Kotlin.imul(l, BigInteger63Arithmetic_getInstance().wordSizeInBits)), this.times_g6oxea$(a, d));
+ if (this.compareTo_g6oxea$(r_0, a) >= 0) {
+ x_1 = plus(x_1, BigInteger63Arithmetic_getInstance().ONE);
+ r_0 = this.minus_g6oxea$(r_0, a);
+ if (this.compareTo_g6oxea$(r_0, a) >= 0) {
+ x_1 = plus(x_1, BigInteger63Arithmetic_getInstance().ONE);
+ r_0 = this.minus_g6oxea$(r_0, a);
+ }
+ }
+ return new Pair(x_1, r_0);
+ };
+ BigInteger63LinkedListArithmetic.prototype.sqrt_11rb$ = function (operand) {
+ return this.reqursiveSqrt_0(operand);
+ };
+ BigInteger63LinkedListArithmetic.prototype.reqursiveSqrt_0 = function (operand) {
+ var n = operand.size;
+ var x = (n - 1 | 0) / 4;
+ var l = numberToInt(Math_0.floor(x));
+ if (l === 0) {
+ return this.basecaseSqrt_1zg3gk$(operand);
+ }
+ var step = n / 4 | 0;
+ var stepRemainder = n % 4;
+ var baseLPowerShift = 63 * l | 0;
+ var a1 = operand.subList_vux9f0$(n - ((3 * step | 0) + stepRemainder) | 0, n - ((2 * step | 0) + stepRemainder) | 0);
+ var a0 = operand.subList_vux9f0$(0, n - ((3 * step | 0) + stepRemainder) | 0);
+ var a3a2 = operand.subList_vux9f0$(n - ((2 * step | 0) + stepRemainder) | 0, n);
+ var tmp$ = this.reqursiveSqrt_0(a3a2);
+ var sPrim = tmp$.component1()
+ , rPrim = tmp$.component2();
+ var tmp$_0 = this.divrem_g6oxea$(this.plus_g6oxea$(this.shl_1xumrx$(rPrim, baseLPowerShift), a1), this.shl_1xumrx$(sPrim, 1));
+ var q = tmp$_0.component1()
+ , u = tmp$_0.component2();
+ var s = this.plus_g6oxea$(this.shl_1xumrx$(sPrim, baseLPowerShift), q);
+ var r = this.minus_g6oxea$(this.plus_g6oxea$(this.shl_1xumrx$(u, baseLPowerShift), a0), this.times_g6oxea$(q, q));
+ return new Pair(s, r);
+ };
+ BigInteger63LinkedListArithmetic.prototype.basecaseSqrt_1zg3gk$ = function (operand) {
+ var sqrt = this.sqrtInt_1zg3gk$(operand);
+ var remainder = this.minus_g6oxea$(operand, this.times_g6oxea$(sqrt, sqrt));
+ return new Pair(sqrt, remainder);
+ };
+ BigInteger63LinkedListArithmetic.prototype.sqrtInt_1zg3gk$ = function (operand) {
+ var u = operand;
+ var s = this.ZERO;
+ var tmp = this.ZERO;
+ do {
+ s = u;
+ tmp = this.plus_g6oxea$(s, this.div_g6oxea$(operand, s));
+ u = this.shr_1xumrx$(tmp, 1);
+ }
+ while (this.compareTo_g6oxea$(u, s) < 0);
+ return s;
+ };
+ BigInteger63LinkedListArithmetic.prototype.gcd_xwzc9q$ = function (first, second) {
+ return this.naiveGcd_0(first, second);
+ };
+ BigInteger63LinkedListArithmetic.prototype.naiveGcd_0 = function (first, second) {
+ var u = first;
+ var v = second;
+ while (!equals(v, this.ZERO)) {
+ var tmpU = u;
+ u = v;
+ v = this.rem_g6oxea$(tmpU, v);
+ }
+ return u;
+ };
+ BigInteger63LinkedListArithmetic.prototype.parseForBase_bm4lxs$ = function (number, base) {
+ var parsed = {v: this.ZERO};
+ var tmp$;
+ tmp$ = iterator(number.toLowerCase());
+ while (tmp$.hasNext()) {
+ var element = unboxChar(tmp$.next());
+ var char = toBoxedChar(element);
+ var tmp$_0 = this.times_hzscfj$(parsed.v, new ULong(Kotlin.Long.fromInt(base)));
+ var $receiver = toDigit(unboxChar(char));
+ parsed.v = this.plus_hzscfj$(tmp$_0, new ULong(Kotlin.Long.fromInt($receiver)));
+ }
+ return this.removeLeadingZeroes_nz1gkn$(parsed.v);
+ };
+ BigInteger63LinkedListArithmetic.prototype.toString_dpg1yx$ = function (operand, base) {
+ var copy = operand;
+ var baseArray = listOf(new ULong(Kotlin.Long.fromInt(base)));
+ var stringBuilder = StringBuilder_init();
+ while (!equals(copy, this.ZERO)) {
+ var divremResult = this.divrem_g6oxea$(copy, baseArray);
+ if (divremResult.second.isEmpty()) {
+ stringBuilder.append_s8jyv4$(0);
+ }
+ else {
+ stringBuilder.append_gw00v9$(toString_1(divremResult.second.get_za3lpa$(0), base));
+ }
+ copy = divremResult.first;
+ }
+ var $receiver = stringBuilder.toString();
+ var tmp$;
+ return reversed_0(Kotlin.isCharSequence(tmp$ = $receiver) ? tmp$ : throwCCE()).toString();
+ };
+ BigInteger63LinkedListArithmetic.prototype.numberOfDecimalDigits_11rb$ = function (operand) {
+ var bitLenght = this.bitLength_11rb$(operand);
+ var x = (bitLenght - 1 | 0) * BigInteger$Companion_getInstance().LOG_10_OF_2;
+ var minDigit = Math_0.ceil(x);
+ var tmp = this.div_g6oxea$(operand, this.pow_19wkf8$(this.TEN, Kotlin.Long.fromNumber(minDigit)));
+ var counter = L0;
+ while (this.compare_xwzc9q$(tmp, this.ZERO) !== 0) {
+ tmp = this.div_g6oxea$(tmp, this.TEN);
+ counter = counter.inc();
+ }
+ return counter.add(Kotlin.Long.fromInt(numberToInt(minDigit)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.and_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$ = list.add_11rb$;
+ var init$result;
+ if (index < mask.size) {
+ var $this = operand.get_za3lpa$(index);
+ var other = mask.get_za3lpa$(index);
+ init$result = new ULong($this.data.and(other.data));
+ }
+ else {
+ init$result = new ULong(Kotlin.Long.ZERO);
+ }
+ tmp$.call(list, init$result);
+ }
+ return this.removeLeadingZeroes_nz1gkn$(list);
+ };
+ BigInteger63LinkedListArithmetic.prototype.or_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$ = list.add_11rb$;
+ var init$result;
+ if (index < mask.size) {
+ var $this = operand.get_za3lpa$(index);
+ var other = mask.get_za3lpa$(index);
+ init$result = new ULong($this.data.or(other.data));
+ }
+ else {
+ init$result = operand.get_za3lpa$(index);
+ }
+ tmp$.call(list, init$result);
+ }
+ return this.removeLeadingZeroes_nz1gkn$(list);
+ };
+ BigInteger63LinkedListArithmetic.prototype.xor_xwzc9q$ = function (operand, mask) {
+ var size = operand.size;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$ = list.add_11rb$;
+ var init$result;
+ if (index < mask.size) {
+ var $this = operand.get_za3lpa$(index);
+ var other = mask.get_za3lpa$(index);
+ init$result = new ULong($this.data.xor(other.data));
+ }
+ else {
+ var $this_0 = operand.get_za3lpa$(index);
+ var other_0 = new ULong(Kotlin.Long.ZERO);
+ init$result = new ULong($this_0.data.xor(other_0.data));
+ }
+ tmp$.call(list, init$result);
+ }
+ return this.removeLeadingZeroes_nz1gkn$(list);
+ };
+ BigInteger63LinkedListArithmetic.prototype.not_11rb$ = function (operand) {
+ var leadingZeroes = this.numberOfLeadingZeroes_11rc$(operand.get_za3lpa$(operand.size - 1 | 0));
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = leadingZeroes + 1 | 0;
+ var $this_0 = new ULong($this.data.shiftLeft(bitCount));
+ var other = new UInt(1);
+ var $this_1 = new ULong($this_0.data.subtract((new ULong(Kotlin.Long.fromInt(other.data).and(L4294967295))).data));
+ var bitCount_0 = this.basePowerOfTwo - leadingZeroes | 0;
+ var cleanupMask = new ULong((new ULong($this_1.data.shiftLeft(bitCount_0))).data.inv());
+ var size = operand.size;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$ = list.add_11rb$;
+ var init$result;
+ if (index < (operand.size - 2 | 0)) {
+ var $this_2 = new ULong(operand.get_za3lpa$(index).data.inv());
+ var other_0 = this.baseMask;
+ init$result = new ULong($this_2.data.and(other_0.data));
+ }
+ else {
+ init$result = new ULong((new ULong(operand.get_za3lpa$(index).data.inv())).data.and(cleanupMask.data));
+ }
+ tmp$.call(list, init$result);
+ }
+ var inverted = list;
+ return inverted;
+ };
+ BigInteger63LinkedListArithmetic.prototype.shl_1xumrx$ = function ($receiver, places) {
+ return this.shiftLeft_dpg1yx$($receiver, places);
+ };
+ BigInteger63LinkedListArithmetic.prototype.shr_1xumrx$ = function ($receiver, places) {
+ return this.shiftRight_dpg1yx$($receiver, places);
+ };
+ BigInteger63LinkedListArithmetic.prototype.bitAt_19wkf8$ = function (operand, position) {
+ var tmp$;
+ if (position.div(Kotlin.Long.fromInt(63)).toNumber() > 2147483647) {
+ throw RuntimeException_init('Invalid bit index, too large, cannot access word (Word position > Int.MAX_VALUE');
+ }
+ var wordPosition = position.div(Kotlin.Long.fromInt(63));
+ if (wordPosition.toNumber() >= operand.size) {
+ return false;
+ }
+ var bitPosition = position.modulo(Kotlin.Long.fromInt(63));
+ var word = operand.get_za3lpa$(wordPosition.toInt());
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = bitPosition.toInt();
+ var other = new ULong($this.data.shiftLeft(bitCount));
+ return (tmp$ = new ULong(word.data.and(other.data))) != null ? tmp$.equals(new ULong(Kotlin.Long.ONE)) : null;
+ };
+ BigInteger63LinkedListArithmetic.prototype.setBitAt_xjejkt$ = function (operand, position, bit) {
+ if (position.div(Kotlin.Long.fromInt(63)).toNumber() > 2147483647) {
+ throw RuntimeException_init('Invalid bit index, too large, cannot access word (Word position > Int.MAX_VALUE');
+ }
+ var wordPosition = position.div(Kotlin.Long.fromInt(63));
+ if (wordPosition.toNumber() >= operand.size) {
+ throw new IndexOutOfBoundsException('Invalid position, addressed word ' + wordPosition.toString() + ' larger than number of words ' + operand.size);
+ }
+ var bitPosition = position.modulo(Kotlin.Long.fromInt(63));
+ var $this = new ULong(Kotlin.Long.ONE);
+ var bitCount = bitPosition.toInt();
+ var setMask = new ULong($this.data.shiftLeft(bitCount));
+ var size = operand.size;
+ var list = ArrayList_init_0(size);
+ for (var index = 0; index < size; index++) {
+ var tmp$ = list.add_11rb$;
+ var init$result;
+ if (index === wordPosition.toInt()) {
+ if (bit) {
+ init$result = new ULong(operand.get_za3lpa$(index).data.or(setMask.data));
+ }
+ else {
+ init$result = new ULong(operand.get_za3lpa$(index).data.xor(setMask.data));
+ }
+ }
+ else {
+ init$result = operand.get_za3lpa$(index);
+ }
+ tmp$.call(list, init$result);
+ }
+ return list;
+ };
+ BigInteger63LinkedListArithmetic.prototype.plus_g6oxea$ = function ($receiver, other) {
+ return this.add_xwzc9q$($receiver, other);
+ };
+ BigInteger63LinkedListArithmetic.prototype.minus_g6oxea$ = function ($receiver, other) {
+ return this.substract_xwzc9q$($receiver, other);
+ };
+ BigInteger63LinkedListArithmetic.prototype.times_g6oxea$ = function ($receiver, other) {
+ return this.multiply_xwzc9q$($receiver, other);
+ };
+ BigInteger63LinkedListArithmetic.prototype.plus_hzscfj$ = function ($receiver, other) {
+ return this.add_xwzc9q$($receiver, listOf(other));
+ };
+ BigInteger63LinkedListArithmetic.prototype.minus_hzscfj$ = function ($receiver, other) {
+ return this.substract_xwzc9q$($receiver, listOf(other));
+ };
+ BigInteger63LinkedListArithmetic.prototype.times_hzscfj$ = function ($receiver, other) {
+ return this.multiply_xwzc9q$($receiver, listOf(other));
+ };
+ BigInteger63LinkedListArithmetic.prototype.div_hzscfj$ = function ($receiver, other) {
+ return this.baseDivide_vvootw$($receiver, listOf(other)).first;
+ };
+ BigInteger63LinkedListArithmetic.prototype.rem_hzscfj$ = function ($receiver, other) {
+ return this.baseDivide_vvootw$($receiver, listOf(other)).second;
+ };
+ BigInteger63LinkedListArithmetic.prototype.div_g6oxea$ = function ($receiver, other) {
+ return this.baseDivide_vvootw$($receiver, other).first;
+ };
+ BigInteger63LinkedListArithmetic.prototype.rem_g6oxea$ = function ($receiver, other) {
+ return this.baseDivide_vvootw$($receiver, other).second;
+ };
+ BigInteger63LinkedListArithmetic.prototype.divrem_g6oxea$ = function ($receiver, other) {
+ return this.baseDivide_vvootw$($receiver, other);
+ };
+ BigInteger63LinkedListArithmetic.prototype.compareTo_g6oxea$ = function ($receiver, other) {
+ return this.compare_xwzc9q$($receiver, other);
+ };
+ BigInteger63LinkedListArithmetic.prototype.compareTo_hzscfj$ = function ($receiver, other) {
+ return this.compare_xwzc9q$($receiver, listOf(other));
+ };
+ BigInteger63LinkedListArithmetic.prototype.to32Bit_9i92ol$ = function ($receiver) {
+ return this.convertTo32BitRepresentation_nz1gkn$($receiver);
+ };
+ BigInteger63LinkedListArithmetic.prototype.from32Bit_j9z43k$ = function ($receiver) {
+ return this.convertFrom32BitRepresentation_rsvixa$($receiver);
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromULong_mpgczg$ = function (uLong) {
+ return listOf(uLong);
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromUInt_s87ys9$ = function (uInt) {
+ return listOf(new ULong(Kotlin.Long.fromInt(uInt.data).and(L4294967295)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ return listOf(new ULong(Kotlin.Long.fromInt(uShort.data).and(L65535)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromUByte_mpmjao$ = function (uByte) {
+ return listOf(new ULong(Kotlin.Long.fromInt(uByte.data).and(L255)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromLong_s8cxhz$ = function (long) {
+ var tmp$;
+ var $this = new ULong(abs(long));
+ var other = this.overflowMask;
+ if ((tmp$ = new ULong((new ULong($this.data.and(other.data))).data.shiftRightUnsigned(63))) != null ? tmp$.equals(new ULong(Kotlin.Long.ONE)) : null) {
+ return this.plus_hzscfj$(listOf(this.baseMask), new ULong(Kotlin.Long.ONE));
+ }
+ var $this_0 = new ULong(abs(long));
+ var other_0 = this.baseMask;
+ return listOf(new ULong($this_0.data.and(other_0.data)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromInt_za3lpa$ = function (int) {
+ var $receiver = abs_0(int);
+ return listOf(new ULong(Kotlin.Long.fromInt($receiver)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromShort_mq22fl$ = function (short) {
+ var $receiver = abs_0(short);
+ return listOf(new ULong(Kotlin.Long.fromInt($receiver)));
+ };
+ BigInteger63LinkedListArithmetic.prototype.fromByte_s8j3t7$ = function (byte) {
+ var $receiver = abs_0(byte);
+ return listOf(new ULong(Kotlin.Long.fromInt($receiver)));
+ };
+ BigInteger63LinkedListArithmetic.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'BigInteger63LinkedListArithmetic',
+ interfaces: [BigIntegerArithmetic]
+ };
+ var BigInteger63LinkedListArithmetic_instance = null;
+ function BigInteger63LinkedListArithmetic_getInstance() {
+ if (BigInteger63LinkedListArithmetic_instance === null) {
+ new BigInteger63LinkedListArithmetic();
+ }
+ return BigInteger63LinkedListArithmetic_instance;
+ }
+ function concurrentMultiply(continuation) {
+ }
+ function toDigit($receiver) {
+ var tmp$;
+ if ((new CharRange(48, 57)).contains_mef7kx$($receiver))
+ tmp$ = toChar($receiver - 48) | 0;
+ else if ((new CharRange(97, 122)).contains_mef7kx$($receiver))
+ tmp$ = $receiver - 97 + 10 | 0;
+ else if ((new CharRange(65, 90)).contains_mef7kx$($receiver))
+ tmp$ = $receiver - 65 + 10 | 0;
+ else if ((new CharRange(65313, 65338)).contains_mef7kx$($receiver))
+ tmp$ = $receiver - 65313 - 10 | 0;
+ else if ((new CharRange(65345, 65370)).contains_mef7kx$($receiver))
+ tmp$ = $receiver - 65345 - 10 | 0;
+ else if ($receiver === 46)
+ throw new NumberFormatException('Invalid digit for radix ' + String.fromCharCode($receiver) + ' (Possibly a decimal value, which is not supported by BigInteger parser');
+ else
+ throw new NumberFormatException('Invalid digit for radix ' + String.fromCharCode($receiver));
+ return tmp$;
+ }
+ function ModularBigInteger(residue, modulus, creator) {
+ ModularBigInteger$Companion_getInstance();
+ this.residue = residue;
+ this.modulus = modulus;
+ this.creator_0 = creator;
+ if (this.modulus.sign === Sign$NEGATIVE_getInstance()) {
+ throw new ArithmeticException('Modulus must be a positive number');
+ }
+ }
+ function ModularBigInteger$Companion() {
+ ModularBigInteger$Companion_instance = this;
+ }
+ ModularBigInteger$Companion.prototype.creatorForModulo_mpgczg$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromULong_mpgczg$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_s87ys9$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromUInt_s87ys9$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_6hrhkk$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromUShort_6hrhkk$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_mpmjao$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromUByte_mpmjao$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_s8cxhz$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromLong_s8cxhz$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_za3lpa$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromInt_za3lpa$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_mq22fl$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromShort_mq22fl$(modulo));
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_s8j3t7$ = function (modulo) {
+ return this.creatorForModulo_sao9k6$(BigInteger$Companion_getInstance().fromByte_s8j3t7$(modulo));
+ };
+ function ModularBigInteger$Companion$creatorForModulo$ObjectLiteral(closure$modulo) {
+ this.closure$modulo = closure$modulo;
+ }
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromBigInteger_sao9k6$ = function (bigInteger) {
+ return new ModularBigInteger(this.prep_0(bigInteger), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.parseString_bm4lxs$$default = function (string, base) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().parseString_bm4lxs$(string, base)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromULong_mpgczg$ = function (uLong) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromULong_mpgczg$(uLong)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromUInt_s87ys9$ = function (uInt) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromUInt_s87ys9$(uInt)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromUShort_6hrhkk$(uShort)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromUByte_mpmjao$ = function (uByte) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromUByte_mpmjao$(uByte)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromLong_s8cxhz$ = function (long) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromLong_s8cxhz$(long)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromInt_za3lpa$ = function (int) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromInt_za3lpa$(int)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromShort_mq22fl$ = function (short) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromShort_mq22fl$(short)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.fromByte_s8j3t7$ = function (byte) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().fromByte_s8j3t7$(byte)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.tryFromFloat_8ca0d4$$default = function (float, exactRequired) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().tryFromFloat_8ca0d4$(float, exactRequired)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.tryFromDouble_8555vt$$default = function (double, exactRequired) {
+ return new ModularBigInteger(this.prep_0(BigInteger$Companion_getInstance().tryFromDouble_8555vt$(double, exactRequired)), this.closure$modulo, this);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.prep_0 = function ($receiver) {
+ var tmp$;
+ var result = $receiver.rem_k9hq86$(this.closure$modulo);
+ switch (result.sign.name) {
+ case 'POSITIVE':
+ tmp$ = result;
+ break;
+ case 'NEGATIVE':
+ tmp$ = result.plus_k9hq86$(this.closure$modulo);
+ break;
+ case 'ZERO':
+ tmp$ = BigInteger$Companion_getInstance().ZERO;
+ break;
+ default:tmp$ = Kotlin.noWhenBranchMatched();
+ break;
+ }
+ return tmp$;
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.$metadata$ = {
+ kind: Kind_CLASS,
+ interfaces: [BigNumber$Creator]
+ };
+ ModularBigInteger$Companion.prototype.creatorForModulo_sao9k6$ = function (modulo) {
+ return new ModularBigInteger$Companion$creatorForModulo$ObjectLiteral(modulo);
+ };
+ ModularBigInteger$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: []
+ };
+ var ModularBigInteger$Companion_instance = null;
+ function ModularBigInteger$Companion_getInstance() {
+ if (ModularBigInteger$Companion_instance === null) {
+ new ModularBigInteger$Companion();
+ }
+ return ModularBigInteger$Companion_instance;
+ }
+ ModularBigInteger.prototype.getCreator = function () {
+ return this.creator_0;
+ };
+ ModularBigInteger.prototype.getInstance = function () {
+ return this;
+ };
+ ModularBigInteger.prototype.assertSameModulo_0 = function (other) {
+ var tmp$;
+ if (!((tmp$ = this.modulus) != null ? tmp$.equals(other.modulus) : null)) {
+ throw RuntimeException_init('Different moduli! This ' + this.modulus + '\n' + ' Other ' + other.modulus);
+ }
+ };
+ ModularBigInteger.prototype.add_k9hq86$ = function (other) {
+ this.assertSameModulo_0(other);
+ return new ModularBigInteger(this.residue.plus_k9hq86$(other.residue).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.subtract_k9hq86$ = function (other) {
+ this.assertSameModulo_0(other);
+ return new ModularBigInteger(this.residue.minus_k9hq86$(other.residue).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.multiply_k9hq86$ = function (other) {
+ this.assertSameModulo_0(other);
+ return new ModularBigInteger(this.residue.times_k9hq86$(other.residue).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.divide_k9hq86$ = function (other) {
+ this.assertSameModulo_0(other);
+ var modInverse = other.residue.modInverse_sao9k6$(this.modulus);
+ var result = modInverse.times_k9hq86$(this.residue).rem_k9hq86$(this.modulus);
+ return new ModularBigInteger(result, this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.remainder_k9hq86$ = function (other) {
+ this.assertSameModulo_0(other);
+ this.checkIfDivisible_0(other);
+ var remainder = this.residue.rem_k9hq86$(other.residue);
+ var result = remainder.rem_k9hq86$(this.modulus);
+ return new ModularBigInteger(result, this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.divideAndRemainder_k9hq86$ = function (other) {
+ this.assertSameModulo_0(other);
+ this.checkIfDivisible_0(other);
+ var quotientAndRemainder = this.residue.divrem_sao9k6$(other.residue);
+ var quotient = quotientAndRemainder.quotient.rem_k9hq86$(this.modulus);
+ var remainder = quotientAndRemainder.remainder.rem_k9hq86$(this.modulus);
+ return new Pair(new ModularBigInteger(quotient, this.modulus, this.creator_0), new ModularBigInteger(remainder, this.modulus, this.creator_0));
+ };
+ ModularBigInteger.prototype.inverse = function () {
+ var inverse = this.residue.modInverse_sao9k6$(this.modulus);
+ return new ModularBigInteger(inverse, this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.compare_xa1oq0$ = function (other) {
+ this.assertSameModulo_0(other);
+ return this.residue.compareTo_za3rmp$(other.residue);
+ };
+ ModularBigInteger.prototype.isZero = function () {
+ return this.residue.isZero();
+ };
+ ModularBigInteger.prototype.negate = function () {
+ return this;
+ };
+ ModularBigInteger.prototype.abs = function () {
+ return this;
+ };
+ ModularBigInteger.prototype.pow_xa1oq0$ = function (exponent) {
+ return new ModularBigInteger(this.residue.pow_sao9k6$(exponent.residue).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.pow_sao9k6$ = function (exponent) {
+ return new ModularBigInteger(this.residue.pow_sao9k6$(exponent).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.pow_s8cxhz$ = function (exponent) {
+ return new ModularBigInteger(this.residue.pow_s8cxhz$(exponent).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.pow_za3lpa$ = function (exponent) {
+ return new ModularBigInteger(this.residue.pow_za3lpa$(exponent).rem_k9hq86$(this.modulus), this.modulus, this.creator_0);
+ };
+ ModularBigInteger.prototype.signum = function () {
+ return this.residue.signum();
+ };
+ ModularBigInteger.prototype.numberOfDecimalDigits = function () {
+ return this.residue.numberOfDecimalDigits();
+ };
+ ModularBigInteger.prototype.unaryMinus = function () {
+ return this.negate();
+ };
+ ModularBigInteger.prototype.rem_k9hq86$ = function (other) {
+ return this.remainder_k9hq86$(other);
+ };
+ ModularBigInteger.prototype.compareTo_za3rmp$ = function (other) {
+ var tmp$;
+ if (Kotlin.isType(other, ModularBigInteger))
+ tmp$ = this.compare_xa1oq0$(other);
+ else if (Kotlin.isType(other, BigInteger))
+ tmp$ = this.residue.compare_sao9k6$(other);
+ else if (Kotlin.isType(other, Kotlin.Long))
+ tmp$ = this.compare_xa1oq0$(this.creator_0.fromLong_s8cxhz$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_xa1oq0$(this.creator_0.fromInt_za3lpa$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_xa1oq0$(this.creator_0.fromShort_mq22fl$(other));
+ else if (typeof other === 'number')
+ tmp$ = this.compare_xa1oq0$(this.creator_0.fromByte_s8j3t7$(other));
+ else
+ throw RuntimeException_init('Invalid comparison type for BigInteger: ' + toString(Kotlin.getKClassFromExpression(other).simpleName));
+ return tmp$;
+ };
+ ModularBigInteger.prototype.equals = function (other) {
+ var tmp$;
+ if (other == null) {
+ tmp$ = false;
+ }
+ else {
+ tmp$ = this.compareTo_za3rmp$(other) === 0;
+ }
+ return tmp$;
+ };
+ ModularBigInteger.prototype.toString = function () {
+ return this.residue.toString();
+ };
+ ModularBigInteger.prototype.toString_za3lpa$ = function (base) {
+ return this.residue.toString_za3lpa$(base);
+ };
+ ModularBigInteger.prototype.toStringWithModulo_za3lpa$ = function (base) {
+ if (base === void 0)
+ base = 10;
+ return this.residue.toString_za3lpa$(base) + ' mod ' + this.modulus.toString_za3lpa$(base);
+ };
+ ModularBigInteger.prototype.divrem_xa1oq0$ = function (other) {
+ var result = this.divideAndRemainder_k9hq86$(other);
+ return new ModularQuotientAndRemainder(result.first, result.second);
+ };
+ ModularBigInteger.prototype.toBigInteger = function () {
+ return this.residue;
+ };
+ ModularBigInteger.prototype.checkIfDivisible_0 = function (other) {
+ var tmp$;
+ if (!((tmp$ = other.residue.gcd_sao9k6$(this.modulus)) != null ? tmp$.equals(BigInteger$Companion_getInstance().ONE) : null)) {
+ throw new ArithmeticException('BigInteger is not invertible. This and modulus are not relatively prime (coprime)');
+ }
+ };
+ ModularBigInteger.prototype.intValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(2147483647)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to int and provide exact value');
+ }
+ return this.residue.magnitude_8be2vx$.get_za3lpa$(0).data.toInt();
+ };
+ ModularBigInteger.prototype.longValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(Long$Companion$MAX_VALUE.toInt())) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to long and provide exact value');
+ }
+ return this.residue.magnitude_8be2vx$.get_za3lpa$(0).data;
+ };
+ ModularBigInteger.prototype.byteValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(kotlin_js_internal_ByteCompanionObject.MAX_VALUE)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to byte and provide exact value');
+ }
+ return toByte(this.residue.magnitude_8be2vx$.get_za3lpa$(0).data.toInt());
+ };
+ ModularBigInteger.prototype.shortValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(kotlin_js_internal_ShortCompanionObject.MAX_VALUE)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to short and provide exact value');
+ }
+ return toShort(this.residue.magnitude_8be2vx$.get_za3lpa$(0).data.toInt());
+ };
+ ModularBigInteger.prototype.uintValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(UInt.Companion.MAX_VALUE) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned int and provide exact value');
+ }
+ return new UInt(this.residue.magnitude_8be2vx$.get_za3lpa$(0).data.toInt());
+ };
+ ModularBigInteger.prototype.ulongValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(ULong.Companion.MAX_VALUE.data.toInt())) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned long and provide exact value');
+ }
+ return this.residue.magnitude_8be2vx$.get_za3lpa$(0);
+ };
+ ModularBigInteger.prototype.ubyteValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(UByte.Companion.MAX_VALUE.data & 255)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned byte and provide exact value');
+ }
+ return new UByte(toByte(this.residue.magnitude_8be2vx$.get_za3lpa$(0).data.toInt()));
+ };
+ ModularBigInteger.prototype.ushortValue_6taknv$$default = function (exactRequired) {
+ var tmp$ = exactRequired;
+ if (tmp$) {
+ tmp$ = this.residue.compareTo_za3rmp$(new UInt(UShort.Companion.MAX_VALUE.data & 65535)) > 0;
+ }
+ if (tmp$) {
+ throw new ArithmeticException('Cannot convert to unsigned short and provide exact value');
+ }
+ return new UShort(toShort(this.residue.magnitude_8be2vx$.get_za3lpa$(0).data.toInt()));
+ };
+ ModularBigInteger.prototype.floatValue_6taknv$$default = function (exactRequired) {
+ return this.residue.floatValue_6taknv$();
+ };
+ ModularBigInteger.prototype.doubleValue_6taknv$$default = function (exactRequired) {
+ return this.residue.doubleValue_6taknv$();
+ };
+ ModularBigInteger.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'ModularBigInteger',
+ interfaces: [NarrowingOperations, CommonBigNumberOperations, BigNumber]
+ };
+ function PlatformBigIntegerArithmetic() {
+ PlatformBigIntegerArithmetic_instance = this;
+ this.baseMask = L2147483647;
+ }
+ Object.defineProperty(PlatformBigIntegerArithmetic.prototype, 'ZERO', {
+ get: function () {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ }
+ });
+ Object.defineProperty(PlatformBigIntegerArithmetic.prototype, 'ONE', {
+ get: function () {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ }
+ });
+ Object.defineProperty(PlatformBigIntegerArithmetic.prototype, 'TWO', {
+ get: function () {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ }
+ });
+ Object.defineProperty(PlatformBigIntegerArithmetic.prototype, 'TEN', {
+ get: function () {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ }
+ });
+ Object.defineProperty(PlatformBigIntegerArithmetic.prototype, 'base', {
+ get: function () {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ }
+ });
+ Object.defineProperty(PlatformBigIntegerArithmetic.prototype, 'basePowerOfTwo', {
+ get: function () {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ }
+ });
+ PlatformBigIntegerArithmetic.prototype.numberOfLeadingZeroes_11rc$ = function (value) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.bitLength_11rb$ = function (value) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.trailingZeroBits_11rb$ = function (value) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.shiftLeft_dpg1yx$ = function (operand, places) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.shiftRight_dpg1yx$ = function (operand, places) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.compare_xwzc9q$ = function (first, second) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.add_xwzc9q$ = function (first, second) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.substract_xwzc9q$ = function (first, second) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.multiply_xwzc9q$ = function (first, second) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.pow_19wkf8$ = function (base, exponent) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.divide_xwzc9q$ = function (first, second) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.reciprocal_11rb$ = function (operand) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.sqrt_11rb$ = function (operand) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.gcd_xwzc9q$ = function (first, second) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.parseForBase_bm4lxs$ = function (number, base) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.toString_dpg1yx$ = function (operand, base) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.numberOfDecimalDigits_11rb$ = function (operand) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.fromULong_mpgczg$ = function (uLong) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.fromUInt_s87ys9$ = function (uInt) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.fromUShort_6hrhkk$ = function (uShort) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.fromUByte_mpmjao$ = function (uByte) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.fromLong_s8cxhz$ = function (long) {
+ return new Int32Array([long.and(this.baseMask).toInt(), long.shiftRight(this.basePowerOfTwo).toInt()]);
+ };
+ PlatformBigIntegerArithmetic.prototype.fromInt_za3lpa$ = function (int) {
+ return new Int32Array([int]);
+ };
+ PlatformBigIntegerArithmetic.prototype.fromShort_mq22fl$ = function (short) {
+ return new Int32Array([short]);
+ };
+ PlatformBigIntegerArithmetic.prototype.fromByte_s8j3t7$ = function (byte) {
+ return new Int32Array([byte]);
+ };
+ PlatformBigIntegerArithmetic.prototype.or_xwzc9q$ = function (operand, mask) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.xor_xwzc9q$ = function (operand, mask) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.and_xwzc9q$ = function (operand, mask) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.not_11rb$ = function (operand) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.bitAt_19wkf8$ = function (operand, position) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.prototype.setBitAt_xjejkt$ = function (operand, position, bit) {
+ throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented yet');
+ };
+ PlatformBigIntegerArithmetic.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'PlatformBigIntegerArithmetic',
+ interfaces: [BigIntegerArithmetic]
+ };
+ var PlatformBigIntegerArithmetic_instance = null;
+ function PlatformBigIntegerArithmetic_getInstance() {
+ if (PlatformBigIntegerArithmetic_instance === null) {
+ new PlatformBigIntegerArithmetic();
+ }
+ return PlatformBigIntegerArithmetic_instance;
+ }
+ function ComparisonWorkaround() {
+ ComparisonWorkaround_instance = this;
+ }
+ ComparisonWorkaround.prototype.isSpecialHandlingForFloatNeeded_3p81yu$ = function (number) {
+ return true;
+ };
+ ComparisonWorkaround.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'ComparisonWorkaround',
+ interfaces: []
+ };
+ var ComparisonWorkaround_instance = null;
+ function ComparisonWorkaround_getInstance() {
+ if (ComparisonWorkaround_instance === null) {
+ new ComparisonWorkaround();
+ }
+ return ComparisonWorkaround_instance;
+ }
+ BigNumber.Creator = BigNumber$Creator;
+ BigNumber.Util = BigNumber$Util;
+ var package$com = _.com || (_.com = {});
+ var package$ionspin = package$com.ionspin || (package$com.ionspin = {});
+ var package$kotlin = package$ionspin.kotlin || (package$ionspin.kotlin = {});
+ var package$bignum = package$kotlin.bignum || (package$kotlin.bignum = {});
+ package$bignum.BigNumber = BigNumber;
+ package$bignum.NarrowingOperations = NarrowingOperations;
+ package$bignum.CommonBigNumberOperations = CommonBigNumberOperations;
+ package$bignum.BitwiseCapable = BitwiseCapable;
+ package$bignum.QuotientAndRemainder = QuotientAndRemainder;
+ package$bignum.ModularQuotientAndRemainder = ModularQuotientAndRemainder;
+ Object.defineProperty(BigDecimal, 'Companion', {
+ get: BigDecimal$Companion_getInstance
+ });
+ var package$decimal = package$bignum.decimal || (package$bignum.decimal = {});
+ package$decimal.BigDecimal = BigDecimal;
+ package$decimal.toBigDecimal_5qqsxr$ = toBigDecimal;
+ package$decimal.toBigDecimal_tx3gyw$ = toBigDecimal_0;
+ package$decimal.toBigDecimal_bi612z$ = toBigDecimal_1;
+ package$decimal.toBigDecimal_ad6jn9$ = toBigDecimal_2;
+ package$decimal.toBigDecimal_vx74cs$ = toBigDecimal_3;
+ package$decimal.toBigDecimal_4h3sss$ = toBigDecimal_4;
+ package$decimal.toBigDecimal_j0c5p7$ = toBigDecimal_5;
+ Object.defineProperty(RoundingMode, 'FLOOR', {
+ get: RoundingMode$FLOOR_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'CEILING', {
+ get: RoundingMode$CEILING_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'AWAY_FROM_ZERO', {
+ get: RoundingMode$AWAY_FROM_ZERO_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'TOWARDS_ZERO', {
+ get: RoundingMode$TOWARDS_ZERO_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'NONE', {
+ get: RoundingMode$NONE_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'ROUND_HALF_AWAY_FROM_ZERO', {
+ get: RoundingMode$ROUND_HALF_AWAY_FROM_ZERO_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'ROUND_HALF_TOWARDS_ZERO', {
+ get: RoundingMode$ROUND_HALF_TOWARDS_ZERO_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'ROUND_HALF_CEILING', {
+ get: RoundingMode$ROUND_HALF_CEILING_getInstance
+ });
+ Object.defineProperty(RoundingMode, 'ROUND_HALF_FLOOR', {
+ get: RoundingMode$ROUND_HALF_FLOOR_getInstance
+ });
+ package$decimal.RoundingMode = RoundingMode;
+ Object.defineProperty(DecimalMode, 'Companion', {
+ get: DecimalMode$Companion_getInstance
+ });
+ package$decimal.DecimalMode = DecimalMode;
+ Object.defineProperty(Sign, 'POSITIVE', {
+ get: Sign$POSITIVE_getInstance
+ });
+ Object.defineProperty(Sign, 'NEGATIVE', {
+ get: Sign$NEGATIVE_getInstance
+ });
+ Object.defineProperty(Sign, 'ZERO', {
+ get: Sign$ZERO_getInstance
+ });
+ var package$integer = package$bignum.integer || (package$bignum.integer = {});
+ package$integer.Sign = Sign;
+ Object.defineProperty(BigInteger, 'Companion', {
+ get: BigInteger$Companion_getInstance
+ });
+ BigInteger.QuotientAndRemainder = BigInteger$QuotientAndRemainder;
+ BigInteger.SqareRootAndRemainder = BigInteger$SqareRootAndRemainder;
+ BigInteger.BigIntegerRange = BigInteger$BigIntegerRange;
+ BigInteger.BigIntegerIterator = BigInteger$BigIntegerIterator;
+ package$integer.BigInteger_init_s8cxhz$ = BigInteger_init;
+ package$integer.BigInteger_init_za3lpa$ = BigInteger_init_0;
+ package$integer.BigInteger_init_mq22fl$ = BigInteger_init_1;
+ package$integer.BigInteger_init_s8j3t7$ = BigInteger_init_2;
+ $$importsForInline$$.bignum = _;
+ package$integer.BigInteger = BigInteger;
+ package$integer.BigIntegerArithmetic = BigIntegerArithmetic;
+ package$integer.toBigInteger_mts6qi$ = toBigInteger;
+ package$integer.toBigInteger_s8ev3n$ = toBigInteger_0;
+ package$integer.toBigInteger_5vcgdc$ = toBigInteger_1;
+ package$integer.toBigInteger_mz3mee$ = toBigInteger_2;
+ package$integer.toBigInteger_6ic1pp$ = toBigInteger_3;
+ package$integer.plus_71y1ds$ = plus_0;
+ package$integer.plus_quw10n$ = plus_1;
+ package$integer.plus_lflkze$ = plus_2;
+ package$integer.plus_ms5evg$ = plus_3;
+ package$integer.minus_71y1ds$ = minus_0;
+ package$integer.minus_quw10n$ = minus_1;
+ package$integer.minus_lflkze$ = minus_2;
+ package$integer.minus_ms5evg$ = minus_3;
+ package$integer.times_71y1ds$ = times;
+ package$integer.times_quw10n$ = times_0;
+ package$integer.times_lflkze$ = times_1;
+ package$integer.times_ms5evg$ = times_2;
+ package$integer.div_71y1ds$ = div;
+ package$integer.div_quw10n$ = div_0;
+ package$integer.div_lflkze$ = div_1;
+ package$integer.div_ms5evg$ = div_2;
+ package$integer.rem_71y1ds$ = rem;
+ package$integer.rem_quw10n$ = rem_0;
+ package$integer.rem_lflkze$ = rem_1;
+ package$integer.rem_ms5evg$ = rem_2;
+ Object.defineProperty(package$integer, 'chosenArithmetic_8be2vx$', {
+ get: function () {
+ return chosenArithmetic;
+ }
+ });
+ package$integer.Quadruple = Quadruple;
+ var package$base32 = package$integer.base32 || (package$integer.base32 = {});
+ Object.defineProperty(package$base32, 'BigInteger32Arithmetic', {
+ get: BigInteger32Arithmetic_getInstance
+ });
+ var package$base63 = package$integer.base63 || (package$integer.base63 = {});
+ Object.defineProperty(package$base63, 'BigInteger63Arithmetic', {
+ get: BigInteger63Arithmetic_getInstance
+ });
+ Object.defineProperty(package$base63, 'BigInteger63LinkedListArithmetic', {
+ get: BigInteger63LinkedListArithmetic_getInstance
+ });
+ var package$concurrent = package$integer.concurrent || (package$integer.concurrent = {});
+ package$concurrent.concurrentMultiply = concurrentMultiply;
+ var package$util = package$integer.util || (package$integer.util = {});
+ package$util.toDigit_myv2d0$ = toDigit;
+ Object.defineProperty(ModularBigInteger, 'Companion', {
+ get: ModularBigInteger$Companion_getInstance
+ });
+ var package$modular = package$bignum.modular || (package$bignum.modular = {});
+ package$modular.ModularBigInteger = ModularBigInteger;
+ Object.defineProperty(package$integer, 'PlatformBigIntegerArithmetic', {
+ get: PlatformBigIntegerArithmetic_getInstance
+ });
+ Object.defineProperty(package$integer, 'ComparisonWorkaround', {
+ get: ComparisonWorkaround_getInstance
+ });
+ BigDecimal$Companion.prototype.tryFromFloat_8ca0d4$ = BigNumber$Creator.prototype.tryFromFloat_8ca0d4$;
+ BigDecimal$Companion.prototype.tryFromDouble_8555vt$ = BigNumber$Creator.prototype.tryFromDouble_8555vt$;
+ BigDecimal$Companion.prototype.parseString_bm4lxs$ = BigNumber$Creator.prototype.parseString_bm4lxs$;
+ BigDecimal.prototype.rem_za3lpa$ = CommonBigNumberOperations.prototype.rem_za3lpa$;
+ BigDecimal.prototype.rem_s8cxhz$ = CommonBigNumberOperations.prototype.rem_s8cxhz$;
+ BigDecimal.prototype.rem_mq22fl$ = CommonBigNumberOperations.prototype.rem_mq22fl$;
+ BigDecimal.prototype.rem_s8j3t7$ = CommonBigNumberOperations.prototype.rem_s8j3t7$;
+ BigDecimal.prototype.plus_za3lpa$ = CommonBigNumberOperations.prototype.plus_za3lpa$;
+ BigDecimal.prototype.plus_s8cxhz$ = CommonBigNumberOperations.prototype.plus_s8cxhz$;
+ BigDecimal.prototype.plus_mq22fl$ = CommonBigNumberOperations.prototype.plus_mq22fl$;
+ BigDecimal.prototype.plus_s8j3t7$ = CommonBigNumberOperations.prototype.plus_s8j3t7$;
+ BigDecimal.prototype.minus_za3lpa$ = CommonBigNumberOperations.prototype.minus_za3lpa$;
+ BigDecimal.prototype.minus_s8cxhz$ = CommonBigNumberOperations.prototype.minus_s8cxhz$;
+ BigDecimal.prototype.minus_mq22fl$ = CommonBigNumberOperations.prototype.minus_mq22fl$;
+ BigDecimal.prototype.minus_s8j3t7$ = CommonBigNumberOperations.prototype.minus_s8j3t7$;
+ BigDecimal.prototype.times_za3lpa$ = CommonBigNumberOperations.prototype.times_za3lpa$;
+ BigDecimal.prototype.times_s8cxhz$ = CommonBigNumberOperations.prototype.times_s8cxhz$;
+ BigDecimal.prototype.times_mq22fl$ = CommonBigNumberOperations.prototype.times_mq22fl$;
+ BigDecimal.prototype.times_s8j3t7$ = CommonBigNumberOperations.prototype.times_s8j3t7$;
+ BigDecimal.prototype.div_za3lpa$ = CommonBigNumberOperations.prototype.div_za3lpa$;
+ BigDecimal.prototype.div_s8cxhz$ = CommonBigNumberOperations.prototype.div_s8cxhz$;
+ BigDecimal.prototype.div_mq22fl$ = CommonBigNumberOperations.prototype.div_mq22fl$;
+ BigDecimal.prototype.div_s8j3t7$ = CommonBigNumberOperations.prototype.div_s8j3t7$;
+ BigDecimal.prototype.compareTo_11rb$ = function (other) {
+ return this.compareTo_za3rmp$(other);
+ };
+ BigInteger$Companion.prototype.parseString_bm4lxs$ = BigNumber$Creator.prototype.parseString_bm4lxs$;
+ BigInteger$Companion.prototype.tryFromFloat_8ca0d4$ = BigNumber$Creator.prototype.tryFromFloat_8ca0d4$;
+ BigInteger$Companion.prototype.tryFromDouble_8555vt$ = BigNumber$Creator.prototype.tryFromDouble_8555vt$;
+ BigInteger$BigIntegerRange.prototype.contains_mef7kx$ = ClosedRange.prototype.contains_mef7kx$;
+ BigInteger$BigIntegerRange.prototype.isEmpty = ClosedRange.prototype.isEmpty;
+ BigInteger.prototype.times_k9hq86$ = CommonBigNumberOperations.prototype.times_k9hq86$;
+ BigInteger.prototype.times_za3lpa$ = CommonBigNumberOperations.prototype.times_za3lpa$;
+ BigInteger.prototype.times_s8cxhz$ = CommonBigNumberOperations.prototype.times_s8cxhz$;
+ BigInteger.prototype.times_mq22fl$ = CommonBigNumberOperations.prototype.times_mq22fl$;
+ BigInteger.prototype.times_s8j3t7$ = CommonBigNumberOperations.prototype.times_s8j3t7$;
+ BigInteger.prototype.plus_k9hq86$ = CommonBigNumberOperations.prototype.plus_k9hq86$;
+ BigInteger.prototype.plus_za3lpa$ = CommonBigNumberOperations.prototype.plus_za3lpa$;
+ BigInteger.prototype.plus_s8cxhz$ = CommonBigNumberOperations.prototype.plus_s8cxhz$;
+ BigInteger.prototype.plus_mq22fl$ = CommonBigNumberOperations.prototype.plus_mq22fl$;
+ BigInteger.prototype.plus_s8j3t7$ = CommonBigNumberOperations.prototype.plus_s8j3t7$;
+ BigInteger.prototype.minus_k9hq86$ = CommonBigNumberOperations.prototype.minus_k9hq86$;
+ BigInteger.prototype.minus_za3lpa$ = CommonBigNumberOperations.prototype.minus_za3lpa$;
+ BigInteger.prototype.minus_s8cxhz$ = CommonBigNumberOperations.prototype.minus_s8cxhz$;
+ BigInteger.prototype.minus_mq22fl$ = CommonBigNumberOperations.prototype.minus_mq22fl$;
+ BigInteger.prototype.minus_s8j3t7$ = CommonBigNumberOperations.prototype.minus_s8j3t7$;
+ BigInteger.prototype.div_k9hq86$ = CommonBigNumberOperations.prototype.div_k9hq86$;
+ BigInteger.prototype.div_za3lpa$ = CommonBigNumberOperations.prototype.div_za3lpa$;
+ BigInteger.prototype.div_s8cxhz$ = CommonBigNumberOperations.prototype.div_s8cxhz$;
+ BigInteger.prototype.div_mq22fl$ = CommonBigNumberOperations.prototype.div_mq22fl$;
+ BigInteger.prototype.div_s8j3t7$ = CommonBigNumberOperations.prototype.div_s8j3t7$;
+ BigInteger.prototype.rem_k9hq86$ = CommonBigNumberOperations.prototype.rem_k9hq86$;
+ BigInteger.prototype.rem_za3lpa$ = CommonBigNumberOperations.prototype.rem_za3lpa$;
+ BigInteger.prototype.rem_s8cxhz$ = CommonBigNumberOperations.prototype.rem_s8cxhz$;
+ BigInteger.prototype.rem_mq22fl$ = CommonBigNumberOperations.prototype.rem_mq22fl$;
+ BigInteger.prototype.rem_s8j3t7$ = CommonBigNumberOperations.prototype.rem_s8j3t7$;
+ BigInteger.prototype.intValue_6taknv$ = NarrowingOperations.prototype.intValue_6taknv$;
+ BigInteger.prototype.longValue_6taknv$ = NarrowingOperations.prototype.longValue_6taknv$;
+ BigInteger.prototype.byteValue_6taknv$ = NarrowingOperations.prototype.byteValue_6taknv$;
+ BigInteger.prototype.shortValue_6taknv$ = NarrowingOperations.prototype.shortValue_6taknv$;
+ BigInteger.prototype.uintValue_6taknv$ = NarrowingOperations.prototype.uintValue_6taknv$;
+ BigInteger.prototype.ulongValue_6taknv$ = NarrowingOperations.prototype.ulongValue_6taknv$;
+ BigInteger.prototype.ubyteValue_6taknv$ = NarrowingOperations.prototype.ubyteValue_6taknv$;
+ BigInteger.prototype.ushortValue_6taknv$ = NarrowingOperations.prototype.ushortValue_6taknv$;
+ BigInteger.prototype.floatValue_6taknv$ = NarrowingOperations.prototype.floatValue_6taknv$;
+ BigInteger.prototype.doubleValue_6taknv$ = NarrowingOperations.prototype.doubleValue_6taknv$;
+ BigInteger.prototype.compareTo_11rb$ = function (other) {
+ return this.compareTo_za3rmp$(other);
+ };
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.parseString_bm4lxs$ = BigNumber$Creator.prototype.parseString_bm4lxs$;
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.tryFromFloat_8ca0d4$ = BigNumber$Creator.prototype.tryFromFloat_8ca0d4$;
+ ModularBigInteger$Companion$creatorForModulo$ObjectLiteral.prototype.tryFromDouble_8555vt$ = BigNumber$Creator.prototype.tryFromDouble_8555vt$;
+ ModularBigInteger.prototype.rem_za3lpa$ = CommonBigNumberOperations.prototype.rem_za3lpa$;
+ ModularBigInteger.prototype.rem_s8cxhz$ = CommonBigNumberOperations.prototype.rem_s8cxhz$;
+ ModularBigInteger.prototype.rem_mq22fl$ = CommonBigNumberOperations.prototype.rem_mq22fl$;
+ ModularBigInteger.prototype.rem_s8j3t7$ = CommonBigNumberOperations.prototype.rem_s8j3t7$;
+ ModularBigInteger.prototype.plus_k9hq86$ = CommonBigNumberOperations.prototype.plus_k9hq86$;
+ ModularBigInteger.prototype.plus_za3lpa$ = CommonBigNumberOperations.prototype.plus_za3lpa$;
+ ModularBigInteger.prototype.plus_s8cxhz$ = CommonBigNumberOperations.prototype.plus_s8cxhz$;
+ ModularBigInteger.prototype.plus_mq22fl$ = CommonBigNumberOperations.prototype.plus_mq22fl$;
+ ModularBigInteger.prototype.plus_s8j3t7$ = CommonBigNumberOperations.prototype.plus_s8j3t7$;
+ ModularBigInteger.prototype.minus_k9hq86$ = CommonBigNumberOperations.prototype.minus_k9hq86$;
+ ModularBigInteger.prototype.minus_za3lpa$ = CommonBigNumberOperations.prototype.minus_za3lpa$;
+ ModularBigInteger.prototype.minus_s8cxhz$ = CommonBigNumberOperations.prototype.minus_s8cxhz$;
+ ModularBigInteger.prototype.minus_mq22fl$ = CommonBigNumberOperations.prototype.minus_mq22fl$;
+ ModularBigInteger.prototype.minus_s8j3t7$ = CommonBigNumberOperations.prototype.minus_s8j3t7$;
+ ModularBigInteger.prototype.times_k9hq86$ = CommonBigNumberOperations.prototype.times_k9hq86$;
+ ModularBigInteger.prototype.times_za3lpa$ = CommonBigNumberOperations.prototype.times_za3lpa$;
+ ModularBigInteger.prototype.times_s8cxhz$ = CommonBigNumberOperations.prototype.times_s8cxhz$;
+ ModularBigInteger.prototype.times_mq22fl$ = CommonBigNumberOperations.prototype.times_mq22fl$;
+ ModularBigInteger.prototype.times_s8j3t7$ = CommonBigNumberOperations.prototype.times_s8j3t7$;
+ ModularBigInteger.prototype.div_k9hq86$ = CommonBigNumberOperations.prototype.div_k9hq86$;
+ ModularBigInteger.prototype.div_za3lpa$ = CommonBigNumberOperations.prototype.div_za3lpa$;
+ ModularBigInteger.prototype.div_s8cxhz$ = CommonBigNumberOperations.prototype.div_s8cxhz$;
+ ModularBigInteger.prototype.div_mq22fl$ = CommonBigNumberOperations.prototype.div_mq22fl$;
+ ModularBigInteger.prototype.div_s8j3t7$ = CommonBigNumberOperations.prototype.div_s8j3t7$;
+ ModularBigInteger.prototype.intValue_6taknv$ = NarrowingOperations.prototype.intValue_6taknv$;
+ ModularBigInteger.prototype.longValue_6taknv$ = NarrowingOperations.prototype.longValue_6taknv$;
+ ModularBigInteger.prototype.byteValue_6taknv$ = NarrowingOperations.prototype.byteValue_6taknv$;
+ ModularBigInteger.prototype.shortValue_6taknv$ = NarrowingOperations.prototype.shortValue_6taknv$;
+ ModularBigInteger.prototype.uintValue_6taknv$ = NarrowingOperations.prototype.uintValue_6taknv$;
+ ModularBigInteger.prototype.ulongValue_6taknv$ = NarrowingOperations.prototype.ulongValue_6taknv$;
+ ModularBigInteger.prototype.ubyteValue_6taknv$ = NarrowingOperations.prototype.ubyteValue_6taknv$;
+ ModularBigInteger.prototype.ushortValue_6taknv$ = NarrowingOperations.prototype.ushortValue_6taknv$;
+ ModularBigInteger.prototype.floatValue_6taknv$ = NarrowingOperations.prototype.floatValue_6taknv$;
+ ModularBigInteger.prototype.doubleValue_6taknv$ = NarrowingOperations.prototype.doubleValue_6taknv$;
+ chosenArithmetic = BigInteger63Arithmetic_getInstance();
+ Kotlin.defineModule('bignum', _);
+ return _;
+}(module.exports, require('kotlin')));
+
+//# sourceMappingURL=bignum.js.map
diff --git a/crypto-core/node_modules/bignum.meta.js b/crypto-core/node_modules/bignum.meta.js
new file mode 100644
index 0000000..18fa6f8
--- /dev/null
+++ b/crypto-core/node_modules/bignum.meta.js
@@ -0,0 +1 @@
+// Kotlin.kotlin_module_metadata(393729, "bignum", "H4sIAAAAAAAAANV9WXRcV3IYen990QRudwNgLyAAQiQoUaLUBCSK2gcEQZEwSVAN7pKGajQaQFONbrAXLppNI8fU7DOWZ+TJWLbjLMpiJ3HiJUpiJ3GczDixZnJOPiY5yU8+Yp+Tc3LykY+cfGVSVbfee/dtaFDjEzvSYdd9VXXr1l1fVd37LgaMSOZ/5sUfGSJSbW2JRL3V7GzXmyL+ZqvbQLha32j2tkTyRH3jfG9rtdYWiYV2rdJtQQJwF+9t10RkvnlPDK23W1uAOdPs1jaATaza6UTdRGoMBmW4162J6Cr9UjqBWGARkTr+YIoYz7aaGyLaoF9KJxG7stlqd0Wso4B6IsIlEhbrKaCeSM4llBjt0S+lFTuJjPUUUE+CCEpmvMeQnwe3K+1ObaXbrgNjvMOQn6OrlU5N7Om2750CCSdbvdVGTcTXGPLzntrdSrVbrt3q1du1NWjLVqtRqzRFirOdarQqUKV1BdRTfvHudq1d36o1u5XGpWYHuqa2hj3Qgbp06w0R2archTz1dgdU7dSqreYa4KAbI5XVDvysrYlYq7sJjZ+E3oY61C62QLP67fpaTWQUnG+ulWtblXpzDdiiFyr1toiDlpVGR4iNWtfs/Hi9c73Wbgljq9fo1rcb90S8WduoQDOPNmmcLK+frFXrW5XGyfpGvQulb7fuCKN2d7vVrGGzt61C4h01xoxOb7XbhlYRRrfFbSl6zUr73rl6s9cRQyfq3Tv1Tm2hsl3BJoxUoHqx1Xp3HnJstzr1LoxeEWm2uiIMGhqdWvcEESPAIyKdzYaIbzcqVWgueGiLyF3gyi+0trZaTWt4L0MLV1AQMEGDiEGo85lmp1tpVmEgbZEi0e0G/EagBiLWhe7oiOK51lqvUWm/0mt161A9RyMatxgrEluKTaSZX58v2CPUNke19KyIVlvb94SxWelsLrSgm7LnK+126w40jqZqEmfQ5UqjVxODaqCpB0HjR6UNmFAqlcRpxAw0dTjds6Ukexa36Nnsgz2Nf8Svtpn/ERJhOSCixoAMwW9IhuE3LCMibkRkNDcAMCpjAMNAiRtxmcghd0QKeDLkIHHE5RDDNMMRhnsZFhjuYzjF8CGGMwwPM3yM4RMMS6zJUX5+nmBELjG8zPB11u4GPI3LNxhbY7idGyhEvmtEpj8IGxu52GGsb3w2XEosSWkUwsdDs3GZLIRLydMzgEkxZg9gBGGGGSMBM0iYDGOygEkRZpQxY4DZA5iszDEmD5ih0zP/OzQAyCIjxwE5bCInGDkJSGki9zNyGpBphSzIA4w8CMjMrAE9doh1KsiHmfYIYLJEexRSI0Q7wrTHATOq094JR0XYyL9nhI2x6TPGem6v1jo5Ocv55hg+iRAk5uRT/hSWN/0fsKWjh4dgfMUPG5loJnw6Xoqi1GfDsaNLhjwG/APUck9jCiQctzDPYJ0UppQgzLMunnH5XGEIpR4fUL+lnEbNyhewdrMGYKK5EMj4MLw0JF8sGMwcAyZDvsTNI+WnXOINOW+lTlhdvMBcJ61hoGMUz6JH0imL+2UP7TR2I9EoBTSzO5PyDHF9GNZ76CNjYPrDEPRS/jDOXNVLafkzDsEfRkHeWWqAuDzHmhnyPJealstu9py8wChiB/gKN01alpmyQooBc1pe9KIuuUSiot+JGpVcwW8IQIYrjgzvhzWUmncOlJp4DpSaeQ6Umnrv+3X1Vavy17wFX/MWfM1b8DVvwdfcBaflda/4617x173ir3vFX/eKf9Ur/lWv+Fe94l/1in/VK/41r/jXvOJf84p/zSv+NZd4awD/Qsh418gVcSCckJm4/DQw7AO4iBAGfgXh6e9HILlqJvfJKiSLtHIRP6UWFTnkM+F/jNnXSMEfhyCpZtqPQ2Uur8zlsVah6f8VMt7ITfiO1oxcx8o7ltSM3PAssxm56V5eAVenxcyJu0nTzIl7E9vJgRuVDXx16Dh8C4zKLXx5eNFNfH140S18gbjQvKjY3THp6I4kd0eSuyNpd0fS7o5JqzuSVnckP1F3JLk7kmZ3vGdExYAYyPzuIfHHe/o4PYk1ZcGS28LWrEguoOXcRFPTzymKLJ9fFJGLV5ZF9PpiefnB3aJBLvQcGnuDJ7WHglPUlXp3c9E0p23D2t+tGjWx850VqFx9vV5F63nERDuEkddF7k+A80I+k5+H4vTeRvjJWWaWsU79fX28URProzWiHSICHcIxi+AUM2rhvXL+/P3HrMaC+tEQyFJrA+ZCCxqY+TPtWqfVuF3Tx4okJ1DHpJU/qKOynd72dqNecyBj7VYPGgfHqTnkBztaqw0R/WS9U62018BzTa5ZyUEiLbdPtqBdXP7v7vzdHbwxQfOurTw/CjjUO2afUXuncODYvbjdBu075BG6nd+JVWw3bShcbK1UtmpW3vjFNni0NbcnHa3WwMdOsOesu9DKR4vAzFVO4y5caqCg/2i61jiNYPXQPWyH57kHHsr1teX1cmWtfldzB2GiVYXgheQkls2OOfuqXv/8QLNl1lQNIHC2q+jGYWOcb3WpvUWs3tzudYOc+TT50fMnW6Ahj0LbA2f3GP198pF3dPXZgU51W3poyPL/pZkClaGjYOToEYEdAiKJk4un5i+dvSgkr6cXrPGQomEKMmm8p8r6U5AXHjt1dnm5DMv84pmzZ86/LIbmr8xfu3GqvHzuBi3zqYvLV+bLJ1fUU/Q8vgXy5eVL50/eOD1/9tQNF/tejeTImdEIZllSwyk1oovYiKrNuGMy/z4c4Hej9xq1vO64EZNx9l4TBBPSYB93CJ6Scpg947Tlo6fkGOFSMs9wnOEkwxmGjzIsMZxjeIzhMwyfZ3iWNTnPz8sMLzC8yrAKMAHwiyFCDFIVEqDkz4UoMSW/ZCa+bCa+Yia+aia+Zia+bia+YSa+aSa+FeKifh4Shd8OF47I90JgQMQOoxEloEWzZHkISktKD55OoHkx8ZERLuy32Yf7s8gAFq3QoV0UqrGnH4w982Dse/uzf9eITv/XpHE/kovPkrVbipWME2EjrAIgpZhl8o8tFZwYXeDSNIZCNJpyAZw8Uo4wzyj5AijRgXFwF+TeQNo0BlU0ml9p/jxDrjIKzFMsuEYA0PYxbaLg6nqoyRTT9lNQB2viwLgkTQfSpuVDDpp/Tfx4hlwaHWAeDAmlSSMHxqXRoUDaNAaQNJq/Rn48bo0eYZ7DZOSjRg6MS6PHAmnTGLbSaH4aTfnyKJ+J/FNwRh5njifQYzs9hl7RPidSF6mib0eZPEsuE+dxIL15nmTyU+gFmnkcSG+ep5mMoa4xM48D6c6Tw2AYkZ8r4FSPk7OlxuKLTHmpYC4CZjvNYIwL/VA5rzCzGNkyUwu8PIRB+kmWschQeflhaGmTcsox03WOlxljcpz2cJzpIyMnlxwzM47BrVIOapej4JQ9Ly1KWQVvYwAFw0GEZijyXcNI5GJT9jqXsFJ5ThVLhWdD8RNTRjjDqmUMWkExpTejgcGvUgzUkRjzInUuM6bgxDia/7C8UhihooT+WxoH7muc6zrJCS/FMTJTii0NYQiFpj3JW0rL17XnIkZZZsh7jtFoVy1qqe0oPi5vsIg3HEq/j8t9xVOPSmA9xuWqiruWYtyE+7Sc+8DFD6Lejy49HEx2vKTCMC9q2LcwMi8TjiobpzAMtstGwXplQakGhV1Un9T1wQuCDAq14OSIU4AlBjVoBNWO+Ld4uKUpnOJqqpanqVqBTWXIbUutWzxT2wipmA6v1jnZ1WkAe6QwRtBuexW4w6gs18qJSZPed93Zxp0oV5WlvOeqleSZbmh1ecsq8DOeNvhMYBuk5WfdysTl53B4gsjPU2OgyM+7FrK4/AJiloR8O8T5ypYyZV40yipKnSsnMUZdGoW1saxi0ukyT2ItdD6Boa4xtHcw0lVES6eckO+g+MHpXw0Z943c4BTG04u4EIxlklCLn0VqmpJ/CZNToNB9wmEMTMh3CYnpSZqHg7N2rlk7l4qIuQc0RcTU4KSImGqNH4dAKyUBEio/RieTxvdDuf2g3pRKTtvJh+zkATt50E7O2MlDdvJhO/kIJReM+6HcFC+IU6XD2EQ3I8aXQvDzZfz5Cv58FX++hj9fx59v4M838edbIQrbxTFsJwYyb78ovpPuF7jzC6z1CdypHfTBs8sv3zhaurF86sasFe7imN7ieT2wJyrtendzq9atV8WIXcy8jRUUB5pvtyv3RPJKq72mkhweiiJGjK3VurU2uOoYjcA4CKsVxWcRugheu0Lo4Y+dYop/YU9V7BQO24M0u4WSd6xkFH364HMNn/wcxp/x+QvfvXAVp7K3/7VAyM67/VZUSMWr7GiPHRgZXblVadfKrZazRNGBnAovhu0hUq40N6DubQQdMbjQaHVqawo5WG01GrWqCrIZZ2A00hiLdboV6JlUrbl2pllt9Dr123iEAMk4WxQjpjJ2KRYuUe2123TgATQ/X7sLo6KJvzuE93yPNbhPfCS3KhvNercHLbHHDEzhsIH2V31frm23ax3sn64z8ud/VkQ7NmGF9cY4ocYLNK6qnxhW+HoH9G+0qm+K5Klek5rtqBjlPDRM7CxahHB07SjGn7bbrWqlUa5B+1CDUshw99HCwLMdkY3qWnDwkGKE9vGPVL1TrnV6jS7FCYfblD5ntawZQCzcrNyudKrt+nZX9daC1QAizsuUdpIkstVaE3E64NISAuCZ5u0aTE4tAmk0K1Dpl0FVMxZJh3UCYox4hsd1aChBAxiac6ezPfqRFjrnYwYdo51bMKIl/jrP57iDkdHqZgWafgF/s92W96zOjud4+p+i0UOYjhM1dCJp9ESl+iaM5QVrXtIhu2FG43gnxBAubxdad7DlLt5piUQLJw7GqbcqHRie0DBna82N7qaI3SbpVjufrVUw4Im9jKFXWkNPtdoncLkU9jAVyc5mfR2ErHexUSFZrm9swrCG9uqoBpMA6g2WdQJ7bcQeJaDpmxW1mzBZ76xsg+BK4zRoiBmgPJot52s1jOqOX2hUuuut9pbvm9TATSR6HxhY6XNUv1d6lbV2D+P0oXkROiFCCyJ0UoQqIrQqQlURWtMW1jkt/aQwLiyvnLl45vKiMM4vvjxPKRVSjXVbOHFldRMWyKamAYX1vce/HGHrzO9HfqoQLMKkFXQVfBQqykeghMzwc5afR/h5lOFexhcYTjKcZniQ4cMMH2X4OMM5hi8wPMFwkeEp1v1lfj7Nz2WGFymMLOQleJqmA1T4dAWeDnAg94B8jXlf5/pXGK4yrLLsbYZ3KBorwGDlxK9gIgacfyUEz0/IXwtxJPh3zcRHJus/NjH/VCXS8vtm4gcqjpymYDfy/hFGe/9jvDAh/9iMdWbBb1gmJ+FdOmKw7yPDQR/pQx/tQx/zp3/cp/yP+5T/cZ/yP+5T/g/7lP/DPuX/sE/5P+xT/o/6lP+jPuX/qE/5P+pT/gd9yv+gT/kf9Cn/gx3LH5X/zipfxdTd6BF/9Kg/ekxDT9roAoVzMKiniZt+VP7bUGEsY2TipT03w28MUWoYUrKUOj5w9YtR8ISZOXZYwmo1Oo2RNPgHLt0+wmSnMTIO/xDDXjLuCPxJxHjXsSNgpZK0NzBJp3nS03FYO3O50GxK5lUo5nSulDn9jgG+fJEd/nErmKCH07OE0UPmI4QxA90Yuh4lzAxjMGA9BpisI4i8V4VKs1b0+IgK2yjkE4wsFfCQ5Zg3optXyEmOzgr5VIEbExiOkYc/oGKteigW4TNcLTsK66U8x5jnC9iFce5ApLzEFBWLjeMpw1KRKAtMwcjLuE3hmCYGPWgPpqz2WRAOMRwmOCVl0Ji4+k7UPvFDA2P6PQp4TMAImKQzPxSVBUix16UkRVZj6szPWTO5j+KvEzQkVRQXU0uKjBGO8wU6oQWzBSMckyrCcYHqThEOjNYU1JmfM6w75TbjtEqpKUuplV0rNUWqrPyUSi2xUiu6Updz+6058JCVOkgKXmMFKXC7NCxftcKSMxixSirC1fejkLzGSVPuK7lDlrQZH2lJithS3DOpgrZKJMV7r74zZEl/xxL5n5KBce6HrdQjVuowpyZLmWdjr1+Mv1w+IYyxDM9BTtMM5TTNRE7TXD6RNwYy2tzJ8NzBmWPQ+Ti1AGzy2F5mTNoK0yrM+3hg9SZ1lIrSqhUA47RZbZIMUWzWWs+XpilCO2JNp4xsOcLLI6VHgecW86iJ5ceTptCrKXcSm1zFZzGAnKT4bOz0fQyU9lwVGZe3XQHtxxzVvEsTxsTcj3KsVZ/53hFKcd63nMsA1P0zetnw/FlXDPxzXKrBo3uMY4qs+he4iqbAvAqtFmcH5RdDZgeeDmPXJVVYtEhVoFgkZsRT7EcoLP1ziBp11IGiorHZhAqJclW/5ERCzi+HPCPhK04UNvhXQ0xNyq/Zya+HeGBk5DeceWj4fNMs7FuqsIwLM0I5nTgl7ecxud/uJWytJZeeBd5bN8cnSPiFkFX7b5tSv6NKeh9PRL+P6TFHK/2ily8pv2tql5B/WamekN9T0ea0/CV3g2WVYVIAIb+MiceVvr+K6ZLd1AavaziNKKW9hUbkX0WmvbZq2Okj8q8hNufG/nXEDjuxQv4NMywPHB9iOu/kyMi/6e6jspRr5ji7+nZUResxKD5S5mWjPCjXaQ4Urt4f0l9XGLr/b3FjI5c6HAPD42+FAITk3w7hmwJenZv6oWX1Iqaz3gVcZgCTkL8e4sRvhJiW5/XGopkLD57E/btqzCfk3zPZc9bS4y7kACwKzg8RHvPhIiOIMMoImlFGEGGUETSjjCDCHGBNyAgijDKCZpQRRBhlBM1YRhAhlRE0YxlBhFRG0IxlBBFSGUEzysb5TEAD5mnC+pIyNDW1xiWcmqNO3N93NCZ+O1KkCRzYMb9plpl3DFzsz2+apBc5G0/jmaUJ+Q9Cnn7Q9HiIJrBepmcmo2L/0KMYT1Uk/lYwcQLn7g7F5+VvB7VknieopphZ4Yz8Hc9ILNLM8m88sAnw26WBqx+ixbHHTg7ZyWEzKeTfIeGQds610PR+4/vh3FGyw9DoH5b/KMQvZ3oJfGSEp38xYfwgnJudVW+/OX6XpoifZmRpjk3jOTaN52gZrRNG6U6J3wgxzTkjKZtpCrhmJLE7ZqSjEGtGslpz5ox0cCm3ZM7jlsx53JI5j1sy53FL5vzckjk/t2TOzy2Zc7olNCN9G1DNSF+SmpFa4xLOMSMZ55iRVFE1IwM75jfNMp0zcoxnJJFe5GzWi9WekVo/aHqoGamX6fNuVTPSqdh3bK1/K5hoz0j/4tWMDGhkfUZatVMWxO94RqKakf6NB680dNvmjl9GL2CQfDfrYUh/GLYfDFXc8VPlUflPqDmv3j/5PcMwovL//OQnPxkup3jqErtz8kamvxdGL+pJelP+nnpT/j6CsPxnCCLyn9N788SBTEL+C1o4IPEHtDZD4l9iIgyJP8RERHldsLaYXhcs4LT1/a+IT6X/NbFi+hx4YwVtFQzRb5h+I6UnaU9clUlJVSolVbmU/EMW90Dem1mXslmXslmXslmXj4yo2u5+ahZDGJQ8ZiefpuQzuAmeZs8oXTpOC5pQUyuNtlZC/htq+5sRyAQ/PwjdDBvDYKG8ZwyprW/z/8yXi+L3krvdAo9jxHxuVozZgeq52fl+e9fJS1bIXW3o+u6Bqx1WOybPW9uDJgIzurcpaPM52UAE5Um1btfa6/BMT0O49btSf6t2pknbCerYvmvnFzc5XLsdKSylCv9WcI9H7ZqhGvXqSbW5NtJrNlvtrUoDZK8pHH6L4sZ2Wm2SZeabNTcNrQ1i7Zy72jH37LMMVzdr1TfL9j6Kvqdi7TNOrR0te3cEcXfncq1N59RDFfwYyNJPZK3t4/OWziJj0mnHcwV3aawNxd2cBXAfA/jpDwA82NY/7Vz6bREm7Yqb32MYa2a/Jda4r3baQAzY78J9Reeel3nGwjw44Np1zNjdR0ME+2bExq1AlgZ1HPUQDGdnefrpjD3t2i3V0TROXduY2n6btplp7bup/csE/lI729tw9rGAVLdFTb+IpxvEODzxMQVzOuMxglPYstCxFZrf3j082obUNq/5GIL1aQtdfODZC6NNWNpw5W3U4OMSmQ+DLglQO2VR3CnT9smitE+m9sUM3iszaK8MoWSYZTjB8ADDGYZPMnyO4YsMFxkuMVxh2FEf98emvy2NPwjn4myTJvmEZYKW8CIdKk/CqzzHEG2ZpLK3inQaHJFFhuM2cRIMRV1iko6UE6OKER+Ukz4MUywJbcmkYpveDVuRbM4hTZeDtrWYJrMTv8/GY9hCGZA6inWeA6NULytl6zybAUPVRVNhnyJ9Hpryb6J9YNF6tT9iap2n49SY5wmGaOOmkHQILFxvTp8ismQCI3KugNcgMPIpRmKIIGUin2bkcd2SfoaRz9K7mpHPMxKPFmZM5EuMxLihMJHzjMTv/QdN5AIjTxaso+NFOlsYMJTydATaJAomCi8pqZOKviRrdJ72JYZVv5wJ6mkkPwrkEb3xmQn9pp9haWdN5izF0q1pYDYB2mDDbuSyPg5NPS8Ez6IimWqIpLOas2r7ImUSLzJxiOElu18nXeNVn39jaoBd7jvABlRbXQloK6Em11XOc81skUl5PbBsav6H6Ki2XueD3Fp0dNus3usupk/rdb8RTJyUb+xc96z6Otu5IBXVd9pBo6nKHVDU2jxlri/0ibY+gtIUo0P+dXucbHiXnCI5/QG9nyO/P3VYEW7SmHk77E9JWhT0BpO+edwUM88B2XC3l5MrqvJvBUp2U2xtmoF53BQ7Tyswj5ti59nWKGoomFrfCqS0A8txU7gccCFxWzEJ/qN6GnQ8pRxPe7SnURouAhxSePqegWdBQhdC5Tz5r4MmWrCrOgmkUZn2y0FX6JRSV98HzxatiU+V99I3YZYM5e4mSPioW/jb8N8USRkjKfdNKc6NzjHyy8Lgi/3nOfHfxQP5YsfmdF/s2FxfX0w/R8welq83Zvthe8yUyuTrghmbYFQSd8J0vpyumNjGHJ3l9aMlEWNBn9A7E6gAO2LKN3tAd8x27X5a58zyvyZAW6huFw/7zs1CdVxnRzUPeJxZL7b8GG3qsSe91FFfNw99u/4O4P+P3t8nOf5NPiCd8aZD3X/BvEEV5HD5hLpL7+cf/vl7gj5HM3vN1UoDTwSvacGJ6Fp9fX1XLh91Ks2A3Xh/ia6aLTudmp/S18Gz9eabtbWz9U5XW/scp9OjSMx8/GfpO6YZjjGcZHiQ4SGGjzE8zvAlhicCfMhXGF5n+Fk+9/g5OhVpyM/DU0F+wfQwP0zv5GE6rC2ABd06clhFAPfZxINyYjee4aSvAzlu230HwXXclYeJuxlDmi4zBc3DfJgtwEcKloepo6wKHWakT22z5EmatZVKuyx5i9KpctbyGzXkPnAivfUomfrv83UoLXLe4UYixDNeg8pTeMonp28FjjESHc20n4NpeYjPMfL5guaKvsBIDORbXuenGImOZtbPwRwxkaaDSZ/TmkjTC8SzU6NmL5hOnE8l8sqzcxMV6Vww6bxGEkwSXlJSJxV9SdZYWfYlsgN7wdEng/aoVg7sBR8HdpAOVpRZ2ortmJh+pOZ7ZJUz6UZe1oe5qeeV4EladHiHeHjiVXsUFMndSzIS4esFzYH9dOC8ZQf2Rt9hOaAm5xuMrNiLwmqgcPZQq65KzXBzoKtneag1F9O6XrmNYOIkuH07Vi5LDp5rhheVLxI0XN7kFh7XGnXQXJ8a3vVJR1ltuhW0SABskkCOerWCO115Y4PsP90q6J6Vm5L09bmcedwU22/tBPitzEV+3jAdRcP80jyd2gssyk2x1bsdmMdNsfPcCczjpth57moUNWJMd/VeIOWtwHLcFLOcYdorl4fNsfWJPdsJp2c7zC4s/YcOKx2doEkHXifdVmD5rp+HzBl3ZnRR/4uZOa8+WfbzjyfI7XVk/Yle7jB4vwaPipQqfW9BucNcutPnzeFpqT8ZRUMlPzuSERmDzZSiw1w5AuaKRbHPcfNTwX5SM+EIGDA6w7jjaZ+b/QUwaQqOsrU0TMUUmCW6gP32E2Y/CqbOztm18tVc2M9WjVO1frZNnlEpQLmqcIgtnL5NsxesHb1EsnkUQVk8DpXUO+/xoMZE8hNg4Oxc+5Izw0EweXR5cw59LPPnJTB/dpbbp6Z5MIt0yZpxlAfjSCdpJlIeTCSdpBlKeTCUdJJmLuXBXNJJmtGUB6NJJ2mmUx5MJ52kGVB5MKB0kmZGHQEz6gHmwiQYO7okj6F00MHglKexHdmBzXcKLu+SnRbGR8hyck//QffsQdYFYJ0KGhiWwZUCg0svccUpZBKMr4BBbXaAMsR8SL7m2BEwxx5gydkPBprezD5m2iEw03QZrzoyaCbbUTDZdr/+8AbZGw7ZFfeKtvoAEsNqGagG1t/XijsEVlxwhnW9HTZ2x3gUrLsHbIdJsPeChsGA6tabDzLq97M16NZyZ5swzyifdf0IGHwPMKwm2NDTy9YtkwMeegrothCTq23jAmUdDuDyk/g8mIw7dE1wbrK0RsGUtEuyDEo8OrkbNf25/Ct+e1cS/bn8Jd7ZlUR/Ln+JdwMk6sbpATBbd8P11q608+fy026UDVznNCpnwMy1UGzCZsDY9eJSPrg9Hlw/8/f/qc07CjbvkGNAo+XrsXOtW6J/LSTOiUy11eQLLc5Zl6nyFk/0UhPvH3Bu/3huobEFZB4XYRkS+JljmMKSEQpeRil4GeLgZRSDl/Abl4lCsTAsB6BOodP3cQ8KbHDrq8qE2oH6dkjMY7SV4tyWYrTHo64w6KNdtNetNzLHHHohjJB+SrMYaRbSNYPfhDQKmcIepR9M9jBo913DUGr9shS/Hu+3MbbDPQradT10jYqsqqstTrXa59QlE363+JgXUPjeAKR2QFTLqL0J3upQWxlq64J32My9iQe9siTRrnXqa7jRRJr0AMOK7xQI91xRLCudTq3dxWuJubZqpGk3lgTdYCPp+OGZdbUXgdem+F1ZvPtLR3b82zaOG0nM+5Ksvxek3VDCV+gE3lFiX08CXacuDjEvItEuGfmkf23IfQ+xfkeI907ioMuInTtCGRPPt3PTvSef/PKPzJ/uvK/hvj1C7Wgk+AaJCO9oJKXgy3xTdE/uHr5XYojhMEPJMM0wwzDLcIThKEsfY7iX8UWGUwwfYvgI8z3Kz0cYlhguqB2P6PSfhtQVsWG+HHYE1hK1KsfI58HoSsoXu8cXO+SLHfbFSvCgvdi0cq29hEwQIRtEGLHfKNPfirs+nk1aqVErNYZ3wx00Ehl1tCaVUc5fKmMbriAd3057l4yAL+AVBv/ST87C4Cd8uD+DMUq8MjZPPAdcPEN0uGjIxPDHKOazQXkOuUoalw+7vlAtaNQ0xTiKFoY+28RPV8Y1RdQeTX7WACY8hW+oL1TxoN8+jW1IHrWbgL5DnbVqO8d6mrwqKIGfKT5l1fYYOzR2/Z921cVQn9pT6hnlrEGp+mWoKddzTP3lIOtZXWCoY4apFZ53lETVe8HTZS8W1PaVqaD6+0FK5Kdc3CpekeK/HjRBPJTicIXKtVgwv6cnHG/8pO0ylG+MQYyMG4m7QVknMqk+q0f9s/QF64iDXh7WB+nVd6JlHr1lHs2acbXXPDhTYFvg/wJ1o2spgXAAAA==");
diff --git a/crypto-core/node_modules/brace-expansion/LICENSE b/crypto-core/node_modules/brace-expansion/LICENSE
new file mode 100644
index 0000000..de32266
--- /dev/null
+++ b/crypto-core/node_modules/brace-expansion/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013 Julian Gruber
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/crypto-core/node_modules/brace-expansion/README.md b/crypto-core/node_modules/brace-expansion/README.md
new file mode 100644
index 0000000..6b4e0e1
--- /dev/null
+++ b/crypto-core/node_modules/brace-expansion/README.md
@@ -0,0 +1,129 @@
+# brace-expansion
+
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
+as known from sh/bash, in JavaScript.
+
+[](http://travis-ci.org/juliangruber/brace-expansion)
+[](https://www.npmjs.org/package/brace-expansion)
+[](https://greenkeeper.io/)
+
+[](https://ci.testling.com/juliangruber/brace-expansion)
+
+## Example
+
+```js
+var expand = require('brace-expansion');
+
+expand('file-{a,b,c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('-v{,,}')
+// => ['-v', '-v', '-v']
+
+expand('file{0..2}.jpg')
+// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
+
+expand('file-{a..c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('file{2..0}.jpg')
+// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
+
+expand('file{0..4..2}.jpg')
+// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
+
+expand('file-{a..e..2}.jpg')
+// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
+
+expand('file{00..10..5}.jpg')
+// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
+
+expand('{{A..C},{a..c}}')
+// => ['A', 'B', 'C', 'a', 'b', 'c']
+
+expand('ppp{,config,oe{,conf}}')
+// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
+```
+
+## API
+
+```js
+var expand = require('brace-expansion');
+```
+
+### var expanded = expand(str)
+
+Return an array of all possible and valid expansions of `str`. If none are
+found, `[str]` is returned.
+
+Valid expansions are:
+
+```js
+/^(.*,)+(.+)?$/
+// {a,b,...}
+```
+
+A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+A numeric sequence from `x` to `y` inclusive, with optional increment.
+If `x` or `y` start with a leading `0`, all the numbers will be padded
+to have equal length. Negative numbers and backwards iteration work too.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+An alphabetic sequence from `x` to `y` inclusive, with optional increment.
+`x` and `y` must be exactly one character, and if given, `incr` must be a
+number.
+
+For compatibility reasons, the string `${` is not eligible for brace expansion.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install brace-expansion
+```
+
+## Contributors
+
+- [Julian Gruber](https://github.com/juliangruber)
+- [Isaac Z. Schlueter](https://github.com/isaacs)
+
+## Sponsors
+
+This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
+
+Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/crypto-core/node_modules/brace-expansion/index.js b/crypto-core/node_modules/brace-expansion/index.js
new file mode 100644
index 0000000..0478be8
--- /dev/null
+++ b/crypto-core/node_modules/brace-expansion/index.js
@@ -0,0 +1,201 @@
+var concatMap = require('concat-map');
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+ return parseInt(str, 10) == str
+ ? parseInt(str, 10)
+ : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+ return str.split('\\\\').join(escSlash)
+ .split('\\{').join(escOpen)
+ .split('\\}').join(escClose)
+ .split('\\,').join(escComma)
+ .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+ return str.split(escSlash).join('\\')
+ .split(escOpen).join('{')
+ .split(escClose).join('}')
+ .split(escComma).join(',')
+ .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+ if (!str)
+ return [''];
+
+ var parts = [];
+ var m = balanced('{', '}', str);
+
+ if (!m)
+ return str.split(',');
+
+ var pre = m.pre;
+ var body = m.body;
+ var post = m.post;
+ var p = pre.split(',');
+
+ p[p.length-1] += '{' + body + '}';
+ var postParts = parseCommaParts(post);
+ if (post.length) {
+ p[p.length-1] += postParts.shift();
+ p.push.apply(p, postParts);
+ }
+
+ parts.push.apply(parts, p);
+
+ return parts;
+}
+
+function expandTop(str) {
+ if (!str)
+ return [];
+
+ // I don't know why Bash 4.3 does this, but it does.
+ // Anything starting with {} will have the first two bytes preserved
+ // but *only* at the top level, so {},a}b will not expand to anything,
+ // but a{},b}c will be expanded to [a}c,abc].
+ // One could argue that this is a bug in Bash, but since the goal of
+ // this module is to match Bash's rules, we escape a leading {}
+ if (str.substr(0, 2) === '{}') {
+ str = '\\{\\}' + str.substr(2);
+ }
+
+ return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function identity(e) {
+ return e;
+}
+
+function embrace(str) {
+ return '{' + str + '}';
+}
+function isPadded(el) {
+ return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+ return i <= y;
+}
+function gte(i, y) {
+ return i >= y;
+}
+
+function expand(str, isTop) {
+ var expansions = [];
+
+ var m = balanced('{', '}', str);
+ if (!m || /\$$/.test(m.pre)) return [str];
+
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+ var isSequence = isNumericSequence || isAlphaSequence;
+ var isOptions = m.body.indexOf(',') >= 0;
+ if (!isSequence && !isOptions) {
+ // {a},b}
+ if (m.post.match(/,.*\}/)) {
+ str = m.pre + '{' + m.body + escClose + m.post;
+ return expand(str);
+ }
+ return [str];
+ }
+
+ var n;
+ if (isSequence) {
+ n = m.body.split(/\.\./);
+ } else {
+ n = parseCommaParts(m.body);
+ if (n.length === 1) {
+ // x{{a,b}}y ==> x{a}y x{b}y
+ n = expand(n[0], false).map(embrace);
+ if (n.length === 1) {
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+ return post.map(function(p) {
+ return m.pre + n[0] + p;
+ });
+ }
+ }
+ }
+
+ // at this point, n is the parts, and we know it's not a comma set
+ // with a single entry.
+
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
+ var pre = m.pre;
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+
+ var N;
+
+ if (isSequence) {
+ var x = numeric(n[0]);
+ var y = numeric(n[1]);
+ var width = Math.max(n[0].length, n[1].length)
+ var incr = n.length == 3
+ ? Math.abs(numeric(n[2]))
+ : 1;
+ var test = lte;
+ var reverse = y < x;
+ if (reverse) {
+ incr *= -1;
+ test = gte;
+ }
+ var pad = n.some(isPadded);
+
+ N = [];
+
+ for (var i = x; test(i, y); i += incr) {
+ var c;
+ if (isAlphaSequence) {
+ c = String.fromCharCode(i);
+ if (c === '\\')
+ c = '';
+ } else {
+ c = String(i);
+ if (pad) {
+ var need = width - c.length;
+ if (need > 0) {
+ var z = new Array(need + 1).join('0');
+ if (i < 0)
+ c = '-' + z + c.slice(1);
+ else
+ c = z + c;
+ }
+ }
+ }
+ N.push(c);
+ }
+ } else {
+ N = concatMap(n, function(el) { return expand(el, false) });
+ }
+
+ for (var j = 0; j < N.length; j++) {
+ for (var k = 0; k < post.length; k++) {
+ var expansion = pre + N[j] + post[k];
+ if (!isTop || isSequence || expansion)
+ expansions.push(expansion);
+ }
+ }
+
+ return expansions;
+}
+
diff --git a/crypto-core/node_modules/brace-expansion/package.json b/crypto-core/node_modules/brace-expansion/package.json
new file mode 100644
index 0000000..e1f261e
--- /dev/null
+++ b/crypto-core/node_modules/brace-expansion/package.json
@@ -0,0 +1,75 @@
+{
+ "_from": "brace-expansion@^1.1.7",
+ "_id": "brace-expansion@1.1.11",
+ "_inBundle": false,
+ "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "_location": "/brace-expansion",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "brace-expansion@^1.1.7",
+ "name": "brace-expansion",
+ "escapedName": "brace-expansion",
+ "rawSpec": "^1.1.7",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.7"
+ },
+ "_requiredBy": [
+ "/minimatch"
+ ],
+ "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
+ "_spec": "brace-expansion@^1.1.7",
+ "_where": "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/jsMain/npm/node_modules/minimatch",
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "bugs": {
+ "url": "https://github.com/juliangruber/brace-expansion/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ },
+ "deprecated": false,
+ "description": "Brace expansion as known from sh/bash",
+ "devDependencies": {
+ "matcha": "^0.7.0",
+ "tape": "^4.6.0"
+ },
+ "homepage": "https://github.com/juliangruber/brace-expansion",
+ "keywords": [],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "brace-expansion",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/brace-expansion.git"
+ },
+ "scripts": {
+ "bench": "matcha test/perf/bench.js",
+ "gentest": "bash test/generate.sh",
+ "test": "tape test/*.js"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ },
+ "version": "1.1.11"
+}
diff --git a/crypto-core/node_modules/browser-stdout/LICENSE b/crypto-core/node_modules/browser-stdout/LICENSE
new file mode 100644
index 0000000..775f6ce
--- /dev/null
+++ b/crypto-core/node_modules/browser-stdout/LICENSE
@@ -0,0 +1,5 @@
+Copyright 2018 kumavis
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/crypto-core/node_modules/browser-stdout/README.md b/crypto-core/node_modules/browser-stdout/README.md
new file mode 100644
index 0000000..f32028a
--- /dev/null
+++ b/crypto-core/node_modules/browser-stdout/README.md
@@ -0,0 +1,40 @@
+### wat?
+
+`process.stdout` in your browser.
+
+### wai?
+
+iono. cuz hakz.
+
+### hau?
+
+```js
+var BrowserStdout = require('browser-stdout')
+
+myStream.pipe(BrowserStdout())
+```
+
+### monkey
+
+You can monkey-patch `process.stdout` for your dependency graph like this:
+
+```
+process.stdout = require('browser-stdout')()
+var coolTool = require('module-that-uses-stdout-somewhere-in-its-depths')
+```
+
+### opts
+
+opts are passed directly to `stream.Writable`.
+additionally, a label arg can be used to label console output.
+
+```js
+BrowserStdout({
+ objectMode: true,
+ label: 'dataz',
+})
+```
+
+### ur doin it rong
+
+i accept pr's.
\ No newline at end of file
diff --git a/crypto-core/node_modules/browser-stdout/index.js b/crypto-core/node_modules/browser-stdout/index.js
new file mode 100644
index 0000000..daf39c3
--- /dev/null
+++ b/crypto-core/node_modules/browser-stdout/index.js
@@ -0,0 +1,25 @@
+var WritableStream = require('stream').Writable
+var inherits = require('util').inherits
+
+module.exports = BrowserStdout
+
+
+inherits(BrowserStdout, WritableStream)
+
+function BrowserStdout(opts) {
+ if (!(this instanceof BrowserStdout)) return new BrowserStdout(opts)
+
+ opts = opts || {}
+ WritableStream.call(this, opts)
+ this.label = (opts.label !== undefined) ? opts.label : 'stdout'
+}
+
+BrowserStdout.prototype._write = function(chunks, encoding, cb) {
+ var output = chunks.toString ? chunks.toString() : chunks
+ if (this.label === false) {
+ console.log(output)
+ } else {
+ console.log(this.label+':', output)
+ }
+ process.nextTick(cb)
+}
diff --git a/crypto-core/node_modules/browser-stdout/package.json b/crypto-core/node_modules/browser-stdout/package.json
new file mode 100644
index 0000000..1c78074
--- /dev/null
+++ b/crypto-core/node_modules/browser-stdout/package.json
@@ -0,0 +1,46 @@
+{
+ "_from": "browser-stdout@1.3.1",
+ "_id": "browser-stdout@1.3.1",
+ "_inBundle": false,
+ "_integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "_location": "/browser-stdout",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "browser-stdout@1.3.1",
+ "name": "browser-stdout",
+ "escapedName": "browser-stdout",
+ "rawSpec": "1.3.1",
+ "saveSpec": null,
+ "fetchSpec": "1.3.1"
+ },
+ "_requiredBy": [
+ "/mocha"
+ ],
+ "_resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "_shasum": "baa559ee14ced73452229bad7326467c61fabd60",
+ "_spec": "browser-stdout@1.3.1",
+ "_where": "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/jsMain/npm/node_modules/mocha",
+ "author": {
+ "name": "kumavis"
+ },
+ "bugs": {
+ "url": "https://github.com/kumavis/browser-stdout/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "`process.stdout` in your browser.",
+ "homepage": "https://github.com/kumavis/browser-stdout#readme",
+ "license": "ISC",
+ "main": "index.js",
+ "name": "browser-stdout",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/kumavis/browser-stdout.git"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "version": "1.3.1"
+}
diff --git a/crypto-core/node_modules/commander/CHANGELOG.md b/crypto-core/node_modules/commander/CHANGELOG.md
new file mode 100644
index 0000000..5e2f813
--- /dev/null
+++ b/crypto-core/node_modules/commander/CHANGELOG.md
@@ -0,0 +1,356 @@
+
+2.15.0 / 2018-03-07
+==================
+
+ * Update downloads badge to point to graph of downloads over time instead of duplicating link to npm
+ * Arguments description
+
+2.14.1 / 2018-02-07
+==================
+
+ * Fix typing of help function
+
+2.14.0 / 2018-02-05
+==================
+
+ * only register the option:version event once
+ * Fixes issue #727: Passing empty string for option on command is set to undefined
+ * enable eqeqeq rule
+ * resolves #754 add linter configuration to project
+ * resolves #560 respect custom name for version option
+ * document how to override the version flag
+ * document using options per command
+
+2.13.0 / 2018-01-09
+==================
+
+ * Do not print default for --no-
+ * remove trailing spaces in command help
+ * Update CI's Node.js to LTS and latest version
+ * typedefs: Command and Option types added to commander namespace
+
+2.12.2 / 2017-11-28
+==================
+
+ * fix: typings are not shipped
+
+2.12.1 / 2017-11-23
+==================
+
+ * Move @types/node to dev dependency
+
+2.12.0 / 2017-11-22
+==================
+
+ * add attributeName() method to Option objects
+ * Documentation updated for options with --no prefix
+ * typings: `outputHelp` takes a string as the first parameter
+ * typings: use overloads
+ * feat(typings): update to match js api
+ * Print default value in option help
+ * Fix translation error
+ * Fail when using same command and alias (#491)
+ * feat(typings): add help callback
+ * fix bug when description is add after command with options (#662)
+ * Format js code
+ * Rename History.md to CHANGELOG.md (#668)
+ * feat(typings): add typings to support TypeScript (#646)
+ * use current node
+
+2.11.0 / 2017-07-03
+==================
+
+ * Fix help section order and padding (#652)
+ * feature: support for signals to subcommands (#632)
+ * Fixed #37, --help should not display first (#447)
+ * Fix translation errors. (#570)
+ * Add package-lock.json
+ * Remove engines
+ * Upgrade package version
+ * Prefix events to prevent conflicts between commands and options (#494)
+ * Removing dependency on graceful-readlink
+ * Support setting name in #name function and make it chainable
+ * Add .vscode directory to .gitignore (Visual Studio Code metadata)
+ * Updated link to ruby commander in readme files
+
+2.10.0 / 2017-06-19
+==================
+
+ * Update .travis.yml. drop support for older node.js versions.
+ * Fix require arguments in README.md
+ * On SemVer you do not start from 0.0.1
+ * Add missing semi colon in readme
+ * Add save param to npm install
+ * node v6 travis test
+ * Update Readme_zh-CN.md
+ * Allow literal '--' to be passed-through as an argument
+ * Test subcommand alias help
+ * link build badge to master branch
+ * Support the alias of Git style sub-command
+ * added keyword commander for better search result on npm
+ * Fix Sub-Subcommands
+ * test node.js stable
+ * Fixes TypeError when a command has an option called `--description`
+ * Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets.
+ * Add chinese Readme file
+
+2.9.0 / 2015-10-13
+==================
+
+ * Add option `isDefault` to set default subcommand #415 @Qix-
+ * Add callback to allow filtering or post-processing of help text #434 @djulien
+ * Fix `undefined` text in help information close #414 #416 @zhiyelee
+
+2.8.1 / 2015-04-22
+==================
+
+ * Back out `support multiline description` Close #396 #397
+
+2.8.0 / 2015-04-07
+==================
+
+ * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee
+ * Fix bug in Git-style sub-commands #372 @zhiyelee
+ * Allow commands to be hidden from help #383 @tonylukasavage
+ * When git-style sub-commands are in use, yet none are called, display help #382 @claylo
+ * Add ability to specify arguments syntax for top-level command #258 @rrthomas
+ * Support multiline descriptions #208 @zxqfox
+
+2.7.1 / 2015-03-11
+==================
+
+ * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
+
+2.7.0 / 2015-03-09
+==================
+
+ * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
+ * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
+ * Add support for camelCase on `opts()`. Close #353 @nkzawa
+ * Add node.js 0.12 and io.js to travis.yml
+ * Allow RegEx options. #337 @palanik
+ * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito
+ * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee
+
+2.6.0 / 2014-12-30
+==================
+
+ * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee
+ * Add application description to the help msg. Close #112 @dalssoft
+
+2.5.1 / 2014-12-15
+==================
+
+ * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
+
+2.5.0 / 2014-10-24
+==================
+
+ * add support for variadic arguments. Closes #277 @whitlockjc
+
+2.4.0 / 2014-10-17
+==================
+
+ * fixed a bug on executing the coercion function of subcommands option. Closes #270
+ * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage
+ * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
+ * fixed a bug on subcommand name. Closes #248 @jonathandelgado
+ * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
+
+2.3.0 / 2014-07-16
+==================
+
+ * add command alias'. Closes PR #210
+ * fix: Typos. Closes #99
+ * fix: Unused fs module. Closes #217
+
+2.2.0 / 2014-03-29
+==================
+
+ * add passing of previous option value
+ * fix: support subcommands on windows. Closes #142
+ * Now the defaultValue passed as the second argument of the coercion function.
+
+2.1.0 / 2013-11-21
+==================
+
+ * add: allow cflag style option params, unit test, fixes #174
+
+2.0.0 / 2013-07-18
+==================
+
+ * remove input methods (.prompt, .confirm, etc)
+
+1.3.2 / 2013-07-18
+==================
+
+ * add support for sub-commands to co-exist with the original command
+
+1.3.1 / 2013-07-18
+==================
+
+ * add quick .runningCommand hack so you can opt-out of other logic when running a sub command
+
+1.3.0 / 2013-07-09
+==================
+
+ * add EACCES error handling
+ * fix sub-command --help
+
+1.2.0 / 2013-06-13
+==================
+
+ * allow "-" hyphen as an option argument
+ * support for RegExp coercion
+
+1.1.1 / 2012-11-20
+==================
+
+ * add more sub-command padding
+ * fix .usage() when args are present. Closes #106
+
+1.1.0 / 2012-11-16
+==================
+
+ * add git-style executable subcommand support. Closes #94
+
+1.0.5 / 2012-10-09
+==================
+
+ * fix `--name` clobbering. Closes #92
+ * fix examples/help. Closes #89
+
+1.0.4 / 2012-09-03
+==================
+
+ * add `outputHelp()` method.
+
+1.0.3 / 2012-08-30
+==================
+
+ * remove invalid .version() defaulting
+
+1.0.2 / 2012-08-24
+==================
+
+ * add `--foo=bar` support [arv]
+ * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
+
+1.0.1 / 2012-08-03
+==================
+
+ * fix issue #56
+ * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
+
+1.0.0 / 2012-07-05
+==================
+
+ * add support for optional option descriptions
+ * add defaulting of `.version()` to package.json's version
+
+0.6.1 / 2012-06-01
+==================
+
+ * Added: append (yes or no) on confirmation
+ * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10
+==================
+
+ * Added `.prompt(obj, callback)` support. Closes #49
+ * Added default support to .choose(). Closes #41
+ * Fixed the choice example
+
+0.5.1 / 2011-12-20
+==================
+
+ * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04
+==================
+
+ * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04
+==================
+
+ * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24
+==================
+
+ * Added travis support
+ * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18
+==================
+
+ * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15
+==================
+
+ * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14
+==================
+
+ * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01
+==================
+
+ * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31
+==================
+
+ * Changed `--version` short flag to `-V` from `-v`
+ * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31
+==================
+
+ * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24
+==================
+
+ * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26
+==================
+
+ * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24
+==================
+
+ * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18
+==================
+
+ * Changed: when the user enters nothing prompt for password again
+ * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15
+==================
+
+ * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15
+==================
+
+ * Added default option value support
+
+0.0.2 / 2011-08-15
+==================
+
+ * Added mask support to `Command#password(str[, mask], fn)`
+ * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/crypto-core/node_modules/commander/LICENSE b/crypto-core/node_modules/commander/LICENSE
new file mode 100644
index 0000000..10f997a
--- /dev/null
+++ b/crypto-core/node_modules/commander/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/crypto-core/node_modules/commander/Readme.md b/crypto-core/node_modules/commander/Readme.md
new file mode 100644
index 0000000..a29da40
--- /dev/null
+++ b/crypto-core/node_modules/commander/Readme.md
@@ -0,0 +1,408 @@
+# Commander.js
+
+
+[](http://travis-ci.org/tj/commander.js)
+[](https://www.npmjs.org/package/commander)
+[](https://npmcharts.com/compare/commander?minimal=true)
+[](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
+ [API documentation](http://tj.github.com/commander.js/)
+
+
+## Installation
+
+ $ npm install commander --save
+
+## Option parsing
+
+Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .option('-p, --peppers', 'Add peppers')
+ .option('-P, --pineapple', 'Add pineapple')
+ .option('-b, --bbq-sauce', 'Add bbq sauce')
+ .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+ .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log(' - peppers');
+if (program.pineapple) console.log(' - pineapple');
+if (program.bbqSauce) console.log(' - bbq');
+console.log(' - %s cheese', program.cheese);
+```
+
+Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .option('--no-sauce', 'Remove sauce')
+ .parse(process.argv);
+
+console.log('you ordered a pizza');
+if (program.sauce) console.log(' with sauce');
+else console.log(' without sauce');
+```
+
+## Version option
+
+Calling the `version` implicitly adds the `-V` and `--version` options to the command.
+When either of these options is present, the command prints the version number and exits.
+
+ $ ./examples/pizza -V
+ 0.0.1
+
+If you want your program to respond to the `-v` option instead of the `-V` option, simply pass custom flags to the `version` method using the same syntax as the `option` method.
+
+```js
+program
+ .version('0.0.1', '-v, --version')
+```
+
+The version flags can be named anything, but the long option is required.
+
+## Command-specific options
+
+You can attach options to a command.
+
+```js
+#!/usr/bin/env node
+
+var program = require('commander');
+
+program
+ .command('rm ')
+ .option('-r, --recursive', 'Remove recursively')
+ .action(function (dir, cmd) {
+ console.log('remove ' + dir + (cmd.recursive ? ' recursively' : ''))
+ })
+
+program.parse(process.argv)
+```
+
+A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated.
+
+## Coercion
+
+```js
+function range(val) {
+ return val.split('..').map(Number);
+}
+
+function list(val) {
+ return val.split(',');
+}
+
+function collect(val, memo) {
+ memo.push(val);
+ return memo;
+}
+
+function increaseVerbosity(v, total) {
+ return total + 1;
+}
+
+program
+ .version('0.1.0')
+ .usage('[options] ')
+ .option('-i, --integer ', 'An integer argument', parseInt)
+ .option('-f, --float ', 'A float argument', parseFloat)
+ .option('-r, --range ..', 'A range', range)
+ .option('-l, --list ', 'A list', list)
+ .option('-o, --optional [value]', 'An optional value')
+ .option('-c, --collect [value]', 'A repeatable value', collect, [])
+ .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)
+ .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' collect: %j', program.collect);
+console.log(' verbosity: %j', program.verbose);
+console.log(' args: %j', program.args);
+```
+
+## Regular Expression
+```js
+program
+ .version('0.1.0')
+ .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium')
+ .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
+ .parse(process.argv);
+
+console.log(' size: %j', program.size);
+console.log(' drink: %j', program.drink);
+```
+
+## Variadic arguments
+
+ The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to
+ append `...` to the argument name. Here is an example:
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .command('rmdir [otherDirs...]')
+ .action(function (dir, otherDirs) {
+ console.log('rmdir %s', dir);
+ if (otherDirs) {
+ otherDirs.forEach(function (oDir) {
+ console.log('rmdir %s', oDir);
+ });
+ }
+ });
+
+program.parse(process.argv);
+```
+
+ An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed
+ to your action as demonstrated above.
+
+## Specify the argument syntax
+
+```js
+#!/usr/bin/env node
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .arguments(' [env]')
+ .action(function (cmd, env) {
+ cmdValue = cmd;
+ envValue = env;
+ });
+
+program.parse(process.argv);
+
+if (typeof cmdValue === 'undefined') {
+ console.error('no command given!');
+ process.exit(1);
+}
+console.log('command:', cmdValue);
+console.log('environment:', envValue || "no environment given");
+```
+Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input.
+
+## Git-style sub-commands
+
+```js
+// file: ./examples/pm
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .command('install [name]', 'install one or more packages')
+ .command('search [query]', 'search with optional query')
+ .command('list', 'list packages installed', {isDefault: true})
+ .parse(process.argv);
+```
+
+When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
+The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.
+
+Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.
+
+If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
+
+### `--harmony`
+
+You can enable `--harmony` option in two ways:
+* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern.
+* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```
+ $ ./examples/pizza --help
+
+ Usage: pizza [options]
+
+ An application for pizzas ordering
+
+ Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -p, --peppers Add peppers
+ -P, --pineapple Add pineapple
+ -b, --bbq Add bbq sauce
+ -c, --cheese Add the specified type of cheese [marble]
+ -C, --no-cheese You do not want any cheese
+
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .option('-f, --foo', 'enable some foo')
+ .option('-b, --bar', 'enable some bar')
+ .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+ console.log(' Examples:');
+ console.log('');
+ console.log(' $ custom-help --help');
+ console.log(' $ custom-help -h');
+ console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -f, --foo enable some foo
+ -b, --bar enable some bar
+ -B, --baz enable some baz
+
+Examples:
+
+ $ custom-help --help
+ $ custom-help -h
+
+```
+
+## .outputHelp(cb)
+
+Output help information without exiting.
+Optional callback cb allows post-processing of help text before it is displayed.
+
+If you want to display help by default (e.g. if no command was provided), you can use something like:
+
+```js
+var program = require('commander');
+var colors = require('colors');
+
+program
+ .version('0.1.0')
+ .command('getstream [url]', 'get stream URL')
+ .parse(process.argv);
+
+if (!process.argv.slice(2).length) {
+ program.outputHelp(make_red);
+}
+
+function make_red(txt) {
+ return colors.red(txt); //display the help text in red on the console
+}
+```
+
+## .help(cb)
+
+ Output help information and exit immediately.
+ Optional callback cb allows post-processing of help text before it is displayed.
+
+## Examples
+
+```js
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .option('-C, --chdir ', 'change the working directory')
+ .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ .option('-T, --no-tests', 'ignore test hook');
+
+program
+ .command('setup [env]')
+ .description('run setup commands for all envs')
+ .option("-s, --setup_mode [mode]", "Which setup mode to use")
+ .action(function(env, options){
+ var mode = options.setup_mode || "normal";
+ env = env || 'all';
+ console.log('setup for %s env(s) with %s mode', env, mode);
+ });
+
+program
+ .command('exec ')
+ .alias('ex')
+ .description('execute the given remote cmd')
+ .option("-e, --exec_mode ", "Which exec mode to use")
+ .action(function(cmd, options){
+ console.log('exec "%s" using %s mode', cmd, options.exec_mode);
+ }).on('--help', function() {
+ console.log(' Examples:');
+ console.log();
+ console.log(' $ deploy exec sequential');
+ console.log(' $ deploy exec async');
+ console.log();
+ });
+
+program
+ .command('*')
+ .action(function(env){
+ console.log('deploying "%s"', env);
+ });
+
+program.parse(process.argv);
+```
+
+More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
+
+## License
+
+MIT
diff --git a/crypto-core/node_modules/commander/index.js b/crypto-core/node_modules/commander/index.js
new file mode 100644
index 0000000..fb648be
--- /dev/null
+++ b/crypto-core/node_modules/commander/index.js
@@ -0,0 +1,1231 @@
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var spawn = require('child_process').spawn;
+var path = require('path');
+var dirname = path.dirname;
+var basename = path.basename;
+var fs = require('fs');
+
+/**
+ * Inherit `Command` from `EventEmitter.prototype`.
+ */
+
+require('util').inherits(Command, EventEmitter);
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command();
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+ this.flags = flags;
+ this.required = ~flags.indexOf('<');
+ this.optional = ~flags.indexOf('[');
+ this.bool = !~flags.indexOf('-no-');
+ flags = flags.split(/[ ,|]+/);
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+ this.long = flags.shift();
+ this.description = description || '';
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function() {
+ return this.long
+ .replace('--', '')
+ .replace('no-', '');
+};
+
+/**
+ * Return option name, in a camelcase format that can be used
+ * as a object attribute key.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.attributeName = function() {
+ return camelcase(this.name());
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg) {
+ return this.short === arg || this.long === arg;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+ this.commands = [];
+ this.options = [];
+ this._execs = {};
+ this._allowUnknownOption = false;
+ this._args = [];
+ this._name = name || '';
+}
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir ', 'change the working directory')
+ * .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function() {
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec ')
+ * .description('run the given remote command')
+ * .action(function(cmd) {
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('teardown [otherDirs...]')
+ * .description('run teardown commands')
+ * .action(function(dir, otherDirs) {
+ * console.log('dir "%s"', dir);
+ * if (otherDirs) {
+ * otherDirs.forEach(function (oDir) {
+ * console.log('dir "%s"', oDir);
+ * });
+ * }
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env) {
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {String} name
+ * @param {String} [desc] for git-style sub-commands
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name, desc, opts) {
+ if (typeof desc === 'object' && desc !== null) {
+ opts = desc;
+ desc = null;
+ }
+ opts = opts || {};
+ var args = name.split(/ +/);
+ var cmd = new Command(args.shift());
+
+ if (desc) {
+ cmd.description(desc);
+ this.executables = true;
+ this._execs[cmd._name] = true;
+ if (opts.isDefault) this.defaultExecutable = cmd._name;
+ }
+ cmd._noHelp = !!opts.noHelp;
+ this.commands.push(cmd);
+ cmd.parseExpectedArgs(args);
+ cmd.parent = this;
+
+ if (desc) return this;
+ return cmd;
+};
+
+/**
+ * Define argument syntax for the top-level command.
+ *
+ * @api public
+ */
+
+Command.prototype.arguments = function(desc) {
+ return this.parseExpectedArgs(desc.split(/ +/));
+};
+
+/**
+ * Add an implicit `help [cmd]` subcommand
+ * which invokes `--help` for the given command.
+ *
+ * @api private
+ */
+
+Command.prototype.addImplicitHelpCommand = function() {
+ this.command('help [cmd]', 'display help for [cmd]');
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args) {
+ if (!args.length) return;
+ var self = this;
+ args.forEach(function(arg) {
+ var argDetails = {
+ required: false,
+ name: '',
+ variadic: false
+ };
+
+ switch (arg[0]) {
+ case '<':
+ argDetails.required = true;
+ argDetails.name = arg.slice(1, -1);
+ break;
+ case '[':
+ argDetails.name = arg.slice(1, -1);
+ break;
+ }
+
+ if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
+ argDetails.variadic = true;
+ argDetails.name = argDetails.name.slice(0, -3);
+ }
+ if (argDetails.name) {
+ self._args.push(argDetails);
+ }
+ });
+ return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function() {
+ * // output help here
+ * });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn) {
+ var self = this;
+ var listener = function(args, unknown) {
+ // Parse any so-far unknown options
+ args = args || [];
+ unknown = unknown || [];
+
+ var parsed = self.parseOptions(unknown);
+
+ // Output help if necessary
+ outputHelpIfNecessary(self, parsed.unknown);
+
+ // If there are still any unknown options, then we simply
+ // die, unless someone asked for help, in which case we give it
+ // to them, and then we die.
+ if (parsed.unknown.length > 0) {
+ self.unknownOption(parsed.unknown[0]);
+ }
+
+ // Leftover arguments need to be pushed back. Fixes issue #56
+ if (parsed.args.length) args = parsed.args.concat(args);
+
+ self._args.forEach(function(arg, i) {
+ if (arg.required && args[i] == null) {
+ self.missingArgument(arg.name);
+ } else if (arg.variadic) {
+ if (i !== self._args.length - 1) {
+ self.variadicArgNotLast(arg.name);
+ }
+
+ args[i] = args.splice(i);
+ }
+ });
+
+ // Always append ourselves to the end of the arguments,
+ // to make sure we match the number of arguments the user
+ // expects
+ if (self._args.length) {
+ args[self._args.length] = self;
+ } else {
+ args.push(self);
+ }
+
+ fn.apply(self, args);
+ };
+ var parent = this.parent || this;
+ var name = parent === this ? '*' : this._name;
+ parent.on('command:' + name, listener);
+ if (this._alias) parent.on('command:' + this._alias, listener);
+ return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * Examples:
+ *
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to true
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => false
+ *
+ * // required argument
+ * program.option('-C, --chdir ', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|*} [fn] or default
+ * @param {*} [defaultValue]
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue) {
+ var self = this,
+ option = new Option(flags, description),
+ oname = option.name(),
+ name = option.attributeName();
+
+ // default as 3rd arg
+ if (typeof fn !== 'function') {
+ if (fn instanceof RegExp) {
+ var regex = fn;
+ fn = function(val, def) {
+ var m = regex.exec(val);
+ return m ? m[0] : def;
+ };
+ } else {
+ defaultValue = fn;
+ fn = null;
+ }
+ }
+
+ // preassign default value only for --no-*, [optional], or
+ if (!option.bool || option.optional || option.required) {
+ // when --no-* we make sure default is true
+ if (!option.bool) defaultValue = true;
+ // preassign only if we have a default
+ if (defaultValue !== undefined) {
+ self[name] = defaultValue;
+ option.defaultValue = defaultValue;
+ }
+ }
+
+ // register the option
+ this.options.push(option);
+
+ // when it's passed assign the value
+ // and conditionally invoke the callback
+ this.on('option:' + oname, function(val) {
+ // coercion
+ if (val !== null && fn) {
+ val = fn(val, self[name] === undefined ? defaultValue : self[name]);
+ }
+
+ // unassigned or bool
+ if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') {
+ // if no value, bool true, and we have a default, then use it!
+ if (val == null) {
+ self[name] = option.bool
+ ? defaultValue || true
+ : false;
+ } else {
+ self[name] = val;
+ }
+ } else if (val !== null) {
+ // reassign
+ self[name] = val;
+ }
+ });
+
+ return this;
+};
+
+/**
+ * Allow unknown options on the command line.
+ *
+ * @param {Boolean} arg if `true` or omitted, no error will be thrown
+ * for unknown options.
+ * @api public
+ */
+Command.prototype.allowUnknownOption = function(arg) {
+ this._allowUnknownOption = arguments.length === 0 || arg;
+ return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv) {
+ // implicit help
+ if (this.executables) this.addImplicitHelpCommand();
+
+ // store raw args
+ this.rawArgs = argv;
+
+ // guess name
+ this._name = this._name || basename(argv[1], '.js');
+
+ // github-style sub-commands with no sub-command
+ if (this.executables && argv.length < 3 && !this.defaultExecutable) {
+ // this user needs help
+ argv.push('--help');
+ }
+
+ // process argv
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+ var args = this.args = parsed.args;
+
+ var result = this.parseArgs(this.args, parsed.unknown);
+
+ // executable sub-commands
+ var name = result.args[0];
+
+ var aliasCommand = null;
+ // check alias of sub commands
+ if (name) {
+ aliasCommand = this.commands.filter(function(command) {
+ return command.alias() === name;
+ })[0];
+ }
+
+ if (this._execs[name] && typeof this._execs[name] !== 'function') {
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (aliasCommand) {
+ // is alias of a subCommand
+ args[0] = aliasCommand._name;
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (this.defaultExecutable) {
+ // use the default subcommand
+ args.unshift(this.defaultExecutable);
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ }
+
+ return result;
+};
+
+/**
+ * Execute a sub-command executable.
+ *
+ * @param {Array} argv
+ * @param {Array} args
+ * @param {Array} unknown
+ * @api private
+ */
+
+Command.prototype.executeSubCommand = function(argv, args, unknown) {
+ args = args.concat(unknown);
+
+ if (!args.length) this.help();
+ if (args[0] === 'help' && args.length === 1) this.help();
+
+ // --help
+ if (args[0] === 'help') {
+ args[0] = args[1];
+ args[1] = '--help';
+ }
+
+ // executable
+ var f = argv[1];
+ // name of the subcommand, link `pm-install`
+ var bin = basename(f, '.js') + '-' + args[0];
+
+ // In case of globally installed, get the base dir where executable
+ // subcommand file should be located at
+ var baseDir,
+ link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;
+
+ // when symbolink is relative path
+ if (link !== f && link.charAt(0) !== '/') {
+ link = path.join(dirname(f), link);
+ }
+ baseDir = dirname(link);
+
+ // prefer local `./` to bin in the $PATH
+ var localBin = path.join(baseDir, bin);
+
+ // whether bin file is a js script with explicit `.js` extension
+ var isExplicitJS = false;
+ if (exists(localBin + '.js')) {
+ bin = localBin + '.js';
+ isExplicitJS = true;
+ } else if (exists(localBin)) {
+ bin = localBin;
+ }
+
+ args = args.slice(1);
+
+ var proc;
+ if (process.platform !== 'win32') {
+ if (isExplicitJS) {
+ args.unshift(bin);
+ // add executable arguments to spawn
+ args = (process.execArgv || []).concat(args);
+
+ proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ } else {
+ proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ }
+ } else {
+ args.unshift(bin);
+ proc = spawn(process.execPath, args, { stdio: 'inherit' });
+ }
+
+ var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
+ signals.forEach(function(signal) {
+ process.on(signal, function() {
+ if (proc.killed === false && proc.exitCode === null) {
+ proc.kill(signal);
+ }
+ });
+ });
+ proc.on('close', process.exit.bind(process));
+ proc.on('error', function(err) {
+ if (err.code === 'ENOENT') {
+ console.error('\n %s(1) does not exist, try --help\n', bin);
+ } else if (err.code === 'EACCES') {
+ console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
+ }
+ process.exit(1);
+ });
+
+ // Store the reference to the child process
+ this.runningCommand = proc;
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ * This also normalizes equal sign and splits "--abc=def" into "--abc def".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args) {
+ var ret = [],
+ arg,
+ lastOpt,
+ index;
+
+ for (var i = 0, len = args.length; i < len; ++i) {
+ arg = args[i];
+ if (i > 0) {
+ lastOpt = this.optionFor(args[i - 1]);
+ }
+
+ if (arg === '--') {
+ // Honor option terminator
+ ret = ret.concat(args.slice(i));
+ break;
+ } else if (lastOpt && lastOpt.required) {
+ ret.push(arg);
+ } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') {
+ arg.slice(1).split('').forEach(function(c) {
+ ret.push('-' + c);
+ });
+ } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
+ ret.push(arg.slice(0, index), arg.slice(index + 1));
+ } else {
+ ret.push(arg);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown) {
+ var name;
+
+ if (args.length) {
+ name = args[0];
+ if (this.listeners('command:' + name).length) {
+ this.emit('command:' + args.shift(), args, unknown);
+ } else {
+ this.emit('command:*', args);
+ }
+ } else {
+ outputHelpIfNecessary(this, unknown);
+
+ // If there were no args and we have unknown options,
+ // then they are extraneous and we need to error.
+ if (unknown.length > 0) {
+ this.unknownOption(unknown[0]);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg) {
+ for (var i = 0, len = this.options.length; i < len; ++i) {
+ if (this.options[i].is(arg)) {
+ return this.options[i];
+ }
+ }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv) {
+ var args = [],
+ len = argv.length,
+ literal,
+ option,
+ arg;
+
+ var unknownOptions = [];
+
+ // parse options
+ for (var i = 0; i < len; ++i) {
+ arg = argv[i];
+
+ // literal args after --
+ if (literal) {
+ args.push(arg);
+ continue;
+ }
+
+ if (arg === '--') {
+ literal = true;
+ continue;
+ }
+
+ // find matching Option
+ option = this.optionFor(arg);
+
+ // option is defined
+ if (option) {
+ // requires arg
+ if (option.required) {
+ arg = argv[++i];
+ if (arg == null) return this.optionMissingArgument(option);
+ this.emit('option:' + option.name(), arg);
+ // optional arg
+ } else if (option.optional) {
+ arg = argv[i + 1];
+ if (arg == null || (arg[0] === '-' && arg !== '-')) {
+ arg = null;
+ } else {
+ ++i;
+ }
+ this.emit('option:' + option.name(), arg);
+ // bool
+ } else {
+ this.emit('option:' + option.name());
+ }
+ continue;
+ }
+
+ // looks like an option
+ if (arg.length > 1 && arg[0] === '-') {
+ unknownOptions.push(arg);
+
+ // If the next argument looks like it might be
+ // an argument for this option, we pass it on.
+ // If it isn't, then it'll simply be ignored
+ if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
+ unknownOptions.push(argv[++i]);
+ }
+ continue;
+ }
+
+ // arg
+ args.push(arg);
+ }
+
+ return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Return an object containing options as key-value pairs
+ *
+ * @return {Object}
+ * @api public
+ */
+Command.prototype.opts = function() {
+ var result = {},
+ len = this.options.length;
+
+ for (var i = 0; i < len; i++) {
+ var key = this.options[i].attributeName();
+ result[key] = key === this._versionOptionName ? this._version : this[key];
+ }
+ return result;
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name) {
+ console.error();
+ console.error(" error: missing required argument `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag) {
+ console.error();
+ if (flag) {
+ console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
+ } else {
+ console.error(" error: option `%s' argument missing", option.flags);
+ }
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag) {
+ if (this._allowUnknownOption) return;
+ console.error();
+ console.error(" error: unknown option `%s'", flag);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Variadic argument with `name` is not the last argument as required.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.variadicArgNotLast = function(name) {
+ console.error();
+ console.error(" error: variadic arguments must be last `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} [flags]
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags) {
+ if (arguments.length === 0) return this._version;
+ this._version = str;
+ flags = flags || '-V, --version';
+ var versionOption = new Option(flags, 'output the version number');
+ this._versionOptionName = versionOption.long.substr(2) || 'version';
+ this.options.push(versionOption);
+ this.on('option:' + this._versionOptionName, function() {
+ process.stdout.write(str + '\n');
+ process.exit(0);
+ });
+ return this;
+};
+
+/**
+ * Set the description to `str`.
+ *
+ * @param {String} str
+ * @param {Object} argsDescription
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str, argsDescription) {
+ if (arguments.length === 0) return this._description;
+ this._description = str;
+ this._argsDescription = argsDescription;
+ return this;
+};
+
+/**
+ * Set an alias for the command
+ *
+ * @param {String} alias
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.alias = function(alias) {
+ var command = this;
+ if (this.commands.length !== 0) {
+ command = this.commands[this.commands.length - 1];
+ }
+
+ if (arguments.length === 0) return command._alias;
+
+ if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
+
+ command._alias = alias;
+ return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str) {
+ var args = this._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ });
+
+ var usage = '[options]' +
+ (this.commands.length ? ' [command]' : '') +
+ (this._args.length ? ' ' + args.join(' ') : '');
+
+ if (arguments.length === 0) return this._usage || usage;
+ this._usage = str;
+
+ return this;
+};
+
+/**
+ * Get or set the name of the command
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.name = function(str) {
+ if (arguments.length === 0) return this._name;
+ this._name = str;
+ return this;
+};
+
+/**
+ * Return prepared commands.
+ *
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.prepareCommands = function() {
+ return this.commands.filter(function(cmd) {
+ return !cmd._noHelp;
+ }).map(function(cmd) {
+ var args = cmd._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ }).join(' ');
+
+ return [
+ cmd._name +
+ (cmd._alias ? '|' + cmd._alias : '') +
+ (cmd.options.length ? ' [options]' : '') +
+ (args ? ' ' + args : ''),
+ cmd._description
+ ];
+ });
+};
+
+/**
+ * Return the largest command length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestCommandLength = function() {
+ var commands = this.prepareCommands();
+ return commands.reduce(function(max, command) {
+ return Math.max(max, command[0].length);
+ }, 0);
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function() {
+ var options = [].slice.call(this.options);
+ options.push({
+ flags: '-h, --help'
+ });
+ return options.reduce(function(max, option) {
+ return Math.max(max, option.flags.length);
+ }, 0);
+};
+
+/**
+ * Return the largest arg length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestArgLength = function() {
+ return this._args.reduce(function(max, arg) {
+ return Math.max(max, arg.name.length);
+ }, 0);
+};
+
+/**
+ * Return the pad width.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.padWidth = function() {
+ var width = this.largestOptionLength();
+ if (this._argsDescription && this._args.length) {
+ if (this.largestArgLength() > width) {
+ width = this.largestArgLength();
+ }
+ }
+
+ if (this.commands && this.commands.length) {
+ if (this.largestCommandLength() > width) {
+ width = this.largestCommandLength();
+ }
+ }
+
+ return width;
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function() {
+ var width = this.padWidth();
+
+ // Append the help information
+ return this.options.map(function(option) {
+ return pad(option.flags, width) + ' ' + option.description +
+ ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : '');
+ }).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
+ .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function() {
+ if (!this.commands.length) return '';
+
+ var commands = this.prepareCommands();
+ var width = this.padWidth();
+
+ return [
+ ' Commands:',
+ '',
+ commands.map(function(cmd) {
+ var desc = cmd[1] ? ' ' + cmd[1] : '';
+ return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
+ }).join('\n').replace(/^/gm, ' '),
+ ''
+ ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function() {
+ var desc = [];
+ if (this._description) {
+ desc = [
+ ' ' + this._description,
+ ''
+ ];
+
+ var argsDescription = this._argsDescription;
+ if (argsDescription && this._args.length) {
+ var width = this.padWidth();
+ desc.push(' Arguments:');
+ desc.push('');
+ this._args.forEach(function(arg) {
+ desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
+ });
+ desc.push('');
+ }
+ }
+
+ var cmdName = this._name;
+ if (this._alias) {
+ cmdName = cmdName + '|' + this._alias;
+ }
+ var usage = [
+ '',
+ ' Usage: ' + cmdName + ' ' + this.usage(),
+ ''
+ ];
+
+ var cmds = [];
+ var commandHelp = this.commandHelp();
+ if (commandHelp) cmds = [commandHelp];
+
+ var options = [
+ ' Options:',
+ '',
+ '' + this.optionHelp().replace(/^/gm, ' '),
+ ''
+ ];
+
+ return usage
+ .concat(desc)
+ .concat(options)
+ .concat(cmds)
+ .join('\n');
+};
+
+/**
+ * Output help information for this command
+ *
+ * @api public
+ */
+
+Command.prototype.outputHelp = function(cb) {
+ if (!cb) {
+ cb = function(passthru) {
+ return passthru;
+ };
+ }
+ process.stdout.write(cb(this.helpInformation()));
+ this.emit('--help');
+};
+
+/**
+ * Output help information and exit.
+ *
+ * @api public
+ */
+
+Command.prototype.help = function(cb) {
+ this.outputHelp(cb);
+ process.exit();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+ return flag.split('-').reduce(function(str, word) {
+ return str + word[0].toUpperCase() + word.slice(1);
+ });
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+ var len = Math.max(0, width - str.length);
+ return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+ options = options || [];
+ for (var i = 0; i < options.length; i++) {
+ if (options[i] === '--help' || options[i] === '-h') {
+ cmd.outputHelp();
+ process.exit(0);
+ }
+ }
+}
+
+/**
+ * Takes an argument an returns its human readable equivalent for help usage.
+ *
+ * @param {Object} arg
+ * @return {String}
+ * @api private
+ */
+
+function humanReadableArgName(arg) {
+ var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
+
+ return arg.required
+ ? '<' + nameOutput + '>'
+ : '[' + nameOutput + ']';
+}
+
+// for versions before node v0.8 when there weren't `fs.existsSync`
+function exists(file) {
+ try {
+ if (fs.statSync(file).isFile()) {
+ return true;
+ }
+ } catch (e) {
+ return false;
+ }
+}
diff --git a/crypto-core/node_modules/commander/package.json b/crypto-core/node_modules/commander/package.json
new file mode 100644
index 0000000..19a3c3c
--- /dev/null
+++ b/crypto-core/node_modules/commander/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "commander@2.15.1",
+ "_id": "commander@2.15.1",
+ "_inBundle": false,
+ "_integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
+ "_location": "/commander",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "commander@2.15.1",
+ "name": "commander",
+ "escapedName": "commander",
+ "rawSpec": "2.15.1",
+ "saveSpec": null,
+ "fetchSpec": "2.15.1"
+ },
+ "_requiredBy": [
+ "/mocha"
+ ],
+ "_resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
+ "_shasum": "df46e867d0fc2aec66a34662b406a9ccafff5b0f",
+ "_spec": "commander@2.15.1",
+ "_where": "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/jsMain/npm/node_modules/mocha",
+ "author": {
+ "name": "TJ Holowaychuk",
+ "email": "tj@vision-media.ca"
+ },
+ "bugs": {
+ "url": "https://github.com/tj/commander.js/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "the complete solution for node.js command-line programs",
+ "devDependencies": {
+ "@types/node": "^7.0.55",
+ "eslint": "^3.19.0",
+ "should": "^11.2.1",
+ "sinon": "^2.4.1",
+ "standard": "^10.0.3",
+ "typescript": "^2.7.2"
+ },
+ "files": [
+ "index.js",
+ "typings/index.d.ts"
+ ],
+ "homepage": "https://github.com/tj/commander.js#readme",
+ "keywords": [
+ "commander",
+ "command",
+ "option",
+ "parser"
+ ],
+ "license": "MIT",
+ "main": "index",
+ "name": "commander",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tj/commander.js.git"
+ },
+ "scripts": {
+ "lint": "eslint index.js",
+ "test": "make test && npm run test-typings",
+ "test-typings": "node_modules/typescript/bin/tsc -p tsconfig.json"
+ },
+ "typings": "typings/index.d.ts",
+ "version": "2.15.1"
+}
diff --git a/crypto-core/node_modules/commander/typings/index.d.ts b/crypto-core/node_modules/commander/typings/index.d.ts
new file mode 100644
index 0000000..4830767
--- /dev/null
+++ b/crypto-core/node_modules/commander/typings/index.d.ts
@@ -0,0 +1,309 @@
+// Type definitions for commander 2.11
+// Project: https://github.com/visionmedia/commander.js
+// Definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare namespace local {
+
+ class Option {
+ flags: string;
+ required: boolean;
+ optional: boolean;
+ bool: boolean;
+ short?: string;
+ long: string;
+ description: string;
+
+ /**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {string} flags
+ * @param {string} [description]
+ */
+ constructor(flags: string, description?: string);
+ }
+
+ class Command extends NodeJS.EventEmitter {
+ [key: string]: any;
+
+ args: string[];
+
+ /**
+ * Initialize a new `Command`.
+ *
+ * @param {string} [name]
+ */
+ constructor(name?: string);
+
+ /**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {string} str
+ * @param {string} [flags]
+ * @returns {Command} for chaining
+ */
+ version(str: string, flags?: string): Command;
+
+ /**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * @example
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir ', 'change the working directory')
+ * .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function() {
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec ')
+ * .description('run the given remote command')
+ * .action(function(cmd) {
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('teardown [otherDirs...]')
+ * .description('run teardown commands')
+ * .action(function(dir, otherDirs) {
+ * console.log('dir "%s"', dir);
+ * if (otherDirs) {
+ * otherDirs.forEach(function (oDir) {
+ * console.log('dir "%s"', oDir);
+ * });
+ * }
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env) {
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {string} name
+ * @param {string} [desc] for git-style sub-commands
+ * @param {CommandOptions} [opts] command options
+ * @returns {Command} the new command
+ */
+ command(name: string, desc?: string, opts?: commander.CommandOptions): Command;
+
+ /**
+ * Define argument syntax for the top-level command.
+ *
+ * @param {string} desc
+ * @returns {Command} for chaining
+ */
+ arguments(desc: string): Command;
+
+ /**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {string[]} args
+ * @returns {Command} for chaining
+ */
+ parseExpectedArgs(args: string[]): Command;
+
+ /**
+ * Register callback `fn` for the command.
+ *
+ * @example
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function() {
+ * // output help here
+ * });
+ *
+ * @param {(...args: any[]) => void} fn
+ * @returns {Command} for chaining
+ */
+ action(fn: (...args: any[]) => void): Command;
+
+ /**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * @example
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to true
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => false
+ *
+ * // required argument
+ * program.option('-C, --chdir ', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {string} flags
+ * @param {string} [description]
+ * @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default
+ * @param {*} [defaultValue]
+ * @returns {Command} for chaining
+ */
+ option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
+ option(flags: string, description?: string, defaultValue?: any): Command;
+
+ /**
+ * Allow unknown options on the command line.
+ *
+ * @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options.
+ * @returns {Command} for chaining
+ */
+ allowUnknownOption(arg?: boolean): Command;
+
+ /**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {string[]} argv
+ * @returns {Command} for chaining
+ */
+ parse(argv: string[]): Command;
+
+ /**
+ * Parse options from `argv` returning `argv` void of these options.
+ *
+ * @param {string[]} argv
+ * @returns {ParseOptionsResult}
+ */
+ parseOptions(argv: string[]): commander.ParseOptionsResult;
+
+ /**
+ * Return an object containing options as key-value pairs
+ *
+ * @returns {{[key: string]: string}}
+ */
+ opts(): { [key: string]: string };
+
+ /**
+ * Set the description to `str`.
+ *
+ * @param {string} str
+ * @return {(Command | string)}
+ */
+ description(str: string): Command;
+ description(): string;
+
+ /**
+ * Set an alias for the command.
+ *
+ * @param {string} alias
+ * @return {(Command | string)}
+ */
+ alias(alias: string): Command;
+ alias(): string;
+
+ /**
+ * Set or get the command usage.
+ *
+ * @param {string} str
+ * @return {(Command | string)}
+ */
+ usage(str: string): Command;
+ usage(): string;
+
+ /**
+ * Set the name of the command.
+ *
+ * @param {string} str
+ * @return {Command}
+ */
+ name(str: string): Command;
+
+ /**
+ * Get the name of the command.
+ *
+ * @return {string}
+ */
+ name(): string;
+
+ /**
+ * Output help information for this command.
+ *
+ * @param {(str: string) => string} [cb]
+ */
+ outputHelp(cb?: (str: string) => string): void;
+
+ /** Output help information and exit.
+ *
+ * @param {(str: string) => string} [cb]
+ */
+ help(cb?: (str: string) => string): void;
+ }
+
+}
+
+declare namespace commander {
+
+ type Command = local.Command
+
+ type Option = local.Option
+
+ interface CommandOptions {
+ noHelp?: boolean;
+ isDefault?: boolean;
+ }
+
+ interface ParseOptionsResult {
+ args: string[];
+ unknown: string[];
+ }
+
+ interface CommanderStatic extends Command {
+ Command: typeof local.Command;
+ Option: typeof local.Option;
+ CommandOptions: CommandOptions;
+ ParseOptionsResult: ParseOptionsResult;
+ }
+
+}
+
+declare const commander: commander.CommanderStatic;
+export = commander;
diff --git a/crypto-core/node_modules/concat-map/.travis.yml b/crypto-core/node_modules/concat-map/.travis.yml
new file mode 100644
index 0000000..f1d0f13
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/crypto-core/node_modules/concat-map/LICENSE b/crypto-core/node_modules/concat-map/LICENSE
new file mode 100644
index 0000000..ee27ba4
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/crypto-core/node_modules/concat-map/README.markdown b/crypto-core/node_modules/concat-map/README.markdown
new file mode 100644
index 0000000..408f70a
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/README.markdown
@@ -0,0 +1,62 @@
+concat-map
+==========
+
+Concatenative mapdashery.
+
+[](http://ci.testling.com/substack/node-concat-map)
+
+[](http://travis-ci.org/substack/node-concat-map)
+
+example
+=======
+
+``` js
+var concatMap = require('concat-map');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+ return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
+```
+
+***
+
+```
+[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
+```
+
+methods
+=======
+
+``` js
+var concatMap = require('concat-map')
+```
+
+concatMap(xs, fn)
+-----------------
+
+Return an array of concatenated elements by calling `fn(x, i)` for each element
+`x` and each index `i` in the array `xs`.
+
+When `fn(x, i)` returns an array, its result will be concatenated with the
+result array. If `fn(x, i)` returns anything else, that value will be pushed
+onto the end of the result array.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install concat-map
+```
+
+license
+=======
+
+MIT
+
+notes
+=====
+
+This module was written while sitting high above the ground in a tree.
diff --git a/crypto-core/node_modules/concat-map/example/map.js b/crypto-core/node_modules/concat-map/example/map.js
new file mode 100644
index 0000000..3365621
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/example/map.js
@@ -0,0 +1,6 @@
+var concatMap = require('../');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+ return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
diff --git a/crypto-core/node_modules/concat-map/index.js b/crypto-core/node_modules/concat-map/index.js
new file mode 100644
index 0000000..b29a781
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/index.js
@@ -0,0 +1,13 @@
+module.exports = function (xs, fn) {
+ var res = [];
+ for (var i = 0; i < xs.length; i++) {
+ var x = fn(xs[i], i);
+ if (isArray(x)) res.push.apply(res, x);
+ else res.push(x);
+ }
+ return res;
+};
+
+var isArray = Array.isArray || function (xs) {
+ return Object.prototype.toString.call(xs) === '[object Array]';
+};
diff --git a/crypto-core/node_modules/concat-map/package.json b/crypto-core/node_modules/concat-map/package.json
new file mode 100644
index 0000000..fc3f237
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/package.json
@@ -0,0 +1,88 @@
+{
+ "_from": "concat-map@0.0.1",
+ "_id": "concat-map@0.0.1",
+ "_inBundle": false,
+ "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "_location": "/concat-map",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "concat-map@0.0.1",
+ "name": "concat-map",
+ "escapedName": "concat-map",
+ "rawSpec": "0.0.1",
+ "saveSpec": null,
+ "fetchSpec": "0.0.1"
+ },
+ "_requiredBy": [
+ "/brace-expansion"
+ ],
+ "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
+ "_spec": "concat-map@0.0.1",
+ "_where": "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/jsMain/npm/node_modules/brace-expansion",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": {
+ "url": "https://github.com/substack/node-concat-map/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "concatenative mapdashery",
+ "devDependencies": {
+ "tape": "~2.4.0"
+ },
+ "directories": {
+ "example": "example",
+ "test": "test"
+ },
+ "homepage": "https://github.com/substack/node-concat-map#readme",
+ "keywords": [
+ "concat",
+ "concatMap",
+ "map",
+ "functional",
+ "higher-order"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "concat-map",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/substack/node-concat-map.git"
+ },
+ "scripts": {
+ "test": "tape test/*.js"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": {
+ "ie": [
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "ff": [
+ 3.5,
+ 10,
+ 15
+ ],
+ "chrome": [
+ 10,
+ 22
+ ],
+ "safari": [
+ 5.1
+ ],
+ "opera": [
+ 12
+ ]
+ }
+ },
+ "version": "0.0.1"
+}
diff --git a/crypto-core/node_modules/concat-map/test/map.js b/crypto-core/node_modules/concat-map/test/map.js
new file mode 100644
index 0000000..fdbd702
--- /dev/null
+++ b/crypto-core/node_modules/concat-map/test/map.js
@@ -0,0 +1,39 @@
+var concatMap = require('../');
+var test = require('tape');
+
+test('empty or not', function (t) {
+ var xs = [ 1, 2, 3, 4, 5, 6 ];
+ var ixes = [];
+ var ys = concatMap(xs, function (x, ix) {
+ ixes.push(ix);
+ return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+ });
+ t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
+ t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
+ t.end();
+});
+
+test('always something', function (t) {
+ var xs = [ 'a', 'b', 'c', 'd' ];
+ var ys = concatMap(xs, function (x) {
+ return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
+ });
+ t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
+ t.end();
+});
+
+test('scalars', function (t) {
+ var xs = [ 'a', 'b', 'c', 'd' ];
+ var ys = concatMap(xs, function (x) {
+ return x === 'b' ? [ 'B', 'B', 'B' ] : x;
+ });
+ t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
+ t.end();
+});
+
+test('undefs', function (t) {
+ var xs = [ 'a', 'b', 'c', 'd' ];
+ var ys = concatMap(xs, function () {});
+ t.same(ys, [ undefined, undefined, undefined, undefined ]);
+ t.end();
+});
diff --git a/crypto-core/node_modules/crypto-core.js b/crypto-core/node_modules/crypto-core.js
new file mode 100644
index 0000000..1eb3685
--- /dev/null
+++ b/crypto-core/node_modules/crypto-core.js
@@ -0,0 +1,1226 @@
+(function (_, Kotlin, $module$bignum) {
+ 'use strict';
+ var $$importsForInline$$ = _.$$importsForInline$$ || (_.$$importsForInline$$ = {});
+ var chunked = Kotlin.kotlin.collections.chunked_ba2ldo$;
+ var joinToString = Kotlin.kotlin.collections.joinToString_fmv235$;
+ var println = Kotlin.kotlin.io.println_s8jyv4$;
+ var toString = Kotlin.kotlin.text.toString_aogav3$;
+ var toString_0 = Kotlin.kotlin.text.toString_hc3rh$;
+ var defineInlineFunction = Kotlin.defineInlineFunction;
+ var wrapFunction = Kotlin.wrapFunction;
+ var toString_1 = Kotlin.kotlin.text.toString_dqglrj$;
+ var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_ww73n8$;
+ var UInt_init = Kotlin.kotlin.UInt;
+ var ULong_init = Kotlin.kotlin.ULong;
+ var encodeToByteArray = Kotlin.kotlin.text.encodeToByteArray_pdl1vz$;
+ var toList = Kotlin.kotlin.collections.toList_7wnvza$;
+ var UByte = Kotlin.kotlin.UByte;
+ var toBigInteger = $module$bignum.com.ionspin.kotlin.bignum.integer.toBigInteger_s8ev3n$;
+ var toList_0 = Kotlin.kotlin.collections.toList_us0mfu$;
+ var IllegalStateException_init = Kotlin.kotlin.IllegalStateException_init_pdl1vj$;
+ var Kind_OBJECT = Kotlin.Kind.OBJECT;
+ var Kind_CLASS = Kotlin.Kind.CLASS;
+ var L255 = Kotlin.Long.fromInt(255);
+ var Array_0 = Array;
+ var copyToArray = Kotlin.kotlin.collections.copyToArray;
+ var collectionSizeOrDefault = Kotlin.kotlin.collections.collectionSizeOrDefault_ba2ldo$;
+ var toByte = Kotlin.toByte;
+ var arrayCopy = Kotlin.kotlin.collections.arrayCopy;
+ var ArrayList_init_0 = Kotlin.kotlin.collections.ArrayList_init_287e2$;
+ var addAll = Kotlin.kotlin.collections.addAll_ipc267$;
+ var until = Kotlin.kotlin.ranges.until_dqglrj$;
+ var RuntimeException_init = Kotlin.kotlin.RuntimeException_init_pdl1vj$;
+ var emptyList = Kotlin.kotlin.collections.emptyList_287e2$;
+ var slice = Kotlin.kotlin.collections.slice_l0m14x$;
+ function hexColumsPrint$lambda$lambda(it) {
+ return it.toUpperCase();
+ }
+ function hexColumsPrint($receiver) {
+ var destination = ArrayList_init($receiver.length);
+ var tmp$;
+ for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) {
+ var item = $receiver[tmp$];
+ destination.add_11rb$(toString_1(item, 16));
+ }
+ var printout = chunked(destination, 16);
+ var tmp$_0;
+ tmp$_0 = printout.iterator();
+ while (tmp$_0.hasNext()) {
+ var element = tmp$_0.next();
+ println(joinToString(element, ' ', void 0, void 0, void 0, void 0, hexColumsPrint$lambda$lambda));
+ }
+ }
+ function hexColumsPrint$lambda$lambda_0(it) {
+ return it.toUpperCase();
+ }
+ function hexColumsPrint_0($receiver) {
+ var destination = ArrayList_init($receiver.length);
+ var tmp$;
+ for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) {
+ var item = $receiver[tmp$];
+ destination.add_11rb$(toString(item, 16));
+ }
+ var printout = chunked(destination, 16);
+ var tmp$_0;
+ tmp$_0 = printout.iterator();
+ while (tmp$_0.hasNext()) {
+ var element = tmp$_0.next();
+ println(joinToString(element, ' ', void 0, void 0, void 0, void 0, hexColumsPrint$lambda$lambda_0));
+ }
+ }
+ function hexColumsPrint$lambda$lambda_1(it) {
+ return it.toUpperCase();
+ }
+ function hexColumsPrint_1($receiver) {
+ var destination = ArrayList_init($receiver.length);
+ var tmp$;
+ for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) {
+ var item = $receiver[tmp$];
+ destination.add_11rb$(toString_0(item, 16));
+ }
+ var printout = chunked(destination, 3);
+ var tmp$_0;
+ tmp$_0 = printout.iterator();
+ while (tmp$_0.hasNext()) {
+ var element = tmp$_0.next();
+ println(joinToString(element, ' ', void 0, void 0, void 0, void 0, hexColumsPrint$lambda$lambda_1));
+ }
+ }
+ var chunked_0 = defineInlineFunction('crypto-core.com.ionspin.kotlin.crypto.chunked_r20n03$', wrapFunction(function () {
+ var emptyList = Kotlin.kotlin.collections.emptyList_287e2$;
+ var wrapFunction = Kotlin.wrapFunction;
+ var until = Kotlin.kotlin.ranges.until_dqglrj$;
+ var slice = Kotlin.kotlin.collections.slice_l0m14x$;
+ var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_ww73n8$;
+ var collectionSizeOrDefault = Kotlin.kotlin.collections.collectionSizeOrDefault_ba2ldo$;
+ var copyToArray = Kotlin.kotlin.collections.copyToArray;
+ var chunked$lambda = wrapFunction(function () {
+ var copyToArray = Kotlin.kotlin.collections.copyToArray;
+ return function (it) {
+ return copyToArray(it);
+ };
+ });
+ return function (T_0, isT, $receiver, sliceSize) {
+ var last = $receiver.length % sliceSize;
+ var hasLast = last !== 0;
+ var numberOfSlices = $receiver.length / sliceSize | 0;
+ var list = ArrayList_init(0);
+ for (var index = 0; index < 0; index++) {
+ list.add_11rb$(emptyList());
+ }
+ var result = list;
+ for (var i = 0; i < numberOfSlices; i++) {
+ result.add_11rb$(slice($receiver, until(Kotlin.imul(i, sliceSize), Kotlin.imul(i + 1 | 0, sliceSize))));
+ }
+ if (hasLast) {
+ result.add_11rb$(slice($receiver, until(Kotlin.imul(numberOfSlices, sliceSize), $receiver.length)));
+ }
+ var destination = ArrayList_init(collectionSizeOrDefault(result, 10));
+ var tmp$;
+ tmp$ = result.iterator();
+ while (tmp$.hasNext()) {
+ var item = tmp$.next();
+ destination.add_11rb$(copyToArray(item));
+ }
+ return copyToArray(destination);
+ };
+ }));
+ function rotateRight($receiver, places) {
+ var tmp$ = new UInt_init($receiver.data >>> places);
+ var bitCount = 32 - places | 0;
+ var other = new UInt_init($receiver.data << bitCount);
+ return new UInt_init(tmp$.data ^ other.data);
+ }
+ function rotateRight_0($receiver, places) {
+ var tmp$ = new ULong_init($receiver.data.shiftRightUnsigned(places));
+ var bitCount = 64 - places | 0;
+ var other = new ULong_init($receiver.data.shiftLeft(bitCount));
+ return new ULong_init(tmp$.data.xor(other.data));
+ }
+ function Blake2b() {
+ Blake2b$Companion_getInstance();
+ }
+ function Blake2b$Companion() {
+ Blake2b$Companion_instance = this;
+ this.BITS_IN_WORD = 64;
+ this.ROUNDS_IN_COMPRESS = 12;
+ this.BLOCK_BYTES = 128;
+ this.MAX_HASH_BYTES = 64;
+ this.MIN_HASH_BYTES = 1;
+ this.MAX_KEY_BYTES = 64;
+ this.MIN_KEY_BYTES = 0;
+ this.MAX_INPUT_BYTES = toBigInteger(2).shl_za3lpa$(128);
+ this.sigma_0 = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3], [11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4], [7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8], [9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13], [2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9], [12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11], [13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10], [6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5], [10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0]];
+ this.iv_0 = [new ULong_init(new Kotlin.Long(-205731576, 1779033703)), new ULong_init(new Kotlin.Long(-2067093701, -1150833019)), new ULong_init(new Kotlin.Long(-23791573, 1013904242)), new ULong_init(new Kotlin.Long(1595750129, -1521486534)), new ULong_init(new Kotlin.Long(-1377402159, 1359893119)), new ULong_init(new Kotlin.Long(725511199, -1694144372)), new ULong_init(new Kotlin.Long(-79577749, 528734635)), new ULong_init(new Kotlin.Long(327033209, 1541459225))];
+ this.R1 = 32;
+ this.R2 = 24;
+ this.R3 = 16;
+ this.R4 = 63;
+ }
+ function Blake2b$Companion$mixRound$lambda$lambda(it) {
+ return it.toUpperCase();
+ }
+ Blake2b$Companion.prototype.mixRound_r29y2p$ = function (input, message, round) {
+ var v = input;
+ var selectedSigma = this.sigma_0[round % 10];
+ var $receiver = v;
+ var destination = ArrayList_init($receiver.length);
+ var tmp$;
+ for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) {
+ var item = $receiver[tmp$];
+ destination.add_11rb$(toString_0(item, 16));
+ }
+ var printout = chunked(destination, 3);
+ var tmp$_0;
+ tmp$_0 = printout.iterator();
+ while (tmp$_0.hasNext()) {
+ var element = tmp$_0.next();
+ println(joinToString(element, ' ', void 0, void 0, void 0, void 0, Blake2b$Companion$mixRound$lambda$lambda));
+ }
+ v = this.mix_0(v, 0, 4, 8, 12, message[selectedSigma[0]], message[selectedSigma[1]]);
+ v = this.mix_0(v, 1, 5, 9, 13, message[selectedSigma[2]], message[selectedSigma[3]]);
+ v = this.mix_0(v, 2, 6, 10, 14, message[selectedSigma[4]], message[selectedSigma[5]]);
+ v = this.mix_0(v, 3, 7, 11, 15, message[selectedSigma[6]], message[selectedSigma[7]]);
+ v = this.mix_0(v, 0, 5, 10, 15, message[selectedSigma[8]], message[selectedSigma[9]]);
+ v = this.mix_0(v, 1, 6, 11, 12, message[selectedSigma[10]], message[selectedSigma[11]]);
+ v = this.mix_0(v, 2, 7, 8, 13, message[selectedSigma[12]], message[selectedSigma[13]]);
+ v = this.mix_0(v, 3, 4, 9, 14, message[selectedSigma[14]], message[selectedSigma[15]]);
+ return v;
+ };
+ Blake2b$Companion.prototype.mix_0 = function (v, a, b, c, d, x, y) {
+ var $this = v[a];
+ var other = v[b];
+ v[a] = new ULong_init((new ULong_init($this.data.add(other.data))).data.add(x.data));
+ var $this_0 = v[d];
+ var other_0 = v[a];
+ v[d] = rotateRight_0(new ULong_init($this_0.data.xor(other_0.data)), 32);
+ var $this_1 = v[c];
+ var other_1 = v[d];
+ v[c] = new ULong_init($this_1.data.add(other_1.data));
+ var $this_2 = v[b];
+ var other_2 = v[c];
+ v[b] = rotateRight_0(new ULong_init($this_2.data.xor(other_2.data)), 24);
+ var $this_3 = v[a];
+ var other_3 = v[b];
+ v[a] = new ULong_init((new ULong_init($this_3.data.add(other_3.data))).data.add(y.data));
+ var $this_4 = v[d];
+ var other_4 = v[a];
+ v[d] = rotateRight_0(new ULong_init($this_4.data.xor(other_4.data)), 16);
+ var $this_5 = v[c];
+ var other_5 = v[d];
+ v[c] = new ULong_init($this_5.data.add(other_5.data));
+ var $this_6 = v[b];
+ var other_6 = v[c];
+ v[b] = rotateRight_0(new ULong_init($this_6.data.xor(other_6.data)), 63);
+ return v;
+ };
+ function Blake2b$Companion$compress$lambda$lambda(it) {
+ return it.toUpperCase();
+ }
+ Blake2b$Companion.prototype.compress_c1cv33$ = function (h, input, offsetCounter, finalBlock) {
+ var array = Array_0(16);
+ var tmp$;
+ tmp$ = array.length - 1 | 0;
+ for (var i = 0; i <= tmp$; i++) {
+ var init$result;
+ if (i >= 0 && i <= 7) {
+ init$result = h[i];
+ }
+ else {
+ init$result = this.iv_0[i - 8 | 0];
+ }
+ array[i] = init$result;
+ }
+ var v = array;
+ var array_0 = Array_0(16);
+ var tmp$_0;
+ tmp$_0 = array_0.length - 1 | 0;
+ for (var i_0 = 0; i_0 <= tmp$_0; i_0++) {
+ array_0[i_0] = new ULong_init(Kotlin.Long.ZERO);
+ }
+ var tmp$_1, tmp$_0_0;
+ var index = 0;
+ var accumulator = array_0;
+ for (tmp$_1 = 0; tmp$_1 !== input.length; ++tmp$_1) {
+ var element = input[tmp$_1];
+ var index_0 = (tmp$_0_0 = index, index = tmp$_0_0 + 1 | 0, tmp$_0_0);
+ var acc = accumulator;
+ var slot = index_0 / 8 | 0;
+ var position = index_0 % 8;
+ var tmp$_2 = acc[slot];
+ var $this = new ULong_init(Kotlin.Long.fromInt(element.data).and(L255));
+ var bitCount = position * 8 | 0;
+ var other = new ULong_init($this.data.shiftLeft(bitCount));
+ acc[slot] = new ULong_init(tmp$_2.data.add(other.data));
+ accumulator = acc;
+ }
+ var m = accumulator;
+ println('m');
+ var destination = ArrayList_init(m.length);
+ var tmp$_3;
+ for (tmp$_3 = 0; tmp$_3 !== m.length; ++tmp$_3) {
+ var item = m[tmp$_3];
+ destination.add_11rb$(toString_0(item, 16));
+ }
+ var printout = chunked(destination, 4);
+ var tmp$_4;
+ tmp$_4 = printout.iterator();
+ while (tmp$_4.hasNext()) {
+ var element_0 = tmp$_4.next();
+ println(joinToString(element_0, ' ', void 0, void 0, void 0, void 0, Blake2b$Companion$compress$lambda$lambda));
+ }
+ println('Offset ' + offsetCounter);
+ var $this_0 = v[12];
+ var other_0 = offsetCounter.ulongValue_6taknv$();
+ v[12] = new ULong_init($this_0.data.xor(other_0.data));
+ var $this_1 = v[13];
+ var other_1 = offsetCounter.shr_za3lpa$(64).ulongValue_6taknv$();
+ v[13] = new ULong_init($this_1.data.xor(other_1.data));
+ if (finalBlock) {
+ v[14] = new ULong_init(v[14].data.inv());
+ }
+ for (var i_1 = 0; i_1 < 12; i_1++) {
+ this.mixRound_r29y2p$(v, m, i_1);
+ }
+ for (var i_2 = 0; i_2 <= 7; i_2++) {
+ var $this_2 = h[i_2];
+ var other_2 = v[i_2];
+ var $this_3 = new ULong_init($this_2.data.xor(other_2.data));
+ var other_3 = v[i_2 + 8 | 0];
+ h[i_2] = new ULong_init($this_3.data.xor(other_3.data));
+ }
+ return h;
+ };
+ Blake2b$Companion.prototype.digest_jyasbz$ = function (inputString, key) {
+ if (key === void 0)
+ key = null;
+ var tmp$;
+ var $receiver = encodeToByteArray(inputString);
+ var destination = ArrayList_init($receiver.length);
+ var tmp$_0;
+ for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
+ var item = $receiver[tmp$_0];
+ destination.add_11rb$(new UByte(item));
+ }
+ var $receiver_0 = chunked(toList(destination), 128);
+ var destination_0 = ArrayList_init(collectionSizeOrDefault($receiver_0, 10));
+ var tmp$_1;
+ tmp$_1 = $receiver_0.iterator();
+ while (tmp$_1.hasNext()) {
+ var item_0 = tmp$_1.next();
+ destination_0.add_11rb$(copyToArray(item_0));
+ }
+ var chunked_0 = copyToArray(destination_0);
+ var tmp$_2;
+ if (key != null) {
+ var $receiver_1 = encodeToByteArray(key);
+ var destination_1 = ArrayList_init($receiver_1.length);
+ var tmp$_3;
+ for (tmp$_3 = 0; tmp$_3 !== $receiver_1.length; ++tmp$_3) {
+ var item_1 = $receiver_1[tmp$_3];
+ destination_1.add_11rb$(new UByte(item_1));
+ }
+ tmp$_2 = copyToArray(destination_1);
+ }
+ else
+ tmp$_2 = null;
+ var keyBytes = (tmp$ = tmp$_2) != null ? tmp$ : [];
+ return this.digest_qdhiwk$(chunked_0, keyBytes);
+ };
+ Blake2b$Companion.prototype.digest_qdhiwk$ = function (inputMessage, secretKey, hashLength) {
+ if (inputMessage === void 0) {
+ inputMessage = [];
+ }
+ if (secretKey === void 0) {
+ secretKey = [];
+ }
+ if (hashLength === void 0)
+ hashLength = 64;
+ var tmp$, tmp$_0, tmp$_1, tmp$_2;
+ var h = this.iv_0.slice();
+ var $this = h[0];
+ var other = new ULong_init(Kotlin.Long.fromInt(16842752));
+ var tmp$_3 = new ULong_init($this.data.xor(other.data));
+ var other_0 = new ULong_init((new ULong_init(Kotlin.Long.fromInt(secretKey.length))).data.shiftLeft(8));
+ var tmp$_4 = new ULong_init(tmp$_3.data.xor(other_0.data));
+ var other_1 = new ULong_init(Kotlin.Long.fromInt(hashLength));
+ h[0] = new ULong_init(tmp$_4.data.xor(other_1.data));
+ if (secretKey.length === 0) {
+ if (inputMessage.length === 0) {
+ var array = Array_0(1);
+ var tmp$_5;
+ tmp$_5 = array.length - 1 | 0;
+ for (var i = 0; i <= tmp$_5; i++) {
+ var array_0 = Array_0(128);
+ var tmp$_6;
+ tmp$_6 = array_0.length - 1 | 0;
+ for (var i_0 = 0; i_0 <= tmp$_6; i_0++) {
+ array_0[i_0] = new UByte(0);
+ }
+ array[i] = array_0;
+ }
+ tmp$ = array;
+ }
+ else {
+ tmp$ = inputMessage;
+ }
+ }
+ else {
+ var padToBlock_0$result;
+ padToBlock_0$break: do {
+ if (secretKey.length === 128) {
+ padToBlock_0$result = secretKey;
+ break padToBlock_0$break;
+ }
+ if (secretKey.length > 128) {
+ throw IllegalStateException_init('Block larger than 128 bytes');
+ }
+ var array_1 = Array_0(128);
+ var tmp$_7;
+ tmp$_7 = array_1.length - 1 | 0;
+ for (var i_1 = 0; i_1 <= tmp$_7; i_1++) {
+ var init$result;
+ if (0 <= i_1 && i_1 < secretKey.length) {
+ init$result = secretKey[i_1];
+ }
+ else {
+ init$result = new UByte(0);
+ }
+ array_1[i_1] = init$result;
+ }
+ padToBlock_0$result = array_1;
+ }
+ while (false);
+ tmp$ = [padToBlock_0$result].concat(inputMessage);
+ }
+ var message = tmp$;
+ if (message.length > 1) {
+ tmp$_0 = message.length - 1 | 0;
+ for (var i_2 = 0; i_2 < tmp$_0; i_2++) {
+ var $receiver = this.compress_c1cv33$(h, message[i_2], toBigInteger((i_2 + 1 | 0) * 128 | 0), false);
+ arrayCopy($receiver, h, 0, 0, $receiver.length);
+ hexColumsPrint_1(h);
+ }
+ }
+ switch (message.length) {
+ case 0:
+ tmp$_1 = 0;
+ break;
+ case 1:
+ tmp$_1 = message[message.length - 1 | 0].length;
+ break;
+ default:tmp$_1 = ((message.length - 1 | 0) * 128 | 0) + message[message.length - 1 | 0].length | 0;
+ break;
+ }
+ var lastSize = tmp$_1;
+ if (!(message.length === 0)) {
+ var unpadded = message[message.length - 1 | 0];
+ var padToBlock_0$result_0;
+ padToBlock_0$break: do {
+ if (unpadded.length === 128) {
+ padToBlock_0$result_0 = unpadded;
+ break padToBlock_0$break;
+ }
+ if (unpadded.length > 128) {
+ throw IllegalStateException_init('Block larger than 128 bytes');
+ }
+ var array_2 = Array_0(128);
+ var tmp$_8;
+ tmp$_8 = array_2.length - 1 | 0;
+ for (var i_3 = 0; i_3 <= tmp$_8; i_3++) {
+ var init$result_0;
+ if (0 <= i_3 && i_3 < unpadded.length) {
+ init$result_0 = unpadded[i_3];
+ }
+ else {
+ init$result_0 = new UByte(0);
+ }
+ array_2[i_3] = init$result_0;
+ }
+ padToBlock_0$result_0 = array_2;
+ }
+ while (false);
+ tmp$_2 = padToBlock_0$result_0;
+ }
+ else {
+ var array_3 = Array_0(16);
+ var tmp$_9;
+ tmp$_9 = array_3.length - 1 | 0;
+ for (var i_4 = 0; i_4 <= tmp$_9; i_4++) {
+ array_3[i_4] = new UByte(0);
+ }
+ tmp$_2 = array_3;
+ }
+ var lastBlockPadded = tmp$_2;
+ var $receiver_0 = this.compress_c1cv33$(h, lastBlockPadded, toBigInteger(lastSize), true);
+ arrayCopy($receiver_0, h, 0, 0, $receiver_0.length);
+ var destination = ArrayList_init(h.length);
+ var tmp$_10;
+ for (tmp$_10 = 0; tmp$_10 !== h.length; ++tmp$_10) {
+ var item = h[tmp$_10];
+ var tmp$_11 = destination.add_11rb$;
+ var other_2 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_12 = new UByte(toByte((new ULong_init(item.data.and(other_2.data))).data.toInt()));
+ var $this_0 = new ULong_init(item.data.shiftRightUnsigned(8));
+ var other_3 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_13 = new UByte(toByte((new ULong_init($this_0.data.and(other_3.data))).data.toInt()));
+ var $this_1 = new ULong_init(item.data.shiftRightUnsigned(16));
+ var other_4 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_14 = new UByte(toByte((new ULong_init($this_1.data.and(other_4.data))).data.toInt()));
+ var $this_2 = new ULong_init(item.data.shiftRightUnsigned(24));
+ var other_5 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_15 = new UByte(toByte((new ULong_init($this_2.data.and(other_5.data))).data.toInt()));
+ var $this_3 = new ULong_init(item.data.shiftRightUnsigned(32));
+ var other_6 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_16 = new UByte(toByte((new ULong_init($this_3.data.and(other_6.data))).data.toInt()));
+ var $this_4 = new ULong_init(item.data.shiftRightUnsigned(40));
+ var other_7 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_17 = new UByte(toByte((new ULong_init($this_4.data.and(other_7.data))).data.toInt()));
+ var $this_5 = new ULong_init(item.data.shiftRightUnsigned(48));
+ var other_8 = new ULong_init(Kotlin.Long.fromInt(255));
+ var tmp$_18 = new UByte(toByte((new ULong_init($this_5.data.and(other_8.data))).data.toInt()));
+ var $this_6 = new ULong_init(item.data.shiftRightUnsigned(56));
+ var other_9 = new ULong_init(Kotlin.Long.fromInt(255));
+ tmp$_11.call(destination, [tmp$_12, tmp$_13, tmp$_14, tmp$_15, tmp$_16, tmp$_17, tmp$_18, new UByte(toByte((new ULong_init($this_6.data.and(other_9.data))).data.toInt()))]);
+ }
+ var destination_0 = ArrayList_init_0();
+ var tmp$_19;
+ tmp$_19 = destination.iterator();
+ while (tmp$_19.hasNext()) {
+ var element = tmp$_19.next();
+ var list = toList_0(element);
+ addAll(destination_0, list);
+ }
+ return copyToArray(destination_0);
+ };
+ Blake2b$Companion.prototype.padToBlock_0 = wrapFunction(function () {
+ var Array_0 = Array;
+ return function (unpadded) {
+ if (unpadded.length === 128) {
+ return unpadded;
+ }
+ if (unpadded.length > 128) {
+ throw IllegalStateException_init('Block larger than 128 bytes');
+ }
+ var array = Array_0(128);
+ var tmp$;
+ tmp$ = array.length - 1 | 0;
+ for (var i = 0; i <= tmp$; i++) {
+ var init$result;
+ if (0 <= i && i < unpadded.length) {
+ init$result = unpadded[i];
+ }
+ else {
+ init$result = new UByte(0);
+ }
+ array[i] = init$result;
+ }
+ return array;
+ };
+ });
+ Blake2b$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: []
+ };
+ var Blake2b$Companion_instance = null;
+ function Blake2b$Companion_getInstance() {
+ if (Blake2b$Companion_instance === null) {
+ new Blake2b$Companion();
+ }
+ return Blake2b$Companion_instance;
+ }
+ Blake2b.prototype.digest_jyasbz$ = function (inputString, key) {
+ if (key === void 0)
+ key = null;
+ return Blake2b$Companion_getInstance().digest_jyasbz$(inputString, key);
+ };
+ Blake2b.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'Blake2b',
+ interfaces: []
+ };
+ var chunked$lambda = wrapFunction(function () {
+ var copyToArray = Kotlin.kotlin.collections.copyToArray;
+ return function (it) {
+ return copyToArray(it);
+ };
+ });
+ function Sha256() {
+ Sha256$Companion_getInstance();
+ this.h0 = new UInt_init(1779033703);
+ this.h1 = new UInt_init(-1150833019);
+ this.h2 = new UInt_init(1013904242);
+ this.h3 = new UInt_init(-1521486534);
+ this.h4 = new UInt_init(1359893119);
+ this.h5 = new UInt_init(-1694144372);
+ this.h6 = new UInt_init(528734635);
+ this.h7 = new UInt_init(1541459225);
+ this.k = [new UInt_init(1116352408), new UInt_init(1899447441), new UInt_init(-1245643825), new UInt_init(-373957723), new UInt_init(961987163), new UInt_init(1508970993), new UInt_init(-1841331548), new UInt_init(-1424204075), new UInt_init(-670586216), new UInt_init(310598401), new UInt_init(607225278), new UInt_init(1426881987), new UInt_init(1925078388), new UInt_init(-2132889090), new UInt_init(-1680079193), new UInt_init(-1046744716), new UInt_init(-459576895), new UInt_init(-272742522), new UInt_init(264347078), new UInt_init(604807628), new UInt_init(770255983), new UInt_init(1249150122), new UInt_init(1555081692), new UInt_init(1996064986), new UInt_init(-1740746414), new UInt_init(-1473132947), new UInt_init(-1341970488), new UInt_init(-1084653625), new UInt_init(-958395405), new UInt_init(-710438585), new UInt_init(113926993), new UInt_init(338241895), new UInt_init(666307205), new UInt_init(773529912), new UInt_init(1294757372), new UInt_init(1396182291), new UInt_init(1695183700), new UInt_init(1986661051), new UInt_init(-2117940946), new UInt_init(-1838011259), new UInt_init(-1564481375), new UInt_init(-1474664885), new UInt_init(-1035236496), new UInt_init(-949202525), new UInt_init(-778901479), new UInt_init(-694614492), new UInt_init(-200395387), new UInt_init(275423344), new UInt_init(430227734), new UInt_init(506948616), new UInt_init(659060556), new UInt_init(883997877), new UInt_init(958139571), new UInt_init(1322822218), new UInt_init(1537002063), new UInt_init(1747873779), new UInt_init(1955562222), new UInt_init(2024104815), new UInt_init(-2067236844), new UInt_init(-1933114872), new UInt_init(-1866530822), new UInt_init(-1538233109), new UInt_init(-1090935817), new UInt_init(-965641998)];
+ }
+ function Sha256$Companion() {
+ Sha256$Companion_instance = this;
+ this.BLOCK_SIZE = 512;
+ this.W_SIZE = 64;
+ this.UINT_MASK = new UInt_init(-1);
+ this.BYTE_MASK_FROM_ULONG = new ULong_init(Kotlin.Long.fromInt(255));
+ this.BYTE_MASK_FROM_UINT = new UInt_init(255);
+ }
+ Sha256$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: []
+ };
+ var Sha256$Companion_instance = null;
+ function Sha256$Companion_getInstance() {
+ if (Sha256$Companion_instance === null) {
+ new Sha256$Companion();
+ }
+ return Sha256$Companion_instance;
+ }
+ Sha256.prototype.digest_ummv9a$ = function (message) {
+ var tmp$;
+ var originalMessageSizeInBits = message.length * 8 | 0;
+ var expandedRemainderOf512 = (originalMessageSizeInBits + 65 | 0) % 512;
+ if (expandedRemainderOf512 === 0)
+ tmp$ = 0;
+ else
+ tmp$ = (512 - expandedRemainderOf512 | 0) / 8 | 0;
+ var zeroAddAmount = tmp$;
+ var array = Array_0(zeroAddAmount + 1 | 0);
+ var tmp$_0;
+ tmp$_0 = array.length - 1 | 0;
+ for (var i = 0; i <= tmp$_0; i++) {
+ var init$result;
+ if (i === 0) {
+ init$result = new UByte(-128);
+ }
+ else {
+ init$result = new UByte(0);
+ }
+ array[i] = init$result;
+ }
+ var expansionArray = array;
+ var tmp$_1 = message.concat(expansionArray);
+ var elements = this.toPaddedByteArray_0(new ULong_init(Kotlin.Long.fromInt(originalMessageSizeInBits)));
+ var $receiver = tmp$_1.concat(elements);
+ var last = $receiver.length % 64;
+ var hasLast = last !== 0;
+ var numberOfSlices = $receiver.length / 64 | 0;
+ var list = ArrayList_init(0);
+ for (var index = 0; index < 0; index++) {
+ list.add_11rb$(emptyList());
+ }
+ var result = list;
+ for (var i_0 = 0; i_0 < numberOfSlices; i_0++) {
+ result.add_11rb$(slice($receiver, until(Kotlin.imul(i_0, 64), Kotlin.imul(i_0 + 1 | 0, 64))));
+ }
+ if (hasLast) {
+ result.add_11rb$(slice($receiver, until(Kotlin.imul(numberOfSlices, 64), $receiver.length)));
+ }
+ var destination = ArrayList_init(collectionSizeOrDefault(result, 10));
+ var tmp$_2;
+ tmp$_2 = result.iterator();
+ while (tmp$_2.hasNext()) {
+ var item = tmp$_2.next();
+ destination.add_11rb$(copyToArray(item));
+ }
+ var chunks = copyToArray(destination);
+ var tmp$_3;
+ for (tmp$_3 = 0; tmp$_3 !== chunks.length; ++tmp$_3) {
+ var element = chunks[tmp$_3];
+ var array_0 = Array_0(64);
+ var tmp$_4;
+ tmp$_4 = array_0.length - 1 | 0;
+ for (var i_1 = 0; i_1 <= tmp$_4; i_1++) {
+ var init$result_0;
+ if (0 <= i_1 && i_1 < 16) {
+ var tmp$_5 = new UInt_init((new UInt_init(element[i_1 * 4 | 0].data & 255)).data << 24);
+ var other = new UInt_init((new UInt_init(element[(i_1 * 4 | 0) + 1 | 0].data & 255)).data << 16);
+ var tmp$_6 = new UInt_init(tmp$_5.data + other.data | 0);
+ var other_0 = new UInt_init((new UInt_init(element[(i_1 * 4 | 0) + 2 | 0].data & 255)).data << 8);
+ var tmp$_7 = new UInt_init(tmp$_6.data + other_0.data | 0);
+ var other_1 = new UInt_init(element[(i_1 * 4 | 0) + 3 | 0].data & 255);
+ var collected = new UInt_init(tmp$_7.data + other_1.data | 0);
+ init$result_0 = collected;
+ }
+ else {
+ init$result_0 = new UInt_init(0);
+ }
+ array_0[i_1] = init$result_0;
+ }
+ var w = array_0;
+ for (var i_2 = 16; i_2 < 64; i_2++) {
+ var s0 = this.scheduleSigma0_0(w[i_2 - 15 | 0]);
+ var s1 = this.scheduleSigma1_0(w[i_2 - 2 | 0]);
+ var $this = new UInt_init(w[i_2 - 16 | 0].data + s0.data | 0);
+ var other_2 = w[i_2 - 7 | 0];
+ w[i_2] = new UInt_init((new UInt_init($this.data + other_2.data | 0)).data + s1.data | 0);
+ }
+ var a = this.h0;
+ var b = this.h1;
+ var c = this.h2;
+ var d = this.h3;
+ var e = this.h4;
+ var f = this.h5;
+ var g = this.h6;
+ var h = this.h7;
+ for (var i_3 = 0; i_3 < 64; i_3++) {
+ var s1_0 = this.compressionSigma1_0(e);
+ var ch = this.ch_0(e, f, g);
+ var $this_0 = new UInt_init((new UInt_init(h.data + s1_0.data | 0)).data + ch.data | 0);
+ var other_3 = this.k[i_3];
+ var $this_1 = new UInt_init($this_0.data + other_3.data | 0);
+ var other_4 = w[i_3];
+ var temp1 = new UInt_init($this_1.data + other_4.data | 0);
+ var s0_0 = this.compressionSigma0_0(a);
+ var maj = this.maj_0(a, b, c);
+ var temp2 = new UInt_init(s0_0.data + maj.data | 0);
+ h = g;
+ g = f;
+ f = e;
+ e = new UInt_init(d.data + temp1.data | 0);
+ d = c;
+ c = b;
+ b = a;
+ a = new UInt_init(temp1.data + temp2.data | 0);
+ }
+ var $this_2 = this.h0;
+ var other_5 = a;
+ this.h0 = new UInt_init($this_2.data + other_5.data | 0);
+ var $this_3 = this.h1;
+ var other_6 = b;
+ this.h1 = new UInt_init($this_3.data + other_6.data | 0);
+ var $this_4 = this.h2;
+ var other_7 = c;
+ this.h2 = new UInt_init($this_4.data + other_7.data | 0);
+ var $this_5 = this.h3;
+ var other_8 = d;
+ this.h3 = new UInt_init($this_5.data + other_8.data | 0);
+ var $this_6 = this.h4;
+ var other_9 = e;
+ this.h4 = new UInt_init($this_6.data + other_9.data | 0);
+ var $this_7 = this.h5;
+ var other_10 = f;
+ this.h5 = new UInt_init($this_7.data + other_10.data | 0);
+ var $this_8 = this.h6;
+ var other_11 = g;
+ this.h6 = new UInt_init($this_8.data + other_11.data | 0);
+ var $this_9 = this.h7;
+ var other_12 = h;
+ this.h7 = new UInt_init($this_9.data + other_12.data | 0);
+ }
+ var $receiver_0 = this.toPaddedByteArray_1(this.h0);
+ var elements_0 = this.toPaddedByteArray_1(this.h1);
+ var $receiver_1 = $receiver_0.concat(elements_0);
+ var elements_1 = this.toPaddedByteArray_1(this.h2);
+ var $receiver_2 = $receiver_1.concat(elements_1);
+ var elements_2 = this.toPaddedByteArray_1(this.h3);
+ var $receiver_3 = $receiver_2.concat(elements_2);
+ var elements_3 = this.toPaddedByteArray_1(this.h4);
+ var $receiver_4 = $receiver_3.concat(elements_3);
+ var elements_4 = this.toPaddedByteArray_1(this.h5);
+ var $receiver_5 = $receiver_4.concat(elements_4);
+ var elements_5 = this.toPaddedByteArray_1(this.h6);
+ var $receiver_6 = $receiver_5.concat(elements_5);
+ var elements_6 = this.toPaddedByteArray_1(this.h7);
+ var digest = $receiver_6.concat(elements_6);
+ this.reset_0();
+ return digest;
+ };
+ Sha256.prototype.reset_0 = function () {
+ this.h0 = new UInt_init(1779033703);
+ this.h1 = new UInt_init(-1150833019);
+ this.h2 = new UInt_init(1013904242);
+ this.h3 = new UInt_init(-1521486534);
+ this.h4 = new UInt_init(1359893119);
+ this.h5 = new UInt_init(-1694144372);
+ this.h6 = new UInt_init(528734635);
+ this.h7 = new UInt_init(1541459225);
+ };
+ Sha256.prototype.scheduleSigma0_0 = function (value) {
+ var $this = rotateRight(value, 7);
+ var other = rotateRight(value, 18);
+ var tmp$ = new UInt_init($this.data ^ other.data);
+ var other_0 = new UInt_init(value.data >>> 3);
+ return new UInt_init(tmp$.data ^ other_0.data);
+ };
+ Sha256.prototype.scheduleSigma1_0 = function (value) {
+ var $this = rotateRight(value, 17);
+ var other = rotateRight(value, 19);
+ var tmp$ = new UInt_init($this.data ^ other.data);
+ var other_0 = new UInt_init(value.data >>> 10);
+ return new UInt_init(tmp$.data ^ other_0.data);
+ };
+ Sha256.prototype.compressionSigma0_0 = function (a) {
+ var $this = rotateRight(a, 2);
+ var other = rotateRight(a, 13);
+ var $this_0 = new UInt_init($this.data ^ other.data);
+ var other_0 = rotateRight(a, 22);
+ return new UInt_init($this_0.data ^ other_0.data);
+ };
+ Sha256.prototype.compressionSigma1_0 = function (e) {
+ var $this = rotateRight(e, 6);
+ var other = rotateRight(e, 11);
+ var $this_0 = new UInt_init($this.data ^ other.data);
+ var other_0 = rotateRight(e, 25);
+ return new UInt_init($this_0.data ^ other_0.data);
+ };
+ Sha256.prototype.ch_0 = function (x, y, z) {
+ var tmp$ = new UInt_init(x.data & y.data);
+ var other = Sha256$Companion_getInstance().UINT_MASK;
+ var other_0 = new UInt_init((new UInt_init(x.data ^ other.data)).data & z.data);
+ return new UInt_init(tmp$.data ^ other_0.data);
+ };
+ Sha256.prototype.maj_0 = function (x, y, z) {
+ var tmp$ = new UInt_init(x.data & y.data);
+ var other = new UInt_init(x.data & z.data);
+ var tmp$_0 = new UInt_init(tmp$.data ^ other.data);
+ var other_0 = new UInt_init(y.data & z.data);
+ return new UInt_init(tmp$_0.data ^ other_0.data);
+ };
+ Sha256.prototype.toPaddedByteArray_0 = function ($receiver) {
+ var byteMask = Sha256$Companion_getInstance().BYTE_MASK_FROM_ULONG;
+ var array = Array_0(8);
+ var tmp$;
+ tmp$ = array.length - 1 | 0;
+ loop_label: for (var i = 0; i <= tmp$; i++) {
+ var init$result;
+ init$break: do {
+ switch (i) {
+ case 7:
+ init$result = new UByte(toByte((new ULong_init($receiver.data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 6:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(8))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 5:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(16))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 4:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(24))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 3:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(32))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 2:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(40))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 1:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(48))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 0:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(54))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ default:throw RuntimeException_init('Invalid conversion');
+ }
+ }
+ while (false);
+ array[i] = init$result;
+ }
+ return array;
+ };
+ Sha256.prototype.toPaddedByteArray_1 = function ($receiver) {
+ var byteMask = Sha256$Companion_getInstance().BYTE_MASK_FROM_UINT;
+ var array = Array_0(4);
+ var tmp$;
+ tmp$ = array.length - 1 | 0;
+ loop_label: for (var i = 0; i <= tmp$; i++) {
+ var init$result;
+ init$break: do {
+ switch (i) {
+ case 3:
+ init$result = new UByte(toByte((new UInt_init($receiver.data & byteMask.data)).data));
+ break init$break;
+ case 2:
+ init$result = new UByte(toByte((new UInt_init((new UInt_init($receiver.data >>> 8)).data & byteMask.data)).data));
+ break init$break;
+ case 1:
+ init$result = new UByte(toByte((new UInt_init((new UInt_init($receiver.data >>> 16)).data & byteMask.data)).data));
+ break init$break;
+ case 0:
+ init$result = new UByte(toByte((new UInt_init((new UInt_init($receiver.data >>> 24)).data & byteMask.data)).data));
+ break init$break;
+ default:throw RuntimeException_init('Invalid conversion');
+ }
+ }
+ while (false);
+ array[i] = init$result;
+ }
+ return array;
+ };
+ Sha256.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'Sha256',
+ interfaces: []
+ };
+ var chunked$lambda_0 = wrapFunction(function () {
+ var copyToArray = Kotlin.kotlin.collections.copyToArray;
+ return function (it) {
+ return copyToArray(it);
+ };
+ });
+ function Sha512() {
+ Sha512$Companion_getInstance();
+ this.h0 = new ULong_init(new Kotlin.Long(-205731576, 1779033703));
+ this.h1 = new ULong_init(new Kotlin.Long(-2067093701, -1150833019));
+ this.h2 = new ULong_init(new Kotlin.Long(-23791573, 1013904242));
+ this.h3 = new ULong_init(new Kotlin.Long(1595750129, -1521486534));
+ this.h4 = new ULong_init(new Kotlin.Long(-1377402159, 1359893119));
+ this.h5 = new ULong_init(new Kotlin.Long(725511199, -1694144372));
+ this.h6 = new ULong_init(new Kotlin.Long(-79577749, 528734635));
+ this.h7 = new ULong_init(new Kotlin.Long(327033209, 1541459225));
+ }
+ function Sha512$Companion() {
+ Sha512$Companion_instance = this;
+ this.BLOCK_SIZE = 1024;
+ this.ULONG_MASK = new ULong_init(Kotlin.Long.NEG_ONE);
+ this.k = [new ULong_init(new Kotlin.Long(-685199838, 1116352408)), new ULong_init(new Kotlin.Long(602891725, 1899447441)), new ULong_init(new Kotlin.Long(-330482897, -1245643825)), new ULong_init(new Kotlin.Long(-2121671748, -373957723)), new ULong_init(new Kotlin.Long(-213338824, 961987163)), new ULong_init(new Kotlin.Long(-1241133031, 1508970993)), new ULong_init(new Kotlin.Long(-1357295717, -1841331548)), new ULong_init(new Kotlin.Long(-630357736, -1424204075)), new ULong_init(new Kotlin.Long(-1560083902, -670586216)), new ULong_init(new Kotlin.Long(1164996542, 310598401)), new ULong_init(new Kotlin.Long(1323610764, 607225278)), new ULong_init(new Kotlin.Long(-704662302, 1426881987)), new ULong_init(new Kotlin.Long(-226784913, 1925078388)), new ULong_init(new Kotlin.Long(991336113, -2132889090)), new ULong_init(new Kotlin.Long(633803317, -1680079193)), new ULong_init(new Kotlin.Long(-815192428, -1046744716)), new ULong_init(new Kotlin.Long(-1628353838, -459576895)), new ULong_init(new Kotlin.Long(944711139, -272742522)), new ULong_init(new Kotlin.Long(-1953704523, 264347078)), new ULong_init(new Kotlin.Long(2007800933, 604807628)), new ULong_init(new Kotlin.Long(1495990901, 770255983)), new ULong_init(new Kotlin.Long(1856431235, 1249150122)), new ULong_init(new Kotlin.Long(-1119749164, 1555081692)), new ULong_init(new Kotlin.Long(-2096016459, 1996064986)), new ULong_init(new Kotlin.Long(-295247957, -1740746414)), new ULong_init(new Kotlin.Long(766784016, -1473132947)), new ULong_init(new Kotlin.Long(-1728372417, -1341970488)), new ULong_init(new Kotlin.Long(-1091629340, -1084653625)), new ULong_init(new Kotlin.Long(1034457026, -958395405)), new ULong_init(new Kotlin.Long(-1828018395, -710438585)), new ULong_init(new Kotlin.Long(-536640913, 113926993)), new ULong_init(new Kotlin.Long(168717936, 338241895)), new ULong_init(new Kotlin.Long(1188179964, 666307205)), new ULong_init(new Kotlin.Long(1546045734, 773529912)), new ULong_init(new Kotlin.Long(1522805485, 1294757372)), new ULong_init(new Kotlin.Long(-1651133473, 1396182291)), new ULong_init(new Kotlin.Long(-1951439906, 1695183700)), new ULong_init(new Kotlin.Long(1014477480, 1986661051)), new ULong_init(new Kotlin.Long(1206759142, -2117940946)), new ULong_init(new Kotlin.Long(344077627, -1838011259)), new ULong_init(new Kotlin.Long(1290863460, -1564481375)), new ULong_init(new Kotlin.Long(-1136513023, -1474664885)), new ULong_init(new Kotlin.Long(-789014639, -1035236496)), new ULong_init(new Kotlin.Long(106217008, -949202525)), new ULong_init(new Kotlin.Long(-688958952, -778901479)), new ULong_init(new Kotlin.Long(1432725776, -694614492)), new ULong_init(new Kotlin.Long(1467031594, -200395387)), new ULong_init(new Kotlin.Long(851169720, 275423344)), new ULong_init(new Kotlin.Long(-1194143544, 430227734)), new ULong_init(new Kotlin.Long(1363258195, 506948616)), new ULong_init(new Kotlin.Long(-544281703, 659060556)), new ULong_init(new Kotlin.Long(-509917016, 883997877)), new ULong_init(new Kotlin.Long(-976659869, 958139571)), new ULong_init(new Kotlin.Long(-482243893, 1322822218)), new ULong_init(new Kotlin.Long(2003034995, 1537002063)), new ULong_init(new Kotlin.Long(-692930397, 1747873779)), new ULong_init(new Kotlin.Long(1575990012, 1955562222)), new ULong_init(new Kotlin.Long(1125592928, 2024104815)), new ULong_init(new Kotlin.Long(-1578062990, -2067236844)), new ULong_init(new Kotlin.Long(442776044, -1933114872)), new ULong_init(new Kotlin.Long(593698344, -1866530822)), new ULong_init(new Kotlin.Long(-561857047, -1538233109)), new ULong_init(new Kotlin.Long(-1295615723, -1090935817)), new ULong_init(new Kotlin.Long(-479046869, -965641998)), new ULong_init(new Kotlin.Long(-366583396, -903397682)), new ULong_init(new Kotlin.Long(566280711, -779700025)), new ULong_init(new Kotlin.Long(-840897762, -354779690)), new ULong_init(new Kotlin.Long(-294727304, -176337025)), new ULong_init(new Kotlin.Long(1914138554, 116418474)), new ULong_init(new Kotlin.Long(-1563912026, 174292421)), new ULong_init(new Kotlin.Long(-1090974290, 289380356)), new ULong_init(new Kotlin.Long(320620315, 460393269)), new ULong_init(new Kotlin.Long(587496836, 685471733)), new ULong_init(new Kotlin.Long(1086792851, 852142971)), new ULong_init(new Kotlin.Long(365543100, 1017036298)), new ULong_init(new Kotlin.Long(-1676669620, 1126000580)), new ULong_init(new Kotlin.Long(-885112138, 1288033470)), new ULong_init(new Kotlin.Long(-60457430, 1501505948)), new ULong_init(new Kotlin.Long(987167468, 1607167915)), new ULong_init(new Kotlin.Long(1246189591, 1816402316))];
+ }
+ Sha512$Companion.$metadata$ = {
+ kind: Kind_OBJECT,
+ simpleName: 'Companion',
+ interfaces: []
+ };
+ var Sha512$Companion_instance = null;
+ function Sha512$Companion_getInstance() {
+ if (Sha512$Companion_instance === null) {
+ new Sha512$Companion();
+ }
+ return Sha512$Companion_instance;
+ }
+ Sha512.prototype.digest_ummv9a$ = function (message) {
+ var tmp$;
+ var originalMessageSizeInBits = message.length * 8 | 0;
+ var expandedRemainderOf1024 = (originalMessageSizeInBits + 129 | 0) % 1024;
+ if (expandedRemainderOf1024 === 0)
+ tmp$ = 0;
+ else
+ tmp$ = (1024 - expandedRemainderOf1024 | 0) / 8 | 0;
+ var zeroAddAmount = tmp$;
+ var array = Array_0(zeroAddAmount + 1 | 0);
+ var tmp$_0;
+ tmp$_0 = array.length - 1 | 0;
+ for (var i = 0; i <= tmp$_0; i++) {
+ var init$result;
+ if (i === 0) {
+ init$result = new UByte(-128);
+ }
+ else {
+ init$result = new UByte(0);
+ }
+ array[i] = init$result;
+ }
+ var expansionArray = array;
+ var tmp$_1 = message.concat(expansionArray);
+ var elements = this.toPadded128BitByteArray_0(new ULong_init(Kotlin.Long.fromInt(originalMessageSizeInBits)));
+ var $receiver = tmp$_1.concat(elements);
+ var last = $receiver.length % 128;
+ var hasLast = last !== 0;
+ var numberOfSlices = $receiver.length / 128 | 0;
+ var list = ArrayList_init(0);
+ for (var index = 0; index < 0; index++) {
+ list.add_11rb$(emptyList());
+ }
+ var result = list;
+ for (var i_0 = 0; i_0 < numberOfSlices; i_0++) {
+ result.add_11rb$(slice($receiver, until(Kotlin.imul(i_0, 128), Kotlin.imul(i_0 + 1 | 0, 128))));
+ }
+ if (hasLast) {
+ result.add_11rb$(slice($receiver, until(Kotlin.imul(numberOfSlices, 128), $receiver.length)));
+ }
+ var destination = ArrayList_init(collectionSizeOrDefault(result, 10));
+ var tmp$_2;
+ tmp$_2 = result.iterator();
+ while (tmp$_2.hasNext()) {
+ var item = tmp$_2.next();
+ destination.add_11rb$(copyToArray(item));
+ }
+ var chunks = copyToArray(destination);
+ var tmp$_3;
+ for (tmp$_3 = 0; tmp$_3 !== chunks.length; ++tmp$_3) {
+ var element = chunks[tmp$_3];
+ var array_0 = Array_0(80);
+ var tmp$_4;
+ tmp$_4 = array_0.length - 1 | 0;
+ for (var i_1 = 0; i_1 <= tmp$_4; i_1++) {
+ var init$result_0;
+ if (0 <= i_1 && i_1 < 16) {
+ var $this = element[i_1 * 8 | 0];
+ var tmp$_5 = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this.data).and(L255))).data.shiftLeft(56));
+ var $this_0 = element[(i_1 * 8 | 0) + 1 | 0];
+ var other = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this_0.data).and(L255))).data.shiftLeft(48));
+ var tmp$_6 = new ULong_init(tmp$_5.data.add(other.data));
+ var $this_1 = element[(i_1 * 8 | 0) + 2 | 0];
+ var other_0 = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this_1.data).and(L255))).data.shiftLeft(40));
+ var tmp$_7 = new ULong_init(tmp$_6.data.add(other_0.data));
+ var $this_2 = element[(i_1 * 8 | 0) + 3 | 0];
+ var other_1 = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this_2.data).and(L255))).data.shiftLeft(32));
+ var tmp$_8 = new ULong_init(tmp$_7.data.add(other_1.data));
+ var $this_3 = element[(i_1 * 8 | 0) + 4 | 0];
+ var other_2 = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this_3.data).and(L255))).data.shiftLeft(24));
+ var tmp$_9 = new ULong_init(tmp$_8.data.add(other_2.data));
+ var $this_4 = element[(i_1 * 8 | 0) + 5 | 0];
+ var other_3 = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this_4.data).and(L255))).data.shiftLeft(16));
+ var tmp$_10 = new ULong_init(tmp$_9.data.add(other_3.data));
+ var $this_5 = element[(i_1 * 8 | 0) + 6 | 0];
+ var other_4 = new ULong_init((new ULong_init(Kotlin.Long.fromInt($this_5.data).and(L255))).data.shiftLeft(8));
+ var tmp$_11 = new ULong_init(tmp$_10.data.add(other_4.data));
+ var $this_6 = element[(i_1 * 8 | 0) + 7 | 0];
+ var other_5 = new ULong_init(Kotlin.Long.fromInt($this_6.data).and(L255));
+ var collected = new ULong_init(tmp$_11.data.add(other_5.data));
+ init$result_0 = collected;
+ }
+ else {
+ init$result_0 = new ULong_init(Kotlin.Long.ZERO);
+ }
+ array_0[i_1] = init$result_0;
+ }
+ var w = array_0;
+ for (var i_2 = 16; i_2 < 80; i_2++) {
+ var s0 = this.scheduleSigma0_0(w[i_2 - 15 | 0]);
+ var s1 = this.scheduleSigma1_0(w[i_2 - 2 | 0]);
+ var $this_7 = new ULong_init(w[i_2 - 16 | 0].data.add(s0.data));
+ var other_6 = w[i_2 - 7 | 0];
+ w[i_2] = new ULong_init((new ULong_init($this_7.data.add(other_6.data))).data.add(s1.data));
+ }
+ var a = this.h0;
+ var b = this.h1;
+ var c = this.h2;
+ var d = this.h3;
+ var e = this.h4;
+ var f = this.h5;
+ var g = this.h6;
+ var h = this.h7;
+ for (var i_3 = 0; i_3 < 80; i_3++) {
+ var s1_0 = this.compressionSigma1_0(e);
+ var ch = this.ch_0(e, f, g);
+ var $this_8 = new ULong_init((new ULong_init(h.data.add(s1_0.data))).data.add(ch.data));
+ var other_7 = Sha512$Companion_getInstance().k[i_3];
+ var $this_9 = new ULong_init($this_8.data.add(other_7.data));
+ var other_8 = w[i_3];
+ var temp1 = new ULong_init($this_9.data.add(other_8.data));
+ var s0_0 = this.compressionSigma0_0(a);
+ var maj = this.maj_0(a, b, c);
+ var temp2 = new ULong_init(s0_0.data.add(maj.data));
+ h = g;
+ g = f;
+ f = e;
+ e = new ULong_init(d.data.add(temp1.data));
+ d = c;
+ c = b;
+ b = a;
+ a = new ULong_init(temp1.data.add(temp2.data));
+ }
+ var $this_10 = this.h0;
+ var other_9 = a;
+ this.h0 = new ULong_init($this_10.data.add(other_9.data));
+ var $this_11 = this.h1;
+ var other_10 = b;
+ this.h1 = new ULong_init($this_11.data.add(other_10.data));
+ var $this_12 = this.h2;
+ var other_11 = c;
+ this.h2 = new ULong_init($this_12.data.add(other_11.data));
+ var $this_13 = this.h3;
+ var other_12 = d;
+ this.h3 = new ULong_init($this_13.data.add(other_12.data));
+ var $this_14 = this.h4;
+ var other_13 = e;
+ this.h4 = new ULong_init($this_14.data.add(other_13.data));
+ var $this_15 = this.h5;
+ var other_14 = f;
+ this.h5 = new ULong_init($this_15.data.add(other_14.data));
+ var $this_16 = this.h6;
+ var other_15 = g;
+ this.h6 = new ULong_init($this_16.data.add(other_15.data));
+ var $this_17 = this.h7;
+ var other_16 = h;
+ this.h7 = new ULong_init($this_17.data.add(other_16.data));
+ }
+ var $receiver_0 = this.toPaddedByteArray_0(this.h0);
+ var elements_0 = this.toPaddedByteArray_0(this.h1);
+ var $receiver_1 = $receiver_0.concat(elements_0);
+ var elements_1 = this.toPaddedByteArray_0(this.h2);
+ var $receiver_2 = $receiver_1.concat(elements_1);
+ var elements_2 = this.toPaddedByteArray_0(this.h3);
+ var $receiver_3 = $receiver_2.concat(elements_2);
+ var elements_3 = this.toPaddedByteArray_0(this.h4);
+ var $receiver_4 = $receiver_3.concat(elements_3);
+ var elements_4 = this.toPaddedByteArray_0(this.h5);
+ var $receiver_5 = $receiver_4.concat(elements_4);
+ var elements_5 = this.toPaddedByteArray_0(this.h6);
+ var $receiver_6 = $receiver_5.concat(elements_5);
+ var elements_6 = this.toPaddedByteArray_0(this.h7);
+ var digest = $receiver_6.concat(elements_6);
+ this.reset_0();
+ return digest;
+ };
+ Sha512.prototype.reset_0 = function () {
+ this.h0 = new ULong_init(new Kotlin.Long(-205731576, 1779033703));
+ this.h1 = new ULong_init(new Kotlin.Long(-2067093701, -1150833019));
+ this.h2 = new ULong_init(new Kotlin.Long(-23791573, 1013904242));
+ this.h3 = new ULong_init(new Kotlin.Long(1595750129, -1521486534));
+ this.h4 = new ULong_init(new Kotlin.Long(-1377402159, 1359893119));
+ this.h5 = new ULong_init(new Kotlin.Long(725511199, -1694144372));
+ this.h6 = new ULong_init(new Kotlin.Long(-79577749, 528734635));
+ this.h7 = new ULong_init(new Kotlin.Long(327033209, 1541459225));
+ };
+ Sha512.prototype.scheduleSigma0_0 = function (value) {
+ var $this = rotateRight_0(value, 1);
+ var other = rotateRight_0(value, 8);
+ var tmp$ = new ULong_init($this.data.xor(other.data));
+ var other_0 = new ULong_init(value.data.shiftRightUnsigned(7));
+ return new ULong_init(tmp$.data.xor(other_0.data));
+ };
+ Sha512.prototype.scheduleSigma1_0 = function (value) {
+ var $this = rotateRight_0(value, 19);
+ var other = rotateRight_0(value, 61);
+ var tmp$ = new ULong_init($this.data.xor(other.data));
+ var other_0 = new ULong_init(value.data.shiftRightUnsigned(6));
+ return new ULong_init(tmp$.data.xor(other_0.data));
+ };
+ Sha512.prototype.compressionSigma0_0 = function (e) {
+ var $this = rotateRight_0(e, 28);
+ var other = rotateRight_0(e, 34);
+ var $this_0 = new ULong_init($this.data.xor(other.data));
+ var other_0 = rotateRight_0(e, 39);
+ return new ULong_init($this_0.data.xor(other_0.data));
+ };
+ Sha512.prototype.compressionSigma1_0 = function (a) {
+ var $this = rotateRight_0(a, 14);
+ var other = rotateRight_0(a, 18);
+ var $this_0 = new ULong_init($this.data.xor(other.data));
+ var other_0 = rotateRight_0(a, 41);
+ return new ULong_init($this_0.data.xor(other_0.data));
+ };
+ Sha512.prototype.ch_0 = function (x, y, z) {
+ var tmp$ = new ULong_init(x.data.and(y.data));
+ var other = Sha512$Companion_getInstance().ULONG_MASK;
+ var other_0 = new ULong_init((new ULong_init(x.data.xor(other.data))).data.and(z.data));
+ return new ULong_init(tmp$.data.xor(other_0.data));
+ };
+ Sha512.prototype.maj_0 = function (x, y, z) {
+ var tmp$ = new ULong_init(x.data.and(y.data));
+ var other = new ULong_init(x.data.and(z.data));
+ var tmp$_0 = new ULong_init(tmp$.data.xor(other.data));
+ var other_0 = new ULong_init(y.data.and(z.data));
+ return new ULong_init(tmp$_0.data.xor(other_0.data));
+ };
+ Sha512.prototype.toPaddedByteArray_0 = function ($receiver) {
+ var byteMask = new ULong_init(Kotlin.Long.fromInt(255));
+ var array = Array_0(8);
+ var tmp$;
+ tmp$ = array.length - 1 | 0;
+ loop_label: for (var i = 0; i <= tmp$; i++) {
+ var init$result;
+ init$break: do {
+ switch (i) {
+ case 7:
+ init$result = new UByte(toByte((new ULong_init($receiver.data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 6:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(8))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 5:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(16))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 4:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(24))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 3:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(32))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 2:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(40))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 1:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(48))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 0:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(56))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ default:init$result = new UByte(0);
+ break init$break;
+ }
+ }
+ while (false);
+ array[i] = init$result;
+ }
+ return array;
+ };
+ Sha512.prototype.toPadded128BitByteArray_0 = function ($receiver) {
+ var byteMask = new ULong_init(Kotlin.Long.fromInt(255));
+ var array = Array_0(16);
+ var tmp$;
+ tmp$ = array.length - 1 | 0;
+ loop_label: for (var i = 0; i <= tmp$; i++) {
+ var init$result;
+ init$break: do {
+ switch (i) {
+ case 15:
+ init$result = new UByte(toByte((new ULong_init($receiver.data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 14:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(8))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 13:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(16))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 12:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(24))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 11:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(32))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 10:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(40))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 9:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(48))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ case 8:
+ init$result = new UByte(toByte((new ULong_init((new ULong_init($receiver.data.shiftRightUnsigned(54))).data.and(byteMask.data))).data.toInt()));
+ break init$break;
+ default:init$result = new UByte(0);
+ break init$break;
+ }
+ }
+ while (false);
+ array[i] = init$result;
+ }
+ return array;
+ };
+ Sha512.$metadata$ = {
+ kind: Kind_CLASS,
+ simpleName: 'Sha512',
+ interfaces: []
+ };
+ var package$com = _.com || (_.com = {});
+ var package$ionspin = package$com.ionspin || (package$com.ionspin = {});
+ var package$kotlin = package$ionspin.kotlin || (package$ionspin.kotlin = {});
+ var package$crypto = package$kotlin.crypto || (package$kotlin.crypto = {});
+ package$crypto.hexColumsPrint_mgx7ee$ = hexColumsPrint;
+ package$crypto.hexColumsPrint_q387ch$ = hexColumsPrint_0;
+ package$crypto.hexColumsPrint_uo2ox1$ = hexColumsPrint_1;
+ package$crypto.rotateRight_k13f4a$ = rotateRight;
+ package$crypto.rotateRight_hc3rh$ = rotateRight_0;
+ $$importsForInline$$['crypto-core'] = _;
+ Object.defineProperty(Blake2b, 'Companion', {
+ get: Blake2b$Companion_getInstance
+ });
+ var package$blake2b = package$crypto.blake2b || (package$crypto.blake2b = {});
+ package$blake2b.Blake2b = Blake2b;
+ Object.defineProperty(Sha256, 'Companion', {
+ get: Sha256$Companion_getInstance
+ });
+ var package$sha = package$crypto.sha || (package$crypto.sha = {});
+ package$sha.Sha256 = Sha256;
+ Object.defineProperty(Sha512, 'Companion', {
+ get: Sha512$Companion_getInstance
+ });
+ package$sha.Sha512 = Sha512;
+ Kotlin.defineModule('crypto-core', _);
+ return _;
+}(module.exports, require('kotlin'), require('bignum')));
+
+//# sourceMappingURL=crypto-core.js.map
diff --git a/crypto-core/node_modules/crypto-core.js.map b/crypto-core/node_modules/crypto-core.js.map
new file mode 100644
index 0000000..609d1d4
--- /dev/null
+++ b/crypto-core/node_modules/crypto-core.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"crypto-core.js","sources":["kotlin/text/numberConversions.kt","generated/_Arrays.kt","kotlin/UInt.kt","kotlin/ULong.kt","kotlin/UByte.kt","arrayUtils.kt","kotlin/collections.kt","generated/_Collections.kt","generated/_ArraysJs.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/Util.kt","kotlin/text/string.kt","collections/Collections.kt","util/Standard.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2b.kt","kotlin/kotlin.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt"],"sourcesContent":["/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n\n/**\n * Returns `true` if the contents of this string is equal to the word \"true\", ignoring case, and `false` otherwise.\n */\npublic actual fun String.toBoolean(): Boolean = toLowerCase() == \"true\"\n\n/**\n * Parses the string as a signed [Byte] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toByte(): Byte = toByteOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a signed [Byte] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toByte(radix: Int): Byte = toByteOrNull(radix) ?: numberFormatError(this)\n\n\n/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toShort(): Short = toShortOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toShort(radix: Int): Short = toShortOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as an [Int] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toInt(): Int = toIntOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as an [Int] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toInt(radix: Int): Int = toIntOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Long] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toLong(): Long = toLongOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Long] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toLong(radix: Int): Long = toLongOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Double] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toDouble(): Double = (+(this.asDynamic())).unsafeCast().also {\n if (it.isNaN() && !this.isNaN() || it == 0.0 && this.isBlank())\n numberFormatError(this)\n}\n\n/**\n * Parses the string as a [Float] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toFloat(): Float = toDouble().unsafeCast()\n\n/**\n * Parses the string as a [Double] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\npublic actual fun String.toDoubleOrNull(): Double? = (+(this.asDynamic())).unsafeCast().takeIf {\n !(it.isNaN() && !this.isNaN() || it == 0.0 && this.isBlank())\n}\n\n/**\n * Parses the string as a [Float] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toFloatOrNull(): Float? = toDoubleOrNull().unsafeCast()\n\n/**\n * Returns a string representation of this [Byte] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Byte.toString(radix: Int): String = this.toInt().toString(radix)\n\n/**\n * Returns a string representation of this [Short] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Short.toString(radix: Int): String = this.toInt().toString(radix)\n\n/**\n * Returns a string representation of this [Long] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Long.toString(radix: Int): String = asDynamic().toString(checkRadix(radix))\n\n/**\n * Returns a string representation of this [Int] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Int.toString(radix: Int): String = asDynamic().toString(checkRadix(radix))\n\nprivate fun String.isNaN(): Boolean = when (this.toLowerCase()) {\n \"nan\", \"+nan\", \"-nan\" -> true\n else -> false\n}\n\n/**\n * Checks whether the given [radix] is valid radix for string to number and number to string conversion.\n */\n@PublishedApi\ninternal actual fun checkRadix(radix: Int): Int {\n if (radix !in 2..36) {\n throw IllegalArgumentException(\"radix $radix was not in valid range 2..36\")\n }\n return radix\n}\n\ninternal actual fun digitOf(char: Char, radix: Int): Int = when {\n char >= '0' && char <= '9' -> char - '0'\n char >= 'A' && char <= 'Z' -> char - 'A' + 10\n char >= 'a' && char <= 'z' -> char - 'a' + 10\n else -> -1\n}.let { if (it >= radix) -1 else it }\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"ArraysKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component1(): T {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component1(): Byte {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component1(): Short {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component1(): Int {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component1(): Long {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component1(): Float {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component1(): Double {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component1(): Boolean {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component1(): Char {\n return get(0)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component2(): T {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component2(): Byte {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component2(): Short {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component2(): Int {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component2(): Long {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component2(): Float {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component2(): Double {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component2(): Boolean {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component2(): Char {\n return get(1)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component3(): T {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component3(): Byte {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component3(): Short {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component3(): Int {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component3(): Long {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component3(): Float {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component3(): Double {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component3(): Boolean {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component3(): Char {\n return get(2)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component4(): T {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component4(): Byte {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component4(): Short {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component4(): Int {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component4(): Long {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component4(): Float {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component4(): Double {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component4(): Boolean {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component4(): Char {\n return get(3)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component5(): T {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component5(): Byte {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component5(): Short {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component5(): Int {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component5(): Long {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component5(): Float {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component5(): Double {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component5(): Boolean {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component5(): Char {\n return get(4)\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Array.contains(element: T): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun ByteArray.contains(element: Byte): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun ShortArray.contains(element: Short): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun IntArray.contains(element: Int): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun LongArray.contains(element: Long): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun FloatArray.contains(element: Float): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun DoubleArray.contains(element: Double): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun BooleanArray.contains(element: Boolean): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun CharArray.contains(element: Char): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun Array.elementAt(index: Int): T\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun ByteArray.elementAt(index: Int): Byte\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun ShortArray.elementAt(index: Int): Short\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun IntArray.elementAt(index: Int): Int\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun LongArray.elementAt(index: Int): Long\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun FloatArray.elementAt(index: Int): Float\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun DoubleArray.elementAt(index: Int): Double\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun BooleanArray.elementAt(index: Int): Boolean\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun CharArray.elementAt(index: Int): Char\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Byte): Byte {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Short): Short {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Int): Int {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Long): Long {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Float): Float {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Double): Double {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.elementAtOrNull(index: Int): T? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.elementAtOrNull(index: Int): Byte? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.elementAtOrNull(index: Int): Short? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.elementAtOrNull(index: Int): Int? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.elementAtOrNull(index: Int): Long? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.elementAtOrNull(index: Int): Float? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.elementAtOrNull(index: Int): Double? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.elementAtOrNull(index: Int): Boolean? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.elementAtOrNull(index: Int): Char? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.find(predicate: (T) -> Boolean): T? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.find(predicate: (Byte) -> Boolean): Byte? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.find(predicate: (Short) -> Boolean): Short? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.find(predicate: (Int) -> Boolean): Int? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.find(predicate: (Long) -> Boolean): Long? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.find(predicate: (Float) -> Boolean): Float? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.find(predicate: (Double) -> Boolean): Double? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.find(predicate: (Boolean) -> Boolean): Boolean? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.find(predicate: (Char) -> Boolean): Char? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.findLast(predicate: (Byte) -> Boolean): Byte? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.findLast(predicate: (Short) -> Boolean): Short? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.findLast(predicate: (Int) -> Boolean): Int? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.findLast(predicate: (Long) -> Boolean): Long? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.findLast(predicate: (Float) -> Boolean): Float? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.findLast(predicate: (Double) -> Boolean): Double? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.findLast(predicate: (Boolean) -> Boolean): Boolean? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.findLast(predicate: (Char) -> Boolean): Char? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun Array.first(): T {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun ByteArray.first(): Byte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun ShortArray.first(): Short {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun IntArray.first(): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun LongArray.first(): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun FloatArray.first(): Float {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun DoubleArray.first(): Double {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun BooleanArray.first(): Boolean {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun CharArray.first(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Array.first(predicate: (T) -> Boolean): T {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun ByteArray.first(predicate: (Byte) -> Boolean): Byte {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun ShortArray.first(predicate: (Short) -> Boolean): Short {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun IntArray.first(predicate: (Int) -> Boolean): Int {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun LongArray.first(predicate: (Long) -> Boolean): Long {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun FloatArray.first(predicate: (Float) -> Boolean): Float {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun DoubleArray.first(predicate: (Double) -> Boolean): Double {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun BooleanArray.first(predicate: (Boolean) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun CharArray.first(predicate: (Char) -> Boolean): Char {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun Array.firstOrNull(): T? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun ByteArray.firstOrNull(): Byte? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun ShortArray.firstOrNull(): Short? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun IntArray.firstOrNull(): Int? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun LongArray.firstOrNull(): Long? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun FloatArray.firstOrNull(): Float? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun DoubleArray.firstOrNull(): Double? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun BooleanArray.firstOrNull(): Boolean? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun CharArray.firstOrNull(): Char? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun Array.firstOrNull(predicate: (T) -> Boolean): T? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun ByteArray.firstOrNull(predicate: (Byte) -> Boolean): Byte? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun ShortArray.firstOrNull(predicate: (Short) -> Boolean): Short? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun LongArray.firstOrNull(predicate: (Long) -> Boolean): Long? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun FloatArray.firstOrNull(predicate: (Float) -> Boolean): Float? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun DoubleArray.firstOrNull(predicate: (Double) -> Boolean): Double? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun BooleanArray.firstOrNull(predicate: (Boolean) -> Boolean): Boolean? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.getOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.getOrElse(index: Int, defaultValue: (Int) -> Byte): Byte {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.getOrElse(index: Int, defaultValue: (Int) -> Short): Short {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.getOrElse(index: Int, defaultValue: (Int) -> Int): Int {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.getOrElse(index: Int, defaultValue: (Int) -> Long): Long {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.getOrElse(index: Int, defaultValue: (Int) -> Float): Float {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.getOrElse(index: Int, defaultValue: (Int) -> Double): Double {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.getOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.getOrElse(index: Int, defaultValue: (Int) -> Char): Char {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun Array.getOrNull(index: Int): T? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun ByteArray.getOrNull(index: Int): Byte? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun ShortArray.getOrNull(index: Int): Short? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun IntArray.getOrNull(index: Int): Int? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun LongArray.getOrNull(index: Int): Long? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun FloatArray.getOrNull(index: Int): Float? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun DoubleArray.getOrNull(index: Int): Double? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun BooleanArray.getOrNull(index: Int): Boolean? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n */\npublic fun CharArray.getOrNull(index: Int): Char? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Array.indexOf(element: T): Int {\n if (element == null) {\n for (index in indices) {\n if (this[index] == null) {\n return index\n }\n }\n } else {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun ByteArray.indexOf(element: Byte): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun ShortArray.indexOf(element: Short): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun IntArray.indexOf(element: Int): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun LongArray.indexOf(element: Long): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun FloatArray.indexOf(element: Float): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun DoubleArray.indexOf(element: Double): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun BooleanArray.indexOf(element: Boolean): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun CharArray.indexOf(element: Char): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun Array.indexOfFirst(predicate: (T) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ByteArray.indexOfFirst(predicate: (Byte) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ShortArray.indexOfFirst(predicate: (Short) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun IntArray.indexOfFirst(predicate: (Int) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun LongArray.indexOfFirst(predicate: (Long) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun FloatArray.indexOfFirst(predicate: (Float) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun DoubleArray.indexOfFirst(predicate: (Double) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun BooleanArray.indexOfFirst(predicate: (Boolean) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun CharArray.indexOfFirst(predicate: (Char) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun Array.indexOfLast(predicate: (T) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ByteArray.indexOfLast(predicate: (Byte) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ShortArray.indexOfLast(predicate: (Short) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun IntArray.indexOfLast(predicate: (Int) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun LongArray.indexOfLast(predicate: (Long) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun FloatArray.indexOfLast(predicate: (Float) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun DoubleArray.indexOfLast(predicate: (Double) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun BooleanArray.indexOfLast(predicate: (Boolean) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun CharArray.indexOfLast(predicate: (Char) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun Array.last(): T {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun ByteArray.last(): Byte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun ShortArray.last(): Short {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun IntArray.last(): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun LongArray.last(): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun FloatArray.last(): Float {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun DoubleArray.last(): Double {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun BooleanArray.last(): Boolean {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun CharArray.last(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Array.last(predicate: (T) -> Boolean): T {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun ByteArray.last(predicate: (Byte) -> Boolean): Byte {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun ShortArray.last(predicate: (Short) -> Boolean): Short {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun IntArray.last(predicate: (Int) -> Boolean): Int {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun LongArray.last(predicate: (Long) -> Boolean): Long {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun FloatArray.last(predicate: (Float) -> Boolean): Float {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun DoubleArray.last(predicate: (Double) -> Boolean): Double {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun BooleanArray.last(predicate: (Boolean) -> Boolean): Boolean {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun CharArray.last(predicate: (Char) -> Boolean): Char {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Array.lastIndexOf(element: T): Int {\n if (element == null) {\n for (index in indices.reversed()) {\n if (this[index] == null) {\n return index\n }\n }\n } else {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun ByteArray.lastIndexOf(element: Byte): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun ShortArray.lastIndexOf(element: Short): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun IntArray.lastIndexOf(element: Int): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun LongArray.lastIndexOf(element: Long): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun FloatArray.lastIndexOf(element: Float): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun DoubleArray.lastIndexOf(element: Double): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun BooleanArray.lastIndexOf(element: Boolean): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun CharArray.lastIndexOf(element: Char): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun Array.lastOrNull(): T? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun ByteArray.lastOrNull(): Byte? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun ShortArray.lastOrNull(): Short? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun IntArray.lastOrNull(): Int? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun LongArray.lastOrNull(): Long? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun FloatArray.lastOrNull(): Float? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun DoubleArray.lastOrNull(): Double? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun BooleanArray.lastOrNull(): Boolean? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n */\npublic fun CharArray.lastOrNull(): Char? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun Array.lastOrNull(predicate: (T) -> Boolean): T? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun ByteArray.lastOrNull(predicate: (Byte) -> Boolean): Byte? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun ShortArray.lastOrNull(predicate: (Short) -> Boolean): Short? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun IntArray.lastOrNull(predicate: (Int) -> Boolean): Int? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun LongArray.lastOrNull(predicate: (Long) -> Boolean): Long? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun FloatArray.lastOrNull(predicate: (Float) -> Boolean): Float? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun DoubleArray.lastOrNull(predicate: (Double) -> Boolean): Double? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun BooleanArray.lastOrNull(predicate: (Boolean) -> Boolean): Boolean? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun CharArray.lastOrNull(predicate: (Char) -> Boolean): Char? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.random(): T {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.random(): Byte {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.random(): Short {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.random(): Int {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.random(): Long {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.random(): Float {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.random(): Double {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.random(): Boolean {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.random(): Char {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Array.random(random: Random): T {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun ByteArray.random(random: Random): Byte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun ShortArray.random(random: Random): Short {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun IntArray.random(random: Random): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun LongArray.random(random: Random): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun FloatArray.random(random: Random): Float {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun DoubleArray.random(random: Random): Double {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun BooleanArray.random(random: Random): Boolean {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun CharArray.random(random: Random): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun Array.single(): T {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun ByteArray.single(): Byte {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun ShortArray.single(): Short {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun IntArray.single(): Int {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun LongArray.single(): Long {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun FloatArray.single(): Float {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun DoubleArray.single(): Double {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun BooleanArray.single(): Boolean {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun CharArray.single(): Char {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun Array.single(predicate: (T) -> Boolean): T {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun ByteArray.single(predicate: (Byte) -> Boolean): Byte {\n var single: Byte? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Byte\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun ShortArray.single(predicate: (Short) -> Boolean): Short {\n var single: Short? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Short\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun IntArray.single(predicate: (Int) -> Boolean): Int {\n var single: Int? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Int\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun LongArray.single(predicate: (Long) -> Boolean): Long {\n var single: Long? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Long\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun FloatArray.single(predicate: (Float) -> Boolean): Float {\n var single: Float? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Float\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun DoubleArray.single(predicate: (Double) -> Boolean): Double {\n var single: Double? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Double\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun BooleanArray.single(predicate: (Boolean) -> Boolean): Boolean {\n var single: Boolean? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Boolean\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun CharArray.single(predicate: (Char) -> Boolean): Char {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Char\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun Array.singleOrNull(): T? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun ByteArray.singleOrNull(): Byte? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun ShortArray.singleOrNull(): Short? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun IntArray.singleOrNull(): Int? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun LongArray.singleOrNull(): Long? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun FloatArray.singleOrNull(): Float? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun DoubleArray.singleOrNull(): Double? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun BooleanArray.singleOrNull(): Boolean? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun CharArray.singleOrNull(): Char? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun Array.singleOrNull(predicate: (T) -> Boolean): T? {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun ByteArray.singleOrNull(predicate: (Byte) -> Boolean): Byte? {\n var single: Byte? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun ShortArray.singleOrNull(predicate: (Short) -> Boolean): Short? {\n var single: Short? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun IntArray.singleOrNull(predicate: (Int) -> Boolean): Int? {\n var single: Int? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun LongArray.singleOrNull(predicate: (Long) -> Boolean): Long? {\n var single: Long? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun FloatArray.singleOrNull(predicate: (Float) -> Boolean): Float? {\n var single: Float? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun DoubleArray.singleOrNull(predicate: (Double) -> Boolean): Double? {\n var single: Double? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun BooleanArray.singleOrNull(predicate: (Boolean) -> Boolean): Boolean? {\n var single: Boolean? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun CharArray.singleOrNull(predicate: (Char) -> Boolean): Char? {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Array.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ByteArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ShortArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun IntArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun LongArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun FloatArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun DoubleArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun BooleanArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun CharArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Array.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ByteArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ShortArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun IntArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun LongArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun FloatArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun DoubleArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun BooleanArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun CharArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Array.dropLastWhile(predicate: (T) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ByteArray.dropLastWhile(predicate: (Byte) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ShortArray.dropLastWhile(predicate: (Short) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun IntArray.dropLastWhile(predicate: (Int) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun LongArray.dropLastWhile(predicate: (Long) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun FloatArray.dropLastWhile(predicate: (Float) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun DoubleArray.dropLastWhile(predicate: (Double) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun BooleanArray.dropLastWhile(predicate: (Boolean) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun CharArray.dropLastWhile(predicate: (Char) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Array.dropWhile(predicate: (T) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun Array.filter(predicate: (T) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun ShortArray.filter(predicate: (Short) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun IntArray.filter(predicate: (Int) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun LongArray.filter(predicate: (Long) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun FloatArray.filter(predicate: (Float) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun DoubleArray.filter(predicate: (Double) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun BooleanArray.filter(predicate: (Boolean) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun CharArray.filter(predicate: (Char) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun Array.filterIndexed(predicate: (index: Int, T) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun ByteArray.filterIndexed(predicate: (index: Int, Byte) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun ShortArray.filterIndexed(predicate: (index: Int, Short) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun IntArray.filterIndexed(predicate: (index: Int, Int) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun LongArray.filterIndexed(predicate: (index: Int, Long) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun FloatArray.filterIndexed(predicate: (index: Int, Float) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun DoubleArray.filterIndexed(predicate: (index: Int, Double) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun BooleanArray.filterIndexed(predicate: (index: Int, Boolean) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun CharArray.filterIndexed(predicate: (index: Int, Char) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > Array.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > ByteArray.filterIndexedTo(destination: C, predicate: (index: Int, Byte) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > ShortArray.filterIndexedTo(destination: C, predicate: (index: Int, Short) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > IntArray.filterIndexedTo(destination: C, predicate: (index: Int, Int) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > LongArray.filterIndexedTo(destination: C, predicate: (index: Int, Long) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > FloatArray.filterIndexedTo(destination: C, predicate: (index: Int, Float) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > DoubleArray.filterIndexedTo(destination: C, predicate: (index: Int, Double) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > BooleanArray.filterIndexedTo(destination: C, predicate: (index: Int, Boolean) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > CharArray.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a list containing all elements that are instances of specified type parameter R.\n */\npublic inline fun Array<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> {\n return filterIsInstanceTo(ArrayList())\n}\n\n/**\n * Appends all elements that are instances of specified type parameter R to the given [destination].\n */\npublic inline fun > Array<*>.filterIsInstanceTo(destination: C): C {\n for (element in this) if (element is R) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun Array.filterNot(predicate: (T) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun ByteArray.filterNot(predicate: (Byte) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun ShortArray.filterNot(predicate: (Short) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun IntArray.filterNot(predicate: (Int) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun LongArray.filterNot(predicate: (Long) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun FloatArray.filterNot(predicate: (Float) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun DoubleArray.filterNot(predicate: (Double) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun BooleanArray.filterNot(predicate: (Boolean) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun CharArray.filterNot(predicate: (Char) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements that are not `null`.\n */\npublic fun Array.filterNotNull(): List {\n return filterNotNullTo(ArrayList())\n}\n\n/**\n * Appends all elements that are not `null` to the given [destination].\n */\npublic fun , T : Any> Array.filterNotNullTo(destination: C): C {\n for (element in this) if (element != null) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > Array.filterNotTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > ByteArray.filterNotTo(destination: C, predicate: (Byte) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > ShortArray.filterNotTo(destination: C, predicate: (Short) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > IntArray.filterNotTo(destination: C, predicate: (Int) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > LongArray.filterNotTo(destination: C, predicate: (Long) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > FloatArray.filterNotTo(destination: C, predicate: (Float) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > DoubleArray.filterNotTo(destination: C, predicate: (Double) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > BooleanArray.filterNotTo(destination: C, predicate: (Boolean) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > CharArray.filterNotTo(destination: C, predicate: (Char) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > Array.filterTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > ByteArray.filterTo(destination: C, predicate: (Byte) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > ShortArray.filterTo(destination: C, predicate: (Short) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > IntArray.filterTo(destination: C, predicate: (Int) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > LongArray.filterTo(destination: C, predicate: (Long) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > FloatArray.filterTo(destination: C, predicate: (Float) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > DoubleArray.filterTo(destination: C, predicate: (Double) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > BooleanArray.filterTo(destination: C, predicate: (Boolean) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > CharArray.filterTo(destination: C, predicate: (Char) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun Array.slice(indices: IntRange): List