@doordeck/doordeck-headless-sdk 0.31.0 → 0.33.0

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 (51) hide show
  1. package/kotlin/Kotlin-DateTime-library-kotlinx-datetime.js +1484 -1484
  2. package/kotlin/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -1
  3. package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js +33 -23
  4. package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js.map +1 -1
  5. package/kotlin/MultiplatformSettings-multiplatform-settings.js +11 -11
  6. package/kotlin/Stately-stately-concurrency.js +9 -9
  7. package/kotlin/Stately-stately-concurrent-collections.js +87 -87
  8. package/kotlin/doordeck-sdk.d.ts +33 -27
  9. package/kotlin/doordeck-sdk.js +14002 -14031
  10. package/kotlin/doordeck-sdk.js.map +1 -1
  11. package/kotlin/kotlin-kotlin-stdlib.js +3422 -3210
  12. package/kotlin/kotlin-kotlin-stdlib.js.map +1 -1
  13. package/kotlin/kotlinx-atomicfu.js +71 -71
  14. package/kotlin/kotlinx-atomicfu.js.map +1 -1
  15. package/kotlin/kotlinx-coroutines-core.js +2854 -2898
  16. package/kotlin/kotlinx-coroutines-core.js.map +1 -1
  17. package/kotlin/kotlinx-io-kotlinx-io-core.js +938 -453
  18. package/kotlin/kotlinx-io-kotlinx-io-core.js.map +1 -1
  19. package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +2344 -2283
  20. package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
  21. package/kotlin/kotlinx-serialization-kotlinx-serialization-json-io.js +8 -0
  22. package/kotlin/kotlinx-serialization-kotlinx-serialization-json-io.js.map +1 -0
  23. package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +2146 -1806
  24. package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -1
  25. package/kotlin/ktor-ktor-client-ktor-client-core.js +3510 -3374
  26. package/kotlin/ktor-ktor-client-ktor-client-core.js.map +1 -1
  27. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-auth.js +490 -431
  28. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-auth.js.map +1 -1
  29. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-content-negotiation.js +232 -232
  30. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-content-negotiation.js.map +1 -1
  31. package/kotlin/ktor-ktor-http.js +1101 -1046
  32. package/kotlin/ktor-ktor-http.js.map +1 -1
  33. package/kotlin/ktor-ktor-io.js +947 -941
  34. package/kotlin/ktor-ktor-io.js.map +1 -1
  35. package/kotlin/ktor-ktor-shared-ktor-events.js +24 -24
  36. package/kotlin/ktor-ktor-shared-ktor-events.js.map +1 -1
  37. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx-ktor-serialization-kotlinx-json.js +9 -9
  38. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx-ktor-serialization-kotlinx-json.js.map +1 -1
  39. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx.js +325 -325
  40. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx.js.map +1 -1
  41. package/kotlin/ktor-ktor-shared-ktor-serialization.js +130 -130
  42. package/kotlin/ktor-ktor-shared-ktor-serialization.js.map +1 -1
  43. package/kotlin/ktor-ktor-shared-ktor-websockets.js +115 -101
  44. package/kotlin/ktor-ktor-shared-ktor-websockets.js.map +1 -1
  45. package/kotlin/ktor-ktor-utils.js +1133 -806
  46. package/kotlin/ktor-ktor-utils.js.map +1 -1
  47. package/kotlin/projects-core-koin-core.js +561 -527
  48. package/kotlin/projects-core-koin-core.js.map +1 -1
  49. package/package.json +3 -5
  50. package/kotlin/uuid.js +0 -152
  51. package/kotlin/uuid.js.map +0 -1
@@ -2,39 +2,38 @@
2
2
  'use strict';
3
3
  //region block: imports
4
4
  var imul = Math.imul;
5
- var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.b2;
6
- var Long = kotlin_kotlin.$_$.ze;
7
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1;
5
+ var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.c2;
6
+ var Long = kotlin_kotlin.$_$.ue;
7
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.v1;
8
8
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.r2;
9
- var charArrayOf = kotlin_kotlin.$_$.da;
10
- var protoOf = kotlin_kotlin.$_$.rb;
11
- var toString = kotlin_kotlin.$_$.vb;
12
- var ensureNotNull = kotlin_kotlin.$_$.vf;
13
- var Unit_instance = kotlin_kotlin.$_$.k5;
14
- var toShort = kotlin_kotlin.$_$.ub;
15
- var toLong = kotlin_kotlin.$_$.tb;
16
- var arrayCopy = kotlin_kotlin.$_$.b6;
17
- var toByte = kotlin_kotlin.$_$.sb;
18
- var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.f1;
19
- var initMetadataForClass = kotlin_kotlin.$_$.ra;
20
- var VOID = kotlin_kotlin.$_$.f;
21
- var objectCreate = kotlin_kotlin.$_$.qb;
22
- var initMetadataForCompanion = kotlin_kotlin.$_$.sa;
23
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.y1;
24
- var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.s1;
25
- var initMetadataForObject = kotlin_kotlin.$_$.xa;
26
- var initMetadataForInterface = kotlin_kotlin.$_$.va;
27
- var charSequenceGet = kotlin_kotlin.$_$.fa;
9
+ var charArrayOf = kotlin_kotlin.$_$.z9;
10
+ var protoOf = kotlin_kotlin.$_$.nb;
11
+ var toString = kotlin_kotlin.$_$.rb;
12
+ var Unit_instance = kotlin_kotlin.$_$.j5;
13
+ var toShort = kotlin_kotlin.$_$.qb;
14
+ var ensureNotNull = kotlin_kotlin.$_$.rf;
15
+ var toLong = kotlin_kotlin.$_$.pb;
16
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.h1;
17
+ var initMetadataForClass = kotlin_kotlin.$_$.na;
18
+ var VOID = kotlin_kotlin.$_$.h;
19
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.z1;
20
+ var objectCreate = kotlin_kotlin.$_$.mb;
21
+ var initMetadataForCompanion = kotlin_kotlin.$_$.oa;
22
+ var arrayCopy = kotlin_kotlin.$_$.z5;
23
+ var toByte = kotlin_kotlin.$_$.ob;
24
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.t1;
25
+ var initMetadataForObject = kotlin_kotlin.$_$.ta;
26
+ var initMetadataForInterface = kotlin_kotlin.$_$.ra;
27
+ var charSequenceGet = kotlin_kotlin.$_$.ba;
28
28
  var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.x2;
29
- var numberToLong = kotlin_kotlin.$_$.pb;
30
- var charArray = kotlin_kotlin.$_$.ea;
31
- var numberToChar = kotlin_kotlin.$_$.nb;
32
- var concatToString = kotlin_kotlin.$_$.lc;
33
- var Exception_init_$Init$ = kotlin_kotlin.$_$.l1;
34
- var captureStack = kotlin_kotlin.$_$.ca;
35
- var Exception_init_$Init$_0 = kotlin_kotlin.$_$.n1;
36
- var Exception_init_$Init$_1 = kotlin_kotlin.$_$.o1;
37
- var Exception = kotlin_kotlin.$_$.we;
29
+ var charArray = kotlin_kotlin.$_$.aa;
30
+ var numberToChar = kotlin_kotlin.$_$.jb;
31
+ var concatToString = kotlin_kotlin.$_$.hc;
32
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.m1;
33
+ var captureStack = kotlin_kotlin.$_$.y9;
34
+ var Exception_init_$Init$_0 = kotlin_kotlin.$_$.o1;
35
+ var Exception_init_$Init$_1 = kotlin_kotlin.$_$.p1;
36
+ var Exception = kotlin_kotlin.$_$.re;
38
37
  //endregion
39
38
  //region block: pre-declaration
40
39
  initMetadataForInterface(Source, 'Source');
@@ -43,19 +42,25 @@
43
42
  endIndex = endIndex === VOID ? source.length : endIndex;
44
43
  var tmp;
45
44
  if ($super === VOID) {
46
- this.n1a(source, startIndex, endIndex);
45
+ this.b1c(source, startIndex, endIndex);
47
46
  tmp = Unit_instance;
48
47
  } else {
49
- tmp = $super.n1a.call(this, source, startIndex, endIndex);
48
+ tmp = $super.b1c.call(this, source, startIndex, endIndex);
50
49
  }
51
50
  return tmp;
52
51
  }
53
52
  initMetadataForInterface(Sink, 'Sink');
54
53
  initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
54
+ initMetadataForClass(PeekSource, 'PeekSource');
55
+ initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
55
56
  initMetadataForCompanion(Companion);
56
57
  initMetadataForClass(Segment, 'Segment');
57
58
  initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
58
59
  initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
60
+ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
61
+ initMetadataForClass(SegmentReadContextImpl$1);
62
+ initMetadataForClass(SegmentWriteContextImpl$1);
63
+ initMetadataForClass(BufferIterationContextImpl$1);
59
64
  initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
60
65
  initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
61
66
  initMetadataForObject(SegmentPool, 'SegmentPool');
@@ -67,16 +72,16 @@
67
72
  var HEX_DIGIT_CHARS;
68
73
  function checkBounds(size, startIndex, endIndex) {
69
74
  _init_properties__Util_kt__g8tcl9();
70
- if (startIndex.z(new Long(0, 0)) < 0 || endIndex.z(size) > 0) {
75
+ if (startIndex.e1(new Long(0, 0)) < 0 || endIndex.e1(size) > 0) {
71
76
  throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
72
77
  }
73
- if (startIndex.z(endIndex) > 0) {
78
+ if (startIndex.e1(endIndex) > 0) {
74
79
  throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
75
80
  }
76
81
  }
77
82
  function checkOffsetAndCount(size, offset, byteCount) {
78
83
  _init_properties__Util_kt__g8tcl9();
79
- if (offset.z(new Long(0, 0)) < 0 || offset.z(size) > 0 || size.v2(offset).z(byteCount) < 0 || byteCount.z(new Long(0, 0)) < 0) {
84
+ if (offset.e1(new Long(0, 0)) < 0 || offset.e1(size) > 0 || size.a3(offset).e1(byteCount) < 0 || byteCount.e1(new Long(0, 0)) < 0) {
80
85
  throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
81
86
  }
82
87
  }
@@ -88,104 +93,160 @@
88
93
  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)]);
89
94
  }
90
95
  }
96
+ function throwEof($this, byteCount) {
97
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.s().toString() + ', required: ' + byteCount.toString() + ')');
98
+ }
91
99
  function Buffer() {
92
- this.j19_1 = null;
93
- this.k19_1 = null;
94
- this.l19_1 = new Long(0, 0);
95
- this.m19_1 = this;
100
+ this.p1a_1 = null;
101
+ this.q1a_1 = null;
102
+ this.r1a_1 = new Long(0, 0);
96
103
  }
