@godaan/shared 1.0.0-SNAPSHOT-202512150300 → 1.0.0-SNAPSHOT-202512150737

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