@dmarket/p2p-tracker-core 0.1.0-SNAPSHOT.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dmarket-p2p-tracker-core-domain.mjs +8456 -0
  2. package/dmarket-p2p-tracker-core-domain.mjs.map +1 -0
  3. package/kotlin-kotlin-stdlib.mjs +17010 -0
  4. package/kotlin-kotlin-stdlib.mjs.map +1 -0
  5. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  6. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -0
  7. package/kotlinx-atomicfu.mjs +251 -0
  8. package/kotlinx-atomicfu.mjs.map +1 -0
  9. package/kotlinx-browser.mjs +8 -0
  10. package/kotlinx-browser.mjs.map +1 -0
  11. package/kotlinx-coroutines-core.mjs +11173 -0
  12. package/kotlinx-coroutines-core.mjs.map +1 -0
  13. package/kotlinx-io-kotlinx-io-bytestring.mjs +202 -0
  14. package/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
  15. package/kotlinx-io-kotlinx-io-core.mjs +2014 -0
  16. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  17. package/kotlinx-serialization-kotlinx-serialization-core.mjs +5753 -0
  18. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  19. package/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  20. package/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  21. package/kotlinx-serialization-kotlinx-serialization-json.mjs +5436 -0
  22. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  23. package/ktor-ktor-client-content-negotiation.mjs +4 -0
  24. package/ktor-ktor-client-content-negotiation.mjs.map +1 -0
  25. package/ktor-ktor-client-core.mjs +9869 -0
  26. package/ktor-ktor-client-core.mjs.map +1 -0
  27. package/ktor-ktor-events.mjs +82 -0
  28. package/ktor-ktor-events.mjs.map +1 -0
  29. package/ktor-ktor-http-cio.mjs +2253 -0
  30. package/ktor-ktor-http-cio.mjs.map +1 -0
  31. package/ktor-ktor-http.mjs +3133 -0
  32. package/ktor-ktor-http.mjs.map +1 -0
  33. package/ktor-ktor-io.mjs +3511 -0
  34. package/ktor-ktor-io.mjs.map +1 -0
  35. package/ktor-ktor-serialization-kotlinx-json.mjs +4 -0
  36. package/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -0
  37. package/ktor-ktor-serialization-kotlinx.mjs +4 -0
  38. package/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
  39. package/ktor-ktor-serialization.mjs +4 -0
  40. package/ktor-ktor-serialization.mjs.map +1 -0
  41. package/ktor-ktor-sse.mjs +4 -0
  42. package/ktor-ktor-sse.mjs.map +1 -0
  43. package/ktor-ktor-utils.mjs +3207 -0
  44. package/ktor-ktor-utils.mjs.map +1 -0
  45. package/ktor-ktor-websocket-serialization.mjs +4 -0
  46. package/ktor-ktor-websocket-serialization.mjs.map +1 -0
  47. package/ktor-ktor-websockets.mjs +2522 -0
  48. package/ktor-ktor-websockets.mjs.map +1 -0
  49. package/p2p-tracker-core.d.mts +286 -0
  50. package/p2p-tracker-core.mjs +15126 -0
  51. package/p2p-tracker-core.mjs.map +1 -0
  52. package/package.json +49 -0