97
- protoOf(Buffer).m = function () {
98
- return this.l19_1;
104
+ protoOf(Buffer).s = function () {
105
+ return this.r1a_1;
99
106
  };
100
- protoOf(Buffer).n19 = function () {
101
- return this.m19_1;
107
+ protoOf(Buffer).s1a = function () {
108
+ return this;
102
109
  };
103
- protoOf(Buffer).o19 = function () {
104
- return this.m().equals(new Long(0, 0));
110
+ protoOf(Buffer).t1a = function () {
111
+ return this.s().equals(new Long(0, 0));
105
112
  };
106
- protoOf(Buffer).p19 = function (byteCount) {
113
+ protoOf(Buffer).u1a = function (byteCount) {
107
114
  // Inline function 'kotlin.require' call
108
115
  // Inline function 'kotlin.contracts.contract' call
109
- if (!(byteCount.z(new Long(0, 0)) >= 0)) {
116
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
110
117
  // Inline function 'kotlinx.io.Buffer.require.<anonymous>' call
111
118
  var message = 'byteCount: ' + byteCount.toString();
112
119
  throw IllegalArgumentException_init_$Create$(toString(message));
113
120
  }
114
- if (this.m().z(byteCount) < 0) {
115
- throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.m().toString() + ', required: ' + byteCount.toString() + ')');
121
+ if (this.s().e1(byteCount) < 0) {
122
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.s().toString() + ', required: ' + byteCount.toString() + ')');
116
123
  }
117
124
  };
118
- protoOf(Buffer).q19 = function (byteCount) {
125
+ protoOf(Buffer).v1a = function (byteCount) {
119
126
  // Inline function 'kotlin.require' call
120
127
  // Inline function 'kotlin.contracts.contract' call
121
- if (!(byteCount.z(new Long(0, 0)) >= 0)) {
128
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
122
129
  // Inline function 'kotlinx.io.Buffer.request.<anonymous>' call
123
130
  var message = 'byteCount: ' + byteCount.toString() + ' < 0';
124
131
  throw IllegalArgumentException_init_$Create$(toString(message));
125
132
  }
126
- return this.m().z(byteCount) >= 0;
133
+ return this.s().e1(byteCount) >= 0;
127
134
  };
128
- protoOf(Buffer).r19 = function () {
129
- this.p19(new Long(1, 0));
130
- var segment = ensureNotNull(this.j19_1);
131
- var pos = segment.t19_1;
132
- var limit = segment.u19_1;
133
- var data = segment.s19_1;
134
- var _unary__edvuaz = pos;
135
- pos = _unary__edvuaz + 1 | 0;
136
- var b = data[_unary__edvuaz];
137
- this.l19_1 = this.l19_1.v2(new Long(1, 0));
138
- if (pos === limit) {
139
- this.z19();
135
+ protoOf(Buffer).w1a = function () {
136
+ var tmp0_elvis_lhs = this.p1a_1;
137
+ var tmp;
138
+ if (tmp0_elvis_lhs == null) {
139
+ throwEof(this, new Long(1, 0));
140
140
  } else {
141
- segment.t19_1 = pos;
141
+ tmp = tmp0_elvis_lhs;
142
+ }
143
+ var segment = tmp;
144
+ var segmentSize = segment.e1b();
145
+ if (segmentSize === 0) {
146
+ this.f1b();
147
+ return this.w1a();
148
+ }
149
+ var v = segment.g1b();
150
+ this.r1a_1 = this.r1a_1.a3(new Long(1, 0));
151
+ if (segmentSize === 1) {
152
+ this.f1b();
142
153
  }
143
- return b;
154
+ return v;
144
155
  };
145
- protoOf(Buffer).a1a = function () {
146
- this.p19(new Long(2, 0));
147
- var segment = ensureNotNull(this.j19_1);
148
- var pos = segment.t19_1;
149
- var limit = segment.u19_1;
150
- if ((limit - pos | 0) < 2) {
156
+ protoOf(Buffer).h1b = function () {
157
+ var tmp0_elvis_lhs = this.p1a_1;
158
+ var tmp;
159
+ if (tmp0_elvis_lhs == null) {
160
+ throwEof(this, new Long(2, 0));
161
+ } else {
162
+ tmp = tmp0_elvis_lhs;
163
+ }
164
+ var segment = tmp;
165
+ var segmentSize = segment.e1b();
166
+ if (segmentSize < 2) {
167
+ this.u1a(new Long(2, 0));
168
+ if (segmentSize === 0) {
169
+ this.f1b();
170
+ return this.h1b();
171
+ }
151
172
  // Inline function 'kotlinx.io.and' call
152
- var tmp = (this.r19() & 255) << 8;
173
+ var tmp_0 = (this.w1a() & 255) << 8;
153
174
  // Inline function 'kotlinx.io.and' call
154
- var s = tmp | this.r19() & 255;
155
- return toShort(s);
175
+ var tmp$ret$1 = this.w1a() & 255;
176
+ return toShort(tmp_0 | tmp$ret$1);
156
177
  }
157
- var data = segment.s19_1;
158
- // Inline function 'kotlinx.io.and' call
159
- var _unary__edvuaz = pos;
160
- pos = _unary__edvuaz + 1 | 0;
161
- var tmp_0 = (data[_unary__edvuaz] & 255) << 8;
162
- // Inline function 'kotlinx.io.and' call
163
- var _unary__edvuaz_0 = pos;
164
- pos = _unary__edvuaz_0 + 1 | 0;
165
- var s_0 = tmp_0 | data[_unary__edvuaz_0] & 255;
166
- this.l19_1 = this.l19_1.v2(new Long(2, 0));
167
- if (pos === limit) {
168
- this.z19();
169
- } else {
170
- segment.t19_1 = pos;
178
+ var v = segment.i1b();
179
+ this.r1a_1 = this.r1a_1.a3(new Long(2, 0));
180
+ if (segmentSize === 2) {
181
+ this.f1b();
171
182
  }
172
- return toShort(s_0);
183
+ return v;
173
184
  };
174
- protoOf(Buffer).b1a = function () {
185
+ protoOf(Buffer).j1b = function () {
175
186
  return Unit_instance;
176
187
  };
177
- protoOf(Buffer).c1a = function (byteCount) {
188
+ protoOf(Buffer).k1b = function (out, startIndex, endIndex) {
189
+ checkBounds(this.s(), startIndex, endIndex);
190
+ if (startIndex.equals(endIndex))
191
+ return Unit_instance;
192
+ var currentOffset = startIndex;
193
+ var remainingByteCount = endIndex.a3(startIndex);
194
+ out.r1a_1 = out.r1a_1.z2(remainingByteCount);
195
+ var s = this.p1a_1;
196
+ while (currentOffset.e1(toLong(ensureNotNull(s).z1a_1 - s.y1a_1 | 0)) >= 0) {
197
+ currentOffset = currentOffset.a3(toLong(s.z1a_1 - s.y1a_1 | 0));
198
+ s = s.c1b_1;
199
+ }
200
+ while (remainingByteCount.e1(new Long(0, 0)) > 0) {
201
+ var copy = ensureNotNull(s).l1b();
202
+ copy.y1a_1 = copy.y1a_1 + currentOffset.j1() | 0;
203
+ var tmp = copy;
204
+ // Inline function 'kotlin.comparisons.minOf' call
205
+ var a = copy.y1a_1 + remainingByteCount.j1() | 0;
206
+ var b = copy.z1a_1;
207
+ tmp.z1a_1 = Math.min(a, b);
208
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
209
+ if (out.p1a_1 == null) {
210
+ out.p1a_1 = copy;
211
+ out.q1a_1 = copy;
212
+ } else if (false) {
213
+ out.q1a_1 = ensureNotNull(out.q1a_1).m1b(copy).n1b();
214
+ if (ensureNotNull(out.q1a_1).d1b_1 == null) {
215
+ out.p1a_1 = out.q1a_1;
216
+ }
217
+ } else {
218
+ out.q1a_1 = ensureNotNull(out.q1a_1).m1b(copy);
219
+ }
220
+ remainingByteCount = remainingByteCount.a3(toLong(copy.z1a_1 - copy.y1a_1 | 0));
221
+ currentOffset = new Long(0, 0);
222
+ s = s.c1b_1;
223
+ }
224
+ };
225
+ protoOf(Buffer).o1b = function () {
226
+ var result = this.s();
227
+ if (result.equals(new Long(0, 0)))
228
+ return new Long(0, 0);
229
+ var tail = ensureNotNull(this.q1a_1);
230
+ if (tail.z1a_1 < 8192 && tail.b1b_1) {
231
+ result = result.a3(toLong(tail.z1a_1 - tail.y1a_1 | 0));
232
+ }
233
+ return result;
234
+ };
235
+ protoOf(Buffer).e2 = function () {
236
+ return this.p1b(this.s());
237
+ };
238
+ protoOf(Buffer).p1b = function (byteCount) {
178
239
  // Inline function 'kotlinx.io.checkByteCount' call
179
240
  // Inline function 'kotlin.require' call
180
241
  // Inline function 'kotlin.contracts.contract' call
181
- if (!(byteCount.z(new Long(0, 0)) >= 0)) {
242
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
182
243
  // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
183
244
  var message = 'byteCount (' + byteCount.toString() + ') < 0';
184
245
  throw IllegalArgumentException_init_$Create$(toString(message));
185
246
  }
186
247
  var remainingByteCount = byteCount;
187
- while (remainingByteCount.z(new Long(0, 0)) > 0) {
188
- var tmp0_elvis_lhs = this.j19_1;
248
+ while (remainingByteCount.e1(new Long(0, 0)) > 0) {
249
+ var tmp0_elvis_lhs = this.p1a_1;
189
250
  var tmp;
190
251
  if (tmp0_elvis_lhs == null) {
191
252
  throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
@@ -195,23 +256,23 @@
195
256
  var head = tmp;
196
257
  // Inline function 'kotlinx.io.minOf' call
197
258
  var a = remainingByteCount;
198
- var b = head.u19_1 - head.t19_1 | 0;
259
+ var b = head.z1a_1 - head.y1a_1 | 0;
199
260
  // Inline function 'kotlin.comparisons.minOf' call
200
261
  var b_0 = toLong(b);
201
- var toSkip = (a.z(b_0) <= 0 ? a : b_0).e1();
202
- this.l19_1 = this.l19_1.v2(toLong(toSkip));
203
- remainingByteCount = remainingByteCount.v2(toLong(toSkip));
204
- head.t19_1 = head.t19_1 + toSkip | 0;
205
- if (head.t19_1 === head.u19_1) {
206
- this.z19();
262
+ var toSkip = (a.e1(b_0) <= 0 ? a : b_0).j1();
263
+ this.r1a_1 = this.r1a_1.a3(toLong(toSkip));
264
+ remainingByteCount = remainingByteCount.a3(toLong(toSkip));
265
+ head.y1a_1 = head.y1a_1 + toSkip | 0;
266
+ if (head.y1a_1 === head.z1a_1) {
267
+ this.f1b();
207
268
  }
208
269
  }
209
270
  };
210
- protoOf(Buffer).d1a = function (sink, startIndex, endIndex) {
271
+ protoOf(Buffer).q1b = function (sink, startIndex, endIndex) {
211
272
  // Inline function 'kotlinx.io.checkBounds' call
212
273
  var size = sink.length;
213
274
  checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
214
- var tmp0_elvis_lhs = this.j19_1;
275
+ var tmp0_elvis_lhs = this.p1a_1;
215
276
  var tmp;
216
277
  if (tmp0_elvis_lhs == null) {
217
278
  return -1;
@@ -221,63 +282,56 @@
221
282
  var s = tmp;
222
283
  // Inline function 'kotlin.comparisons.minOf' call
223
284
  var a = endIndex - startIndex | 0;
224
- var b = s.u19_1 - s.t19_1 | 0;
285
+ var b = s.e1b();
225
286
  var toCopy = Math.min(a, b);
226
- // Inline function 'kotlin.collections.copyInto' call
227
- var this_0 = s.s19_1;
228
- var startIndex_0 = s.t19_1;
229
- var endIndex_0 = s.t19_1 + toCopy | 0;
230
- // Inline function 'kotlin.js.unsafeCast' call
231
- // Inline function 'kotlin.js.asDynamic' call
232
- var tmp_0 = this_0;
233
- // Inline function 'kotlin.js.unsafeCast' call
234
- // Inline function 'kotlin.js.asDynamic' call
235
- arrayCopy(tmp_0, sink, startIndex, startIndex_0, endIndex_0);
236
- s.t19_1 = s.t19_1 + toCopy | 0;
237
- this.l19_1 = this.l19_1.v2(toLong(toCopy));
238
- if (s.t19_1 === s.u19_1) {
239
- this.z19();
287
+ s.r1b(sink, startIndex, startIndex + toCopy | 0);
288
+ this.r1a_1 = this.r1a_1.a3(toLong(toCopy));
289
+ if (isEmpty(s)) {
290
+ this.f1b();
240
291
  }
241
292
  return toCopy;
242
293
  };
243
- protoOf(Buffer).e1a = function (sink, byteCount) {
294
+ protoOf(Buffer).s1b = function (sink, byteCount) {
244
295
  // Inline function 'kotlinx.io.checkByteCount' call
245
296
  // Inline function 'kotlin.require' call
246
297
  // Inline function 'kotlin.contracts.contract' call
247
- if (!(byteCount.z(new Long(0, 0)) >= 0)) {
298
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
248
299
  // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
249
300
  var message = 'byteCount (' + byteCount.toString() + ') < 0';
250
301
  throw IllegalArgumentException_init_$Create$(toString(message));
251
302
  }
252
- if (this.m().equals(new Long(0, 0)))
303
+ if (this.s().equals(new Long(0, 0)))
253
304
  return new Long(-1, -1);
254
- var bytesWritten = byteCount.z(this.m()) > 0 ? this.m() : byteCount;
255
- sink.f1a(this, bytesWritten);
305
+ var bytesWritten = byteCount.e1(this.s()) > 0 ? this.s() : byteCount;
306
+ sink.t1b(this, bytesWritten);
256
307
  return bytesWritten;
257
308
  };
258
- protoOf(Buffer).g1a = function (sink, byteCount) {
309
+ protoOf(Buffer).u1b = function (sink, byteCount) {
259
310
  // Inline function 'kotlinx.io.checkByteCount' call
260
311
  // Inline function 'kotlin.require' call
261
312
  // Inline function 'kotlin.contracts.contract' call
262
- if (!(byteCount.z(new Long(0, 0)) >= 0)) {
313
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
263
314
  // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
264
315
  var message = 'byteCount (' + byteCount.toString() + ') < 0';
265
316
  throw IllegalArgumentException_init_$Create$(toString(message));
266
317
  }
267
- if (this.m().z(byteCount) < 0) {
268
- sink.f1a(this, this.m());
269
- throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.m().toString() + ' bytes were written.');
318
+ if (this.s().e1(byteCount) < 0) {
319
+ sink.t1b(this, this.s());
320
+ throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.s().toString() + ' bytes were written.');
270
321
  }
271
- sink.f1a(this, byteCount);
322
+ sink.t1b(this, byteCount);
272
323
  };
273
- protoOf(Buffer).h1a = function (sink) {
274
- var byteCount = this.m();
275
- if (byteCount.z(new Long(0, 0)) > 0) {
276
- sink.f1a(this, byteCount);
324
+ protoOf(Buffer).v1b = function (sink) {
325
+ var byteCount = this.s();
326
+ if (byteCount.e1(new Long(0, 0)) > 0) {
327
+ sink.t1b(this, byteCount);
277
328
  }
278
329
  return byteCount;
279
330
  };
280
- protoOf(Buffer).i1a = function (minimumCapacity) {
331
+ protoOf(Buffer).w1b = function () {
332
+ return buffered(new PeekSource(this));
333
+ };
334
+ protoOf(Buffer).x1b = function (minimumCapacity) {
281
335
  // Inline function 'kotlin.require' call
282
336
  // Inline function 'kotlin.contracts.contract' call
283
337
  if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
@@ -285,52 +339,41 @@
285
339
  var message = 'unexpected capacity';
286
340
  throw IllegalArgumentException_init_$Create$(toString(message));
287
341
  }
288
- if (this.k19_1 == null) {
289
- var result = SegmentPool_instance.l1a();
290
- this.j19_1 = result;
291
- this.k19_1 = result;
342
+ if (this.q1a_1 == null) {
343
+ var result = SegmentPool_instance.a1c();
344
+ this.p1a_1 = result;
345
+ this.q1a_1 = result;
292
346
  return result;
293
347
  }
294
- var t = ensureNotNull(this.k19_1);
295
- if ((t.u19_1 + minimumCapacity | 0) > 8192 || !t.w19_1) {
296
- var newTail = t.m1a(SegmentPool_instance.l1a());
297
- this.k19_1 = newTail;
348
+ var t = ensureNotNull(this.q1a_1);
349
+ if ((t.z1a_1 + minimumCapacity | 0) > 8192 || !t.b1b_1) {
350
+ var newTail = t.m1b(SegmentPool_instance.a1c());
351
+ this.q1a_1 = newTail;
298
352
  return newTail;
299
353
  }
300
354
  return t;
301
355
  };
302
- protoOf(Buffer).n1a = function (source, startIndex, endIndex) {
356
+ protoOf(Buffer).b1c = function (source, startIndex, endIndex) {
303
357
  // Inline function 'kotlinx.io.checkBounds' call
304
358
  var size = source.length;
305
359
  checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
306
360
  var currentOffset = startIndex;
307
361
  while (currentOffset < endIndex) {
308
- var tail = this.i1a(1);
362
+ var tail = this.x1b(1);
309
363
  // Inline function 'kotlin.comparisons.minOf' call
310
364
  var a = endIndex - currentOffset | 0;
311
- var b = 8192 - tail.u19_1 | 0;
365
+ var b = tail.c1c();
312
366
  var toCopy = Math.min(a, b);
313
- // Inline function 'kotlin.collections.copyInto' call
314
- var destination = tail.s19_1;
315
- var destinationOffset = tail.u19_1;
316
- var startIndex_0 = currentOffset;
317
- var endIndex_0 = currentOffset + toCopy | 0;
318
- // Inline function 'kotlin.js.unsafeCast' call
319
- // Inline function 'kotlin.js.asDynamic' call
320
- var tmp = source;
321
- // Inline function 'kotlin.js.unsafeCast' call
322
- // Inline function 'kotlin.js.asDynamic' call
323
- arrayCopy(tmp, destination, destinationOffset, startIndex_0, endIndex_0);
367
+ tail.d1c(source, currentOffset, currentOffset + toCopy | 0);
324
368
  currentOffset = currentOffset + toCopy | 0;
325
- tail.u19_1 = tail.u19_1 + toCopy | 0;
326
369
  }
327
- var tmp_0 = this;
370
+ var tmp = this;
328
371
  // Inline function 'kotlin.Long.plus' call
329
- var this_0 = this.l19_1;
372
+ var this_0 = this.r1a_1;
330
373
  var other = endIndex - startIndex | 0;
331
- tmp_0.l19_1 = this_0.u2(toLong(other));
374
+ tmp.r1a_1 = this_0.z2(toLong(other));
332
375
  };
333
- protoOf(Buffer).f1a = function (source, byteCount) {
376
+ protoOf(Buffer).t1b = function (source, byteCount) {
334
377
  // Inline function 'kotlin.require' call
335
378
  // Inline function 'kotlin.contracts.contract' call
336
379
  if (!!(source === this)) {
@@ -338,151 +381,343 @@
338
381
  var message = 'source == this';
339
382
  throw IllegalArgumentException_init_$Create$(toString(message));
340
383
  }
341
- checkOffsetAndCount(source.l19_1, new Long(0, 0), byteCount);
384
+ checkOffsetAndCount(source.r1a_1, new Long(0, 0), byteCount);
342
385
  var remainingByteCount = byteCount;
343
- while (remainingByteCount.z(new Long(0, 0)) > 0) {
344
- if (remainingByteCount.z(toLong(ensureNotNull(source.j19_1).s1a())) < 0) {
345
- var tail = this.k19_1;
386
+ while (remainingByteCount.e1(new Long(0, 0)) > 0) {
387
+ if (remainingByteCount.e1(toLong(ensureNotNull(source.p1a_1).e1b())) < 0) {
388
+ var tail = this.q1a_1;
346
389
  var tmp;
347
- if (!(tail == null) && tail.w19_1) {
390
+ if (!(tail == null) && tail.b1b_1) {
348
391
  // Inline function 'kotlin.Long.minus' call
349
392
  // Inline function 'kotlin.Long.plus' call
350
393
  var this_0 = remainingByteCount;
351
- var other = tail.u19_1;
352
- var this_1 = this_0.u2(toLong(other));
353
- var other_0 = tail.p1a() ? 0 : tail.t19_1;
354
- tmp = this_1.v2(toLong(other_0)).z(new Long(8192, 0)) <= 0;
394
+ var other = tail.z1a_1;
395
+ var this_1 = this_0.z2(toLong(other));
396
+ var other_0 = tail.f1c() ? 0 : tail.y1a_1;
397
+ tmp = this_1.a3(toLong(other_0)).e1(new Long(8192, 0)) <= 0;
355
398
  } else {
356
399
  tmp = false;
357
400
  }
358
401
  if (tmp) {
359
- ensureNotNull(source.j19_1).r1a(tail, remainingByteCount.e1());
360
- source.l19_1 = source.l19_1.v2(remainingByteCount);
361
- this.l19_1 = this.l19_1.u2(remainingByteCount);
402
+ ensureNotNull(source.p1a_1).h1c(tail, remainingByteCount.j1());
403
+ source.r1a_1 = source.r1a_1.a3(remainingByteCount);
404
+ this.r1a_1 = this.r1a_1.z2(remainingByteCount);
362
405
  return Unit_instance;
363
406
  } else {
364
- source.j19_1 = ensureNotNull(source.j19_1).q1a(remainingByteCount.e1());
407
+ source.p1a_1 = ensureNotNull(source.p1a_1).g1c(remainingByteCount.j1());
365
408
  }
366
409
  }
367
- var segmentToMove = ensureNotNull(source.j19_1);
368
- var movedByteCount = toLong(segmentToMove.s1a());
369
- source.j19_1 = segmentToMove.t1a();
370
- if (source.j19_1 == null) {
371
- source.k19_1 = null;
410
+ var segmentToMove = ensureNotNull(source.p1a_1);
411
+ var movedByteCount = toLong(segmentToMove.e1b());
412
+ source.p1a_1 = segmentToMove.i1c();
413
+ if (source.p1a_1 == null) {
414
+ source.q1a_1 = null;
372
415
  }
373
416
  // Inline function 'kotlinx.io.Buffer.pushSegment' call
374
- if (this.j19_1 == null) {
375
- this.j19_1 = segmentToMove;
376
- this.k19_1 = segmentToMove;
417
+ if (this.p1a_1 == null) {
418
+ this.p1a_1 = segmentToMove;
419
+ this.q1a_1 = segmentToMove;
377
420
  } else if (true) {
378
- this.k19_1 = ensureNotNull(this.k19_1).m1a(segmentToMove).u1a();
379
- if (ensureNotNull(this.k19_1).y19_1 == null) {
380
- this.j19_1 = this.k19_1;
421
+ this.q1a_1 = ensureNotNull(this.q1a_1).m1b(segmentToMove).n1b();
422
+ if (ensureNotNull(this.q1a_1).d1b_1 == null) {
423
+ this.p1a_1 = this.q1a_1;
381
424
  }
382
425
  } else {
383
- this.k19_1 = ensureNotNull(this.k19_1).m1a(segmentToMove);
426
+ this.q1a_1 = ensureNotNull(this.q1a_1).m1b(segmentToMove);
384
427
  }
385
- source.l19_1 = source.l19_1.v2(movedByteCount);
386
- this.l19_1 = this.l19_1.u2(movedByteCount);
387
- remainingByteCount = remainingByteCount.v2(movedByteCount);
428
+ source.r1a_1 = source.r1a_1.a3(movedByteCount);
429
+ this.r1a_1 = this.r1a_1.z2(movedByteCount);
430
+ remainingByteCount = remainingByteCount.a3(movedByteCount);
388
431
  }
389
432
  };
390
- protoOf(Buffer).v1a = function (source) {
433
+ protoOf(Buffer).j1c = function (source) {
391
434
  var totalBytesRead = new Long(0, 0);
392
435
  $l$loop: while (true) {
393
- var readCount = source.e1a(this, new Long(8192, 0));
436
+ var readCount = source.s1b(this, new Long(8192, 0));
394
437
  if (readCount.equals(new Long(-1, -1)))
395
438
  break $l$loop;
396
- totalBytesRead = totalBytesRead.u2(readCount);
439
+ totalBytesRead = totalBytesRead.z2(readCount);
397
440
  }
398
441
  return totalBytesRead;
399
442
  };
400
- protoOf(Buffer).w1a = function (byte) {
401
- var tail = this.i1a(1);
402
- var _unary__edvuaz = tail.u19_1;
403
- tail.u19_1 = _unary__edvuaz + 1 | 0;
404
- tail.s19_1[_unary__edvuaz] = byte;
405
- this.l19_1 = this.l19_1.u2(new Long(1, 0));
406
- };
407
- protoOf(Buffer).x1a = function (short) {
408
- var tail = this.i1a(2);
409
- var data = tail.s19_1;
410
- var limit = tail.u19_1;
411
- var _unary__edvuaz = limit;
412
- limit = _unary__edvuaz + 1 | 0;
413
- data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
414
- var _unary__edvuaz_0 = limit;
415
- limit = _unary__edvuaz_0 + 1 | 0;
416
- data[_unary__edvuaz_0] = toByte(short & 255);
417
- tail.u19_1 = limit;
418
- this.l19_1 = this.l19_1.u2(new Long(2, 0));
443
+ protoOf(Buffer).k1c = function (byte) {
444
+ this.x1b(1).l1c(byte);
445
+ this.r1a_1 = this.r1a_1.z2(new Long(1, 0));
419
446
  };
420
- protoOf(Buffer).y1a = function () {
421
- var result = new Buffer();
422
- if (this.m().equals(new Long(0, 0)))
423
- return result;
424
- var head = ensureNotNull(this.j19_1);
425
- var headCopy = head.z1a();
426
- result.j19_1 = headCopy;
427
- result.k19_1 = headCopy;
428
- var s = head.x19_1;
429
- while (!(s == null)) {
430
- result.k19_1 = ensureNotNull(result.k19_1).m1a(s.z1a());
431
- s = s.x19_1;
432
- }
433
- result.l19_1 = this.m();
434
- return result;
447
+ protoOf(Buffer).m1c = function (short) {
448
+ this.x1b(2).n1c(short);
449
+ this.r1a_1 = this.r1a_1.z2(new Long(2, 0));
435
450
  };
436
- protoOf(Buffer).a1b = function () {
451
+ protoOf(Buffer).o1c = function () {
437
452
  return Unit_instance;
438
453
  };
439
454
  protoOf(Buffer).toString = function () {
440
- if (this.m().equals(new Long(0, 0)))
455
+ if (this.s().equals(new Long(0, 0)))
441
456
  return 'Buffer(size=0)';
442
457
  var maxPrintableBytes = 64;
443
458
  // Inline function 'kotlinx.io.minOf' call
444
- var b = this.m();
459
+ var b = this.s();
445
460
  // Inline function 'kotlin.comparisons.minOf' call
446
461
  var a = toLong(maxPrintableBytes);
447
- var len = (a.z(b) <= 0 ? a : b).e1();
448
- var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.m().z(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
449
- var curr = ensureNotNull(this.j19_1);
462
+ var len = (a.e1(b) <= 0 ? a : b).j1();
463
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.s().e1(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
450
464
  var bytesWritten = 0;
451
- var pos = curr.t19_1;
452
- while (bytesWritten < len) {
453
- if (pos === curr.u19_1) {
454
- curr = ensureNotNull(curr.x19_1);
455
- pos = curr.t19_1;
465
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
466
+ var curr = this.p1a_1;
467
+ while (!(curr == null)) {
468
+ // Inline function 'kotlinx.io.Buffer.toString.<anonymous>' call
469
+ var ctx = get_SegmentReadContextImpl();
470
+ var segment = curr;
471
+ var idx = 0;
472
+ while (bytesWritten < len && idx < segment.e1b()) {
473
+ var _unary__edvuaz = idx;
474
+ idx = _unary__edvuaz + 1 | 0;
475
+ var b_0 = ctx.p1c(segment, _unary__edvuaz);
476
+ bytesWritten = bytesWritten + 1 | 0;
477
+ var tmp = get_HEX_DIGIT_CHARS();
478
+ // Inline function 'kotlinx.io.shr' call
479
+ var tmp$ret$2 = b_0 >> 4;
480
+ var tmp_0 = builder.n8(tmp[tmp$ret$2 & 15]);
481
+ var tmp_1 = get_HEX_DIGIT_CHARS();
482
+ // Inline function 'kotlinx.io.and' call
483
+ var tmp$ret$3 = b_0 & 15;
484
+ tmp_0.n8(tmp_1[tmp$ret$3]);
456
485
  }
457
- var tmp = curr.s19_1;
458
- var _unary__edvuaz = pos;
459
- pos = _unary__edvuaz + 1 | 0;
460
- var b_0 = tmp[_unary__edvuaz];
461
- bytesWritten = bytesWritten + 1 | 0;
462
- builder.k8(get_HEX_DIGIT_CHARS()[b_0 >> 4 & 15]).k8(get_HEX_DIGIT_CHARS()[b_0 & 15]);
463
- }
464
- if (this.m().z(toLong(maxPrintableBytes)) > 0) {
465
- builder.k8(_Char___init__impl__6a9atx(8230));
466
- }
467
- return 'Buffer(size=' + this.m().toString() + ' hex=' + builder.toString() + ')';
468
- };
469
- protoOf(Buffer).z19 = function () {
470
- var oldHead = ensureNotNull(this.j19_1);
471
- var nextHead = oldHead.x19_1;
472
- this.j19_1 = nextHead;
486
+ curr = curr.c1b_1;
487
+ }
488
+ if (this.s().e1(toLong(maxPrintableBytes)) > 0) {
489
+ builder.n8(_Char___init__impl__6a9atx(8230));
490
+ }
491
+ return 'Buffer(size=' + this.s().toString() + ' hex=' + builder.toString() + ')';
492
+ };
493
+ protoOf(Buffer).f1b = function () {
494
+ var oldHead = ensureNotNull(this.p1a_1);
495
+ var nextHead = oldHead.c1b_1;
496
+ this.p1a_1 = nextHead;
473
497
  if (nextHead == null) {
474
- this.k19_1 = null;
498
+ this.q1a_1 = null;
475
499
  } else {
476
- nextHead.y19_1 = null;
500
+ nextHead.d1b_1 = null;
501
+ }
502
+ oldHead.c1b_1 = null;
503
+ SegmentPool_instance.q1c(oldHead);
504
+ };
505
+ protoOf(Buffer).r1c = function () {
506
+ var oldTail = ensureNotNull(this.q1a_1);
507
+ var newTail = oldTail.d1b_1;
508
+ this.q1a_1 = newTail;
509
+ if (newTail == null) {
510
+ this.p1a_1 = null;
511
+ } else {
512
+ newTail.c1b_1 = null;
513
+ }
514
+ oldTail.d1b_1 = null;
515
+ SegmentPool_instance.q1c(oldTail);
516
+ };
517
+ function buffered(_this__u8e3s4) {
518
+ return new RealSource(_this__u8e3s4);
519
+ }
520
+ function PeekSource(upstream) {
521
+ this.s1c_1 = upstream;
522
+ this.t1c_1 = this.s1c_1.s1a();
523
+ this.u1c_1 = this.t1c_1.p1a_1;
524
+ var tmp = this;
525
+ var tmp0_safe_receiver = this.t1c_1.p1a_1;
526
+ var tmp0_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.y1a_1;
527
+ tmp.v1c_1 = tmp0_elvis_lhs == null ? -1 : tmp0_elvis_lhs;
528
+ this.w1c_1 = false;
529
+ this.x1c_1 = new Long(0, 0);
530
+ }
531
+ protoOf(PeekSource).s1b = function (sink, byteCount) {
532
+ // Inline function 'kotlin.check' call
533
+ // Inline function 'kotlin.contracts.contract' call
534
+ if (!!this.w1c_1) {
535
+ // Inline function 'kotlinx.io.PeekSource.readAtMostTo.<anonymous>' call
536
+ var message = 'Source is closed.';
537
+ throw IllegalStateException_init_$Create$(toString(message));
538
+ }
539
+ // Inline function 'kotlinx.io.checkByteCount' call
540
+ // Inline function 'kotlin.require' call
541
+ // Inline function 'kotlin.contracts.contract' call
542
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
543
+ // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
544
+ var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
545
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
546
+ }
547
+ // Inline function 'kotlin.check' call
548
+ // Inline function 'kotlin.contracts.contract' call
549
+ if (!(this.u1c_1 == null || (this.u1c_1 === this.t1c_1.p1a_1 && this.v1c_1 === ensureNotNull(this.t1c_1.p1a_1).y1a_1))) {
550
+ // Inline function 'kotlinx.io.PeekSource.readAtMostTo.<anonymous>' call
551
+ var message_1 = 'Peek source is invalid because upstream source was used';
552
+ throw IllegalStateException_init_$Create$(toString(message_1));
553
+ }
554
+ if (byteCount.equals(new Long(0, 0)))
555
+ return new Long(0, 0);
556
+ // Inline function 'kotlin.Long.plus' call
557
+ var tmp$ret$3 = this.x1c_1.z2(toLong(1));
558
+ if (!this.s1c_1.v1a(tmp$ret$3))
559
+ return new Long(-1, -1);
560
+ if (this.u1c_1 == null && !(this.t1c_1.p1a_1 == null)) {
561
+ this.u1c_1 = this.t1c_1.p1a_1;
562
+ this.v1c_1 = ensureNotNull(this.t1c_1.p1a_1).y1a_1;
563
+ }
564
+ // Inline function 'kotlin.comparisons.minOf' call
565
+ var b = this.t1c_1.s().a3(this.x1c_1);
566
+ var toCopy = byteCount.e1(b) <= 0 ? byteCount : b;
567
+ this.t1c_1.k1b(sink, this.x1c_1, this.x1c_1.z2(toCopy));
568
+ this.x1c_1 = this.x1c_1.z2(toCopy);
569
+ return toCopy;
570
+ };
571
+ protoOf(PeekSource).o1c = function () {
572
+ this.w1c_1 = true;
573
+ };
574
+ function RealSource(source) {
575
+ this.y1c_1 = source;
576
+ this.z1c_1 = false;
577
+ this.a1d_1 = new Buffer();
578
+ }
579
+ protoOf(RealSource).s1a = function () {
580
+ return this.a1d_1;
581
+ };
582
+ protoOf(RealSource).s1b = function (sink, byteCount) {
583
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
584
+ // Inline function 'kotlin.check' call
585
+ // Inline function 'kotlin.contracts.contract' call
586
+ if (!!this.z1c_1) {
587
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed.<anonymous>' call
588
+ var message = 'Source is closed.';
589
+ throw IllegalStateException_init_$Create$(toString(message));
590
+ }
591
+ // Inline function 'kotlin.require' call
592
+ // Inline function 'kotlin.contracts.contract' call
593
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
594
+ // Inline function 'kotlinx.io.RealSource.readAtMostTo.<anonymous>' call
595
+ var message_0 = 'byteCount: ' + byteCount.toString();
596
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
597
+ }
598
+ if (this.a1d_1.s().equals(new Long(0, 0))) {
599
+ var read = this.y1c_1.s1b(this.a1d_1, new Long(8192, 0));
600
+ if (read.equals(new Long(-1, -1)))
601
+ return new Long(-1, -1);
602
+ }
603
+ // Inline function 'kotlin.comparisons.minOf' call
604
+ var b = this.a1d_1.s();
605
+ var toRead = byteCount.e1(b) <= 0 ? byteCount : b;
606
+ return this.a1d_1.s1b(sink, toRead);
607
+ };
608
+ protoOf(RealSource).t1a = function () {
609
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
610
+ // Inline function 'kotlin.check' call
611
+ // Inline function 'kotlin.contracts.contract' call
612
+ if (!!this.z1c_1) {
613
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed.<anonymous>' call
614
+ var message = 'Source is closed.';
615
+ throw IllegalStateException_init_$Create$(toString(message));
616
+ }
617
+ return this.a1d_1.t1a() && this.y1c_1.s1b(this.a1d_1, new Long(8192, 0)).equals(new Long(-1, -1));
618
+ };
619
+ protoOf(RealSource).u1a = function (byteCount) {
620
+ if (!this.v1a(byteCount))
621
+ throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
622
+ };
623
+ protoOf(RealSource).v1a = function (byteCount) {
624
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
625
+ // Inline function 'kotlin.check' call
626
+ // Inline function 'kotlin.contracts.contract' call
627
+ if (!!this.z1c_1) {
628
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed.<anonymous>' call
629
+ var message = 'Source is closed.';
630
+ throw IllegalStateException_init_$Create$(toString(message));
631
+ }
632
+ // Inline function 'kotlin.require' call
633
+ // Inline function 'kotlin.contracts.contract' call
634
+ if (!(byteCount.e1(new Long(0, 0)) >= 0)) {
635
+ // Inline function 'kotlinx.io.RealSource.request.<anonymous>' call
636
+ var message_0 = 'byteCount: ' + byteCount.toString();
637
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
638
+ }
639
+ while (this.a1d_1.s().e1(byteCount) < 0) {
640
+ if (this.y1c_1.s1b(this.a1d_1, new Long(8192, 0)).equals(new Long(-1, -1)))
641
+ return false;
642
+ }
643
+ return true;
644
+ };
645
+ protoOf(RealSource).q1b = function (sink, startIndex, endIndex) {
646
+ // Inline function 'kotlinx.io.checkBounds' call
647
+ var size = sink.length;
648
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
649
+ if (this.a1d_1.s().equals(new Long(0, 0))) {
650
+ var read = this.y1c_1.s1b(this.a1d_1, new Long(8192, 0));
651
+ if (read.equals(new Long(-1, -1)))
652
+ return -1;
653
+ }
654
+ // Inline function 'kotlinx.io.minOf' call
655
+ var a = endIndex - startIndex | 0;
656
+ var b = this.a1d_1.s();
657
+ // Inline function 'kotlin.comparisons.minOf' call
658
+ var a_0 = toLong(a);
659
+ var toRead = (a_0.e1(b) <= 0 ? a_0 : b).j1();
660
+ return this.a1d_1.q1b(sink, startIndex, startIndex + toRead | 0);
661
+ };
662
+ protoOf(RealSource).u1b = function (sink, byteCount) {
663
+ try {
664
+ this.u1a(byteCount);
665
+ } catch ($p) {
666
+ if ($p instanceof EOFException) {
667
+ var e = $p;
668
+ sink.t1b(this.a1d_1, this.a1d_1.s());
669
+ throw e;
670
+ } else {
671
+ throw $p;
672
+ }
673
+ }
674
+ this.a1d_1.u1b(sink, byteCount);
675
+ };
676
+ protoOf(RealSource).v1b = function (sink) {
677
+ var totalBytesWritten = new Long(0, 0);
678
+ while (!this.y1c_1.s1b(this.a1d_1, new Long(8192, 0)).equals(new Long(-1, -1))) {
679
+ var emitByteCount = this.a1d_1.o1b();
680
+ if (emitByteCount.e1(new Long(0, 0)) > 0) {
681
+ totalBytesWritten = totalBytesWritten.z2(emitByteCount);
682
+ sink.t1b(this.a1d_1, emitByteCount);
683
+ }
477
684
  }
478
- oldHead.x19_1 = null;
479
- SegmentPool_instance.b1b(oldHead);
685
+ if (this.a1d_1.s().e1(new Long(0, 0)) > 0) {
686
+ totalBytesWritten = totalBytesWritten.z2(this.a1d_1.s());
687
+ sink.t1b(this.a1d_1, this.a1d_1.s());
688
+ }
689
+ return totalBytesWritten;
690
+ };
691
+ protoOf(RealSource).h1b = function () {
692
+ this.u1a(new Long(2, 0));
693
+ return this.a1d_1.h1b();
694
+ };
695
+ protoOf(RealSource).w1b = function () {
696
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
697
+ // Inline function 'kotlin.check' call
698
+ // Inline function 'kotlin.contracts.contract' call
699
+ if (!!this.z1c_1) {
700
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed.<anonymous>' call
701
+ var message = 'Source is closed.';
702
+ throw IllegalStateException_init_$Create$(toString(message));
703
+ }
704
+ return buffered(new PeekSource(this));
705
+ };
706
+ protoOf(RealSource).o1c = function () {
707
+ if (this.z1c_1)
708
+ return Unit_instance;
709
+ this.z1c_1 = true;
710
+ this.y1c_1.o1c();
711
+ this.a1d_1.e2();
712
+ };
713
+ protoOf(RealSource).toString = function () {
714
+ return 'buffered(' + toString(this.y1c_1) + ')';
480
715
  };
481
716
  function Segment_init_$Init$($this) {
482
717
  Segment.call($this);
483
- $this.s19_1 = new Int8Array(8192);
484
- $this.w19_1 = true;
485
- $this.v19_1 = null;
718
+ $this.x1a_1 = new Int8Array(8192);
719
+ $this.b1b_1 = true;
720
+ $this.a1b_1 = null;
486
721
  return $this;
487
722
  }
488
723
  function Segment_init_$Create$() {
@@ -490,93 +725,93 @@
490
725
  }
491
726
  function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
492
727
  Segment.call($this);
493
- $this.s19_1 = data;
494
- $this.t19_1 = pos;
495
- $this.u19_1 = limit;
496
- $this.v19_1 = shareToken;
497
- $this.w19_1 = owner;
728
+ $this.x1a_1 = data;
729
+ $this.y1a_1 = pos;
730
+ $this.z1a_1 = limit;
731
+ $this.a1b_1 = shareToken;
732
+ $this.b1b_1 = owner;
498
733
  return $this;
499
734
  }
500
735
  function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
501
736
  return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
502
737
  }
503
738
  function Companion() {
504
- this.c1b_1 = 8192;
505
- this.d1b_1 = 1024;
739
+ this.b1d_1 = 8192;
740
+ this.c1d_1 = 1024;
506
741
  }
507
- protoOf(Companion).e1b = function () {
742
+ protoOf(Companion).d1d = function () {
508
743
  return Segment_init_$Create$();
509
744
  };
510
745
  var Companion_instance;
511
746
  function Companion_getInstance() {
512
747
  return Companion_instance;
513
748
  }
514
- protoOf(Segment).p1a = function () {
515
- var tmp2_safe_receiver = this.v19_1;
516
- var tmp0_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.f1b();
749
+ protoOf(Segment).f1c = function () {
750
+ var tmp1_safe_receiver = this.a1b_1;
751
+ var tmp0_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.e1d();
517
752
  return tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
518
753
  };
519
- protoOf(Segment).z1a = function () {
520
- var tmp0_elvis_lhs = this.v19_1;
754
+ protoOf(Segment).l1b = function () {
755
+ var tmp0_elvis_lhs = this.a1b_1;
521
756
  var tmp;
522
757
  if (tmp0_elvis_lhs == null) {
523
758
  // Inline function 'kotlin.also' call
524
- var this_0 = SegmentPool_instance.g1b();
759
+ var this_0 = SegmentPool_instance.f1d();
525
760
  // Inline function 'kotlin.contracts.contract' call
526
761
  // Inline function 'kotlinx.io.Segment.sharedCopy.<anonymous>' call
527
- this.v19_1 = this_0;
762
+ this.a1b_1 = this_0;
528
763
  tmp = this_0;
529
764
  } else {
530
765
  tmp = tmp0_elvis_lhs;
531
766
  }
532
767
  var t = tmp;
533
- var tmp_0 = this.t19_1;
534
- var tmp_1 = this.u19_1;
768
+ var tmp_0 = this.y1a_1;
769
+ var tmp_1 = this.z1a_1;
535
770
  // Inline function 'kotlin.also' call
536
771
  // Inline function 'kotlin.contracts.contract' call
537
772
  // Inline function 'kotlinx.io.Segment.sharedCopy.<anonymous>' call
538
- t.h1b();
539
- return Segment_init_$Create$_0(this.s19_1, tmp_0, tmp_1, t, false);
773
+ t.g1d();
774
+ return Segment_init_$Create$_0(this.x1a_1, tmp_0, tmp_1, t, false);
540
775
  };
541
- protoOf(Segment).t1a = function () {
542
- var result = this.x19_1;
543
- if (!(this.y19_1 == null)) {
544
- ensureNotNull(this.y19_1).x19_1 = this.x19_1;
776
+ protoOf(Segment).i1c = function () {
777
+ var result = this.c1b_1;
778
+ if (!(this.d1b_1 == null)) {
779
+ ensureNotNull(this.d1b_1).c1b_1 = this.c1b_1;
545
780
  }
546
- if (!(this.x19_1 == null)) {
547
- ensureNotNull(this.x19_1).y19_1 = this.y19_1;
781
+ if (!(this.c1b_1 == null)) {
782
+ ensureNotNull(this.c1b_1).d1b_1 = this.d1b_1;
548
783
  }
549
- this.x19_1 = null;
550
- this.y19_1 = null;
784
+ this.c1b_1 = null;
785
+ this.d1b_1 = null;
551
786
  return result;
552
787
  };
553
- protoOf(Segment).m1a = function (segment) {
554
- segment.y19_1 = this;
555
- segment.x19_1 = this.x19_1;
556
- if (!(this.x19_1 == null)) {
557
- ensureNotNull(this.x19_1).y19_1 = segment;
788
+ protoOf(Segment).m1b = function (segment) {
789
+ segment.d1b_1 = this;
790
+ segment.c1b_1 = this.c1b_1;
791
+ if (!(this.c1b_1 == null)) {
792
+ ensureNotNull(this.c1b_1).d1b_1 = segment;
558
793
  }
559
- this.x19_1 = segment;
794
+ this.c1b_1 = segment;
560
795
  return segment;
561
796
  };
562
- protoOf(Segment).q1a = function (byteCount) {
797
+ protoOf(Segment).g1c = function (byteCount) {
563
798
  // Inline function 'kotlin.require' call
564
799
  // Inline function 'kotlin.contracts.contract' call
565
- if (!(byteCount > 0 && byteCount <= (this.u19_1 - this.t19_1 | 0))) {
800
+ if (!(byteCount > 0 && byteCount <= (this.z1a_1 - this.y1a_1 | 0))) {
566
801
  // Inline function 'kotlinx.io.Segment.split.<anonymous>' call
567
802
  var message = 'byteCount out of range';
568
803
  throw IllegalArgumentException_init_$Create$(toString(message));
569
804
  }
570
805
  var prefix;
571
806
  if (byteCount >= 1024) {
572
- prefix = this.z1a();
807
+ prefix = this.l1b();
573
808
  } else {
574
- prefix = SegmentPool_instance.l1a();
809
+ prefix = SegmentPool_instance.a1c();
575
810
  // Inline function 'kotlin.collections.copyInto' call
576
- var this_0 = this.s19_1;
577
- var destination = prefix.s19_1;
578
- var startIndex = this.t19_1;
579
- var endIndex = this.t19_1 + byteCount | 0;
811
+ var this_0 = this.x1a_1;
812
+ var destination = prefix.x1a_1;
813
+ var startIndex = this.y1a_1;
814
+ var endIndex = this.y1a_1 + byteCount | 0;
580
815
  // Inline function 'kotlin.js.unsafeCast' call
581
816
  // Inline function 'kotlin.js.asDynamic' call
582
817
  var tmp = this_0;
@@ -584,33 +819,33 @@
584
819
  // Inline function 'kotlin.js.asDynamic' call
585
820
  arrayCopy(tmp, destination, 0, startIndex, endIndex);
586
821
  }
587
- prefix.u19_1 = prefix.t19_1 + byteCount | 0;
588
- this.t19_1 = this.t19_1 + byteCount | 0;
589
- if (!(this.y19_1 == null)) {
590
- ensureNotNull(this.y19_1).m1a(prefix);
822
+ prefix.z1a_1 = prefix.y1a_1 + byteCount | 0;
823
+ this.y1a_1 = this.y1a_1 + byteCount | 0;
824
+ if (!(this.d1b_1 == null)) {
825
+ ensureNotNull(this.d1b_1).m1b(prefix);
591
826
  } else {
592
- prefix.x19_1 = this;
593
- this.y19_1 = prefix;
827
+ prefix.c1b_1 = this;
828
+ this.d1b_1 = prefix;
594
829
  }
595
830
  return prefix;
596
831
  };
597
- protoOf(Segment).u1a = function () {
832
+ protoOf(Segment).n1b = function () {
598
833
  // Inline function 'kotlin.check' call
599
834
  // Inline function 'kotlin.contracts.contract' call
600
- if (!!(this.y19_1 == null)) {
835
+ if (!!(this.d1b_1 == null)) {
601
836
  // Inline function 'kotlinx.io.Segment.compact.<anonymous>' call
602
837
  var message = 'cannot compact';
603
838
  throw IllegalStateException_init_$Create$(toString(message));
604
839
  }
605
- if (!ensureNotNull(this.y19_1).w19_1)
840
+ if (!ensureNotNull(this.d1b_1).b1b_1)
606
841
  return this;
607
- var byteCount = this.u19_1 - this.t19_1 | 0;
608
- var availableByteCount = (8192 - ensureNotNull(this.y19_1).u19_1 | 0) + (ensureNotNull(this.y19_1).p1a() ? 0 : ensureNotNull(this.y19_1).t19_1) | 0;
842
+ var byteCount = this.z1a_1 - this.y1a_1 | 0;
843
+ var availableByteCount = (8192 - ensureNotNull(this.d1b_1).z1a_1 | 0) + (ensureNotNull(this.d1b_1).f1c() ? 0 : ensureNotNull(this.d1b_1).y1a_1) | 0;
609
844
  if (byteCount > availableByteCount)
610
845
  return this;
611
- var predecessor = this.y19_1;
612
- this.r1a(ensureNotNull(predecessor), byteCount);
613
- var successor = this.t1a();
846
+ var predecessor = this.d1b_1;
847
+ this.h1c(ensureNotNull(predecessor), byteCount);
848
+ var successor = this.i1c();
614
849
  // Inline function 'kotlin.check' call
615
850
  // Inline function 'kotlin.contracts.contract' call
616
851
  // Inline function 'kotlin.check' call
@@ -620,73 +855,170 @@
620
855
  var message_0 = 'Check failed.';
621
856
  throw IllegalStateException_init_$Create$(toString(message_0));
622
857
  }
623
- SegmentPool_instance.b1b(this);
858
+ SegmentPool_instance.q1c(this);
624
859
  return predecessor;
625
860
  };
626
- protoOf(Segment).r1a = function (sink, byteCount) {
861
+ protoOf(Segment).l1c = function (byte) {
862
+ var _unary__edvuaz = this.z1a_1;
863
+ this.z1a_1 = _unary__edvuaz + 1 | 0;
864
+ this.x1a_1[_unary__edvuaz] = byte;
865
+ };
866
+ protoOf(Segment).n1c = function (short) {
867
+ var data = this.x1a_1;
868
+ var limit = this.z1a_1;
869
+ var _unary__edvuaz = limit;
870
+ limit = _unary__edvuaz + 1 | 0;
871
+ data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
872
+ var _unary__edvuaz_0 = limit;
873
+ limit = _unary__edvuaz_0 + 1 | 0;
874
+ data[_unary__edvuaz_0] = toByte(short & 255);
875
+ this.z1a_1 = limit;
876
+ };
877
+ protoOf(Segment).g1b = function () {
878
+ var _unary__edvuaz = this.y1a_1;
879
+ this.y1a_1 = _unary__edvuaz + 1 | 0;
880
+ return this.x1a_1[_unary__edvuaz];
881
+ };
882
+ protoOf(Segment).i1b = function () {
883
+ var data = this.x1a_1;
884
+ var pos = this.y1a_1;
885
+ // Inline function 'kotlinx.io.and' call
886
+ var _unary__edvuaz = pos;
887
+ pos = _unary__edvuaz + 1 | 0;
888
+ var tmp = (data[_unary__edvuaz] & 255) << 8;
889
+ // Inline function 'kotlinx.io.and' call
890
+ var _unary__edvuaz_0 = pos;
891
+ pos = _unary__edvuaz_0 + 1 | 0;
892
+ var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
893
+ var s = toShort(tmp | tmp$ret$1);
894
+ this.y1a_1 = pos;
895
+ return s;
896
+ };
897
+ protoOf(Segment).h1c = function (sink, byteCount) {
627
898
  // Inline function 'kotlin.check' call
628
899
  // Inline function 'kotlin.contracts.contract' call
629
- if (!sink.w19_1) {
900
+ if (!sink.b1b_1) {
630
901
  // Inline function 'kotlinx.io.Segment.writeTo.<anonymous>' call
631
902
  var message = 'only owner can write';
632
903
  throw IllegalStateException_init_$Create$(toString(message));
633
904
  }
634
- if ((sink.u19_1 + byteCount | 0) > 8192) {
635
- if (sink.p1a())
905
+ if ((sink.z1a_1 + byteCount | 0) > 8192) {
906
+ if (sink.f1c())
636
907
  throw IllegalArgumentException_init_$Create$_0();
637
- if (((sink.u19_1 + byteCount | 0) - sink.t19_1 | 0) > 8192)
908
+ if (((sink.z1a_1 + byteCount | 0) - sink.y1a_1 | 0) > 8192)
638
909
  throw IllegalArgumentException_init_$Create$_0();
639
910
  // Inline function 'kotlin.collections.copyInto' call
640
- var this_0 = sink.s19_1;
641
- var destination = sink.s19_1;
642
- var startIndex = sink.t19_1;
643
- var endIndex = sink.u19_1;
911
+ var this_0 = sink.x1a_1;
912
+ var destination = sink.x1a_1;
913
+ var startIndex = sink.y1a_1;
914
+ var endIndex = sink.z1a_1;
644
915
  // Inline function 'kotlin.js.unsafeCast' call
645
916
  // Inline function 'kotlin.js.asDynamic' call
646
917
  var tmp = this_0;
647
918
  // Inline function 'kotlin.js.unsafeCast' call
648
919
  // Inline function 'kotlin.js.asDynamic' call
649
920
  arrayCopy(tmp, destination, 0, startIndex, endIndex);
650
- sink.u19_1 = sink.u19_1 - sink.t19_1 | 0;
651
- sink.t19_1 = 0;
921
+ sink.z1a_1 = sink.z1a_1 - sink.y1a_1 | 0;
922
+ sink.y1a_1 = 0;
652
923
  }
653
924
  // Inline function 'kotlin.collections.copyInto' call
654
- var this_1 = this.s19_1;
655
- var destination_0 = sink.s19_1;
656
- var destinationOffset = sink.u19_1;
657
- var startIndex_0 = this.t19_1;
658
- var endIndex_0 = this.t19_1 + byteCount | 0;
925
+ var this_1 = this.x1a_1;
926
+ var destination_0 = sink.x1a_1;
927
+ var destinationOffset = sink.z1a_1;
928
+ var startIndex_0 = this.y1a_1;
929
+ var endIndex_0 = this.y1a_1 + byteCount | 0;
659
930
  // Inline function 'kotlin.js.unsafeCast' call
660
931
  // Inline function 'kotlin.js.asDynamic' call
661
932
  var tmp_0 = this_1;
662
933
  // Inline function 'kotlin.js.unsafeCast' call
663
934
  // Inline function 'kotlin.js.asDynamic' call
664
935
  arrayCopy(tmp_0, destination_0, destinationOffset, startIndex_0, endIndex_0);
665
- sink.u19_1 = sink.u19_1 + byteCount | 0;
666
- this.t19_1 = this.t19_1 + byteCount | 0;
936
+ sink.z1a_1 = sink.z1a_1 + byteCount | 0;
937
+ this.y1a_1 = this.y1a_1 + byteCount | 0;
938
+ };
939
+ protoOf(Segment).r1b = function (dst, dstStartOffset, dstEndOffset) {
940
+ var len = dstEndOffset - dstStartOffset | 0;
941
+ // Inline function 'kotlin.collections.copyInto' call
942
+ var this_0 = this.x1a_1;
943
+ var startIndex = this.y1a_1;
944
+ var endIndex = this.y1a_1 + len | 0;
945
+ // Inline function 'kotlin.js.unsafeCast' call
946
+ // Inline function 'kotlin.js.asDynamic' call
947
+ var tmp = this_0;
948
+ // Inline function 'kotlin.js.unsafeCast' call
949
+ // Inline function 'kotlin.js.asDynamic' call
950
+ arrayCopy(tmp, dst, dstStartOffset, startIndex, endIndex);
951
+ this.y1a_1 = this.y1a_1 + len | 0;
667
952
  };
668
- protoOf(Segment).s1a = function () {
669
- return this.u19_1 - this.t19_1 | 0;
953
+ protoOf(Segment).d1c = function (src, srcStartOffset, srcEndOffset) {
954
+ // Inline function 'kotlin.collections.copyInto' call
955
+ var destination = this.x1a_1;
956
+ var destinationOffset = this.z1a_1;
957
+ // Inline function 'kotlin.js.unsafeCast' call
958
+ // Inline function 'kotlin.js.asDynamic' call
959
+ var tmp = src;
960
+ // Inline function 'kotlin.js.unsafeCast' call
961
+ // Inline function 'kotlin.js.asDynamic' call
962
+ arrayCopy(tmp, destination, destinationOffset, srcStartOffset, srcEndOffset);
963
+ this.z1a_1 = this.z1a_1 + (srcEndOffset - srcStartOffset | 0) | 0;
964
+ };
965
+ protoOf(Segment).e1b = function () {
966
+ return this.z1a_1 - this.y1a_1 | 0;
967
+ };
968
+ protoOf(Segment).c1c = function () {
969
+ return this.x1a_1.length - this.z1a_1 | 0;
970
+ };
971
+ protoOf(Segment).h1d = function (readOnly) {
972
+ return this.x1a_1;
973
+ };
974
+ protoOf(Segment).i1d = function (index) {
975
+ return this.x1a_1[this.y1a_1 + index | 0];
976
+ };
977
+ protoOf(Segment).j1d = function (index, value) {
978
+ this.x1a_1[this.z1a_1 + index | 0] = value;
979
+ };
980
+ protoOf(Segment).k1d = function (index, b0, b1) {
981
+ var d = this.x1a_1;
982
+ var l = this.z1a_1;
983
+ d[l + index | 0] = b0;
984
+ d[(l + index | 0) + 1 | 0] = b1;
985
+ };
986
+ protoOf(Segment).l1d = function (index, b0, b1, b2) {
987
+ var d = this.x1a_1;
988
+ var l = this.z1a_1;
989
+ d[l + index | 0] = b0;
990
+ d[(l + index | 0) + 1 | 0] = b1;
991
+ d[(l + index | 0) + 2 | 0] = b2;
992
+ };
993
+ protoOf(Segment).m1d = function (index, b0, b1, b2, b3) {
994
+ var d = this.x1a_1;
995
+ var l = this.z1a_1;
996
+ d[l + index | 0] = b0;
997
+ d[(l + index | 0) + 1 | 0] = b1;
998
+ d[(l + index | 0) + 2 | 0] = b2;
999
+ d[(l + index | 0) + 3 | 0] = b3;
670
1000
  };
671
1001
  function Segment() {
672
- this.t19_1 = 0;
673
- this.u19_1 = 0;
674
- this.v19_1 = null;
675
- this.w19_1 = false;
676
- this.x19_1 = null;
677
- this.y19_1 = null;
1002
+ this.y1a_1 = 0;
1003
+ this.z1a_1 = 0;
1004
+ this.a1b_1 = null;
1005
+ this.b1b_1 = false;
1006
+ this.c1b_1 = null;
1007
+ this.d1b_1 = null;
678
1008
  }
679
1009
  function SegmentCopyTracker() {
680
1010
  }
1011
+ function isEmpty(_this__u8e3s4) {
1012
+ return _this__u8e3s4.e1b() === 0;
1013
+ }
681
1014
  function AlwaysSharedCopyTracker() {
682
1015
  AlwaysSharedCopyTracker_instance = this;
683
1016
  SegmentCopyTracker.call(this);
684
- this.i1b_1 = true;
685
1017
  }
686
- protoOf(AlwaysSharedCopyTracker).f1b = function () {
687
- return this.i1b_1;
1018
+ protoOf(AlwaysSharedCopyTracker).e1d = function () {
1019
+ return true;
688
1020
  };
689
- protoOf(AlwaysSharedCopyTracker).h1b = function () {
1021
+ protoOf(AlwaysSharedCopyTracker).g1d = function () {
690
1022
  return Unit_instance;
691
1023
  };
692
1024
  var AlwaysSharedCopyTracker_instance;
@@ -702,39 +1034,27 @@
702
1034
  function readByteArray(_this__u8e3s4) {
703
1035
  return readByteArrayImpl(_this__u8e3s4, -1);
704
1036
  }
705
- function readByteArray_0(_this__u8e3s4, byteCount) {
706
- // Inline function 'kotlinx.io.checkByteCount' call
707
- var byteCount_0 = toLong(byteCount);
708
- // Inline function 'kotlin.require' call
709
- // Inline function 'kotlin.contracts.contract' call
710
- if (!(byteCount_0.z(new Long(0, 0)) >= 0)) {
711
- // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
712
- var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
713
- throw IllegalArgumentException_init_$Create$(toString(message));
714
- }
715
- return readByteArrayImpl(_this__u8e3s4, byteCount);
716
- }
717
1037
  function readByteArrayImpl(_this__u8e3s4, size) {
718
1038
  var arraySize = size;
719
1039
  if (size === -1) {
720
1040
  var fetchSize = new Long(2147483647, 0);
721
- while (_this__u8e3s4.n19().m().z(new Long(2147483647, 0)) < 0 && _this__u8e3s4.q19(fetchSize)) {
1041
+ while (_this__u8e3s4.s1a().s().e1(new Long(2147483647, 0)) < 0 && _this__u8e3s4.v1a(fetchSize)) {
722
1042
  // Inline function 'kotlin.Long.times' call
723
- fetchSize = fetchSize.w2(toLong(2));
1043
+ fetchSize = fetchSize.b3(toLong(2));
724
1044
  }
725
1045
  // Inline function 'kotlin.check' call
726
1046
  // Inline function 'kotlin.contracts.contract' call
727
- if (!(_this__u8e3s4.n19().m().z(new Long(2147483647, 0)) < 0)) {
1047
+ if (!(_this__u8e3s4.s1a().s().e1(new Long(2147483647, 0)) < 0)) {
728
1048
  // Inline function 'kotlinx.io.readByteArrayImpl.<anonymous>' call
729
- var message = "Can't create an array of size " + _this__u8e3s4.n19().m().toString();
1049
+ var message = "Can't create an array of size " + _this__u8e3s4.s1a().s().toString();
730
1050
  throw IllegalStateException_init_$Create$(toString(message));
731
1051
  }
732
- arraySize = _this__u8e3s4.n19().m().e1();
1052
+ arraySize = _this__u8e3s4.s1a().s().j1();
733
1053
  } else {
734
- _this__u8e3s4.p19(toLong(size));
1054
+ _this__u8e3s4.u1a(toLong(size));
735
1055
  }
736
1056
  var array = new Int8Array(arraySize);
737
- readTo(_this__u8e3s4.n19(), array);
1057
+ readTo(_this__u8e3s4.s1a(), array);
738
1058
  return array;
739
1059
  }
740
1060
  function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
@@ -745,24 +1065,60 @@
745
1065
  checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
746
1066
  var offset = startIndex;
747
1067
  while (offset < endIndex) {
748
- var bytesRead = _this__u8e3s4.d1a(sink, offset, endIndex);
1068
+ var bytesRead = _this__u8e3s4.q1b(sink, offset, endIndex);
749
1069
  if (bytesRead === -1) {
750
1070
  throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
751
1071
  }
752
1072
  offset = offset + bytesRead | 0;
753
1073
  }
754
1074
  }
755
- function readString(_this__u8e3s4) {
756
- var req = new Long(8192, 0);
757
- while (_this__u8e3s4.q19(req)) {
758
- // Inline function 'kotlin.Long.times' call
759
- req = req.w2(toLong(2));
1075
+ function readByteArray_0(_this__u8e3s4, byteCount) {
1076
+ // Inline function 'kotlinx.io.checkByteCount' call
1077
+ var byteCount_0 = toLong(byteCount);
1078
+ // Inline function 'kotlin.require' call
1079
+ // Inline function 'kotlin.contracts.contract' call
1080
+ if (!(byteCount_0.e1(new Long(0, 0)) >= 0)) {
1081
+ // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
1082
+ var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
1083
+ throw IllegalArgumentException_init_$Create$(toString(message));
760
1084
  }
761
- return commonReadUtf8(_this__u8e3s4.n19(), _this__u8e3s4.n19().m());
1085
+ return readByteArrayImpl(_this__u8e3s4, byteCount);
1086
+ }
1087
+ function readString(_this__u8e3s4) {
1088
+ _this__u8e3s4.v1a(new Long(-1, 2147483647));
1089
+ return commonReadUtf8(_this__u8e3s4.s1a(), _this__u8e3s4.s1a().s());
762
1090
  }
763
1091
  function readString_0(_this__u8e3s4, byteCount) {
764
- _this__u8e3s4.p19(byteCount);
765
- return commonReadUtf8(_this__u8e3s4.n19(), byteCount);
1092
+ _this__u8e3s4.u1a(byteCount);
1093
+ return commonReadUtf8(_this__u8e3s4.s1a(), byteCount);
1094
+ }
1095
+ function commonReadUtf8(_this__u8e3s4, byteCount) {
1096
+ if (byteCount.equals(new Long(0, 0)))
1097
+ return '';
1098
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
1099
+ var curr = _this__u8e3s4.p1a_1;
1100
+ while (!(curr == null)) {
1101
+ // Inline function 'kotlinx.io.commonReadUtf8.<anonymous>' call
1102
+ get_SegmentReadContextImpl();
1103
+ if (toLong(curr.e1b()).e1(byteCount) >= 0) {
1104
+ var result = '';
1105
+ // Inline function 'kotlinx.io.unsafe.withData' call
1106
+ // Inline function 'kotlinx.io.commonReadUtf8.<anonymous>.<anonymous>' call
1107
+ var data = curr.h1d(true);
1108
+ var pos = curr.y1a_1;
1109
+ // Inline function 'kotlin.math.min' call
1110
+ var a = curr.z1a_1;
1111
+ var b = pos + byteCount.j1() | 0;
1112
+ var tmp$ret$0 = Math.min(a, b);
1113
+ result = commonToUtf8String(data, pos, tmp$ret$0);
1114
+ _this__u8e3s4.p1b(byteCount);
1115
+ return result;
1116
+ }
1117
+ return commonToUtf8String(readByteArray_0(_this__u8e3s4, byteCount.j1()));
1118
+ }
1119
+ // Inline function 'kotlin.error' call
1120
+ var message = 'Unreacheable';
1121
+ throw IllegalStateException_init_$Create$(toString(message));
766
1122
  }
767
1123
  function writeString(_this__u8e3s4, string, startIndex, endIndex) {
768
1124
  startIndex = startIndex === VOID ? 0 : startIndex;
@@ -773,7 +1129,7 @@
773
1129
  // Inline function 'kotlinx.io.writeToInternalBuffer' call
774
1130
  // Inline function 'kotlinx.io.writeString.<anonymous>' call
775
1131
  // Inline function 'kotlinx.io.commonWriteUtf8' call
776
- var this_0 = _this__u8e3s4.n19();
1132
+ var this_0 = _this__u8e3s4.s1a();
777
1133
  var i = startIndex;
778
1134
  while (i < endIndex) {
779
1135
  // Inline function 'kotlin.code' call
@@ -781,95 +1137,173 @@
781
1137
  var this_1 = charSequenceGet(string, p0);
782
1138
  var c = Char__toInt_impl_vasixd(this_1);
783
1139
  if (c < 128) {
784
- var tail = this_0.i1a(1);
785
- var data = tail.s19_1;
786
- var segmentOffset = tail.u19_1 - i | 0;
787
- // Inline function 'kotlin.comparisons.minOf' call
788
- var b = 8192 - segmentOffset | 0;
789
- var runLimit = Math.min(endIndex, b);
790
- var _unary__edvuaz = i;
791
- i = _unary__edvuaz + 1 | 0;
792
- data[segmentOffset + _unary__edvuaz | 0] = toByte(c);
793
- $l$loop: while (i < runLimit) {
794
- // Inline function 'kotlin.code' call
795
- var p0_0 = i;
796
- var this_2 = charSequenceGet(string, p0_0);
797
- c = Char__toInt_impl_vasixd(this_2);
798
- if (c >= 128)
799
- break $l$loop;
800
- var _unary__edvuaz_0 = i;
801
- i = _unary__edvuaz_0 + 1 | 0;
802
- data[segmentOffset + _unary__edvuaz_0 | 0] = toByte(c);
1140
+ $l$block_0: {
1141
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1142
+ var tail = this_0.x1b(1);
1143
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
1144
+ var ctx = get_SegmentWriteContextImpl();
1145
+ var segmentOffset = -i | 0;
1146
+ // Inline function 'kotlin.comparisons.minOf' call
1147
+ var b = i + tail.c1c() | 0;
1148
+ var runLimit = Math.min(endIndex, b);
1149
+ var _unary__edvuaz = i;
1150
+ i = _unary__edvuaz + 1 | 0;
1151
+ ctx.q1d(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
1152
+ $l$loop: while (i < runLimit) {
1153
+ // Inline function 'kotlin.code' call
1154
+ var p0_0 = i;
1155
+ var this_2 = charSequenceGet(string, p0_0);
1156
+ c = Char__toInt_impl_vasixd(this_2);
1157
+ if (c >= 128)
1158
+ break $l$loop;
1159
+ var _unary__edvuaz_0 = i;
1160
+ i = _unary__edvuaz_0 + 1 | 0;
1161
+ ctx.q1d(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
1162
+ }
1163
+ var bytesWritten = i + segmentOffset | 0;
1164
+ if (bytesWritten === 1) {
1165
+ tail.z1a_1 = tail.z1a_1 + bytesWritten | 0;
1166
+ var tmp = this_0;
1167
+ // Inline function 'kotlin.Long.plus' call
1168
+ tmp.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten));
1169
+ break $l$block_0;
1170
+ }
1171
+ // Inline function 'kotlin.check' call
1172
+ // Inline function 'kotlin.contracts.contract' call
1173
+ if (!(0 <= bytesWritten ? bytesWritten <= tail.c1c() : false)) {
1174
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
1175
+ var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.c1c();
1176
+ throw IllegalStateException_init_$Create$(toString(message));
1177
+ }
1178
+ if (!(bytesWritten === 0)) {
1179
+ tail.z1a_1 = tail.z1a_1 + bytesWritten | 0;
1180
+ var tmp_0 = this_0;
1181
+ // Inline function 'kotlin.Long.plus' call
1182
+ tmp_0.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten));
1183
+ break $l$block_0;
1184
+ }
1185
+ if (isEmpty(tail)) {
1186
+ this_0.r1c();
1187
+ }
803
1188
  }
804
- var runSize = (i + segmentOffset | 0) - tail.u19_1 | 0;
805
- tail.u19_1 = tail.u19_1 + runSize | 0;
806
- this_0.l19_1 = this_0.l19_1.u2(toLong(runSize));
807
1189
  } else if (c < 2048) {
808
- var tail_0 = this_0.i1a(2);
809
- tail_0.s19_1[tail_0.u19_1] = toByte(c >> 6 | 192);
810
- tail_0.s19_1[tail_0.u19_1 + 1 | 0] = toByte(c & 63 | 128);
811
- tail_0.u19_1 = tail_0.u19_1 + 2 | 0;
812
- this_0.l19_1 = this_0.l19_1.u2(new Long(2, 0));
1190
+ $l$block_2: {
1191
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1192
+ var tail_0 = this_0.x1b(2);
1193
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
1194
+ get_SegmentWriteContextImpl().p1d(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
1195
+ var bytesWritten_0 = 2;
1196
+ if (bytesWritten_0 === 2) {
1197
+ tail_0.z1a_1 = tail_0.z1a_1 + bytesWritten_0 | 0;
1198
+ var tmp_1 = this_0;
1199
+ // Inline function 'kotlin.Long.plus' call
1200
+ tmp_1.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten_0));
1201
+ break $l$block_2;
1202
+ }
1203
+ // Inline function 'kotlin.check' call
1204
+ // Inline function 'kotlin.contracts.contract' call
1205
+ if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.c1c() : false)) {
1206
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
1207
+ var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.c1c();
1208
+ throw IllegalStateException_init_$Create$(toString(message_0));
1209
+ }
1210
+ if (!(bytesWritten_0 === 0)) {
1211
+ tail_0.z1a_1 = tail_0.z1a_1 + bytesWritten_0 | 0;
1212
+ var tmp_2 = this_0;
1213
+ // Inline function 'kotlin.Long.plus' call
1214
+ tmp_2.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten_0));
1215
+ break $l$block_2;
1216
+ }
1217
+ if (isEmpty(tail_0)) {
1218
+ this_0.r1c();
1219
+ }
1220
+ }
813
1221
  i = i + 1 | 0;
814
1222
  } else if (c < 55296 || c > 57343) {
815
- var tail_1 = this_0.i1a(3);
816
- tail_1.s19_1[tail_1.u19_1] = toByte(c >> 12 | 224);
817
- tail_1.s19_1[tail_1.u19_1 + 1 | 0] = toByte(c >> 6 & 63 | 128);
818
- tail_1.s19_1[tail_1.u19_1 + 2 | 0] = toByte(c & 63 | 128);
819
- tail_1.u19_1 = tail_1.u19_1 + 3 | 0;
820
- this_0.l19_1 = this_0.l19_1.u2(new Long(3, 0));
1223
+ $l$block_4: {
1224
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1225
+ var tail_1 = this_0.x1b(3);
1226
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
1227
+ get_SegmentWriteContextImpl().o1d(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
1228
+ var bytesWritten_1 = 3;
1229
+ if (bytesWritten_1 === 3) {
1230
+ tail_1.z1a_1 = tail_1.z1a_1 + bytesWritten_1 | 0;
1231
+ var tmp_3 = this_0;
1232
+ // Inline function 'kotlin.Long.plus' call
1233
+ tmp_3.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten_1));
1234
+ break $l$block_4;
1235
+ }
1236
+ // Inline function 'kotlin.check' call
1237
+ // Inline function 'kotlin.contracts.contract' call
1238
+ if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.c1c() : false)) {
1239
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
1240
+ var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.c1c();
1241
+ throw IllegalStateException_init_$Create$(toString(message_1));
1242
+ }
1243
+ if (!(bytesWritten_1 === 0)) {
1244
+ tail_1.z1a_1 = tail_1.z1a_1 + bytesWritten_1 | 0;
1245
+ var tmp_4 = this_0;
1246
+ // Inline function 'kotlin.Long.plus' call
1247
+ tmp_4.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten_1));
1248
+ break $l$block_4;
1249
+ }
1250
+ if (isEmpty(tail_1)) {
1251
+ this_0.r1c();
1252
+ }
1253
+ }
821
1254
  i = i + 1 | 0;
822
1255
  } else {
823
- var tmp;
1256
+ var tmp_5;
824
1257
  if ((i + 1 | 0) < endIndex) {
825
1258
  // Inline function 'kotlin.code' call
826
1259
  var p0_1 = i + 1 | 0;
827
1260
  var this_3 = charSequenceGet(string, p0_1);
828
- tmp = Char__toInt_impl_vasixd(this_3);
1261
+ tmp_5 = Char__toInt_impl_vasixd(this_3);
829
1262
  } else {
830
- tmp = 0;
1263
+ tmp_5 = 0;
831
1264
  }
832
- var low = tmp;
1265
+ var low = tmp_5;
833
1266
  if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
834
- this_0.w1a(63);
1267
+ this_0.k1c(63);
835
1268
  i = i + 1 | 0;
836
1269
  } else {
837
1270
  var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
838
- var tail_2 = this_0.i1a(4);
839
- tail_2.s19_1[tail_2.u19_1] = toByte(codePoint >> 18 | 240);
840
- tail_2.s19_1[tail_2.u19_1 + 1 | 0] = toByte(codePoint >> 12 & 63 | 128);
841
- tail_2.s19_1[tail_2.u19_1 + 2 | 0] = toByte(codePoint >> 6 & 63 | 128);
842
- tail_2.s19_1[tail_2.u19_1 + 3 | 0] = toByte(codePoint & 63 | 128);
843
- tail_2.u19_1 = tail_2.u19_1 + 4 | 0;
844
- this_0.l19_1 = this_0.l19_1.u2(new Long(4, 0));
1271
+ $l$block_6: {
1272
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1273
+ var tail_2 = this_0.x1b(4);
1274
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
1275
+ get_SegmentWriteContextImpl().n1d(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
1276
+ var bytesWritten_2 = 4;
1277
+ if (bytesWritten_2 === 4) {
1278
+ tail_2.z1a_1 = tail_2.z1a_1 + bytesWritten_2 | 0;
1279
+ var tmp_6 = this_0;
1280
+ // Inline function 'kotlin.Long.plus' call
1281
+ tmp_6.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten_2));
1282
+ break $l$block_6;
1283
+ }
1284
+ // Inline function 'kotlin.check' call
1285
+ // Inline function 'kotlin.contracts.contract' call
1286
+ if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.c1c() : false)) {
1287
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
1288
+ var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.c1c();
1289
+ throw IllegalStateException_init_$Create$(toString(message_2));
1290
+ }
1291
+ if (!(bytesWritten_2 === 0)) {
1292
+ tail_2.z1a_1 = tail_2.z1a_1 + bytesWritten_2 | 0;
1293
+ var tmp_7 = this_0;
1294
+ // Inline function 'kotlin.Long.plus' call
1295
+ tmp_7.r1a_1 = this_0.r1a_1.z2(toLong(bytesWritten_2));
1296
+ break $l$block_6;
1297
+ }
1298
+ if (isEmpty(tail_2)) {
1299
+ this_0.r1c();
1300
+ }
1301
+ }
845
1302
  i = i + 2 | 0;
846
1303
  }
847
1304
  }
848
1305
  }
849
- _this__u8e3s4.b1a();
850
- }
851
- function commonReadUtf8(_this__u8e3s4, byteCount) {
852
- // Inline function 'kotlin.require' call
853
- // Inline function 'kotlin.contracts.contract' call
854
- if (!(byteCount.z(new Long(0, 0)) >= 0 && byteCount.z(new Long(2147483647, 0)) <= 0)) {
855
- // Inline function 'kotlinx.io.commonReadUtf8.<anonymous>' call
856
- var message = 'byteCount (' + byteCount.toString() + ') is not within the range [0..2147483647)';
857
- throw IllegalArgumentException_init_$Create$(toString(message));
858
- }
859
- _this__u8e3s4.p19(byteCount);
860
- if (byteCount.equals(new Long(0, 0)))
861
- return '';
862
- var s = ensureNotNull(_this__u8e3s4.j19_1);
863
- if (numberToLong(s.t19_1).u2(byteCount).z(toLong(s.u19_1)) > 0) {
864
- return commonToUtf8String(readByteArray_0(_this__u8e3s4, byteCount.e1()));
865
- }
866
- var result = commonToUtf8String(s.s19_1, s.t19_1, s.t19_1 + byteCount.e1() | 0);
867
- s.t19_1 = s.t19_1 + byteCount.e1() | 0;
868
- _this__u8e3s4.l19_1 = _this__u8e3s4.l19_1.v2(byteCount);
869
- if (s.t19_1 === s.u19_1) {
870
- _this__u8e3s4.z19();
871
- }
872
- return result;
1306
+ _this__u8e3s4.j1b();
873
1307
  }
874
1308
  function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
875
1309
  beginIndex = beginIndex === VOID ? 0 : beginIndex;
@@ -1232,6 +1666,56 @@
1232
1666
  }
1233
1667
  return concatToString(chars, 0, length);
1234
1668
  }
1669
+ function get_SegmentReadContextImpl() {
1670
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1671
+ return SegmentReadContextImpl;
1672
+ }
1673
+ var SegmentReadContextImpl;
1674
+ function get_SegmentWriteContextImpl() {
1675
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1676
+ return SegmentWriteContextImpl;
1677
+ }
1678
+ var SegmentWriteContextImpl;
1679
+ var BufferIterationContextImpl;
1680
+ function UnsafeBufferOperations() {
1681
+ }
1682
+ var UnsafeBufferOperations_instance;
1683
+ function UnsafeBufferOperations_getInstance() {
1684
+ return UnsafeBufferOperations_instance;
1685
+ }
1686
+ function SegmentReadContextImpl$1() {
1687
+ }
1688
+ protoOf(SegmentReadContextImpl$1).p1c = function (segment, offset) {
1689
+ return segment.i1d(offset);
1690
+ };
1691
+ function SegmentWriteContextImpl$1() {
1692
+ }
1693
+ protoOf(SegmentWriteContextImpl$1).q1d = function (segment, offset, value) {
1694
+ segment.j1d(offset, value);
1695
+ };
1696
+ protoOf(SegmentWriteContextImpl$1).p1d = function (segment, offset, b0, b1) {
1697
+ segment.k1d(offset, b0, b1);
1698
+ };
1699
+ protoOf(SegmentWriteContextImpl$1).o1d = function (segment, offset, b0, b1, b2) {
1700
+ segment.l1d(offset, b0, b1, b2);
1701
+ };
1702
+ protoOf(SegmentWriteContextImpl$1).n1d = function (segment, offset, b0, b1, b2, b3) {
1703
+ segment.m1d(offset, b0, b1, b2, b3);
1704
+ };
1705
+ function BufferIterationContextImpl$1() {
1706
+ }
1707
+ protoOf(BufferIterationContextImpl$1).p1c = function (segment, offset) {
1708
+ return get_SegmentReadContextImpl().p1c(segment, offset);
1709
+ };
1710
+ var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
1711
+ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
1712
+ if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
1713
+ properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
1714
+ SegmentReadContextImpl = new SegmentReadContextImpl$1();
1715
+ SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
1716
+ BufferIterationContextImpl = new BufferIterationContextImpl$1();
1717
+ }
1718
+ }
1235
1719
  function IOException_init_$Init$($this) {
1236
1720
  Exception_init_$Init$($this);
1237
1721
  IOException.call($this);
@@ -1289,15 +1773,15 @@
1289
1773
  captureStack(this, EOFException);
1290
1774
  }
1291
1775
  function SegmentPool() {
1292
- this.j1a_1 = 0;
1293
- this.k1a_1 = 0;
1776
+ this.y1b_1 = 0;
1777
+ this.z1b_1 = 0;
1294
1778
  }
1295
- protoOf(SegmentPool).l1a = function () {
1296
- return Companion_instance.e1b();
1779
+ protoOf(SegmentPool).a1c = function () {
1780
+ return Companion_instance.d1d();
1297
1781
  };
1298
- protoOf(SegmentPool).b1b = function (segment) {
1782
+ protoOf(SegmentPool).q1c = function (segment) {
1299
1783
  };
1300
- protoOf(SegmentPool).g1b = function () {
1784
+ protoOf(SegmentPool).f1d = function () {
1301
1785
  return AlwaysSharedCopyTracker_getInstance();
1302
1786
  };
1303
1787
  var SegmentPool_instance;
@@ -1305,10 +1789,11 @@
1305
1789
  return SegmentPool_instance;
1306
1790
  }
1307
1791
  //region block: post-declaration
1308
- protoOf(Buffer).o1a = write$default;
1792
+ protoOf(Buffer).e1c = write$default;
1309
1793
  //endregion
1310
1794
  //region block: init
1311
1795
  Companion_instance = new Companion();
1796
+ UnsafeBufferOperations_instance = new UnsafeBufferOperations();
1312
1797
  SegmentPool_instance = new SegmentPool();
1313
1798
  //endregion
1314
1799
  //region block: exports