import {
  VOID3gxj6tk5isa35 as VOID,
  protoOf180f3jzyo7rfj as protoOf,
  initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
  Unit_instancev9v8hjid95df as Unit_instance,
  toString1pkumu07cwy4m as toString,
  IllegalArgumentException_init_$Create$i4126l9nkbuo as IllegalArgumentException_init_$Create$,
  abs1kdzbjes1idip as abs,
  StringBuilder_init_$Create$3ds9zx2kx9u4d as StringBuilder_init_$Create$,
  CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl,
  THROW_CCE2g6jy02ryeudk as THROW_CCE,
  SequenceScope1coiso86pqzq2 as SequenceScope,
  get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED,
  initMetadataForLambda3af3he42mmnh as initMetadataForLambda,
  ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$,
  sequence2vgswtrxvqoa7 as sequence,
  fill2542d4m9l93pn as fill,
  isIntArrayeijsubfngq38 as isIntArray,
  _Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
  endsWith1a79dp5rc3sfv as endsWith,
  charSequenceLength3278n89t01tmv as charSequenceLength,
  charSequenceGet1vxk1y5n17t1z as charSequenceGet,
  Char19o2r8palgjof as Char,
  Char__compareTo_impl_ypi4mb28h1l6umahrlb as Char__compareTo_impl_ypi4mb,
  contains2el4s70rdq4ld as contains,
  charSequenceSubSequence1iwpdba8s3jc7 as charSequenceSubSequence,
  Char__toInt_impl_vasixdnyockrdnmht5 as Char__toInt_impl_vasixd,
  IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
  IllegalStateException_init_$Init$22echgkfx1r7y as IllegalStateException_init_$Init$,
  captureStack1fzi4aczwc4hg as captureStack,
  IllegalStateException_init_$Create$1h4bcfod21ri0 as IllegalStateException_init_$Create$,
  initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
  setOf45ia9pnfhe90 as setOf,
  listOf1jh22dvmctj1r as listOf,
  toString1h6jjoch8cjt8 as toString_0,
  toByte4i43936u611k as toByte,
  copyOfRange3alro60z4hhf8 as copyOfRange,
  startsWith641pyr7vf687 as startsWith,
  isInterface3d6p8outrmvmk as isInterface,
  CancellationException_init_$Create$3rqo8z2i1rbfw as CancellationException_init_$Create$,
  subtract2orl8z9upxd9l as subtract,
  convertToInty04h231mmjoh as convertToInt,
  add2suhfggl4zvkk as add,
  fromInt2ii0rejb1w62w as fromInt,
  LinkedHashMap_init_$Create$2tibire69n089 as LinkedHashMap_init_$Create$,
  compareTo3ankvs086tmwq as compareTo,
  NoSuchElementException_init_$Create$2qpmbgrjh4thr as NoSuchElementException_init_$Create$,
  Collection1k04j3hzsbod0 as Collection,
  emptyList1g2z5xcrvp2zy as emptyList,
  initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
  ensureNotNull1e947j3ixpazm as ensureNotNull,
  StringBuilder_init_$Create$3pdhqn0ol6juo as StringBuilder_init_$Create$_0,
  isCharSequence1ju9jr1w86plq as isCharSequence,
  getStringHashCode26igk1bx568vk as getStringHashCode,
  CharSequence1ceii1xorfwh7 as CharSequence,
  IndexOutOfBoundsException_init_$Create$3tkfni2s7f1n7 as IndexOutOfBoundsException_init_$Create$,
  charArray2ujmm1qusno00 as charArray,
  shiftLeft3tsh2sstjchzn as shiftLeft,
  NumberFormatException_init_$Create$1frrsjd61hhze as NumberFormatException_init_$Create$,
  toString22rbkbhdb5cl2 as toString_1,
  charCodeAt1yspne1d8erbm as charCodeAt,
  numberRangeToNumber25vse2rgp6rs8 as numberRangeToNumber,
  collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
  ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$_0,
  numberToLong2pakxeg38estk as numberToLong,
  toLongArray23ixicpzp5r3w as toLongArray,
  Char__plus_impl_qi7pgjft9ii3h59tnw as Char__plus_impl_qi7pgj,
  Char__minus_impl_a2frrh3s4vevfuhhke4 as Char__minus_impl_a2frrh,
  toByteArray3caw0hip00os as toByteArray,
  isWhitespace25occ8z1ed1s9 as isWhitespace,
} from './kotlin-kotlin-stdlib.mjs';
import {
  MultiPartData57syw40llxls as MultiPartData,
  MultiPart_getInstance1qrv90sa9uvz5 as MultiPart_getInstance,
  Companion_getInstance13wwf84j92s7c as Companion_getInstance,
} from './ktor-ktor-http.mjs';
import {
  CoroutineScopefcb5f5dwqcas as CoroutineScope,
  produce1iljho2c8bp6o as produce,
  ProducerScopeb3mmhvfa6ll7 as ProducerScope,
  CompletableDeferred2lnqvsbvx74d3 as CompletableDeferred,
} from './kotlinx-coroutines-core.mjs';
import {
  DefaultPool2gb1fm4epwgu9 as DefaultPool,
  readLineStrictTo1xxmy01uq4bp as readLineStrictTo,
  Companion_getInstanceu6i25dezdn6m as Companion_getInstance_0,
  LineEndingMode__plus_impl_ttpz2jpqrbpe81vmkf as LineEndingMode__plus_impl_ttpz2j,
  readUntil3qqal0dj72fys as readUntil,
  WriterScope3b0bo1enaee6b as WriterScope,
  counted3iniv3aql3f9n as counted,
  writer1eia5its2a1fh as writer,
  readRemaining1u8soafhjma7y as readRemaining,
  get_remaining1lapv95kcmm0y as get_remaining,
  skipIfFound34xzbgurmhd09 as skipIfFound,
  ByteChannel3cxdguezl3lu7 as ByteChannel,
  close3semq7pafb42g as close,
  readPacket1qzyfym3sry67 as readPacket,
  copyTo2si6ixg3c5rjz as copyTo,
  toByteArray1i3ns5jnoqlv6 as toByteArray_0,
  NoPoolImplgos9n8jphzjp as NoPoolImpl,
} from './ktor-ktor-io.mjs';
import {
  ByteString_init_$Create$qzlxiaby0679 as ByteString_init_$Create$,
  ByteString3c9fk8lsh3lvs as ByteString,
} from './kotlinx-io-kotlinx-io-bytestring.mjs';
import {
  IOException_init_$Create$1sfdrtkx2q59o as IOException_init_$Create$,
  EOFException_init_$Create$1bfeevmh0hfbn as EOFException_init_$Create$,
  IOException1wyutdmfe71nu as IOException,
  IOException_init_$Init$2t3b4cq5mf3nb as IOException_init_$Init$,
} from './kotlinx-io-kotlinx-io-core.mjs';
//region block: imports
var imul = Math.imul;
//endregion
//region block: pre-declaration
initMetadataForClass(CIOMultipartDataBase, 'CIOMultipartDataBase', VOID, VOID, [MultiPartData, CoroutineScope], [0, 1]);
initMetadataForClass(HttpHeadersMap, 'HttpHeadersMap');
initMetadataForLambda(HeadersData$headersStarts$slambda, CoroutineImpl, VOID, [1]);
initMetadataForClass(HeadersData, 'HeadersData', HeadersData);
initMetadataForClass(IntArrayPool$1, VOID, VOID, DefaultPool);
initMetadataForClass(HeadersDataPool$1, VOID, VOID, DefaultPool);
initMetadataForClass(ParserException, 'ParserException', VOID, IllegalStateException);
initMetadataForCoroutine($parseHeadersCOROUTINE$, CoroutineImpl);
initMetadataForClass(MultipartEvent, 'MultipartEvent');
initMetadataForClass(Preamble, 'Preamble', VOID, MultipartEvent);
initMetadataForClass(MultipartPart, 'MultipartPart', VOID, MultipartEvent);
initMetadataForClass(Epilogue, 'Epilogue', VOID, MultipartEvent);
initMetadataForLambda(parseMultipart$slambda$slambda, CoroutineImpl, VOID, [1]);
initMetadataForLambda(parseMultipart$slambda, CoroutineImpl, VOID, [1]);
initMetadataForCoroutine($parsePartHeadersImplCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($parsePartBodyImplCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($skipIfFoundReadCountCOROUTINE$, CoroutineImpl);
initMetadataForClass(Node, 'Node');
initMetadataForCompanion(Companion);
initMetadataForClass(AsciiCharTree, 'AsciiCharTree');
initMetadataForClass(SubSequenceImpl, 'SubSequenceImpl', VOID, VOID, [CharSequence]);
initMetadataForClass(CharArrayBuilder, 'CharArrayBuilder', CharArrayBuilder, VOID, [CharSequence]);
initMetadataForClass(CharArrayPool$1, VOID, VOID, NoPoolImpl);
initMetadataForClass(CharArrayPool$2, VOID, VOID, DefaultPool);
initMetadataForClass(UnsupportedMediaTypeExceptionCIO, 'UnsupportedMediaTypeExceptionCIO', VOID, IOException);
initMetadataForClass(MutableRange, 'MutableRange');
//endregion
function CIOMultipartDataBase(coroutineContext, channel, contentType, contentLength, formFieldLimit) {
  formFieldLimit = formFieldLimit === VOID ? 65536n : formFieldLimit;
  this.h2w_1 = coroutineContext;
  this.i2w_1 = null;
  this.j2w_1 = parseMultipart(this, channel, contentType, contentLength, formFieldLimit);
}
protoOf(CIOMultipartDataBase).ur = function () {
  return this.h2w_1;
};
function get_IntArrayPool() {
  _init_properties_HttpHeadersMap_kt__hwatby();
  return IntArrayPool;
}
var IntArrayPool;
function get_HeadersDataPool() {
  _init_properties_HttpHeadersMap_kt__hwatby();
  return HeadersDataPool;
}
var HeadersDataPool;
function thresholdReached($this) {
  return $this.l2w_1 >= $this.m2w_1 * 0.75;
}
function resize($this) {
  var prevSize = $this.l2w_1;
  var prevData = $this.n2w_1;
  $this.l2w_1 = 0;
  $this.m2w_1 = imul($this.m2w_1, 2) | 128;
  var tmp = $this;
  // Inline function 'kotlin.apply' call
  var this_0 = get_HeadersDataPool().d1r();
  this_0.q2w(imul(prevData.p2w(), 2) | 1);
  tmp.n2w_1 = this_0;
  var _iterator__ex2g4s = prevData.r2w().t();
  while (_iterator__ex2g4s.u()) {
    var headerOffset = _iterator__ex2g4s.v();
    $this.t2w(prevData.s2w(headerOffset + 1 | 0), prevData.s2w(headerOffset + 2 | 0), prevData.s2w(headerOffset + 3 | 0), prevData.s2w(headerOffset + 4 | 0));
  }
  get_HeadersDataPool().e1r(prevData);
  // Inline function 'kotlin.require' call
  // Inline function 'kotlin.require' call
  if (!(prevSize === $this.l2w_1)) {
    var message = 'Failed requirement.';
    throw IllegalArgumentException_init_$Create$(toString(message));
  }
}
function headerHasName($this, name, headerOffset) {
  var nameStartIndex = $this.n2w_1.s2w(headerOffset + 1 | 0);
  var nameEndIndex = $this.n2w_1.s2w(headerOffset + 2 | 0);
  return equalsLowerCase($this.k2w_1, nameStartIndex, nameEndIndex, name);
}
function HttpHeadersMap(builder) {
  this.k2w_1 = builder;
  this.l2w_1 = 0;
  this.m2w_1 = 0;
  this.n2w_1 = get_HeadersDataPool().d1r();
}
protoOf(HttpHeadersMap).f2e = function (name) {
  if (this.l2w_1 === 0)
    return null;
  // Inline function 'kotlin.math.absoluteValue' call
  var this_0 = hashCodeLowerCase(name);
  var hash = abs(this_0);
  var headerIndex = hash % this.m2w_1 | 0;
  while (!(this.n2w_1.s2w(imul(headerIndex, 6) + 0 | 0) === -1)) {
    if (headerHasName(this, name, imul(headerIndex, 6))) {
      return this.u2w(imul(headerIndex, 6));
    }
    headerIndex = (headerIndex + 1 | 0) % this.m2w_1 | 0;
  }
  return null;
};
protoOf(HttpHeadersMap).v2w = function () {
  return this.n2w_1.r2w();
};
protoOf(HttpHeadersMap).t2w = function (nameStartIndex, nameEndIndex, valueStartIndex, valueEndIndex) {
  if (thresholdReached(this)) {
    resize(this);
  }
  // Inline function 'kotlin.math.absoluteValue' call
  var this_0 = hashCodeLowerCase(this.k2w_1, nameStartIndex, nameEndIndex);
  var hash = abs(this_0);
  var name = this.k2w_1.c(nameStartIndex, nameEndIndex);
  var headerIndex = hash % this.m2w_1 | 0;
  var sameNameHeaderIndex = -1;
  while (!(this.n2w_1.s2w(imul(headerIndex, 6) + 0 | 0) === -1)) {
    if (headerHasName(this, name, imul(headerIndex, 6))) {
      sameNameHeaderIndex = headerIndex;
    }
    headerIndex = (headerIndex + 1 | 0) % this.m2w_1 | 0;
  }
  var headerOffset = imul(headerIndex, 6);
  this.n2w_1.d2x(headerOffset + 0 | 0, hash);
  this.n2w_1.d2x(headerOffset + 1 | 0, nameStartIndex);
  this.n2w_1.d2x(headerOffset + 2 | 0, nameEndIndex);
  this.n2w_1.d2x(headerOffset + 3 | 0, valueStartIndex);
  this.n2w_1.d2x(headerOffset + 4 | 0, valueEndIndex);
  this.n2w_1.d2x(headerOffset + 5 | 0, -1);
  if (!(sameNameHeaderIndex === -1)) {
    this.n2w_1.d2x(imul(sameNameHeaderIndex, 6) + 5 | 0, headerIndex);
  }
  this.l2w_1 = this.l2w_1 + 1 | 0;
};
protoOf(HttpHeadersMap).e2x = function (headerOffset) {
  var nameStartIndex = this.n2w_1.s2w(headerOffset + 1 | 0);
  var nameEndIndex = this.n2w_1.s2w(headerOffset + 2 | 0);
  return this.k2w_1.c(nameStartIndex, nameEndIndex);
};
protoOf(HttpHeadersMap).u2w = function (headerOffset) {
  var valueStartIndex = this.n2w_1.s2w(headerOffset + 3 | 0);
  var valueEndIndex = this.n2w_1.s2w(headerOffset + 4 | 0);
  return this.k2w_1.c(valueStartIndex, valueEndIndex);
};
protoOf(HttpHeadersMap).f2x = function () {
  this.l2w_1 = 0;
  this.m2w_1 = 0;
  get_HeadersDataPool().e1r(this.n2w_1);
  this.n2w_1 = get_HeadersDataPool().d1r();
};
protoOf(HttpHeadersMap).toString = function () {
  // Inline function 'kotlin.text.buildString' call
  // Inline function 'kotlin.apply' call
  var this_0 = StringBuilder_init_$Create$();
  dumpTo(this, '', this_0);
  return this_0.toString();
};
function HeadersData$headersStarts$slambda(this$0, resultContinuation) {
  this.o2x_1 = this$0;
  CoroutineImpl.call(this, resultContinuation);
}
protoOf(HeadersData$headersStarts$slambda).u2x = function ($this$sequence, $completion) {
  var tmp = this.v2x($this$sequence, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
};
protoOf(HeadersData$headersStarts$slambda).d9 = function (p1, $completion) {
  return this.u2x(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
};
protoOf(HeadersData$headersStarts$slambda).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 7;
          this.q2x_1 = 0;
          this.t2x_1 = this.o2x_1.o2w_1.t();
          this.j8_1 = 1;
          continue $sm;
        case 1:
          if (!this.t2x_1.u()) {
            this.j8_1 = 6;
            continue $sm;
          }

          this.s2x_1 = this.t2x_1.v();
          this.r2x_1 = 0;
          this.j8_1 = 2;
          continue $sm;
        case 2:
          if (!(this.r2x_1 < this.s2x_1.length)) {
            this.j8_1 = 5;
            continue $sm;
          }

          if (!(this.o2x_1.s2w(this.q2x_1 + 0 | 0) === -1)) {
            this.j8_1 = 3;
            suspendResult = this.p2x_1.te(this.q2x_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }
            continue $sm;
          } else {
            this.j8_1 = 4;
            continue $sm;
          }

        case 3:
          this.j8_1 = 4;
          continue $sm;
        case 4:
          this.r2x_1 = this.r2x_1 + 6 | 0;
          this.q2x_1 = this.q2x_1 + 6 | 0;
          this.j8_1 = 2;
          continue $sm;
        case 5:
          this.j8_1 = 1;
          continue $sm;
        case 6:
          return Unit_instance;
        case 7:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 7) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
protoOf(HeadersData$headersStarts$slambda).v2x = function ($this$sequence, completion) {
  var i = new HeadersData$headersStarts$slambda(this.o2x_1, completion);
  i.p2x_1 = $this$sequence;
  return i;
};
function HeadersData$headersStarts$slambda_0(this$0, resultContinuation) {
  var i = new HeadersData$headersStarts$slambda(this$0, resultContinuation);
  var l = function ($this$sequence, $completion) {
    return i.u2x($this$sequence, $completion);
  };
  l.$arity = 1;
  return l;
}
function HeadersData() {
  var tmp = this;
  // Inline function 'kotlin.collections.mutableListOf' call
  tmp.o2w_1 = ArrayList_init_$Create$();
}
protoOf(HeadersData).p2w = function () {
  return this.o2w_1.g1();
};
protoOf(HeadersData).q2w = function (subArraysCount) {
  // Inline function 'kotlin.repeat' call
  var inductionVariable = 0;
  if (inductionVariable < subArraysCount)
    do {
      var index = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      this.o2w_1.e1(get_IntArrayPool().d1r());
    }
     while (inductionVariable < subArraysCount);
};
protoOf(HeadersData).s2w = function (index) {
  return this.o2w_1.h1(index / 768 | 0)[index % 768 | 0];
};
protoOf(HeadersData).d2x = function (index, value) {
  this.o2w_1.h1(index / 768 | 0)[index % 768 | 0] = value;
};
protoOf(HeadersData).r2w = function () {
  return sequence(HeadersData$headersStarts$slambda_0(this, null));
};
protoOf(HeadersData).f2x = function () {
  var _iterator__ex2g4s = this.o2w_1.t();
  while (_iterator__ex2g4s.u()) {
    var array = _iterator__ex2g4s.v();
    get_IntArrayPool().e1r(array);
  }
  this.o2w_1.n2();
};
function dumpTo(_this__u8e3s4, indent, out) {
  _init_properties_HttpHeadersMap_kt__hwatby();
  var _iterator__ex2g4s = _this__u8e3s4.v2w().t();
  while (_iterator__ex2g4s.u()) {
    var offset = _iterator__ex2g4s.v();
    out.f1(indent);
    out.f1(_this__u8e3s4.e2x(offset));
    out.f1(' => ');
    out.f1(_this__u8e3s4.u2w(offset));
    out.f1('\n');
  }
}
function IntArrayPool$1() {
  DefaultPool.call(this, 1000);
}
protoOf(IntArrayPool$1).w1q = function () {
  var tmp = 0;
  var tmp_0 = new Int32Array(768);
  while (tmp < 768) {
    tmp_0[tmp] = -1;
    tmp = tmp + 1 | 0;
  }
  return tmp_0;
};
protoOf(IntArrayPool$1).z2x = function (instance) {
  fill(instance, -1);
  return protoOf(DefaultPool).b1r.call(this, instance);
};
protoOf(IntArrayPool$1).b1r = function (instance) {
  return this.z2x(isIntArray(instance) ? instance : THROW_CCE());
};
function HeadersDataPool$1() {
  DefaultPool.call(this, 1000);
}
protoOf(HeadersDataPool$1).w1q = function () {
  return new HeadersData();
};
protoOf(HeadersDataPool$1).d2y = function (instance) {
  instance.f2x();
  return protoOf(DefaultPool).b1r.call(this, instance);
};
protoOf(HeadersDataPool$1).b1r = function (instance) {
  return this.d2y(instance instanceof HeadersData ? instance : THROW_CCE());
};
var properties_initialized_HttpHeadersMap_kt_kotj4w;
function _init_properties_HttpHeadersMap_kt__hwatby() {
  if (!properties_initialized_HttpHeadersMap_kt_kotj4w) {
    properties_initialized_HttpHeadersMap_kt_kotj4w = true;
    IntArrayPool = new IntArrayPool$1();
    HeadersDataPool = new HeadersDataPool$1();
  }
}
function get_hostForbiddenSymbols() {
  _init_properties_HttpParser_kt__gbdom1();
  return hostForbiddenSymbols;
}
var hostForbiddenSymbols;
var httpLineEndings;
var versions;
function parseHeaders(input, builder, range, $completion) {
  range = range === VOID ? new MutableRange(0, 0) : range;
  var tmp = new $parseHeadersCOROUTINE$(input, builder, range, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
}
function parseHeaderName(text, range) {
  _init_properties_HttpParser_kt__gbdom1();
  var index = range.r2y_1;
  var end = range.s2y_1;
  while (index < end) {
    var ch = text.b(index);
    if (ch === _Char___init__impl__6a9atx(58) && !(index === range.r2y_1)) {
      range.r2y_1 = index + 1 | 0;
      return index;
    }
    if (isDelimiter(ch)) {
      parseHeaderNameFailed(text, index, range.r2y_1, ch);
    }
    index = index + 1 | 0;
  }
  noColonFound(text, range);
}
function parseHeaderValue(text, range) {
  _init_properties_HttpParser_kt__gbdom1();
  var start = range.r2y_1;
  var end = range.s2y_1;
  var index = start;
  index = skipSpacesAndHorizontalTabs(text, index, end);
  if (index >= end) {
    range.r2y_1 = end;
    return Unit_instance;
  }
  var valueStart = index;
  var valueLastIndex = index;
  while (index < end) {
    var ch = text.b(index);
    if (ch !== _Char___init__impl__6a9atx(9) && ch !== _Char___init__impl__6a9atx(32))
      if (ch === _Char___init__impl__6a9atx(13) || ch === _Char___init__impl__6a9atx(10)) {
        characterIsNotAllowed(text, ch);
      } else
        valueLastIndex = index;
    index = index + 1 | 0;
  }
  range.r2y_1 = valueStart;
  range.s2y_1 = valueLastIndex + 1 | 0;
}
function validateHostHeader(host) {
  _init_properties_HttpParser_kt__gbdom1();
  if (endsWith(host, ':')) {
    throw new ParserException("Host header with ':' should contains port: " + toString(host));
  }
  var tmp$ret$0;
  $l$block: {
    // Inline function 'kotlin.text.any' call
    var inductionVariable = 0;
    while (inductionVariable < charSequenceLength(host)) {
      var element = charSequenceGet(host, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      if (get_hostForbiddenSymbols().h2(new Char(element))) {
        tmp$ret$0 = true;
        break $l$block;
      }
    }
    tmp$ret$0 = false;
  }
  if (tmp$ret$0) {
    throw new ParserException('Host cannot contain any of the following symbols: ' + toString(get_hostForbiddenSymbols()));
  }
}
function isDelimiter(ch) {
  _init_properties_HttpParser_kt__gbdom1();
  return Char__compareTo_impl_ypi4mb(ch, _Char___init__impl__6a9atx(32)) <= 0 || contains('"(),/:;<=>?@[\\]{}', ch);
}
function parseHeaderNameFailed(text, index, start, ch) {
  _init_properties_HttpParser_kt__gbdom1();
  if (ch === _Char___init__impl__6a9atx(58)) {
    throw new ParserException('Empty header names are not allowed as per RFC7230.');
  }
  if (index === start) {
    throw new ParserException('Multiline headers via line folding is not supported since it is deprecated as per RFC7230.');
  }
  characterIsNotAllowed(text, ch);
}
function noColonFound(text, range) {
  _init_properties_HttpParser_kt__gbdom1();
  var tmp2 = range.r2y_1;
  // Inline function 'kotlin.text.substring' call
  var endIndex = range.s2y_1;
  var tmp$ret$0 = toString(charSequenceSubSequence(text, tmp2, endIndex));
  throw new ParserException('No colon in HTTP header in ' + tmp$ret$0 + ' in builder: \n' + toString(text));
}
function characterIsNotAllowed(text, ch) {
  _init_properties_HttpParser_kt__gbdom1();
  // Inline function 'kotlin.code' call
  var tmp$ret$0 = Char__toInt_impl_vasixd(ch);
  throw new ParserException('Character with code ' + (tmp$ret$0 & 255) + ' is not allowed in header names, \n' + toString(text));
}
function ParserException(message) {
  IllegalStateException_init_$Init$(message, this);
  captureStack(this, ParserException);
}
function $parseHeadersCOROUTINE$(input, builder, range, resultContinuation) {
  CoroutineImpl.call(this, resultContinuation);
  this.m2y_1 = input;
  this.n2y_1 = builder;
  this.o2y_1 = range;
}
protoOf($parseHeadersCOROUTINE$).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 7;
          this.p2y_1 = new HttpHeadersMap(this.n2y_1);
          this.k8_1 = 6;
          this.j8_1 = 1;
          continue $sm;
        case 1:
          if (!true) {
            this.j8_1 = 5;
            continue $sm;
          }

          this.j8_1 = 2;
          suspendResult = readLineStrictTo(this.m2y_1, this.n2y_1, 8192n, VOID, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 2:
          if (suspendResult === -1n) {
            this.p2y_1.f2x();
            return null;
          } else {
            this.j8_1 = 3;
            continue $sm;
          }

        case 3:
          this.o2y_1.s2y_1 = this.n2y_1.c2x_1;
          this.q2y_1 = this.o2y_1.s2y_1 - this.o2y_1.r2y_1 | 0;
          if (this.q2y_1 === 0) {
            this.j8_1 = 5;
            continue $sm;
          } else {
            this.j8_1 = 4;
            continue $sm;
          }

        case 4:
          if (this.q2y_1 >= 8192) {
            var message = 'Header line length limit exceeded';
            throw IllegalStateException_init_$Create$(toString(message));
          }

          var nameStart = this.o2y_1.r2y_1;
          var nameEnd = parseHeaderName(this.n2y_1, this.o2y_1);
          var headerEnd = this.o2y_1.s2y_1;
          parseHeaderValue(this.n2y_1, this.o2y_1);
          var valueStart = this.o2y_1.r2y_1;
          var valueEnd = this.o2y_1.s2y_1;
          this.o2y_1.r2y_1 = headerEnd;
          this.p2y_1.t2w(nameStart, nameEnd, valueStart, valueEnd);
          this.j8_1 = 1;
          continue $sm;
        case 5:
          var host = this.p2y_1.f2e('Host');
          if (!(host == null)) {
            validateHostHeader(host);
          }

          return this.p2y_1;
        case 6:
          this.k8_1 = 7;
          var tmp_0 = this.m8_1;
          if (tmp_0 instanceof Error) {
            var t = this.m8_1;
            this.p2y_1.f2x();
            throw t;
          } else {
            throw this.m8_1;
          }

        case 7:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 7) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
var properties_initialized_HttpParser_kt_uedryv;
function _init_properties_HttpParser_kt__gbdom1() {
  if (!properties_initialized_HttpParser_kt_uedryv) {
    properties_initialized_HttpParser_kt_uedryv = true;
    hostForbiddenSymbols = setOf([new Char(_Char___init__impl__6a9atx(47)), new Char(_Char___init__impl__6a9atx(63)), new Char(_Char___init__impl__6a9atx(35)), new Char(_Char___init__impl__6a9atx(64))]);
    httpLineEndings = LineEndingMode__plus_impl_ttpz2j(Companion_getInstance_0().i1q_1, Companion_getInstance_0().h1q_1);
    versions = Companion_instance.t2y(listOf(['HTTP/1.0', 'HTTP/1.1']));
  }
}
function get_CrLf() {
  _init_properties_Multipart_kt__ato98a();
  return CrLf;
}
var CrLf;
function get_PrefixString() {
  _init_properties_Multipart_kt__ato98a();
  return PrefixString;
}
var PrefixString;
function Preamble(body) {
  MultipartEvent.call(this);
  this.u2y_1 = body;
}
function MultipartPart(headers, body) {
  MultipartEvent.call(this);
  this.v2y_1 = headers;
  this.w2y_1 = body;
}
function Epilogue(body) {
  MultipartEvent.call(this);
  this.x2y_1 = body;
}
function MultipartEvent() {
}
function parseMultipart(_this__u8e3s4, input, contentType, contentLength, maxPartSize) {
  maxPartSize = maxPartSize === VOID ? 9223372036854775807n : maxPartSize;
  _init_properties_Multipart_kt__ato98a();
  if (!MultiPart_getInstance().t2k(contentType)) {
    throw new UnsupportedMediaTypeExceptionCIO('Failed to parse multipart: Content-Type should be multipart/* but it is ' + toString(contentType));
  }
  var boundaryByteBuffer = parseBoundaryInternal(contentType);
  var boundaryBytes = ByteString_init_$Create$(boundaryByteBuffer);
  return parseMultipart_0(_this__u8e3s4, boundaryBytes, input, contentLength, maxPartSize);
}
function parseBoundaryInternal(contentType) {
  _init_properties_Multipart_kt__ato98a();
  var boundaryParameter = findBoundary(contentType);
  if (boundaryParameter === -1) {
    throw IOException_init_$Create$("Failed to parse multipart: Content-Type's boundary parameter is missing");
  }
  var boundaryStart = boundaryParameter + 9 | 0;
  var boundaryBytes = new Int8Array(74);
  var position = {_v: 0};
  parseBoundaryInternal$put(position, boundaryBytes, 13);
  parseBoundaryInternal$put(position, boundaryBytes, 10);
  parseBoundaryInternal$put(position, boundaryBytes, 45);
  parseBoundaryInternal$put(position, boundaryBytes, 45);
  var state = 0;
  var inductionVariable = boundaryStart;
  var last = charSequenceLength(contentType);
  if (inductionVariable < last)
    loop: do {
      var i = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      var ch = charSequenceGet(contentType, i);
      // Inline function 'kotlin.code' call
      var v = Char__toInt_impl_vasixd(ch) & 65535;
      if ((v & 65535) > 127) {
        throw IOException_init_$Create$('Failed to parse multipart: wrong boundary byte 0x' + toString_0(v, 16) + ' - should be 7bit character');
      }
      switch (state) {
        case 0:
          if (ch !== _Char___init__impl__6a9atx(32))
            if (ch === _Char___init__impl__6a9atx(34)) {
              state = 2;
            } else if (ch === _Char___init__impl__6a9atx(59) || ch === _Char___init__impl__6a9atx(44)) {
              break loop;
            } else {
              state = 1;
              parseBoundaryInternal$put(position, boundaryBytes, toByte(v));
            }

          break;
        case 1:
          if (ch === _Char___init__impl__6a9atx(32) || ch === _Char___init__impl__6a9atx(44) || ch === _Char___init__impl__6a9atx(59)) {
            break loop;
          } else {
            parseBoundaryInternal$put(position, boundaryBytes, toByte(v));
          }

          break;
        case 2:
          if (ch === _Char___init__impl__6a9atx(92)) {
            state = 3;
          } else if (ch === _Char___init__impl__6a9atx(34)) {
            break loop;
          } else {
            parseBoundaryInternal$put(position, boundaryBytes, toByte(v));
          }

          break;
        case 3:
          parseBoundaryInternal$put(position, boundaryBytes, toByte(v));
          state = 2;
          break;
      }
    }
     while (inductionVariable < last);
  if (position._v === 4) {
    throw IOException_init_$Create$('Empty multipart boundary is not allowed');
  }
  return copyOfRange(boundaryBytes, 0, position._v);
}
function parseMultipart_0(_this__u8e3s4, boundaryPrefixed, input, totalLength, maxPartSize) {
  _init_properties_Multipart_kt__ato98a();
  return produce(_this__u8e3s4, VOID, VOID, parseMultipart$slambda_0(input, boundaryPrefixed, maxPartSize, totalLength, null));
}
function findBoundary(contentType) {
  _init_properties_Multipart_kt__ato98a();
  var state = 0;
  var paramNameCount = 0;
  var inductionVariable = 0;
  var last = charSequenceLength(contentType) - 1 | 0;
  if (inductionVariable <= last)
    do {
      var i = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      var ch = charSequenceGet(contentType, i);
      switch (state) {
        case 0:
          if (ch === _Char___init__impl__6a9atx(59)) {
            state = 1;
            paramNameCount = 0;
          }

          break;
        case 1:
          if (ch === _Char___init__impl__6a9atx(61)) {
            state = 2;
          } else if (ch === _Char___init__impl__6a9atx(59)) {
            paramNameCount = 0;
          } else if (ch === _Char___init__impl__6a9atx(44)) {
            state = 0;
          } else if (ch !== _Char___init__impl__6a9atx(32))
            if (paramNameCount === 0 && startsWith(contentType, 'boundary=', i, true)) {
              return i;
            } else {
              paramNameCount = paramNameCount + 1 | 0;
            }

          break;
        case 2:
          if (ch === _Char___init__impl__6a9atx(34))
            state = 3;
          else if (ch === _Char___init__impl__6a9atx(44))
            state = 0;
          else if (ch === _Char___init__impl__6a9atx(59)) {
            state = 1;
            paramNameCount = 0;
          }

          break;
        case 3:
          if (ch === _Char___init__impl__6a9atx(34)) {
            state = 1;
            paramNameCount = 0;
          } else if (ch === _Char___init__impl__6a9atx(92)) {
            state = 4;
          }

          break;
        case 4:
          state = 3;
          break;
      }
    }
     while (inductionVariable <= last);
  return -1;
}
function parsePreambleImpl(boundary, input, output, limit, $completion) {
  limit = limit === VOID ? 9223372036854775807n : limit;
  return readUntil(input, boundary, output, limit, true, $completion);
}
function parsePartHeadersImpl(input, $completion) {
  var tmp = new $parsePartHeadersImplCOROUTINE$(input, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
}
function parsePartBodyImpl(boundaryPrefixed, input, output, headers, limit, $completion) {
  var tmp = new $parsePartBodyImplCOROUTINE$(boundaryPrefixed, input, output, headers, limit, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
}
function skipIfFoundReadCount(_this__u8e3s4, prefix, $completion) {
  var tmp = new $skipIfFoundReadCountCOROUTINE$(_this__u8e3s4, prefix, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
}
function throwLimitExceeded(actual, limit) {
  _init_properties_Multipart_kt__ato98a();
  throw IOException_init_$Create$('Multipart content length exceeds limit ' + actual.toString() + ' > ' + limit.toString() + '; ' + "limit is defined using 'formFieldLimit' argument");
}
function parseBoundaryInternal$put(position, boundaryBytes, value) {
  if (position._v >= boundaryBytes.length) {
    throw IOException_init_$Create$("Failed to parse multipart: boundary shouldn't be longer than 70 characters");
  }
  var _unary__edvuaz = position._v;
  position._v = _unary__edvuaz + 1 | 0;
  boundaryBytes[_unary__edvuaz] = value;
}
function parseMultipart$slambda$slambda($firstBoundary, $countedInput, resultContinuation) {
  this.r30_1 = $firstBoundary;
  this.s30_1 = $countedInput;
  CoroutineImpl.call(this, resultContinuation);
}
protoOf(parseMultipart$slambda$slambda).u30 = function ($this$writer, $completion) {
  var tmp = this.v30($this$writer, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
};
protoOf(parseMultipart$slambda$slambda).d9 = function (p1, $completion) {
  return this.u30(p1 instanceof WriterScope ? p1 : THROW_CCE(), $completion);
};
protoOf(parseMultipart$slambda$slambda).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 3;
          this.j8_1 = 1;
          suspendResult = parsePreambleImpl(this.r30_1, this.s30_1, this.t30_1.i1o_1, 8193n, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 1:
          this.j8_1 = 2;
          suspendResult = this.t30_1.i1o_1.u1g(this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 2:
          return Unit_instance;
        case 3:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 3) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
protoOf(parseMultipart$slambda$slambda).v30 = function ($this$writer, completion) {
  var i = new parseMultipart$slambda$slambda(this.r30_1, this.s30_1, completion);
  i.t30_1 = $this$writer;
  return i;
};
function parseMultipart$slambda$slambda_0($firstBoundary, $countedInput, resultContinuation) {
  var i = new parseMultipart$slambda$slambda($firstBoundary, $countedInput, resultContinuation);
  var l = function ($this$writer, $completion) {
    return i.u30($this$writer, $completion);
  };
  l.$arity = 1;
  return l;
}
function parseMultipart$slambda($input, $boundaryPrefixed, $maxPartSize, $totalLength, resultContinuation) {
  this.e31_1 = $input;
  this.f31_1 = $boundaryPrefixed;
  this.g31_1 = $maxPartSize;
  this.h31_1 = $totalLength;
  CoroutineImpl.call(this, resultContinuation);
}
protoOf(parseMultipart$slambda).q31 = function ($this$produce, $completion) {
  var tmp = this.r31($this$produce, $completion);
  tmp.l8_1 = Unit_instance;
  tmp.m8_1 = null;
  return tmp.r8();
};
protoOf(parseMultipart$slambda).d9 = function (p1, $completion) {
  return this.q31((!(p1 == null) ? isInterface(p1, ProducerScope) : false) ? p1 : THROW_CCE(), $completion);
};
protoOf(parseMultipart$slambda).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 25;
          this.j31_1 = counted(this.e31_1);
          this.k31_1 = this.j31_1.f1q();
          this.o31_1 = this.f31_1.bo(get_PrefixString().g1());
          this.j8_1 = 1;
          suspendResult = readRemaining(writer(this.i31_1, VOID, VOID, parseMultipart$slambda$slambda_0(this.o31_1, this.j31_1, null)).g1o_1, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 1:
          var preambleData = suspendResult;
          if (get_remaining(preambleData) > 0n) {
            this.j8_1 = 2;
            suspendResult = this.i31_1.s18(new Preamble(preambleData), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }
            continue $sm;
          } else {
            this.j8_1 = 3;
            continue $sm;
          }

        case 2:
          this.j8_1 = 3;
          continue $sm;
        case 3:
          this.j8_1 = 4;
          continue $sm;
        case 4:
          if (!this.j31_1.r1g()) {
            this.j8_1 = 5;
            suspendResult = skipIfFound(this.j31_1, get_PrefixString(), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }
            continue $sm;
          } else {
            this.p31_1 = false;
            this.j8_1 = 6;
            continue $sm;
          }

        case 5:
          this.p31_1 = !suspendResult;
          this.j8_1 = 6;
          continue $sm;
        case 6:
          if (!this.p31_1) {
            this.j8_1 = 15;
            continue $sm;
          }

          this.j8_1 = 7;
          suspendResult = skipIfFound(this.j31_1, get_CrLf(), this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 7:
          this.j8_1 = 8;
          suspendResult = skipIfFound(this.j31_1, this.o31_1, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 8:
          if (suspendResult) {
            this.j8_1 = 4;
            continue $sm;
          } else {
            this.j8_1 = 9;
            continue $sm;
          }

        case 9:
          this.l31_1 = new ByteChannel();
          this.n31_1 = CompletableDeferred();
          var part = new MultipartPart(this.n31_1, this.l31_1);
          this.j8_1 = 10;
          suspendResult = this.i31_1.s18(part, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 10:
          this.m31_1 = null;
          this.k8_1 = 14;
          this.j8_1 = 11;
          suspendResult = parsePartHeadersImpl(this.j31_1, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 11:
          this.m31_1 = suspendResult;
          if (!this.n31_1.ky(this.m31_1)) {
            this.m31_1.f2x();
            throw CancellationException_init_$Create$('Multipart processing has been cancelled');
          }

          this.j8_1 = 12;
          suspendResult = parsePartBodyImpl(this.f31_1, this.j31_1, this.l31_1, this.m31_1, this.g31_1, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 12:
          this.l31_1.j4();
          this.k8_1 = 25;
          this.j8_1 = 13;
          continue $sm;
        case 13:
          this.k8_1 = 25;
          this.j8_1 = 4;
          continue $sm;
        case 14:
          this.k8_1 = 25;
          var tmp_0 = this.m8_1;
          if (tmp_0 instanceof Error) {
            var cause = this.m8_1;
            if (this.n31_1.ly(cause)) {
              var tmp0_safe_receiver = this.m31_1;
              if (tmp0_safe_receiver == null)
                null;
              else {
                tmp0_safe_receiver.f2x();
              }
            }
            close(this.l31_1, cause);
            throw cause;
          } else {
            throw this.m8_1;
          }

        case 15:
          this.j8_1 = 16;
          suspendResult = skipIfFound(this.j31_1, get_CrLf(), this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 16:
          this.j8_1 = 17;
          suspendResult = skipIfFound(this.j31_1, get_CrLf(), this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 17:
          if (!(this.h31_1 == null)) {
            var consumedExceptEpilogue = subtract(this.j31_1.f1q(), this.k31_1);
            var size = subtract(this.h31_1, consumedExceptEpilogue);
            if (size > 2147483647n)
              throw IOException_init_$Create$('Failed to parse multipart: prologue is too long');
            if (size > 0n) {
              this.j8_1 = 21;
              suspendResult = readPacket(this.j31_1, convertToInt(size), this);
              if (suspendResult === get_COROUTINE_SUSPENDED()) {
                return suspendResult;
              }
              continue $sm;
            } else {
              this.j8_1 = 23;
              continue $sm;
            }
          } else {
            this.j8_1 = 18;
            suspendResult = readRemaining(this.j31_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }
            continue $sm;
          }

        case 18:
          var epilogueContent = suspendResult;
          if (!epilogueContent.jo()) {
            this.j8_1 = 19;
            suspendResult = this.i31_1.s18(new Epilogue(epilogueContent), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }
            continue $sm;
          } else {
            this.j8_1 = 20;
            continue $sm;
          }

        case 19:
          this.j8_1 = 20;
          continue $sm;
        case 20:
          this.j8_1 = 24;
          continue $sm;
        case 21:
          var ARGUMENT = suspendResult;
          var ARGUMENT_0 = new Epilogue(ARGUMENT);
          this.j8_1 = 22;
          suspendResult = this.i31_1.s18(ARGUMENT_0, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 22:
          this.j8_1 = 23;
          continue $sm;
        case 23:
          this.j8_1 = 24;
          continue $sm;
        case 24:
          return Unit_instance;
        case 25:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 25) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
protoOf(parseMultipart$slambda).r31 = function ($this$produce, completion) {
  var i = new parseMultipart$slambda(this.e31_1, this.f31_1, this.g31_1, this.h31_1, completion);
  i.i31_1 = $this$produce;
  return i;
};
function parseMultipart$slambda_0($input, $boundaryPrefixed, $maxPartSize, $totalLength, resultContinuation) {
  var i = new parseMultipart$slambda($input, $boundaryPrefixed, $maxPartSize, $totalLength, resultContinuation);
  var l = function ($this$produce, $completion) {
    return i.q31($this$produce, $completion);
  };
  l.$arity = 1;
  return l;
}
function $parsePartHeadersImplCOROUTINE$(input, resultContinuation) {
  CoroutineImpl.call(this, resultContinuation);
  this.g2z_1 = input;
}
protoOf($parsePartHeadersImplCOROUTINE$).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 3;
          this.h2z_1 = new CharArrayBuilder();
          this.k8_1 = 2;
          this.j8_1 = 1;
          suspendResult = parseHeaders(this.g2z_1, this.h2z_1, VOID, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 1:
          var tmp0_elvis_lhs = suspendResult;
          var tmp_0;
          if (tmp0_elvis_lhs == null) {
            throw EOFException_init_$Create$('Failed to parse multipart headers: unexpected end of stream');
          } else {
            tmp_0 = tmp0_elvis_lhs;
          }

          return tmp_0;
        case 2:
          this.k8_1 = 3;
          var tmp_1 = this.m8_1;
          if (tmp_1 instanceof Error) {
            var t = this.m8_1;
            this.h2z_1.f2x();
            throw t;
          } else {
            throw this.m8_1;
          }

        case 3:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 3) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
function $parsePartBodyImplCOROUTINE$(boundaryPrefixed, input, output, headers, limit, resultContinuation) {
  CoroutineImpl.call(this, resultContinuation);
  this.q2z_1 = boundaryPrefixed;
  this.r2z_1 = input;
  this.s2z_1 = output;
  this.t2z_1 = headers;
  this.u2z_1 = limit;
}
protoOf($parsePartBodyImplCOROUTINE$).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 6;
          var tmp0_safe_receiver = this.t2z_1.f2e('Content-Length');
          var contentLength = tmp0_safe_receiver == null ? null : parseDecLong(tmp0_safe_receiver);
          if (contentLength == null) {
            this.j8_1 = 3;
            suspendResult = readUntil(this.r2z_1, this.q2z_1, this.s2z_1, this.u2z_1, true, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }
            continue $sm;
          } else {
            var containsUpper = this.u2z_1;
            if (0n <= contentLength ? contentLength <= containsUpper : false) {
              this.j8_1 = 1;
              suspendResult = copyTo(this.r2z_1, this.s2z_1, contentLength, this);
              if (suspendResult === get_COROUTINE_SUSPENDED()) {
                return suspendResult;
              }
              continue $sm;
            } else {
              var tmp_0 = this;
              throwLimitExceeded(contentLength, this.u2z_1);
            }
          }

          break;
        case 1:
          this.x2z_1 = suspendResult;
          this.j8_1 = 2;
          suspendResult = skipIfFoundReadCount(this.r2z_1, this.q2z_1, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 2:
          var ARGUMENT = suspendResult;
          this.w2z_1 = add(this.x2z_1, ARGUMENT);
          this.j8_1 = 4;
          continue $sm;
        case 3:
          this.w2z_1 = suspendResult;
          this.j8_1 = 4;
          continue $sm;
        case 4:
          this.v2z_1 = this.w2z_1;
          this.j8_1 = 5;
          suspendResult = this.s2z_1.i1g(this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 5:
          return this.v2z_1;
        case 6:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 6) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
function $skipIfFoundReadCountCOROUTINE$(_this__u8e3s4, prefix, resultContinuation) {
  CoroutineImpl.call(this, resultContinuation);
  this.g30_1 = _this__u8e3s4;
  this.h30_1 = prefix;
}
protoOf($skipIfFoundReadCountCOROUTINE$).r8 = function () {
  var suspendResult = this.l8_1;
  $sm: do
    try {
      var tmp = this.j8_1;
      switch (tmp) {
        case 0:
          this.k8_1 = 3;
          this.j8_1 = 1;
          suspendResult = skipIfFound(this.g30_1, this.h30_1, this);
          if (suspendResult === get_COROUTINE_SUSPENDED()) {
            return suspendResult;
          }

          continue $sm;
        case 1:
          if (suspendResult) {
            var tmp_0 = this;
            tmp_0.i30_1 = fromInt(this.h30_1.g1());
            this.j8_1 = 2;
            continue $sm;
          } else {
            var tmp_1 = this;
            tmp_1.i30_1 = 0n;
            this.j8_1 = 2;
            continue $sm;
          }

        case 2:
          return this.i30_1;
        case 3:
          throw this.m8_1;
      }
    } catch ($p) {
      var e = $p;
      if (this.k8_1 === 3) {
        throw e;
      } else {
        this.j8_1 = this.k8_1;
        this.m8_1 = e;
      }
    }
   while (true);
};
var properties_initialized_Multipart_kt_wu0sh0;
function _init_properties_Multipart_kt__ato98a() {
  if (!properties_initialized_Multipart_kt_wu0sh0) {
    properties_initialized_Multipart_kt_wu0sh0 = true;
    CrLf = ByteString_init_$Create$(toByteArray_0('\r\n'));
    PrefixString = ByteString(new Int8Array([45, 45]));
  }
}
function build($this, resultList, from, maxLength, idx, length, charAt) {
  // Inline function 'kotlin.collections.groupBy' call
  // Inline function 'kotlin.collections.groupByTo' call
  var destination = LinkedHashMap_init_$Create$();
  var _iterator__ex2g4s = from.t();
  while (_iterator__ex2g4s.u()) {
    var element = _iterator__ex2g4s.v();
    var key = charAt(element, idx);
    // Inline function 'kotlin.collections.getOrPut' call
    var value = destination.z2(key);
    var tmp;
    if (value == null) {
      var answer = ArrayList_init_$Create$();
      destination.s2(key, answer);
      tmp = answer;
    } else {
      tmp = value;
    }
    var list = tmp;
    list.e1(element);
  }
  // Inline function 'kotlin.collections.forEach' call
  // Inline function 'kotlin.collections.iterator' call
  var _iterator__ex2g4s_0 = destination.k1().t();
  while (_iterator__ex2g4s_0.u()) {
    var element_0 = _iterator__ex2g4s_0.v();
    // Inline function 'kotlin.collections.component1' call
    var ch = element_0.l1().u1_1;
    // Inline function 'kotlin.collections.component2' call
    var list_0 = element_0.m1();
    var nextIdx = idx + 1 | 0;
    var children = ArrayList_init_$Create$();
    var tmp_0 = Companion_instance;
    // Inline function 'kotlin.collections.filter' call
    // Inline function 'kotlin.collections.filterTo' call
    var destination_0 = ArrayList_init_$Create$();
    var _iterator__ex2g4s_1 = list_0.t();
    while (_iterator__ex2g4s_1.u()) {
      var element_1 = _iterator__ex2g4s_1.v();
      if (length(element_1) > nextIdx) {
        destination_0.e1(element_1);
      }
    }
    build(tmp_0, children, destination_0, maxLength, nextIdx, length, charAt);
    children.s5();
    // Inline function 'kotlin.collections.filter' call
    // Inline function 'kotlin.collections.filterTo' call
    var destination_1 = ArrayList_init_$Create$();
    var _iterator__ex2g4s_2 = list_0.t();
    while (_iterator__ex2g4s_2.u()) {
      var element_2 = _iterator__ex2g4s_2.v();
      if (length(element_2) === nextIdx) {
        destination_1.e1(element_2);
      }
    }
    resultList.e1(new Node(ch, destination_1, children));
  }
}
function AsciiCharTree$Companion$build$lambda(it) {
  return charSequenceLength(it);
}
function AsciiCharTree$Companion$build$lambda_0(s, idx) {
  return new Char(charSequenceGet(s, idx));
}
function Node(ch, exact, children) {
  this.s31_1 = ch;
  this.t31_1 = exact;
  this.u31_1 = children;
  var tmp = this;
  var tmp_0 = 0;
  // Inline function 'kotlin.arrayOfNulls' call
  var tmp_1 = Array(256);
  while (tmp_0 < 256) {
    var tmp_2 = tmp_0;
    var tmp0 = this.u31_1;
    var tmp$ret$2;
    $l$block_0: {
      // Inline function 'kotlin.collections.singleOrNull' call
      var single = null;
      var found = false;
      var _iterator__ex2g4s = tmp0.t();
      while (_iterator__ex2g4s.u()) {
        var element = _iterator__ex2g4s.v();
        // Inline function 'kotlin.code' call
        var this_0 = element.s31_1;
        if (Char__toInt_impl_vasixd(this_0) === tmp_2) {
          if (found) {
            tmp$ret$2 = null;
            break $l$block_0;
          }
          single = element;
          found = true;
        }
      }
      if (!found) {
        tmp$ret$2 = null;
        break $l$block_0;
      }
      tmp$ret$2 = single;
    }
    tmp_1[tmp_2] = tmp$ret$2;
    tmp_0 = tmp_0 + 1 | 0;
  }
  tmp.v31_1 = tmp_1;
}
function Companion() {
}
protoOf(Companion).t2y = function (from) {
  var tmp = AsciiCharTree$Companion$build$lambda;
  return this.w31(from, tmp, AsciiCharTree$Companion$build$lambda_0);
};
protoOf(Companion).w31 = function (from, length, charAt) {
  var tmp$ret$0;
  $l$block_0: {
    // Inline function 'kotlin.collections.maxByOrNull' call
    var iterator = from.t();
    if (!iterator.u()) {
      tmp$ret$0 = null;
      break $l$block_0;
    }
    var maxElem = iterator.v();
    if (!iterator.u()) {
      tmp$ret$0 = maxElem;
      break $l$block_0;
    }
    var maxValue = length(maxElem);
    do {
      var e = iterator.v();
      var v = length(e);
      if (compareTo(maxValue, v) < 0) {
        maxElem = e;
        maxValue = v;
      }
    }
     while (iterator.u());
    tmp$ret$0 = maxElem;
  }
  var tmp0_safe_receiver = tmp$ret$0;
  var tmp;
  if (tmp0_safe_receiver == null) {
    tmp = null;
  } else {
    // Inline function 'kotlin.let' call
    tmp = length(tmp0_safe_receiver);
  }
  var tmp1_elvis_lhs = tmp;
  var tmp_0;
  if (tmp1_elvis_lhs == null) {
    throw NoSuchElementException_init_$Create$('Unable to build char tree from an empty list');
  } else {
    tmp_0 = tmp1_elvis_lhs;
  }
  var maxLen = tmp_0;
  var tmp$ret$2;
  $l$block_2: {
    // Inline function 'kotlin.collections.any' call
    var tmp_1;
    if (isInterface(from, Collection)) {
      tmp_1 = from.r();
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp$ret$2 = false;
      break $l$block_2;
    }
    var _iterator__ex2g4s = from.t();
    while (_iterator__ex2g4s.u()) {
      var element = _iterator__ex2g4s.v();
      if (length(element) === 0) {
        tmp$ret$2 = true;
        break $l$block_2;
      }
    }
    tmp$ret$2 = false;
  }
  if (tmp$ret$2)
    throw IllegalArgumentException_init_$Create$('There should be no empty entries');
  var root = ArrayList_init_$Create$();
  build(this, root, from, maxLen, 0, length, charAt);
  root.s5();
  return new AsciiCharTree(new Node(_Char___init__impl__6a9atx(0), emptyList(), root));
};
var Companion_instance;
function Companion_getInstance_1() {
  return Companion_instance;
}
function AsciiCharTree(root) {
  this.x31_1 = root;
}
function getImpl($this, index) {
  return bufferForIndex($this, index)[index % ensureNotNull($this.y2w_1).length | 0];
}
function copy($this, startIndex, endIndex) {
  if (startIndex === endIndex)
    return '';
  var builder = StringBuilder_init_$Create$_0(endIndex - startIndex | 0);
  var buffer;
  var base = startIndex - (startIndex % 2048 | 0) | 0;
  while (base < endIndex) {
    buffer = bufferForIndex($this, base);
    // Inline function 'kotlin.comparisons.maxOf' call
    var b = startIndex - base | 0;
    var innerStartIndex = Math.max(0, b);
    // Inline function 'kotlin.comparisons.minOf' call
    var a = endIndex - base | 0;
    var innerEndIndex = Math.min(a, 2048);
    var inductionVariable = innerStartIndex;
    if (inductionVariable < innerEndIndex)
      do {
        var innerIndex = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        builder.s(buffer[innerIndex]);
      }
       while (inductionVariable < innerEndIndex);
    base = base + 2048 | 0;
  }
  return builder;
}
function SubSequenceImpl($outer, start, end) {
  this.b32_1 = $outer;
  this.y31_1 = start;
  this.z31_1 = end;
  this.a32_1 = null;
}
protoOf(SubSequenceImpl).a = function () {
  return this.z31_1 - this.y31_1 | 0;
};
protoOf(SubSequenceImpl).b = function (index) {
  var withOffset = index + this.y31_1 | 0;
  // Inline function 'kotlin.require' call
  if (!(index >= 0)) {
    var message = 'index is negative: ' + index;
    throw IllegalArgumentException_init_$Create$(toString(message));
  }
  // Inline function 'kotlin.require' call
  if (!(withOffset < this.z31_1)) {
    var message_0 = 'index (' + index + ') should be less than length (' + this.a() + ')';
    throw IllegalArgumentException_init_$Create$(toString(message_0));
  }
  return getImpl(this.b32_1, withOffset);
};
protoOf(SubSequenceImpl).c = function (startIndex, endIndex) {
  // Inline function 'kotlin.require' call
  if (!(startIndex >= 0)) {
    var message = 'start is negative: ' + startIndex;
    throw IllegalArgumentException_init_$Create$(toString(message));
  }
  // Inline function 'kotlin.require' call
  if (!(startIndex <= endIndex)) {
    var message_0 = 'start (' + startIndex + ') should be less or equal to end (' + endIndex + ')';
    throw IllegalArgumentException_init_$Create$(toString(message_0));
  }
  // Inline function 'kotlin.require' call
  if (!(endIndex <= (this.z31_1 - this.y31_1 | 0))) {
    var message_1 = 'end should be less than length (' + this.a() + ')';
    throw IllegalArgumentException_init_$Create$(toString(message_1));
  }
  if (startIndex === endIndex)
    return '';
  return new SubSequenceImpl(this.b32_1, this.y31_1 + startIndex | 0, this.y31_1 + endIndex | 0);
};
protoOf(SubSequenceImpl).toString = function () {
  var tmp0_elvis_lhs = this.a32_1;
  var tmp;
  if (tmp0_elvis_lhs == null) {
    // Inline function 'kotlin.also' call
    var this_0 = toString(copy(this.b32_1, this.y31_1, this.z31_1));
    this.a32_1 = this_0;
    tmp = this_0;
  } else {
    tmp = tmp0_elvis_lhs;
  }
  return tmp;
};
protoOf(SubSequenceImpl).equals = function (other) {
  if (!(!(other == null) ? isCharSequence(other) : false))
    return false;
  if (!(charSequenceLength(other) === this.a()))
    return false;
  return rangeEqualsImpl(this.b32_1, this.y31_1, other, 0, this.a());
};
protoOf(SubSequenceImpl).hashCode = function () {
  var tmp0_safe_receiver = this.a32_1;
  var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : getStringHashCode(tmp0_safe_receiver);
  return tmp1_elvis_lhs == null ? hashCodeImpl(this.b32_1, this.y31_1, this.z31_1) : tmp1_elvis_lhs;
};
function bufferForIndex($this, index) {
  var list = $this.x2w_1;
  if (list == null) {
    if (index >= 2048) {
      throwSingleBuffer($this, index);
    }
    var tmp0_elvis_lhs = $this.y2w_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throwSingleBuffer($this, index);
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  }
  return list.h1(index / ensureNotNull($this.y2w_1).length | 0);
}
function throwSingleBuffer($this, index) {
  if ($this.a2x_1)
    throw IllegalStateException_init_$Create$('Buffer is already released');
  throw IndexOutOfBoundsException_init_$Create$('' + index + ' is not in range [0; ' + currentPosition($this) + ')');
}
function nonFullBuffer($this) {
  return $this.b2x_1 === 0 ? appendNewArray($this) : ensureNotNull($this.y2w_1);
}
function appendNewArray($this) {
  var newBuffer = $this.w2w_1.d1r();
  var existing = $this.y2w_1;
  $this.y2w_1 = newBuffer;
  $this.b2x_1 = newBuffer.length;
  $this.a2x_1 = false;
  if (!(existing == null)) {
    var tmp0_elvis_lhs = $this.x2w_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      // Inline function 'kotlin.also' call
      var this_0 = ArrayList_init_$Create$();
      $this.x2w_1 = this_0;
      this_0.e1(existing);
      tmp = this_0;
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var list = tmp;
    list.e1(newBuffer);
  }
  return newBuffer;
}
function rangeEqualsImpl($this, start, other, otherStart, length) {
  var inductionVariable = 0;
  if (inductionVariable < length)
    do {
      var i = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      if (!(getImpl($this, start + i | 0) === charSequenceGet(other, otherStart + i | 0)))
        return false;
    }
     while (inductionVariable < length);
  return true;
}
function hashCodeImpl($this, start, end) {
  var hc = 0;
  var inductionVariable = start;
  if (inductionVariable < end)
    do {
      var i = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      var tmp = imul(31, hc);
      // Inline function 'kotlin.code' call
      var this_0 = getImpl($this, i);
      hc = tmp + Char__toInt_impl_vasixd(this_0) | 0;
    }
     while (inductionVariable < end);
  return hc;
}
function currentPosition($this) {
  return ensureNotNull($this.y2w_1).length - $this.b2x_1 | 0;
}
function CharArrayBuilder(pool) {
  pool = pool === VOID ? get_CharArrayPool() : pool;
  this.w2w_1 = pool;
  this.x2w_1 = null;
  this.y2w_1 = null;
  this.z2w_1 = null;
  this.a2x_1 = false;
  this.b2x_1 = 0;
  this.c2x_1 = 0;
}
protoOf(CharArrayBuilder).a = function () {
  return this.c2x_1;
};
protoOf(CharArrayBuilder).b = function (index) {
  // Inline function 'kotlin.require' call
  if (!(index >= 0)) {
    var message = 'index is negative: ' + index;
    throw IllegalArgumentException_init_$Create$(toString(message));
  }
  // Inline function 'kotlin.require' call
  if (!(index < this.c2x_1)) {
    var message_0 = 'index ' + index + ' is not in range [0, ' + this.c2x_1 + ')';
    throw IllegalArgumentException_init_$Create$(toString(message_0));
  }
  return getImpl(this, index);
};
protoOf(CharArrayBuilder).c = function (startIndex, endIndex) {
  // Inline function 'kotlin.require' call
  if (!(startIndex <= endIndex)) {
    var message = 'startIndex (' + startIndex + ') should be less or equal to endIndex (' + endIndex + ')';
    throw IllegalArgumentException_init_$Create$(toString(message));
  }
  // Inline function 'kotlin.require' call
  if (!(startIndex >= 0)) {
    var message_0 = 'startIndex is negative: ' + startIndex;
    throw IllegalArgumentException_init_$Create$(toString(message_0));
  }
  // Inline function 'kotlin.require' call
  if (!(endIndex <= this.c2x_1)) {
    var message_1 = 'endIndex (' + endIndex + ') is greater than length (' + this.c2x_1 + ')';
    throw IllegalArgumentException_init_$Create$(toString(message_1));
  }
  return new SubSequenceImpl(this, startIndex, endIndex);
};
protoOf(CharArrayBuilder).toString = function () {
  var tmp0_elvis_lhs = this.z2w_1;
  var tmp;
  if (tmp0_elvis_lhs == null) {
    // Inline function 'kotlin.also' call
    var this_0 = toString(copy(this, 0, this.c2x_1));
    this.z2w_1 = this_0;
    tmp = this_0;
  } else {
    tmp = tmp0_elvis_lhs;
  }
  return tmp;
};
protoOf(CharArrayBuilder).equals = function (other) {
  if (!(!(other == null) ? isCharSequence(other) : false))
    return false;
  if (!(this.c2x_1 === charSequenceLength(other)))
    return false;
  return rangeEqualsImpl(this, 0, other, 0, this.c2x_1);
};
protoOf(CharArrayBuilder).hashCode = function () {
  var tmp0_safe_receiver = this.z2w_1;
  var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : getStringHashCode(tmp0_safe_receiver);
  return tmp1_elvis_lhs == null ? hashCodeImpl(this, 0, this.c2x_1) : tmp1_elvis_lhs;
};
protoOf(CharArrayBuilder).s = function (value) {
  nonFullBuffer(this)[ensureNotNull(this.y2w_1).length - this.b2x_1 | 0] = value;
  this.z2w_1 = null;
  this.b2x_1 = this.b2x_1 - 1 | 0;
  this.c2x_1 = this.c2x_1 + 1 | 0;
  return this;
};
protoOf(CharArrayBuilder).wb = function (value, startIndex, endIndex) {
  if (value == null)
    return this;
  var current = startIndex;
  while (current < endIndex) {
    var buffer = nonFullBuffer(this);
    var offset = buffer.length - this.b2x_1 | 0;
    var tmp0 = endIndex - current | 0;
    // Inline function 'kotlin.math.min' call
    var b = this.b2x_1;
    var bytesToCopy = Math.min(tmp0, b);
    var inductionVariable = 0;
    if (inductionVariable < bytesToCopy)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        buffer[offset + i | 0] = charSequenceGet(value, current + i | 0);
      }
       while (inductionVariable < bytesToCopy);
    current = current + bytesToCopy | 0;
    this.b2x_1 = this.b2x_1 - bytesToCopy | 0;
  }
  this.z2w_1 = null;
  this.c2x_1 = this.c2x_1 + (endIndex - startIndex | 0) | 0;
  return this;
};
protoOf(CharArrayBuilder).f1 = function (value) {
  if (value == null)
    return this;
  return this.wb(value, 0, charSequenceLength(value));
};
protoOf(CharArrayBuilder).f2x = function () {
  var list = this.x2w_1;
  if (!(list == null)) {
    this.y2w_1 = null;
    var inductionVariable = 0;
    var last = list.g1();
    if (inductionVariable < last)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        this.w2w_1.e1r(list.h1(i));
      }
       while (inductionVariable < last);
  } else {
    var tmp0_safe_receiver = this.y2w_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      // Inline function 'kotlin.let' call
      this.w2w_1.e1r(tmp0_safe_receiver);
    }
    this.y2w_1 = null;
  }
  this.a2x_1 = true;
  this.x2w_1 = null;
  this.z2w_1 = null;
  this.c2x_1 = 0;
  this.b2x_1 = 0;
};
function get_CharArrayPool() {
  _init_properties_CharArrayPool_kt__u4nq0d();
  return CharArrayPool;
}
var CharArrayPool;
function CharArrayPool$1() {
  NoPoolImpl.call(this);
}
protoOf(CharArrayPool$1).d1r = function () {
  return charArray(2048);
};
function CharArrayPool$2() {
  DefaultPool.call(this, 4096);
}
protoOf(CharArrayPool$2).w1q = function () {
  return charArray(2048);
};
var properties_initialized_CharArrayPool_kt_aq0u0f;
function _init_properties_CharArrayPool_kt__u4nq0d() {
  if (!properties_initialized_CharArrayPool_kt_aq0u0f) {
    properties_initialized_CharArrayPool_kt_aq0u0f = true;
    var tmp;
    if (isPoolingDisabled()) {
      tmp = new CharArrayPool$1();
    } else {
      tmp = new CharArrayPool$2();
    }
    CharArrayPool = tmp;
  }
}
var DefaultHttpMethods;
var HexTable;
var HexLetterTable;
function hashCodeLowerCase(_this__u8e3s4, start, end) {
  start = start === VOID ? 0 : start;
  end = end === VOID ? charSequenceLength(_this__u8e3s4) : end;
  _init_properties_Chars_kt__d3i39x();
  var hashCode = 0;
  var inductionVariable = start;
  if (inductionVariable < end)
    do {
      var pos = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      // Inline function 'kotlin.code' call
      var this_0 = charSequenceGet(_this__u8e3s4, pos);
      // Inline function 'io.ktor.http.cio.internals.toLowerCase' call
      var this_1 = Char__toInt_impl_vasixd(this_0);
      var tmp;
      // Inline function 'kotlin.code' call
      var this_2 = _Char___init__impl__6a9atx(65);
      var containsLower = Char__toInt_impl_vasixd(this_2);
      var tmp_0;
      // Inline function 'kotlin.code' call
      var this_3 = _Char___init__impl__6a9atx(90);
      if (this_1 <= Char__toInt_impl_vasixd(this_3)) {
        tmp_0 = containsLower <= this_1;
      } else {
        tmp_0 = false;
      }
      if (tmp_0) {
        // Inline function 'kotlin.code' call
        var this_4 = _Char___init__impl__6a9atx(97);
        var tmp_1 = Char__toInt_impl_vasixd(this_4);
        // Inline function 'kotlin.code' call
        var this_5 = _Char___init__impl__6a9atx(65);
        tmp = tmp_1 + (this_1 - Char__toInt_impl_vasixd(this_5) | 0) | 0;
      } else {
        tmp = this_1;
      }
      var v = tmp;
      hashCode = imul(31, hashCode) + v | 0;
    }
     while (inductionVariable < end);
  return hashCode;
}
function equalsLowerCase(_this__u8e3s4, start, end, other) {
  start = start === VOID ? 0 : start;
  end = end === VOID ? charSequenceLength(_this__u8e3s4) : end;
  _init_properties_Chars_kt__d3i39x();
  if (!((end - start | 0) === charSequenceLength(other)))
    return false;
  var inductionVariable = start;
  if (inductionVariable < end)
    do {
      var pos = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      // Inline function 'kotlin.code' call
      var this_0 = charSequenceGet(_this__u8e3s4, pos);
      // Inline function 'io.ktor.http.cio.internals.toLowerCase' call
      var this_1 = Char__toInt_impl_vasixd(this_0);
      var tmp;
      // Inline function 'kotlin.code' call
      var this_2 = _Char___init__impl__6a9atx(65);
      var containsLower = Char__toInt_impl_vasixd(this_2);
      var tmp_0;
      // Inline function 'kotlin.code' call
      var this_3 = _Char___init__impl__6a9atx(90);
      if (this_1 <= Char__toInt_impl_vasixd(this_3)) {
        tmp_0 = containsLower <= this_1;
      } else {
        tmp_0 = false;
      }
      if (tmp_0) {
        // Inline function 'kotlin.code' call
        var this_4 = _Char___init__impl__6a9atx(97);
        var tmp_1 = Char__toInt_impl_vasixd(this_4);
        // Inline function 'kotlin.code' call
        var this_5 = _Char___init__impl__6a9atx(65);
        tmp = tmp_1 + (this_1 - Char__toInt_impl_vasixd(this_5) | 0) | 0;
      } else {
        tmp = this_1;
      }
      var tmp_2 = tmp;
      // Inline function 'kotlin.code' call
      var this_6 = charSequenceGet(other, pos - start | 0);
      // Inline function 'io.ktor.http.cio.internals.toLowerCase' call
      var this_7 = Char__toInt_impl_vasixd(this_6);
      var tmp_3;
      // Inline function 'kotlin.code' call
      var this_8 = _Char___init__impl__6a9atx(65);
      var containsLower_0 = Char__toInt_impl_vasixd(this_8);
      var tmp_4;
      // Inline function 'kotlin.code' call
      var this_9 = _Char___init__impl__6a9atx(90);
      if (this_7 <= Char__toInt_impl_vasixd(this_9)) {
        tmp_4 = containsLower_0 <= this_7;
      } else {
        tmp_4 = false;
      }
      if (tmp_4) {
        // Inline function 'kotlin.code' call
        var this_10 = _Char___init__impl__6a9atx(97);
        var tmp_5 = Char__toInt_impl_vasixd(this_10);
        // Inline function 'kotlin.code' call
        var this_11 = _Char___init__impl__6a9atx(65);
        tmp_3 = tmp_5 + (this_7 - Char__toInt_impl_vasixd(this_11) | 0) | 0;
      } else {
        tmp_3 = this_7;
      }
      if (!(tmp_2 === tmp_3))
        return false;
    }
     while (inductionVariable < end);
  return true;
}
function parseDecLong(_this__u8e3s4) {
  _init_properties_Chars_kt__d3i39x();
  var length = charSequenceLength(_this__u8e3s4);
  if (length > 19) {
    numberFormatException(_this__u8e3s4);
  }
  if (length === 19)
    return parseDecLongWithCheck(_this__u8e3s4);
  var result = 0n;
  var inductionVariable = 0;
  if (inductionVariable < length)
    do {
      var i = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      // Inline function 'kotlin.code' call
      var this_0 = charSequenceGet(_this__u8e3s4, i);
      var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
      var digit = subtract(fromInt(tmp$ret$0), 48n);
      if (digit < 0n || digit > 9n) {
        numberFormatException_0(_this__u8e3s4, i);
      }
      result = add(add(shiftLeft(result, 3), shiftLeft(result, 1)), digit);
    }
     while (inductionVariable < length);
  return result;
}
function numberFormatException(cs) {
  _init_properties_Chars_kt__d3i39x();
  throw NumberFormatException_init_$Create$('Invalid number ' + toString(cs) + ': too large for Long type');
}
function parseDecLongWithCheck(_this__u8e3s4) {
  _init_properties_Chars_kt__d3i39x();
  var result = 0n;
  var inductionVariable = 0;
  var last = charSequenceLength(_this__u8e3s4) - 1 | 0;
  if (inductionVariable <= last)
    do {
      var i = inductionVariable;
      inductionVariable = inductionVariable + 1 | 0;
      // Inline function 'kotlin.code' call
      var this_0 = charSequenceGet(_this__u8e3s4, i);
      var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
      var digit = subtract(fromInt(tmp$ret$0), 48n);
      if (digit < 0n || digit > 9n) {
        numberFormatException_0(_this__u8e3s4, i);
      }
      result = add(add(shiftLeft(result, 3), shiftLeft(result, 1)), digit);
      if (result < 0n) {
        numberFormatException(_this__u8e3s4);
      }
    }
     while (inductionVariable <= last);
  return result;
}
function numberFormatException_0(cs, idx) {
  _init_properties_Chars_kt__d3i39x();
  throw NumberFormatException_init_$Create$('Invalid number: ' + toString(cs) + ', wrong digit: ' + toString_1(charSequenceGet(cs, idx)) + ' at position ' + idx);
}
function DefaultHttpMethods$lambda(it) {
  _init_properties_Chars_kt__d3i39x();
  return it.o2q_1.length;
}
function DefaultHttpMethods$lambda_0(m, idx) {
  _init_properties_Chars_kt__d3i39x();
  return new Char(charCodeAt(m.o2q_1, idx));
}
var properties_initialized_Chars_kt_phjfhp;
function _init_properties_Chars_kt__d3i39x() {
  if (!properties_initialized_Chars_kt_phjfhp) {
    properties_initialized_Chars_kt_phjfhp = true;
    var tmp = Companion_instance;
    var tmp_0 = Companion_getInstance().n2q_1;
    var tmp_1 = DefaultHttpMethods$lambda;
    DefaultHttpMethods = tmp.w31(tmp_0, tmp_1, DefaultHttpMethods$lambda_0);
    // Inline function 'kotlin.collections.map' call
    var this_0 = numberRangeToNumber(0, 255);
    // Inline function 'kotlin.collections.mapTo' call
    var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
    var inductionVariable = this_0.p1_1;
    var last = this_0.q1_1;
    if (inductionVariable <= last)
      do {
        var item = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var v = item;
        var tmp_2;
        if (48 <= v ? v <= 57 : false) {
          tmp_2 = subtract(numberToLong(v), 48n);
        } else {
          var tmp_3;
          var tmp_4 = fromInt(v);
          // Inline function 'kotlin.code' call
          var this_1 = _Char___init__impl__6a9atx(97);
          var tmp$ret$3 = Char__toInt_impl_vasixd(this_1);
          if (tmp_4 >= fromInt(tmp$ret$3)) {
            var tmp_5 = fromInt(v);
            // Inline function 'kotlin.code' call
            var this_2 = _Char___init__impl__6a9atx(102);
            var tmp$ret$4 = Char__toInt_impl_vasixd(this_2);
            tmp_3 = tmp_5 <= fromInt(tmp$ret$4);
          } else {
            tmp_3 = false;
          }
          if (tmp_3) {
            // Inline function 'kotlin.code' call
            var this_3 = _Char___init__impl__6a9atx(97);
            var tmp$ret$5 = Char__toInt_impl_vasixd(this_3);
            // Inline function 'kotlin.Long.plus' call
            var this_4 = subtract(numberToLong(v), fromInt(tmp$ret$5));
            tmp_2 = add(this_4, fromInt(10));
          } else {
            var tmp_6;
            var tmp_7 = fromInt(v);
            // Inline function 'kotlin.code' call
            var this_5 = _Char___init__impl__6a9atx(65);
            var tmp$ret$7 = Char__toInt_impl_vasixd(this_5);
            if (tmp_7 >= fromInt(tmp$ret$7)) {
              var tmp_8 = fromInt(v);
              // Inline function 'kotlin.code' call
              var this_6 = _Char___init__impl__6a9atx(70);
              var tmp$ret$8 = Char__toInt_impl_vasixd(this_6);
              tmp_6 = tmp_8 <= fromInt(tmp$ret$8);
            } else {
              tmp_6 = false;
            }
            if (tmp_6) {
              // Inline function 'kotlin.code' call
              var this_7 = _Char___init__impl__6a9atx(65);
              var tmp$ret$9 = Char__toInt_impl_vasixd(this_7);
              // Inline function 'kotlin.Long.plus' call
              var this_8 = subtract(numberToLong(v), fromInt(tmp$ret$9));
              tmp_2 = add(this_8, fromInt(10));
            } else {
              tmp_2 = -1n;
            }
          }
        }
        var tmp$ret$2 = tmp_2;
        destination.e1(tmp$ret$2);
      }
       while (!(item === last));
    HexTable = toLongArray(destination);
    // Inline function 'kotlin.collections.map' call
    var this_9 = numberRangeToNumber(0, 15);
    // Inline function 'kotlin.collections.mapTo' call
    var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_9, 10));
    var inductionVariable_0 = this_9.p1_1;
    var last_0 = this_9.q1_1;
    if (inductionVariable_0 <= last_0)
      do {
        var item_0 = inductionVariable_0;
        inductionVariable_0 = inductionVariable_0 + 1 | 0;
        var it = item_0;
        var tmp_9;
        if (it < 10) {
          tmp_9 = toByte(48 + it | 0);
        } else {
          // Inline function 'kotlin.code' call
          var this_10 = Char__minus_impl_a2frrh(Char__plus_impl_qi7pgj(_Char___init__impl__6a9atx(97), it), 10);
          var tmp$ret$3_0 = Char__toInt_impl_vasixd(this_10);
          tmp_9 = toByte(tmp$ret$3_0);
        }
        var tmp$ret$2_0 = tmp_9;
        destination_0.e1(tmp$ret$2_0);
      }
       while (!(item_0 === last_0));
    HexLetterTable = toByteArray(destination_0);
  }
}
function UnsupportedMediaTypeExceptionCIO(message) {
  IOException_init_$Init$(message, this);
  captureStack(this, UnsupportedMediaTypeExceptionCIO);
}
function MutableRange(start, end) {
  this.r2y_1 = start;
  this.s2y_1 = end;
}
protoOf(MutableRange).toString = function () {
  return 'MutableRange(start=' + this.r2y_1 + ', end=' + this.s2y_1 + ')';
};
function skipSpacesAndHorizontalTabs(text, start, end) {
  var index = start;
  $l$loop: while (index < end) {
    var ch = text.b(index);
    if (!isWhitespace(ch) && !(ch === _Char___init__impl__6a9atx(9)))
      break $l$loop;
    index = index + 1 | 0;
  }
  return index;
}
function isPoolingDisabled() {
  return false;
}
//region block: init
Companion_instance = new Companion();
//endregion
//region block: exports
export {
  CIOMultipartDataBase as CIOMultipartDataBase3o5u8w437tq5s,
};
//endregion