@@ -0,0 +1,2014 @@
1
+ import {
2
+ IndexOutOfBoundsException_init_$Create$1dzbcrcoqjvjq as IndexOutOfBoundsException_init_$Create$,
3
+ Long2qws0ah9gnpki as Long,
4
+ compare2uud5j30pw5xc as compare,
5
+ IllegalArgumentException_init_$Create$1mgk48flhjim3 as IllegalArgumentException_init_$Create$,
6
+ subtract16cg4lfi29fq9 as subtract,
7
+ _Char___init__impl__6a9atx2yltdocdrxs4d as _Char___init__impl__6a9atx,
8
+ charArrayOf27f4r3dozbrk1 as charArrayOf,
9
+ protoOf180f3jzyo7rfj as protoOf,
10
+ equalsLong28bsrfhwvd686 as equalsLong,
11
+ toString1pkumu07cwy4m as toString,
12
+ Unit_instance3vdlo4e4f5ggx as Unit_instance,
13
+ toShort36kaw0zjdq3ex as toShort,
14
+ add85si75olwt6n as add,
15
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
16
+ fromInt1lka3ktyu79a4 as fromInt,
17
+ convertToIntofdoxh9bstof as convertToInt,
18
+ StringBuilder_init_$Create$3q4yitjcnfjo as StringBuilder_init_$Create$,
19
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
20
+ VOID3gxj6tk5isa35 as VOID,
21
+ IllegalStateException_init_$Create$3394faf8tdm0h as IllegalStateException_init_$Create$,
22
+ AutoCloseable1l5p57f9lp7kv as AutoCloseable,
23
+ objectCreate1ve4bgxiu4x98 as objectCreate,
24
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
25
+ arrayCopytctsywo3h7gj as arrayCopy,
26
+ toByte4i43936u611k as toByte,
27
+ IllegalArgumentException_init_$Create$3iqt7dot1ye95 as IllegalArgumentException_init_$Create$_0,
28
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
29
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
30
+ multiply18i3gv3wlmcjg as multiply,
31
+ charCodeAt1yspne1d8erbm as charCodeAt,
32
+ Char__toInt_impl_vasixd1ka89vowck9tn as Char__toInt_impl_vasixd,
33
+ charArray2ujmm1qusno00 as charArray,
34
+ numberToChar93r9buh19yek as numberToChar,
35
+ concatToString3cxf0c1gqonpo as concatToString,
36
+ Exception_init_$Init$2vwhrp06ljvx1 as Exception_init_$Init$,
37
+ captureStack1fzi4aczwc4hg as captureStack,
38
+ Exception_init_$Init$1ksq2fk0jxaag as Exception_init_$Init$_0,
39
+ Exception_init_$Init$1h6nhjelrr18t as Exception_init_$Init$_1,
40
+ Exceptiondt2hlxn7j7vw as Exception,
41
+ } from './kotlin-kotlin-stdlib.mjs';
42
+ import { UnsafeByteStringOperations_instance32go50d8u0bll as UnsafeByteStringOperations_instance } from './kotlinx-io-kotlinx-io-bytestring.mjs';
43
+ //region block: imports
44
+ var imul = Math.imul;
45
+ //endregion
46
+ //region block: pre-declaration
47
+ initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
48
+ function write$default(source, startIndex, endIndex, $super) {
49
+ startIndex = startIndex === VOID ? 0 : startIndex;
50
+ endIndex = endIndex === VOID ? source.length : endIndex;
51
+ var tmp;
52
+ if ($super === VOID) {
53
+ this.n2z(source, startIndex, endIndex);
54
+ tmp = Unit_instance;
55
+ } else {
56
+ tmp = $super.n2z.call(this, source, startIndex, endIndex);
57
+ }
58
+ return tmp;
59
+ }
60
+ initMetadataForInterface(Sink, 'Sink', VOID, VOID, [AutoCloseable]);
61
+ initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
62
+ initMetadataForClass(PeekSource, 'PeekSource', VOID, VOID, [AutoCloseable]);
63
+ initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
64
+ initMetadataForCompanion(Companion);
65
+ initMetadataForClass(Segment, 'Segment');
66
+ initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
67
+ initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
68
+ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
69
+ initMetadataForClass(SegmentReadContextImpl$1);
70
+ initMetadataForClass(SegmentWriteContextImpl$1);
71
+ initMetadataForClass(BufferIterationContextImpl$1);
72
+ initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
73
+ initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
74
+ initMetadataForObject(SegmentPool, 'SegmentPool');
75
+ //endregion
76
+ function get_HEX_DIGIT_CHARS() {
77
+ _init_properties__Util_kt__g8tcl9();
78
+ return HEX_DIGIT_CHARS;
79
+ }
80
+ var HEX_DIGIT_CHARS;
81
+ function checkBounds(size, startIndex, endIndex) {
82
+ _init_properties__Util_kt__g8tcl9();
83
+ if (compare(startIndex, new Long(0, 0)) < 0 || compare(endIndex, size) > 0) {
84
+ throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
85
+ }
86
+ if (compare(startIndex, endIndex) > 0) {
87
+ throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
88
+ }
89
+ }
90
+ function checkOffsetAndCount(size, offset, byteCount) {
91
+ _init_properties__Util_kt__g8tcl9();
92
+ if (compare(offset, new Long(0, 0)) < 0 || compare(offset, size) > 0 || compare(subtract(size, offset), byteCount) < 0 || compare(byteCount, new Long(0, 0)) < 0) {
93
+ throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
94
+ }
95
+ }
96
+ var properties_initialized__Util_kt_67kc5b;
97
+ function _init_properties__Util_kt__g8tcl9() {
98
+ if (!properties_initialized__Util_kt_67kc5b) {
99
+ properties_initialized__Util_kt_67kc5b = true;
100
+ // Inline function 'kotlin.charArrayOf' call
101
+ HEX_DIGIT_CHARS = charArrayOf([_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(49), _Char___init__impl__6a9atx(50), _Char___init__impl__6a9atx(51), _Char___init__impl__6a9atx(52), _Char___init__impl__6a9atx(53), _Char___init__impl__6a9atx(54), _Char___init__impl__6a9atx(55), _Char___init__impl__6a9atx(56), _Char___init__impl__6a9atx(57), _Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(98), _Char___init__impl__6a9atx(99), _Char___init__impl__6a9atx(100), _Char___init__impl__6a9atx(101), _Char___init__impl__6a9atx(102)]);
102
+ }
103
+ }
104
+ function throwEof($this, byteCount) {
105
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.d1().toString() + ', required: ' + byteCount.toString() + ')');
106
+ }
107
+ function Buffer() {
108
+ this.a2y_1 = null;
109
+ this.b2y_1 = null;
110
+ this.c2y_1 = new Long(0, 0);
111
+ }
112
+ protoOf(Buffer).d1 = function () {
113
+ return this.c2y_1;
114
+ };
115
+ protoOf(Buffer).d2y = function () {
116
+ return this;
117
+ };
118
+ protoOf(Buffer).e2y = function () {
119
+ return equalsLong(this.d1(), new Long(0, 0));
120
+ };
121
+ protoOf(Buffer).f2y = function (byteCount) {
122
+ // Inline function 'kotlin.require' call
123
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
124
+ var message = 'byteCount: ' + byteCount.toString();
125
+ throw IllegalArgumentException_init_$Create$(toString(message));
126
+ }
127
+ if (compare(this.d1(), byteCount) < 0) {
128
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.d1().toString() + ', required: ' + byteCount.toString() + ')');
129
+ }
130
+ };
131
+ protoOf(Buffer).g2y = function (byteCount) {
132
+ // Inline function 'kotlin.require' call
133
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
134
+ var message = 'byteCount: ' + byteCount.toString() + ' < 0';
135
+ throw IllegalArgumentException_init_$Create$(toString(message));
136
+ }
137
+ return compare(this.d1(), byteCount) >= 0;
138
+ };
139
+ protoOf(Buffer).h2y = function () {
140
+ var tmp0_elvis_lhs = this.a2y_1;
141
+ var tmp;
142
+ if (tmp0_elvis_lhs == null) {
143
+ throwEof(this, new Long(1, 0));
144
+ } else {
145
+ tmp = tmp0_elvis_lhs;
146
+ }
147
+ var segment = tmp;
148
+ var segmentSize = segment.d1();
149
+ if (segmentSize === 0) {
150
+ this.p2y();
151
+ return this.h2y();
152
+ }
153
+ var v = segment.q2y();
154
+ this.c2y_1 = subtract(this.c2y_1, new Long(1, 0));
155
+ if (segmentSize === 1) {
156
+ this.p2y();
157
+ }
158
+ return v;
159
+ };
160
+ protoOf(Buffer).r2y = function () {
161
+ var tmp0_elvis_lhs = this.a2y_1;
162
+ var tmp;
163
+ if (tmp0_elvis_lhs == null) {
164
+ throwEof(this, new Long(2, 0));
165
+ } else {
166
+ tmp = tmp0_elvis_lhs;
167
+ }
168
+ var segment = tmp;
169
+ var segmentSize = segment.d1();
170
+ if (segmentSize < 2) {
171
+ this.f2y(new Long(2, 0));
172
+ if (segmentSize === 0) {
173
+ this.p2y();
174
+ return this.r2y();
175
+ }
176
+ // Inline function 'kotlinx.io.and' call
177
+ var tmp_0 = (this.h2y() & 255) << 8;
178
+ // Inline function 'kotlinx.io.and' call
179
+ var tmp$ret$1 = this.h2y() & 255;
180
+ return toShort(tmp_0 | tmp$ret$1);
181
+ }
182
+ var v = segment.s2y();
183
+ this.c2y_1 = subtract(this.c2y_1, new Long(2, 0));
184
+ if (segmentSize === 2) {
185
+ this.p2y();
186
+ }
187
+ return v;
188
+ };
189
+ protoOf(Buffer).t2y = function () {
190
+ return Unit_instance;
191
+ };
192
+ protoOf(Buffer).u2y = function (out, startIndex, endIndex) {
193
+ checkBounds(this.d1(), startIndex, endIndex);
194
+ if (equalsLong(startIndex, endIndex))
195
+ return Unit_instance;
196
+ var currentOffset = startIndex;
197
+ var remainingByteCount = subtract(endIndex, startIndex);
198
+ out.c2y_1 = add(out.c2y_1, remainingByteCount);
199
+ var s = this.a2y_1;
200
+ while (compare(currentOffset, fromInt(ensureNotNull(s).k2y_1 - s.j2y_1 | 0)) >= 0) {
201
+ currentOffset = subtract(currentOffset, fromInt(s.k2y_1 - s.j2y_1 | 0));
202
+ s = s.n2y_1;
203
+ }
204
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
205
+ var copy = ensureNotNull(s).v2y();
206
+ copy.j2y_1 = copy.j2y_1 + convertToInt(currentOffset) | 0;
207
+ var tmp = copy;
208
+ var tmp0 = copy.j2y_1 + convertToInt(remainingByteCount) | 0;
209
+ // Inline function 'kotlin.comparisons.minOf' call
210
+ var b = copy.k2y_1;
211
+ tmp.k2y_1 = Math.min(tmp0, b);
212
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
213
+ if (out.a2y_1 == null) {
214
+ out.a2y_1 = copy;
215
+ out.b2y_1 = copy;
216
+ } else if (false) {
217
+ out.b2y_1 = ensureNotNull(out.b2y_1).w2y(copy).x2y();
218
+ if (ensureNotNull(out.b2y_1).o2y_1 == null) {
219
+ out.a2y_1 = out.b2y_1;
220
+ }
221
+ } else {
222
+ out.b2y_1 = ensureNotNull(out.b2y_1).w2y(copy);
223
+ }
224
+ remainingByteCount = subtract(remainingByteCount, fromInt(copy.k2y_1 - copy.j2y_1 | 0));
225
+ currentOffset = new Long(0, 0);
226
+ s = s.n2y_1;
227
+ }
228
+ };
229
+ protoOf(Buffer).y2y = function () {
230
+ var result = this.d1();
231
+ if (equalsLong(result, new Long(0, 0)))
232
+ return new Long(0, 0);
233
+ var tail = ensureNotNull(this.b2y_1);
234
+ if (tail.k2y_1 < 8192 && tail.m2y_1) {
235
+ result = subtract(result, fromInt(tail.k2y_1 - tail.j2y_1 | 0));
236
+ }
237
+ return result;
238
+ };
239
+ protoOf(Buffer).z2y = function (position) {
240
+ if (compare(position, new Long(0, 0)) < 0 || compare(position, this.d1()) >= 0) {
241
+ throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.d1().toString() + '))');
242
+ }
243
+ if (equalsLong(position, new Long(0, 0))) {
244
+ return ensureNotNull(this.a2y_1).a2z(0);
245
+ }
246
+ $l$block_1: {
247
+ // Inline function 'kotlinx.io.seek' call
248
+ if (this.a2y_1 == null) {
249
+ var offset = new Long(-1, -1);
250
+ return ensureNotNull(null).a2z(convertToInt(subtract(position, offset)));
251
+ }
252
+ if (compare(subtract(this.d1(), position), position) < 0) {
253
+ var s = this.b2y_1;
254
+ var offset_0 = this.d1();
255
+ $l$loop: while (!(s == null) && compare(offset_0, position) > 0) {
256
+ offset_0 = subtract(offset_0, fromInt(s.k2y_1 - s.j2y_1 | 0));
257
+ if (compare(offset_0, position) <= 0)
258
+ break $l$loop;
259
+ s = s.o2y_1;
260
+ }
261
+ var tmp0 = s;
262
+ var offset_1 = offset_0;
263
+ return ensureNotNull(tmp0).a2z(convertToInt(subtract(position, offset_1)));
264
+ } else {
265
+ var s_0 = this.a2y_1;
266
+ var offset_2 = new Long(0, 0);
267
+ $l$loop_0: while (!(s_0 == null)) {
268
+ var tmp0_0 = offset_2;
269
+ // Inline function 'kotlin.Long.plus' call
270
+ var other = s_0.k2y_1 - s_0.j2y_1 | 0;
271
+ var nextOffset = add(tmp0_0, fromInt(other));
272
+ if (compare(nextOffset, position) > 0)
273
+ break $l$loop_0;
274
+ s_0 = s_0.n2y_1;
275
+ offset_2 = nextOffset;
276
+ }
277
+ var tmp0_1 = s_0;
278
+ var offset_3 = offset_2;
279
+ return ensureNotNull(tmp0_1).a2z(convertToInt(subtract(position, offset_3)));
280
+ }
281
+ }
282
+ };
283
+ protoOf(Buffer).q2 = function () {
284
+ return this.b2z(this.d1());
285
+ };
286
+ protoOf(Buffer).b2z = function (byteCount) {
287
+ // Inline function 'kotlinx.io.checkByteCount' call
288
+ // Inline function 'kotlin.require' call
289
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
290
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
291
+ throw IllegalArgumentException_init_$Create$(toString(message));
292
+ }
293
+ var remainingByteCount = byteCount;
294
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
295
+ var tmp0_elvis_lhs = this.a2y_1;
296
+ var tmp;
297
+ if (tmp0_elvis_lhs == null) {
298
+ throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
299
+ } else {
300
+ tmp = tmp0_elvis_lhs;
301
+ }
302
+ var head = tmp;
303
+ var tmp0 = remainingByteCount;
304
+ // Inline function 'kotlinx.io.minOf' call
305
+ var b = head.k2y_1 - head.j2y_1 | 0;
306
+ // Inline function 'kotlin.comparisons.minOf' call
307
+ var b_0 = fromInt(b);
308
+ var tmp$ret$3 = compare(tmp0, b_0) <= 0 ? tmp0 : b_0;
309
+ var toSkip = convertToInt(tmp$ret$3);
310
+ this.c2y_1 = subtract(this.c2y_1, fromInt(toSkip));
311
+ remainingByteCount = subtract(remainingByteCount, fromInt(toSkip));
312
+ head.j2y_1 = head.j2y_1 + toSkip | 0;
313
+ if (head.j2y_1 === head.k2y_1) {
314
+ this.p2y();
315
+ }
316
+ }
317
+ };
318
+ protoOf(Buffer).c2z = function (sink, startIndex, endIndex) {
319
+ // Inline function 'kotlinx.io.checkBounds' call
320
+ var size = sink.length;
321
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
322
+ var tmp0_elvis_lhs = this.a2y_1;
323
+ var tmp;
324
+ if (tmp0_elvis_lhs == null) {
325
+ return -1;
326
+ } else {
327
+ tmp = tmp0_elvis_lhs;
328
+ }
329
+ var s = tmp;
330
+ var tmp0 = endIndex - startIndex | 0;
331
+ // Inline function 'kotlin.comparisons.minOf' call
332
+ var b = s.d1();
333
+ var toCopy = Math.min(tmp0, b);
334
+ s.d2z(sink, startIndex, startIndex + toCopy | 0);
335
+ this.c2y_1 = subtract(this.c2y_1, fromInt(toCopy));
336
+ if (isEmpty(s)) {
337
+ this.p2y();
338
+ }
339
+ return toCopy;
340
+ };
341
+ protoOf(Buffer).e2z = function (sink, byteCount) {
342
+ // Inline function 'kotlinx.io.checkByteCount' call
343
+ // Inline function 'kotlin.require' call
344
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
345
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
346
+ throw IllegalArgumentException_init_$Create$(toString(message));
347
+ }
348
+ if (equalsLong(this.d1(), new Long(0, 0)))
349
+ return new Long(-1, -1);
350
+ var bytesWritten = compare(byteCount, this.d1()) > 0 ? this.d1() : byteCount;
351
+ sink.f2z(this, bytesWritten);
352
+ return bytesWritten;
353
+ };
354
+ protoOf(Buffer).g2z = function (sink, byteCount) {
355
+ // Inline function 'kotlinx.io.checkByteCount' call
356
+ // Inline function 'kotlin.require' call
357
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
358
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
359
+ throw IllegalArgumentException_init_$Create$(toString(message));
360
+ }
361
+ if (compare(this.d1(), byteCount) < 0) {
362
+ sink.f2z(this, this.d1());
363
+ throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.d1().toString() + ' bytes were written.');
364
+ }
365
+ sink.f2z(this, byteCount);
366
+ };
367
+ protoOf(Buffer).h2z = function (sink) {
368
+ var byteCount = this.d1();
369
+ if (compare(byteCount, new Long(0, 0)) > 0) {
370
+ sink.f2z(this, byteCount);
371
+ }
372
+ return byteCount;
373
+ };
374
+ protoOf(Buffer).i2z = function () {
375
+ return buffered(new PeekSource(this));
376
+ };
377
+ protoOf(Buffer).j2z = function (minimumCapacity) {
378
+ // Inline function 'kotlin.require' call
379
+ if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
380
+ var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
381
+ throw IllegalArgumentException_init_$Create$(toString(message));
382
+ }
383
+ if (this.b2y_1 == null) {
384
+ var result = SegmentPool_instance.m2z();
385
+ this.a2y_1 = result;
386
+ this.b2y_1 = result;
387
+ return result;
388
+ }
389
+ var t = ensureNotNull(this.b2y_1);
390
+ if ((t.k2y_1 + minimumCapacity | 0) > 8192 || !t.m2y_1) {
391
+ var newTail = t.w2y(SegmentPool_instance.m2z());
392
+ this.b2y_1 = newTail;
393
+ return newTail;
394
+ }
395
+ return t;
396
+ };
397
+ protoOf(Buffer).n2z = function (source, startIndex, endIndex) {
398
+ // Inline function 'kotlinx.io.checkBounds' call
399
+ var size = source.length;
400
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
401
+ var currentOffset = startIndex;
402
+ while (currentOffset < endIndex) {
403
+ var tail = this.j2z(1);
404
+ var tmp0 = endIndex - currentOffset | 0;
405
+ // Inline function 'kotlin.comparisons.minOf' call
406
+ var b = tail.o2z();
407
+ var toCopy = Math.min(tmp0, b);
408
+ tail.p2z(source, currentOffset, currentOffset + toCopy | 0);
409
+ currentOffset = currentOffset + toCopy | 0;
410
+ }
411
+ var tmp = this;
412
+ var tmp0_0 = this.c2y_1;
413
+ // Inline function 'kotlin.Long.plus' call
414
+ var other = endIndex - startIndex | 0;
415
+ tmp.c2y_1 = add(tmp0_0, fromInt(other));
416
+ };
417
+ protoOf(Buffer).f2z = function (source, byteCount) {
418
+ // Inline function 'kotlin.require' call
419
+ if (!!(source === this)) {
420
+ var message = 'source == this';
421
+ throw IllegalArgumentException_init_$Create$(toString(message));
422
+ }
423
+ checkOffsetAndCount(source.c2y_1, new Long(0, 0), byteCount);
424
+ var remainingByteCount = byteCount;
425
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
426
+ if (compare(remainingByteCount, fromInt(ensureNotNull(source.a2y_1).d1())) < 0) {
427
+ var tail = this.b2y_1;
428
+ var tmp;
429
+ if (!(tail == null) && tail.m2y_1) {
430
+ var tmp0 = remainingByteCount;
431
+ // Inline function 'kotlin.Long.plus' call
432
+ var other = tail.k2y_1;
433
+ var tmp0_0 = add(tmp0, fromInt(other));
434
+ // Inline function 'kotlin.Long.minus' call
435
+ var other_0 = tail.r2z() ? 0 : tail.j2y_1;
436
+ var tmp$ret$3 = subtract(tmp0_0, fromInt(other_0));
437
+ tmp = compare(tmp$ret$3, new Long(8192, 0)) <= 0;
438
+ } else {
439
+ tmp = false;
440
+ }
441
+ if (tmp) {
442
+ ensureNotNull(source.a2y_1).t2z(tail, convertToInt(remainingByteCount));
443
+ source.c2y_1 = subtract(source.c2y_1, remainingByteCount);
444
+ this.c2y_1 = add(this.c2y_1, remainingByteCount);
445
+ return Unit_instance;
446
+ } else {
447
+ source.a2y_1 = ensureNotNull(source.a2y_1).s2z(convertToInt(remainingByteCount));
448
+ }
449
+ }
450
+ var segmentToMove = ensureNotNull(source.a2y_1);
451
+ var movedByteCount = fromInt(segmentToMove.d1());
452
+ source.a2y_1 = segmentToMove.u2z();
453
+ if (source.a2y_1 == null) {
454
+ source.b2y_1 = null;
455
+ }
456
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
457
+ if (this.a2y_1 == null) {
458
+ this.a2y_1 = segmentToMove;
459
+ this.b2y_1 = segmentToMove;
460
+ } else if (true) {
461
+ this.b2y_1 = ensureNotNull(this.b2y_1).w2y(segmentToMove).x2y();
462
+ if (ensureNotNull(this.b2y_1).o2y_1 == null) {
463
+ this.a2y_1 = this.b2y_1;
464
+ }
465
+ } else {
466
+ this.b2y_1 = ensureNotNull(this.b2y_1).w2y(segmentToMove);
467
+ }
468
+ source.c2y_1 = subtract(source.c2y_1, movedByteCount);
469
+ this.c2y_1 = add(this.c2y_1, movedByteCount);
470
+ remainingByteCount = subtract(remainingByteCount, movedByteCount);
471
+ }
472
+ };
473
+ protoOf(Buffer).v2z = function (source) {
474
+ var totalBytesRead = new Long(0, 0);
475
+ $l$loop: while (true) {
476
+ var readCount = source.e2z(this, new Long(8192, 0));
477
+ if (equalsLong(readCount, new Long(-1, -1)))
478
+ break $l$loop;
479
+ totalBytesRead = add(totalBytesRead, readCount);
480
+ }
481
+ return totalBytesRead;
482
+ };
483
+ protoOf(Buffer).w2z = function (byte) {
484
+ this.j2z(1).x2z(byte);
485
+ this.c2y_1 = add(this.c2y_1, new Long(1, 0));
486
+ };
487
+ protoOf(Buffer).y2z = function (short) {
488
+ this.j2z(2).z2z(short);
489
+ this.c2y_1 = add(this.c2y_1, new Long(2, 0));
490
+ };
491
+ protoOf(Buffer).c4 = function () {
492
+ return Unit_instance;
493
+ };
494
+ protoOf(Buffer).toString = function () {
495
+ if (equalsLong(this.d1(), new Long(0, 0)))
496
+ return 'Buffer(size=0)';
497
+ var maxPrintableBytes = 64;
498
+ // Inline function 'kotlinx.io.minOf' call
499
+ var b = this.d1();
500
+ // Inline function 'kotlin.comparisons.minOf' call
501
+ var a = fromInt(maxPrintableBytes);
502
+ var tmp$ret$0 = compare(a, b) <= 0 ? a : b;
503
+ var len = convertToInt(tmp$ret$0);
504
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (compare(this.d1(), fromInt(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
505
+ var bytesWritten = 0;
506
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
507
+ var curr = this.a2y_1;
508
+ while (!(curr == null)) {
509
+ var tmp0 = get_SegmentReadContextImpl();
510
+ var segment = curr;
511
+ var idx = 0;
512
+ while (bytesWritten < len && idx < segment.d1()) {
513
+ var _unary__edvuaz = idx;
514
+ idx = _unary__edvuaz + 1 | 0;
515
+ var b_0 = tmp0.a30(segment, _unary__edvuaz);
516
+ bytesWritten = bytesWritten + 1 | 0;
517
+ var tmp = get_HEX_DIGIT_CHARS();
518
+ // Inline function 'kotlinx.io.shr' call
519
+ var tmp$ret$4 = b_0 >> 4;
520
+ var tmp_0 = builder.s(tmp[tmp$ret$4 & 15]);
521
+ var tmp_1 = get_HEX_DIGIT_CHARS();
522
+ // Inline function 'kotlinx.io.and' call
523
+ var tmp$ret$5 = b_0 & 15;
524
+ tmp_0.s(tmp_1[tmp$ret$5]);
525
+ }
526
+ curr = curr.n2y_1;
527
+ }
528
+ if (compare(this.d1(), fromInt(maxPrintableBytes)) > 0) {
529
+ builder.s(_Char___init__impl__6a9atx(8230));
530
+ }
531
+ return 'Buffer(size=' + this.d1().toString() + ' hex=' + builder.toString() + ')';
532
+ };
533
+ protoOf(Buffer).p2y = function () {
534
+ var oldHead = ensureNotNull(this.a2y_1);
535
+ var nextHead = oldHead.n2y_1;
536
+ this.a2y_1 = nextHead;
537
+ if (nextHead == null) {
538
+ this.b2y_1 = null;
539
+ } else {
540
+ nextHead.o2y_1 = null;
541
+ }
542
+ oldHead.n2y_1 = null;
543
+ SegmentPool_instance.b30(oldHead);
544
+ };
545
+ protoOf(Buffer).c30 = function () {
546
+ var oldTail = ensureNotNull(this.b2y_1);
547
+ var newTail = oldTail.o2y_1;
548
+ this.b2y_1 = newTail;
549
+ if (newTail == null) {
550
+ this.a2y_1 = null;
551
+ } else {
552
+ newTail.n2y_1 = null;
553
+ }
554
+ oldTail.o2y_1 = null;
555
+ SegmentPool_instance.b30(oldTail);
556
+ };
557
+ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
558
+ startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
559
+ endIndex = endIndex === VOID ? _this__u8e3s4.d1() : endIndex;
560
+ // Inline function 'kotlin.comparisons.minOf' call
561
+ var b = _this__u8e3s4.d1();
562
+ var endOffset = compare(endIndex, b) <= 0 ? endIndex : b;
563
+ checkBounds(_this__u8e3s4.d1(), startIndex, endOffset);
564
+ if (equalsLong(startIndex, endOffset))
565
+ return new Long(-1, -1);
566
+ $l$block_1: {
567
+ // Inline function 'kotlinx.io.seek' call
568
+ if (_this__u8e3s4.a2y_1 == null) {
569
+ var o = new Long(-1, -1);
570
+ if (equalsLong(o, new Long(-1, -1))) {
571
+ return new Long(-1, -1);
572
+ }
573
+ var segment = null;
574
+ var offset = o;
575
+ do {
576
+ // Inline function 'kotlin.check' call
577
+ if (!(compare(endOffset, offset) > 0)) {
578
+ throw IllegalStateException_init_$Create$('Check failed.');
579
+ }
580
+ ensureNotNull(segment);
581
+ var tmp = segment;
582
+ // Inline function 'kotlin.comparisons.maxOf' call
583
+ var a = convertToInt(subtract(startIndex, offset));
584
+ var tmp_0 = Math.max(a, 0);
585
+ var tmp0 = segment.d1();
586
+ // Inline function 'kotlin.comparisons.minOf' call
587
+ var b_0 = convertToInt(subtract(endOffset, offset));
588
+ var tmp$ret$5 = Math.min(tmp0, b_0);
589
+ var idx = indexOf_0(tmp, byte, tmp_0, tmp$ret$5);
590
+ if (!(idx === -1)) {
591
+ return add(offset, fromInt(idx));
592
+ }
593
+ var tmp0_0 = offset;
594
+ // Inline function 'kotlin.Long.plus' call
595
+ var other = segment.d1();
596
+ offset = add(tmp0_0, fromInt(other));
597
+ segment = segment.n2y_1;
598
+ }
599
+ while (!(segment == null) && compare(offset, endOffset) < 0);
600
+ return new Long(-1, -1);
601
+ }
602
+ if (compare(subtract(_this__u8e3s4.d1(), startIndex), startIndex) < 0) {
603
+ var s = _this__u8e3s4.b2y_1;
604
+ var offset_0 = _this__u8e3s4.d1();
605
+ $l$loop: while (!(s == null) && compare(offset_0, startIndex) > 0) {
606
+ offset_0 = subtract(offset_0, fromInt(s.k2y_1 - s.j2y_1 | 0));
607
+ if (compare(offset_0, startIndex) <= 0)
608
+ break $l$loop;
609
+ s = s.o2y_1;
610
+ }
611
+ var tmp0_1 = s;
612
+ var o_0 = offset_0;
613
+ if (equalsLong(o_0, new Long(-1, -1))) {
614
+ return new Long(-1, -1);
615
+ }
616
+ var segment_0 = tmp0_1;
617
+ var offset_1 = o_0;
618
+ do {
619
+ // Inline function 'kotlin.check' call
620
+ if (!(compare(endOffset, offset_1) > 0)) {
621
+ throw IllegalStateException_init_$Create$('Check failed.');
622
+ }
623
+ ensureNotNull(segment_0);
624
+ var tmp_1 = segment_0;
625
+ // Inline function 'kotlin.comparisons.maxOf' call
626
+ var a_0 = convertToInt(subtract(startIndex, offset_1));
627
+ var tmp_2 = Math.max(a_0, 0);
628
+ var tmp0_2 = segment_0.d1();
629
+ // Inline function 'kotlin.comparisons.minOf' call
630
+ var b_1 = convertToInt(subtract(endOffset, offset_1));
631
+ var tmp$ret$10 = Math.min(tmp0_2, b_1);
632
+ var idx_0 = indexOf_0(tmp_1, byte, tmp_2, tmp$ret$10);
633
+ if (!(idx_0 === -1)) {
634
+ return add(offset_1, fromInt(idx_0));
635
+ }
636
+ var tmp0_3 = offset_1;
637
+ // Inline function 'kotlin.Long.plus' call
638
+ var other_0 = segment_0.d1();
639
+ offset_1 = add(tmp0_3, fromInt(other_0));
640
+ segment_0 = segment_0.n2y_1;
641
+ }
642
+ while (!(segment_0 == null) && compare(offset_1, endOffset) < 0);
643
+ return new Long(-1, -1);
644
+ } else {
645
+ var s_0 = _this__u8e3s4.a2y_1;
646
+ var offset_2 = new Long(0, 0);
647
+ $l$loop_0: while (!(s_0 == null)) {
648
+ var tmp0_4 = offset_2;
649
+ // Inline function 'kotlin.Long.plus' call
650
+ var other_1 = s_0.k2y_1 - s_0.j2y_1 | 0;
651
+ var nextOffset = add(tmp0_4, fromInt(other_1));
652
+ if (compare(nextOffset, startIndex) > 0)
653
+ break $l$loop_0;
654
+ s_0 = s_0.n2y_1;
655
+ offset_2 = nextOffset;
656
+ }
657
+ var tmp0_5 = s_0;
658
+ var o_1 = offset_2;
659
+ if (equalsLong(o_1, new Long(-1, -1))) {
660
+ return new Long(-1, -1);
661
+ }
662
+ var segment_1 = tmp0_5;
663
+ var offset_3 = o_1;
664
+ do {
665
+ // Inline function 'kotlin.check' call
666
+ if (!(compare(endOffset, offset_3) > 0)) {
667
+ throw IllegalStateException_init_$Create$('Check failed.');
668
+ }
669
+ ensureNotNull(segment_1);
670
+ var tmp_3 = segment_1;
671
+ // Inline function 'kotlin.comparisons.maxOf' call
672
+ var a_1 = convertToInt(subtract(startIndex, offset_3));
673
+ var tmp_4 = Math.max(a_1, 0);
674
+ var tmp0_6 = segment_1.d1();
675
+ // Inline function 'kotlin.comparisons.minOf' call
676
+ var b_2 = convertToInt(subtract(endOffset, offset_3));
677
+ var tmp$ret$16 = Math.min(tmp0_6, b_2);
678
+ var idx_1 = indexOf_0(tmp_3, byte, tmp_4, tmp$ret$16);
679
+ if (!(idx_1 === -1)) {
680
+ return add(offset_3, fromInt(idx_1));
681
+ }
682
+ var tmp0_7 = offset_3;
683
+ // Inline function 'kotlin.Long.plus' call
684
+ var other_2 = segment_1.d1();
685
+ offset_3 = add(tmp0_7, fromInt(other_2));
686
+ segment_1 = segment_1.n2y_1;
687
+ }
688
+ while (!(segment_1 == null) && compare(offset_3, endOffset) < 0);
689
+ return new Long(-1, -1);
690
+ }
691
+ }
692
+ }
693
+ function readByteString(_this__u8e3s4, byteCount) {
694
+ return UnsafeByteStringOperations_instance.z2x(readByteArray_0(_this__u8e3s4, byteCount));
695
+ }
696
+ function buffered(_this__u8e3s4) {
697
+ return new RealSource(_this__u8e3s4);
698
+ }
699
+ function PeekSource(upstream) {
700
+ this.d30_1 = upstream;
701
+ this.e30_1 = this.d30_1.d2y();
702
+ this.f30_1 = this.e30_1.a2y_1;
703
+ var tmp = this;
704
+ var tmp0_safe_receiver = this.e30_1.a2y_1;
705
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j2y_1;
706
+ tmp.g30_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
707
+ this.h30_1 = false;
708
+ this.i30_1 = new Long(0, 0);
709
+ }
710
+ protoOf(PeekSource).e2z = function (sink, byteCount) {
711
+ // Inline function 'kotlin.check' call
712
+ if (!!this.h30_1) {
713
+ var message = 'Source is closed.';
714
+ throw IllegalStateException_init_$Create$(toString(message));
715
+ }
716
+ // Inline function 'kotlinx.io.checkByteCount' call
717
+ // Inline function 'kotlin.require' call
718
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
719
+ var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
720
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
721
+ }
722
+ // Inline function 'kotlin.check' call
723
+ if (!(this.f30_1 == null || (this.f30_1 === this.e30_1.a2y_1 && this.g30_1 === ensureNotNull(this.e30_1.a2y_1).j2y_1))) {
724
+ var message_1 = 'Peek source is invalid because upstream source was used';
725
+ throw IllegalStateException_init_$Create$(toString(message_1));
726
+ }
727
+ if (equalsLong(byteCount, new Long(0, 0)))
728
+ return new Long(0, 0);
729
+ // Inline function 'kotlin.Long.plus' call
730
+ var this_0 = this.i30_1;
731
+ var tmp$ret$7 = add(this_0, fromInt(1));
732
+ if (!this.d30_1.g2y(tmp$ret$7))
733
+ return new Long(-1, -1);
734
+ if (this.f30_1 == null && !(this.e30_1.a2y_1 == null)) {
735
+ this.f30_1 = this.e30_1.a2y_1;
736
+ this.g30_1 = ensureNotNull(this.e30_1.a2y_1).j2y_1;
737
+ }
738
+ // Inline function 'kotlin.comparisons.minOf' call
739
+ var b = subtract(this.e30_1.d1(), this.i30_1);
740
+ var toCopy = compare(byteCount, b) <= 0 ? byteCount : b;
741
+ this.e30_1.u2y(sink, this.i30_1, add(this.i30_1, toCopy));
742
+ this.i30_1 = add(this.i30_1, toCopy);
743
+ return toCopy;
744
+ };
745
+ protoOf(PeekSource).c4 = function () {
746
+ this.h30_1 = true;
747
+ };
748
+ function RealSource(source) {
749
+ this.j30_1 = source;
750
+ this.k30_1 = false;
751
+ this.l30_1 = new Buffer();
752
+ }
753
+ protoOf(RealSource).d2y = function () {
754
+ return this.l30_1;
755
+ };
756
+ protoOf(RealSource).e2z = function (sink, byteCount) {
757
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
758
+ // Inline function 'kotlin.check' call
759
+ if (!!this.k30_1) {
760
+ var message = 'Source is closed.';
761
+ throw IllegalStateException_init_$Create$(toString(message));
762
+ }
763
+ // Inline function 'kotlin.require' call
764
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
765
+ var message_0 = 'byteCount: ' + byteCount.toString();
766
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
767
+ }
768
+ if (equalsLong(this.l30_1.d1(), new Long(0, 0))) {
769
+ var read = this.j30_1.e2z(this.l30_1, new Long(8192, 0));
770
+ if (equalsLong(read, new Long(-1, -1)))
771
+ return new Long(-1, -1);
772
+ }
773
+ // Inline function 'kotlin.comparisons.minOf' call
774
+ var b = this.l30_1.d1();
775
+ var toRead = compare(byteCount, b) <= 0 ? byteCount : b;
776
+ return this.l30_1.e2z(sink, toRead);
777
+ };
778
+ protoOf(RealSource).e2y = function () {
779
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
780
+ // Inline function 'kotlin.check' call
781
+ if (!!this.k30_1) {
782
+ var message = 'Source is closed.';
783
+ throw IllegalStateException_init_$Create$(toString(message));
784
+ }
785
+ return this.l30_1.e2y() && equalsLong(this.j30_1.e2z(this.l30_1, new Long(8192, 0)), new Long(-1, -1));
786
+ };
787
+ protoOf(RealSource).f2y = function (byteCount) {
788
+ if (!this.g2y(byteCount))
789
+ throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
790
+ };
791
+ protoOf(RealSource).g2y = function (byteCount) {
792
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
793
+ // Inline function 'kotlin.check' call
794
+ if (!!this.k30_1) {
795
+ var message = 'Source is closed.';
796
+ throw IllegalStateException_init_$Create$(toString(message));
797
+ }
798
+ // Inline function 'kotlin.require' call
799
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
800
+ var message_0 = 'byteCount: ' + byteCount.toString();
801
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
802
+ }
803
+ while (compare(this.l30_1.d1(), byteCount) < 0) {
804
+ if (equalsLong(this.j30_1.e2z(this.l30_1, new Long(8192, 0)), new Long(-1, -1)))
805
+ return false;
806
+ }
807
+ return true;
808
+ };
809
+ protoOf(RealSource).h2y = function () {
810
+ this.f2y(new Long(1, 0));
811
+ return this.l30_1.h2y();
812
+ };
813
+ protoOf(RealSource).c2z = function (sink, startIndex, endIndex) {
814
+ // Inline function 'kotlinx.io.checkBounds' call
815
+ var size = sink.length;
816
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
817
+ if (equalsLong(this.l30_1.d1(), new Long(0, 0))) {
818
+ var read = this.j30_1.e2z(this.l30_1, new Long(8192, 0));
819
+ if (equalsLong(read, new Long(-1, -1)))
820
+ return -1;
821
+ }
822
+ var tmp0 = endIndex - startIndex | 0;
823
+ // Inline function 'kotlinx.io.minOf' call
824
+ var b = this.l30_1.d1();
825
+ // Inline function 'kotlin.comparisons.minOf' call
826
+ var a = fromInt(tmp0);
827
+ var tmp$ret$1 = compare(a, b) <= 0 ? a : b;
828
+ var toRead = convertToInt(tmp$ret$1);
829
+ return this.l30_1.c2z(sink, startIndex, startIndex + toRead | 0);
830
+ };
831
+ protoOf(RealSource).g2z = function (sink, byteCount) {
832
+ try {
833
+ this.f2y(byteCount);
834
+ } catch ($p) {
835
+ if ($p instanceof EOFException) {
836
+ var e = $p;
837
+ sink.f2z(this.l30_1, this.l30_1.d1());
838
+ throw e;
839
+ } else {
840
+ throw $p;
841
+ }
842
+ }
843
+ this.l30_1.g2z(sink, byteCount);
844
+ };
845
+ protoOf(RealSource).h2z = function (sink) {
846
+ var totalBytesWritten = new Long(0, 0);
847
+ while (!equalsLong(this.j30_1.e2z(this.l30_1, new Long(8192, 0)), new Long(-1, -1))) {
848
+ var emitByteCount = this.l30_1.y2y();
849
+ if (compare(emitByteCount, new Long(0, 0)) > 0) {
850
+ totalBytesWritten = add(totalBytesWritten, emitByteCount);
851
+ sink.f2z(this.l30_1, emitByteCount);
852
+ }
853
+ }
854
+ if (compare(this.l30_1.d1(), new Long(0, 0)) > 0) {
855
+ totalBytesWritten = add(totalBytesWritten, this.l30_1.d1());
856
+ sink.f2z(this.l30_1, this.l30_1.d1());
857
+ }
858
+ return totalBytesWritten;
859
+ };
860
+ protoOf(RealSource).r2y = function () {
861
+ this.f2y(new Long(2, 0));
862
+ return this.l30_1.r2y();
863
+ };
864
+ protoOf(RealSource).i2z = function () {
865
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
866
+ // Inline function 'kotlin.check' call
867
+ if (!!this.k30_1) {
868
+ var message = 'Source is closed.';
869
+ throw IllegalStateException_init_$Create$(toString(message));
870
+ }
871
+ return buffered(new PeekSource(this));
872
+ };
873
+ protoOf(RealSource).c4 = function () {
874
+ if (this.k30_1)
875
+ return Unit_instance;
876
+ this.k30_1 = true;
877
+ this.j30_1.c4();
878
+ this.l30_1.q2();
879
+ };
880
+ protoOf(RealSource).toString = function () {
881
+ return 'buffered(' + toString(this.j30_1) + ')';
882
+ };
883
+ function Segment_init_$Init$($this) {
884
+ Segment.call($this);
885
+ $this.i2y_1 = new Int8Array(8192);
886
+ $this.m2y_1 = true;
887
+ $this.l2y_1 = null;
888
+ return $this;
889
+ }
890
+ function Segment_init_$Create$() {
891
+ return Segment_init_$Init$(objectCreate(protoOf(Segment)));
892
+ }
893
+ function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
894
+ Segment.call($this);
895
+ $this.i2y_1 = data;
896
+ $this.j2y_1 = pos;
897
+ $this.k2y_1 = limit;
898
+ $this.l2y_1 = shareToken;
899
+ $this.m2y_1 = owner;
900
+ return $this;
901
+ }
902
+ function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
903
+ return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
904
+ }
905
+ function Companion() {
906
+ this.m30_1 = 8192;
907
+ this.n30_1 = 1024;
908
+ }
909
+ protoOf(Companion).o30 = function () {
910
+ return Segment_init_$Create$();
911
+ };
912
+ var Companion_instance;
913
+ function Companion_getInstance() {
914
+ return Companion_instance;
915
+ }
916
+ protoOf(Segment).r2z = function () {
917
+ var tmp0_safe_receiver = this.l2y_1;
918
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p30();
919
+ return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
920
+ };
921
+ protoOf(Segment).v2y = function () {
922
+ var tmp0_elvis_lhs = this.l2y_1;
923
+ var tmp;
924
+ if (tmp0_elvis_lhs == null) {
925
+ // Inline function 'kotlin.also' call
926
+ var this_0 = SegmentPool_instance.q30();
927
+ this.l2y_1 = this_0;
928
+ tmp = this_0;
929
+ } else {
930
+ tmp = tmp0_elvis_lhs;
931
+ }
932
+ var t = tmp;
933
+ var tmp_0 = this.j2y_1;
934
+ var tmp_1 = this.k2y_1;
935
+ // Inline function 'kotlin.also' call
936
+ t.r30();
937
+ return Segment_init_$Create$_0(this.i2y_1, tmp_0, tmp_1, t, false);
938
+ };
939
+ protoOf(Segment).u2z = function () {
940
+ var result = this.n2y_1;
941
+ if (!(this.o2y_1 == null)) {
942
+ ensureNotNull(this.o2y_1).n2y_1 = this.n2y_1;
943
+ }
944
+ if (!(this.n2y_1 == null)) {
945
+ ensureNotNull(this.n2y_1).o2y_1 = this.o2y_1;
946
+ }
947
+ this.n2y_1 = null;
948
+ this.o2y_1 = null;
949
+ return result;
950
+ };
951
+ protoOf(Segment).w2y = function (segment) {
952
+ segment.o2y_1 = this;
953
+ segment.n2y_1 = this.n2y_1;
954
+ if (!(this.n2y_1 == null)) {
955
+ ensureNotNull(this.n2y_1).o2y_1 = segment;
956
+ }
957
+ this.n2y_1 = segment;
958
+ return segment;
959
+ };
960
+ protoOf(Segment).s2z = function (byteCount) {
961
+ // Inline function 'kotlin.require' call
962
+ if (!(byteCount > 0 && byteCount <= (this.k2y_1 - this.j2y_1 | 0))) {
963
+ var message = 'byteCount out of range';
964
+ throw IllegalArgumentException_init_$Create$(toString(message));
965
+ }
966
+ var prefix;
967
+ if (byteCount >= 1024) {
968
+ prefix = this.v2y();
969
+ } else {
970
+ prefix = SegmentPool_instance.m2z();
971
+ var tmp0 = this.i2y_1;
972
+ var tmp2 = prefix.i2y_1;
973
+ var tmp5 = this.j2y_1;
974
+ // Inline function 'kotlin.collections.copyInto' call
975
+ var endIndex = this.j2y_1 + byteCount | 0;
976
+ // Inline function 'kotlin.js.unsafeCast' call
977
+ // Inline function 'kotlin.js.asDynamic' call
978
+ var tmp = tmp0;
979
+ // Inline function 'kotlin.js.unsafeCast' call
980
+ // Inline function 'kotlin.js.asDynamic' call
981
+ arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
982
+ }
983
+ prefix.k2y_1 = prefix.j2y_1 + byteCount | 0;
984
+ this.j2y_1 = this.j2y_1 + byteCount | 0;
985
+ if (!(this.o2y_1 == null)) {
986
+ ensureNotNull(this.o2y_1).w2y(prefix);
987
+ } else {
988
+ prefix.n2y_1 = this;
989
+ this.o2y_1 = prefix;
990
+ }
991
+ return prefix;
992
+ };
993
+ protoOf(Segment).x2y = function () {
994
+ // Inline function 'kotlin.check' call
995
+ if (!!(this.o2y_1 == null)) {
996
+ var message = 'cannot compact';
997
+ throw IllegalStateException_init_$Create$(toString(message));
998
+ }
999
+ if (!ensureNotNull(this.o2y_1).m2y_1)
1000
+ return this;
1001
+ var byteCount = this.k2y_1 - this.j2y_1 | 0;
1002
+ var availableByteCount = (8192 - ensureNotNull(this.o2y_1).k2y_1 | 0) + (ensureNotNull(this.o2y_1).r2z() ? 0 : ensureNotNull(this.o2y_1).j2y_1) | 0;
1003
+ if (byteCount > availableByteCount)
1004
+ return this;
1005
+ var predecessor = this.o2y_1;
1006
+ this.t2z(ensureNotNull(predecessor), byteCount);
1007
+ var successor = this.u2z();
1008
+ // Inline function 'kotlin.check' call
1009
+ if (!(successor == null)) {
1010
+ throw IllegalStateException_init_$Create$('Check failed.');
1011
+ }
1012
+ SegmentPool_instance.b30(this);
1013
+ return predecessor;
1014
+ };
1015
+ protoOf(Segment).x2z = function (byte) {
1016
+ var _unary__edvuaz = this.k2y_1;
1017
+ this.k2y_1 = _unary__edvuaz + 1 | 0;
1018
+ this.i2y_1[_unary__edvuaz] = byte;
1019
+ };
1020
+ protoOf(Segment).z2z = function (short) {
1021
+ var data = this.i2y_1;
1022
+ var limit = this.k2y_1;
1023
+ var _unary__edvuaz = limit;
1024
+ limit = _unary__edvuaz + 1 | 0;
1025
+ data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
1026
+ var _unary__edvuaz_0 = limit;
1027
+ limit = _unary__edvuaz_0 + 1 | 0;
1028
+ data[_unary__edvuaz_0] = toByte(short & 255);
1029
+ this.k2y_1 = limit;
1030
+ };
1031
+ protoOf(Segment).q2y = function () {
1032
+ var _unary__edvuaz = this.j2y_1;
1033
+ this.j2y_1 = _unary__edvuaz + 1 | 0;
1034
+ return this.i2y_1[_unary__edvuaz];
1035
+ };
1036
+ protoOf(Segment).s2y = function () {
1037
+ var data = this.i2y_1;
1038
+ var pos = this.j2y_1;
1039
+ var _unary__edvuaz = pos;
1040
+ pos = _unary__edvuaz + 1 | 0;
1041
+ // Inline function 'kotlinx.io.and' call
1042
+ var tmp = (data[_unary__edvuaz] & 255) << 8;
1043
+ var _unary__edvuaz_0 = pos;
1044
+ pos = _unary__edvuaz_0 + 1 | 0;
1045
+ // Inline function 'kotlinx.io.and' call
1046
+ var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
1047
+ var s = toShort(tmp | tmp$ret$1);
1048
+ this.j2y_1 = pos;
1049
+ return s;
1050
+ };
1051
+ protoOf(Segment).t2z = function (sink, byteCount) {
1052
+ // Inline function 'kotlin.check' call
1053
+ if (!sink.m2y_1) {
1054
+ var message = 'only owner can write';
1055
+ throw IllegalStateException_init_$Create$(toString(message));
1056
+ }
1057
+ if ((sink.k2y_1 + byteCount | 0) > 8192) {
1058
+ if (sink.r2z())
1059
+ throw IllegalArgumentException_init_$Create$_0();
1060
+ if (((sink.k2y_1 + byteCount | 0) - sink.j2y_1 | 0) > 8192)
1061
+ throw IllegalArgumentException_init_$Create$_0();
1062
+ var tmp0 = sink.i2y_1;
1063
+ var tmp2 = sink.i2y_1;
1064
+ var tmp5 = sink.j2y_1;
1065
+ // Inline function 'kotlin.collections.copyInto' call
1066
+ var endIndex = sink.k2y_1;
1067
+ // Inline function 'kotlin.js.unsafeCast' call
1068
+ // Inline function 'kotlin.js.asDynamic' call
1069
+ var tmp = tmp0;
1070
+ // Inline function 'kotlin.js.unsafeCast' call
1071
+ // Inline function 'kotlin.js.asDynamic' call
1072
+ arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
1073
+ sink.k2y_1 = sink.k2y_1 - sink.j2y_1 | 0;
1074
+ sink.j2y_1 = 0;
1075
+ }
1076
+ var tmp0_0 = this.i2y_1;
1077
+ var tmp2_0 = sink.i2y_1;
1078
+ var tmp4 = sink.k2y_1;
1079
+ var tmp6 = this.j2y_1;
1080
+ // Inline function 'kotlin.collections.copyInto' call
1081
+ var endIndex_0 = this.j2y_1 + byteCount | 0;
1082
+ // Inline function 'kotlin.js.unsafeCast' call
1083
+ // Inline function 'kotlin.js.asDynamic' call
1084
+ var tmp_0 = tmp0_0;
1085
+ // Inline function 'kotlin.js.unsafeCast' call
1086
+ // Inline function 'kotlin.js.asDynamic' call
1087
+ arrayCopy(tmp_0, tmp2_0, tmp4, tmp6, endIndex_0);
1088
+ sink.k2y_1 = sink.k2y_1 + byteCount | 0;
1089
+ this.j2y_1 = this.j2y_1 + byteCount | 0;
1090
+ };
1091
+ protoOf(Segment).d2z = function (dst, dstStartOffset, dstEndOffset) {
1092
+ var len = dstEndOffset - dstStartOffset | 0;
1093
+ var tmp0 = this.i2y_1;
1094
+ var tmp6 = this.j2y_1;
1095
+ // Inline function 'kotlin.collections.copyInto' call
1096
+ var endIndex = this.j2y_1 + len | 0;
1097
+ // Inline function 'kotlin.js.unsafeCast' call
1098
+ // Inline function 'kotlin.js.asDynamic' call
1099
+ var tmp = tmp0;
1100
+ // Inline function 'kotlin.js.unsafeCast' call
1101
+ // Inline function 'kotlin.js.asDynamic' call
1102
+ arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
1103
+ this.j2y_1 = this.j2y_1 + len | 0;
1104
+ };
1105
+ protoOf(Segment).p2z = function (src, srcStartOffset, srcEndOffset) {
1106
+ var tmp2 = this.i2y_1;
1107
+ // Inline function 'kotlin.collections.copyInto' call
1108
+ var destinationOffset = this.k2y_1;
1109
+ // Inline function 'kotlin.js.unsafeCast' call
1110
+ // Inline function 'kotlin.js.asDynamic' call
1111
+ var tmp = src;
1112
+ // Inline function 'kotlin.js.unsafeCast' call
1113
+ // Inline function 'kotlin.js.asDynamic' call
1114
+ arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
1115
+ this.k2y_1 = this.k2y_1 + (srcEndOffset - srcStartOffset | 0) | 0;
1116
+ };
1117
+ protoOf(Segment).d1 = function () {
1118
+ return this.k2y_1 - this.j2y_1 | 0;
1119
+ };
1120
+ protoOf(Segment).o2z = function () {
1121
+ return this.i2y_1.length - this.k2y_1 | 0;
1122
+ };
1123
+ protoOf(Segment).s30 = function (readOnly) {
1124
+ return this.i2y_1;
1125
+ };
1126
+ protoOf(Segment).a2z = function (index) {
1127
+ return this.i2y_1[this.j2y_1 + index | 0];
1128
+ };
1129
+ protoOf(Segment).t30 = function (index, value) {
1130
+ this.i2y_1[this.k2y_1 + index | 0] = value;
1131
+ };
1132
+ protoOf(Segment).u30 = function (index, b0, b1) {
1133
+ var d = this.i2y_1;
1134
+ var l = this.k2y_1;
1135
+ d[l + index | 0] = b0;
1136
+ d[(l + index | 0) + 1 | 0] = b1;
1137
+ };
1138
+ protoOf(Segment).v30 = function (index, b0, b1, b2) {
1139
+ var d = this.i2y_1;
1140
+ var l = this.k2y_1;
1141
+ d[l + index | 0] = b0;
1142
+ d[(l + index | 0) + 1 | 0] = b1;
1143
+ d[(l + index | 0) + 2 | 0] = b2;
1144
+ };
1145
+ protoOf(Segment).w30 = function (index, b0, b1, b2, b3) {
1146
+ var d = this.i2y_1;
1147
+ var l = this.k2y_1;
1148
+ d[l + index | 0] = b0;
1149
+ d[(l + index | 0) + 1 | 0] = b1;
1150
+ d[(l + index | 0) + 2 | 0] = b2;
1151
+ d[(l + index | 0) + 3 | 0] = b3;
1152
+ };
1153
+ function Segment() {
1154
+ this.j2y_1 = 0;
1155
+ this.k2y_1 = 0;
1156
+ this.l2y_1 = null;
1157
+ this.m2y_1 = false;
1158
+ this.n2y_1 = null;
1159
+ this.o2y_1 = null;
1160
+ }
1161
+ function isEmpty(_this__u8e3s4) {
1162
+ return _this__u8e3s4.d1() === 0;
1163
+ }
1164
+ function SegmentCopyTracker() {
1165
+ }
1166
+ function AlwaysSharedCopyTracker() {
1167
+ AlwaysSharedCopyTracker_instance = this;
1168
+ SegmentCopyTracker.call(this);
1169
+ }
1170
+ protoOf(AlwaysSharedCopyTracker).p30 = function () {
1171
+ return true;
1172
+ };
1173
+ protoOf(AlwaysSharedCopyTracker).r30 = function () {
1174
+ return Unit_instance;
1175
+ };
1176
+ var AlwaysSharedCopyTracker_instance;
1177
+ function AlwaysSharedCopyTracker_getInstance() {
1178
+ if (AlwaysSharedCopyTracker_instance == null)
1179
+ new AlwaysSharedCopyTracker();
1180
+ return AlwaysSharedCopyTracker_instance;
1181
+ }
1182
+ function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
1183
+ // Inline function 'kotlin.require' call
1184
+ if (!(0 <= startOffset ? startOffset < _this__u8e3s4.d1() : false)) {
1185
+ var message = '' + startOffset;
1186
+ throw IllegalArgumentException_init_$Create$(toString(message));
1187
+ }
1188
+ // Inline function 'kotlin.require' call
1189
+ if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.d1() : false)) {
1190
+ var message_0 = '' + endOffset;
1191
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1192
+ }
1193
+ var p = _this__u8e3s4.j2y_1;
1194
+ var data = _this__u8e3s4.s30(true);
1195
+ var inductionVariable = startOffset;
1196
+ if (inductionVariable < endOffset)
1197
+ do {
1198
+ var idx = inductionVariable;
1199
+ inductionVariable = inductionVariable + 1 | 0;
1200
+ if (data[p + idx | 0] === byte) {
1201
+ return idx;
1202
+ }
1203
+ }
1204
+ while (inductionVariable < endOffset);
1205
+ return -1;
1206
+ }
1207
+ function Sink() {
1208
+ }
1209
+ function Source() {
1210
+ }
1211
+ function readByteArray(_this__u8e3s4) {
1212
+ return readByteArrayImpl(_this__u8e3s4, -1);
1213
+ }
1214
+ function readByteArray_0(_this__u8e3s4, byteCount) {
1215
+ // Inline function 'kotlinx.io.checkByteCount' call
1216
+ var byteCount_0 = fromInt(byteCount);
1217
+ // Inline function 'kotlin.require' call
1218
+ if (!(compare(byteCount_0, new Long(0, 0)) >= 0)) {
1219
+ var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
1220
+ throw IllegalArgumentException_init_$Create$(toString(message));
1221
+ }
1222
+ return readByteArrayImpl(_this__u8e3s4, byteCount);
1223
+ }
1224
+ function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
1225
+ startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
1226
+ endIndex = endIndex === VOID ? new Long(-1, 2147483647) : endIndex;
1227
+ // Inline function 'kotlin.require' call
1228
+ if (!(compare(new Long(0, 0), startIndex) <= 0 ? compare(startIndex, endIndex) <= 0 : false)) {
1229
+ var tmp;
1230
+ if (compare(endIndex, new Long(0, 0)) < 0) {
1231
+ tmp = 'startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') should be non negative';
1232
+ } else {
1233
+ tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
1234
+ }
1235
+ var message = tmp;
1236
+ throw IllegalArgumentException_init_$Create$(toString(message));
1237
+ }
1238
+ if (equalsLong(startIndex, endIndex))
1239
+ return new Long(-1, -1);
1240
+ var offset = startIndex;
1241
+ $l$loop: while (true) {
1242
+ var tmp_0;
1243
+ if (compare(offset, endIndex) < 0) {
1244
+ // Inline function 'kotlin.Long.plus' call
1245
+ var this_0 = offset;
1246
+ var tmp$ret$2 = add(this_0, fromInt(1));
1247
+ tmp_0 = _this__u8e3s4.g2y(tmp$ret$2);
1248
+ } else {
1249
+ tmp_0 = false;
1250
+ }
1251
+ if (!tmp_0) {
1252
+ break $l$loop;
1253
+ }
1254
+ var tmp_1 = _this__u8e3s4.d2y();
1255
+ var tmp_2 = offset;
1256
+ // Inline function 'kotlin.comparisons.minOf' call
1257
+ var b = _this__u8e3s4.d2y().d1();
1258
+ var tmp$ret$3 = compare(endIndex, b) <= 0 ? endIndex : b;
1259
+ var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
1260
+ if (!equalsLong(idx, new Long(-1, -1))) {
1261
+ return idx;
1262
+ }
1263
+ offset = _this__u8e3s4.d2y().d1();
1264
+ }
1265
+ return new Long(-1, -1);
1266
+ }
1267
+ function readByteArrayImpl(_this__u8e3s4, size) {
1268
+ var arraySize = size;
1269
+ if (size === -1) {
1270
+ var fetchSize = new Long(2147483647, 0);
1271
+ while (compare(_this__u8e3s4.d2y().d1(), new Long(2147483647, 0)) < 0 && _this__u8e3s4.g2y(fetchSize)) {
1272
+ // Inline function 'kotlin.Long.times' call
1273
+ var this_0 = fetchSize;
1274
+ fetchSize = multiply(this_0, fromInt(2));
1275
+ }
1276
+ // Inline function 'kotlin.check' call
1277
+ if (!(compare(_this__u8e3s4.d2y().d1(), new Long(2147483647, 0)) < 0)) {
1278
+ var message = "Can't create an array of size " + _this__u8e3s4.d2y().d1().toString();
1279
+ throw IllegalStateException_init_$Create$(toString(message));
1280
+ }
1281
+ arraySize = convertToInt(_this__u8e3s4.d2y().d1());
1282
+ } else {
1283
+ _this__u8e3s4.f2y(fromInt(size));
1284
+ }
1285
+ var array = new Int8Array(arraySize);
1286
+ readTo(_this__u8e3s4.d2y(), array);
1287
+ return array;
1288
+ }
1289
+ function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
1290
+ startIndex = startIndex === VOID ? 0 : startIndex;
1291
+ endIndex = endIndex === VOID ? sink.length : endIndex;
1292
+ // Inline function 'kotlinx.io.checkBounds' call
1293
+ var size = sink.length;
1294
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1295
+ var offset = startIndex;
1296
+ while (offset < endIndex) {
1297
+ var bytesRead = _this__u8e3s4.c2z(sink, offset, endIndex);
1298
+ if (bytesRead === -1) {
1299
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
1300
+ }
1301
+ offset = offset + bytesRead | 0;
1302
+ }
1303
+ }
1304
+ function readString(_this__u8e3s4, byteCount) {
1305
+ _this__u8e3s4.f2y(byteCount);
1306
+ return commonReadUtf8(_this__u8e3s4.d2y(), byteCount);
1307
+ }
1308
+ function readString_0(_this__u8e3s4) {
1309
+ _this__u8e3s4.g2y(new Long(-1, 2147483647));
1310
+ return commonReadUtf8(_this__u8e3s4.d2y(), _this__u8e3s4.d2y().d1());
1311
+ }
1312
+ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
1313
+ startIndex = startIndex === VOID ? 0 : startIndex;
1314
+ endIndex = endIndex === VOID ? string.length : endIndex;
1315
+ // Inline function 'kotlinx.io.checkBounds' call
1316
+ var size = string.length;
1317
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1318
+ // Inline function 'kotlinx.io.writeToInternalBuffer' call
1319
+ // Inline function 'kotlinx.io.commonWriteUtf8' call
1320
+ var this_0 = _this__u8e3s4.d2y();
1321
+ var i = startIndex;
1322
+ while (i < endIndex) {
1323
+ var p0 = i;
1324
+ // Inline function 'kotlin.code' call
1325
+ var this_1 = charCodeAt(string, p0);
1326
+ var c = Char__toInt_impl_vasixd(this_1);
1327
+ if (c < 128) {
1328
+ $l$block_0: {
1329
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1330
+ var tail = this_0.j2z(1);
1331
+ var ctx = get_SegmentWriteContextImpl();
1332
+ var segmentOffset = -i | 0;
1333
+ // Inline function 'kotlin.comparisons.minOf' call
1334
+ var b = i + tail.o2z() | 0;
1335
+ var runLimit = Math.min(endIndex, b);
1336
+ var _unary__edvuaz = i;
1337
+ i = _unary__edvuaz + 1 | 0;
1338
+ ctx.a31(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
1339
+ $l$loop: while (i < runLimit) {
1340
+ var p0_0 = i;
1341
+ // Inline function 'kotlin.code' call
1342
+ var this_2 = charCodeAt(string, p0_0);
1343
+ c = Char__toInt_impl_vasixd(this_2);
1344
+ if (c >= 128)
1345
+ break $l$loop;
1346
+ var _unary__edvuaz_0 = i;
1347
+ i = _unary__edvuaz_0 + 1 | 0;
1348
+ ctx.a31(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
1349
+ }
1350
+ var bytesWritten = i + segmentOffset | 0;
1351
+ if (bytesWritten === 1) {
1352
+ tail.k2y_1 = tail.k2y_1 + bytesWritten | 0;
1353
+ var tmp = this_0;
1354
+ // Inline function 'kotlin.Long.plus' call
1355
+ var this_3 = this_0.c2y_1;
1356
+ tmp.c2y_1 = add(this_3, fromInt(bytesWritten));
1357
+ break $l$block_0;
1358
+ }
1359
+ // Inline function 'kotlin.check' call
1360
+ if (!(0 <= bytesWritten ? bytesWritten <= tail.o2z() : false)) {
1361
+ var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.o2z();
1362
+ throw IllegalStateException_init_$Create$(toString(message));
1363
+ }
1364
+ if (!(bytesWritten === 0)) {
1365
+ tail.k2y_1 = tail.k2y_1 + bytesWritten | 0;
1366
+ var tmp_0 = this_0;
1367
+ // Inline function 'kotlin.Long.plus' call
1368
+ var this_4 = this_0.c2y_1;
1369
+ tmp_0.c2y_1 = add(this_4, fromInt(bytesWritten));
1370
+ break $l$block_0;
1371
+ }
1372
+ if (isEmpty(tail)) {
1373
+ this_0.c30();
1374
+ }
1375
+ }
1376
+ } else if (c < 2048) {
1377
+ $l$block_2: {
1378
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1379
+ var tail_0 = this_0.j2z(2);
1380
+ get_SegmentWriteContextImpl().z30(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
1381
+ var bytesWritten_0 = 2;
1382
+ if (bytesWritten_0 === 2) {
1383
+ tail_0.k2y_1 = tail_0.k2y_1 + bytesWritten_0 | 0;
1384
+ var tmp_1 = this_0;
1385
+ // Inline function 'kotlin.Long.plus' call
1386
+ var this_5 = this_0.c2y_1;
1387
+ tmp_1.c2y_1 = add(this_5, fromInt(bytesWritten_0));
1388
+ break $l$block_2;
1389
+ }
1390
+ // Inline function 'kotlin.check' call
1391
+ if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.o2z() : false)) {
1392
+ var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.o2z();
1393
+ throw IllegalStateException_init_$Create$(toString(message_0));
1394
+ }
1395
+ if (!(bytesWritten_0 === 0)) {
1396
+ tail_0.k2y_1 = tail_0.k2y_1 + bytesWritten_0 | 0;
1397
+ var tmp_2 = this_0;
1398
+ // Inline function 'kotlin.Long.plus' call
1399
+ var this_6 = this_0.c2y_1;
1400
+ tmp_2.c2y_1 = add(this_6, fromInt(bytesWritten_0));
1401
+ break $l$block_2;
1402
+ }
1403
+ if (isEmpty(tail_0)) {
1404
+ this_0.c30();
1405
+ }
1406
+ }
1407
+ i = i + 1 | 0;
1408
+ } else if (c < 55296 || c > 57343) {
1409
+ $l$block_4: {
1410
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1411
+ var tail_1 = this_0.j2z(3);
1412
+ get_SegmentWriteContextImpl().y30(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
1413
+ var bytesWritten_1 = 3;
1414
+ if (bytesWritten_1 === 3) {
1415
+ tail_1.k2y_1 = tail_1.k2y_1 + bytesWritten_1 | 0;
1416
+ var tmp_3 = this_0;
1417
+ // Inline function 'kotlin.Long.plus' call
1418
+ var this_7 = this_0.c2y_1;
1419
+ tmp_3.c2y_1 = add(this_7, fromInt(bytesWritten_1));
1420
+ break $l$block_4;
1421
+ }
1422
+ // Inline function 'kotlin.check' call
1423
+ if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.o2z() : false)) {
1424
+ var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.o2z();
1425
+ throw IllegalStateException_init_$Create$(toString(message_1));
1426
+ }
1427
+ if (!(bytesWritten_1 === 0)) {
1428
+ tail_1.k2y_1 = tail_1.k2y_1 + bytesWritten_1 | 0;
1429
+ var tmp_4 = this_0;
1430
+ // Inline function 'kotlin.Long.plus' call
1431
+ var this_8 = this_0.c2y_1;
1432
+ tmp_4.c2y_1 = add(this_8, fromInt(bytesWritten_1));
1433
+ break $l$block_4;
1434
+ }
1435
+ if (isEmpty(tail_1)) {
1436
+ this_0.c30();
1437
+ }
1438
+ }
1439
+ i = i + 1 | 0;
1440
+ } else {
1441
+ var tmp_5;
1442
+ if ((i + 1 | 0) < endIndex) {
1443
+ var p0_1 = i + 1 | 0;
1444
+ // Inline function 'kotlin.code' call
1445
+ var this_9 = charCodeAt(string, p0_1);
1446
+ tmp_5 = Char__toInt_impl_vasixd(this_9);
1447
+ } else {
1448
+ tmp_5 = 0;
1449
+ }
1450
+ var low = tmp_5;
1451
+ if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
1452
+ // Inline function 'kotlin.code' call
1453
+ var this_10 = _Char___init__impl__6a9atx(63);
1454
+ var tmp$ret$29 = Char__toInt_impl_vasixd(this_10);
1455
+ this_0.w2z(toByte(tmp$ret$29));
1456
+ i = i + 1 | 0;
1457
+ } else {
1458
+ var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
1459
+ $l$block_6: {
1460
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1461
+ var tail_2 = this_0.j2z(4);
1462
+ get_SegmentWriteContextImpl().x30(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
1463
+ var bytesWritten_2 = 4;
1464
+ if (bytesWritten_2 === 4) {
1465
+ tail_2.k2y_1 = tail_2.k2y_1 + bytesWritten_2 | 0;
1466
+ var tmp_6 = this_0;
1467
+ // Inline function 'kotlin.Long.plus' call
1468
+ var this_11 = this_0.c2y_1;
1469
+ tmp_6.c2y_1 = add(this_11, fromInt(bytesWritten_2));
1470
+ break $l$block_6;
1471
+ }
1472
+ // Inline function 'kotlin.check' call
1473
+ if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.o2z() : false)) {
1474
+ var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.o2z();
1475
+ throw IllegalStateException_init_$Create$(toString(message_2));
1476
+ }
1477
+ if (!(bytesWritten_2 === 0)) {
1478
+ tail_2.k2y_1 = tail_2.k2y_1 + bytesWritten_2 | 0;
1479
+ var tmp_7 = this_0;
1480
+ // Inline function 'kotlin.Long.plus' call
1481
+ var this_12 = this_0.c2y_1;
1482
+ tmp_7.c2y_1 = add(this_12, fromInt(bytesWritten_2));
1483
+ break $l$block_6;
1484
+ }
1485
+ if (isEmpty(tail_2)) {
1486
+ this_0.c30();
1487
+ }
1488
+ }
1489
+ i = i + 2 | 0;
1490
+ }
1491
+ }
1492
+ }
1493
+ _this__u8e3s4.t2y();
1494
+ }
1495
+ function commonReadUtf8(_this__u8e3s4, byteCount) {
1496
+ if (equalsLong(byteCount, new Long(0, 0)))
1497
+ return '';
1498
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
1499
+ var curr = _this__u8e3s4.a2y_1;
1500
+ while (!(curr == null)) {
1501
+ get_SegmentReadContextImpl();
1502
+ if (compare(fromInt(curr.d1()), byteCount) >= 0) {
1503
+ var result = '';
1504
+ // Inline function 'kotlinx.io.unsafe.withData' call
1505
+ var tmp0 = curr.s30(true);
1506
+ var tmp2 = curr.j2y_1;
1507
+ var tmp0_0 = curr.k2y_1;
1508
+ // Inline function 'kotlin.math.min' call
1509
+ var b = tmp2 + convertToInt(byteCount) | 0;
1510
+ var tmp$ret$4 = Math.min(tmp0_0, b);
1511
+ result = commonToUtf8String(tmp0, tmp2, tmp$ret$4);
1512
+ _this__u8e3s4.b2z(byteCount);
1513
+ return result;
1514
+ }
1515
+ return commonToUtf8String(readByteArray_0(_this__u8e3s4, convertToInt(byteCount)));
1516
+ }
1517
+ // Inline function 'kotlin.error' call
1518
+ var message = 'Unreacheable';
1519
+ throw IllegalStateException_init_$Create$(toString(message));
1520
+ }
1521
+ function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
1522
+ beginIndex = beginIndex === VOID ? 0 : beginIndex;
1523
+ endIndex = endIndex === VOID ? _this__u8e3s4.length : endIndex;
1524
+ if (beginIndex < 0 || endIndex > _this__u8e3s4.length || beginIndex > endIndex) {
1525
+ throw IndexOutOfBoundsException_init_$Create$('size=' + _this__u8e3s4.length + ' beginIndex=' + beginIndex + ' endIndex=' + endIndex);
1526
+ }
1527
+ var chars = charArray(endIndex - beginIndex | 0);
1528
+ var length = 0;
1529
+ // Inline function 'kotlinx.io.internal.processUtf16Chars' call
1530
+ var index = beginIndex;
1531
+ while (index < endIndex) {
1532
+ var b0 = _this__u8e3s4[index];
1533
+ if (b0 >= 0) {
1534
+ var c = numberToChar(b0);
1535
+ var _unary__edvuaz = length;
1536
+ length = _unary__edvuaz + 1 | 0;
1537
+ chars[_unary__edvuaz] = c;
1538
+ index = index + 1 | 0;
1539
+ while (index < endIndex && _this__u8e3s4[index] >= 0) {
1540
+ var _unary__edvuaz_0 = index;
1541
+ index = _unary__edvuaz_0 + 1 | 0;
1542
+ var c_0 = numberToChar(_this__u8e3s4[_unary__edvuaz_0]);
1543
+ var _unary__edvuaz_1 = length;
1544
+ length = _unary__edvuaz_1 + 1 | 0;
1545
+ chars[_unary__edvuaz_1] = c_0;
1546
+ }
1547
+ } else {
1548
+ // Inline function 'kotlinx.io.shr' call
1549
+ if (b0 >> 5 === -2) {
1550
+ var tmp = index;
1551
+ var tmp2 = index;
1552
+ var tmp$ret$4;
1553
+ $l$block_0: {
1554
+ // Inline function 'kotlinx.io.internal.process2Utf8Bytes' call
1555
+ if (endIndex <= (tmp2 + 1 | 0)) {
1556
+ var c_1 = numberToChar(65533);
1557
+ var _unary__edvuaz_2 = length;
1558
+ length = _unary__edvuaz_2 + 1 | 0;
1559
+ chars[_unary__edvuaz_2] = c_1;
1560
+ tmp$ret$4 = 1;
1561
+ break $l$block_0;
1562
+ }
1563
+ var b0_0 = _this__u8e3s4[tmp2];
1564
+ var b1 = _this__u8e3s4[tmp2 + 1 | 0];
1565
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1566
+ // Inline function 'kotlinx.io.and' call
1567
+ if (!((b1 & 192) === 128)) {
1568
+ var c_2 = numberToChar(65533);
1569
+ var _unary__edvuaz_3 = length;
1570
+ length = _unary__edvuaz_3 + 1 | 0;
1571
+ chars[_unary__edvuaz_3] = c_2;
1572
+ tmp$ret$4 = 1;
1573
+ break $l$block_0;
1574
+ }
1575
+ var codePoint = 3968 ^ b1 ^ b0_0 << 6;
1576
+ if (codePoint < 128) {
1577
+ var c_3 = numberToChar(65533);
1578
+ var _unary__edvuaz_4 = length;
1579
+ length = _unary__edvuaz_4 + 1 | 0;
1580
+ chars[_unary__edvuaz_4] = c_3;
1581
+ } else {
1582
+ var c_4 = numberToChar(codePoint);
1583
+ var _unary__edvuaz_5 = length;
1584
+ length = _unary__edvuaz_5 + 1 | 0;
1585
+ chars[_unary__edvuaz_5] = c_4;
1586
+ }
1587
+ tmp$ret$4 = 2;
1588
+ }
1589
+ index = tmp + tmp$ret$4 | 0;
1590
+ } else {
1591
+ // Inline function 'kotlinx.io.shr' call
1592
+ if (b0 >> 4 === -2) {
1593
+ var tmp_0 = index;
1594
+ var tmp2_0 = index;
1595
+ var tmp$ret$16;
1596
+ $l$block_4: {
1597
+ // Inline function 'kotlinx.io.internal.process3Utf8Bytes' call
1598
+ if (endIndex <= (tmp2_0 + 2 | 0)) {
1599
+ var c_5 = numberToChar(65533);
1600
+ var _unary__edvuaz_6 = length;
1601
+ length = _unary__edvuaz_6 + 1 | 0;
1602
+ chars[_unary__edvuaz_6] = c_5;
1603
+ var tmp_1;
1604
+ if (endIndex <= (tmp2_0 + 1 | 0)) {
1605
+ tmp_1 = true;
1606
+ } else {
1607
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1608
+ // Inline function 'kotlinx.io.and' call
1609
+ tmp_1 = !((_this__u8e3s4[tmp2_0 + 1 | 0] & 192) === 128);
1610
+ }
1611
+ if (tmp_1) {
1612
+ tmp$ret$16 = 1;
1613
+ break $l$block_4;
1614
+ } else {
1615
+ tmp$ret$16 = 2;
1616
+ break $l$block_4;
1617
+ }
1618
+ }
1619
+ var b0_1 = _this__u8e3s4[tmp2_0];
1620
+ var b1_0 = _this__u8e3s4[tmp2_0 + 1 | 0];
1621
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1622
+ // Inline function 'kotlinx.io.and' call
1623
+ if (!((b1_0 & 192) === 128)) {
1624
+ var c_6 = numberToChar(65533);
1625
+ var _unary__edvuaz_7 = length;
1626
+ length = _unary__edvuaz_7 + 1 | 0;
1627
+ chars[_unary__edvuaz_7] = c_6;
1628
+ tmp$ret$16 = 1;
1629
+ break $l$block_4;
1630
+ }
1631
+ var b2 = _this__u8e3s4[tmp2_0 + 2 | 0];
1632
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1633
+ // Inline function 'kotlinx.io.and' call
1634
+ if (!((b2 & 192) === 128)) {
1635
+ var c_7 = numberToChar(65533);
1636
+ var _unary__edvuaz_8 = length;
1637
+ length = _unary__edvuaz_8 + 1 | 0;
1638
+ chars[_unary__edvuaz_8] = c_7;
1639
+ tmp$ret$16 = 2;
1640
+ break $l$block_4;
1641
+ }
1642
+ var codePoint_0 = -123008 ^ b2 ^ b1_0 << 6 ^ b0_1 << 12;
1643
+ if (codePoint_0 < 2048) {
1644
+ var c_8 = numberToChar(65533);
1645
+ var _unary__edvuaz_9 = length;
1646
+ length = _unary__edvuaz_9 + 1 | 0;
1647
+ chars[_unary__edvuaz_9] = c_8;
1648
+ } else if (55296 <= codePoint_0 ? codePoint_0 <= 57343 : false) {
1649
+ var c_9 = numberToChar(65533);
1650
+ var _unary__edvuaz_10 = length;
1651
+ length = _unary__edvuaz_10 + 1 | 0;
1652
+ chars[_unary__edvuaz_10] = c_9;
1653
+ } else {
1654
+ var c_10 = numberToChar(codePoint_0);
1655
+ var _unary__edvuaz_11 = length;
1656
+ length = _unary__edvuaz_11 + 1 | 0;
1657
+ chars[_unary__edvuaz_11] = c_10;
1658
+ }
1659
+ tmp$ret$16 = 3;
1660
+ }
1661
+ index = tmp_0 + tmp$ret$16 | 0;
1662
+ } else {
1663
+ // Inline function 'kotlinx.io.shr' call
1664
+ if (b0 >> 3 === -2) {
1665
+ var tmp_2 = index;
1666
+ var tmp2_1 = index;
1667
+ var tmp$ret$36;
1668
+ $l$block_10: {
1669
+ // Inline function 'kotlinx.io.internal.process4Utf8Bytes' call
1670
+ if (endIndex <= (tmp2_1 + 3 | 0)) {
1671
+ if (!(65533 === 65533)) {
1672
+ var c_11 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1673
+ var _unary__edvuaz_12 = length;
1674
+ length = _unary__edvuaz_12 + 1 | 0;
1675
+ chars[_unary__edvuaz_12] = c_11;
1676
+ var c_12 = numberToChar((65533 & 1023) + 56320 | 0);
1677
+ var _unary__edvuaz_13 = length;
1678
+ length = _unary__edvuaz_13 + 1 | 0;
1679
+ chars[_unary__edvuaz_13] = c_12;
1680
+ } else {
1681
+ var c_13 = _Char___init__impl__6a9atx(65533);
1682
+ var _unary__edvuaz_14 = length;
1683
+ length = _unary__edvuaz_14 + 1 | 0;
1684
+ chars[_unary__edvuaz_14] = c_13;
1685
+ }
1686
+ var tmp_3;
1687
+ if (endIndex <= (tmp2_1 + 1 | 0)) {
1688
+ tmp_3 = true;
1689
+ } else {
1690
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1691
+ // Inline function 'kotlinx.io.and' call
1692
+ tmp_3 = !((_this__u8e3s4[tmp2_1 + 1 | 0] & 192) === 128);
1693
+ }
1694
+ if (tmp_3) {
1695
+ tmp$ret$36 = 1;
1696
+ break $l$block_10;
1697
+ } else {
1698
+ var tmp_4;
1699
+ if (endIndex <= (tmp2_1 + 2 | 0)) {
1700
+ tmp_4 = true;
1701
+ } else {
1702
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1703
+ // Inline function 'kotlinx.io.and' call
1704
+ tmp_4 = !((_this__u8e3s4[tmp2_1 + 2 | 0] & 192) === 128);
1705
+ }
1706
+ if (tmp_4) {
1707
+ tmp$ret$36 = 2;
1708
+ break $l$block_10;
1709
+ } else {
1710
+ tmp$ret$36 = 3;
1711
+ break $l$block_10;
1712
+ }
1713
+ }
1714
+ }
1715
+ var b0_2 = _this__u8e3s4[tmp2_1];
1716
+ var b1_1 = _this__u8e3s4[tmp2_1 + 1 | 0];
1717
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1718
+ // Inline function 'kotlinx.io.and' call
1719
+ if (!((b1_1 & 192) === 128)) {
1720
+ if (!(65533 === 65533)) {
1721
+ var c_14 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1722
+ var _unary__edvuaz_15 = length;
1723
+ length = _unary__edvuaz_15 + 1 | 0;
1724
+ chars[_unary__edvuaz_15] = c_14;
1725
+ var c_15 = numberToChar((65533 & 1023) + 56320 | 0);
1726
+ var _unary__edvuaz_16 = length;
1727
+ length = _unary__edvuaz_16 + 1 | 0;
1728
+ chars[_unary__edvuaz_16] = c_15;
1729
+ } else {
1730
+ var c_16 = _Char___init__impl__6a9atx(65533);
1731
+ var _unary__edvuaz_17 = length;
1732
+ length = _unary__edvuaz_17 + 1 | 0;
1733
+ chars[_unary__edvuaz_17] = c_16;
1734
+ }
1735
+ tmp$ret$36 = 1;
1736
+ break $l$block_10;
1737
+ }
1738
+ var b2_0 = _this__u8e3s4[tmp2_1 + 2 | 0];
1739
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1740
+ // Inline function 'kotlinx.io.and' call
1741
+ if (!((b2_0 & 192) === 128)) {
1742
+ if (!(65533 === 65533)) {
1743
+ var c_17 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1744
+ var _unary__edvuaz_18 = length;
1745
+ length = _unary__edvuaz_18 + 1 | 0;
1746
+ chars[_unary__edvuaz_18] = c_17;
1747
+ var c_18 = numberToChar((65533 & 1023) + 56320 | 0);
1748
+ var _unary__edvuaz_19 = length;
1749
+ length = _unary__edvuaz_19 + 1 | 0;
1750
+ chars[_unary__edvuaz_19] = c_18;
1751
+ } else {
1752
+ var c_19 = _Char___init__impl__6a9atx(65533);
1753
+ var _unary__edvuaz_20 = length;
1754
+ length = _unary__edvuaz_20 + 1 | 0;
1755
+ chars[_unary__edvuaz_20] = c_19;
1756
+ }
1757
+ tmp$ret$36 = 2;
1758
+ break $l$block_10;
1759
+ }
1760
+ var b3 = _this__u8e3s4[tmp2_1 + 3 | 0];
1761
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1762
+ // Inline function 'kotlinx.io.and' call
1763
+ if (!((b3 & 192) === 128)) {
1764
+ if (!(65533 === 65533)) {
1765
+ var c_20 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1766
+ var _unary__edvuaz_21 = length;
1767
+ length = _unary__edvuaz_21 + 1 | 0;
1768
+ chars[_unary__edvuaz_21] = c_20;
1769
+ var c_21 = numberToChar((65533 & 1023) + 56320 | 0);
1770
+ var _unary__edvuaz_22 = length;
1771
+ length = _unary__edvuaz_22 + 1 | 0;
1772
+ chars[_unary__edvuaz_22] = c_21;
1773
+ } else {
1774
+ var c_22 = _Char___init__impl__6a9atx(65533);
1775
+ var _unary__edvuaz_23 = length;
1776
+ length = _unary__edvuaz_23 + 1 | 0;
1777
+ chars[_unary__edvuaz_23] = c_22;
1778
+ }
1779
+ tmp$ret$36 = 3;
1780
+ break $l$block_10;
1781
+ }
1782
+ var codePoint_1 = 3678080 ^ b3 ^ b2_0 << 6 ^ b1_1 << 12 ^ b0_2 << 18;
1783
+ if (codePoint_1 > 1114111) {
1784
+ if (!(65533 === 65533)) {
1785
+ var c_23 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1786
+ var _unary__edvuaz_24 = length;
1787
+ length = _unary__edvuaz_24 + 1 | 0;
1788
+ chars[_unary__edvuaz_24] = c_23;
1789
+ var c_24 = numberToChar((65533 & 1023) + 56320 | 0);
1790
+ var _unary__edvuaz_25 = length;
1791
+ length = _unary__edvuaz_25 + 1 | 0;
1792
+ chars[_unary__edvuaz_25] = c_24;
1793
+ } else {
1794
+ var c_25 = _Char___init__impl__6a9atx(65533);
1795
+ var _unary__edvuaz_26 = length;
1796
+ length = _unary__edvuaz_26 + 1 | 0;
1797
+ chars[_unary__edvuaz_26] = c_25;
1798
+ }
1799
+ } else if (55296 <= codePoint_1 ? codePoint_1 <= 57343 : false) {
1800
+ if (!(65533 === 65533)) {
1801
+ var c_26 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1802
+ var _unary__edvuaz_27 = length;
1803
+ length = _unary__edvuaz_27 + 1 | 0;
1804
+ chars[_unary__edvuaz_27] = c_26;
1805
+ var c_27 = numberToChar((65533 & 1023) + 56320 | 0);
1806
+ var _unary__edvuaz_28 = length;
1807
+ length = _unary__edvuaz_28 + 1 | 0;
1808
+ chars[_unary__edvuaz_28] = c_27;
1809
+ } else {
1810
+ var c_28 = _Char___init__impl__6a9atx(65533);
1811
+ var _unary__edvuaz_29 = length;
1812
+ length = _unary__edvuaz_29 + 1 | 0;
1813
+ chars[_unary__edvuaz_29] = c_28;
1814
+ }
1815
+ } else if (codePoint_1 < 65536) {
1816
+ if (!(65533 === 65533)) {
1817
+ var c_29 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1818
+ var _unary__edvuaz_30 = length;
1819
+ length = _unary__edvuaz_30 + 1 | 0;
1820
+ chars[_unary__edvuaz_30] = c_29;
1821
+ var c_30 = numberToChar((65533 & 1023) + 56320 | 0);
1822
+ var _unary__edvuaz_31 = length;
1823
+ length = _unary__edvuaz_31 + 1 | 0;
1824
+ chars[_unary__edvuaz_31] = c_30;
1825
+ } else {
1826
+ var c_31 = _Char___init__impl__6a9atx(65533);
1827
+ var _unary__edvuaz_32 = length;
1828
+ length = _unary__edvuaz_32 + 1 | 0;
1829
+ chars[_unary__edvuaz_32] = c_31;
1830
+ }
1831
+ } else {
1832
+ if (!(codePoint_1 === 65533)) {
1833
+ var c_32 = numberToChar((codePoint_1 >>> 10 | 0) + 55232 | 0);
1834
+ var _unary__edvuaz_33 = length;
1835
+ length = _unary__edvuaz_33 + 1 | 0;
1836
+ chars[_unary__edvuaz_33] = c_32;
1837
+ var c_33 = numberToChar((codePoint_1 & 1023) + 56320 | 0);
1838
+ var _unary__edvuaz_34 = length;
1839
+ length = _unary__edvuaz_34 + 1 | 0;
1840
+ chars[_unary__edvuaz_34] = c_33;
1841
+ } else {
1842
+ var c_34 = _Char___init__impl__6a9atx(65533);
1843
+ var _unary__edvuaz_35 = length;
1844
+ length = _unary__edvuaz_35 + 1 | 0;
1845
+ chars[_unary__edvuaz_35] = c_34;
1846
+ }
1847
+ }
1848
+ tmp$ret$36 = 4;
1849
+ }
1850
+ index = tmp_2 + tmp$ret$36 | 0;
1851
+ } else {
1852
+ var c_35 = _Char___init__impl__6a9atx(65533);
1853
+ var _unary__edvuaz_36 = length;
1854
+ length = _unary__edvuaz_36 + 1 | 0;
1855
+ chars[_unary__edvuaz_36] = c_35;
1856
+ index = index + 1 | 0;
1857
+ }
1858
+ }
1859
+ }
1860
+ }
1861
+ }
1862
+ return concatToString(chars, 0, length);
1863
+ }
1864
+ function get_SegmentReadContextImpl() {
1865
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1866
+ return SegmentReadContextImpl;
1867
+ }
1868
+ var SegmentReadContextImpl;
1869
+ function get_SegmentWriteContextImpl() {
1870
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1871
+ return SegmentWriteContextImpl;
1872
+ }
1873
+ var SegmentWriteContextImpl;
1874
+ var BufferIterationContextImpl;
1875
+ function UnsafeBufferOperations() {
1876
+ }
1877
+ var UnsafeBufferOperations_instance;
1878
+ function UnsafeBufferOperations_getInstance() {
1879
+ return UnsafeBufferOperations_instance;
1880
+ }
1881
+ function SegmentReadContextImpl$1() {
1882
+ }
1883
+ protoOf(SegmentReadContextImpl$1).a30 = function (segment, offset) {
1884
+ return segment.a2z(offset);
1885
+ };
1886
+ function SegmentWriteContextImpl$1() {
1887
+ }
1888
+ protoOf(SegmentWriteContextImpl$1).a31 = function (segment, offset, value) {
1889
+ segment.t30(offset, value);
1890
+ };
1891
+ protoOf(SegmentWriteContextImpl$1).z30 = function (segment, offset, b0, b1) {
1892
+ segment.u30(offset, b0, b1);
1893
+ };
1894
+ protoOf(SegmentWriteContextImpl$1).y30 = function (segment, offset, b0, b1, b2) {
1895
+ segment.v30(offset, b0, b1, b2);
1896
+ };
1897
+ protoOf(SegmentWriteContextImpl$1).x30 = function (segment, offset, b0, b1, b2, b3) {
1898
+ segment.w30(offset, b0, b1, b2, b3);
1899
+ };
1900
+ function BufferIterationContextImpl$1() {
1901
+ }
1902
+ protoOf(BufferIterationContextImpl$1).a30 = function (segment, offset) {
1903
+ return get_SegmentReadContextImpl().a30(segment, offset);
1904
+ };
1905
+ var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
1906
+ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
1907
+ if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
1908
+ properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
1909
+ SegmentReadContextImpl = new SegmentReadContextImpl$1();
1910
+ SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
1911
+ BufferIterationContextImpl = new BufferIterationContextImpl$1();
1912
+ }
1913
+ }
1914
+ function IOException_init_$Init$($this) {
1915
+ Exception_init_$Init$($this);
1916
+ IOException.call($this);
1917
+ return $this;
1918
+ }
1919
+ function IOException_init_$Create$() {
1920
+ var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
1921
+ captureStack(tmp, IOException_init_$Create$);
1922
+ return tmp;
1923
+ }
1924
+ function IOException_init_$Init$_0(message, $this) {
1925
+ Exception_init_$Init$_0(message, $this);
1926
+ IOException.call($this);
1927
+ return $this;
1928
+ }
1929
+ function IOException_init_$Create$_0(message) {
1930
+ var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
1931
+ captureStack(tmp, IOException_init_$Create$_0);
1932
+ return tmp;
1933
+ }
1934
+ function IOException_init_$Init$_1(message, cause, $this) {
1935
+ Exception_init_$Init$_1(message, cause, $this);
1936
+ IOException.call($this);
1937
+ return $this;
1938
+ }
1939
+ function IOException_init_$Create$_1(message, cause) {
1940
+ var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
1941
+ captureStack(tmp, IOException_init_$Create$_1);
1942
+ return tmp;
1943
+ }
1944
+ function IOException() {
1945
+ captureStack(this, IOException);
1946
+ }
1947
+ function EOFException_init_$Init$($this) {
1948
+ IOException_init_$Init$($this);
1949
+ EOFException.call($this);
1950
+ return $this;
1951
+ }
1952
+ function EOFException_init_$Create$() {
1953
+ var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
1954
+ captureStack(tmp, EOFException_init_$Create$);
1955
+ return tmp;
1956
+ }
1957
+ function EOFException_init_$Init$_0(message, $this) {
1958
+ IOException_init_$Init$_0(message, $this);
1959
+ EOFException.call($this);
1960
+ return $this;
1961
+ }
1962
+ function EOFException_init_$Create$_0(message) {
1963
+ var tmp = EOFException_init_$Init$_0(message, objectCreate(protoOf(EOFException)));
1964
+ captureStack(tmp, EOFException_init_$Create$_0);
1965
+ return tmp;
1966
+ }
1967
+ function EOFException() {
1968
+ captureStack(this, EOFException);
1969
+ }
1970
+ function SegmentPool() {
1971
+ this.k2z_1 = 0;
1972
+ this.l2z_1 = 0;
1973
+ }
1974
+ protoOf(SegmentPool).m2z = function () {
1975
+ return Companion_instance.o30();
1976
+ };
1977
+ protoOf(SegmentPool).b30 = function (segment) {
1978
+ };
1979
+ protoOf(SegmentPool).q30 = function () {
1980
+ return AlwaysSharedCopyTracker_getInstance();
1981
+ };
1982
+ var SegmentPool_instance;
1983
+ function SegmentPool_getInstance() {
1984
+ return SegmentPool_instance;
1985
+ }
1986
+ //region block: post-declaration
1987
+ protoOf(Buffer).q2z = write$default;
1988
+ //endregion
1989
+ //region block: init
1990
+ Companion_instance = new Companion();
1991
+ UnsafeBufferOperations_instance = new UnsafeBufferOperations();
1992
+ SegmentPool_instance = new SegmentPool();
1993
+ //endregion
1994
+ //region block: exports
1995
+ export {
1996
+ EOFException_init_$Create$_0 as EOFException_init_$Create$28fkhq0q0kobq,
1997
+ IOException_init_$Init$_0 as IOException_init_$Init$214bkj3jbj847,
1998
+ IOException_init_$Create$_0 as IOException_init_$Create$30ael4xxp8cz,
1999
+ IOException_init_$Init$_1 as IOException_init_$Init$1v5tzhogkz08y,
2000
+ IOException_init_$Create$_1 as IOException_init_$Create$1n9wqi59tj1t7,
2001
+ Buffer as Buffergs925ekssbch,
2002
+ IOException as IOException1wyutdmfe71nu,
2003
+ Source as Source1shr0ps16u4p4,
2004
+ indexOf_1 as indexOf29nspdgx2e3ap,
2005
+ readByteArray_0 as readByteArray1fhzfwi2j014k,
2006
+ readByteArray as readByteArray1ri21h2rciakw,
2007
+ readByteString as readByteString2hnsbql6t4ads,
2008
+ readString_0 as readString2nvggcfaijfhd,
2009
+ readString as readString3v6duspiz33tv,
2010
+ writeString as writeString33ca4btrgctw7,
2011
+ };
2012
+ //endregion
2013
+
2014
+ //# sourceMappingURL=kotlinx-io-kotlinx-io-core.mjs.map