(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core) {
  'use strict';
  //region block: imports
  var imul = Math.imul;
  var CoroutineImpl = kotlin_kotlin.$_$.md;
  var Unit_getInstance = kotlin_kotlin.$_$.g6;
  var protoOf = kotlin_kotlin.$_$.tf;
  var THROW_CCE = kotlin_kotlin.$_$.cm;
  var SequenceScope = kotlin_kotlin.$_$.fh;
  var until = kotlin_kotlin.$_$.yg;
  var charSequenceLength = kotlin_kotlin.$_$.ce;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.xc;
  var classMeta = kotlin_kotlin.$_$.ee;
  var setMetadataFor = kotlin_kotlin.$_$.uf;
  var VOID = kotlin_kotlin.$_$.g;
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.q;
  var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.l2;
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.m3;
  var sequence = kotlin_kotlin.$_$.vh;
  var listOfNotNull = kotlin_kotlin.$_$.oa;
  var toString = kotlin_kotlin.$_$.yf;
  var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.f2;
  var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.n1;
  var collectionSizeOrDefault = kotlin_kotlin.$_$.z7;
  var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.p;
  var ensureNotNull = kotlin_kotlin.$_$.xm;
  var equals = kotlin_kotlin.$_$.ie;
  var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.o2;
  var SuspendFunction1 = kotlin_kotlin.$_$.od;
  var objectCreate = kotlin_kotlin.$_$.rf;
  var emptyList = kotlin_kotlin.$_$.d9;
  var MutableList = kotlin_kotlin.$_$.f7;
  var isInterface = kotlin_kotlin.$_$.df;
  var objectMeta = kotlin_kotlin.$_$.sf;
  var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.d1;
  var toList = kotlin_kotlin.$_$.ic;
  var asSequence = kotlin_kotlin.$_$.hh;
  var checkCountOverflow = kotlin_kotlin.$_$.w7;
  var isBlank = kotlin_kotlin.$_$.ri;
  var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.d3;
  var indexOf = kotlin_kotlin.$_$.qi;
  var to = kotlin_kotlin.$_$.un;
  var split = kotlin_kotlin.$_$.oj;
  var THROW_IAE = kotlin_kotlin.$_$.dm;
  var enumEntries = kotlin_kotlin.$_$.sd;
  var Enum = kotlin_kotlin.$_$.pl;
  var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.v5;
  var arrayOf = kotlin_kotlin.$_$.rm;
  var createKType = kotlin_kotlin.$_$.b;
  var serializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.u3;
  var KSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.l3;
  var getKClass = kotlin_kotlin.$_$.e;
  var buildClassSerialDescriptor = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.t1;
  var Companion_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.r;
  var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.on;
  var interfaceMeta = kotlin_kotlin.$_$.ue;
  var asSequence_0 = kotlin_kotlin.$_$.t7;
  var plus = kotlin_kotlin.$_$.sh;
  var toList_0 = kotlin_kotlin.$_$.xh;
  var Iterable = kotlin_kotlin.$_$.u6;
  var StringCompanionObject_getInstance = kotlin_kotlin.$_$.t5;
  var serializer_0 = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.c1;
  var flatMap = kotlin_kotlin.$_$.mh;
  var fillArrayVal = kotlin_kotlin.$_$.ke;
  var sequenceOf = kotlin_kotlin.$_$.uh;
  var Iterator = kotlin_kotlin.$_$.v6;
  var getStringHashCode = kotlin_kotlin.$_$.re;
  var Collection = kotlin_kotlin.$_$.p6;
  var ListSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.y;
  var SerialDescriptor = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.o1;
  var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.a1;
  var reversed = kotlin_kotlin.$_$.wg;
  var firstOrNull = kotlin_kotlin.$_$.l9;
  var firstOrNull_0 = kotlin_kotlin.$_$.lh;
  var filter = kotlin_kotlin.$_$.kh;
  var map = kotlin_kotlin.$_$.qh;
  var IndexOutOfBoundsException_init_$Create$_0 = kotlin_kotlin.$_$.p2;
  var IndexOutOfBoundsException = kotlin_kotlin.$_$.ul;
  var contentEquals = kotlin_kotlin.$_$.f8;
  var contentHashCode = kotlin_kotlin.$_$.l8;
  var ArrayDeque_init_$Create$ = kotlin_kotlin.$_$.o;
  var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.q2;
  var joinToString = kotlin_kotlin.$_$.da;
  var getKClassFromExpression = kotlin_kotlin.$_$.d;
  var captureStack = kotlin_kotlin.$_$.yd;
  var RuntimeException = kotlin_kotlin.$_$.bm;
  var charSequenceGet = kotlin_kotlin.$_$.be;
  var charSequenceSubSequence = kotlin_kotlin.$_$.de;
  var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.m1;
  var repeat = kotlin_kotlin.$_$.ij;
  var Annotation = kotlin_kotlin.$_$.fl;
  var RuntimeException_init_$Create$ = kotlin_kotlin.$_$.y2;
  var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.t3;
  var concatToString = kotlin_kotlin.$_$.di;
  var copyOf = kotlin_kotlin.$_$.t8;
  var numberToChar = kotlin_kotlin.$_$.nf;
  var println = kotlin_kotlin.$_$.ud;
  var toInt = kotlin_kotlin.$_$.kk;
  var toInt_0 = kotlin_kotlin.$_$.lk;
  var Char = kotlin_kotlin.$_$.jl;
  var toString_0 = kotlin_kotlin.$_$.u3;
  var StringBuilder = kotlin_kotlin.$_$.ai;
  var copyOf_0 = kotlin_kotlin.$_$.x8;
  var arrayCopy = kotlin_kotlin.$_$.n7;
  var fill = kotlin_kotlin.$_$.i9;
  var charArray = kotlin_kotlin.$_$.ae;
  var HashMap_init_$Create$ = kotlin_kotlin.$_$.t;
  var substringBefore = kotlin_kotlin.$_$.yj;
  var substringAfter = kotlin_kotlin.$_$.tj;
  var _UInt___init__impl__l7qpdl = kotlin_kotlin.$_$.i4;
  var UIntRange = kotlin_kotlin.$_$.jg;
  var UInt__compareTo_impl_yacclj = kotlin_kotlin.$_$.j4;
  var _UShort___init__impl__jigrne = kotlin_kotlin.$_$.c5;
  var _Char___init__impl__6a9atx_0 = kotlin_kotlin.$_$.n3;
  var _UInt___get_data__impl__f0vqqw = kotlin_kotlin.$_$.k4;
  var toShort = kotlin_kotlin.$_$.xf;
  var uintCompare = kotlin_kotlin.$_$.vn;
  var Pair = kotlin_kotlin.$_$.zl;
  var toString_1 = kotlin_kotlin.$_$.pk;
  var isCharSequence = kotlin_kotlin.$_$.ze;
  var trimStart = kotlin_kotlin.$_$.yk;
  var isHighSurrogate = kotlin_kotlin.$_$.ti;
  var UInt = kotlin_kotlin.$_$.jm;
  var downTo = kotlin_kotlin.$_$.ug;
  var copyOf_1 = kotlin_kotlin.$_$.y8;
  var getProgressionLastElement = kotlin_kotlin.$_$.td;
  var joinToString_0 = kotlin_kotlin.$_$.ca;
  var listOf = kotlin_kotlin.$_$.pa;
  var booleanArray = kotlin_kotlin.$_$.xd;
  var NoSuchElementException_init_$Create$_0 = kotlin_kotlin.$_$.s2;
  var AssertionError_init_$Create$ = kotlin_kotlin.$_$.p1;
  var NotImplementedError = kotlin_kotlin.$_$.xl;
  var startsWith = kotlin_kotlin.$_$.pj;
  var Exception_init_$Init$ = kotlin_kotlin.$_$.w1;
  var Exception_init_$Init$_0 = kotlin_kotlin.$_$.x1;
  var Exception_init_$Init$_1 = kotlin_kotlin.$_$.z1;
  var Exception_init_$Init$_2 = kotlin_kotlin.$_$.v1;
  var Exception = kotlin_kotlin.$_$.rl;
  var get_js = kotlin_kotlin.$_$.hf;
  var hashCode = kotlin_kotlin.$_$.se;
  var Appendable = kotlin_kotlin.$_$.zh;
  var joinTo = kotlin_kotlin.$_$.ea;
  var HashSet_init_$Create$ = kotlin_kotlin.$_$.x;
  //endregion
  //region block: pre-declaration
  setMetadataFor(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9, 'DomReader$<get-namespaceContext>$o$iterator$slambda', classMeta, CoroutineImpl, [CoroutineImpl], VOID, VOID, VOID, [1]);
  setMetadataFor(NamespaceContext, 'NamespaceContext', interfaceMeta);
  function getPrefixes(namespaceURI) {
    return this.getPrefixesCompat_d6ifqa_k$(namespaceURI);
  }
  setMetadataFor(NamespaceContextImpl, 'NamespaceContextImpl', interfaceMeta, VOID, [NamespaceContext]);
  function freeze() {
    return SimpleNamespaceContext_init_$Create$_4(this);
  }
  function plus_0(secondary) {
    return SimpleNamespaceContext_init_$Create$_3(toList_0(plus(asSequence_0(this), asSequence_0(secondary))));
  }
  setMetadataFor(IterableNamespaceContext, 'IterableNamespaceContext', interfaceMeta, VOID, [NamespaceContextImpl, Iterable]);
  setMetadataFor(DomReader$namespaceContext$1, VOID, classMeta, VOID, [IterableNamespaceContext]);
  setMetadataFor(AutoCloseable, 'AutoCloseable', interfaceMeta);
  setMetadataFor(Closeable, 'Closeable', interfaceMeta, VOID, [AutoCloseable]);
  function nextTag() {
    var event = this.next_20eer_k$();
    while (!(event === EventType_START_ELEMENT_getInstance()) ? !(event === EventType_END_ELEMENT_getInstance()) : false) {
      if (event === EventType_TEXT_getInstance()) {
        if (!isXmlWhitespace(this.get_text_wouvsm_k$())) {
          throw XmlException_init_$Create$_0('Unexpected text content');
        }
      }
      event = this.next_20eer_k$();
    }
    return event;
  }
  function get_name() {
    return qname(this.get_namespaceURI_g6nmhy_k$(), this.get_localName_bf4zrn_k$(), this.get_prefix_i78za3_k$());
  }
  function require_0(type, namespace, name) {
    if (!this.get_eventType_918hfv_k$().equals(type))
      throw XmlException_init_$Create$_0('Type ' + this.get_eventType_918hfv_k$() + ' does not match expected type "' + type + '" (' + this.get_locationInfo_3kny30_k$() + ')');
    else if (!(namespace == null) ? !(this.get_namespaceURI_g6nmhy_k$() === namespace) : false)
      throw XmlException_init_$Create$_0('Namespace ' + this.get_namespaceURI_g6nmhy_k$() + ' does not match expected "' + namespace + '" (' + this.get_locationInfo_3kny30_k$() + ')');
    else if (!(name == null) ? !(this.get_localName_bf4zrn_k$() === name) : false)
      throw XmlException_init_$Create$_0('local name ' + this.get_localName_bf4zrn_k$() + ' does not match expected "' + name + '" (' + this.get_locationInfo_3kny30_k$() + ')');
  }
  function require_1(type, name) {
    var tmp;
    if (name == null) {
      tmp = null;
    } else {
      // Inline function 'nl.adaptivity.xmlutil.namespaceURI' call
      tmp = name.getNamespaceURI_665tvr_k$();
    }
    var tmp_0 = tmp;
    var tmp_1;
    if (name == null) {
      tmp_1 = null;
    } else {
      // Inline function 'nl.adaptivity.xmlutil.localPart' call
      tmp_1 = name.getLocalPart_k3cdyw_k$();
    }
    return this.require_glcost_k$(type, tmp_0, tmp_1);
  }
  function getAttributeName(index) {
    return qname(this.getAttributeNamespace_wj9j6l_k$(index), this.getAttributeLocalName_i25hjc_k$(index), this.getAttributePrefix_luun28_k$(index));
  }
  function getAttributeValue(name) {
    // Inline function 'nl.adaptivity.xmlutil.namespaceURI' call
    var tmp = name.getNamespaceURI_665tvr_k$();
    // Inline function 'nl.adaptivity.xmlutil.localPart' call
    var tmp$ret$1 = name.getLocalPart_k3cdyw_k$();
    return this.getAttributeValue_8yb7e2_k$(tmp, tmp$ret$1);
  }
  function isWhitespace() {
    return this.get_eventType_918hfv_k$() === EventType_IGNORABLE_WHITESPACE_getInstance() ? true : this.get_eventType_918hfv_k$() === EventType_TEXT_getInstance() ? isXmlWhitespace(this.get_text_wouvsm_k$()) : false;
  }
  function isEndElement() {
    return this.get_eventType_918hfv_k$() === EventType_END_ELEMENT_getInstance();
  }
  function isCharacters() {
    return this.get_eventType_918hfv_k$() === EventType_TEXT_getInstance();
  }
  function isStartElement() {
    return this.get_eventType_918hfv_k$() === EventType_START_ELEMENT_getInstance();
  }
  setMetadataFor(XmlReader, 'XmlReader', interfaceMeta, VOID, [Closeable, Iterator]);
  setMetadataFor(DomReader, 'DomReader', classMeta, VOID, [XmlReader]);
  setMetadataFor(Companion, 'Companion', objectMeta);
  setMetadataFor(DomWriter$namespaceContext$1, VOID, classMeta, VOID, [NamespaceContextImpl]);
  function set_indent(value) {
    this.set_indentString_30d8vk_k$(repeat(' ', value));
  }
  function get_indent() {
    return countIndentedLength(this.get_indentString_li4jl2_k$());
  }
  function setPrefix(prefix, namespaceUri) {
    this.setPrefix_e36xz8_k$(toString(prefix), toString(namespaceUri));
  }
  function namespaceAttr(namespacePrefix, namespaceUri) {
    this.namespaceAttr_vkifxg_k$(toString(namespacePrefix), toString(namespaceUri));
  }
  function namespaceAttr_0(namespace) {
    this.namespaceAttr_vkifxg_k$(namespace.get_prefix_i78za3_k$(), namespace.get_namespaceURI_g6nmhy_k$());
  }
  function processingInstruction(target, data) {
    return this.processingInstruction_2btz8x_k$(target + ' ' + data);
  }
  function startDocument$default(version, encoding, standalone, $super) {
    version = version === VOID ? null : version;
    encoding = encoding === VOID ? null : encoding;
    standalone = standalone === VOID ? null : standalone;
    var tmp;
    if ($super === VOID) {
      this.startDocument_dbnt67_k$(version, encoding, standalone);
      tmp = Unit_getInstance();
    } else {
      tmp = $super.startDocument_dbnt67_k$.call(this, version, encoding, standalone);
    }
    return tmp;
  }
  setMetadataFor(XmlWriter, 'XmlWriter', interfaceMeta, VOID, [Closeable]);
  setMetadataFor(PlatformXmlWriterBase, 'PlatformXmlWriterBase', classMeta, VOID, [XmlWriter]);
  setMetadataFor(DomWriter, 'DomWriter', classMeta, PlatformXmlWriterBase, [PlatformXmlWriterBase, XmlWriter], DomWriter_init_$Create$);
  setMetadataFor(EventType, 'EventType', classMeta, Enum);
  setMetadataFor(EventType$START_DOCUMENT, 'START_DOCUMENT', classMeta, EventType);
  setMetadataFor(EventType$START_ELEMENT, 'START_ELEMENT', classMeta, EventType);
  setMetadataFor(EventType$END_ELEMENT, 'END_ELEMENT', classMeta, EventType);
  setMetadataFor(EventType$COMMENT, 'COMMENT', classMeta, EventType);
  setMetadataFor(EventType$TEXT, 'TEXT', classMeta, EventType);
  setMetadataFor(EventType$CDSECT, 'CDSECT', classMeta, EventType);
  setMetadataFor(EventType$DOCDECL, 'DOCDECL', classMeta, EventType);
  setMetadataFor(EventType$END_DOCUMENT, 'END_DOCUMENT', classMeta, EventType);
  setMetadataFor(EventType$ENTITY_REF, 'ENTITY_REF', classMeta, EventType);
  setMetadataFor(EventType$IGNORABLE_WHITESPACE, 'IGNORABLE_WHITESPACE', classMeta, EventType);
  setMetadataFor(EventType$ATTRIBUTE, 'ATTRIBUTE', classMeta, EventType);
  setMetadataFor(EventType$PROCESSING_INSTRUCTION, 'PROCESSING_INSTRUCTION', classMeta, EventType);
  setMetadataFor(Companion_0, 'Companion', objectMeta, VOID, [KSerializer]);
  function component1() {
    return this.get_prefix_i78za3_k$();
  }
  function component2() {
    return this.get_namespaceURI_g6nmhy_k$();
  }
  setMetadataFor(Namespace, 'Namespace', interfaceMeta);
  setMetadataFor(QNameSerializer, 'QNameSerializer', objectMeta, VOID, [KSerializer]);
  setMetadataFor(SimpleIterator, 'SimpleIterator', classMeta, VOID, [Iterator]);
  setMetadataFor(SimpleNamespace, 'SimpleNamespace', classMeta, VOID, [Namespace]);
  setMetadataFor(Companion_1, 'Companion', objectMeta, VOID, [KSerializer]);
  setMetadataFor(SimpleNamespaceContext, 'SimpleNamespaceContext', classMeta, VOID, [IterableNamespaceContext], SimpleNamespaceContext_init_$Create$, VOID, {0: Companion_getInstance_2});
  setMetadataFor(XMLConstants, 'XMLConstants', objectMeta);
  setMetadataFor(XmlBufferedReaderBase, 'XmlBufferedReaderBase', classMeta, VOID, [XmlReader]);
  setMetadataFor(XmlBufferedReader, 'XmlBufferedReader', classMeta, XmlBufferedReaderBase);
  setMetadataFor(XmlDelegatingReader, 'XmlDelegatingReader', classMeta, VOID, [XmlReader]);
  setMetadataFor(XmlDeserializerFactory, 'XmlDeserializerFactory', interfaceMeta);
  setMetadataFor(Companion_2, 'Companion', objectMeta);
  setMetadataFor(XmlEvent, 'XmlEvent', classMeta);
  setMetadataFor(TextEvent, 'TextEvent', classMeta, XmlEvent);
  setMetadataFor(ProcessingInstructionEvent, 'ProcessingInstructionEvent', classMeta, TextEvent);
  setMetadataFor(EntityRefEvent, 'EntityRefEvent', classMeta, TextEvent);
  setMetadataFor(EndDocumentEvent, 'EndDocumentEvent', classMeta, XmlEvent);
  setMetadataFor(NamedEvent, 'NamedEvent', classMeta, XmlEvent);
  setMetadataFor(EndElementEvent, 'EndElementEvent', classMeta, NamedEvent);
  setMetadataFor(StartDocumentEvent, 'StartDocumentEvent', classMeta, XmlEvent);
  setMetadataFor(StartElementEvent, 'StartElementEvent', classMeta, NamedEvent);
  setMetadataFor(Attribute, 'Attribute', classMeta, XmlEvent);
  setMetadataFor(NamespaceImpl, 'NamespaceImpl', classMeta, VOID, [Namespace]);
  setMetadataFor(IOException, 'IOException', classMeta, Exception, VOID, IOException_init_$Create$);
  setMetadataFor(XmlException, 'XmlException', classMeta, IOException, VOID, XmlException_init_$Create$);
  setMetadataFor(XmlSerializable, 'XmlSerializable', interfaceMeta);
  setMetadataFor(Companion_3, 'Companion', objectMeta);
  setMetadataFor(XmlDeclMode, 'XmlDeclMode', classMeta, Enum);
  setMetadataFor(ExperimentalXmlUtilApi, 'ExperimentalXmlUtilApi', classMeta, VOID, [Annotation]);
  setMetadataFor(XmlUtilInternal, 'XmlUtilInternal', classMeta, VOID, [Annotation]);
  setMetadataFor(Companion_4, 'Companion', objectMeta);
  setMetadataFor(ElementStack, 'ElementStack', classMeta, VOID, VOID, ElementStack);
  setMetadataFor(ElementDelegate, 'ElementDelegate', classMeta);
  setMetadataFor(AttributesCollection, 'AttributesCollection', classMeta, VOID, VOID, AttributesCollection);
  setMetadataFor(AttributeDelegate, 'AttributeDelegate', classMeta);
  setMetadataFor(KtXmlReader, 'KtXmlReader', classMeta, VOID, [XmlReader]);
  setMetadataFor(EscapeMode, 'EscapeMode', classMeta, Enum);
  setMetadataFor(Companion_5, 'Companion', objectMeta);
  setMetadataFor(WriteState, 'WriteState', classMeta, Enum);
  setMetadataFor(KtXmlWriter, 'KtXmlWriter', classMeta, PlatformXmlWriterBase, [PlatformXmlWriterBase, XmlWriter]);
  setMetadataFor(asCodePoints$1$iterator$1, VOID, classMeta, VOID, [Iterator]);
  setMetadataFor(asCodePoints$1, VOID, classMeta, VOID, [Iterable]);
  setMetadataFor(XmlVersion, 'XmlVersion', classMeta, Enum);
  setMetadataFor(NamespaceHolder$namespaceContext$1, VOID, classMeta, VOID, [IterableNamespaceContext]);
  setMetadataFor(NamespaceHolder$iterator$1, VOID, classMeta, VOID, [Iterator]);
  setMetadataFor(NamespaceHolder, 'NamespaceHolder', classMeta, VOID, [Iterable], NamespaceHolder);
  setMetadataFor(Companion_6, 'Companion', objectMeta);
  setMetadataFor(NamedNodeMapIterator, 'NamedNodeMapIterator', classMeta, VOID, [Iterator]);
  setMetadataFor(NodeConsts, 'NodeConsts', objectMeta);
  setMetadataFor(NodeListIterator, 'NodeListIterator', classMeta, VOID, [Iterator]);
  setMetadataFor(ICompactFragment, 'ICompactFragment', interfaceMeta, VOID, [XmlSerializable]);
  setMetadataFor(QName, 'QName', classMeta);
  setMetadataFor(XmlStreaming, 'XmlStreaming', objectMeta);
  setMetadataFor(XmlStreamingFactory, 'XmlStreamingFactory', interfaceMeta);
  setMetadataFor(AppendingWriter, 'AppendingWriter', classMeta, VOID, [XmlWriter]);
  setMetadataFor(WriterXmlWriter, 'WriterXmlWriter', classMeta, VOID, [XmlWriter]);
  setMetadataFor(Writer, 'Writer', classMeta, VOID, [Appendable]);
  setMetadataFor(StringWriter, 'StringWriter', classMeta, Writer, VOID, StringWriter);
  setMetadataFor(Language, 'Language', classMeta, VOID, [Annotation]);
  setMetadataFor(Throws, 'Throws', classMeta, VOID, [Annotation]);
  setMetadataFor(Reader, 'Reader', classMeta);
  setMetadataFor(StringReader, 'StringReader', classMeta, Reader);
  setMetadataFor(Factory, 'Factory', classMeta, VOID, [XmlDeserializerFactory], Factory);
  setMetadataFor(Companion_7, 'Companion', objectMeta);
  setMetadataFor(CompactFragment, 'CompactFragment', classMeta, VOID, [ICompactFragment]);
  setMetadataFor(FragmentNamespaceContext, 'FragmentNamespaceContext', classMeta, SimpleNamespaceContext);
  setMetadataFor(Companion_8, 'Companion', objectMeta);
  setMetadataFor(XMLFragmentStreamReader, 'XMLFragmentStreamReader', classMeta, XmlDelegatingReader);
  //endregion
  function _get_currentElement__mbt3qg($this) {
    return $this.currentElement_1;
  }
  function DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9(this$0, resultContinuation) {
    this.this$0__1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9).invoke_u4iaop_k$ = function ($this$sequence, $completion) {
    var tmp = this.create_cqiuad_k$($this$sequence, $completion);
    tmp.set_result_xj64lm_k$(Unit_getInstance());
    tmp.set_exception_px07aa_k$(null);
    return tmp.doResume_5yljmg_k$();
  };
  protoOf(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9).invoke_qns8j1_k$ = function (p1, $completion) {
    return this.invoke_u4iaop_k$(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
  };
  protoOf(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9).doResume_5yljmg_k$ = function () {
    var suspendResult = this.get_result_iyg5d2_k$();
    $sm: do
      try {
        var tmp = this.get_state_iypx7s_k$();
        switch (tmp) {
          case 0:
            this.set_exceptionState_fex74n_k$(8);
            this.c0__1 = this.this$0__1.currentElement_1;
            this.set_state_rjd8d0_k$(1);
            continue $sm;
          case 1:
            if (!!(this.c0__1 == null)) {
              this.set_state_rjd8d0_k$(7);
              continue $sm;
            }

            var tmp_0 = this;
            tmp_0.this1__1 = this.c0__1.attributes;
            this.l2__1 = this.this1__1.length;
            this.tmp0_iterator3__1 = until(0, this.l2__1).iterator_jk1svi_k$();
            this.set_state_rjd8d0_k$(2);
            continue $sm;
          case 2:
            if (!this.tmp0_iterator3__1.hasNext_bitz1p_k$()) {
              this.set_state_rjd8d0_k$(6);
              continue $sm;
            }

            this.idx4__1 = this.tmp0_iterator3__1.next_20eer_k$();
            var tmp_1 = this;
            var tmp_2 = this.this1__1.item(this.idx4__1);
            tmp_1.attr5__1 = (!(tmp_2 == null) ? !(tmp_2 == null) : false) ? tmp_2 : THROW_CCE();
            if (this.attr5__1.prefix === 'xmlns') {
              this.set_state_rjd8d0_k$(4);
              var tmp0_elvis_lhs = this.attr5__1.localName;
              suspendResult = this.$this$sequence_1.yield_3xhcex_k$(new NamespaceImpl(tmp0_elvis_lhs == null ? this.attr5__1.name : tmp0_elvis_lhs, this.attr5__1.value), this);
              if (suspendResult === get_COROUTINE_SUSPENDED()) {
                return suspendResult;
              }
              continue $sm;
            } else {
              var tmp_3;
              var this_0 = this.attr5__1.prefix;
              if (this_0 == null ? true : charSequenceLength(this_0) === 0) {
                tmp_3 = this.attr5__1.localName === 'xmlns';
              } else {
                tmp_3 = false;
              }
              if (tmp_3) {
                this.set_state_rjd8d0_k$(3);
                suspendResult = this.$this$sequence_1.yield_3xhcex_k$(new NamespaceImpl('', this.attr5__1.value), this);
                if (suspendResult === get_COROUTINE_SUSPENDED()) {
                  return suspendResult;
                }
                continue $sm;
              } else {
                this.set_state_rjd8d0_k$(5);
                continue $sm;
              }
            }

          case 3:
            this.set_state_rjd8d0_k$(5);
            continue $sm;
          case 4:
            this.set_state_rjd8d0_k$(5);
            continue $sm;
          case 5:
            this.set_state_rjd8d0_k$(2);
            continue $sm;
          case 6:
            this.c0__1 = this.c0__1.parentElement;
            this.set_state_rjd8d0_k$(1);
            continue $sm;
          case 7:
            return Unit_getInstance();
          case 8:
            throw this.get_exception_x0n6w6_k$();
        }
      } catch ($p) {
        var e = $p;
        if (this.get_exceptionState_wflpxn_k$() === 8) {
          throw e;
        } else {
          this.set_state_rjd8d0_k$(this.get_exceptionState_wflpxn_k$());
          this.set_exception_px07aa_k$(e);
        }
      }
     while (true);
  };
  protoOf(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9).create_cqiuad_k$ = function ($this$sequence, completion) {
    var i = new DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9(this.this$0__1, completion);
    i.$this$sequence_1 = $this$sequence;
    return i;
  };
  protoOf(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9).create_wyq9v6_k$ = function (value, completion) {
    return this.create_cqiuad_k$(value instanceof SequenceScope ? value : THROW_CCE(), completion);
  };
  function DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9_0(this$0, resultContinuation) {
    var i = new DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9(this$0, resultContinuation);
    var l = function ($this$sequence, $completion) {
      return i.invoke_u4iaop_k$($this$sequence, $completion);
    };
    l.$arity = 1;
    return l;
  }
  function _set_current__qj3kk($this, _set____db54di) {
    $this.current_1 = _set____db54di;
  }
  function _get_current__qcrdxk($this) {
    return $this.current_1;
  }
  function _set_isStarted__srcka6($this, _set____db54di) {
    $this.isStarted_1 = _set____db54di;
  }
  function _set_atEndOfElement__3r99p6($this, _set____db54di) {
    $this.atEndOfElement_1 = _set____db54di;
  }
  function _get_atEndOfElement__tacpqm($this) {
    return $this.atEndOfElement_1;
  }
  function _set_depth__dghfxe($this, _set____db54di) {
    $this.depth_1 = _set____db54di;
  }
  function _set__namespaceAttrs__ndv02n($this, _set____db54di) {
    $this._namespaceAttrs_1 = _set____db54di;
  }
  function _get__namespaceAttrs__xhl7l7($this) {
    return $this._namespaceAttrs_1;
  }
  function _get_namespaceAttrs__14mg2s($this) {
    var tmp0_elvis_lhs = $this._namespaceAttrs_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      // Inline function 'kotlin.also' call
      // Inline function 'nl.adaptivity.xmlutil.util.filterTyped' call
      var this_0 = _get_requireCurrentElem__bg81k8($this).attributes;
      // Inline function 'kotlin.collections.mutableListOf' call
      var result = ArrayList_init_$Create$();
      // Inline function 'nl.adaptivity.xmlutil.util.forEachAttr' call
      var l = this_0.length;
      var inductionVariable = 0;
      if (inductionVariable < l)
        do {
          var idx = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          // Inline function 'nl.adaptivity.xmlutil.util.filterTyped.<anonymous>' call
          var tmp_0 = this_0.item(idx);
          var attr = (!(tmp_0 == null) ? !(tmp_0 == null) : false) ? tmp_0 : THROW_CCE();
          // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-namespaceAttrs>.<anonymous>' call
          var tmp_1;
          var tmp_2;
          if (attr.namespaceURI == null ? true : attr.namespaceURI === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$()) {
            var tmp_3;
            if (attr.prefix === 'xmlns') {
              tmp_3 = true;
            } else {
              var tmp_4;
              // Inline function 'kotlin.text.isNullOrEmpty' call
              var this_1 = attr.prefix;
              // Inline function 'kotlin.contracts.contract' call
              if (this_1 == null ? true : charSequenceLength(this_1) === 0) {
                tmp_4 = attr.localName === 'xmlns';
              } else {
                tmp_4 = false;
              }
              tmp_3 = tmp_4;
            }
            tmp_2 = tmp_3;
          } else {
            tmp_2 = false;
          }
          if (tmp_2) {
            tmp_1 = !(attr.value === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$());
          } else {
            tmp_1 = false;
          }
          if (tmp_1) {
            result.add_utx5q5_k$(attr);
          }
        }
         while (inductionVariable < l);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-namespaceAttrs>.<anonymous>' call
      $this._namespaceAttrs_1 = result;
      tmp = result;
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  }
  function _get_requireCurrent__f4sn5j($this) {
    var tmp0_elvis_lhs = $this.current_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IllegalStateException_init_$Create$('No current element');
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  }
  function _get_requireCurrentElem__bg81k8($this) {
    var tmp0_elvis_lhs = $this.get_currentElement_kfm01g_k$();
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IllegalStateException_init_$Create$('No current element');
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  }
  function _get_locationInfo_$helper_86tu52(node, result) {
    var tmp;
    if (node == null ? true : node.nodeType === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$()) {
      tmp = result;
    } else if (get_isElement(node)) {
      // Inline function 'kotlin.apply' call
      var this_0 = _get_locationInfo_$helper_86tu52(node.parentNode, result);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-locationInfo>.helper.<anonymous>' call
      this_0.append_am5a4z_k$(_Char___init__impl__6a9atx(47)).append_jgojdo_k$(node.nodeName);
      tmp = this_0;
    } else if (get_isText(node)) {
      // Inline function 'kotlin.apply' call
      var this_1 = _get_locationInfo_$helper_86tu52(node.parentNode, result);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-locationInfo>.helper.<anonymous>' call
      this_1.append_jgojdo_k$('/text()');
      tmp = this_1;
    } else {
      // Inline function 'kotlin.apply' call
      var this_2 = _get_locationInfo_$helper_86tu52(node.parentNode, result);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-locationInfo>.helper.<anonymous>' call
      this_2.append_jgojdo_k$('/.');
      tmp = this_2;
    }
    return tmp;
  }
  function DomReader$namespaceContext$1(this$0) {
    var tmp = this;
    var tmp_0 = _get_requireCurrent__f4sn5j(this$0);
    var tmp0_elvis_lhs = !(tmp_0 == null) ? tmp_0 : null;
    var tmp_1;
    if (tmp0_elvis_lhs == null) {
      var tmp_2 = _get_requireCurrent__f4sn5j(this$0).parentNode;
      tmp_1 = (!(tmp_2 == null) ? !(tmp_2 == null) : false) ? tmp_2 : null;
    } else {
      tmp_1 = tmp0_elvis_lhs;
    }
    tmp.currentElement_1 = tmp_1;
  }
  protoOf(DomReader$namespaceContext$1).getNamespaceURI_859c43_k$ = function (prefix) {
    var tmp0_safe_receiver = this.currentElement_1;
    return tmp0_safe_receiver == null ? null : myLookupNamespaceURI(tmp0_safe_receiver, prefix);
  };
  protoOf(DomReader$namespaceContext$1).getPrefix_7o0aoe_k$ = function (namespaceURI) {
    var tmp0_safe_receiver = this.currentElement_1;
    return tmp0_safe_receiver == null ? null : myLookupPrefix(tmp0_safe_receiver, namespaceURI);
  };
  protoOf(DomReader$namespaceContext$1).freeze_kxzejt_k$ = function () {
    return this;
  };
  protoOf(DomReader$namespaceContext$1).iterator_jk1svi_k$ = function () {
    return sequence(DomReader$_get_namespaceContext_$o$iterator$slambda_vvguk9_0(this, null)).iterator_jk1svi_k$();
  };
  protoOf(DomReader$namespaceContext$1).getPrefixesCompat_d6ifqa_k$ = function (namespaceURI) {
    return listOfNotNull(this.getPrefix_7o0aoe_k$(namespaceURI)).iterator_jk1svi_k$();
  };
  function DomReader(delegate) {
    this.delegate_1 = delegate;
    this.current_1 = null;
    this.isStarted_1 = false;
    this.atEndOfElement_1 = false;
    this.depth_1 = 0;
    this._namespaceAttrs_1 = null;
  }
  protoOf(DomReader).get_delegate_i94tki_k$ = function () {
    return this.delegate_1;
  };
  protoOf(DomReader).get_namespaceURI_g6nmhy_k$ = function () {
    var tmp0_safe_receiver = this.get_currentElement_kfm01g_k$();
    var tmp;
    if (tmp0_safe_receiver == null) {
      tmp = null;
    } else {
      // Inline function 'kotlin.run' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-namespaceURI>.<anonymous>' call
      var tmp0_elvis_lhs = tmp0_safe_receiver.namespaceURI;
      tmp = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
    }
    var tmp1_elvis_lhs = tmp;
    var tmp_0;
    if (tmp1_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Only elements have a namespace uri');
    } else {
      tmp_0 = tmp1_elvis_lhs;
    }
    return tmp_0;
  };
  protoOf(DomReader).get_localName_bf4zrn_k$ = function () {
    var tmp0_safe_receiver = this.get_currentElement_kfm01g_k$();
    var tmp;
    if (tmp0_safe_receiver == null) {
      tmp = null;
    } else {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-localName>.<anonymous>' call
      var tmp0_elvis_lhs = tmp0_safe_receiver.localName;
      tmp = tmp0_elvis_lhs == null ? tmp0_safe_receiver.tagName : tmp0_elvis_lhs;
    }
    var tmp1_elvis_lhs = tmp;
    var tmp_0;
    if (tmp1_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Only elements have a local name');
    } else {
      tmp_0 = tmp1_elvis_lhs;
    }
    return tmp_0;
  };
  protoOf(DomReader).get_prefix_i78za3_k$ = function () {
    var tmp0_safe_receiver = this.get_currentElement_kfm01g_k$();
    var tmp;
    if (tmp0_safe_receiver == null) {
      tmp = null;
    } else {
      // Inline function 'kotlin.run' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-prefix>.<anonymous>' call
      var tmp0_elvis_lhs = tmp0_safe_receiver.prefix;
      tmp = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
    }
    var tmp1_elvis_lhs = tmp;
    var tmp_0;
    if (tmp1_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Only elements have a prefix');
    } else {
      tmp_0 = tmp1_elvis_lhs;
    }
    return tmp_0;
  };
  protoOf(DomReader).get_isStarted_wg74c2_k$ = function () {
    return this.isStarted_1;
  };
  protoOf(DomReader).get_depth_iq7qmy_k$ = function () {
    return this.depth_1;
  };
  protoOf(DomReader).get_piTarget_jrarar_k$ = function () {
    var c = _get_requireCurrent__f4sn5j(this);
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    if (!(c.nodeType === NodeConsts_getInstance().get_PROCESSING_INSTRUCTION_NODE_34ol86_k$())) {
      // Inline function 'kotlin.require.<anonymous>' call
      var message = 'Failed requirement.';
      throw IllegalArgumentException_init_$Create$(toString(message));
    }
    // Inline function 'nl.adaptivity.xmlutil.dom.getTarget' call
    return (!(c == null) ? c : THROW_CCE()).target;
  };
  protoOf(DomReader).get_piData_i1pnws_k$ = function () {
    var c = _get_requireCurrent__f4sn5j(this);
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    if (!(c.nodeType === NodeConsts_getInstance().get_PROCESSING_INSTRUCTION_NODE_34ol86_k$())) {
      // Inline function 'kotlin.require.<anonymous>' call
      var message = 'Failed requirement.';
      throw IllegalArgumentException_init_$Create$(toString(message));
    }
    // Inline function 'nl.adaptivity.xmlutil.dom.getData' call
    return (!(c == null) ? c : THROW_CCE()).data;
  };
  protoOf(DomReader).get_text_wouvsm_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp1_subject = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nodeType;
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if ((tmp1_subject == null ? null : tmp1_subject) === NodeConsts_getInstance().get_ENTITY_REFERENCE_NODE_3pz5x3_k$()) {
      tmp_2 = true;
    } else {
      tmp_2 = (tmp1_subject == null ? null : tmp1_subject) === NodeConsts_getInstance().get_COMMENT_NODE_eipp6d_k$();
    }
    if (tmp_2) {
      tmp_1 = true;
    } else {
      tmp_1 = (tmp1_subject == null ? null : tmp1_subject) === NodeConsts_getInstance().get_TEXT_NODE_x3rt91_k$();
    }
    if (tmp_1) {
      tmp_0 = true;
    } else {
      tmp_0 = (tmp1_subject == null ? null : tmp1_subject) === NodeConsts_getInstance().get_CDATA_SECTION_NODE_v6gjhl_k$();
    }
    if (tmp_0) {
      var tmp_3 = this.current_1;
      tmp = ((!(tmp_3 == null) ? !(tmp_3 == null) : false) ? tmp_3 : THROW_CCE()).data;
    } else {
      if ((tmp1_subject == null ? null : tmp1_subject) === NodeConsts_getInstance().get_PROCESSING_INSTRUCTION_NODE_34ol86_k$()) {
        // Inline function 'kotlin.let' call
        var tmp_4 = this.current_1;
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-text>.<anonymous>' call
        var it = (!(tmp_4 == null) ? !(tmp_4 == null) : false) ? tmp_4 : THROW_CCE();
        var tmp_5 = it.nodeName;
        // Inline function 'nl.adaptivity.xmlutil.dom.getData' call
        tmp = tmp_5 + ' ' + it.data;
      } else {
        throw XmlException_init_$Create$_0('Node is not a text node');
      }
    }
    return tmp;
  };
  protoOf(DomReader).get_attributeCount_hqf30_k$ = function () {
    var tmp = this.current_1;
    var tmp0_safe_receiver = (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
    var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.attributes;
    var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.length;
    return tmp2_elvis_lhs == null ? 0 : tmp2_elvis_lhs;
  };
  protoOf(DomReader).get_eventType_918hfv_k$ = function () {
    var c = this.current_1;
    return c == null ? EventType_END_DOCUMENT_getInstance() : toEventType(c, this.atEndOfElement_1);
  };
  protoOf(DomReader).get_locationInfo_3kny30_k$ = function () {
    return _get_locationInfo_$helper_86tu52(this.current_1, StringBuilder_init_$Create$()).toString();
  };
  protoOf(DomReader).get_currentElement_kfm01g_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp;
    var tmp2_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nodeType;
    if ((tmp2_safe_receiver == null ? null : tmp2_safe_receiver) === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$()) {
      var tmp_0 = this.current_1;
      tmp = (!(tmp_0 == null) ? !(tmp_0 == null) : false) ? tmp_0 : THROW_CCE();
    } else {
      tmp = null;
    }
    return tmp;
  };
  protoOf(DomReader).get_namespaceContext_n7n1ib_k$ = function () {
    return new DomReader$namespaceContext$1(this);
  };
  protoOf(DomReader).get_namespaceDecls_1u0o6v_k$ = function () {
    // Inline function 'kotlin.collections.map' call
    var this_0 = _get_namespaceAttrs__14mg2s(this);
    // Inline function 'kotlin.collections.mapTo' call
    var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
    var tmp0_iterator = this_0.iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var item = tmp0_iterator.next_20eer_k$();
      // Inline function 'nl.adaptivity.xmlutil.DomReader.<get-namespaceDecls>.<anonymous>' call
      var tmp$ret$0 = item.prefix === 'xmlns' ? new NamespaceImpl(ensureNotNull(item.localName), item.value) : new NamespaceImpl('', item.value);
      destination.add_utx5q5_k$(tmp$ret$0);
    }
    return destination;
  };
  protoOf(DomReader).get_encoding_3i4b8k_k$ = function () {
    var d = this.delegate_1;
    var tmp;
    if (d.nodeType === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$()) {
      tmp = (!(d == null) ? d : THROW_CCE()).inputEncoding;
    } else {
      tmp = ensureNotNull(d.ownerDocument).inputEncoding;
    }
    return tmp;
  };
  protoOf(DomReader).get_standalone_tm0l3i_k$ = function () {
    return null;
  };
  protoOf(DomReader).get_version_72w4j3_k$ = function () {
    return '1.0';
  };
  protoOf(DomReader).hasNext_bitz1p_k$ = function () {
    var tmp;
    var tmp_0;
    if (this.atEndOfElement_1) {
      var tmp0_safe_receiver = this.current_1;
      tmp_0 = (tmp0_safe_receiver == null ? null : tmp0_safe_receiver.parentNode) == null;
    } else {
      tmp_0 = false;
    }
    if (!tmp_0) {
      tmp = true;
    } else {
      tmp = !equals(this.current_1, this.delegate_1);
    }
    return tmp;
  };
  protoOf(DomReader).next_20eer_k$ = function () {
    this._namespaceAttrs_1 = null;
    var c = this.current_1;
    if (c == null) {
      this.isStarted_1 = true;
      this.current_1 = this.delegate_1;
      return EventType_START_DOCUMENT_getInstance();
    } else {
      if (this.atEndOfElement_1) {
        if (!(c.nextSibling == null)) {
          this.current_1 = c.nextSibling;
          this.atEndOfElement_1 = false;
        } else {
          this.current_1 = c.parentNode;
          var tmp0_safe_receiver = this.current_1;
          var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : toEventType(tmp0_safe_receiver, true);
          return tmp1_elvis_lhs == null ? EventType_END_DOCUMENT_getInstance() : tmp1_elvis_lhs;
        }
      } else if (!(c.firstChild == null)) {
        this.current_1 = c.firstChild;
      } else {
        this.atEndOfElement_1 = true;
        return EventType_END_ELEMENT_getInstance();
      }
      var c2 = _get_requireCurrent__f4sn5j(this);
      var nodeType = c2.nodeType;
      if (!(nodeType === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$()) ? !(nodeType === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$()) : false) {
        this.atEndOfElement_1 = true;
      }
      return toEventType(c2, this.atEndOfElement_1);
    }
  };
  protoOf(DomReader).getAttributeNamespace_wj9j6l_k$ = function (index) {
    var tmp0_elvis_lhs = get_0(_get_requireCurrentElem__bg81k8(this).attributes, index);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IndexOutOfBoundsException_init_$Create$();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var attr = tmp;
    var tmp1_elvis_lhs = attr.namespaceURI;
    return tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
  };
  protoOf(DomReader).getAttributePrefix_luun28_k$ = function (index) {
    var tmp0_elvis_lhs = get_0(_get_requireCurrentElem__bg81k8(this).attributes, index);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IndexOutOfBoundsException_init_$Create$();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var attr = tmp;
    var tmp1_elvis_lhs = attr.prefix;
    return tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
  };
  protoOf(DomReader).getAttributeLocalName_i25hjc_k$ = function (index) {
    var tmp0_elvis_lhs = get_0(_get_requireCurrentElem__bg81k8(this).attributes, index);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IndexOutOfBoundsException_init_$Create$();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var attr = tmp;
    var tmp1_elvis_lhs = attr.localName;
    return tmp1_elvis_lhs == null ? attr.name : tmp1_elvis_lhs;
  };
  protoOf(DomReader).getAttributeValue_qah2od_k$ = function (index) {
    var tmp0_elvis_lhs = get_0(_get_requireCurrentElem__bg81k8(this).attributes, index);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IndexOutOfBoundsException_init_$Create$();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var attr = tmp;
    return attr.value;
  };
  protoOf(DomReader).getAttributeValue_8yb7e2_k$ = function (nsUri, localName) {
    return _get_requireCurrentElem__bg81k8(this).getAttributeNS(nsUri, localName);
  };
  protoOf(DomReader).close_yn9xrc_k$ = function () {
    this.current_1 = null;
  };
  protoOf(DomReader).getNamespacePrefix_8fyoot_k$ = function (namespaceUri) {
    return myLookupPrefix(_get_requireCurrent__f4sn5j(this), namespaceUri);
  };
  protoOf(DomReader).getNamespaceURI_859c43_k$ = function (prefix) {
    return myLookupNamespaceURI(_get_requireCurrent__f4sn5j(this), prefix);
  };
  function toEventType(_this__u8e3s4, endOfElement) {
    var tmp0_subject = _this__u8e3s4.nodeType;
    var tmp;
    if (tmp0_subject === NodeConsts_getInstance().get_ATTRIBUTE_NODE_ynn1g2_k$()) {
      tmp = EventType_ATTRIBUTE_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_CDATA_SECTION_NODE_v6gjhl_k$()) {
      tmp = EventType_CDSECT_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_COMMENT_NODE_eipp6d_k$()) {
      tmp = EventType_COMMENT_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_DOCUMENT_TYPE_NODE_eh0gng_k$()) {
      tmp = EventType_DOCDECL_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_ENTITY_REFERENCE_NODE_3pz5x3_k$()) {
      tmp = EventType_ENTITY_REF_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_DOCUMENT_FRAGMENT_NODE_tz3fyi_k$() ? true : tmp0_subject === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$()) {
      tmp = endOfElement ? EventType_END_DOCUMENT_getInstance() : EventType_START_DOCUMENT_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_PROCESSING_INSTRUCTION_NODE_34ol86_k$()) {
      tmp = EventType_PROCESSING_INSTRUCTION_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_TEXT_NODE_x3rt91_k$()) {
      tmp = isXmlWhitespace_1(ensureNotNull(_this__u8e3s4.textContent)) ? EventType_IGNORABLE_WHITESPACE_getInstance() : EventType_TEXT_getInstance();
    } else if (tmp0_subject === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$()) {
      tmp = endOfElement ? EventType_END_ELEMENT_getInstance() : EventType_START_ELEMENT_getInstance();
    } else {
      throw XmlException_init_$Create$_0('Unsupported event type (' + _this__u8e3s4 + ')');
    }
    return tmp;
  }
  function _get_TAG_DEPTH_NOT_TAG__lom46c($this) {
    return $this.TAG_DEPTH_NOT_TAG_1;
  }
  function _get_TAG_DEPTH_FORCE_INDENT_NEXT__lyzvog($this) {
    return $this.TAG_DEPTH_FORCE_INDENT_NEXT_1;
  }
  function collectDeclaredPrefixes(_this__u8e3s4, $this, namespaceUri, result, redeclared) {
    // Inline function 'nl.adaptivity.xmlutil.util.forEachAttr' call
    var this_0 = _this__u8e3s4.attributes;
    var l = this_0.length;
    var inductionVariable = 0;
    if (inductionVariable < l)
      do {
        var idx = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'nl.adaptivity.xmlutil.<no name provided>.collectDeclaredPrefixes.<anonymous>' call
        var tmp = this_0.item(idx);
        var attr = (!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE();
        var tmp_0;
        if (attr.prefix === 'xmlns') {
          tmp_0 = attr.localName;
        } else {
          var tmp_1;
          // Inline function 'kotlin.text.isNullOrEmpty' call
          var this_1 = attr.prefix;
          // Inline function 'kotlin.contracts.contract' call
          if (this_1 == null ? true : charSequenceLength(this_1) === 0) {
            tmp_1 = attr.localName === 'xmlns';
          } else {
            tmp_1 = false;
          }
          if (tmp_1) {
            tmp_0 = '';
          } else {
            tmp_0 = null;
          }
        }
        var prefix = tmp_0;
        if (!(prefix == null)) {
          if (redeclared.contains_aljjnj_k$(prefix)) {
            if (attr.value === namespaceUri) {
              result.add_utx5q5_k$(prefix);
            }
            redeclared.add_utx5q5_k$(prefix);
          }
        }
      }
       while (inductionVariable < l);
    var tmp0_safe_receiver = _this__u8e3s4.parentElement;
    if (tmp0_safe_receiver == null)
      null;
    else {
      collectDeclaredPrefixes(tmp0_safe_receiver, $this, namespaceUri, result, redeclared);
    }
  }
  function _set_docDelegate__qk9ebs($this, _set____db54di) {
    $this.docDelegate_1 = _set____db54di;
  }
  function _get_docDelegate__e6ghbg($this) {
    return $this.docDelegate_1;
  }
  function DomWriter_init_$Init$(xmlDeclMode, $this) {
    xmlDeclMode = xmlDeclMode === VOID ? XmlDeclMode_None_getInstance() : xmlDeclMode;
    DomWriter.call($this, null, VOID, xmlDeclMode);
    return $this;
  }
  function DomWriter_init_$Create$(xmlDeclMode) {
    return DomWriter_init_$Init$(xmlDeclMode, objectCreate(protoOf(DomWriter)));
  }
  function _set_currentNode__l3kmyy($this, _set____db54di) {
    $this.currentNode_1 = _set____db54di;
  }
  function _get_pendingOperations__5vhsr2($this) {
    return $this.pendingOperations_1;
  }
  function _set_lastTagDepth__ry6p54($this, _set____db54di) {
    $this.lastTagDepth_1 = _set____db54di;
  }
  function _get_lastTagDepth__cefyl0($this) {
    return $this.lastTagDepth_1;
  }
  function writeIndent($this, newDepth) {
    var indentSeq = $this.get_indentSequence_chovoq_k$();
    var tmp;
    var tmp_0;
    if ($this.lastTagDepth_1 >= 0) {
      // Inline function 'kotlin.collections.isNotEmpty' call
      tmp_0 = !indentSeq.isEmpty_y1axqb_k$();
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = !($this.lastTagDepth_1 === $this.depth_1);
    } else {
      tmp = false;
    }
    if (tmp) {
      $this.ignorableWhitespace_7szqkg_k$('\n');
      try {
        $this.set_indentSequence_r8jc87_k$(emptyList());
        // Inline function 'kotlin.repeat' call
        var times = $this.depth_1;
        // Inline function 'kotlin.contracts.contract' call
        var inductionVariable = 0;
        if (inductionVariable < times)
          do {
            var index = inductionVariable;
            inductionVariable = inductionVariable + 1 | 0;
            // Inline function 'nl.adaptivity.xmlutil.DomWriter.writeIndent.<anonymous>' call
            // Inline function 'kotlin.collections.forEach' call
            var tmp0_iterator = indentSeq.iterator_jk1svi_k$();
            while (tmp0_iterator.hasNext_bitz1p_k$()) {
              var element = tmp0_iterator.next_20eer_k$();
              // Inline function 'nl.adaptivity.xmlutil.DomWriter.writeIndent.<anonymous>.<anonymous>' call
              element.writeTo_3vocdz_k$($this);
            }
          }
           while (inductionVariable < times);
      }finally {
        $this.set_indentSequence_r8jc87_k$(indentSeq);
      }
    }
    $this.lastTagDepth_1 = newDepth;
  }
  function writeIndent$default($this, newDepth, $super) {
    newDepth = newDepth === VOID ? $this.depth_1 : newDepth;
    return writeIndent($this, newDepth);
  }
  function addToPending($this, operation) {
    if ($this.docDelegate_1 == null) {
      var tmp = $this.pendingOperations_1;
      (isInterface(tmp, MutableList) ? tmp : THROW_CCE()).add_utx5q5_k$(operation);
    } else
      throw IllegalStateException_init_$Create$('Use of pending list when there is a document already');
  }
  function _get_requireCurrent__f4sn5j_0($this) {
    var tmp0_elvis_lhs = $this.currentNode_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IllegalStateException_init_$Create$('No current element');
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var tmp_0 = tmp;
    return !(tmp_0 == null) ? tmp_0 : THROW_CCE();
  }
  function requireCurrent($this, error) {
    var tmp = $this.currentNode_1;
    var tmp0_elvis_lhs = (!(tmp == null) ? !(tmp == null) : false) ? tmp : null;
    var tmp_0;
    if (tmp0_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('The current node is not an element: ' + error);
    } else {
      tmp_0 = tmp0_elvis_lhs;
    }
    return tmp_0;
  }
  function _set_depth__dghfxe_0($this, _set____db54di) {
    $this.depth_1 = _set____db54di;
  }
  function _set_requestedVersion__4q837($this, _set____db54di) {
    $this.requestedVersion_1 = _set____db54di;
  }
  function _set_requestedEncoding__qvyad8($this, _set____db54di) {
    $this.requestedEncoding_1 = _set____db54di;
  }
  function _set_requestedStandalone__y2o9oy($this, _set____db54di) {
    $this.requestedStandalone_1 = _set____db54di;
  }
  function Companion() {
    Companion_instance = this;
    this.TAG_DEPTH_NOT_TAG_1 = -1;
    this.TAG_DEPTH_FORCE_INDENT_NEXT_1 = 2147483647;
  }
  var Companion_instance;
  function Companion_getInstance_0() {
    if (Companion_instance == null)
      new Companion();
    return Companion_instance;
  }
  function DomWriter$namespaceContext$1(this$0) {
    this.this$0__1 = this$0;
  }
  protoOf(DomWriter$namespaceContext$1).getNamespaceURI_859c43_k$ = function (prefix) {
    var tmp0_safe_receiver = this.this$0__1.currentNode_1;
    return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.lookupNamespaceURI(prefix);
  };
  protoOf(DomWriter$namespaceContext$1).getPrefix_7o0aoe_k$ = function (namespaceURI) {
    var tmp0_safe_receiver = this.this$0__1.currentNode_1;
    return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.lookupPrefix(namespaceURI);
  };
  protoOf(DomWriter$namespaceContext$1).getPrefixesCompat_d6ifqa_k$ = function (namespaceURI) {
    // Inline function 'kotlin.collections.buildSet' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.collections.buildSetInternal' call
    // Inline function 'kotlin.apply' call
    var this_0 = LinkedHashSet_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.<no name provided>.getPrefixesCompat.<anonymous>' call
    var tmp = this.this$0__1.currentNode_1;
    var tmp0_safe_receiver = (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
    if (tmp0_safe_receiver == null)
      null;
    else {
      // Inline function 'kotlin.collections.mutableListOf' call
      var tmp$ret$0 = ArrayList_init_$Create$();
      collectDeclaredPrefixes(tmp0_safe_receiver, this, namespaceURI, this_0, tmp$ret$0);
    }
    var tmp$ret$3 = this_0.build_1k0s4u_k$();
    return toList(tmp$ret$3).iterator_jk1svi_k$();
  };
  function DomWriter$comment$lambda(this$0, $text) {
    return function (it) {
      this$0.comment_dbctn9_k$($text);
      return Unit_getInstance();
    };
  }
  function DomWriter$text$lambda(this$0, $text) {
    return function (it) {
      this$0.ignorableWhitespace_7szqkg_k$($text);
      return Unit_getInstance();
    };
  }
  function DomWriter$processingInstruction$lambda(this$0, $text) {
    return function (it) {
      this$0.processingInstruction_2btz8x_k$($text);
      return Unit_getInstance();
    };
  }
  function DomWriter$processingInstruction$lambda_0(this$0, $target, $data) {
    return function (it) {
      this$0.processingInstruction_tweoff_k$($target, $data);
      return Unit_getInstance();
    };
  }
  function DomWriter$ignorableWhitespace$lambda(this$0, $text) {
    return function (it) {
      this$0.ignorableWhitespace_7szqkg_k$($text);
      return Unit_getInstance();
    };
  }
  function DomWriter$docdecl$lambda(this$0, $text) {
    return function (it) {
      this$0.docdecl_aom8aw_k$($text);
      return Unit_getInstance();
    };
  }
  function DomWriter$setPrefix$lambda(this$0, $prefix, $namespaceUri) {
    return function (it) {
      this$0.setPrefix_e36xz8_k$($prefix, $namespaceUri);
      return Unit_getInstance();
    };
  }
  function DomWriter$close$lambda(this$0) {
    return function () {
      return 'Closing a dom writer but not all elements were closed (depth:' + this$0.depth_1 + ')';
    };
  }
  function DomWriter(current, isAppend, xmlDeclMode) {
    Companion_getInstance_0();
    isAppend = isAppend === VOID ? false : isAppend;
    xmlDeclMode = xmlDeclMode === VOID ? XmlDeclMode_None_getInstance() : xmlDeclMode;
    PlatformXmlWriterBase.call(this);
    this.isAppend_1 = isAppend;
    this.xmlDeclMode_1 = xmlDeclMode;
    var tmp = this;
    var tmp1_subject = current == null ? null : current.nodeType;
    var tmp_0;
    if (tmp1_subject == null) {
      tmp_0 = null;
    } else {
      if ((tmp1_subject == null ? null : tmp1_subject) === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$()) {
        tmp_0 = (!(current == null) ? !(current == null) : false) ? current : THROW_CCE();
      } else {
        tmp_0 = current.ownerDocument;
      }
    }
    tmp.docDelegate_1 = tmp_0;
    this.currentNode_1 = current;
    var tmp_1 = this;
    // Inline function 'kotlin.collections.mutableListOf' call
    tmp_1.pendingOperations_1 = ArrayList_init_$Create$();
    this.lastTagDepth_1 = -1;
    var tmp_2 = this;
    tmp_2.namespaceContext_1 = new DomWriter$namespaceContext$1(this);
    this.depth_1 = 0;
    this.requestedVersion_1 = null;
    this.requestedEncoding_1 = null;
    this.requestedStandalone_1 = null;
  }
  protoOf(DomWriter).get_isAppend_r1d48d_k$ = function () {
    return this.isAppend_1;
  };
  protoOf(DomWriter).get_xmlDeclMode_lc8ced_k$ = function () {
    return this.xmlDeclMode_1;
  };
  protoOf(DomWriter).get_target_juba8q_k$ = function () {
    var tmp0_elvis_lhs = this.docDelegate_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Document not created yet');
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  };
  protoOf(DomWriter).get_currentNode_nu23ea_k$ = function () {
    return this.currentNode_1;
  };
  protoOf(DomWriter).get_namespaceContext_n7n1ib_k$ = function () {
    return this.namespaceContext_1;
  };
  protoOf(DomWriter).get_depth_iq7qmy_k$ = function () {
    return this.depth_1;
  };
  protoOf(DomWriter).namespaceAttr_vkifxg_k$ = function (namespacePrefix, namespaceUri) {
    var cur = requireCurrent(this, 'Namespace attribute');
    // Inline function 'kotlin.text.isEmpty' call
    if (charSequenceLength(namespacePrefix) === 0) {
      var tmp;
      // Inline function 'kotlin.text.isEmpty' call
      if (charSequenceLength(namespaceUri) === 0) {
        tmp = cur.lookupNamespaceURI('') === '';
      } else {
        tmp = false;
      }
      if (!tmp) {
        cur.setAttributeNS(XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$(), XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$(), namespaceUri);
      }
    } else {
      cur.setAttributeNS(XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$(), XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$() + ':' + namespacePrefix, namespaceUri);
    }
  };
  protoOf(DomWriter).startTag_pjuzbi_k$ = function (namespace, localName, prefix) {
    writeIndent$default(this);
    this.depth_1 = this.depth_1 + 1 | 0;
    if (this.currentNode_1 == null ? this.docDelegate_1 == null : false) {
      var doc = createDocument(qname(namespace == null ? '' : namespace, localName, prefix));
      this.docDelegate_1 = doc;
      this.currentNode_1 = this.docDelegate_1;
      var e = ensureNotNull(doc.documentElement);
      doc.removeChild(e);
      var tmp3_iterator = this.pendingOperations_1.iterator_jk1svi_k$();
      while (tmp3_iterator.hasNext_bitz1p_k$()) {
        var pending = tmp3_iterator.next_20eer_k$();
        pending(doc);
      }
      doc.appendChild(e);
      var tmp = this.pendingOperations_1;
      (isInterface(tmp, MutableList) ? tmp : THROW_CCE()).clear_j9egeb_k$();
      this.lastTagDepth_1 = 0;
      this.currentNode_1 = doc.documentElement;
      return Unit_getInstance();
    } else if (this.currentNode_1 == null ? !this.isAppend_1 : false) {
      // Inline function 'kotlin.sequences.count' call
      var count = 0;
      var tmp0_iterator = asSequence(iterator_0(this.get_target_juba8q_k$().childNodes)).iterator_jk1svi_k$();
      while (tmp0_iterator.hasNext_bitz1p_k$()) {
        var element = tmp0_iterator.next_20eer_k$();
        // Inline function 'nl.adaptivity.xmlutil.DomWriter.startTag.<anonymous>' call
        if (element.nodeType === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$()) {
          count = count + 1 | 0;
          checkCountOverflow(count);
        }
      }
      if (count > 0) {
        removeElementChildren(this.get_target_juba8q_k$());
      }
    }
    // Inline function 'kotlin.let' call
    // Inline function 'kotlin.contracts.contract' call
    var elem = createElement(this.get_target_juba8q_k$(), qname(namespace, localName, prefix));
    ensureNotNull(this.currentNode_1).appendChild(elem);
    this.currentNode_1 = elem;
  };
  protoOf(DomWriter).comment_dbctn9_k$ = function (text) {
    writeIndent$default(this);
    var ce = this.currentNode_1;
    if (ce == null) {
      addToPending(this, DomWriter$comment$lambda(this, text));
    } else {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomWriter.comment.<anonymous>' call
      var comment = this.get_target_juba8q_k$().createComment(text);
      ce.appendChild(comment);
    }
  };
  protoOf(DomWriter).text_x72pul_k$ = function (text) {
    this.lastTagDepth_1 = -1;
    var ce = this.currentNode_1;
    if (ce == null) {
      if (isBlank(text)) {
        addToPending(this, DomWriter$text$lambda(this, text));
      } else
        throw XmlException_init_$Create$_0('Not in an element -- text');
    } else {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomWriter.text.<anonymous>' call
      var textNode = this.get_target_juba8q_k$().createTextNode(text);
      ce.appendChild(textNode);
    }
  };
  protoOf(DomWriter).cdsect_yhnzeu_k$ = function (text) {
    this.lastTagDepth_1 = -1;
    // Inline function 'kotlin.let' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.DomWriter.cdsect.<anonymous>' call
    var cdataSection = this.get_target_juba8q_k$().createCDATASection(text);
    var tmp0_safe_receiver = this.currentNode_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.appendChild(cdataSection);
    var tmp;
    if (tmp1_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Not in an element -- cdsect');
    } else {
      tmp = tmp1_elvis_lhs;
    }
  };
  protoOf(DomWriter).entityRef_cqd3i2_k$ = function (text) {
    this.lastTagDepth_1 = -1;
    throw UnsupportedOperationException_init_$Create$('Creating entity references is not supported (or incorrect) in most browsers');
  };
  protoOf(DomWriter).processingInstruction_2btz8x_k$ = function (text) {
    writeIndent(this, 2147483647);
    var tmp0_safe_receiver = this.currentNode_1;
    var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nodeType;
    if (!((tmp1_safe_receiver == null ? null : tmp1_safe_receiver) === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$()))
      throw XmlException_init_$Create$_0('Document already started');
    if (this.docDelegate_1 == null) {
      addToPending(this, DomWriter$processingInstruction$lambda(this, text));
    } else {
      var split = indexOf(text, _Char___init__impl__6a9atx(32));
      var tmp;
      if (split < 0) {
        tmp = to(text, '');
      } else {
        // Inline function 'kotlin.text.substring' call
        // Inline function 'kotlin.js.asDynamic' call
        var tmp_0 = text.substring(0, split);
        // Inline function 'kotlin.text.substring' call
        var startIndex = split + 1 | 0;
        // Inline function 'kotlin.js.asDynamic' call
        var tmp$ret$3 = text.substring(startIndex);
        tmp = to(tmp_0, tmp$ret$3);
      }
      var tmp2_container = tmp;
      var target = tmp2_container.component1_7eebsc_k$();
      var data = tmp2_container.component2_7eebsb_k$();
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomWriter.processingInstruction.<anonymous>' call
      var processInstr = this.get_target_juba8q_k$().createProcessingInstruction(target, data);
      this.get_target_juba8q_k$().appendChild(processInstr);
    }
  };
  protoOf(DomWriter).processingInstruction_tweoff_k$ = function (target, data) {
    var ce = this.currentNode_1;
    if (ce == null) {
      addToPending(this, DomWriter$processingInstruction$lambda_0(this, target, data));
    } else {
      var processInstr = this.get_target_juba8q_k$().createProcessingInstruction(target, data);
      ce.appendChild(processInstr);
    }
    this.lastTagDepth_1 = -1;
  };
  protoOf(DomWriter).ignorableWhitespace_7szqkg_k$ = function (text) {
    var ce = this.currentNode_1;
    if (ce == null) {
      addToPending(this, DomWriter$ignorableWhitespace$lambda(this, text));
    } else if (!(ce.nodeType === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$())) {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomWriter.ignorableWhitespace.<anonymous>' call
      var textNode = this.get_target_juba8q_k$().createTextNode(text);
      ce.appendChild(textNode);
    }
    this.lastTagDepth_1 = -1;
  };
  protoOf(DomWriter).attribute_ruzjv8_k$ = function (namespace, name, prefix, value) {
    var cur = requireCurrent(this, 'attribute');
    var tmp;
    // Inline function 'kotlin.text.isNullOrEmpty' call
    // Inline function 'kotlin.contracts.contract' call
    if (namespace == null ? true : charSequenceLength(namespace) === 0) {
      // Inline function 'kotlin.text.isNullOrEmpty' call
      // Inline function 'kotlin.contracts.contract' call
      tmp = prefix == null ? true : charSequenceLength(prefix) === 0;
    } else {
      tmp = false;
    }
    if (tmp) {
      cur.setAttribute(name, value);
    } else {
      // Inline function 'kotlin.text.isNullOrEmpty' call
      // Inline function 'kotlin.contracts.contract' call
      if (prefix == null ? true : charSequenceLength(prefix) === 0) {
        cur.setAttributeNS(namespace, name, value);
      } else {
        cur.setAttributeNS(namespace == null ? XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$() : namespace, '' + prefix + ':' + name, value);
      }
    }
  };
  protoOf(DomWriter).docdecl_aom8aw_k$ = function (text) {
    writeIndent(this, 2147483647);
    var target = this.docDelegate_1;
    if (target == null) {
      addToPending(this, DomWriter$docdecl$lambda(this, text));
    } else {
      var textElems = split(text, [' '], VOID, 3);
      var qualifiedName = textElems.get_c1px32_k$(0);
      var publicId = textElems.get_size_woubt6_k$() > 1 ? textElems.get_c1px32_k$(1) : '';
      var systemId = textElems.get_size_woubt6_k$() > 2 ? textElems.get_c1px32_k$(2) : '';
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.DomWriter.docdecl.<anonymous>' call
      var docType = target.implementation.createDocumentType(qualifiedName, publicId, systemId);
      target.appendChild(docType);
    }
  };
  protoOf(DomWriter).get_requestedVersion_7huwyb_k$ = function () {
    return this.requestedVersion_1;
  };
  protoOf(DomWriter).get_requestedEncoding_9du5vc_k$ = function () {
    return this.requestedEncoding_1;
  };
  protoOf(DomWriter).get_requestedStandalone_fpebrq_k$ = function () {
    return this.requestedStandalone_1;
  };
  protoOf(DomWriter).startDocument_dbnt67_k$ = function (version, encoding, standalone) {
    writeIndent(this, 2147483647);
    this.requestedVersion_1 = version;
    this.requestedEncoding_1 = encoding;
    this.requestedStandalone_1 = standalone;
  };
  protoOf(DomWriter).endDocument_lstnba_k$ = function () {
    this.currentNode_1 = null;
  };
  protoOf(DomWriter).endTag_yzukbv_k$ = function (namespace, localName, prefix) {
    this.depth_1 = this.depth_1 - 1 | 0;
    writeIndent(this, 2147483647);
    this.currentNode_1 = requireCurrent(this, 'No current element or no parent element').parentNode;
  };
  protoOf(DomWriter).getNamespaceUri_buhtgt_k$ = function (prefix) {
    var tmp0_safe_receiver = this.currentNode_1;
    return tmp0_safe_receiver == null ? null : myLookupNamespaceURI(tmp0_safe_receiver, prefix);
  };
  protoOf(DomWriter).getPrefix_r4en0f_k$ = function (namespaceUri) {
    var tmp1_safe_receiver = this.currentNode_1;
    var tmp;
    if (tmp1_safe_receiver == null) {
      tmp = null;
    } else {
      tmp = myLookupPrefix(tmp1_safe_receiver, namespaceUri == null ? '' : namespaceUri);
    }
    return tmp;
  };
  protoOf(DomWriter).setPrefix_e36xz8_k$ = function (prefix, namespaceUri) {
    var docDelegate = this.docDelegate_1;
    if (docDelegate == null) {
      addToPending(this, DomWriter$setPrefix$lambda(this, prefix, namespaceUri));
    } else {
      if (!(docDelegate.lookupNamespaceURI(prefix) === namespaceUri)) {
        var tmp;
        // Inline function 'kotlin.text.isEmpty' call
        if (charSequenceLength(prefix) === 0) {
          tmp = 'xmlns';
        } else {
          tmp = 'xmlns:' + prefix;
        }
        var qname = tmp;
        var tmp_0 = this.currentNode_1;
        var tmp0_safe_receiver = (!(tmp_0 == null) ? !(tmp_0 == null) : false) ? tmp_0 : null;
        if (tmp0_safe_receiver == null)
          null;
        else {
          tmp0_safe_receiver.setAttribute(qname, namespaceUri);
        }
      }
    }
  };
  protoOf(DomWriter).close_yn9xrc_k$ = function () {
    var tmp = this.depth_1 === 0;
    assert(tmp, DomWriter$close$lambda(this));
    this.currentNode_1 = null;
  };
  protoOf(DomWriter).flush_shahbo_k$ = function () {
  };
  function EventType$START_DOCUMENT() {
    EventType.call(this, 'START_DOCUMENT', 0);
    EventType_START_DOCUMENT_instance = this;
  }
  protoOf(EventType$START_DOCUMENT).get_isIgnorable_uazyqu_k$ = function () {
    return true;
  };
  protoOf(EventType$START_DOCUMENT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.START_DOCUMENT.createEvent.<anonymous>' call
    return new StartDocumentEvent(reader.get_locationInfo_3kny30_k$(), reader.get_version_72w4j3_k$(), reader.get_encoding_3i4b8k_k$(), reader.get_standalone_tm0l3i_k$());
  };
  protoOf(EventType$START_DOCUMENT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.startDocument_dbnt67_k$(reader.get_version_72w4j3_k$(), reader.get_encoding_3i4b8k_k$(), reader.get_standalone_tm0l3i_k$());
  };
  var EventType_START_DOCUMENT_instance;
  function EventType$START_ELEMENT() {
    EventType.call(this, 'START_ELEMENT', 1);
    EventType_START_ELEMENT_instance = this;
  }
  protoOf(EventType$START_ELEMENT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.START_ELEMENT.createEvent.<anonymous>' call
    return new StartElementEvent(reader.get_locationInfo_3kny30_k$(), reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$(), get_attributes(reader), reader.get_namespaceContext_n7n1ib_k$().freeze_kxzejt_k$(), reader.get_namespaceDecls_1u0o6v_k$());
  };
  protoOf(EventType$START_ELEMENT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.startTag_pjuzbi_k$(reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$());
    var tmp0_iterator = reader.get_namespaceDecls_1u0o6v_k$().iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var attr = tmp0_iterator.next_20eer_k$();
      writer.namespaceAttr_vkifxg_k$(attr.get_prefix_i78za3_k$(), attr.get_namespaceURI_g6nmhy_k$());
    }
    var inductionVariable = 0;
    var last = reader.get_attributeCount_hqf30_k$();
    if (inductionVariable < last)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var attrNs = reader.getAttributeNamespace_wj9j6l_k$(i);
        if (!(attrNs === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$())) {
          var attrPrefix = reader.getAttributePrefix_luun28_k$(i);
          var tmp;
          if (attrNs === '') {
            tmp = '';
          } else if (attrNs === writer.get_namespaceContext_n7n1ib_k$().getNamespaceURI_859c43_k$(attrPrefix)) {
            tmp = attrPrefix;
          } else {
            var tmp3_elvis_lhs = writer.get_namespaceContext_n7n1ib_k$().getPrefix_7o0aoe_k$(attrNs);
            tmp = tmp3_elvis_lhs == null ? attrPrefix : tmp3_elvis_lhs;
          }
          var prefix = tmp;
          writer.attribute_ruzjv8_k$(attrNs, reader.getAttributeLocalName_i25hjc_k$(i), prefix, reader.getAttributeValue_qah2od_k$(i));
        }
      }
       while (inductionVariable < last);
  };
  var EventType_START_ELEMENT_instance;
  function EventType$END_ELEMENT() {
    EventType.call(this, 'END_ELEMENT', 2);
    EventType_END_ELEMENT_instance = this;
  }
  protoOf(EventType$END_ELEMENT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.END_ELEMENT.createEvent.<anonymous>' call
    return new EndElementEvent(reader.get_locationInfo_3kny30_k$(), reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$(), reader.get_namespaceContext_n7n1ib_k$());
  };
  protoOf(EventType$END_ELEMENT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.endTag_yzukbv_k$(reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$());
  };
  var EventType_END_ELEMENT_instance;
  function EventType$COMMENT() {
    EventType.call(this, 'COMMENT', 3);
    EventType_COMMENT_instance = this;
  }
  protoOf(EventType$COMMENT).get_isIgnorable_uazyqu_k$ = function () {
    return true;
  };
  protoOf(EventType$COMMENT).get_isTextElement_53s5zw_k$ = function () {
    return true;
  };
  protoOf(EventType$COMMENT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.COMMENT.createEvent.<anonymous>' call
    return new TextEvent(reader.get_locationInfo_3kny30_k$(), EventType_COMMENT_getInstance(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$COMMENT).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    writer.comment_dbctn9_k$(textEvent.get_text_wouvsm_k$());
  };
  protoOf(EventType$COMMENT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.comment_dbctn9_k$(reader.get_text_wouvsm_k$());
  };
  var EventType_COMMENT_instance;
  function EventType$TEXT() {
    EventType.call(this, 'TEXT', 4);
    EventType_TEXT_instance = this;
  }
  protoOf(EventType$TEXT).get_isTextElement_53s5zw_k$ = function () {
    return true;
  };
  protoOf(EventType$TEXT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.TEXT.createEvent.<anonymous>' call
    return new TextEvent(reader.get_locationInfo_3kny30_k$(), EventType_TEXT_getInstance(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$TEXT).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    writer.text_x72pul_k$(textEvent.get_text_wouvsm_k$());
  };
  protoOf(EventType$TEXT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.text_x72pul_k$(reader.get_text_wouvsm_k$());
  };
  var EventType_TEXT_instance;
  function EventType$CDSECT() {
    EventType.call(this, 'CDSECT', 5);
    EventType_CDSECT_instance = this;
  }
  protoOf(EventType$CDSECT).get_isTextElement_53s5zw_k$ = function () {
    return true;
  };
  protoOf(EventType$CDSECT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.CDSECT.createEvent.<anonymous>' call
    return new TextEvent(reader.get_locationInfo_3kny30_k$(), EventType_CDSECT_getInstance(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$CDSECT).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    writer.cdsect_yhnzeu_k$(textEvent.get_text_wouvsm_k$());
  };
  protoOf(EventType$CDSECT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.cdsect_yhnzeu_k$(reader.get_text_wouvsm_k$());
  };
  var EventType_CDSECT_instance;
  function EventType$DOCDECL() {
    EventType.call(this, 'DOCDECL', 6);
    EventType_DOCDECL_instance = this;
  }
  protoOf(EventType$DOCDECL).get_isIgnorable_uazyqu_k$ = function () {
    return true;
  };
  protoOf(EventType$DOCDECL).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.DOCDECL.createEvent.<anonymous>' call
    return new TextEvent(reader.get_locationInfo_3kny30_k$(), EventType_DOCDECL_getInstance(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$DOCDECL).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    writer.docdecl_aom8aw_k$(textEvent.get_text_wouvsm_k$());
  };
  protoOf(EventType$DOCDECL).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.docdecl_aom8aw_k$(reader.get_text_wouvsm_k$());
  };
  var EventType_DOCDECL_instance;
  function EventType$END_DOCUMENT() {
    EventType.call(this, 'END_DOCUMENT', 7);
    EventType_END_DOCUMENT_instance = this;
  }
  protoOf(EventType$END_DOCUMENT).get_isIgnorable_uazyqu_k$ = function () {
    return true;
  };
  protoOf(EventType$END_DOCUMENT).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.END_DOCUMENT.createEvent.<anonymous>' call
    return new EndDocumentEvent(reader.get_locationInfo_3kny30_k$());
  };
  protoOf(EventType$END_DOCUMENT).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.endDocument_lstnba_k$();
  };
  var EventType_END_DOCUMENT_instance;
  function EventType$ENTITY_REF() {
    EventType.call(this, 'ENTITY_REF', 8);
    EventType_ENTITY_REF_instance = this;
  }
  protoOf(EventType$ENTITY_REF).get_isTextElement_53s5zw_k$ = function () {
    return true;
  };
  protoOf(EventType$ENTITY_REF).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.ENTITY_REF.createEvent.<anonymous>' call
    return new EntityRefEvent(reader.get_locationInfo_3kny30_k$(), reader.get_localName_bf4zrn_k$(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$ENTITY_REF).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    writer.text_x72pul_k$(textEvent.get_text_wouvsm_k$());
  };
  protoOf(EventType$ENTITY_REF).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.text_x72pul_k$(reader.get_text_wouvsm_k$());
  };
  var EventType_ENTITY_REF_instance;
  function EventType$IGNORABLE_WHITESPACE() {
    EventType.call(this, 'IGNORABLE_WHITESPACE', 9);
    EventType_IGNORABLE_WHITESPACE_instance = this;
  }
  protoOf(EventType$IGNORABLE_WHITESPACE).get_isIgnorable_uazyqu_k$ = function () {
    return true;
  };
  protoOf(EventType$IGNORABLE_WHITESPACE).get_isTextElement_53s5zw_k$ = function () {
    return true;
  };
  protoOf(EventType$IGNORABLE_WHITESPACE).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.IGNORABLE_WHITESPACE.createEvent.<anonymous>' call
    return new TextEvent(reader.get_locationInfo_3kny30_k$(), EventType_IGNORABLE_WHITESPACE_getInstance(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$IGNORABLE_WHITESPACE).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    writer.ignorableWhitespace_7szqkg_k$(textEvent.get_text_wouvsm_k$());
  };
  protoOf(EventType$IGNORABLE_WHITESPACE).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.ignorableWhitespace_7szqkg_k$(reader.get_text_wouvsm_k$());
  };
  var EventType_IGNORABLE_WHITESPACE_instance;
  function EventType$ATTRIBUTE() {
    EventType.call(this, 'ATTRIBUTE', 10);
    EventType_ATTRIBUTE_instance = this;
  }
  protoOf(EventType$ATTRIBUTE).createEvent_2rhg4u_k$ = function (reader) {
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.ATTRIBUTE.createEvent.<anonymous>' call
    return new Attribute(reader.get_locationInfo_3kny30_k$(), reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$(), reader.get_text_wouvsm_k$());
  };
  protoOf(EventType$ATTRIBUTE).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.attribute_ruzjv8_k$(reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$(), reader.get_text_wouvsm_k$());
  };
  var EventType_ATTRIBUTE_instance;
  function EventType$PROCESSING_INSTRUCTION() {
    EventType.call(this, 'PROCESSING_INSTRUCTION', 11);
    EventType_PROCESSING_INSTRUCTION_instance = this;
  }
  protoOf(EventType$PROCESSING_INSTRUCTION).get_isIgnorable_uazyqu_k$ = function () {
    return true;
  };
  protoOf(EventType$PROCESSING_INSTRUCTION).get_isTextElement_53s5zw_k$ = function () {
    return true;
  };
  protoOf(EventType$PROCESSING_INSTRUCTION).createEvent_2rhg4u_k$ = function (reader) {
    return new ProcessingInstructionEvent(reader.get_locationInfo_3kny30_k$(), reader.get_piTarget_jrarar_k$(), reader.get_piData_i1pnws_k$());
  };
  protoOf(EventType$PROCESSING_INSTRUCTION).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    var tmp;
    if (textEvent instanceof ProcessingInstructionEvent) {
      writer.processingInstruction_tweoff_k$(textEvent.get_target_juba8q_k$(), textEvent.get_data_wokkxf_k$());
      tmp = Unit_getInstance();
    } else {
      writer.processingInstruction_2btz8x_k$(textEvent.get_text_wouvsm_k$());
      tmp = Unit_getInstance();
    }
    return tmp;
  };
  protoOf(EventType$PROCESSING_INSTRUCTION).writeEvent_g8yuzw_k$ = function (writer, reader) {
    writer.processingInstruction_tweoff_k$(reader.get_piTarget_jrarar_k$(), reader.get_piData_i1pnws_k$());
  };
  var EventType_PROCESSING_INSTRUCTION_instance;
  function values() {
    return [EventType_START_DOCUMENT_getInstance(), EventType_START_ELEMENT_getInstance(), EventType_END_ELEMENT_getInstance(), EventType_COMMENT_getInstance(), EventType_TEXT_getInstance(), EventType_CDSECT_getInstance(), EventType_DOCDECL_getInstance(), EventType_END_DOCUMENT_getInstance(), EventType_ENTITY_REF_getInstance(), EventType_IGNORABLE_WHITESPACE_getInstance(), EventType_ATTRIBUTE_getInstance(), EventType_PROCESSING_INSTRUCTION_getInstance()];
  }
  function valueOf(value) {
    switch (value) {
      case 'START_DOCUMENT':
        return EventType_START_DOCUMENT_getInstance();
      case 'START_ELEMENT':
        return EventType_START_ELEMENT_getInstance();
      case 'END_ELEMENT':
        return EventType_END_ELEMENT_getInstance();
      case 'COMMENT':
        return EventType_COMMENT_getInstance();
      case 'TEXT':
        return EventType_TEXT_getInstance();
      case 'CDSECT':
        return EventType_CDSECT_getInstance();
      case 'DOCDECL':
        return EventType_DOCDECL_getInstance();
      case 'END_DOCUMENT':
        return EventType_END_DOCUMENT_getInstance();
      case 'ENTITY_REF':
        return EventType_ENTITY_REF_getInstance();
      case 'IGNORABLE_WHITESPACE':
        return EventType_IGNORABLE_WHITESPACE_getInstance();
      case 'ATTRIBUTE':
        return EventType_ATTRIBUTE_getInstance();
      case 'PROCESSING_INSTRUCTION':
        return EventType_PROCESSING_INSTRUCTION_getInstance();
      default:
        EventType_initEntries();
        THROW_IAE('No enum constant value.');
        break;
    }
  }
  function get_entries() {
    if ($ENTRIES == null)
      $ENTRIES = enumEntries(values());
    return $ENTRIES;
  }
  var EventType_entriesInitialized;
  function EventType_initEntries() {
    if (EventType_entriesInitialized)
      return Unit_getInstance();
    EventType_entriesInitialized = true;
    EventType_START_DOCUMENT_instance = new EventType$START_DOCUMENT();
    EventType_START_ELEMENT_instance = new EventType$START_ELEMENT();
    EventType_END_ELEMENT_instance = new EventType$END_ELEMENT();
    EventType_COMMENT_instance = new EventType$COMMENT();
    EventType_TEXT_instance = new EventType$TEXT();
    EventType_CDSECT_instance = new EventType$CDSECT();
    EventType_DOCDECL_instance = new EventType$DOCDECL();
    EventType_END_DOCUMENT_instance = new EventType$END_DOCUMENT();
    EventType_ENTITY_REF_instance = new EventType$ENTITY_REF();
    EventType_IGNORABLE_WHITESPACE_instance = new EventType$IGNORABLE_WHITESPACE();
    EventType_ATTRIBUTE_instance = new EventType$ATTRIBUTE();
    EventType_PROCESSING_INSTRUCTION_instance = new EventType$PROCESSING_INSTRUCTION();
  }
  var $ENTRIES;
  function EventType(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  protoOf(EventType).get_isIgnorable_uazyqu_k$ = function () {
    return false;
  };
  protoOf(EventType).get_isTextElement_53s5zw_k$ = function () {
    return false;
  };
  protoOf(EventType).writeEvent_nrkoim_k$ = function (writer, textEvent) {
    throw UnsupportedOperationException_init_$Create$('This is not generally supported, only by text types');
  };
  function EventType_START_DOCUMENT_getInstance() {
    EventType_initEntries();
    return EventType_START_DOCUMENT_instance;
  }
  function EventType_START_ELEMENT_getInstance() {
    EventType_initEntries();
    return EventType_START_ELEMENT_instance;
  }
  function EventType_END_ELEMENT_getInstance() {
    EventType_initEntries();
    return EventType_END_ELEMENT_instance;
  }
  function EventType_COMMENT_getInstance() {
    EventType_initEntries();
    return EventType_COMMENT_instance;
  }
  function EventType_TEXT_getInstance() {
    EventType_initEntries();
    return EventType_TEXT_instance;
  }
  function EventType_CDSECT_getInstance() {
    EventType_initEntries();
    return EventType_CDSECT_instance;
  }
  function EventType_DOCDECL_getInstance() {
    EventType_initEntries();
    return EventType_DOCDECL_instance;
  }
  function EventType_END_DOCUMENT_getInstance() {
    EventType_initEntries();
    return EventType_END_DOCUMENT_instance;
  }
  function EventType_ENTITY_REF_getInstance() {
    EventType_initEntries();
    return EventType_ENTITY_REF_instance;
  }
  function EventType_IGNORABLE_WHITESPACE_getInstance() {
    EventType_initEntries();
    return EventType_IGNORABLE_WHITESPACE_instance;
  }
  function EventType_ATTRIBUTE_getInstance() {
    EventType_initEntries();
    return EventType_ATTRIBUTE_instance;
  }
  function EventType_PROCESSING_INSTRUCTION_getInstance() {
    EventType_initEntries();
    return EventType_PROCESSING_INSTRUCTION_instance;
  }
  function Namespace$Companion$descriptor$lambda($this$buildClassSerialDescriptor) {
    // Inline function 'kotlinx.serialization.descriptors.serialDescriptor' call
    // Inline function 'kotlinx.serialization.serializer' call
    // Inline function 'kotlinx.serialization.internal.cast' call
    var this_0 = serializer(createKType(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$(), arrayOf([]), false));
    var tmp$ret$2 = (isInterface(this_0, KSerializer) ? this_0 : THROW_CCE()).get_descriptor_wjt6a0_k$();
    $this$buildClassSerialDescriptor.element$default_ey7ac9_k$('prefix', tmp$ret$2);
    // Inline function 'kotlinx.serialization.descriptors.serialDescriptor' call
    // Inline function 'kotlinx.serialization.serializer' call
    // Inline function 'kotlinx.serialization.internal.cast' call
    var this_1 = serializer(createKType(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$(), arrayOf([]), false));
    var tmp$ret$5 = (isInterface(this_1, KSerializer) ? this_1 : THROW_CCE()).get_descriptor_wjt6a0_k$();
    $this$buildClassSerialDescriptor.element$default_ey7ac9_k$('namespaceURI', tmp$ret$5);
    return Unit_getInstance();
  }
  function Companion_0() {
    Companion_instance_0 = this;
    var tmp = this;
    var tmp_0 = ensureNotNull(getKClass(Namespace).get_simpleName_r6f8py_k$());
    tmp.descriptor_1 = buildClassSerialDescriptor(tmp_0, [], Namespace$Companion$descriptor$lambda);
  }
  protoOf(Companion_0).get_descriptor_wjt6a0_k$ = function () {
    return this.descriptor_1;
  };
  protoOf(Companion_0).deserialize_sy6x50_k$ = function (decoder) {
    var prefix = {_v: null};
    var namespaceUri = {_v: null};
    // Inline function 'kotlinx.serialization.encoding.decodeStructure' call
    var descriptor = this.descriptor_1;
    var composite = decoder.beginStructure_yljocp_k$(descriptor);
    var index = composite.decodeElementIndex_bstkhp_k$(Companion_getInstance_1().descriptor_1);
    while (!(index === Companion_getInstance().get_DECODE_DONE_1b8fna_k$())) {
      var tmp0_subject = index;
      if (tmp0_subject === 0) {
        prefix._v = composite.decodeStringElement_3oenpg_k$(Companion_getInstance_1().descriptor_1, index);
      } else if (tmp0_subject === 1) {
        namespaceUri._v = composite.decodeStringElement_3oenpg_k$(Companion_getInstance_1().descriptor_1, index);
      }
      index = composite.decodeElementIndex_bstkhp_k$(Companion_getInstance_1().descriptor_1);
    }
    var result = Unit_getInstance();
    composite.endStructure_1xqz0n_k$(descriptor);
    var tmp;
    if (prefix._v == null) {
      throwUninitializedPropertyAccessException('prefix');
    } else {
      tmp = prefix._v;
    }
    var tmp_0 = tmp;
    var tmp_1;
    if (namespaceUri._v == null) {
      throwUninitializedPropertyAccessException('namespaceUri');
    } else {
      tmp_1 = namespaceUri._v;
    }
    return new NamespaceImpl(tmp_0, tmp_1);
  };
  protoOf(Companion_0).serialize_bsqcfz_k$ = function (encoder, value) {
    // Inline function 'kotlinx.serialization.encoding.encodeStructure' call
    var descriptor = this.descriptor_1;
    var composite = encoder.beginStructure_yljocp_k$(descriptor);
    // Inline function 'nl.adaptivity.xmlutil.Companion.serialize.<anonymous>' call
    composite.encodeStringElement_1n5wu2_k$(Companion_getInstance_1().descriptor_1, 0, value.get_prefix_i78za3_k$());
    composite.encodeStringElement_1n5wu2_k$(Companion_getInstance_1().descriptor_1, 1, value.get_namespaceURI_g6nmhy_k$());
    composite.endStructure_1xqz0n_k$(descriptor);
  };
  protoOf(Companion_0).serialize_5ase3y_k$ = function (encoder, value) {
    return this.serialize_bsqcfz_k$(encoder, (!(value == null) ? isInterface(value, Namespace) : false) ? value : THROW_CCE());
  };
  var Companion_instance_0;
  function Companion_getInstance_1() {
    if (Companion_instance_0 == null)
      new Companion_0();
    return Companion_instance_0;
  }
  function Namespace() {
  }
  function IterableNamespaceContext() {
  }
  function QNameSerializer$descriptor$lambda($this$buildClassSerialDescriptor) {
    var stringSerializer = serializer_0(StringCompanionObject_getInstance());
    $this$buildClassSerialDescriptor.element$default_ey7ac9_k$('namespace', stringSerializer.get_descriptor_wjt6a0_k$(), VOID, true);
    $this$buildClassSerialDescriptor.element$default_ey7ac9_k$('localPart', stringSerializer.get_descriptor_wjt6a0_k$());
    $this$buildClassSerialDescriptor.element$default_ey7ac9_k$('prefix', stringSerializer.get_descriptor_wjt6a0_k$(), VOID, true);
    return Unit_getInstance();
  }
  function QNameSerializer() {
    QNameSerializer_instance = this;
    var tmp = this;
    tmp.descriptor_1 = buildClassSerialDescriptor('javax.xml.namespace.QName', [], QNameSerializer$descriptor$lambda);
  }
  protoOf(QNameSerializer).get_descriptor_wjt6a0_k$ = function () {
    return this.descriptor_1;
  };
  protoOf(QNameSerializer).deserialize_sy6x50_k$ = function (decoder) {
    // Inline function 'kotlinx.serialization.encoding.decodeStructure' call
    var descriptor = this.descriptor_1;
    var composite = decoder.beginStructure_yljocp_k$(descriptor);
    // Inline function 'nl.adaptivity.xmlutil.QNameSerializer.deserialize.<anonymous>' call
    var prefix = '';
    var namespace = '';
    var localPart = null;
    loop: while (true) {
      var tmp0_subject = composite.decodeElementIndex_bstkhp_k$(QNameSerializer_getInstance().descriptor_1);
      if (tmp0_subject === Companion_getInstance().get_DECODE_DONE_1b8fna_k$())
        break loop;
      else if (tmp0_subject === 0)
        namespace = composite.decodeStringElement_3oenpg_k$(QNameSerializer_getInstance().descriptor_1, 0);
      else if (tmp0_subject === 1)
        localPart = composite.decodeStringElement_3oenpg_k$(QNameSerializer_getInstance().descriptor_1, 1);
      else if (tmp0_subject === 2)
        prefix = composite.decodeStringElement_3oenpg_k$(QNameSerializer_getInstance().descriptor_1, 2);
    }
    var tmp = namespace;
    var tmp_0;
    if (localPart == null) {
      throwUninitializedPropertyAccessException('localPart');
    } else {
      tmp_0 = localPart;
    }
    var result = new QName(tmp, tmp_0, prefix);
    composite.endStructure_1xqz0n_k$(descriptor);
    return result;
  };
  protoOf(QNameSerializer).serialize_n8ddsu_k$ = function (encoder, value) {
    // Inline function 'kotlinx.serialization.encoding.encodeStructure' call
    var descriptor = this.descriptor_1;
    var composite = encoder.beginStructure_yljocp_k$(descriptor);
    // Inline function 'nl.adaptivity.xmlutil.QNameSerializer.serialize.<anonymous>' call
    // Inline function 'kotlin.let' call
    // Inline function 'nl.adaptivity.xmlutil.namespaceURI' call
    // Inline function 'kotlin.contracts.contract' call
    var ns = value.getNamespaceURI_665tvr_k$();
    var tmp;
    var tmp_0;
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(ns) > 0) {
      tmp_0 = true;
    } else {
      tmp_0 = composite.shouldEncodeElementDefault_x8eyid_k$(QNameSerializer_getInstance().descriptor_1, 0);
    }
    if (tmp_0) {
      composite.encodeStringElement_1n5wu2_k$(QNameSerializer_getInstance().descriptor_1, 0, ns);
      tmp = Unit_getInstance();
    }
    var tmp_1 = QNameSerializer_getInstance().descriptor_1;
    // Inline function 'nl.adaptivity.xmlutil.localPart' call
    var tmp$ret$3 = value.getLocalPart_k3cdyw_k$();
    composite.encodeStringElement_1n5wu2_k$(tmp_1, 1, tmp$ret$3);
    // Inline function 'kotlin.let' call
    // Inline function 'nl.adaptivity.xmlutil.prefix' call
    // Inline function 'kotlin.contracts.contract' call
    var prefix = value.getPrefix_bu8bd4_k$();
    var tmp_2;
    var tmp_3;
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(prefix) > 0) {
      tmp_3 = true;
    } else {
      tmp_3 = composite.shouldEncodeElementDefault_x8eyid_k$(QNameSerializer_getInstance().descriptor_1, 2);
    }
    if (tmp_3) {
      composite.encodeStringElement_1n5wu2_k$(QNameSerializer_getInstance().descriptor_1, 2, prefix);
      tmp_2 = Unit_getInstance();
    }
    composite.endStructure_1xqz0n_k$(descriptor);
  };
  protoOf(QNameSerializer).serialize_5ase3y_k$ = function (encoder, value) {
    return this.serialize_n8ddsu_k$(encoder, value instanceof QName ? value : THROW_CCE());
  };
  var QNameSerializer_instance;
  function QNameSerializer_getInstance() {
    if (QNameSerializer_instance == null)
      new QNameSerializer();
    return QNameSerializer_instance;
  }
  function get_prefix(_this__u8e3s4) {
    return _this__u8e3s4.getPrefix_bu8bd4_k$();
  }
  function get_namespaceURI(_this__u8e3s4) {
    return _this__u8e3s4.getNamespaceURI_665tvr_k$();
  }
  function isEquivalent(_this__u8e3s4, other) {
    return _this__u8e3s4.getLocalPart_k3cdyw_k$() === other.getLocalPart_k3cdyw_k$() ? _this__u8e3s4.getNamespaceURI_665tvr_k$() === other.getNamespaceURI_665tvr_k$() : false;
  }
  function get_localPart(_this__u8e3s4) {
    return _this__u8e3s4.getLocalPart_k3cdyw_k$();
  }
  function toNamespace(_this__u8e3s4) {
    // Inline function 'nl.adaptivity.xmlutil.prefix' call
    var tmp = _this__u8e3s4.getPrefix_bu8bd4_k$();
    // Inline function 'nl.adaptivity.xmlutil.namespaceURI' call
    var tmp$ret$1 = _this__u8e3s4.getNamespaceURI_665tvr_k$();
    return new NamespaceImpl(tmp, tmp$ret$1);
  }
  function _set_pos__4wcab5($this, _set____db54di) {
    $this.pos_1 = _set____db54di;
  }
  function _get_pos__e6evgd($this) {
    return $this.pos_1;
  }
  function _get_pos__e6evgd_0($this) {
    return $this.pos_1;
  }
  function _get_actualSerializer__bfqoej($this) {
    return $this.actualSerializer_1;
  }
  function flatten($this, namespaces, prefix, namespace) {
    var tmp = asSequence_0(namespaces);
    var filler = flatMap(tmp, SimpleNamespaceContext$Companion$flatten$lambda(prefix, namespace)).iterator_jk1svi_k$();
    var tmp_0 = 0;
    var tmp_1 = imul(namespaces.get_size_woubt6_k$(), 2);
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_2 = fillArrayVal(Array(tmp_1), null);
    while (tmp_0 < tmp_1) {
      tmp_2[tmp_0] = filler.next_20eer_k$();
      tmp_0 = tmp_0 + 1 | 0;
    }
    return tmp_2;
  }
  function SimpleNamespaceContext$Companion$flatten$lambda($prefix, $namespace) {
    return function (it) {
      return sequenceOf([$prefix(it), $namespace(it)]);
    };
  }
  function SimpleIterator($outer) {
    this.$this_1 = $outer;
    this.pos_1 = 0;
  }
  protoOf(SimpleIterator).hasNext_bitz1p_k$ = function () {
    return this.pos_1 < this.$this_1.get_size_woubt6_k$();
  };
  protoOf(SimpleIterator).next_20eer_k$ = function () {
    var tmp1 = this.pos_1;
    this.pos_1 = tmp1 + 1 | 0;
    return new SimpleNamespace(this.$this_1, tmp1);
  };
  function SimpleNamespace($outer, pos) {
    this.$this_1 = $outer;
    this.pos_1 = pos;
  }
  protoOf(SimpleNamespace).get_prefix_i78za3_k$ = function () {
    return this.$this_1.getPrefix_wrbewg_k$(this.pos_1);
  };
  protoOf(SimpleNamespace).get_namespaceURI_g6nmhy_k$ = function () {
    return this.$this_1.getNamespaceURI_7dpe6n_k$(this.pos_1);
  };
  protoOf(SimpleNamespace).hashCode = function () {
    return imul(getStringHashCode(this.get_prefix_i78za3_k$()), 31) + getStringHashCode(this.get_namespaceURI_g6nmhy_k$()) | 0;
  };
  protoOf(SimpleNamespace).equals = function (other) {
    if (this === other)
      return true;
    if (!(!(other == null) ? isInterface(other, Namespace) : false))
      return false;
    return this.get_prefix_i78za3_k$() === other.get_prefix_i78za3_k$() ? this.get_namespaceURI_g6nmhy_k$() === other.get_namespaceURI_g6nmhy_k$() : false;
  };
  protoOf(SimpleNamespace).toString = function () {
    return '{' + this.get_prefix_i78za3_k$() + ':' + this.get_namespaceURI_g6nmhy_k$() + '}';
  };
  function SimpleNamespaceContext_init_$Init$($this) {
    // Inline function 'kotlin.emptyArray' call
    var tmp$ret$0 = [];
    SimpleNamespaceContext.call($this, tmp$ret$0);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$() {
    return SimpleNamespaceContext_init_$Init$(objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function SimpleNamespaceContext_init_$Init$_0(prefixMap, $this) {
    // Inline function 'nl.adaptivity.xmlutil.Companion.flatten' call
    Companion_getInstance_2();
    var namespaces = prefixMap.get_entries_p20ztl_k$();
    var tmp = asSequence_0(namespaces);
    var filler = flatMap(tmp, SimpleNamespaceContext$_init_$lambda_w7q6ud).iterator_jk1svi_k$();
    var tmp_0 = 0;
    var tmp_1 = imul(namespaces.get_size_woubt6_k$(), 2);
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_2 = fillArrayVal(Array(tmp_1), null);
    while (tmp_0 < tmp_1) {
      tmp_2[tmp_0] = filler.next_20eer_k$();
      tmp_0 = tmp_0 + 1 | 0;
    }
    SimpleNamespaceContext.call($this, tmp_2);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$_0(prefixMap) {
    return SimpleNamespaceContext_init_$Init$_0(prefixMap, objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function SimpleNamespaceContext_init_$Init$_1(prefixes, namespaces, $this) {
    var tmp = 0;
    var tmp_0 = imul(prefixes.length, 2);
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_1 = fillArrayVal(Array(tmp_0), null);
    while (tmp < tmp_0) {
      var tmp_2 = tmp;
      tmp_1[tmp_2] = toString((tmp_2 % 2 | 0) === 0 ? prefixes[tmp_2 / 2 | 0] : namespaces[tmp_2 / 2 | 0]);
      tmp = tmp + 1 | 0;
    }
    SimpleNamespaceContext.call($this, tmp_1);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$_1(prefixes, namespaces) {
    return SimpleNamespaceContext_init_$Init$_1(prefixes, namespaces, objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function SimpleNamespaceContext_init_$Init$_2(prefix, namespace, $this) {
    // Inline function 'kotlin.arrayOf' call
    // Inline function 'kotlin.js.unsafeCast' call
    // Inline function 'kotlin.js.asDynamic' call
    var tmp$ret$2 = [toString(prefix), toString(namespace)];
    SimpleNamespaceContext.call($this, tmp$ret$2);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$_2(prefix, namespace) {
    return SimpleNamespaceContext_init_$Init$_2(prefix, namespace, objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function SimpleNamespaceContext_init_$Init$_3(namespaces, $this) {
    // Inline function 'nl.adaptivity.xmlutil.Companion.flatten' call
    Companion_getInstance_2();
    var tmp = asSequence_0(namespaces);
    var filler = flatMap(tmp, SimpleNamespaceContext$_init_$lambda_w7q6ud_0).iterator_jk1svi_k$();
    var tmp_0 = 0;
    var tmp_1 = imul(namespaces.get_size_woubt6_k$(), 2);
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_2 = fillArrayVal(Array(tmp_1), null);
    while (tmp_0 < tmp_1) {
      tmp_2[tmp_0] = filler.next_20eer_k$();
      tmp_0 = tmp_0 + 1 | 0;
    }
    SimpleNamespaceContext.call($this, tmp_2);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$_3(namespaces) {
    return SimpleNamespaceContext_init_$Init$_3(namespaces, objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function SimpleNamespaceContext_init_$Init$_4(namespaces, $this) {
    var tmp0_elvis_lhs = isInterface(namespaces, Collection) ? namespaces : null;
    SimpleNamespaceContext_init_$Init$_3(tmp0_elvis_lhs == null ? toList(namespaces) : tmp0_elvis_lhs, $this);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$_4(namespaces) {
    return SimpleNamespaceContext_init_$Init$_4(namespaces, objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function SimpleNamespaceContext_init_$Init$_5(original, $this) {
    SimpleNamespaceContext.call($this, original.buffer_1);
    return $this;
  }
  function SimpleNamespaceContext_init_$Create$_5(original) {
    return SimpleNamespaceContext_init_$Init$_5(original, objectCreate(protoOf(SimpleNamespaceContext)));
  }
  function Companion_1() {
    Companion_instance_1 = this;
    this.actualSerializer_1 = ListSerializer(Companion_getInstance_1());
    this.descriptor_1 = SerialDescriptor('nl.adaptivity.xmlutil.SimpleNamespaceContext', this.actualSerializer_1.get_descriptor_wjt6a0_k$());
  }
  protoOf(Companion_1).get_descriptor_wjt6a0_k$ = function () {
    return this.descriptor_1;
  };
  protoOf(Companion_1).from_ls380c_k$ = function (originalNSContext) {
    var tmp;
    if (originalNSContext instanceof SimpleNamespaceContext) {
      tmp = originalNSContext;
    } else {
      tmp = SimpleNamespaceContext_init_$Create$_4(originalNSContext);
    }
    return tmp;
  };
  protoOf(Companion_1).deserialize_sy6x50_k$ = function (decoder) {
    return SimpleNamespaceContext_init_$Create$_3(this.actualSerializer_1.deserialize_sy6x50_k$(decoder));
  };
  protoOf(Companion_1).serialize_ytbcy_k$ = function (encoder, value) {
    this.actualSerializer_1.serialize_5ase3y_k$(encoder, toList(value));
  };
  protoOf(Companion_1).serialize_5ase3y_k$ = function (encoder, value) {
    return this.serialize_ytbcy_k$(encoder, value instanceof SimpleNamespaceContext ? value : THROW_CCE());
  };
  protoOf(Companion_1).serializer_9w0wvi_k$ = function () {
    return Companion_getInstance_2();
  };
  var Companion_instance_1;
  function Companion_getInstance_2() {
    if (Companion_instance_1 == null)
      new Companion_1();
    return Companion_instance_1;
  }
  function SimpleNamespaceContext$_init_$lambda_w7q6ud(it) {
    // Inline function 'nl.adaptivity.xmlutil.SimpleNamespaceContext.<init>.<anonymous>' call
    var tmp = toString(it.get_key_18j28a_k$());
    // Inline function 'nl.adaptivity.xmlutil.SimpleNamespaceContext.<init>.<anonymous>' call
    var tmp$ret$1 = toString(it.get_value_j01efc_k$());
    return sequenceOf([tmp, tmp$ret$1]);
  }
  function SimpleNamespaceContext$_init_$lambda_w7q6ud_0(it) {
    // Inline function 'nl.adaptivity.xmlutil.SimpleNamespaceContext.<init>.<anonymous>' call
    var tmp = it.get_prefix_i78za3_k$();
    // Inline function 'nl.adaptivity.xmlutil.SimpleNamespaceContext.<init>.<anonymous>' call
    var tmp$ret$1 = it.get_namespaceURI_g6nmhy_k$();
    return sequenceOf([tmp, tmp$ret$1]);
  }
  function SimpleNamespaceContext$getPrefixSequence$lambda(this$0, $namespaceURI) {
    return function (it) {
      return this$0.getNamespaceURI_7dpe6n_k$(it) === $namespaceURI;
    };
  }
  function SimpleNamespaceContext$getPrefixSequence$lambda_0(this$0) {
    return function (it) {
      return this$0.getPrefix_wrbewg_k$(it);
    };
  }
  function SimpleNamespaceContext(buffer) {
    Companion_getInstance_2();
    this.buffer_1 = buffer;
  }
  protoOf(SimpleNamespaceContext).get_buffer_bmaafd_k$ = function () {
    return this.buffer_1;
  };
  protoOf(SimpleNamespaceContext).get_indices_xelk8u_k$ = function () {
    return until(0, this.get_size_woubt6_k$());
  };
  protoOf(SimpleNamespaceContext).get_size_woubt6_k$ = function () {
    return this.buffer_1.length / 2 | 0;
  };
  protoOf(SimpleNamespaceContext).freeze_kxzejt_k$ = function () {
    return this;
  };
  protoOf(SimpleNamespaceContext).combine_9pjrd0_k$ = function (other) {
    return this.plus_v2kwkh_k$(other);
  };
  protoOf(SimpleNamespaceContext).plus_v2kwkh_k$ = function (other) {
    // Inline function 'kotlin.collections.mutableMapOf' call
    var result = LinkedHashMap_init_$Create$();
    var progression = this.get_indices_xelk8u_k$();
    var last = progression.get_first_irdx8n_k$();
    var inductionVariable = progression.get_last_wopotb_k$();
    if (last <= inductionVariable)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + -1 | 0;
        // Inline function 'kotlin.collections.set' call
        var key = this.getPrefix_wrbewg_k$(i);
        var value = this.getNamespaceURI_7dpe6n_k$(i);
        result.put_4fpzoq_k$(key, value);
      }
       while (!(i === last));
    var progression_0 = other.get_indices_xelk8u_k$();
    var last_0 = progression_0.get_first_irdx8n_k$();
    var inductionVariable_0 = progression_0.get_last_wopotb_k$();
    if (last_0 <= inductionVariable_0)
      do {
        var i_0 = inductionVariable_0;
        inductionVariable_0 = inductionVariable_0 + -1 | 0;
        // Inline function 'kotlin.collections.set' call
        var key_0 = other.getPrefix_wrbewg_k$(i_0);
        var value_0 = other.getNamespaceURI_7dpe6n_k$(i_0);
        result.put_4fpzoq_k$(key_0, value_0);
      }
       while (!(i_0 === last_0));
    return SimpleNamespaceContext_init_$Create$_0(result);
  };
  protoOf(SimpleNamespaceContext).combine_xppgll_k$ = function (other) {
    return this.plus_orip44_k$(other);
  };
  protoOf(SimpleNamespaceContext).plus_orip44_k$ = function (other) {
    if (this.get_size_woubt6_k$() === 0) {
      return Companion_getInstance_2().from_ls380c_k$(other);
    }
    if (other instanceof SimpleNamespaceContext) {
      return this.plus_v2kwkh_k$(other);
    } else {
      if (!other.iterator_jk1svi_k$().hasNext_bitz1p_k$()) {
        return this;
      }
    }
    // Inline function 'kotlin.collections.mutableMapOf' call
    var result = LinkedHashMap_init_$Create$();
    var progression = this.get_indices_xelk8u_k$();
    var last = progression.get_first_irdx8n_k$();
    var inductionVariable = progression.get_last_wopotb_k$();
    if (last <= inductionVariable)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + -1 | 0;
        // Inline function 'kotlin.collections.set' call
        var key = this.getPrefix_wrbewg_k$(i);
        var value = this.getNamespaceURI_7dpe6n_k$(i);
        result.put_4fpzoq_k$(key, value);
      }
       while (!(i === last));
    var tmp1_iterator = other.iterator_jk1svi_k$();
    while (tmp1_iterator.hasNext_bitz1p_k$()) {
      var ns = tmp1_iterator.next_20eer_k$();
      // Inline function 'kotlin.collections.set' call
      var key_0 = ns.get_prefix_i78za3_k$();
      var value_0 = ns.get_namespaceURI_g6nmhy_k$();
      result.put_4fpzoq_k$(key_0, value_0);
    }
    return SimpleNamespaceContext_init_$Create$_0(result);
  };
  protoOf(SimpleNamespaceContext).getNamespaceURI_859c43_k$ = function (prefix) {
    var tmp;
    if (prefix === XMLConstants_getInstance().get_XML_NS_PREFIX_coe5ej_k$()) {
      tmp = XMLConstants_getInstance().get_XML_NS_URI_kvobz7_k$();
    } else if (prefix === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$()) {
      tmp = XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$();
    } else {
      // Inline function 'kotlin.collections.filter' call
      // Inline function 'kotlin.collections.filterTo' call
      var this_0 = reversed(this.get_indices_xelk8u_k$());
      var destination = ArrayList_init_$Create$();
      var tmp0_iterator = this_0.iterator_jk1svi_k$();
      while (tmp0_iterator.hasNext_bitz1p_k$()) {
        var element = tmp0_iterator.next_20eer_k$();
        // Inline function 'nl.adaptivity.xmlutil.SimpleNamespaceContext.getNamespaceURI.<anonymous>' call
        if (this.getPrefix_wrbewg_k$(element) === prefix) {
          destination.add_utx5q5_k$(element);
        }
      }
      var tmp1_safe_receiver = firstOrNull(destination);
      var tmp_0;
      if (tmp1_safe_receiver == null) {
        tmp_0 = null;
      } else {
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'nl.adaptivity.xmlutil.SimpleNamespaceContext.getNamespaceURI.<anonymous>' call
        tmp_0 = this.getNamespaceURI_7dpe6n_k$(tmp1_safe_receiver);
      }
      tmp = tmp_0;
    }
    return tmp;
  };
  protoOf(SimpleNamespaceContext).getPrefix_7o0aoe_k$ = function (namespaceURI) {
    return firstOrNull_0(this.getPrefixSequence_785chd_k$(namespaceURI));
  };
  protoOf(SimpleNamespaceContext).getPrefixSequence_785chd_k$ = function (namespaceURI) {
    var tmp;
    if (namespaceURI === XMLConstants_getInstance().get_XML_NS_URI_kvobz7_k$()) {
      tmp = sequenceOf([XMLConstants_getInstance().get_XML_NS_PREFIX_coe5ej_k$()]);
    } else if (namespaceURI === XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$()) {
      tmp = sequenceOf([XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$()]);
    } else if (namespaceURI === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$()) {
      tmp = sequenceOf([XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$()]);
    } else {
      var tmp_0 = asSequence_0(reversed(this.get_indices_xelk8u_k$()));
      var tmp_1 = filter(tmp_0, SimpleNamespaceContext$getPrefixSequence$lambda(this, namespaceURI));
      tmp = map(tmp_1, SimpleNamespaceContext$getPrefixSequence$lambda_0(this));
    }
    return tmp;
  };
  protoOf(SimpleNamespaceContext).getPrefixesCompat_d6ifqa_k$ = function (namespaceURI) {
    return this.getPrefixSequence_785chd_k$(namespaceURI).iterator_jk1svi_k$();
  };
  protoOf(SimpleNamespaceContext).getPrefix_wrbewg_k$ = function (index) {
    try {
      return this.buffer_1[imul(index, 2)];
    } catch ($p) {
      if ($p instanceof IndexOutOfBoundsException) {
        var e = $p;
        throw IndexOutOfBoundsException_init_$Create$_0('Index out of range: ' + index);
      } else {
        throw $p;
      }
    }
  };
  protoOf(SimpleNamespaceContext).getNamespaceURI_7dpe6n_k$ = function (index) {
    try {
      return this.buffer_1[imul(index, 2) + 1 | 0];
    } catch ($p) {
      if ($p instanceof IndexOutOfBoundsException) {
        var e = $p;
        throw IndexOutOfBoundsException_init_$Create$_0('Index out of range: ' + index);
      } else {
        throw $p;
      }
    }
  };
  protoOf(SimpleNamespaceContext).iterator_jk1svi_k$ = function () {
    return new SimpleIterator(this);
  };
  protoOf(SimpleNamespaceContext).plus_4d2jm7_k$ = function (secondary) {
    var tmp;
    var tmp_0;
    if (secondary instanceof SimpleNamespaceContext) {
      tmp_0 = secondary.get_size_woubt6_k$() === 0;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this;
    } else {
      var tmp_1;
      if (secondary instanceof SimpleNamespaceContext) {
        tmp_1 = this.get_size_woubt6_k$() === 0;
      } else {
        tmp_1 = false;
      }
      if (tmp_1) {
        tmp = secondary;
      } else {
        tmp = plus_0.call(this, secondary);
      }
    }
    return tmp;
  };
  protoOf(SimpleNamespaceContext).equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof SimpleNamespaceContext))
      return false;
    if (!contentEquals(this.buffer_1, other.buffer_1))
      return false;
    return true;
  };
  protoOf(SimpleNamespaceContext).hashCode = function () {
    return contentHashCode(this.buffer_1);
  };
  function XMLConstants() {
    XMLConstants_instance = this;
    this.DEFAULT_NS_PREFIX_1 = '';
    this.NULL_NS_URI_1 = '';
    this.XMLNS_ATTRIBUTE_NS_URI_1 = 'http://www.w3.org/2000/xmlns/';
    this.XMLNS_ATTRIBUTE_1 = 'xmlns';
    this.XML_NS_PREFIX_1 = 'xml';
    this.XML_NS_URI_1 = 'http://www.w3.org/XML/1998/namespace';
    this.XSI_PREFIX_1 = 'xsi';
    this.XSI_NS_URI_1 = 'http://www.w3.org/2001/XMLSchema-instance';
    this.XSD_PREFIX_1 = 'xsd';
    this.XSD_NS_URI_1 = 'http://www.w3.org/2001/XMLSchema';
  }
  protoOf(XMLConstants).get_DEFAULT_NS_PREFIX_h2n08r_k$ = function () {
    return this.DEFAULT_NS_PREFIX_1;
  };
  protoOf(XMLConstants).get_NULL_NS_URI_lh88gv_k$ = function () {
    return this.NULL_NS_URI_1;
  };
  protoOf(XMLConstants).get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$ = function () {
    return this.XMLNS_ATTRIBUTE_NS_URI_1;
  };
  protoOf(XMLConstants).get_XMLNS_ATTRIBUTE_883gnk_k$ = function () {
    return this.XMLNS_ATTRIBUTE_1;
  };
  protoOf(XMLConstants).get_XML_NS_PREFIX_coe5ej_k$ = function () {
    return this.XML_NS_PREFIX_1;
  };
  protoOf(XMLConstants).get_XML_NS_URI_kvobz7_k$ = function () {
    return this.XML_NS_URI_1;
  };
  protoOf(XMLConstants).get_XSI_PREFIX_uxgit0_k$ = function () {
    return this.XSI_PREFIX_1;
  };
  protoOf(XMLConstants).get_XSI_NS_URI_vuj20k_k$ = function () {
    return this.XSI_NS_URI_1;
  };
  protoOf(XMLConstants).get_XSD_PREFIX_wzcs5r_k$ = function () {
    return this.XSD_PREFIX_1;
  };
  protoOf(XMLConstants).get_XSD_NS_URI_xwfbdb_k$ = function () {
    return this.XSD_NS_URI_1;
  };
  var XMLConstants_instance;
  function XMLConstants_getInstance() {
    if (XMLConstants_instance == null)
      new XMLConstants();
    return XMLConstants_instance;
  }
  function _get_peekBuffer__uxzhww($this) {
    return $this.peekBuffer_1;
  }
  function XmlBufferedReader(delegate) {
    XmlBufferedReaderBase.call(this, delegate);
    this.peekBuffer_1 = ArrayDeque_init_$Create$();
  }
  protoOf(XmlBufferedReader).get_hasPeekItems_ilwmpg_k$ = function () {
    // Inline function 'kotlin.collections.isNotEmpty' call
    return !this.peekBuffer_1.isEmpty_y1axqb_k$();
  };
  protoOf(XmlBufferedReader).peekFirst_vz5wd1_k$ = function () {
    return this.peekBuffer_1.firstOrNull_j0zfvq_k$();
  };
  protoOf(XmlBufferedReader).peekLast_118i35_k$ = function () {
    return this.peekBuffer_1.lastOrNull_u4yjpc_k$();
  };
  protoOf(XmlBufferedReader).bufferRemoveLast_z9ht2e_k$ = function () {
    return this.peekBuffer_1.removeLast_i5wx8a_k$();
  };
  protoOf(XmlBufferedReader).bufferRemoveFirst_rssvro_k$ = function () {
    return this.peekBuffer_1.removeFirst_58pi0k_k$();
  };
  protoOf(XmlBufferedReader).pushBackCurrent_culk5k_k$ = function () {
    var tmp0_elvis_lhs = this.get_current_jwi6j4_k$();
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Push back fails due to missing current element');
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var c = tmp;
    switch (c.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$()) {
      case 1:
        this.decDepth_8l9b73_k$();
        break;
      case 2:
        this.incDepth_t2y8xh_k$();
        break;
      default:
        break;
    }
    this.peekBuffer_1.addFirst_7io6zl_k$(c);
  };
  protoOf(XmlBufferedReader).add_m082ir_k$ = function (event) {
    this.peekBuffer_1.addLast_gaaijb_k$(event);
  };
  protoOf(XmlBufferedReader).addAll_xdbcam_k$ = function (events) {
    this.peekBuffer_1.addAll_4lagoh_k$(events);
  };
  protoOf(XmlBufferedReader).close_yn9xrc_k$ = function () {
    protoOf(XmlBufferedReaderBase).close_yn9xrc_k$.call(this);
    this.peekBuffer_1.clear_j9egeb_k$();
  };
  function _get_delegate__idh0py($this) {
    return $this.delegate_1;
  }
  function _get_namespaceHolder__6tzxme($this) {
    return $this.namespaceHolder_1;
  }
  function _set_current__qj3kk_0($this, _set____db54di) {
    $this.current_1 = _set____db54di;
  }
  function _get_currentElement__mbt3qg_0($this) {
    var tmp = $this.current_1;
    var tmp0_elvis_lhs = tmp instanceof StartElementEvent ? tmp : null;
    var tmp_0;
    if (tmp0_elvis_lhs == null) {
      throw XmlException_init_$Create$_0('Expected a start element, but did not find it.');
    } else {
      tmp_0 = tmp0_elvis_lhs;
    }
    return tmp_0;
  }
  function removeFirstToCurrent($this) {
    var event = $this.bufferRemoveFirst_rssvro_k$();
    $this.current_1 = event;
    switch (event.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$()) {
      case 1:
        $this.namespaceHolder_1.incDepth_t2y8xh_k$();
        var start = event instanceof StartElementEvent ? event : THROW_CCE();
        var tmp1_iterator = start.get_namespaceDecls_1u0o6v_k$().iterator_jk1svi_k$();
        while (tmp1_iterator.hasNext_bitz1p_k$()) {
          var ns = tmp1_iterator.next_20eer_k$();
          $this.namespaceHolder_1.addPrefixToContext_uj25lh_k$(ns);
        }

        break;
      case 2:
        $this.namespaceHolder_1.decDepth_8l9b73_k$();
        break;
      default:
        break;
    }
    return event;
  }
  function XmlBufferedReaderBase(delegate) {
    this.delegate_1 = delegate;
    this.namespaceHolder_1 = new NamespaceHolder();
    if (this.delegate_1.get_isStarted_wg74c2_k$()) {
      var tmp0_iterator = this.delegate_1.get_namespaceContext_n7n1ib_k$().iterator_jk1svi_k$();
      while (tmp0_iterator.hasNext_bitz1p_k$()) {
        var ns = tmp0_iterator.next_20eer_k$();
        this.namespaceHolder_1.addPrefixToContext_uj25lh_k$(ns);
      }
    }
    this.current_1 = this.delegate_1.get_isStarted_wg74c2_k$() ? Companion_getInstance_3().from_28j0le_k$(this.delegate_1) : null;
  }
  protoOf(XmlBufferedReaderBase).get_current_jwi6j4_k$ = function () {
    return this.current_1;
  };
  protoOf(XmlBufferedReaderBase).get_namespaceURI_g6nmhy_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp1_subject = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_eventType_918hfv_k$();
    var tmp;
    switch (tmp1_subject == null ? -1 : tmp1_subject.get_ordinal_ip24qg_k$()) {
      case 10:
        var tmp_0 = this.current_1;
        tmp = (tmp_0 instanceof Attribute ? tmp_0 : THROW_CCE()).get_namespaceUri_g6nlpi_k$();
        break;
      case 1:
        var tmp_1 = this.current_1;
        tmp = (tmp_1 instanceof StartElementEvent ? tmp_1 : THROW_CCE()).get_namespaceUri_g6nlpi_k$();
        break;
      case 2:
        var tmp_2 = this.current_1;
        tmp = (tmp_2 instanceof EndElementEvent ? tmp_2 : THROW_CCE()).get_namespaceUri_g6nlpi_k$();
        break;
      default:
        var tmp2_safe_receiver = this.current_1;
        throw XmlException_init_$Create$_0('Attribute not defined here: namespaceUri (current event: ' + (tmp2_safe_receiver == null ? null : tmp2_safe_receiver.get_eventType_918hfv_k$()) + ')');
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_localName_bf4zrn_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp1_subject = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_eventType_918hfv_k$();
    var tmp;
    switch (tmp1_subject == null ? -1 : tmp1_subject.get_ordinal_ip24qg_k$()) {
      case 8:
        var tmp_0 = this.current_1;
        tmp = (tmp_0 instanceof EntityRefEvent ? tmp_0 : THROW_CCE()).get_localName_bf4zrn_k$();
        break;
      case 10:
        var tmp_1 = this.current_1;
        tmp = (tmp_1 instanceof Attribute ? tmp_1 : THROW_CCE()).get_localName_bf4zrn_k$();
        break;
      case 1:
        var tmp_2 = this.current_1;
        tmp = (tmp_2 instanceof StartElementEvent ? tmp_2 : THROW_CCE()).get_localName_bf4zrn_k$();
        break;
      case 2:
        var tmp_3 = this.current_1;
        tmp = (tmp_3 instanceof EndElementEvent ? tmp_3 : THROW_CCE()).get_localName_bf4zrn_k$();
        break;
      default:
        throw XmlException_init_$Create$_0('Attribute not defined here: localName');
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_prefix_i78za3_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp1_subject = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_eventType_918hfv_k$();
    var tmp;
    switch (tmp1_subject == null ? -1 : tmp1_subject.get_ordinal_ip24qg_k$()) {
      case 10:
        var tmp_0 = this.current_1;
        tmp = (tmp_0 instanceof Attribute ? tmp_0 : THROW_CCE()).get_prefix_i78za3_k$();
        break;
      case 1:
        var tmp_1 = this.current_1;
        tmp = (tmp_1 instanceof StartElementEvent ? tmp_1 : THROW_CCE()).get_prefix_i78za3_k$();
        break;
      case 2:
        var tmp_2 = this.current_1;
        tmp = (tmp_2 instanceof EndElementEvent ? tmp_2 : THROW_CCE()).get_prefix_i78za3_k$();
        break;
      default:
        throw XmlException_init_$Create$_0('Attribute not defined here: prefix');
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_depth_iq7qmy_k$ = function () {
    return this.namespaceHolder_1.get_depth_iq7qmy_k$();
  };
  protoOf(XmlBufferedReaderBase).incDepth_t2y8xh_k$ = function () {
    this.namespaceHolder_1.incDepth_t2y8xh_k$();
  };
  protoOf(XmlBufferedReaderBase).decDepth_8l9b73_k$ = function () {
    this.namespaceHolder_1.decDepth_8l9b73_k$();
  };
  protoOf(XmlBufferedReaderBase).get_piTarget_jrarar_k$ = function () {
    var tmp = this.current_1;
    return (tmp instanceof ProcessingInstructionEvent ? tmp : THROW_CCE()).get_target_juba8q_k$();
  };
  protoOf(XmlBufferedReaderBase).get_piData_i1pnws_k$ = function () {
    var tmp = this.current_1;
    return (tmp instanceof ProcessingInstructionEvent ? tmp : THROW_CCE()).get_data_wokkxf_k$();
  };
  protoOf(XmlBufferedReaderBase).get_text_wouvsm_k$ = function () {
    var tmp;
    if (ensureNotNull(this.current_1).get_eventType_918hfv_k$() === EventType_ATTRIBUTE_getInstance()) {
      var tmp_0 = this.current_1;
      tmp = (tmp_0 instanceof Attribute ? tmp_0 : THROW_CCE()).get_value_j01efc_k$();
    } else {
      var tmp_1 = this.current_1;
      tmp = (tmp_1 instanceof TextEvent ? tmp_1 : THROW_CCE()).get_text_wouvsm_k$();
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_attributeCount_hqf30_k$ = function () {
    return _get_currentElement__mbt3qg_0(this).get_attributes_dgqof4_k$().length;
  };
  protoOf(XmlBufferedReaderBase).get_isStarted_wg74c2_k$ = function () {
    return !(this.current_1 == null);
  };
  protoOf(XmlBufferedReaderBase).get_eventType_918hfv_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_eventType_918hfv_k$();
    var tmp;
    if (tmp1_elvis_lhs == null) {
      var tmp_0;
      if (this.hasNext_bitz1p_k$()) {
        throw XmlException_init_$Create$_0('Attempting to get the event type before getting an event.');
      } else {
        throw XmlException_init_$Create$_0('Attempting to read beyond the end of the stream');
      }
    } else {
      tmp = tmp1_elvis_lhs;
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_locationInfo_3kny30_k$ = function () {
    var tmp0_safe_receiver = this.current_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_locationInfo_3kny30_k$();
    return tmp1_elvis_lhs == null ? this.delegate_1.get_locationInfo_3kny30_k$() : tmp1_elvis_lhs;
  };
  protoOf(XmlBufferedReaderBase).get_namespaceContext_n7n1ib_k$ = function () {
    var c = this.current_1;
    var tmp;
    if (c instanceof StartElementEvent) {
      tmp = c.get_namespaceContext_n7n1ib_k$();
    } else {
      if (c instanceof EndElementEvent) {
        tmp = c.get_namespaceContext_n7n1ib_k$();
      } else {
        tmp = this.namespaceHolder_1.get_namespaceContext_n7n1ib_k$();
      }
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_namespaceDecls_1u0o6v_k$ = function () {
    var c = this.current_1;
    var tmp;
    if (c instanceof StartElementEvent) {
      tmp = toList(c.get_namespaceDecls_1u0o6v_k$());
    } else {
      tmp = this.namespaceHolder_1.get_namespacesAtCurrentDepth_6mysci_k$();
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).get_encoding_3i4b8k_k$ = function () {
    var tmp = this.current_1;
    return (tmp instanceof StartDocumentEvent ? tmp : THROW_CCE()).get_encoding_3i4b8k_k$();
  };
  protoOf(XmlBufferedReaderBase).get_standalone_tm0l3i_k$ = function () {
    var tmp = this.current_1;
    return (tmp instanceof StartDocumentEvent ? tmp : THROW_CCE()).get_standalone_tm0l3i_k$();
  };
  protoOf(XmlBufferedReaderBase).get_version_72w4j3_k$ = function () {
    var tmp = this.current_1;
    return (tmp instanceof StartDocumentEvent ? tmp : THROW_CCE()).get_version_72w4j3_k$();
  };
  protoOf(XmlBufferedReaderBase).nextEvent_jqfwbr_k$ = function () {
    if (this.get_hasPeekItems_ilwmpg_k$()) {
      return removeFirstToCurrent(this);
    }
    if (!this.hasNext_bitz1p_k$()) {
      throw NoSuchElementException_init_$Create$();
    }
    this.peek_21nx7_k$();
    return removeFirstToCurrent(this);
  };
  protoOf(XmlBufferedReaderBase).peek_21nx7_k$ = function () {
    if (!this.get_hasPeekItems_ilwmpg_k$()) {
      this.addAll_xdbcam_k$(this.doPeek_ly3gca_k$());
    }
    return this.peekFirst_vz5wd1_k$();
  };
  protoOf(XmlBufferedReaderBase).doPeek_ly3gca_k$ = function () {
    if (this.delegate_1.hasNext_bitz1p_k$()) {
      this.delegate_1.next_20eer_k$();
      var event = Companion_getInstance_3().from_28j0le_k$(this.delegate_1);
      var result = ArrayList_init_$Create$_0(1);
      result.add_utx5q5_k$(event);
      return result;
    }
    return emptyList();
  };
  protoOf(XmlBufferedReaderBase).hasNext_bitz1p_k$ = function () {
    if (this.get_hasPeekItems_ilwmpg_k$()) {
      return true;
    }
    return !(this.peek_21nx7_k$() == null);
  };
  protoOf(XmlBufferedReaderBase).stripWhiteSpaceFromPeekBuffer_qyai22_k$ = function () {
    $l$loop: while (true) {
      var tmp;
      if (this.get_hasPeekItems_ilwmpg_k$()) {
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'nl.adaptivity.xmlutil.XmlBufferedReaderBase.stripWhiteSpaceFromPeekBuffer.<anonymous>' call
        var peekLast = this.peekLast_118i35_k$();
        var tmp_0;
        if (peekLast instanceof TextEvent) {
          tmp_0 = isXmlWhitespace(peekLast.get_text_wouvsm_k$());
        } else {
          tmp_0 = false;
        }
        tmp = tmp_0;
      } else {
        tmp = false;
      }
      if (!tmp) {
        break $l$loop;
      }
      this.bufferRemoveLast_z9ht2e_k$();
    }
  };
  protoOf(XmlBufferedReaderBase).close_yn9xrc_k$ = function () {
    this.delegate_1.close_yn9xrc_k$();
  };
  protoOf(XmlBufferedReaderBase).nextTag_ujozaf_k$ = function () {
    return this.nextTagEvent_u9u0ul_k$().get_eventType_918hfv_k$();
  };
  protoOf(XmlBufferedReaderBase).nextTagEvent_u9u0ul_k$ = function () {
    var current = this.nextEvent_jqfwbr_k$();
    var tmp;
    switch (current.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$()) {
      case 4:
        var tmp_0;
        if (isXmlWhitespace((current instanceof TextEvent ? current : THROW_CCE()).get_text_wouvsm_k$())) {
          tmp_0 = this.nextTagEvent_u9u0ul_k$();
        } else {
          throw XmlException_init_$Create$_0('Unexpected element found when looking for tags: ' + current);
        }

        tmp = tmp_0;
        break;
      case 0:
      case 3:
      case 9:
      case 11:
        tmp = this.nextTagEvent_u9u0ul_k$();
        break;
      case 1:
      case 2:
        tmp = current;
        break;
      default:
        throw XmlException_init_$Create$_0('Unexpected element found when looking for tags: ' + current);
    }
    return tmp;
  };
  protoOf(XmlBufferedReaderBase).next_20eer_k$ = function () {
    return this.nextEvent_jqfwbr_k$().get_eventType_918hfv_k$();
  };
  protoOf(XmlBufferedReaderBase).getAttributeNamespace_wj9j6l_k$ = function (index) {
    return _get_currentElement__mbt3qg_0(this).get_attributes_dgqof4_k$()[index].get_namespaceUri_g6nlpi_k$();
  };
  protoOf(XmlBufferedReaderBase).getAttributePrefix_luun28_k$ = function (index) {
    return _get_currentElement__mbt3qg_0(this).get_attributes_dgqof4_k$()[index].get_prefix_i78za3_k$();
  };
  protoOf(XmlBufferedReaderBase).getAttributeLocalName_i25hjc_k$ = function (index) {
    return _get_currentElement__mbt3qg_0(this).get_attributes_dgqof4_k$()[index].get_localName_bf4zrn_k$();
  };
  protoOf(XmlBufferedReaderBase).getAttributeValue_qah2od_k$ = function (index) {
    return _get_currentElement__mbt3qg_0(this).get_attributes_dgqof4_k$()[index].get_value_j01efc_k$();
  };
  protoOf(XmlBufferedReaderBase).getAttributeValue_8yb7e2_k$ = function (nsUri, localName) {
    var tmp$ret$1;
    $l$block: {
      // Inline function 'kotlin.collections.firstOrNull' call
      var indexedObject = _get_currentElement__mbt3qg_0(this).get_attributes_dgqof4_k$();
      var inductionVariable = 0;
      var last = indexedObject.length;
      while (inductionVariable < last) {
        var element = indexedObject[inductionVariable];
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'nl.adaptivity.xmlutil.XmlBufferedReaderBase.getAttributeValue.<anonymous>' call
        if ((nsUri == null ? true : nsUri === element.get_namespaceUri_g6nlpi_k$()) ? localName === element.get_localName_bf4zrn_k$() : false) {
          tmp$ret$1 = element;
          break $l$block;
        }
      }
      tmp$ret$1 = null;
    }
    var tmp0_safe_receiver = tmp$ret$1;
    return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_value_j01efc_k$();
  };
  protoOf(XmlBufferedReaderBase).getNamespacePrefix_8fyoot_k$ = function (namespaceUri) {
    return _get_currentElement__mbt3qg_0(this).getPrefix_7o0aoe_k$(namespaceUri);
  };
  protoOf(XmlBufferedReaderBase).getNamespaceURI_859c43_k$ = function (prefix) {
    return _get_currentElement__mbt3qg_0(this).getNamespaceURI_859c43_k$(prefix);
  };
  function XmlDelegatingReader(delegate) {
    this.delegate_1 = delegate;
  }
  protoOf(XmlDelegatingReader).get_delegate_i94tki_k$ = function () {
    return this.delegate_1;
  };
  protoOf(XmlDelegatingReader).get_attributeCount_hqf30_k$ = function () {
    return this.delegate_1.get_attributeCount_hqf30_k$();
  };
  protoOf(XmlDelegatingReader).get_depth_iq7qmy_k$ = function () {
    return this.delegate_1.get_depth_iq7qmy_k$();
  };
  protoOf(XmlDelegatingReader).get_encoding_3i4b8k_k$ = function () {
    return this.delegate_1.get_encoding_3i4b8k_k$();
  };
  protoOf(XmlDelegatingReader).get_eventType_918hfv_k$ = function () {
    return this.delegate_1.get_eventType_918hfv_k$();
  };
  protoOf(XmlDelegatingReader).get_isStarted_wg74c2_k$ = function () {
    return this.delegate_1.get_isStarted_wg74c2_k$();
  };
  protoOf(XmlDelegatingReader).get_localName_bf4zrn_k$ = function () {
    return this.delegate_1.get_localName_bf4zrn_k$();
  };
  protoOf(XmlDelegatingReader).get_locationInfo_3kny30_k$ = function () {
    return this.delegate_1.get_locationInfo_3kny30_k$();
  };
  protoOf(XmlDelegatingReader).get_name_woqyms_k$ = function () {
    return this.delegate_1.get_name_woqyms_k$();
  };
  protoOf(XmlDelegatingReader).get_namespaceContext_n7n1ib_k$ = function () {
    return this.delegate_1.get_namespaceContext_n7n1ib_k$();
  };
  protoOf(XmlDelegatingReader).get_namespaceDecls_1u0o6v_k$ = function () {
    return this.delegate_1.get_namespaceDecls_1u0o6v_k$();
  };
  protoOf(XmlDelegatingReader).get_namespaceURI_g6nmhy_k$ = function () {
    return this.delegate_1.get_namespaceURI_g6nmhy_k$();
  };
  protoOf(XmlDelegatingReader).get_piData_i1pnws_k$ = function () {
    return this.delegate_1.get_piData_i1pnws_k$();
  };
  protoOf(XmlDelegatingReader).get_piTarget_jrarar_k$ = function () {
    return this.delegate_1.get_piTarget_jrarar_k$();
  };
  protoOf(XmlDelegatingReader).get_prefix_i78za3_k$ = function () {
    return this.delegate_1.get_prefix_i78za3_k$();
  };
  protoOf(XmlDelegatingReader).get_standalone_tm0l3i_k$ = function () {
    return this.delegate_1.get_standalone_tm0l3i_k$();
  };
  protoOf(XmlDelegatingReader).get_text_wouvsm_k$ = function () {
    return this.delegate_1.get_text_wouvsm_k$();
  };
  protoOf(XmlDelegatingReader).get_version_72w4j3_k$ = function () {
    return this.delegate_1.get_version_72w4j3_k$();
  };
  protoOf(XmlDelegatingReader).close_yn9xrc_k$ = function () {
    this.delegate_1.close_yn9xrc_k$();
  };
  protoOf(XmlDelegatingReader).getAttributeLocalName_i25hjc_k$ = function (index) {
    return this.delegate_1.getAttributeLocalName_i25hjc_k$(index);
  };
  protoOf(XmlDelegatingReader).getAttributeName_q93fq1_k$ = function (index) {
    return this.delegate_1.getAttributeName_q93fq1_k$(index);
  };
  protoOf(XmlDelegatingReader).getAttributeNamespace_wj9j6l_k$ = function (index) {
    return this.delegate_1.getAttributeNamespace_wj9j6l_k$(index);
  };
  protoOf(XmlDelegatingReader).getAttributePrefix_luun28_k$ = function (index) {
    return this.delegate_1.getAttributePrefix_luun28_k$(index);
  };
  protoOf(XmlDelegatingReader).getAttributeValue_qah2od_k$ = function (index) {
    return this.delegate_1.getAttributeValue_qah2od_k$(index);
  };
  protoOf(XmlDelegatingReader).getAttributeValue_8yb7e2_k$ = function (nsUri, localName) {
    return this.delegate_1.getAttributeValue_8yb7e2_k$(nsUri, localName);
  };
  protoOf(XmlDelegatingReader).getAttributeValue_j0o48g_k$ = function (name) {
    return this.delegate_1.getAttributeValue_j0o48g_k$(name);
  };
  protoOf(XmlDelegatingReader).getNamespacePrefix_8fyoot_k$ = function (namespaceUri) {
    return this.delegate_1.getNamespacePrefix_8fyoot_k$(namespaceUri);
  };
  protoOf(XmlDelegatingReader).getNamespaceURI_859c43_k$ = function (prefix) {
    return this.delegate_1.getNamespaceURI_859c43_k$(prefix);
  };
  protoOf(XmlDelegatingReader).hasNext_bitz1p_k$ = function () {
    return this.delegate_1.hasNext_bitz1p_k$();
  };
  protoOf(XmlDelegatingReader).isCharacters_eiwdzg_k$ = function () {
    return this.delegate_1.isCharacters_eiwdzg_k$();
  };
  protoOf(XmlDelegatingReader).isEndElement_c65r3f_k$ = function () {
    return this.delegate_1.isEndElement_c65r3f_k$();
  };
  protoOf(XmlDelegatingReader).isStartElement_spryx0_k$ = function () {
    return this.delegate_1.isStartElement_spryx0_k$();
  };
  protoOf(XmlDelegatingReader).isWhitespace_ujiz09_k$ = function () {
    return this.delegate_1.isWhitespace_ujiz09_k$();
  };
  protoOf(XmlDelegatingReader).next_20eer_k$ = function () {
    return this.delegate_1.next_20eer_k$();
  };
  protoOf(XmlDelegatingReader).require_glcost_k$ = function (type, namespace, name) {
    this.delegate_1.require_glcost_k$(type, namespace, name);
  };
  protoOf(XmlDelegatingReader).require_e8zaef_k$ = function (type, name) {
    this.delegate_1.require_e8zaef_k$(type, name);
  };
  protoOf(XmlDelegatingReader).nextTag_ujozaf_k$ = function () {
    var eventType = this.next_20eer_k$();
    while (((((eventType.equals(EventType_TEXT_getInstance()) ? this.isWhitespace_ujiz09_k$() : false) ? true : eventType.equals(EventType_CDSECT_getInstance()) ? this.isWhitespace_ujiz09_k$() : false) ? true : eventType.equals(EventType_IGNORABLE_WHITESPACE_getInstance())) ? true : eventType.equals(EventType_PROCESSING_INSTRUCTION_getInstance())) ? true : eventType.equals(EventType_COMMENT_getInstance())) {
      eventType = this.next_20eer_k$();
    }
    if (!eventType.equals(EventType_START_ELEMENT_getInstance()) ? !eventType.equals(EventType_END_ELEMENT_getInstance()) : false) {
      throw XmlException_init_$Create$_0('expected start or end tag');
    }
    return eventType;
  };
  function XmlDeserializerFactory() {
  }
  function _get_parentNamespaceContext__ywen1p($this) {
    return $this.parentNamespaceContext_1;
  }
  function _get_namespaceHolder__6tzxme_0($this) {
    return $this.namespaceHolder_1;
  }
  function StartElementEvent_init_$Init$(namespaceUri, localName, prefix, parentNamespaceContext, $this) {
    // Inline function 'kotlin.emptyArray' call
    var tmp$ret$0 = [];
    StartElementEvent.call($this, null, namespaceUri, localName, prefix, tmp$ret$0, parentNamespaceContext, emptyList());
    return $this;
  }
  function StartElementEvent_init_$Create$(namespaceUri, localName, prefix, parentNamespaceContext) {
    return StartElementEvent_init_$Init$(namespaceUri, localName, prefix, parentNamespaceContext, objectCreate(protoOf(StartElementEvent)));
  }
  function StartElementEvent_init_$Init$_0(namespaceUri, localName, prefix, $this) {
    StartElementEvent_init_$Init$(namespaceUri, localName, prefix, SimpleNamespaceContext_init_$Create$(), $this);
    return $this;
  }
  function StartElementEvent_init_$Create$_0(namespaceUri, localName, prefix) {
    return StartElementEvent_init_$Init$_0(namespaceUri, localName, prefix, objectCreate(protoOf(StartElementEvent)));
  }
  function StartElementEvent_init_$Init$_1(locationInfo, namespaceUri, localName, prefix, attributes, namespaceDecls, $this) {
    StartElementEvent.call($this, locationInfo, namespaceUri, localName, prefix, attributes, SimpleNamespaceContext_init_$Create$(), namespaceDecls);
    return $this;
  }
  function StartElementEvent_init_$Create$_1(locationInfo, namespaceUri, localName, prefix, attributes, namespaceDecls) {
    return StartElementEvent_init_$Init$_1(locationInfo, namespaceUri, localName, prefix, attributes, namespaceDecls, objectCreate(protoOf(StartElementEvent)));
  }
  function XmlEvent$StartElementEvent$toString$lambda(it) {
    return it.localName_1 + ' = ' + it.value_1 + ' ';
  }
  function Attribute_init_$Init$(namespaceUri, localName, prefix, value, $this) {
    Attribute.call($this, null, namespaceUri, localName, prefix, value);
    return $this;
  }
  function Attribute_init_$Create$(namespaceUri, localName, prefix, value) {
    return Attribute_init_$Init$(namespaceUri, localName, prefix, value, objectCreate(protoOf(Attribute)));
  }
  function Companion_2() {
    Companion_instance_2 = this;
  }
  protoOf(Companion_2).from_28j0le_k$ = function (reader) {
    return reader.get_eventType_918hfv_k$().createEvent_2rhg4u_k$(reader);
  };
  var Companion_instance_2;
  function Companion_getInstance_3() {
    if (Companion_instance_2 == null)
      new Companion_2();
    return Companion_instance_2;
  }
  function TextEvent(locationInfo, eventType, text) {
    XmlEvent.call(this, locationInfo);
    this.eventType_1 = eventType;
    this.text_1 = text;
  }
  protoOf(TextEvent).get_eventType_918hfv_k$ = function () {
    return this.eventType_1;
  };
  protoOf(TextEvent).get_text_wouvsm_k$ = function () {
    return this.text_1;
  };
  protoOf(TextEvent).writeTo_3vocdz_k$ = function (writer) {
    return this.get_eventType_918hfv_k$().writeEvent_nrkoim_k$(writer, this);
  };
  protoOf(TextEvent).get_isIgnorable_uazyqu_k$ = function () {
    return protoOf(XmlEvent).get_isIgnorable_uazyqu_k$.call(this) ? true : this.get_eventType_918hfv_k$().equals(EventType_TEXT_getInstance()) ? isXmlWhitespace(this.text_1) : false;
  };
  protoOf(TextEvent).toString = function () {
    var tmp = this.get_eventType_918hfv_k$();
    var tmp0_elvis_lhs = this.locationInfo_1;
    return '' + tmp + ' - "' + this.text_1 + '" (' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + ')';
  };
  function ProcessingInstructionEvent(locationInfo, target, data) {
    TextEvent.call(this, locationInfo, EventType_PROCESSING_INSTRUCTION_getInstance(), target + ' ' + data);
    this.target_1 = target;
    this.data_1 = data;
  }
  protoOf(ProcessingInstructionEvent).get_target_juba8q_k$ = function () {
    return this.target_1;
  };
  protoOf(ProcessingInstructionEvent).get_data_wokkxf_k$ = function () {
    return this.data_1;
  };
  function EntityRefEvent(locationInfo, localName, text) {
    TextEvent.call(this, locationInfo, EventType_ENTITY_REF_getInstance(), text);
    this.localName_1 = localName;
  }
  protoOf(EntityRefEvent).get_localName_bf4zrn_k$ = function () {
    return this.localName_1;
  };
  protoOf(EntityRefEvent).writeTo_3vocdz_k$ = function (writer) {
    return this.get_eventType_918hfv_k$().writeEvent_nrkoim_k$(writer, this);
  };
  protoOf(EntityRefEvent).get_isIgnorable_uazyqu_k$ = function () {
    return false;
  };
  protoOf(EntityRefEvent).toString = function () {
    var tmp = this.get_eventType_918hfv_k$();
    var tmp0_elvis_lhs = this.locationInfo_1;
    return '' + tmp + ' - "' + this.text_1 + '" (' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + ')';
  };
  function EndDocumentEvent(locationInfo) {
    XmlEvent.call(this, locationInfo);
  }
  protoOf(EndDocumentEvent).writeTo_3vocdz_k$ = function (writer) {
    return writer.endDocument_lstnba_k$();
  };
  protoOf(EndDocumentEvent).get_eventType_918hfv_k$ = function () {
    return EventType_END_DOCUMENT_getInstance();
  };
  protoOf(EndDocumentEvent).toString = function () {
    var tmp = this.get_eventType_918hfv_k$();
    var tmp0_elvis_lhs = this.locationInfo_1;
    return '' + tmp + ' (' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + ')';
  };
  function EndElementEvent(locationInfo, namespaceUri, localName, prefix, namespaceContext) {
    NamedEvent.call(this, locationInfo, namespaceUri, localName, prefix);
    this.namespaceContext_1 = namespaceContext.freeze_kxzejt_k$();
  }
  protoOf(EndElementEvent).writeTo_3vocdz_k$ = function (writer) {
    return writer.endTag_yzukbv_k$(this.namespaceUri_1, this.localName_1, this.prefix_1);
  };
  protoOf(EndElementEvent).get_eventType_918hfv_k$ = function () {
    return EventType_END_ELEMENT_getInstance();
  };
  protoOf(EndElementEvent).get_namespaceContext_n7n1ib_k$ = function () {
    return this.namespaceContext_1;
  };
  function StartDocumentEvent(locationInfo, encoding, version, standalone) {
    XmlEvent.call(this, locationInfo);
    this.encoding_1 = encoding;
    this.version_1 = version;
    this.standalone_1 = standalone;
  }
  protoOf(StartDocumentEvent).get_encoding_3i4b8k_k$ = function () {
    return this.encoding_1;
  };
  protoOf(StartDocumentEvent).get_version_72w4j3_k$ = function () {
    return this.version_1;
  };
  protoOf(StartDocumentEvent).get_standalone_tm0l3i_k$ = function () {
    return this.standalone_1;
  };
  protoOf(StartDocumentEvent).writeTo_3vocdz_k$ = function (writer) {
    return writer.startDocument_dbnt67_k$(this.version_1, this.encoding_1, this.standalone_1);
  };
  protoOf(StartDocumentEvent).get_eventType_918hfv_k$ = function () {
    return EventType_START_DOCUMENT_getInstance();
  };
  protoOf(StartDocumentEvent).toString = function () {
    var tmp = this.get_eventType_918hfv_k$();
    var tmp0_elvis_lhs = this.locationInfo_1;
    return '' + tmp + ' - encoding:' + this.encoding_1 + ', version: ' + this.version_1 + ', standalone: ' + this.standalone_1 + ' (' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + ')';
  };
  function NamedEvent(locationInfo, namespaceUri, localName, prefix) {
    XmlEvent.call(this, locationInfo);
    this.namespaceUri_1 = namespaceUri;
    this.localName_1 = localName;
    this.prefix_1 = prefix;
  }
  protoOf(NamedEvent).get_namespaceUri_g6nlpi_k$ = function () {
    return this.namespaceUri_1;
  };
  protoOf(NamedEvent).get_localName_bf4zrn_k$ = function () {
    return this.localName_1;
  };
  protoOf(NamedEvent).get_prefix_i78za3_k$ = function () {
    return this.prefix_1;
  };
  protoOf(NamedEvent).isEqualNames_i3xeee_k$ = function (ev) {
    return (this.namespaceUri_1 === ev.namespaceUri_1 ? this.localName_1 === ev.localName_1 : false) ? this.prefix_1 === ev.prefix_1 : false;
  };
  protoOf(NamedEvent).get_name_woqyms_k$ = function () {
    return new QName(this.namespaceUri_1, this.localName_1, this.prefix_1);
  };
  protoOf(NamedEvent).toString = function () {
    var tmp = this.get_eventType_918hfv_k$();
    var tmp0_elvis_lhs = this.locationInfo_1;
    return '' + tmp + ' - {' + this.namespaceUri_1 + '}' + this.prefix_1 + ':' + this.localName_1 + ' (' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + ')';
  };
  function StartElementEvent(locationInfo, namespaceUri, localName, prefix, attributes, parentNamespaceContext, namespaceDecls) {
    NamedEvent.call(this, locationInfo, namespaceUri, localName, prefix);
    this.attributes_1 = attributes;
    this.parentNamespaceContext_1 = parentNamespaceContext;
    var tmp = this;
    // Inline function 'kotlin.collections.asIterable' call
    tmp.namespaceHolder_1 = SimpleNamespaceContext_init_$Create$_4(namespaceDecls);
  }
  protoOf(StartElementEvent).get_attributes_dgqof4_k$ = function () {
    return this.attributes_1;
  };
  protoOf(StartElementEvent).writeTo_3vocdz_k$ = function (writer) {
    writer.startTag_pjuzbi_k$(this.namespaceUri_1, this.localName_1, this.prefix_1);
    // Inline function 'kotlin.collections.forEach' call
    var indexedObject = this.attributes_1;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var element = indexedObject[inductionVariable];
      inductionVariable = inductionVariable + 1 | 0;
      // Inline function 'nl.adaptivity.xmlutil.StartElementEvent.writeTo.<anonymous>' call
      writer.attribute_ruzjv8_k$(element.namespaceUri_1, element.localName_1, element.prefix_1, element.value_1);
    }
    // Inline function 'kotlin.collections.forEach' call
    var tmp0_iterator = this.namespaceHolder_1.iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var element_0 = tmp0_iterator.next_20eer_k$();
      // Inline function 'nl.adaptivity.xmlutil.StartElementEvent.writeTo.<anonymous>' call
      writer.namespaceAttr_vkifxg_k$(element_0.get_prefix_i78za3_k$(), element_0.get_namespaceURI_g6nmhy_k$());
    }
  };
  protoOf(StartElementEvent).get_namespaceDecls_1u0o6v_k$ = function () {
    return this.namespaceHolder_1;
  };
  protoOf(StartElementEvent).get_eventType_918hfv_k$ = function () {
    return EventType_START_ELEMENT_getInstance();
  };
  protoOf(StartElementEvent).getPrefix_7o0aoe_k$ = function (namespaceURI) {
    var tmp0_elvis_lhs = this.namespaceHolder_1.getPrefix_7o0aoe_k$(namespaceURI);
    return tmp0_elvis_lhs == null ? this.parentNamespaceContext_1.getPrefix_7o0aoe_k$(this.namespaceUri_1) : tmp0_elvis_lhs;
  };
  protoOf(StartElementEvent).getNamespaceURI_859c43_k$ = function (prefix) {
    var decl = this.namespaceHolder_1.getNamespaceURI_859c43_k$(prefix);
    return decl == null ? this.parentNamespaceContext_1.getNamespaceURI_859c43_k$(prefix) : decl;
  };
  protoOf(StartElementEvent).getNamespaceUri_83evzq_k$ = function (prefix) {
    return this.getNamespaceURI_859c43_k$(toString(prefix));
  };
  protoOf(StartElementEvent).get_namespaceContext_n7n1ib_k$ = function () {
    return this.namespaceHolder_1.plus_4d2jm7_k$(this.parentNamespaceContext_1);
  };
  protoOf(StartElementEvent).getPrefixesCompat_d6ifqa_k$ = function (namespaceURI) {
    return plus(asSequence(this.namespaceHolder_1.getPrefixesCompat_d6ifqa_k$(namespaceURI)), asSequence(this.parentNamespaceContext_1.getPrefixesCompat_d6ifqa_k$(namespaceURI))).iterator_jk1svi_k$();
  };
  protoOf(StartElementEvent).toString = function () {
    var tmp = this.get_eventType_918hfv_k$();
    var tmp0_elvis_lhs = this.locationInfo_1;
    var tmp_0 = '' + tmp + ' - {' + this.namespaceUri_1 + '}' + this.prefix_1 + ':' + this.localName_1 + ' (' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + ')';
    var tmp_1;
    // Inline function 'kotlin.collections.isNotEmpty' call
    // Inline function 'kotlin.collections.isEmpty' call
    if (!(this.attributes_1.length === 0)) {
      tmp_1 = '\n    ';
    } else {
      tmp_1 = '';
    }
    var tmp_2 = tmp_1;
    return tmp_0 + joinToString(this.attributes_1, '\n    ', tmp_2, VOID, VOID, VOID, XmlEvent$StartElementEvent$toString$lambda);
  };
  function Attribute(locationInfo, namespaceUri, localName, prefix, value) {
    XmlEvent.call(this, locationInfo);
    this.value_1 = toString(value);
    this.prefix_1 = toString(prefix);
    this.localName_1 = toString(localName);
    this.namespaceUri_1 = toString(namespaceUri);
  }
  protoOf(Attribute).get_value_j01efc_k$ = function () {
    return this.value_1;
  };
  protoOf(Attribute).get_prefix_i78za3_k$ = function () {
    return this.prefix_1;
  };
  protoOf(Attribute).get_localName_bf4zrn_k$ = function () {
    return this.localName_1;
  };
  protoOf(Attribute).get_namespaceUri_g6nlpi_k$ = function () {
    return this.namespaceUri_1;
  };
  protoOf(Attribute).get_eventType_918hfv_k$ = function () {
    return EventType_ATTRIBUTE_getInstance();
  };
  protoOf(Attribute).get_name_woqyms_k$ = function () {
    return new QName(this.namespaceUri_1, this.localName_1, this.prefix_1);
  };
  protoOf(Attribute).writeTo_3vocdz_k$ = function (writer) {
    if (this.hasNamespaceUri_1mpzjp_k$()) {
      var tmp;
      // Inline function 'kotlin.text.isEmpty' call
      var this_0 = this.prefix_1;
      if (charSequenceLength(this_0) === 0) {
        tmp = '';
      } else {
        tmp = this.localName_1;
      }
      var nsPrefix = tmp;
      writer.namespaceAttr_vkifxg_k$(nsPrefix, this.namespaceUri_1);
    } else {
      writer.attribute_ruzjv8_k$(this.namespaceUri_1, this.localName_1, this.prefix_1, this.value_1);
    }
  };
  protoOf(Attribute).hasNamespaceUri_1mpzjp_k$ = function () {
    var tmp;
    if (XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$() === this.namespaceUri_1) {
      tmp = true;
    } else {
      var tmp_0;
      // Inline function 'kotlin.text.isEmpty' call
      var this_0 = this.prefix_1;
      if (charSequenceLength(this_0) === 0) {
        tmp_0 = XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$() === this.localName_1;
      } else {
        tmp_0 = false;
      }
      tmp = tmp_0;
    }
    return tmp;
  };
  protoOf(Attribute).toString = function () {
    return isBlank(this.namespaceUri_1) ? this.localName_1 + '="' + this.value_1 + '"' : isBlank(this.prefix_1) ? '{' + this.namespaceUri_1 + '}' + this.localName_1 + '="' + this.value_1 + '"' : '{' + this.namespaceUri_1 + '}' + this.prefix_1 + ':' + this.localName_1 + '="' + this.value_1 + '"';
  };
  protoOf(Attribute).equals = function (other) {
    if (this === other)
      return true;
    if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
      return false;
    if (!(other instanceof Attribute))
      THROW_CCE();
    if (!(this.value_1 === other.value_1))
      return false;
    if (!(this.prefix_1 === other.prefix_1))
      return false;
    if (!(this.localName_1 === other.localName_1))
      return false;
    if (!(this.namespaceUri_1 === other.namespaceUri_1))
      return false;
    return true;
  };
  protoOf(Attribute).hashCode = function () {
    var result = getStringHashCode(this.value_1);
    result = imul(31, result) + getStringHashCode(this.prefix_1) | 0;
    result = imul(31, result) + getStringHashCode(this.localName_1) | 0;
    result = imul(31, result) + getStringHashCode(this.namespaceUri_1) | 0;
    return result;
  };
  function NamespaceImpl(namespacePrefix, namespaceUri) {
    this.prefix_1 = toString(namespacePrefix);
    this.namespaceURI_1 = toString(namespaceUri);
  }
  protoOf(NamespaceImpl).get_prefix_i78za3_k$ = function () {
    return this.prefix_1;
  };
  protoOf(NamespaceImpl).get_namespaceURI_g6nmhy_k$ = function () {
    return this.namespaceURI_1;
  };
  protoOf(NamespaceImpl).equals = function (other) {
    if (this === other)
      return true;
    if (!(!(other == null) ? isInterface(other, Namespace) : false))
      return false;
    if (!(this.prefix_1 === other.get_prefix_i78za3_k$()))
      return false;
    if (!(this.namespaceURI_1 === other.get_namespaceURI_g6nmhy_k$()))
      return false;
    return true;
  };
  protoOf(NamespaceImpl).hashCode = function () {
    return imul(31, getStringHashCode(this.prefix_1)) + getStringHashCode(this.namespaceURI_1) | 0;
  };
  protoOf(NamespaceImpl).toString = function () {
    return '{' + this.prefix_1 + ':' + this.namespaceURI_1 + '}';
  };
  function XmlEvent(locationInfo) {
    Companion_getInstance_3();
    this.locationInfo_1 = locationInfo;
  }
  protoOf(XmlEvent).get_locationInfo_3kny30_k$ = function () {
    return this.locationInfo_1;
  };
  protoOf(XmlEvent).get_isIgnorable_uazyqu_k$ = function () {
    return this.get_eventType_918hfv_k$().get_isIgnorable_uazyqu_k$();
  };
  function XmlException_init_$Init$($this) {
    IOException_init_$Init$($this);
    XmlException.call($this);
    return $this;
  }
  function XmlException_init_$Create$() {
    var tmp = XmlException_init_$Init$(objectCreate(protoOf(XmlException)));
    captureStack(tmp, XmlException_init_$Create$);
    return tmp;
  }
  function XmlException_init_$Init$_0(message, $this) {
    IOException_init_$Init$_0(message, $this);
    XmlException.call($this);
    return $this;
  }
  function XmlException_init_$Create$_0(message) {
    var tmp = XmlException_init_$Init$_0(message, objectCreate(protoOf(XmlException)));
    captureStack(tmp, XmlException_init_$Create$_0);
    return tmp;
  }
  function XmlException_init_$Init$_1(message, cause, $this) {
    IOException_init_$Init$_1(message, cause, $this);
    XmlException.call($this);
    return $this;
  }
  function XmlException_init_$Create$_1(message, cause) {
    var tmp = XmlException_init_$Init$_1(message, cause, objectCreate(protoOf(XmlException)));
    captureStack(tmp, XmlException_init_$Create$_1);
    return tmp;
  }
  function XmlException_init_$Init$_2(cause, $this) {
    IOException_init_$Init$_2(cause, $this);
    XmlException.call($this);
    return $this;
  }
  function XmlException_init_$Create$_2(cause) {
    var tmp = XmlException_init_$Init$_2(cause, objectCreate(protoOf(XmlException)));
    captureStack(tmp, XmlException_init_$Create$_2);
    return tmp;
  }
  function XmlException_init_$Init$_3(message, reader, cause, $this) {
    var tmp0_elvis_lhs = reader.get_locationInfo_3kny30_k$();
    IOException_init_$Init$_1((tmp0_elvis_lhs == null ? 'Unknown position' : tmp0_elvis_lhs) + ' - ' + message, cause, $this);
    XmlException.call($this);
    return $this;
  }
  function XmlException_init_$Create$_3(message, reader, cause) {
    var tmp = XmlException_init_$Init$_3(message, reader, cause, objectCreate(protoOf(XmlException)));
    captureStack(tmp, XmlException_init_$Create$_3);
    return tmp;
  }
  function XmlException_init_$Init$_4(message, reader, $this) {
    var tmp0_elvis_lhs = reader.get_locationInfo_3kny30_k$();
    IOException_init_$Init$_0((tmp0_elvis_lhs == null ? 'Unknown position' : tmp0_elvis_lhs) + ' - ' + message, $this);
    XmlException.call($this);
    return $this;
  }
  function XmlException_init_$Create$_4(message, reader) {
    var tmp = XmlException_init_$Init$_4(message, reader, objectCreate(protoOf(XmlException)));
    captureStack(tmp, XmlException_init_$Create$_4);
    return tmp;
  }
  protoOf(XmlException).doThrow_u0eucb_k$ = function () {
    throw this;
  };
  function XmlException() {
    captureStack(this, XmlException);
  }
  function XmlReader() {
  }
  function skipPreamble(_this__u8e3s4) {
    while ((!_this__u8e3s4.get_isStarted_wg74c2_k$() ? true : isIgnorable(_this__u8e3s4)) ? _this__u8e3s4.hasNext_bitz1p_k$() : false) {
      _this__u8e3s4.next_20eer_k$();
    }
  }
  function readSimpleElement(_this__u8e3s4) {
    var t = _this__u8e3s4;
    t.require_glcost_k$(EventType_START_ELEMENT_getInstance(), null, null);
    // Inline function 'kotlin.text.buildString' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.readSimpleElement.<anonymous>' call
    while (!(t.next_20eer_k$() === EventType_END_ELEMENT_getInstance())) {
      switch (t.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$()) {
        case 3:
        case 11:
          break;
        case 9:
        case 4:
        case 8:
        case 5:
          this_0.append_22ad7x_k$(t.get_text_wouvsm_k$());
          break;
        default:
          throw XmlException_init_$Create$_0('Expected text content or end tag, found: ' + t.get_eventType_918hfv_k$());
      }
    }
    return this_0.toString();
  }
  function allConsecutiveTextContent(_this__u8e3s4) {
    var t = _this__u8e3s4;
    // Inline function 'kotlin.text.buildString' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.allConsecutiveTextContent.<anonymous>' call
    if (_this__u8e3s4.get_eventType_918hfv_k$().get_isTextElement_53s5zw_k$() ? true : _this__u8e3s4.get_eventType_918hfv_k$().equals(EventType_IGNORABLE_WHITESPACE_getInstance())) {
      this_0.append_22ad7x_k$(_this__u8e3s4.get_text_wouvsm_k$());
    }
    var event = null;
    loop: while (true) {
      // Inline function 'kotlin.apply' call
      var this_1 = t.peek_21nx7_k$();
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.allConsecutiveTextContent.<anonymous>.<anonymous>' call
      event = this_1;
      if (!!((this_1 == null ? null : this_1.get_eventType_918hfv_k$()) === EventType_END_ELEMENT_getInstance())) {
        break loop;
      }
      var tmp1_safe_receiver = event;
      var tmp2_subject = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get_eventType_918hfv_k$();
      switch (tmp2_subject == null ? -1 : tmp2_subject.get_ordinal_ip24qg_k$()) {
        case 11:
        case 3:
          t.next_20eer_k$();
          break;
        case 9:
        case 4:
        case 8:
        case 5:
          t.next_20eer_k$();
          this_0.append_22ad7x_k$(t.get_text_wouvsm_k$());
          break;
        case 1:
          break loop;
        default:
          throw XmlException_init_$Create$_0('Found unexpected child tag: ' + event);
      }
    }
    return this_0.toString();
  }
  function allText(_this__u8e3s4) {
    var t = _this__u8e3s4;
    // Inline function 'kotlin.text.buildString' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.allText.<anonymous>' call
    if (_this__u8e3s4.get_eventType_918hfv_k$().get_isTextElement_53s5zw_k$()) {
      this_0.append_22ad7x_k$(_this__u8e3s4.get_text_wouvsm_k$());
    }
    var type;
    $l$loop: while (true) {
      // Inline function 'kotlin.apply' call
      var this_1 = t.next_20eer_k$();
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.allText.<anonymous>.<anonymous>' call
      type = this_1;
      if (!!(this_1 === EventType_END_ELEMENT_getInstance())) {
        break $l$loop;
      }
      switch (type == null ? -1 : type.get_ordinal_ip24qg_k$()) {
        case 11:
        case 3:
          break;
        case 9:
          if (!(this_0.get_length_g42xv3_k$() === 0)) {
            this_0.append_22ad7x_k$(t.get_text_wouvsm_k$());
          }

          break;
        case 8:
        case 4:
        case 5:
          this_0.append_22ad7x_k$(t.get_text_wouvsm_k$());
          break;
        default:
          throw XmlException_init_$Create$_0('Found unexpected child tag with type: ' + type);
      }
    }
    return this_0.toString();
  }
  function isIgnorable(_this__u8e3s4) {
    switch (_this__u8e3s4.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$()) {
      case 3:
      case 0:
      case 7:
      case 11:
      case 6:
      case 9:
        return true;
      case 4:
        return isXmlWhitespace(_this__u8e3s4.get_text_wouvsm_k$());
      default:
        return false;
    }
  }
  function get_attributes(_this__u8e3s4) {
    var tmp = 0;
    var tmp_0 = _this__u8e3s4.get_attributeCount_hqf30_k$();
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_1 = fillArrayVal(Array(tmp_0), null);
    while (tmp < tmp_0) {
      var tmp_2 = tmp;
      tmp_1[tmp_2] = new Attribute(_this__u8e3s4.get_locationInfo_3kny30_k$(), _this__u8e3s4.getAttributeNamespace_wj9j6l_k$(tmp_2), _this__u8e3s4.getAttributeLocalName_i25hjc_k$(tmp_2), _this__u8e3s4.getAttributePrefix_luun28_k$(tmp_2), _this__u8e3s4.getAttributeValue_qah2od_k$(tmp_2));
      tmp = tmp + 1 | 0;
    }
    return tmp_1;
  }
  function writeCurrent(_this__u8e3s4, writer) {
    return _this__u8e3s4.get_eventType_918hfv_k$().writeEvent_g8yuzw_k$(writer, _this__u8e3s4);
  }
  function get_attributeIndices(_this__u8e3s4) {
    return until(0, _this__u8e3s4.get_attributeCount_hqf30_k$());
  }
  function isPrefixDeclaredInElement(_this__u8e3s4, prefix) {
    var tmp$ret$0;
    $l$block_0: {
      // Inline function 'kotlin.collections.any' call
      var this_0 = _this__u8e3s4.get_namespaceDecls_1u0o6v_k$();
      var tmp;
      if (isInterface(this_0, Collection)) {
        tmp = this_0.isEmpty_y1axqb_k$();
      } else {
        tmp = false;
      }
      if (tmp) {
        tmp$ret$0 = false;
        break $l$block_0;
      }
      var tmp0_iterator = this_0.iterator_jk1svi_k$();
      while (tmp0_iterator.hasNext_bitz1p_k$()) {
        var element = tmp0_iterator.next_20eer_k$();
        // Inline function 'nl.adaptivity.xmlutil.isPrefixDeclaredInElement.<anonymous>' call
        if (element.get_prefix_i78za3_k$() === prefix) {
          tmp$ret$0 = true;
          break $l$block_0;
        }
      }
      tmp$ret$0 = false;
    }
    return tmp$ret$0;
  }
  function elementContentToFragment(_this__u8e3s4) {
    var r = _this__u8e3s4;
    skipPreamble(r);
    if (r.hasNext_bitz1p_k$()) {
      r.require_glcost_k$(EventType_START_ELEMENT_getInstance(), null, null);
      r.next_20eer_k$();
      return siblingsToFragment(r);
    }
    return CompactFragment_init_$Create$_0('');
  }
  function elementToFragment(_this__u8e3s4) {
    var output = StringBuilder_init_$Create$();
    if (!_this__u8e3s4.get_isStarted_wg74c2_k$()) {
      if (_this__u8e3s4.hasNext_bitz1p_k$()) {
        _this__u8e3s4.next_20eer_k$();
      } else {
        return CompactFragment_init_$Create$_0('');
      }
    }
    var startLocation = _this__u8e3s4.get_locationInfo_3kny30_k$();
    try {
      // Inline function 'kotlin.collections.mutableMapOf' call
      var missingNamespaces = LinkedHashMap_init_$Create$();
      if (_this__u8e3s4.get_eventType_918hfv_k$().get_isTextElement_53s5zw_k$() ? true : _this__u8e3s4.get_eventType_918hfv_k$().equals(EventType_IGNORABLE_WHITESPACE_getInstance()))
        return CompactFragment_init_$Create$_0(_this__u8e3s4.get_text_wouvsm_k$());
      _this__u8e3s4.require_glcost_k$(EventType_START_ELEMENT_getInstance(), null, null);
      $l$block: {
        // Inline function 'nl.adaptivity.xmlutil.core.impl.multiplatform.use' call
        var this_0 = new KtXmlWriter(output, false, XmlDeclMode_None_getInstance());
        try {
          this_0.set_indentString_30d8vk_k$('');
          while (_this__u8e3s4.get_eventType_918hfv_k$().equals(EventType_IGNORABLE_WHITESPACE_getInstance())) {
            this_0.ignorableWhitespace_7szqkg_k$(_this__u8e3s4.get_text_wouvsm_k$());
            _this__u8e3s4.next_20eer_k$();
          }
          if (_this__u8e3s4.get_eventType_918hfv_k$().equals(EventType_END_ELEMENT_getInstance()) ? true : _this__u8e3s4.get_eventType_918hfv_k$().equals(EventType_END_DOCUMENT_getInstance())) {
            return CompactFragment_init_$Create$_0(output.toString());
          }
          _this__u8e3s4.require_glcost_k$(EventType_START_ELEMENT_getInstance(), null, null);
          var namespaceForPrefix = this_0.getNamespaceUri_buhtgt_k$(_this__u8e3s4.get_prefix_i78za3_k$());
          writeCurrent(_this__u8e3s4, this_0);
          if (!(namespaceForPrefix === _this__u8e3s4.get_namespaceURI_g6nmhy_k$())) {
            addUndeclaredNamespaces(this_0, _this__u8e3s4, missingNamespaces);
          }
          writeElementContent(this_0, missingNamespaces, _this__u8e3s4);
          break $l$block;
        }finally {
          this_0.close_yn9xrc_k$();
        }
      }
      if (missingNamespaces.get_wei43m_k$('') === '') {
        missingNamespaces.remove_gppy8k_k$('');
      }
      return CompactFragment_init_$Create$_3(SimpleNamespaceContext_init_$Create$_0(missingNamespaces), output.toString());
    } catch ($p) {
      if ($p instanceof XmlException) {
        var e = $p;
        throw XmlException_init_$Create$_1('Failure to parse children into string at ' + startLocation, e);
      } else {
        if ($p instanceof RuntimeException) {
          var e_0 = $p;
          throw XmlException_init_$Create$_1('Failure to parse children into string at ' + startLocation, e_0);
        } else {
          throw $p;
        }
      }
    }
  }
  function XmlSerializable() {
  }
  var XmlDeclMode_None_instance;
  var XmlDeclMode_Minimal_instance;
  var XmlDeclMode_Auto_instance;
  var XmlDeclMode_Charset_instance;
  function Companion_3() {
    Companion_instance_3 = this;
  }
  protoOf(Companion_3).from_imbmez_k$ = function (value) {
    return value === true ? XmlDeclMode_None_getInstance() : XmlDeclMode_Auto_getInstance();
  };
  var Companion_instance_3;
  function Companion_getInstance_4() {
    XmlDeclMode_initEntries();
    if (Companion_instance_3 == null)
      new Companion_3();
    return Companion_instance_3;
  }
  function values_0() {
    return [XmlDeclMode_None_getInstance(), XmlDeclMode_Minimal_getInstance(), XmlDeclMode_Auto_getInstance(), XmlDeclMode_Charset_getInstance()];
  }
  function valueOf_0(value) {
    switch (value) {
      case 'None':
        return XmlDeclMode_None_getInstance();
      case 'Minimal':
        return XmlDeclMode_Minimal_getInstance();
      case 'Auto':
        return XmlDeclMode_Auto_getInstance();
      case 'Charset':
        return XmlDeclMode_Charset_getInstance();
      default:
        XmlDeclMode_initEntries();
        THROW_IAE('No enum constant value.');
        break;
    }
  }
  function get_entries_0() {
    if ($ENTRIES_0 == null)
      $ENTRIES_0 = enumEntries(values_0());
    return $ENTRIES_0;
  }
  var XmlDeclMode_entriesInitialized;
  function XmlDeclMode_initEntries() {
    if (XmlDeclMode_entriesInitialized)
      return Unit_getInstance();
    XmlDeclMode_entriesInitialized = true;
    XmlDeclMode_None_instance = new XmlDeclMode('None', 0);
    XmlDeclMode_Minimal_instance = new XmlDeclMode('Minimal', 1);
    XmlDeclMode_Auto_instance = new XmlDeclMode('Auto', 2);
    XmlDeclMode_Charset_instance = new XmlDeclMode('Charset', 3);
    Companion_getInstance_4();
  }
  var $ENTRIES_0;
  function XmlDeclMode(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  function XmlDeclMode_None_getInstance() {
    XmlDeclMode_initEntries();
    return XmlDeclMode_None_instance;
  }
  function XmlDeclMode_Minimal_getInstance() {
    XmlDeclMode_initEntries();
    return XmlDeclMode_Minimal_instance;
  }
  function XmlDeclMode_Auto_getInstance() {
    XmlDeclMode_initEntries();
    return XmlDeclMode_Auto_instance;
  }
  function XmlDeclMode_Charset_getInstance() {
    XmlDeclMode_initEntries();
    return XmlDeclMode_Charset_instance;
  }
  function toCName(_this__u8e3s4) {
    if (XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$() === _this__u8e3s4.getPrefix_bu8bd4_k$())
      return _this__u8e3s4.getLocalPart_k3cdyw_k$();
    return _this__u8e3s4.getPrefix_bu8bd4_k$() + ':' + _this__u8e3s4.getLocalPart_k3cdyw_k$();
  }
  function toQname(_this__u8e3s4, namespace) {
    var split = indexOf(_this__u8e3s4, _Char___init__impl__6a9atx(125));
    var localname;
    var nsUri;
    if (split >= 0) {
      if (!(charSequenceGet(_this__u8e3s4, 0) === _Char___init__impl__6a9atx(123)))
        throw IllegalArgumentException_init_$Create$('Not a valid qname literal');
      // Inline function 'kotlin.text.substring' call
      nsUri = toString(charSequenceSubSequence(_this__u8e3s4, 1, split));
      // Inline function 'kotlin.text.substring' call
      var startIndex = split + 1 | 0;
      var endIndex = charSequenceLength(_this__u8e3s4);
      localname = toString(charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex));
    } else {
      nsUri = namespace.get_namespaceURI_g6nmhy_k$();
      localname = toString(_this__u8e3s4);
    }
    return QName_init_$Create$(nsUri, localname);
  }
  function xmlCollapseWhitespace(original) {
    // Inline function 'kotlin.text.buildString' call
    var capacity = original.length;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$_0(capacity);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.xmlCollapseWhitespace.<anonymous>' call
    var last = _Char___init__impl__6a9atx(32);
    var inductionVariable = 0;
    var last_0 = original.length;
    while (inductionVariable < last_0) {
      var c = charSequenceGet(original, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      var tmp;
      if (((c === _Char___init__impl__6a9atx(9) ? true : c === _Char___init__impl__6a9atx(10)) ? true : c === _Char___init__impl__6a9atx(13)) ? true : c === _Char___init__impl__6a9atx(32)) {
        if (!(last === _Char___init__impl__6a9atx(32))) {
          this_0.append_am5a4z_k$(_Char___init__impl__6a9atx(32));
        }
        tmp = _Char___init__impl__6a9atx(32);
      } else {
        this_0.append_am5a4z_k$(c);
        tmp = c;
      }
      last = tmp;
    }
    if (last === _Char___init__impl__6a9atx(32)) {
      this_0.deleteAt_mq1vvq_k$(this_0.get_length_g42xv3_k$() - 1 | 0);
    }
    return this_0.toString();
  }
  function isXmlWhitespace(data) {
    var tmp$ret$1;
    $l$block: {
      // Inline function 'kotlin.text.all' call
      var inductionVariable = 0;
      while (inductionVariable < charSequenceLength(data)) {
        var element = charSequenceGet(data, inductionVariable);
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'nl.adaptivity.xmlutil.isXmlWhitespace.<anonymous>' call
        if (!isXmlWhitespace_0(element)) {
          tmp$ret$1 = false;
          break $l$block;
        }
      }
      tmp$ret$1 = true;
    }
    return tmp$ret$1;
  }
  function qname(namespaceUri, localname, prefix) {
    prefix = prefix === VOID ? XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$() : prefix;
    var tmp = namespaceUri == null ? XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$() : namespaceUri;
    return new QName(tmp, localname, prefix == null ? XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$() : prefix);
  }
  function isXmlWhitespace_0(char) {
    return ((char === _Char___init__impl__6a9atx(10) ? true : char === _Char___init__impl__6a9atx(9)) ? true : char === _Char___init__impl__6a9atx(13)) ? true : char === _Char___init__impl__6a9atx(32);
  }
  function xmlEncode(_this__u8e3s4) {
    // Inline function 'kotlin.text.buildString' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.xmlEncode.<anonymous>' call
    var inductionVariable = 0;
    while (inductionVariable < charSequenceLength(_this__u8e3s4)) {
      var c = charSequenceGet(_this__u8e3s4, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      if (c === _Char___init__impl__6a9atx(60)) {
        this_0.append_22ad7x_k$('&lt;');
      } else if (c === _Char___init__impl__6a9atx(62)) {
        this_0.append_22ad7x_k$('&gt;');
      } else if (c === _Char___init__impl__6a9atx(38)) {
        this_0.append_22ad7x_k$('&amp;');
      } else {
        this_0.append_am5a4z_k$(c);
      }
    }
    return this_0.toString();
  }
  function XmlWriter() {
  }
  function smartStartTag(_this__u8e3s4, qName, body) {
    // Inline function 'nl.adaptivity.xmlutil.smartStartTag' call
    var nsUri = qName.getNamespaceURI_665tvr_k$();
    var localName = qName.getLocalPart_k3cdyw_k$();
    var prefix = qName.getPrefix_bu8bd4_k$();
    smartStartTag_2(_this__u8e3s4, nsUri, localName, prefix);
    body(_this__u8e3s4);
    _this__u8e3s4.endTag_yzukbv_k$(nsUri, localName, prefix);
  }
  function smartStartTag_0(_this__u8e3s4, qName) {
    smartStartTag_2(_this__u8e3s4, qName.getNamespaceURI_665tvr_k$(), qName.getLocalPart_k3cdyw_k$(), qName.getPrefix_bu8bd4_k$());
  }
  function endTag(_this__u8e3s4, predelemname) {
    _this__u8e3s4.endTag_yzukbv_k$(predelemname.getNamespaceURI_665tvr_k$(), predelemname.getLocalPart_k3cdyw_k$(), predelemname.getPrefix_bu8bd4_k$());
  }
  function writeAttribute(_this__u8e3s4, name, value) {
    if (value == null)
      null;
    else {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp;
      var tmp_0;
      // Inline function 'kotlin.text.isEmpty' call
      // Inline function 'nl.adaptivity.xmlutil.namespaceURI' call
      var this_0 = name.getNamespaceURI_665tvr_k$();
      if (charSequenceLength(this_0) === 0) {
        // Inline function 'kotlin.text.isEmpty' call
        // Inline function 'nl.adaptivity.xmlutil.prefix' call
        var this_1 = name.getPrefix_bu8bd4_k$();
        tmp_0 = charSequenceLength(this_1) === 0;
      } else {
        tmp_0 = false;
      }
      if (tmp_0) {
        // Inline function 'nl.adaptivity.xmlutil.localPart' call
        var tmp$ret$4 = name.getLocalPart_k3cdyw_k$();
        _this__u8e3s4.attribute_ruzjv8_k$(null, tmp$ret$4, null, value);
        tmp = Unit_getInstance();
      } else {
        // Inline function 'nl.adaptivity.xmlutil.namespaceURI' call
        var tmp_1 = name.getNamespaceURI_665tvr_k$();
        // Inline function 'nl.adaptivity.xmlutil.localPart' call
        var tmp_2 = name.getLocalPart_k3cdyw_k$();
        // Inline function 'nl.adaptivity.xmlutil.prefix' call
        var tmp$ret$7 = name.getPrefix_bu8bd4_k$();
        _this__u8e3s4.attribute_ruzjv8_k$(tmp_1, tmp_2, tmp$ret$7, value);
        tmp = Unit_getInstance();
      }
    }
  }
  function writeElement(_this__u8e3s4, missingNamespaces, reader) {
    if (reader.get_eventType_918hfv_k$().equals(EventType_END_ELEMENT_getInstance()))
      throw IllegalArgumentException_init_$Create$('Cannot really validly write an end element here');
    writeCurrent(reader, _this__u8e3s4);
    if (reader.get_eventType_918hfv_k$().equals(EventType_START_ELEMENT_getInstance())) {
      writeElementContent(_this__u8e3s4, missingNamespaces, reader);
    }
  }
  function smartStartTag_1(_this__u8e3s4, nsUri, localName, prefix, body) {
    prefix = prefix === VOID ? null : prefix;
    smartStartTag_2(_this__u8e3s4, nsUri, localName, prefix);
    body(_this__u8e3s4);
    _this__u8e3s4.endTag_yzukbv_k$(nsUri, localName, prefix);
  }
  function serialize(_this__u8e3s4, reader) {
    while (reader.hasNext_bitz1p_k$()) {
      switch (reader.next_20eer_k$().get_ordinal_ip24qg_k$()) {
        case 0:
        case 11:
        case 6:
        case 7:
          if (_this__u8e3s4.get_depth_iq7qmy_k$() <= 0) {
            writeCurrentEvent(_this__u8e3s4, reader);
          }

          break;
        case 9:
          // Inline function 'kotlin.text.isEmpty' call

          var this_0 = _this__u8e3s4.get_indentString_li4jl2_k$();
          if (charSequenceLength(this_0) === 0) {
            writeCurrentEvent(_this__u8e3s4, reader);
          }

          break;
        default:
          writeCurrentEvent(_this__u8e3s4, reader);
          break;
      }
    }
  }
  function addUndeclaredNamespaces(_this__u8e3s4, reader, missingNamespaces) {
    undeclaredPrefixes(_this__u8e3s4, reader, missingNamespaces);
  }
  function writeElementContent(_this__u8e3s4, missingNamespaces, reader) {
    // Inline function 'kotlin.collections.forEach' call
    // Inline function 'kotlin.collections.iterator' call
    var tmp0_iterator = reader;
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var element = tmp0_iterator.next_20eer_k$();
      // Inline function 'nl.adaptivity.xmlutil.writeElementContent.<anonymous>' call
      if (reader.get_eventType_918hfv_k$().equals(EventType_START_ELEMENT_getInstance()) ? !(missingNamespaces == null) : false) {
        addUndeclaredNamespaces(_this__u8e3s4, reader, missingNamespaces);
      }
      writeCurrent(reader, _this__u8e3s4);
      switch (element.get_ordinal_ip24qg_k$()) {
        case 1:
          writeElementContent(_this__u8e3s4, missingNamespaces, reader);
          break;
        case 2:
          return Unit_getInstance();
        default:
          break;
      }
    }
  }
  function smartStartTag_2(_this__u8e3s4, nsUri, localName, prefix) {
    prefix = prefix === VOID ? null : prefix;
    if ((nsUri == null ? true : nsUri === XMLConstants_getInstance().get_XML_NS_URI_kvobz7_k$()) ? true : nsUri === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$()) {
      var tmp = _this__u8e3s4.get_namespaceContext_n7n1ib_k$();
      var tmp1_elvis_lhs = tmp.getNamespaceURI_859c43_k$(prefix == null ? XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$() : prefix);
      var namespace = tmp1_elvis_lhs == null ? XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$() : tmp1_elvis_lhs;
      _this__u8e3s4.startTag_pjuzbi_k$(namespace, localName, prefix);
    } else {
      var writeNs = false;
      var tmp2_elvis_lhs = _this__u8e3s4.getPrefix_r4en0f_k$(nsUri);
      var tmp_0;
      if (tmp2_elvis_lhs == null) {
        // Inline function 'kotlin.run' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'nl.adaptivity.xmlutil.smartStartTag.<anonymous>' call
        var tmp_1;
        if (prefix == null) {
          tmp_1 = null;
        } else {
          // Inline function 'kotlin.let' call
          // Inline function 'kotlin.contracts.contract' call
          // Inline function 'nl.adaptivity.xmlutil.smartStartTag.<anonymous>.<anonymous>' call
          tmp_1 = _this__u8e3s4.getNamespaceUri_buhtgt_k$(prefix);
        }
        var tmp1_elvis_lhs_0 = tmp_1;
        var currentNs = tmp1_elvis_lhs_0 == null ? XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$() : tmp1_elvis_lhs_0;
        if (!(nsUri === currentNs)) {
          writeNs = true;
        }
        tmp_0 = prefix == null ? XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$() : prefix;
      } else {
        tmp_0 = tmp2_elvis_lhs;
      }
      var usedPrefix = tmp_0;
      _this__u8e3s4.startTag_pjuzbi_k$(nsUri, localName, usedPrefix);
      if (writeNs) {
        _this__u8e3s4.namespaceAttr_vkifxg_k$(usedPrefix, nsUri);
      }
    }
  }
  function writeCurrentEvent(_this__u8e3s4, reader) {
    switch (reader.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$()) {
      case 0:
        _this__u8e3s4.startDocument_dbnt67_k$(null, reader.get_encoding_3i4b8k_k$(), reader.get_standalone_tm0l3i_k$());
        break;
      case 1:
        _this__u8e3s4.startTag_pjuzbi_k$(reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$());
        // Inline function 'kotlin.run' call

        // Inline function 'kotlin.contracts.contract' call

        var tmp0_iterator = reader.get_namespaceDecls_1u0o6v_k$().iterator_jk1svi_k$();
        while (tmp0_iterator.hasNext_bitz1p_k$()) {
          var a = tmp0_iterator.next_20eer_k$();
          _this__u8e3s4.namespaceAttr_vkifxg_k$(a.get_prefix_i78za3_k$(), a.get_namespaceURI_g6nmhy_k$());
        }

        // Inline function 'kotlin.run' call

        // Inline function 'kotlin.contracts.contract' call

        var progression = get_attributeIndices(reader);
        var inductionVariable = progression.get_first_irdx8n_k$();
        var last = progression.get_last_wopotb_k$();
        var tmp;
        if (inductionVariable <= last) {
          do {
            var i = inductionVariable;
            inductionVariable = inductionVariable + 1 | 0;
            var attrPrefix = reader.getAttributePrefix_luun28_k$(i);
            var namespace = attrPrefix === '' ? '' : reader.getAttributeNamespace_wj9j6l_k$(i);
            var tmp_0;
            if (namespace === '') {
              tmp_0 = '';
            } else if (namespace === _this__u8e3s4.get_namespaceContext_n7n1ib_k$().getNamespaceURI_859c43_k$(attrPrefix)) {
              tmp_0 = attrPrefix;
            } else {
              var tmp2_elvis_lhs = _this__u8e3s4.get_namespaceContext_n7n1ib_k$().getPrefix_7o0aoe_k$(namespace);
              tmp_0 = tmp2_elvis_lhs == null ? attrPrefix : tmp2_elvis_lhs;
            }
            var prefix = tmp_0;
            _this__u8e3s4.attribute_ruzjv8_k$(namespace, reader.getAttributeLocalName_i25hjc_k$(i), prefix, reader.getAttributeValue_qah2od_k$(i));
          }
           while (!(i === last));
          tmp = Unit_getInstance();
        }

        break;
      case 2:
        _this__u8e3s4.endTag_yzukbv_k$(reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$());
        break;
      case 3:
        _this__u8e3s4.comment_dbctn9_k$(reader.get_text_wouvsm_k$());
        break;
      case 4:
        _this__u8e3s4.text_x72pul_k$(reader.get_text_wouvsm_k$());
        break;
      case 10:
        _this__u8e3s4.attribute_ruzjv8_k$(reader.get_namespaceURI_g6nmhy_k$(), reader.get_localName_bf4zrn_k$(), reader.get_prefix_i78za3_k$(), reader.get_text_wouvsm_k$());
        break;
      case 5:
        _this__u8e3s4.cdsect_yhnzeu_k$(reader.get_text_wouvsm_k$());
        break;
      case 6:
        _this__u8e3s4.docdecl_aom8aw_k$(reader.get_text_wouvsm_k$());
        break;
      case 7:
        _this__u8e3s4.endDocument_lstnba_k$();
        break;
      case 8:
        _this__u8e3s4.entityRef_cqd3i2_k$(reader.get_text_wouvsm_k$());
        break;
      case 9:
        _this__u8e3s4.ignorableWhitespace_7szqkg_k$(reader.get_text_wouvsm_k$());
        break;
      case 11:
        _this__u8e3s4.processingInstruction_tweoff_k$(reader.get_piTarget_jrarar_k$(), reader.get_piData_i1pnws_k$());
        break;
    }
  }
  function undeclaredPrefixes(_this__u8e3s4, reader, missingNamespaces) {
    assert_0(reader.get_eventType_918hfv_k$() === EventType_START_ELEMENT_getInstance());
    var prefix = reader.get_prefix_i78za3_k$();
    if (!missingNamespaces.containsKey_aw81wo_k$(prefix)) {
      var uri = reader.get_namespaceURI_g6nmhy_k$();
      if (_this__u8e3s4.getNamespaceUri_buhtgt_k$(prefix) === uri ? isPrefixDeclaredInElement(reader, prefix) : false) {
        return Unit_getInstance();
      } else {
        // Inline function 'kotlin.collections.set' call
        missingNamespaces.put_4fpzoq_k$(prefix, uri);
      }
    }
  }
  function ExperimentalXmlUtilApi() {
  }
  protoOf(ExperimentalXmlUtilApi).equals = function (other) {
    if (!(other instanceof ExperimentalXmlUtilApi))
      return false;
    other instanceof ExperimentalXmlUtilApi || THROW_CCE();
    return true;
  };
  protoOf(ExperimentalXmlUtilApi).hashCode = function () {
    return 0;
  };
  protoOf(ExperimentalXmlUtilApi).toString = function () {
    return '@nl.adaptivity.xmlutil.ExperimentalXmlUtilApi()';
  };
  function XmlUtilInternal() {
  }
  protoOf(XmlUtilInternal).equals = function (other) {
    if (!(other instanceof XmlUtilInternal))
      return false;
    other instanceof XmlUtilInternal || THROW_CCE();
    return true;
  };
  protoOf(XmlUtilInternal).hashCode = function () {
    return 0;
  };
  protoOf(XmlUtilInternal).toString = function () {
    return '@nl.adaptivity.xmlutil.XmlUtilInternal()';
  };
  function _set_data__9licbx($this, _set____db54di) {
    $this.data_1 = _set____db54di;
  }
  function _ElementDelegate___init__impl__t07x0o(index) {
    return index;
  }
  function _ElementDelegate___get_index__impl__2ny1jf($this) {
    return $this;
  }
  function ElementDelegate__toString_impl_schjmo($this) {
    return 'ElementDelegate(index=' + $this + ')';
  }
  function ElementDelegate__hashCode_impl_kxgljl($this) {
    return $this;
  }
  function ElementDelegate__equals_impl_mnl19p($this, other) {
    if (!(other instanceof ElementDelegate))
      return false;
    if (!($this === (other instanceof ElementDelegate ? other.index_1 : THROW_CCE())))
      return false;
    return true;
  }
  function _set_data__9licbx_0($this, _set____db54di) {
    $this.data_1 = _set____db54di;
  }
  function _set_size__9twho6($this, _set____db54di) {
    $this.size_1 = _set____db54di;
  }
  function _AttributeDelegate___init__impl__ovambc(index) {
    return index;
  }
  function _AttributeDelegate___get_index__impl__2x9emt($this) {
    return $this;
  }
  function AttributeDelegate__toString_impl_z41b5s($this) {
    return 'AttributeDelegate(index=' + $this + ')';
  }
  function AttributeDelegate__hashCode_impl_dcvecx($this) {
    return $this;
  }
  function AttributeDelegate__equals_impl_js1r03($this, other) {
    if (!(other instanceof AttributeDelegate))
      return false;
    if (!($this === (other instanceof AttributeDelegate ? other.index_1 : THROW_CCE())))
      return false;
    return true;
  }
  function _get_reader__fd8dw8($this) {
    return $this.reader_1;
  }
  function KtXmlReader_init_$Init$(reader, relaxed, $this) {
    relaxed = relaxed === VOID ? false : relaxed;
    KtXmlReader.call($this, reader, null, relaxed);
    return $this;
  }
  function KtXmlReader_init_$Create$(reader, relaxed) {
    return KtXmlReader_init_$Init$(reader, relaxed, objectCreate(protoOf(KtXmlReader)));
  }
  function _set_line__9q1omb($this, _set____db54di) {
    $this.line_1 = _set____db54di;
  }
  function _get_line__d9to7r($this) {
    return $this.line_1;
  }
  function _set_column__izs2v3($this, _set____db54di) {
    $this.column_1 = _set____db54di;
  }
  function _get_column__hj1i8b($this) {
    return $this.column_1;
  }
  function _set__eventType__hz8s02($this, _set____db54di) {
    $this._eventType_1 = _set____db54di;
  }
  function _get__eventType__2x06uu($this) {
    return $this._eventType_1;
  }
  function _set_entityName__4sl7bd($this, _set____db54di) {
    $this.entityName_1 = _set____db54di;
  }
  function _get_entityName__a9ndtv($this) {
    return $this.entityName_1;
  }
  function _set_isSelfClosing__gwtica($this, _set____db54di) {
    $this.isSelfClosing_1 = _set____db54di;
  }
  function _get_isSelfClosing__w4l0um($this) {
    return $this.isSelfClosing_1;
  }
  function _set_attributes__l9bcv4($this, _set____db54di) {
    $this.attributes_1 = _set____db54di;
  }
  function _get_attributes__ypk3ys($this) {
    return $this.attributes_1;
  }
  function _set_encoding__8rz9cs($this, _set____db54di) {
    $this.encoding_1 = _set____db54di;
  }
  function _get_srcBuf__5h96nw($this) {
    return $this.srcBuf_1;
  }
  function _set_srcBufPos__o7de2o($this, _set____db54di) {
    $this.srcBufPos_1 = _set____db54di;
  }
  function _get_srcBufPos__53h2bw($this) {
    return $this.srcBufPos_1;
  }
  function _set_srcBufCount__v6yjz9($this, _set____db54di) {
    $this.srcBufCount_1 = _set____db54di;
  }
  function _get_srcBufCount__9jrbnz($this) {
    return $this.srcBufCount_1;
  }
  function _get_peek__dby440($this) {
    return $this.peek_1;
  }
  function _set_peekCount__fmd9ld($this, _set____db54di) {
    $this.peekCount_1 = _set____db54di;
  }
  function _get_peekCount__q3wbz7($this) {
    return $this.peekCount_1;
  }
  function _set_entityMap__4ffb84($this, _set____db54di) {
    $this.entityMap_1 = _set____db54di;
  }
  function _get_entityMap__ovf56g($this) {
    return $this.entityMap_1;
  }
  function _get_namespaceHolder__6tzxme_1($this) {
    return $this.namespaceHolder_1;
  }
  function _set_elementStack__z9vt3p($this, _set____db54di) {
    $this.elementStack_1 = _set____db54di;
  }
  function _get_elementStack__jq52jl($this) {
    return $this.elementStack_1;
  }
  function _set_txtBuf__lsj4pg($this, _set____db54di) {
    $this.txtBuf_1 = _set____db54di;
  }
  function _get_txtBuf__n99pc8($this) {
    return $this.txtBuf_1;
  }
  function _set_txtBufPos__xvngs($this, _set____db54di) {
    $this.txtBufPos_1 = _set____db54di;
  }
  function _get_txtBufPos__scysxs($this) {
    return $this.txtBufPos_1;
  }
  function _set_isWhitespace__rrlzow($this, _set____db54di) {
    $this.isWhitespace_1 = _set____db54di;
  }
  function _get_isWhitespace__rprbq4($this) {
    return $this.isWhitespace_1;
  }
  function _set_error__e4pkjh($this, _set____db54di) {
    $this.error_1 = _set____db54di;
  }
  function _get_error__hwevxz($this) {
    return $this.error_1;
  }
  function _set_wasCR__me5z59($this, _set____db54di) {
    $this.wasCR_1 = _set____db54di;
  }
  function _get_wasCR__9myhc7($this) {
    return $this.wasCR_1;
  }
  function _set_unresolved__n3hw6e($this, _set____db54di) {
    $this.unresolved_1 = _set____db54di;
  }
  function _get_unresolved__819b16($this) {
    return $this.unresolved_1;
  }
  function _set_token__l6lu98($this, _set____db54di) {
    $this.token_1 = _set____db54di;
  }
  function _get_token__auim88($this) {
    return $this.token_1;
  }
  function adjustNsp($this, fullName) {
    var hasActualAttributeWithPrefix = false;
    var attrIdx = 0;
    $l$loop: while (attrIdx < $this.attributes_1.size_1) {
      var attr = $this.attributes_1.get_2wmxux_k$(attrIdx);
      var attrName = _get_localName__c3lhh_0(attr, $this);
      var cIndex = indexOf(ensureNotNull(attrName), _Char___init__impl__6a9atx(58));
      var prefix;
      if (cIndex >= 0) {
        // Inline function 'kotlin.text.substring' call
        // Inline function 'kotlin.js.asDynamic' call
        prefix = attrName.substring(0, cIndex);
        // Inline function 'kotlin.text.substring' call
        var this_0 = attrName;
        var startIndex = cIndex + 1 | 0;
        // Inline function 'kotlin.js.asDynamic' call
        attrName = this_0.substring(startIndex);
      } else if (attrName === 'xmlns') {
        prefix = attrName;
        attrName = null;
      } else {
        _set_namespace__mtbsui_0(attr, $this, XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$());
        _set_prefix__v265l1_0(attr, $this, XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$());
        attrIdx = attrIdx + 1 | 0;
        continue $l$loop;
      }
      if (!(prefix === 'xmlns')) {
        hasActualAttributeWithPrefix = true;
        attrIdx = attrIdx + 1 | 0;
      } else {
        $this.namespaceHolder_1.addPrefixToContext_gkzdgb_k$(attrName, _get_value__a43j40($this.attributes_1.get_2wmxux_k$(attrIdx), $this));
        if (!(attrName == null) ? _get_value__a43j40($this.attributes_1.get_2wmxux_k$(attrIdx), $this) === '' : false) {
          error($this, 'illegal empty namespace');
        }
        $this.attributes_1.removeAttr_xhxyio_k$(attr);
      }
    }
    if (hasActualAttributeWithPrefix) {
      var i = $this.attributes_1.size_1 - 1 | 0;
      while (i >= 0) {
        var attrName_0 = ensureNotNull(_get_localName__c3lhh_0($this.attributes_1.get_2wmxux_k$(i), $this));
        var cIndex_0 = indexOf(attrName_0, _Char___init__impl__6a9atx(58));
        if (cIndex_0 === 0 ? !$this.relaxed_1 : false) {
          throw RuntimeException_init_$Create$('illegal attribute name: ' + attrName_0 + ' at ' + $this);
        } else if (!(cIndex_0 === -1)) {
          // Inline function 'kotlin.text.substring' call
          // Inline function 'kotlin.js.asDynamic' call
          var attrPrefix = attrName_0.substring(0, cIndex_0);
          // Inline function 'kotlin.text.substring' call
          var this_1 = attrName_0;
          var startIndex_0 = cIndex_0 + 1 | 0;
          // Inline function 'kotlin.js.asDynamic' call
          attrName_0 = this_1.substring(startIndex_0);
          var attrNs = $this.namespaceHolder_1.getNamespaceUri_83evzq_k$(attrPrefix);
          if (attrNs == null ? !$this.relaxed_1 : false)
            throw RuntimeException_init_$Create$('Undefined Prefix: ' + attrPrefix + ' in ' + $this);
          _set_namespace__mtbsui_0($this.attributes_1.get_2wmxux_k$(i), $this, attrNs);
          _set_prefix__v265l1_0($this.attributes_1.get_2wmxux_k$(i), $this, attrPrefix);
          _set_localName__tmy1w1_0($this.attributes_1.get_2wmxux_k$(i), $this, attrName_0);
        }
        i = i - 1 | 0;
      }
    }
    var cIdx = indexOf(fullName, _Char___init__impl__6a9atx(58));
    if (cIdx === 0) {
      error($this, 'illegal tag name: ' + fullName);
    }
    var prefix_0;
    var localName;
    if (!(cIdx === -1)) {
      // Inline function 'kotlin.text.substring' call
      // Inline function 'kotlin.js.asDynamic' call
      prefix_0 = fullName.substring(0, cIdx);
      // Inline function 'kotlin.text.substring' call
      var startIndex_1 = cIdx + 1 | 0;
      // Inline function 'kotlin.js.asDynamic' call
      localName = fullName.substring(startIndex_1);
    } else {
      prefix_0 = '';
      localName = fullName;
    }
    var tmp0_elvis_lhs = $this.namespaceHolder_1.getNamespaceUri_83evzq_k$(prefix_0);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      // Inline function 'kotlin.run' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.core.KtXmlReader.adjustNsp.<anonymous>' call
      if (cIdx >= 0) {
        error($this, 'undefined prefix: ' + prefix_0);
      }
      tmp = XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var ns = tmp;
    var d = $this.get_depth_iq7qmy_k$() - 1 | 0;
    _set_prefix__v265l1($this.elementStack_1.get_udoj0p_k$(d), $this, prefix_0);
    _set_localName__tmy1w1($this.elementStack_1.get_udoj0p_k$(d), $this, localName);
    _set_namespace__mtbsui($this.elementStack_1.get_udoj0p_k$(d), $this, ns);
    return hasActualAttributeWithPrefix;
  }
  function error($this, desc) {
    if ($this.relaxed_1) {
      if ($this.error_1 == null)
        $this.error_1 = 'ERR: ' + desc;
    } else {
      exception($this, desc);
    }
  }
  function exception($this, desc) {
    var tmp;
    if (desc.length < 100) {
      tmp = desc;
    } else {
      // Inline function 'kotlin.text.substring' call
      // Inline function 'kotlin.js.asDynamic' call
      tmp = desc.substring(0, 100) + '\n';
    }
    throw XmlException_init_$Create$_4(tmp, $this);
  }
  function nextImpl($this) {
    if (equals($this._eventType_1, EventType_END_ELEMENT_getInstance())) {
      $this.namespaceHolder_1.decDepth_8l9b73_k$();
    }
    while (true) {
      $this.attributes_1.clear$default_90upub_k$();
      if ($this.isSelfClosing_1) {
        $this.isSelfClosing_1 = false;
        $this._eventType_1 = EventType_END_ELEMENT_getInstance();
        return Unit_getInstance();
      }
      var tmp0_safe_receiver = $this.error_1;
      if (tmp0_safe_receiver == null)
        null;
      else {
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        var inductionVariable = 0;
        var last = tmp0_safe_receiver.length;
        while (inductionVariable < last) {
          var element = charSequenceGet(tmp0_safe_receiver, inductionVariable);
          inductionVariable = inductionVariable + 1 | 0;
          // Inline function 'kotlin.code' call
          var tmp$ret$0 = Char__toInt_impl_vasixd(element);
          push($this, tmp$ret$0);
        }
        $this.error_1 = null;
        $this._eventType_1 = EventType_COMMENT_getInstance();
        return Unit_getInstance();
      }
      $this._eventType_1 = peekType($this);
      var tmp1_subject = $this._eventType_1;
      switch (tmp1_subject == null ? -1 : tmp1_subject.get_ordinal_ip24qg_k$()) {
        case 0:
          return Unit_getInstance();
        case 8:
          pushEntity($this);
          return Unit_getInstance();
        case 1:
          parseStartTag($this, false);
          return Unit_getInstance();
        case 2:
          parseEndTag($this);
          return Unit_getInstance();
        case 7:
          return Unit_getInstance();
        case 4:
          // Inline function 'kotlin.code' call

          var this_0 = _Char___init__impl__6a9atx(60);
          var tmp$ret$2 = Char__toInt_impl_vasixd(this_0);
          pushText($this, tmp$ret$2, !$this.token_1);
          if ($this.isWhitespace_1)
            $this._eventType_1 = EventType_IGNORABLE_WHITESPACE_getInstance();
          return Unit_getInstance();
        default:
          $this._eventType_1 = parseLegacy($this, $this.token_1);
          if (!equals($this._eventType_1, EventType_START_DOCUMENT_getInstance()))
            return Unit_getInstance();
          break;
      }
    }
  }
  function parseLegacy($this, push_0) {
    var localPush = push_0;
    var expected;
    var term;
    var result;
    var prev = 0;
    read_0($this);
    var c = read_0($this);
    var tmp = c;
    // Inline function 'kotlin.code' call
    var this_0 = _Char___init__impl__6a9atx(63);
    if (tmp === Char__toInt_impl_vasixd(this_0)) {
      var tmp_0;
      var tmp_1;
      var tmp_2 = peek($this, 0);
      // Inline function 'kotlin.code' call
      var this_1 = _Char___init__impl__6a9atx(120);
      if (tmp_2 === Char__toInt_impl_vasixd(this_1)) {
        tmp_1 = true;
      } else {
        var tmp_3 = peek($this, 0);
        // Inline function 'kotlin.code' call
        var this_2 = _Char___init__impl__6a9atx(88);
        tmp_1 = tmp_3 === Char__toInt_impl_vasixd(this_2);
      }
      if (tmp_1) {
        var tmp_4;
        var tmp_5 = peek($this, 1);
        // Inline function 'kotlin.code' call
        var this_3 = _Char___init__impl__6a9atx(109);
        if (tmp_5 === Char__toInt_impl_vasixd(this_3)) {
          tmp_4 = true;
        } else {
          var tmp_6 = peek($this, 1);
          // Inline function 'kotlin.code' call
          var this_4 = _Char___init__impl__6a9atx(77);
          tmp_4 = tmp_6 === Char__toInt_impl_vasixd(this_4);
        }
        tmp_0 = tmp_4;
      } else {
        tmp_0 = false;
      }
      if (tmp_0) {
        if (localPush) {
          push($this, peek($this, 0));
          push($this, peek($this, 1));
        }
        read_0($this);
        read_0($this);
        var tmp_7;
        var tmp_8;
        var tmp_9 = peek($this, 0);
        // Inline function 'kotlin.code' call
        var this_5 = _Char___init__impl__6a9atx(108);
        if (tmp_9 === Char__toInt_impl_vasixd(this_5)) {
          tmp_8 = true;
        } else {
          var tmp_10 = peek($this, 0);
          // Inline function 'kotlin.code' call
          var this_6 = _Char___init__impl__6a9atx(76);
          tmp_8 = tmp_10 === Char__toInt_impl_vasixd(this_6);
        }
        if (tmp_8) {
          var tmp_11 = peek($this, 1);
          // Inline function 'kotlin.code' call
          var this_7 = _Char___init__impl__6a9atx(32);
          tmp_7 = tmp_11 <= Char__toInt_impl_vasixd(this_7);
        } else {
          tmp_7 = false;
        }
        if (tmp_7) {
          if (!($this.line_1 === 1) ? true : $this.column_1 > 4) {
            error($this, 'PI must not start with xml');
          }
          parseStartTag($this, true);
          if ($this.get_attributeCount_hqf30_k$() < 1 ? true : !('version' === _get_localName__c3lhh_0($this.attributes_1.get_2wmxux_k$(0), $this))) {
            error($this, 'version expected');
          }
          $this.version_1 = _get_value__a43j40($this.attributes_1.get_2wmxux_k$(0), $this);
          var pos = 1;
          if (pos < $this.get_attributeCount_hqf30_k$() ? 'encoding' === _get_localName__c3lhh_0($this.attributes_1.get_2wmxux_k$(1), $this) : false) {
            $this.encoding_1 = _get_value__a43j40($this.attributes_1.get_2wmxux_k$(1), $this);
            pos = pos + 1 | 0;
          }
          if (pos < $this.get_attributeCount_hqf30_k$() ? 'standalone' === _get_localName__c3lhh_0($this.attributes_1.get_2wmxux_k$(pos), $this) : false) {
            var st = _get_value__a43j40($this.attributes_1.get_2wmxux_k$(pos), $this);
            switch (st) {
              case 'yes':
                $this.standalone_1 = true;
                break;
              case 'no':
                $this.standalone_1 = false;
                break;
              default:
                error($this, 'illegal standalone value: ' + st);
                break;
            }
            pos = pos + 1 | 0;
          }
          if (!(pos === $this.get_attributeCount_hqf30_k$())) {
            error($this, 'illegal xmldecl');
          }
          $this.isWhitespace_1 = true;
          $this.txtBufPos_1 = 0;
          return EventType_START_DOCUMENT_getInstance();
        }
      }
      // Inline function 'kotlin.code' call
      var this_8 = _Char___init__impl__6a9atx(63);
      term = Char__toInt_impl_vasixd(this_8);
      result = EventType_PROCESSING_INSTRUCTION_getInstance();
      expected = '';
    } else {
      var tmp_12 = c;
      // Inline function 'kotlin.code' call
      var this_9 = _Char___init__impl__6a9atx(33);
      if (tmp_12 === Char__toInt_impl_vasixd(this_9)) {
        var tmp_13 = peek($this, 0);
        // Inline function 'kotlin.code' call
        var this_10 = _Char___init__impl__6a9atx(45);
        if (tmp_13 === Char__toInt_impl_vasixd(this_10)) {
          result = EventType_COMMENT_getInstance();
          expected = '--';
          // Inline function 'kotlin.code' call
          var this_11 = _Char___init__impl__6a9atx(45);
          term = Char__toInt_impl_vasixd(this_11);
        } else {
          var tmp_14 = peek($this, 0);
          // Inline function 'kotlin.code' call
          var this_12 = _Char___init__impl__6a9atx(91);
          if (tmp_14 === Char__toInt_impl_vasixd(this_12)) {
            result = EventType_CDSECT_getInstance();
            expected = '[CDATA[';
            // Inline function 'kotlin.code' call
            var this_13 = _Char___init__impl__6a9atx(93);
            term = Char__toInt_impl_vasixd(this_13);
            localPush = true;
          } else {
            result = EventType_DOCDECL_getInstance();
            expected = 'DOCTYPE';
            term = -1;
          }
        }
      } else {
        error($this, 'illegal: <' + c);
        return EventType_COMMENT_getInstance();
      }
    }
    var indexedObject = expected;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var ch = charSequenceGet(indexedObject, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      read($this, ch);
    }
    if (result.equals(EventType_DOCDECL_getInstance())) {
      parseDoctype($this, localPush);
    } else {
      $l$loop: while (true) {
        c = read_0($this);
        if (c === -1) {
          error($this, 'Unexpected EOF');
          return EventType_COMMENT_getInstance();
        }
        if (localPush) {
          push($this, c);
        }
        var tmp_15;
        var tmp_16;
        var tmp_17;
        // Inline function 'kotlin.code' call
        var this_14 = _Char___init__impl__6a9atx(63);
        if (term === Char__toInt_impl_vasixd(this_14)) {
          tmp_17 = true;
        } else {
          tmp_17 = c === term;
        }
        if (tmp_17) {
          tmp_16 = peek($this, 0) === term;
        } else {
          tmp_16 = false;
        }
        if (tmp_16) {
          var tmp_18 = peek($this, 1);
          // Inline function 'kotlin.code' call
          var this_15 = _Char___init__impl__6a9atx(62);
          tmp_15 = tmp_18 === Char__toInt_impl_vasixd(this_15);
        } else {
          tmp_15 = false;
        }
        if (tmp_15)
          break $l$loop;
        prev = c;
      }
      var tmp_19;
      var tmp_20;
      // Inline function 'kotlin.code' call
      var this_16 = _Char___init__impl__6a9atx(45);
      if (term === Char__toInt_impl_vasixd(this_16)) {
        var tmp_21 = prev;
        // Inline function 'kotlin.code' call
        var this_17 = _Char___init__impl__6a9atx(45);
        tmp_20 = tmp_21 === Char__toInt_impl_vasixd(this_17);
      } else {
        tmp_20 = false;
      }
      if (tmp_20) {
        tmp_19 = !$this.relaxed_1;
      } else {
        tmp_19 = false;
      }
      if (tmp_19) {
        error($this, 'illegal comment delimiter: --->');
      }
      read_0($this);
      read_0($this);
      var tmp_22;
      if (localPush) {
        // Inline function 'kotlin.code' call
        var this_18 = _Char___init__impl__6a9atx(63);
        tmp_22 = !(term === Char__toInt_impl_vasixd(this_18));
      } else {
        tmp_22 = false;
      }
      if (tmp_22) {
        $this.txtBufPos_1 = $this.txtBufPos_1 - 1 | 0;
      }
    }
    return result;
  }
  function parseDoctype($this, push_0) {
    var nesting = 1;
    var quoted = false;
    while (true) {
      var i = read_0($this);
      if (i === -1) {
        error($this, 'Unexpected EOF');
        return Unit_getInstance();
      } else {
        // Inline function 'kotlin.code' call
        var this_0 = _Char___init__impl__6a9atx(39);
        if (i === Char__toInt_impl_vasixd(this_0))
          quoted = !quoted;
        else {
          // Inline function 'kotlin.code' call
          var this_1 = _Char___init__impl__6a9atx(60);
          if (i === Char__toInt_impl_vasixd(this_1)) {
            if (!quoted) {
              nesting = nesting + 1 | 0;
            }
          } else {
            // Inline function 'kotlin.code' call
            var this_2 = _Char___init__impl__6a9atx(62);
            if (i === Char__toInt_impl_vasixd(this_2))
              if (!quoted) {
                nesting = nesting - 1 | 0;
                if (nesting === 0)
                  return Unit_getInstance();
              }
          }
        }
      }
      if (push_0) {
        push($this, i);
      }
    }
  }
  function parseEndTag($this) {
    read_0($this);
    read_0($this);
    var fullName = readName($this);
    skip($this);
    read($this, _Char___init__impl__6a9atx(62));
    var spIdx = $this.get_depth_iq7qmy_k$() - 1 | 0;
    if ($this.get_depth_iq7qmy_k$() === 0) {
      error($this, 'element stack empty');
      $this._eventType_1 = EventType_COMMENT_getInstance();
      return Unit_getInstance();
    }
    if (!$this.relaxed_1) {
      var tmp0_elvis_lhs = _get_prefix__wiwq7t($this.elementStack_1.get_udoj0p_k$(spIdx), $this);
      var tmp;
      if (tmp0_elvis_lhs == null) {
        exception($this, 'Missing prefix');
      } else {
        tmp = tmp0_elvis_lhs;
      }
      var expectedPrefix = tmp;
      var tmp1_elvis_lhs = _get_localName__c3lhh($this.elementStack_1.get_udoj0p_k$(spIdx), $this);
      var tmp_0;
      if (tmp1_elvis_lhs == null) {
        exception($this, 'Missing localname');
      } else {
        tmp_0 = tmp1_elvis_lhs;
      }
      var expectedLocalName = tmp_0;
      var tmp_1;
      // Inline function 'kotlin.text.isEmpty' call
      if (charSequenceLength(expectedPrefix) === 0) {
        tmp_1 = expectedLocalName;
      } else {
        tmp_1 = expectedPrefix + ':' + expectedLocalName;
      }
      var expectedFullname = tmp_1;
      if (!(fullName === expectedFullname)) {
        error($this, 'expected: /' + _get_fullName__3hvezz($this.elementStack_1.get_udoj0p_k$(spIdx), $this) + ' read: ' + fullName);
      }
    }
  }
  function peekType($this) {
    if ($this._eventType_1 == null)
      return EventType_START_DOCUMENT_getInstance();
    var tmp0_subject = peek($this, 0);
    var tmp;
    if (tmp0_subject === -1) {
      tmp = EventType_END_DOCUMENT_getInstance();
    } else {
      // Inline function 'kotlin.code' call
      var this_0 = _Char___init__impl__6a9atx(38);
      if (tmp0_subject === Char__toInt_impl_vasixd(this_0)) {
        tmp = EventType_ENTITY_REF_getInstance();
      } else {
        // Inline function 'kotlin.code' call
        var this_1 = _Char___init__impl__6a9atx(60);
        if (tmp0_subject === Char__toInt_impl_vasixd(this_1)) {
          var tmp1_subject = peek($this, 1);
          var tmp_0;
          // Inline function 'kotlin.code' call
          var this_2 = _Char___init__impl__6a9atx(47);
          if (tmp1_subject === Char__toInt_impl_vasixd(this_2)) {
            tmp_0 = EventType_END_ELEMENT_getInstance();
          } else {
            // Inline function 'kotlin.code' call
            var this_3 = _Char___init__impl__6a9atx(63);
            if (tmp1_subject === Char__toInt_impl_vasixd(this_3)) {
              tmp_0 = EventType_PROCESSING_INSTRUCTION_getInstance();
            } else {
              // Inline function 'kotlin.code' call
              var this_4 = _Char___init__impl__6a9atx(33);
              if (tmp1_subject === Char__toInt_impl_vasixd(this_4)) {
                tmp_0 = EventType_COMMENT_getInstance();
              } else {
                tmp_0 = EventType_START_ELEMENT_getInstance();
              }
            }
          }
          tmp = tmp_0;
        } else {
          tmp = EventType_TEXT_getInstance();
        }
      }
    }
    return tmp;
  }
  function get($this, pos) {
    return concatToString($this.txtBuf_1, pos, pos + ($this.txtBufPos_1 - pos | 0) | 0);
  }
  function push($this, c) {
    $this.isWhitespace_1 = !!($this.isWhitespace_1 & isXmlWhitespace_2(c));
    if (($this.txtBufPos_1 + 1 | 0) >= $this.txtBuf_1.length) {
      $this.txtBuf_1 = copyOf($this.txtBuf_1, (imul($this.txtBufPos_1, 4) / 3 | 0) + 4 | 0);
    }
    if (c > 65535) {
      var offset = c - 65536 | 0;
      var tmp = $this.txtBuf_1;
      var tmp1 = $this.txtBufPos_1;
      $this.txtBufPos_1 = tmp1 + 1 | 0;
      tmp[tmp1] = numberToChar((offset >>> 10 | 0) + 55296 | 0);
      var tmp_0 = $this.txtBuf_1;
      var tmp3 = $this.txtBufPos_1;
      $this.txtBufPos_1 = tmp3 + 1 | 0;
      tmp_0[tmp3] = numberToChar((offset & 1023) + 56320 | 0);
    } else {
      var tmp_1 = $this.txtBuf_1;
      var tmp5 = $this.txtBufPos_1;
      $this.txtBufPos_1 = tmp5 + 1 | 0;
      tmp_1[tmp5] = numberToChar(c);
    }
  }
  function parseStartTag($this, xmldecl) {
    if (!xmldecl) {
      read_0($this);
    }
    var fullName = readName($this);
    $this.attributes_1.clear_ihvbz9_k$(0);
    $l$loop_1: while (true) {
      skip($this);
      var c = peek($this, 0);
      if (xmldecl) {
        // Inline function 'kotlin.code' call
        var this_0 = _Char___init__impl__6a9atx(63);
        if (c === Char__toInt_impl_vasixd(this_0)) {
          read_0($this);
          read($this, _Char___init__impl__6a9atx(62));
          return Unit_getInstance();
        }
      } else {
        // Inline function 'kotlin.code' call
        var this_1 = _Char___init__impl__6a9atx(47);
        if (c === Char__toInt_impl_vasixd(this_1)) {
          $this.isSelfClosing_1 = true;
          read_0($this);
          skip($this);
          read($this, _Char___init__impl__6a9atx(62));
          break $l$loop_1;
        }
        var tmp;
        // Inline function 'kotlin.code' call
        var this_2 = _Char___init__impl__6a9atx(62);
        if (c === Char__toInt_impl_vasixd(this_2)) {
          tmp = !xmldecl;
        } else {
          tmp = false;
        }
        if (tmp) {
          read_0($this);
          break $l$loop_1;
        }
      }
      if (c === -1) {
        error($this, 'Unexpected EOF');
        return Unit_getInstance();
      }
      var attrName = readName($this);
      // Inline function 'kotlin.text.isEmpty' call
      if (charSequenceLength(attrName) === 0) {
        error($this, 'attr name expected');
        break $l$loop_1;
      }
      skip($this);
      var tmp_0 = peek($this, 0);
      // Inline function 'kotlin.code' call
      var this_3 = _Char___init__impl__6a9atx(61);
      if (!(tmp_0 === Char__toInt_impl_vasixd(this_3))) {
        if (!$this.relaxed_1) {
          error($this, 'Attr.value missing f. ' + attrName);
        }
        $this.attributes_1.addNoNS_wmiq0n_k$(attrName, attrName);
      } else {
        read($this, _Char___init__impl__6a9atx(61));
        skip($this);
        var delimiter = peek($this, 0);
        var tmp_1;
        var tmp_2 = delimiter;
        // Inline function 'kotlin.code' call
        var this_4 = _Char___init__impl__6a9atx(39);
        if (!(tmp_2 === Char__toInt_impl_vasixd(this_4))) {
          var tmp_3 = delimiter;
          // Inline function 'kotlin.code' call
          var this_5 = _Char___init__impl__6a9atx(34);
          tmp_1 = !(tmp_3 === Char__toInt_impl_vasixd(this_5));
        } else {
          tmp_1 = false;
        }
        if (tmp_1) {
          if (!$this.relaxed_1) {
            error($this, 'attr value delimiter missing!');
          }
          // Inline function 'kotlin.code' call
          var this_6 = _Char___init__impl__6a9atx(32);
          delimiter = Char__toInt_impl_vasixd(this_6);
        } else {
          read_0($this);
        }
        var p = $this.txtBufPos_1;
        pushText($this, delimiter, true);
        $this.attributes_1.addNoNS_wmiq0n_k$(attrName, get($this, p));
        $this.txtBufPos_1 = p;
        var tmp_4 = delimiter;
        // Inline function 'kotlin.code' call
        var this_7 = _Char___init__impl__6a9atx(32);
        if (!(tmp_4 === Char__toInt_impl_vasixd(this_7))) {
          read_0($this);
        }
      }
    }
    var d = $this.get_depth_iq7qmy_k$();
    $this.namespaceHolder_1.incDepth_t2y8xh_k$();
    $this.elementStack_1.ensureCapacity_wr7980_k$($this.get_depth_iq7qmy_k$());
    _set_fullName__9b0wgt($this.elementStack_1.get_udoj0p_k$(d), $this, fullName);
    adjustNsp($this, fullName);
  }
  function pushEntity($this) {
    push($this, read_0($this));
    var pos = $this.txtBufPos_1;
    $l$loop: while (true) {
      var c = peek($this, 0);
      // Inline function 'kotlin.code' call
      var this_0 = _Char___init__impl__6a9atx(59);
      if (c === Char__toInt_impl_vasixd(this_0)) {
        read_0($this);
        break $l$loop;
      }
      var tmp;
      var tmp_0;
      var tmp_1;
      var tmp_2;
      var tmp_3;
      var tmp_4;
      if (c < 128) {
        var tmp_5;
        // Inline function 'kotlin.code' call
        var this_1 = _Char___init__impl__6a9atx(48);
        if (c < Char__toInt_impl_vasixd(this_1)) {
          tmp_5 = true;
        } else {
          // Inline function 'kotlin.code' call
          var this_2 = _Char___init__impl__6a9atx(57);
          tmp_5 = c > Char__toInt_impl_vasixd(this_2);
        }
        tmp_4 = tmp_5;
      } else {
        tmp_4 = false;
      }
      if (tmp_4) {
        var tmp_6;
        // Inline function 'kotlin.code' call
        var this_3 = _Char___init__impl__6a9atx(97);
        if (c < Char__toInt_impl_vasixd(this_3)) {
          tmp_6 = true;
        } else {
          // Inline function 'kotlin.code' call
          var this_4 = _Char___init__impl__6a9atx(122);
          tmp_6 = c > Char__toInt_impl_vasixd(this_4);
        }
        tmp_3 = tmp_6;
      } else {
        tmp_3 = false;
      }
      if (tmp_3) {
        var tmp_7;
        // Inline function 'kotlin.code' call
        var this_5 = _Char___init__impl__6a9atx(65);
        if (c < Char__toInt_impl_vasixd(this_5)) {
          tmp_7 = true;
        } else {
          // Inline function 'kotlin.code' call
          var this_6 = _Char___init__impl__6a9atx(90);
          tmp_7 = c > Char__toInt_impl_vasixd(this_6);
        }
        tmp_2 = tmp_7;
      } else {
        tmp_2 = false;
      }
      if (tmp_2) {
        // Inline function 'kotlin.code' call
        var this_7 = _Char___init__impl__6a9atx(95);
        tmp_1 = !(c === Char__toInt_impl_vasixd(this_7));
      } else {
        tmp_1 = false;
      }
      if (tmp_1) {
        // Inline function 'kotlin.code' call
        var this_8 = _Char___init__impl__6a9atx(45);
        tmp_0 = !(c === Char__toInt_impl_vasixd(this_8));
      } else {
        tmp_0 = false;
      }
      if (tmp_0) {
        // Inline function 'kotlin.code' call
        var this_9 = _Char___init__impl__6a9atx(35);
        tmp = !(c === Char__toInt_impl_vasixd(this_9));
      } else {
        tmp = false;
      }
      if (tmp) {
        if (!$this.relaxed_1) {
          error($this, 'unterminated entity ref');
        }
        println('broken entitiy: ' + get($this, pos - 1 | 0));
        return Unit_getInstance();
      }
      push($this, read_0($this));
    }
    var code = get($this, pos);
    $this.txtBufPos_1 = pos - 1 | 0;
    if ($this.token_1 ? equals($this._eventType_1, EventType_ENTITY_REF_getInstance()) : false) {
      $this.entityName_1 = code;
    }
    if (charSequenceGet(code, 0) === _Char___init__impl__6a9atx(35)) {
      var tmp_8;
      if (charSequenceGet(code, 1) === _Char___init__impl__6a9atx(120)) {
        // Inline function 'kotlin.text.substring' call
        // Inline function 'kotlin.js.asDynamic' call
        var tmp$ret$11 = code.substring(2);
        tmp_8 = toInt_0(tmp$ret$11, 16);
      } else {
        // Inline function 'kotlin.text.substring' call
        // Inline function 'kotlin.js.asDynamic' call
        var tmp$ret$13 = code.substring(1);
        tmp_8 = toInt(tmp$ret$13);
      }
      var c_0 = tmp_8;
      push($this, c_0);
      return Unit_getInstance();
    }
    var result = $this.entityMap_1.get_wei43m_k$(code);
    $this.unresolved_1 = result == null;
    if (result == null) {
      if (!$this.token_1) {
        error($this, 'unresolved: &' + code + ';');
      }
    } else {
      var inductionVariable = 0;
      var last = result.length;
      if (inductionVariable < last)
        do {
          var i = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          // Inline function 'kotlin.code' call
          var this_10 = charSequenceGet(result, i);
          var tmp$ret$14 = Char__toInt_impl_vasixd(this_10);
          push($this, tmp$ret$14);
        }
         while (inductionVariable < last);
    }
  }
  function pushText($this, delimiter, resolveEntities) {
    var next = peek($this, 0);
    var cbrCount = 0;
    $l$loop_0: while (!(next === -1) ? !(next === delimiter) : false) {
      // Inline function 'kotlin.code' call
      var this_0 = _Char___init__impl__6a9atx(32);
      if (delimiter === Char__toInt_impl_vasixd(this_0)) {
        var tmp;
        if (isXmlWhitespace_2(next)) {
          tmp = true;
        } else {
          var tmp_0 = next;
          // Inline function 'kotlin.code' call
          var this_1 = _Char___init__impl__6a9atx(62);
          tmp = tmp_0 === Char__toInt_impl_vasixd(this_1);
        }
        if (tmp)
          break $l$loop_0;
      }
      var tmp_1 = next;
      // Inline function 'kotlin.code' call
      var this_2 = _Char___init__impl__6a9atx(38);
      if (tmp_1 === Char__toInt_impl_vasixd(this_2)) {
        if (!resolveEntities)
          break $l$loop_0;
        pushEntity($this);
      } else {
        var tmp_2;
        var tmp_3 = next;
        // Inline function 'kotlin.code' call
        var this_3 = _Char___init__impl__6a9atx(10);
        if (tmp_3 === Char__toInt_impl_vasixd(this_3)) {
          tmp_2 = equals($this._eventType_1, EventType_START_ELEMENT_getInstance());
        } else {
          tmp_2 = false;
        }
        if (tmp_2) {
          read_0($this);
          // Inline function 'kotlin.code' call
          var this_4 = _Char___init__impl__6a9atx(32);
          var tmp$ret$4 = Char__toInt_impl_vasixd(this_4);
          push($this, tmp$ret$4);
        } else {
          push($this, read_0($this));
        }
      }
      var tmp_4;
      var tmp_5;
      var tmp_6 = next;
      // Inline function 'kotlin.code' call
      var this_5 = _Char___init__impl__6a9atx(62);
      if (tmp_6 === Char__toInt_impl_vasixd(this_5)) {
        tmp_5 = cbrCount >= 2;
      } else {
        tmp_5 = false;
      }
      if (tmp_5) {
        // Inline function 'kotlin.code' call
        var this_6 = _Char___init__impl__6a9atx(93);
        tmp_4 = !(delimiter === Char__toInt_impl_vasixd(this_6));
      } else {
        tmp_4 = false;
      }
      if (tmp_4) {
        error($this, 'Illegal: ]]>');
      }
      var tmp_7 = next;
      // Inline function 'kotlin.code' call
      var this_7 = _Char___init__impl__6a9atx(93);
      if (tmp_7 === Char__toInt_impl_vasixd(this_7)) {
        cbrCount = cbrCount + 1 | 0;
      } else {
        cbrCount = 0;
      }
      next = peek($this, 0);
    }
  }
  function read($this, c) {
    var a = read_0($this);
    // Inline function 'kotlin.code' call
    if (!(a === Char__toInt_impl_vasixd(c))) {
      error($this, "expected: '" + new Char(c) + "' actual: '" + toString_0(numberToChar(a)) + "'");
    }
  }
  function read_0($this) {
    var result;
    if ($this.peekCount_1 === 0)
      result = peek($this, 0);
    else {
      result = $this.peek_1[0];
      $this.peek_1[0] = $this.peek_1[1];
    }
    $this.peekCount_1 = $this.peekCount_1 - 1 | 0;
    $this.column_1 = $this.column_1 + 1 | 0;
    // Inline function 'kotlin.code' call
    var this_0 = _Char___init__impl__6a9atx(10);
    if (result === Char__toInt_impl_vasixd(this_0)) {
      $this.line_1 = $this.line_1 + 1 | 0;
      $this.column_1 = 1;
    }
    return result;
  }
  function peek($this, pos) {
    while (pos >= $this.peekCount_1) {
      var nw;
      if ($this.srcBuf_1.length <= 1)
        nw = $this.reader_1.read_22xsm_k$();
      else if ($this.srcBufPos_1 < $this.srcBufCount_1) {
        // Inline function 'kotlin.code' call
        var tmp1 = $this.srcBufPos_1;
        $this.srcBufPos_1 = tmp1 + 1 | 0;
        var this_0 = $this.srcBuf_1[tmp1];
        nw = Char__toInt_impl_vasixd(this_0);
      } else {
        $this.srcBufCount_1 = $this.reader_1.read_l2ukak_k$($this.srcBuf_1, 0, $this.srcBuf_1.length);
        var tmp;
        if ($this.srcBufCount_1 <= 0) {
          tmp = -1;
        } else {
          // Inline function 'kotlin.code' call
          var this_1 = $this.srcBuf_1[0];
          tmp = Char__toInt_impl_vasixd(this_1);
        }
        nw = tmp;
        $this.srcBufPos_1 = 1;
      }
      var tmp_0 = nw;
      // Inline function 'kotlin.code' call
      var this_2 = _Char___init__impl__6a9atx(13);
      if (tmp_0 === Char__toInt_impl_vasixd(this_2)) {
        $this.wasCR_1 = true;
        var tmp3 = $this.peekCount_1;
        $this.peekCount_1 = tmp3 + 1 | 0;
        // Inline function 'kotlin.code' call
        var this_3 = _Char___init__impl__6a9atx(10);
        var tmp$ret$3 = Char__toInt_impl_vasixd(this_3);
        $this.peek_1[tmp3] = tmp$ret$3;
      } else {
        var tmp_1 = nw;
        // Inline function 'kotlin.code' call
        var this_4 = _Char___init__impl__6a9atx(10);
        if (tmp_1 === Char__toInt_impl_vasixd(this_4)) {
          if (!$this.wasCR_1) {
            var tmp5 = $this.peekCount_1;
            $this.peekCount_1 = tmp5 + 1 | 0;
            // Inline function 'kotlin.code' call
            var this_5 = _Char___init__impl__6a9atx(10);
            var tmp$ret$5 = Char__toInt_impl_vasixd(this_5);
            $this.peek_1[tmp5] = tmp$ret$5;
          }
        } else {
          var tmp7 = $this.peekCount_1;
          $this.peekCount_1 = tmp7 + 1 | 0;
          $this.peek_1[tmp7] = nw;
        }
        $this.wasCR_1 = false;
      }
    }
    return $this.peek_1[pos];
  }
  function readName($this) {
    var pos = $this.txtBufPos_1;
    var c = peek($this, 0);
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    var tmp_3;
    var tmp_4;
    var tmp_5 = c;
    // Inline function 'kotlin.code' call
    var this_0 = _Char___init__impl__6a9atx(97);
    if (tmp_5 < Char__toInt_impl_vasixd(this_0)) {
      tmp_4 = true;
    } else {
      var tmp_6 = c;
      // Inline function 'kotlin.code' call
      var this_1 = _Char___init__impl__6a9atx(122);
      tmp_4 = tmp_6 > Char__toInt_impl_vasixd(this_1);
    }
    if (tmp_4) {
      var tmp_7;
      var tmp_8 = c;
      // Inline function 'kotlin.code' call
      var this_2 = _Char___init__impl__6a9atx(65);
      if (tmp_8 < Char__toInt_impl_vasixd(this_2)) {
        tmp_7 = true;
      } else {
        var tmp_9 = c;
        // Inline function 'kotlin.code' call
        var this_3 = _Char___init__impl__6a9atx(90);
        tmp_7 = tmp_9 > Char__toInt_impl_vasixd(this_3);
      }
      tmp_3 = tmp_7;
    } else {
      tmp_3 = false;
    }
    if (tmp_3) {
      var tmp_10 = c;
      // Inline function 'kotlin.code' call
      var this_4 = _Char___init__impl__6a9atx(95);
      tmp_2 = !(tmp_10 === Char__toInt_impl_vasixd(this_4));
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      var tmp_11 = c;
      // Inline function 'kotlin.code' call
      var this_5 = _Char___init__impl__6a9atx(58);
      tmp_1 = !(tmp_11 === Char__toInt_impl_vasixd(this_5));
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = c < 192;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = !$this.relaxed_1;
    } else {
      tmp = false;
    }
    if (tmp) {
      error($this, 'name expected');
    }
    $l$1: do {
      $l$0: do {
        push($this, read_0($this));
        c = peek($this, 0);
      }
       while (false);
      var tmp_12;
      var tmp_13;
      var tmp_14;
      var tmp_15;
      var tmp_16;
      var tmp_17;
      var tmp_18;
      var tmp_19;
      var tmp_20 = c;
      // Inline function 'kotlin.code' call
      var this_6 = _Char___init__impl__6a9atx(97);
      if (tmp_20 >= Char__toInt_impl_vasixd(this_6)) {
        var tmp_21 = c;
        // Inline function 'kotlin.code' call
        var this_7 = _Char___init__impl__6a9atx(122);
        tmp_19 = tmp_21 <= Char__toInt_impl_vasixd(this_7);
      } else {
        tmp_19 = false;
      }
      if (tmp_19) {
        tmp_18 = true;
      } else {
        var tmp_22;
        var tmp_23 = c;
        // Inline function 'kotlin.code' call
        var this_8 = _Char___init__impl__6a9atx(65);
        if (tmp_23 >= Char__toInt_impl_vasixd(this_8)) {
          var tmp_24 = c;
          // Inline function 'kotlin.code' call
          var this_9 = _Char___init__impl__6a9atx(90);
          tmp_22 = tmp_24 <= Char__toInt_impl_vasixd(this_9);
        } else {
          tmp_22 = false;
        }
        tmp_18 = tmp_22;
      }
      if (tmp_18) {
        tmp_17 = true;
      } else {
        var tmp_25;
        var tmp_26 = c;
        // Inline function 'kotlin.code' call
        var this_10 = _Char___init__impl__6a9atx(48);
        if (tmp_26 >= Char__toInt_impl_vasixd(this_10)) {
          var tmp_27 = c;
          // Inline function 'kotlin.code' call
          var this_11 = _Char___init__impl__6a9atx(57);
          tmp_25 = tmp_27 <= Char__toInt_impl_vasixd(this_11);
        } else {
          tmp_25 = false;
        }
        tmp_17 = tmp_25;
      }
      if (tmp_17) {
        tmp_16 = true;
      } else {
        var tmp_28 = c;
        // Inline function 'kotlin.code' call
        var this_12 = _Char___init__impl__6a9atx(95);
        tmp_16 = tmp_28 === Char__toInt_impl_vasixd(this_12);
      }
      if (tmp_16) {
        tmp_15 = true;
      } else {
        var tmp_29 = c;
        // Inline function 'kotlin.code' call
        var this_13 = _Char___init__impl__6a9atx(45);
        tmp_15 = tmp_29 === Char__toInt_impl_vasixd(this_13);
      }
      if (tmp_15) {
        tmp_14 = true;
      } else {
        var tmp_30 = c;
        // Inline function 'kotlin.code' call
        var this_14 = _Char___init__impl__6a9atx(58);
        tmp_14 = tmp_30 === Char__toInt_impl_vasixd(this_14);
      }
      if (tmp_14) {
        tmp_13 = true;
      } else {
        var tmp_31 = c;
        // Inline function 'kotlin.code' call
        var this_15 = _Char___init__impl__6a9atx(46);
        tmp_13 = tmp_31 === Char__toInt_impl_vasixd(this_15);
      }
      if (tmp_13) {
        tmp_12 = true;
      } else {
        tmp_12 = c >= 183;
      }
    }
     while (tmp_12);
    var result = get($this, pos);
    $this.txtBufPos_1 = pos;
    return result;
  }
  function skip($this) {
    $l$loop: while (true) {
      var c = peek($this, 0);
      var tmp;
      // Inline function 'kotlin.code' call
      var this_0 = _Char___init__impl__6a9atx(32);
      if (c > Char__toInt_impl_vasixd(this_0)) {
        tmp = true;
      } else {
        tmp = c === -1;
      }
      if (tmp)
        break $l$loop;
      read_0($this);
    }
  }
  function getPositionDescription($this) {
    var tmp0_elvis_lhs = $this._eventType_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      return '<!--Parsing not started yet-->';
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var et = tmp;
    var buf = new StringBuilder(et.get_name_woqyms_k$());
    buf.append_am5a4z_k$(_Char___init__impl__6a9atx(32));
    if (et.equals(EventType_START_ELEMENT_getInstance()) ? true : et.equals(EventType_END_ELEMENT_getInstance())) {
      if ($this.isSelfClosing_1) {
        buf.append_22ad7x_k$('(empty) ');
      }
      buf.append_am5a4z_k$(_Char___init__impl__6a9atx(60));
      if (et.equals(EventType_END_ELEMENT_getInstance())) {
        buf.append_am5a4z_k$(_Char___init__impl__6a9atx(47));
      }
      if (!(_get_prefix__wiwq7t($this.elementStack_1.get_udoj0p_k$($this.get_depth_iq7qmy_k$()), $this) == null)) {
        buf.append_22ad7x_k$('{' + $this.get_namespaceURI_g6nmhy_k$() + '}' + $this.get_prefix_i78za3_k$() + ':');
      }
      buf.append_t8pm91_k$($this.get_name_woqyms_k$());
      var inductionVariable = 0;
      var last = $this.attributes_1.size_1;
      if (inductionVariable < last)
        do {
          var x = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          buf.append_am5a4z_k$(_Char___init__impl__6a9atx(32));
          var a = $this.attributes_1.get_2wmxux_k$(x);
          if (!(_get_namespace__iwxsq2_0(a, $this) == null)) {
            buf.append_am5a4z_k$(_Char___init__impl__6a9atx(123)).append_22ad7x_k$(_get_namespace__iwxsq2_0(a, $this)).append_am5a4z_k$(_Char___init__impl__6a9atx(125)).append_22ad7x_k$(_get_prefix__wiwq7t_0(a, $this)).append_am5a4z_k$(_Char___init__impl__6a9atx(58));
          }
          buf.append_22ad7x_k$('' + _get_localName__c3lhh_0(a, $this) + "='" + _get_value__a43j40(a, $this) + "'");
        }
         while (inductionVariable < last);
      buf.append_am5a4z_k$(_Char___init__impl__6a9atx(62));
    } else if (!et.equals(EventType_IGNORABLE_WHITESPACE_getInstance()))
      if (!et.equals(EventType_TEXT_getInstance())) {
        buf.append_22ad7x_k$($this.get_text_wouvsm_k$());
      } else if ($this.isWhitespace_1) {
        buf.append_22ad7x_k$('(whitespace)');
      } else {
        var textCpy = $this.get_text_wouvsm_k$();
        if (textCpy.length > 16) {
          // Inline function 'kotlin.text.substring' call
          // Inline function 'kotlin.js.asDynamic' call
          textCpy = textCpy.substring(0, 16) + '...';
        }
        buf.append_22ad7x_k$(textCpy);
      }
    buf.append_22ad7x_k$('@' + $this.line_1 + ':' + $this.column_1 + ' in ');
    buf.append_22ad7x_k$(toString($this.reader_1));
    return buf.toString();
  }
  function Companion_4() {
    Companion_instance_4 = this;
    this.UNEXPECTED_EOF_1 = 'Unexpected EOF';
    this.ILLEGAL_TYPE_1 = 'Wrong event type';
    this.processNsp_1 = true;
  }
  protoOf(Companion_4).get_UNEXPECTED_EOF_kaxurt_k$ = function () {
    return this.UNEXPECTED_EOF_1;
  };
  protoOf(Companion_4).get_ILLEGAL_TYPE_k7mjhw_k$ = function () {
    return this.ILLEGAL_TYPE_1;
  };
  protoOf(Companion_4).get_processNsp_d6wisb_k$ = function () {
    return this.processNsp_1;
  };
  var Companion_instance_4;
  function Companion_getInstance_5() {
    if (Companion_instance_4 == null)
      new Companion_4();
    return Companion_instance_4;
  }
  function ElementStack() {
    var tmp = this;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp.data_1 = fillArrayVal(Array(16), null);
  }
  protoOf(ElementStack).get_data_wokkxf_k$ = function () {
    return this.data_1;
  };
  protoOf(ElementStack).get_udoj0p_k$ = function (idx) {
    return _ElementDelegate___init__impl__t07x0o(idx);
  };
  protoOf(ElementStack).ensureCapacity_wr7980_k$ = function (required) {
    var requiredCapacity = imul(required, 4);
    if (this.data_1.length >= requiredCapacity)
      return Unit_getInstance();
    this.data_1 = copyOf_0(this.data_1, requiredCapacity + 16 | 0);
  };
  function ElementDelegate(index) {
    this.index_1 = index;
  }
  protoOf(ElementDelegate).toString = function () {
    return ElementDelegate__toString_impl_schjmo(this.index_1);
  };
  protoOf(ElementDelegate).hashCode = function () {
    return ElementDelegate__hashCode_impl_kxgljl(this.index_1);
  };
  protoOf(ElementDelegate).equals = function (other) {
    return ElementDelegate__equals_impl_mnl19p(this.index_1, other);
  };
  function _set_namespace__mtbsui(_this__u8e3s4, $this, value) {
    $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4)] = value;
  }
  function _get_namespace__iwxsq2(_this__u8e3s4, $this) {
    var containsUpper = $this.get_depth_iq7qmy_k$();
    var containsArg = _ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4)];
  }
  function _set_prefix__v265l1(_this__u8e3s4, $this, value) {
    $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4) + 1 | 0] = value;
  }
  function _get_prefix__wiwq7t(_this__u8e3s4, $this) {
    var containsUpper = $this.get_depth_iq7qmy_k$();
    var containsArg = _ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4) + 1 | 0];
  }
  function _set_localName__tmy1w1(_this__u8e3s4, $this, value) {
    $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4) + 2 | 0] = value;
  }
  function _get_localName__c3lhh(_this__u8e3s4, $this) {
    var containsUpper = $this.get_depth_iq7qmy_k$();
    var containsArg = _ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4) + 2 | 0];
  }
  function _set_fullName__9b0wgt(_this__u8e3s4, $this, value) {
    $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4) + 3 | 0] = value;
  }
  function _get_fullName__3hvezz(_this__u8e3s4, $this) {
    var containsUpper = $this.get_depth_iq7qmy_k$();
    var containsArg = _ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.elementStack_1.data_1[imul(_ElementDelegate___get_index__impl__2ny1jf(_this__u8e3s4), 4) + 3 | 0];
  }
  function AttributesCollection() {
    var tmp = this;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp.data_1 = fillArrayVal(Array(16), null);
    this.size_1 = 0;
  }
  protoOf(AttributesCollection).get_data_wokkxf_k$ = function () {
    return this.data_1;
  };
  protoOf(AttributesCollection).get_size_woubt6_k$ = function () {
    return this.size_1;
  };
  protoOf(AttributesCollection).get_2wmxux_k$ = function (index) {
    return _AttributeDelegate___init__impl__ovambc(index);
  };
  protoOf(AttributesCollection).removeAttr_xhxyio_k$ = function (attr) {
    // Inline function 'kotlin.collections.copyInto' call
    var this_0 = this.data_1;
    var destination = this.data_1;
    var destinationOffset = imul(_AttributeDelegate___get_index__impl__2x9emt(attr), 4);
    var startIndex = imul(_AttributeDelegate___get_index__impl__2x9emt(attr), 4) + 4 | 0;
    var tmp1 = this.size_1;
    this.size_1 = tmp1 - 1 | 0;
    var endIndex = imul(tmp1, 4);
    arrayCopy(this_0, destination, destinationOffset, startIndex, endIndex);
    fill(this.data_1, null, imul(this.size_1, 4), imul(this.size_1, 4) + 4 | 0);
  };
  protoOf(AttributesCollection).clear_ihvbz9_k$ = function (newSize) {
    if (this.size_1 > 0) {
      fill(this.data_1, null, 0, imul(this.size_1, 4));
    }
    this.size_1 = newSize;
  };
  protoOf(AttributesCollection).clear$default_90upub_k$ = function (newSize, $super) {
    newSize = newSize === VOID ? -1 : newSize;
    var tmp;
    if ($super === VOID) {
      this.clear_ihvbz9_k$(newSize);
      tmp = Unit_getInstance();
    } else {
      tmp = $super.clear_ihvbz9_k$.call(this, newSize);
    }
    return tmp;
  };
  protoOf(AttributesCollection).ensureCapacity_wr7980_k$ = function (required) {
    var requiredSize = imul(required, 4);
    if (this.data_1.length >= requiredSize)
      return Unit_getInstance();
    this.data_1 = copyOf_0(this.data_1, requiredSize + 16 | 0);
  };
  protoOf(AttributesCollection).addNoNS_wmiq0n_k$ = function (attrName, attrValue) {
    this.size_1 = this.size_1 < 0 ? 1 : this.size_1 + 1 | 0;
    this.ensureCapacity_wr7980_k$(this.size_1);
    var i = imul(this.size_1, 4) - 4 | 0;
    var tmp = this.data_1;
    var tmp0 = i;
    i = tmp0 + 1 | 0;
    tmp[tmp0] = '';
    var tmp_0 = this.data_1;
    var tmp1 = i;
    i = tmp1 + 1 | 0;
    tmp_0[tmp1] = null;
    var tmp_1 = this.data_1;
    var tmp2 = i;
    i = tmp2 + 1 | 0;
    tmp_1[tmp2] = attrName;
    this.data_1[i] = attrValue;
  };
  function AttributeDelegate(index) {
    this.index_1 = index;
  }
  protoOf(AttributeDelegate).toString = function () {
    return AttributeDelegate__toString_impl_z41b5s(this.index_1);
  };
  protoOf(AttributeDelegate).hashCode = function () {
    return AttributeDelegate__hashCode_impl_dcvecx(this.index_1);
  };
  protoOf(AttributeDelegate).equals = function (other) {
    return AttributeDelegate__equals_impl_js1r03(this.index_1, other);
  };
  function _set_namespace__mtbsui_0(_this__u8e3s4, $this, value) {
    $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4)] = value;
  }
  function _get_namespace__iwxsq2_0(_this__u8e3s4, $this) {
    var containsUpper = $this.attributes_1.size_1;
    var containsArg = _AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4)];
  }
  function _set_prefix__v265l1_0(_this__u8e3s4, $this, value) {
    $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4) + 1 | 0] = value;
  }
  function _get_prefix__wiwq7t_0(_this__u8e3s4, $this) {
    var containsUpper = $this.attributes_1.size_1;
    var containsArg = _AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4) + 1 | 0];
  }
  function _set_localName__tmy1w1_0(_this__u8e3s4, $this, value) {
    $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4) + 2 | 0] = value;
  }
  function _get_localName__c3lhh_0(_this__u8e3s4, $this) {
    var containsUpper = $this.attributes_1.size_1;
    var containsArg = _AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4) + 2 | 0];
  }
  function _set_value__lx0xdg(_this__u8e3s4, $this, value) {
    $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4) + 3 | 0] = value;
  }
  function _get_value__a43j40(_this__u8e3s4, $this) {
    var containsUpper = $this.attributes_1.size_1;
    var containsArg = _AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4);
    if (!(0 <= containsArg ? containsArg <= containsUpper : false))
      throw IndexOutOfBoundsException_init_$Create$();
    return $this.attributes_1.data_1[imul(_AttributeDelegate___get_index__impl__2x9emt(_this__u8e3s4), 4) + 3 | 0];
  }
  function KtXmlReader(reader, encoding, relaxed) {
    Companion_getInstance_5();
    relaxed = relaxed === VOID ? false : relaxed;
    this.reader_1 = reader;
    this.relaxed_1 = relaxed;
    this.line_1 = 1;
    this.column_1 = 0;
    this._eventType_1 = null;
    this.entityName_1 = null;
    this.isSelfClosing_1 = false;
    this.attributes_1 = new AttributesCollection();
    this.encoding_1 = encoding;
    this.version_1 = null;
    this.standalone_1 = null;
    this.srcBuf_1 = charArray(8192);
    this.srcBufPos_1 = 0;
    this.srcBufCount_1 = 0;
    this.peek_1 = new Int32Array(2);
    this.peekCount_1 = 0;
    var tmp = this;
    // Inline function 'kotlin.also' call
    var this_0 = HashMap_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.core.KtXmlReader.entityMap.<anonymous>' call
    // Inline function 'kotlin.collections.set' call
    this_0.put_4fpzoq_k$('amp', '&');
    // Inline function 'kotlin.collections.set' call
    this_0.put_4fpzoq_k$('apos', "'");
    // Inline function 'kotlin.collections.set' call
    this_0.put_4fpzoq_k$('gt', '>');
    // Inline function 'kotlin.collections.set' call
    this_0.put_4fpzoq_k$('lt', '<');
    // Inline function 'kotlin.collections.set' call
    this_0.put_4fpzoq_k$('quot', '"');
    tmp.entityMap_1 = this_0;
    this.namespaceHolder_1 = new NamespaceHolder();
    this.elementStack_1 = new ElementStack();
    this.txtBuf_1 = charArray(128);
    this.txtBufPos_1 = 0;
    this.isWhitespace_1 = false;
    this.error_1 = null;
    this.wasCR_1 = false;
    this.unresolved_1 = false;
    this.token_1 = false;
    var firstChar = peek(this, 0);
    if (firstChar === 65279) {
      this.peekCount_1 = 0;
    }
  }
  protoOf(KtXmlReader).get_relaxed_jat35y_k$ = function () {
    return this.relaxed_1;
  };
  protoOf(KtXmlReader).get_eventType_918hfv_k$ = function () {
    var tmp0_elvis_lhs = this._eventType_1;
    var tmp;
    if (tmp0_elvis_lhs == null) {
      throw IllegalStateException_init_$Create$('Not yet started');
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  };
  protoOf(KtXmlReader).get_isStarted_wg74c2_k$ = function () {
    return !(this._eventType_1 == null);
  };
  protoOf(KtXmlReader).get_localName_bf4zrn_k$ = function () {
    var tmp0_subject = this._eventType_1;
    var tmp;
    switch (tmp0_subject == null ? -1 : tmp0_subject.get_ordinal_ip24qg_k$()) {
      case 8:
        var tmp1_elvis_lhs = this.entityName_1;
        var tmp_0;
        if (tmp1_elvis_lhs == null) {
          throw XmlException_init_$Create$_0('Missing entity name');
        } else {
          tmp_0 = tmp1_elvis_lhs;
        }

        tmp = tmp_0;
        break;
      case 1:
      case 2:
        var tmp2_elvis_lhs = _get_localName__c3lhh(this.elementStack_1.get_udoj0p_k$(this.get_depth_iq7qmy_k$() - 1 | 0), this);
        var tmp_1;
        if (tmp2_elvis_lhs == null) {
          throw XmlException_init_$Create$_0('Missing local name');
        } else {
          tmp_1 = tmp2_elvis_lhs;
        }

        tmp = tmp_1;
        break;
      default:
        throw IllegalStateException_init_$Create$('Local name not accessible outside of element tags');
    }
    return tmp;
  };
  protoOf(KtXmlReader).get_namespaceURI_g6nmhy_k$ = function () {
    var tmp0_subject = this._eventType_1;
    var tmp;
    switch (tmp0_subject == null ? -1 : tmp0_subject.get_ordinal_ip24qg_k$()) {
      case 1:
      case 2:
        var tmp1_elvis_lhs = _get_namespace__iwxsq2(this.elementStack_1.get_udoj0p_k$(this.get_depth_iq7qmy_k$() - 1 | 0), this);
        var tmp_0;
        if (tmp1_elvis_lhs == null) {
          throw XmlException_init_$Create$_0('Missing namespace');
        } else {
          tmp_0 = tmp1_elvis_lhs;
        }

        tmp = tmp_0;
        break;
      default:
        throw IllegalStateException_init_$Create$('Local name not accessible outside of element tags');
    }
    return tmp;
  };
  protoOf(KtXmlReader).get_prefix_i78za3_k$ = function () {
    var tmp0_subject = this._eventType_1;
    var tmp;
    switch (tmp0_subject == null ? -1 : tmp0_subject.get_ordinal_ip24qg_k$()) {
      case 1:
      case 2:
        var tmp1_elvis_lhs = _get_prefix__wiwq7t(this.elementStack_1.get_udoj0p_k$(this.get_depth_iq7qmy_k$() - 1 | 0), this);
        var tmp_0;
        if (tmp1_elvis_lhs == null) {
          throw XmlException_init_$Create$_0('Missing prefix');
        } else {
          tmp_0 = tmp1_elvis_lhs;
        }

        tmp = tmp_0;
        break;
      default:
        throw IllegalStateException_init_$Create$('Local name not accessible outside of element tags');
    }
    return tmp;
  };
  protoOf(KtXmlReader).get_attributeCount_hqf30_k$ = function () {
    return this.attributes_1.size_1;
  };
  protoOf(KtXmlReader).get_encoding_3i4b8k_k$ = function () {
    return this.encoding_1;
  };
  protoOf(KtXmlReader).set_version_f26bs4_k$ = function (_set____db54di) {
    this.version_1 = _set____db54di;
  };
  protoOf(KtXmlReader).get_version_72w4j3_k$ = function () {
    return this.version_1;
  };
  protoOf(KtXmlReader).set_standalone_i3ndwe_k$ = function (_set____db54di) {
    this.standalone_1 = _set____db54di;
  };
  protoOf(KtXmlReader).get_standalone_tm0l3i_k$ = function () {
    return this.standalone_1;
  };
  protoOf(KtXmlReader).get_depth_iq7qmy_k$ = function () {
    return this.namespaceHolder_1.get_depth_iq7qmy_k$();
  };
  protoOf(KtXmlReader).get_namespaceDecls_1u0o6v_k$ = function () {
    return this.namespaceHolder_1.get_namespacesAtCurrentDepth_6mysci_k$();
  };
  protoOf(KtXmlReader).get_namespaceContext_n7n1ib_k$ = function () {
    return this.namespaceHolder_1.get_namespaceContext_n7n1ib_k$();
  };
  protoOf(KtXmlReader).close_yn9xrc_k$ = function () {
  };
  protoOf(KtXmlReader).getNamespacePrefix_8fyoot_k$ = function (namespaceUri) {
    return this.namespaceHolder_1.getPrefix_2nmkkr_k$(namespaceUri);
  };
  protoOf(KtXmlReader).getNamespaceURI_859c43_k$ = function (prefix) {
    return this.namespaceHolder_1.getNamespaceUri_83evzq_k$(prefix);
  };
  protoOf(KtXmlReader).toString = function () {
    return 'KtXmlReader [' + getPositionDescription(this) + ']';
  };
  protoOf(KtXmlReader).get_locationInfo_3kny30_k$ = function () {
    return '' + this.line_1 + ':' + this.column_1;
  };
  protoOf(KtXmlReader).getLineNumber_ad8fxp_k$ = function () {
    return this.line_1;
  };
  protoOf(KtXmlReader).getColumnNumber_h3fiyd_k$ = function () {
    return this.column_1;
  };
  protoOf(KtXmlReader).isWhitespace_ujiz09_k$ = function () {
    var et = this.get_eventType_918hfv_k$();
    if ((!et.equals(EventType_TEXT_getInstance()) ? !et.equals(EventType_IGNORABLE_WHITESPACE_getInstance()) : false) ? !et.equals(EventType_CDSECT_getInstance()) : false) {
      exception(this, 'Wrong event type');
    }
    return this.isWhitespace_1;
  };
  protoOf(KtXmlReader).get_text_wouvsm_k$ = function () {
    var tmp;
    if (this.get_eventType_918hfv_k$().get_isTextElement_53s5zw_k$()) {
      tmp = get(this, 0);
    } else {
      throw XmlException_init_$Create$_0('The element is not text, it is: ' + this.get_eventType_918hfv_k$());
    }
    return tmp;
  };
  protoOf(KtXmlReader).get_piTarget_jrarar_k$ = function () {
    // Inline function 'kotlin.check' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.check' call
    // Inline function 'kotlin.contracts.contract' call
    if (!this.get_eventType_918hfv_k$().equals(EventType_PROCESSING_INSTRUCTION_getInstance())) {
      // Inline function 'kotlin.check.<anonymous>' call
      var message = 'Check failed.';
      throw IllegalStateException_init_$Create$(toString(message));
    }
    return substringBefore(get(this, 0), _Char___init__impl__6a9atx(32));
  };
  protoOf(KtXmlReader).get_piData_i1pnws_k$ = function () {
    // Inline function 'kotlin.check' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.check' call
    // Inline function 'kotlin.contracts.contract' call
    if (!this.get_eventType_918hfv_k$().equals(EventType_PROCESSING_INSTRUCTION_getInstance())) {
      // Inline function 'kotlin.check.<anonymous>' call
      var message = 'Check failed.';
      throw IllegalStateException_init_$Create$(toString(message));
    }
    return substringAfter(get(this, 0), _Char___init__impl__6a9atx(32), '');
  };
  protoOf(KtXmlReader).isEmptyElementTag_rijrz3_k$ = function () {
    if (!equals(this._eventType_1, EventType_START_ELEMENT_getInstance())) {
      exception(this, 'Wrong event type');
    }
    return this.isSelfClosing_1;
  };
  protoOf(KtXmlReader).getAttributeNamespace_wj9j6l_k$ = function (index) {
    return ensureNotNull(_get_namespace__iwxsq2_0(this.attributes_1.get_2wmxux_k$(index), this));
  };
  protoOf(KtXmlReader).getAttributeLocalName_i25hjc_k$ = function (index) {
    return ensureNotNull(_get_localName__c3lhh_0(this.attributes_1.get_2wmxux_k$(index), this));
  };
  protoOf(KtXmlReader).getAttributePrefix_luun28_k$ = function (index) {
    return ensureNotNull(_get_prefix__wiwq7t_0(this.attributes_1.get_2wmxux_k$(index), this));
  };
  protoOf(KtXmlReader).getAttributeValue_qah2od_k$ = function (index) {
    return ensureNotNull(_get_value__a43j40(this.attributes_1.get_2wmxux_k$(index), this));
  };
  protoOf(KtXmlReader).getAttributeValue_8yb7e2_k$ = function (nsUri, localName) {
    var inductionVariable = 0;
    var last = this.attributes_1.size_1;
    if (inductionVariable < last)
      do {
        var attrIdx = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var attr = this.attributes_1.get_2wmxux_k$(attrIdx);
        if (_get_localName__c3lhh_0(attr, this) === localName ? nsUri == null ? true : _get_namespace__iwxsq2_0(attr, this) == nsUri : false) {
          return _get_value__a43j40(attr, this);
        }
      }
       while (inductionVariable < last);
    return null;
  };
  protoOf(KtXmlReader).next_20eer_k$ = function () {
    this.isWhitespace_1 = true;
    this.txtBufPos_1 = 0;
    this.token_1 = true;
    nextImpl(this);
    return this.get_eventType_918hfv_k$();
  };
  protoOf(KtXmlReader).hasNext_bitz1p_k$ = function () {
    return !equals(this._eventType_1, EventType_END_DOCUMENT_getInstance());
  };
  protoOf(KtXmlReader).nextTag_ujozaf_k$ = function () {
    $l$1: do {
      $l$0: do {
        this.next_20eer_k$();
      }
       while (false);
      var tmp;
      var tmp0_safe_receiver = this._eventType_1;
      if ((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_isIgnorable_uazyqu_k$()) === true) {
        tmp = true;
      } else {
        tmp = equals(this._eventType_1, EventType_TEXT_getInstance()) ? this.isWhitespace_1 : false;
      }
    }
     while (tmp);
    if (!equals(this._eventType_1, EventType_END_ELEMENT_getInstance()) ? !equals(this._eventType_1, EventType_START_ELEMENT_getInstance()) : false) {
      exception(this, 'unexpected type');
    }
    return this.get_eventType_918hfv_k$();
  };
  protoOf(KtXmlReader).require_glcost_k$ = function (type, namespace, name) {
    if ((!type.equals(this._eventType_1) ? true : !(namespace == null) ? !(namespace == _get_namespace__iwxsq2(this.elementStack_1.get_udoj0p_k$(this.get_depth_iq7qmy_k$() - 1 | 0), this)) : false) ? true : !(name == null) ? !(name == _get_localName__c3lhh(this.elementStack_1.get_udoj0p_k$(this.get_depth_iq7qmy_k$() - 1 | 0), this)) : false) {
      exception(this, 'expected: ' + type + ' {' + namespace + '}' + name + ', found: ' + this._eventType_1 + ' {' + this.get_namespaceURI_g6nmhy_k$() + '}' + this.get_localName_bf4zrn_k$());
    }
  };
  var EscapeMode_MINIMAL_instance;
  var EscapeMode_ATTRCONTENTQUOT_instance;
  var EscapeMode_ATTRCONTENTAPOS_instance;
  var EscapeMode_TEXTCONTENT_instance;
  var EscapeMode_DTD_instance;
  function values_1() {
    return [EscapeMode_MINIMAL_getInstance(), EscapeMode_ATTRCONTENTQUOT_getInstance(), EscapeMode_ATTRCONTENTAPOS_getInstance(), EscapeMode_TEXTCONTENT_getInstance(), EscapeMode_DTD_getInstance()];
  }
  function valueOf_1(value) {
    switch (value) {
      case 'MINIMAL':
        return EscapeMode_MINIMAL_getInstance();
      case 'ATTRCONTENTQUOT':
        return EscapeMode_ATTRCONTENTQUOT_getInstance();
      case 'ATTRCONTENTAPOS':
        return EscapeMode_ATTRCONTENTAPOS_getInstance();
      case 'TEXTCONTENT':
        return EscapeMode_TEXTCONTENT_getInstance();
      case 'DTD':
        return EscapeMode_DTD_getInstance();
      default:
        EscapeMode_initEntries();
        THROW_IAE('No enum constant value.');
        break;
    }
  }
  function get_entries_1() {
    if ($ENTRIES_1 == null)
      $ENTRIES_1 = enumEntries(values_1());
    return $ENTRIES_1;
  }
  var EscapeMode_entriesInitialized;
  function EscapeMode_initEntries() {
    if (EscapeMode_entriesInitialized)
      return Unit_getInstance();
    EscapeMode_entriesInitialized = true;
    EscapeMode_MINIMAL_instance = new EscapeMode('MINIMAL', 0);
    EscapeMode_ATTRCONTENTQUOT_instance = new EscapeMode('ATTRCONTENTQUOT', 1);
    EscapeMode_ATTRCONTENTAPOS_instance = new EscapeMode('ATTRCONTENTAPOS', 2);
    EscapeMode_TEXTCONTENT_instance = new EscapeMode('TEXTCONTENT', 3);
    EscapeMode_DTD_instance = new EscapeMode('DTD', 4);
  }
  var $ENTRIES_1;
  function _get_TAG_DEPTH_NOT_TAG__lom46c_0($this) {
    return $this.TAG_DEPTH_NOT_TAG_1;
  }
  function _get_TAG_DEPTH_FORCE_INDENT_NEXT__lyzvog_0($this) {
    return $this.TAG_DEPTH_FORCE_INDENT_NEXT_1;
  }
  var WriteState_BeforeDocument_instance;
  var WriteState_AfterXmlDecl_instance;
  var WriteState_AfterDocTypeDecl_instance;
  var WriteState_InTagContent_instance;
  var WriteState_Finished_instance;
  function values_2() {
    return [WriteState_BeforeDocument_getInstance(), WriteState_AfterXmlDecl_getInstance(), WriteState_AfterDocTypeDecl_getInstance(), WriteState_InTagContent_getInstance(), WriteState_Finished_getInstance()];
  }
  function valueOf_2(value) {
    switch (value) {
      case 'BeforeDocument':
        return WriteState_BeforeDocument_getInstance();
      case 'AfterXmlDecl':
        return WriteState_AfterXmlDecl_getInstance();
      case 'AfterDocTypeDecl':
        return WriteState_AfterDocTypeDecl_getInstance();
      case 'InTagContent':
        return WriteState_InTagContent_getInstance();
      case 'Finished':
        return WriteState_Finished_getInstance();
      default:
        WriteState_initEntries();
        THROW_IAE('No enum constant value.');
        break;
    }
  }
  function get_entries_2() {
    if ($ENTRIES_2 == null)
      $ENTRIES_2 = enumEntries(values_2());
    return $ENTRIES_2;
  }
  var WriteState_entriesInitialized;
  function WriteState_initEntries() {
    if (WriteState_entriesInitialized)
      return Unit_getInstance();
    WriteState_entriesInitialized = true;
    WriteState_BeforeDocument_instance = new WriteState('BeforeDocument', 0);
    WriteState_AfterXmlDecl_instance = new WriteState('AfterXmlDecl', 1);
    WriteState_AfterDocTypeDecl_instance = new WriteState('AfterDocTypeDecl', 2);
    WriteState_InTagContent_instance = new WriteState('InTagContent', 3);
    WriteState_Finished_instance = new WriteState('Finished', 4);
  }
  var $ENTRIES_2;
  function _get_writer__6q3d3c($this) {
    return $this.writer_1;
  }
  function _set_xmlVersion__mjs2yy($this, _set____db54di) {
    $this.xmlVersion_1 = _set____db54di;
  }
  function _set_isPartiallyOpenTag__cp8osr($this, _set____db54di) {
    $this.isPartiallyOpenTag_1 = _set____db54di;
  }
  function _get_isPartiallyOpenTag__l8mmbl($this) {
    return $this.isPartiallyOpenTag_1;
  }
  function _set_elementStack__z9vt3p_0($this, _set____db54di) {
    $this.elementStack_1 = _set____db54di;
  }
  function _get_elementStack__jq52jl_0($this) {
    return $this.elementStack_1;
  }
  function _set_state__ks53v8($this, _set____db54di) {
    $this.state_1 = _set____db54di;
  }
  function _get_state__b8zcm8($this) {
    return $this.state_1;
  }
  function _get_namespaceHolder__6tzxme_2($this) {
    return $this.namespaceHolder_1;
  }
  function _set_lastTagDepth__ry6p54_0($this, _set____db54di) {
    $this.lastTagDepth_1 = _set____db54di;
  }
  function _get_lastTagDepth__cefyl0_0($this) {
    return $this.lastTagDepth_1;
  }
  function namespaceAt($this, depth) {
    return ensureNotNull($this.elementStack_1[imul(depth, 3)]);
  }
  function setElementStack($this, depth, namespace, prefix, localName) {
    var esp = imul(depth, 3);
    if ($this.elementStack_1.length < (esp + 3 | 0)) {
      // Inline function 'kotlin.arrayOfNulls' call
      var size = $this.elementStack_1.length + 12 | 0;
      var hlp = fillArrayVal(Array(size), null);
      // Inline function 'kotlin.collections.copyInto' call
      var this_0 = $this.elementStack_1;
      var endIndex = esp;
      arrayCopy(this_0, hlp, 0, 0, endIndex);
      $this.elementStack_1 = hlp;
    }
    var tmp = $this.elementStack_1;
    var tmp0 = esp;
    esp = tmp0 + 1 | 0;
    tmp[tmp0] = namespace;
    var tmp_0 = $this.elementStack_1;
    var tmp1 = esp;
    esp = tmp1 + 1 | 0;
    tmp_0[tmp1] = prefix;
    $this.elementStack_1[esp] = localName;
  }
  function prefixAt($this, depth) {
    return ensureNotNull($this.elementStack_1[imul(depth, 3) + 1 | 0]);
  }
  function localNameAt($this, depth) {
    return ensureNotNull($this.elementStack_1[imul(depth, 3) + 2 | 0]);
  }
  function finishPartialStartTag($this, close) {
    if (!$this.isPartiallyOpenTag_1) {
      return Unit_getInstance();
    }
    $this.isPartiallyOpenTag_1 = false;
    var endOfTag = !close ? '>' : $this.addTrailingSpaceBeforeEnd_1 ? ' />' : '/>';
    $this.writer_1.append_jgojdo_k$(endOfTag);
  }
  function EscapeMode(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  function appendXmlCodepoint(_this__u8e3s4, $this, codepoint, mode) {
    var c = codepoint;
    var tmp;
    var tmp_0;
    var tmp_1;
    if ((codepoint === _UInt___init__impl__l7qpdl(9) ? true : codepoint === _UInt___init__impl__l7qpdl(10)) ? true : codepoint === _UInt___init__impl__l7qpdl(13)) {
      tmp_1 = true;
    } else {
      // Inline function 'kotlin.UInt.rangeTo' call
      var this_0 = _UInt___init__impl__l7qpdl(32);
      var other = _UInt___init__impl__l7qpdl(55295);
      var progression = new UIntRange(this_0, other);
      var containsLower = progression.get_first_eo0eb1_k$();
      tmp_1 = UInt__compareTo_impl_yacclj(codepoint, progression.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(codepoint, containsLower) : false;
    }
    if (tmp_1) {
      tmp_0 = true;
    } else {
      // Inline function 'kotlin.UInt.rangeTo' call
      var this_1 = _UInt___init__impl__l7qpdl(57344);
      var other_0 = _UInt___init__impl__l7qpdl(65533);
      var progression_0 = new UIntRange(this_1, other_0);
      var containsLower_0 = progression_0.get_first_eo0eb1_k$();
      tmp_0 = UInt__compareTo_impl_yacclj(codepoint, progression_0.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(codepoint, containsLower_0) : false;
    }
    if (tmp_0) {
      // Inline function 'kotlin.UInt.toUShort' call
      // Inline function 'kotlin.toUShort' call
      var this_2 = _UInt___get_data__impl__f0vqqw(codepoint);
      var tmp$ret$3 = _UShort___init__impl__jigrne(toShort(this_2));
      tmp = _Char___init__impl__6a9atx_0(tmp$ret$3);
    } else {
      tmp = _Char___init__impl__6a9atx_0(_UShort___init__impl__jigrne(0));
    }
    var ch = tmp;
    if (c === _UInt___init__impl__l7qpdl(0))
      throw IllegalArgumentException_init_$Create$('XML documents may not contain null strings directly or indirectly');
    else {
      if (ch === _Char___init__impl__6a9atx(38)) {
        _this__u8e3s4.append_jgojdo_k$('&amp;');
      } else {
        if (ch === _Char___init__impl__6a9atx(60) ? !mode.equals(EscapeMode_MINIMAL_getInstance()) : false) {
          _this__u8e3s4.append_jgojdo_k$('&lt;');
        } else {
          if (ch === _Char___init__impl__6a9atx(62) ? mode.equals(EscapeMode_TEXTCONTENT_getInstance()) : false) {
            _this__u8e3s4.append_jgojdo_k$('&gt;');
          } else {
            if (ch === _Char___init__impl__6a9atx(34) ? mode.equals(EscapeMode_ATTRCONTENTQUOT_getInstance()) : false) {
              _this__u8e3s4.append_jgojdo_k$('&quot;');
            } else {
              if (ch === _Char___init__impl__6a9atx(39) ? mode.equals(EscapeMode_ATTRCONTENTAPOS_getInstance()) : false) {
                _this__u8e3s4.append_jgojdo_k$('&apos;');
              } else {
                var tmp_2;
                var tmp_3;
                var tmp_4;
                // Inline function 'kotlin.UInt.rangeTo' call
                var this_3 = _UInt___init__impl__l7qpdl(1);
                var other_1 = _UInt___init__impl__l7qpdl(8);
                var progression_1 = new UIntRange(this_3, other_1);
                var containsLower_1 = progression_1.get_first_eo0eb1_k$();
                if (UInt__compareTo_impl_yacclj(c, progression_1.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(c, containsLower_1) : false) {
                  tmp_4 = true;
                } else {
                  tmp_4 = c === _UInt___init__impl__l7qpdl(11);
                }
                if (tmp_4) {
                  tmp_3 = true;
                } else {
                  tmp_3 = c === _UInt___init__impl__l7qpdl(12);
                }
                if (tmp_3) {
                  tmp_2 = true;
                } else {
                  // Inline function 'kotlin.UInt.rangeTo' call
                  var this_4 = _UInt___init__impl__l7qpdl(14);
                  var other_2 = _UInt___init__impl__l7qpdl(31);
                  var progression_2 = new UIntRange(this_4, other_2);
                  var containsLower_2 = progression_2.get_first_eo0eb1_k$();
                  tmp_2 = UInt__compareTo_impl_yacclj(c, progression_2.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(c, containsLower_2) : false;
                }
                if (tmp_2) {
                  var tmp0 = $this.xmlVersion_1.get_ordinal_ip24qg_k$();
                  if (tmp0 === 0) {
                    appendXmlCodepoint$throwInvalid($this, c);
                  } else if (tmp0 === 1) {
                    appendXmlCodepoint$appendNumCharRef(_this__u8e3s4, c);
                  }
                } else {
                  var tmp_5;
                  // Inline function 'kotlin.UInt.rangeTo' call
                  var this_5 = _UInt___init__impl__l7qpdl(127);
                  var other_3 = _UInt___init__impl__l7qpdl(132);
                  var progression_3 = new UIntRange(this_5, other_3);
                  var containsLower_3 = progression_3.get_first_eo0eb1_k$();
                  if (UInt__compareTo_impl_yacclj(c, progression_3.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(c, containsLower_3) : false) {
                    tmp_5 = true;
                  } else {
                    // Inline function 'kotlin.UInt.rangeTo' call
                    var this_6 = _UInt___init__impl__l7qpdl(134);
                    var other_4 = _UInt___init__impl__l7qpdl(159);
                    var progression_4 = new UIntRange(this_6, other_4);
                    var containsLower_4 = progression_4.get_first_eo0eb1_k$();
                    tmp_5 = UInt__compareTo_impl_yacclj(c, progression_4.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(c, containsLower_4) : false;
                  }
                  if (tmp_5) {
                    var tmp0_0 = $this.xmlVersion_1.get_ordinal_ip24qg_k$();
                    if (tmp0_0 === 0) {
                      _this__u8e3s4.append_am5a4z_k$(ch);
                    } else if (tmp0_0 === 1) {
                      appendXmlCodepoint$appendNumCharRef(_this__u8e3s4, c);
                    }
                  } else {
                    var tmp_6;
                    var tmp_7;
                    // Inline function 'kotlin.UInt.rangeTo' call
                    var this_7 = _UInt___init__impl__l7qpdl(55296);
                    var other_5 = _UInt___init__impl__l7qpdl(57343);
                    var progression_5 = new UIntRange(this_7, other_5);
                    var containsLower_5 = progression_5.get_first_eo0eb1_k$();
                    if (UInt__compareTo_impl_yacclj(c, progression_5.get_last_rpwfyd_k$()) <= 0 ? 0 <= UInt__compareTo_impl_yacclj(c, containsLower_5) : false) {
                      tmp_7 = true;
                    } else {
                      tmp_7 = c === _UInt___init__impl__l7qpdl(65534);
                    }
                    if (tmp_7) {
                      tmp_6 = true;
                    } else {
                      tmp_6 = c === _UInt___init__impl__l7qpdl(65535);
                    }
                    if (tmp_6) {
                      appendXmlCodepoint$throwInvalid($this, c);
                    } else {
                      // Inline function 'kotlin.UInt.compareTo' call
                      var other_6 = _UInt___init__impl__l7qpdl(65535);
                      if (uintCompare(_UInt___get_data__impl__f0vqqw(c), _UInt___get_data__impl__f0vqqw(other_6)) > 0) {
                        // Inline function 'kotlin.UInt.minus' call
                        var other_7 = _UInt___init__impl__l7qpdl(65536);
                        var down = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(c) - _UInt___get_data__impl__f0vqqw(other_7) | 0);
                        // Inline function 'kotlin.UInt.plus' call
                        // Inline function 'kotlin.UInt.shr' call
                        var this_8 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(down) >>> 10 | 0);
                        var other_8 = _UInt___init__impl__l7qpdl(55296);
                        var highSurogate = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_8) + _UInt___get_data__impl__f0vqqw(other_8) | 0);
                        // Inline function 'kotlin.UInt.plus' call
                        // Inline function 'kotlin.UInt.and' call
                        var other_9 = _UInt___init__impl__l7qpdl(1023);
                        var this_9 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(down) & _UInt___get_data__impl__f0vqqw(other_9));
                        var other_10 = _UInt___init__impl__l7qpdl(56320);
                        var lowSurogate = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_9) + _UInt___get_data__impl__f0vqqw(other_10) | 0);
                        // Inline function 'kotlin.UInt.toUShort' call
                        // Inline function 'kotlin.toUShort' call
                        var this_10 = _UInt___get_data__impl__f0vqqw(highSurogate);
                        var tmp$ret$16 = _UShort___init__impl__jigrne(toShort(this_10));
                        _this__u8e3s4.append_am5a4z_k$(_Char___init__impl__6a9atx_0(tmp$ret$16));
                        // Inline function 'kotlin.UInt.toUShort' call
                        // Inline function 'kotlin.toUShort' call
                        var this_11 = _UInt___get_data__impl__f0vqqw(lowSurogate);
                        var tmp$ret$18 = _UShort___init__impl__jigrne(toShort(this_11));
                        _this__u8e3s4.append_am5a4z_k$(_Char___init__impl__6a9atx_0(tmp$ret$18));
                      } else {
                        _this__u8e3s4.append_am5a4z_k$(ch);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  function writeEscapedText($this, s, mode) {
    var tmp0_iterator = asCodePoints(s).iterator_jk1svi_k$();
    loop: while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var c = tmp0_iterator.next_20eer_k$().data_1;
      appendXmlCodepoint($this.writer_1, $this, c, mode);
    }
  }
  function triggerStartDocument($this) {
    if ($this.state_1.get_ordinal_ip24qg_k$() === 0) {
      if (!$this.xmlDeclMode_1.equals(XmlDeclMode_None_getInstance())) {
        $this.startDocument_dbnt67_k$(null, null, null);
      }
      $this.state_1 = WriteState_AfterXmlDecl_getInstance();
    }
  }
  function writeIndent_0($this, newDepth) {
    var indentSeq = $this.get_indentSequence_chovoq_k$();
    var tmp;
    var tmp_0;
    if ($this.lastTagDepth_1 >= 0) {
      // Inline function 'kotlin.collections.isNotEmpty' call
      tmp_0 = !indentSeq.isEmpty_y1axqb_k$();
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = !($this.lastTagDepth_1 === $this.get_depth_iq7qmy_k$());
    } else {
      tmp = false;
    }
    if (tmp) {
      $this.ignorableWhitespace_7szqkg_k$('\n');
      try {
        $this.set_indentSequence_r8jc87_k$(emptyList());
        var merged = joinRepeated(indentSeq, $this.get_depth_iq7qmy_k$());
        // Inline function 'kotlin.collections.forEach' call
        var tmp0_iterator = merged.iterator_jk1svi_k$();
        while (tmp0_iterator.hasNext_bitz1p_k$()) {
          var element = tmp0_iterator.next_20eer_k$();
          // Inline function 'nl.adaptivity.xmlutil.core.KtXmlWriter.writeIndent.<anonymous>' call
          element.writeTo_3vocdz_k$($this);
        }
      }finally {
        $this.set_indentSequence_r8jc87_k$(indentSeq);
      }
    }
    $this.lastTagDepth_1 = newDepth;
  }
  function writeIndent$default_0($this, newDepth, $super) {
    newDepth = newDepth === VOID ? $this.get_depth_iq7qmy_k$() : newDepth;
    return writeIndent_0($this, newDepth);
  }
  function ensureNamespaceIfRepairing($this, namespace, prefix) {
    var tmp;
    var tmp_0;
    if ($this.isRepairNamespaces_1 ? !(namespace == null) : false) {
      // Inline function 'kotlin.text.isNotEmpty' call
      tmp_0 = charSequenceLength(namespace) > 0;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = !(prefix == null);
    } else {
      tmp = false;
    }
    if (tmp) {
      if (!($this.namespaceHolder_1.getNamespaceUri_83evzq_k$(prefix) == namespace)) {
        $this.namespaceAttr_vkifxg_k$(prefix, namespace);
      }
    }
  }
  function rawWriteAttribute($this, prefix, localName, value) {
    $this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(32));
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(prefix) > 0) {
      $this.writer_1.append_jgojdo_k$(prefix).append_am5a4z_k$(_Char___init__impl__6a9atx(58));
    }
    $this.writer_1.append_jgojdo_k$(localName).append_am5a4z_k$(_Char___init__impl__6a9atx(61));
    var tmp1_container = indexOf(value, _Char___init__impl__6a9atx(34)) === -1 ? new Pair(new Char(_Char___init__impl__6a9atx(34)), EscapeMode_ATTRCONTENTQUOT_getInstance()) : new Pair(new Char(_Char___init__impl__6a9atx(39)), EscapeMode_ATTRCONTENTAPOS_getInstance());
    var q = tmp1_container.component1_7eebsc_k$().value_1;
    var mode = tmp1_container.component2_7eebsb_k$();
    $this.writer_1.append_am5a4z_k$(q);
    writeEscapedText($this, value, mode);
    $this.writer_1.append_am5a4z_k$(q);
  }
  function Companion_5() {
    Companion_instance_5 = this;
    this.TAG_DEPTH_NOT_TAG_1 = -1;
    this.TAG_DEPTH_FORCE_INDENT_NEXT_1 = 2147483647;
  }
  var Companion_instance_5;
  function Companion_getInstance_6() {
    if (Companion_instance_5 == null)
      new Companion_5();
    return Companion_instance_5;
  }
  function WriteState(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  function appendXmlCodepoint$appendNumCharRef($this_appendXmlCodepoint, code) {
    $this_appendXmlCodepoint.append_jgojdo_k$('&#x').append_jgojdo_k$(toString_1(code, 16)).append_am5a4z_k$(_Char___init__impl__6a9atx(59));
  }
  function appendXmlCodepoint$throwInvalid(this$0, code) {
    throw IllegalArgumentException_init_$Create$('In xml ' + this$0.xmlVersion_1.get_versionString_blgteo_k$() + ' the character 0x' + toString_1(code, 16) + ' is not valid');
  }
  function EscapeMode_MINIMAL_getInstance() {
    EscapeMode_initEntries();
    return EscapeMode_MINIMAL_instance;
  }
  function EscapeMode_ATTRCONTENTQUOT_getInstance() {
    EscapeMode_initEntries();
    return EscapeMode_ATTRCONTENTQUOT_instance;
  }
  function EscapeMode_ATTRCONTENTAPOS_getInstance() {
    EscapeMode_initEntries();
    return EscapeMode_ATTRCONTENTAPOS_instance;
  }
  function EscapeMode_TEXTCONTENT_getInstance() {
    EscapeMode_initEntries();
    return EscapeMode_TEXTCONTENT_instance;
  }
  function EscapeMode_DTD_getInstance() {
    EscapeMode_initEntries();
    return EscapeMode_DTD_instance;
  }
  function WriteState_BeforeDocument_getInstance() {
    WriteState_initEntries();
    return WriteState_BeforeDocument_instance;
  }
  function WriteState_AfterXmlDecl_getInstance() {
    WriteState_initEntries();
    return WriteState_AfterXmlDecl_instance;
  }
  function WriteState_AfterDocTypeDecl_getInstance() {
    WriteState_initEntries();
    return WriteState_AfterDocTypeDecl_instance;
  }
  function WriteState_InTagContent_getInstance() {
    WriteState_initEntries();
    return WriteState_InTagContent_instance;
  }
  function WriteState_Finished_getInstance() {
    WriteState_initEntries();
    return WriteState_Finished_instance;
  }
  function KtXmlWriter(writer, isRepairNamespaces, xmlDeclMode, xmlVersion) {
    Companion_getInstance_6();
    isRepairNamespaces = isRepairNamespaces === VOID ? true : isRepairNamespaces;
    xmlDeclMode = xmlDeclMode === VOID ? XmlDeclMode_None_getInstance() : xmlDeclMode;
    xmlVersion = xmlVersion === VOID ? XmlVersion_XML11_getInstance() : xmlVersion;
    PlatformXmlWriterBase.call(this);
    this.writer_1 = writer;
    this.isRepairNamespaces_1 = isRepairNamespaces;
    this.xmlDeclMode_1 = xmlDeclMode;
    this.xmlVersion_1 = xmlVersion;
    this.addTrailingSpaceBeforeEnd_1 = true;
    this.isPartiallyOpenTag_1 = false;
    var tmp = this;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp.elementStack_1 = fillArrayVal(Array(12), null);
    this.state_1 = WriteState_BeforeDocument_getInstance();
    this.namespaceHolder_1 = new NamespaceHolder();
    this.lastTagDepth_1 = -1;
  }
  protoOf(KtXmlWriter).get_isRepairNamespaces_6ezs1k_k$ = function () {
    return this.isRepairNamespaces_1;
  };
  protoOf(KtXmlWriter).get_xmlDeclMode_lc8ced_k$ = function () {
    return this.xmlDeclMode_1;
  };
  protoOf(KtXmlWriter).get_xmlVersion_oyodyu_k$ = function () {
    return this.xmlVersion_1;
  };
  protoOf(KtXmlWriter).set_addTrailingSpaceBeforeEnd_348wan_k$ = function (_set____db54di) {
    this.addTrailingSpaceBeforeEnd_1 = _set____db54di;
  };
  protoOf(KtXmlWriter).get_addTrailingSpaceBeforeEnd_is7i8a_k$ = function () {
    return this.addTrailingSpaceBeforeEnd_1;
  };
  protoOf(KtXmlWriter).get_namespaceContext_n7n1ib_k$ = function () {
    return this.namespaceHolder_1.get_namespaceContext_n7n1ib_k$();
  };
  protoOf(KtXmlWriter).get_depth_iq7qmy_k$ = function () {
    return this.namespaceHolder_1.get_depth_iq7qmy_k$();
  };
  protoOf(KtXmlWriter).flush_shahbo_k$ = function () {
    finishPartialStartTag(this, false);
  };
  protoOf(KtXmlWriter).startDocument_dbnt67_k$ = function (version, encoding, standalone) {
    writeIndent_0(this, 2147483647);
    if (!this.state_1.equals(WriteState_BeforeDocument_getInstance())) {
      throw XmlException_init_$Create$_0('Attempting to write start document after document already started');
    }
    this.state_1 = WriteState_AfterXmlDecl_getInstance();
    var tmp;
    switch (version) {
      case null:
        tmp = this.xmlVersion_1.get_versionString_blgteo_k$();
        break;
      case '1':
      case '1.0':
        this.xmlVersion_1 = XmlVersion_XML10_getInstance();
        tmp = version;
        break;
      default:
        this.xmlVersion_1 = XmlVersion_XML11_getInstance();
        tmp = version;
        break;
    }
    var verString = tmp;
    this.writer_1.append_jgojdo_k$("<?xml version='" + verString + "'");
    var effectiveEncoding = encoding == null ? 'UTF-8' : encoding;
    if (!this.xmlDeclMode_1.equals(XmlDeclMode_Minimal_getInstance()) ? true : !(encoding == null)) {
      this.writer_1.append_jgojdo_k$(" encoding='");
      writeEscapedText(this, effectiveEncoding, EscapeMode_ATTRCONTENTAPOS_getInstance());
      this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(39));
      if (!(standalone == null)) {
        this.writer_1.append_jgojdo_k$(" standalone='");
        this.writer_1.append_jgojdo_k$(standalone ? 'yes' : 'no');
        this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(39));
      }
    }
    if (this.addTrailingSpaceBeforeEnd_1) {
      this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(32));
    }
    this.writer_1.append_jgojdo_k$('?>');
  };
  protoOf(KtXmlWriter).docdecl_aom8aw_k$ = function (text) {
    writeIndent_0(this, 2147483647);
    triggerStartDocument(this);
    if (!this.state_1.equals(WriteState_AfterXmlDecl_getInstance())) {
      throw XmlException_init_$Create$_0('Writing a DTD is only allowed once, in the prolog');
    }
    this.state_1 = WriteState_AfterDocTypeDecl_getInstance();
    var tmp = this.writer_1.append_jgojdo_k$('<!DOCTYPE ');
    // Inline function 'kotlin.text.trimStart' call
    var tmp$ret$0 = toString(trimStart(isCharSequence(text) ? text : THROW_CCE()));
    tmp.append_jgojdo_k$(tmp$ret$0).append_jgojdo_k$('>');
  };
  protoOf(KtXmlWriter).processingInstruction_2btz8x_k$ = function (text) {
    finishPartialStartTag(this, false);
    writeIndent_0(this, 2147483647);
    triggerStartDocument(this);
    this.writer_1.append_jgojdo_k$('<?');
    this.writer_1.append_jgojdo_k$(text);
    this.writer_1.append_jgojdo_k$('?>');
  };
  protoOf(KtXmlWriter).processingInstruction_tweoff_k$ = function (target, data) {
    finishPartialStartTag(this, false);
    writeIndent_0(this, 2147483647);
    triggerStartDocument(this);
    this.writer_1.append_jgojdo_k$('<?');
    this.writer_1.append_jgojdo_k$(target);
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(data) > 0) {
      this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(32)).append_jgojdo_k$(data);
    }
    this.writer_1.append_jgojdo_k$('?>');
  };
  protoOf(KtXmlWriter).startTag_pjuzbi_k$ = function (namespace, localName, prefix) {
    finishPartialStartTag(this, false);
    writeIndent$default_0(this);
    triggerStartDocument(this);
    if (this.state_1.equals(WriteState_Finished_getInstance())) {
      throw XmlException_init_$Create$_0('Attempting to write tag after the document finished');
    }
    this.state_1 = WriteState_InTagContent_getInstance();
    var tmp;
    if (namespace === '') {
      tmp = '';
    } else {
      var reg = this.getPrefix_r4en0f_k$(namespace);
      tmp = !(reg == null) ? reg : prefix == null ? this.namespaceHolder_1.nextAutoPrefix_ts9tvw_k$() : prefix;
    }
    var appliedPrefix = tmp;
    var tmp_0 = this.get_depth_iq7qmy_k$();
    setElementStack(this, tmp_0, namespace == null ? '' : namespace, appliedPrefix, localName);
    this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(60));
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(appliedPrefix) > 0) {
      this.writer_1.append_jgojdo_k$(appliedPrefix);
      this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(58));
    }
    this.writer_1.append_jgojdo_k$(localName);
    this.isPartiallyOpenTag_1 = true;
    this.namespaceHolder_1.incDepth_t2y8xh_k$();
    ensureNamespaceIfRepairing(this, namespace, appliedPrefix);
  };
  protoOf(KtXmlWriter).endTag_yzukbv_k$ = function (namespace, localName, prefix) {
    this.namespaceHolder_1.decDepth_8l9b73_k$();
    writeIndent_0(this, 2147483647);
    var tmp;
    if (!((namespace == null ? '' : namespace) === namespaceAt(this, this.get_depth_iq7qmy_k$()))) {
      tmp = true;
    } else {
      tmp = !(localNameAt(this, this.get_depth_iq7qmy_k$()) === localName);
    }
    if (tmp) {
      throw IllegalArgumentException_init_$Create$('<\/{' + namespace + '}' + localName + '> does not match start');
    }
    if (this.isPartiallyOpenTag_1) {
      finishPartialStartTag(this, true);
    } else {
      this.writer_1.append_jgojdo_k$('<\/');
      var actualPrefix = prefixAt(this, this.get_depth_iq7qmy_k$());
      // Inline function 'kotlin.text.isNotEmpty' call
      if (charSequenceLength(actualPrefix) > 0) {
        this.writer_1.append_jgojdo_k$(actualPrefix);
        this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(58));
      }
      this.writer_1.append_jgojdo_k$(localName);
      this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(62));
    }
  };
  protoOf(KtXmlWriter).comment_dbctn9_k$ = function (text) {
    finishPartialStartTag(this, false);
    writeIndent_0(this, 2147483647);
    triggerStartDocument(this);
    var lastWasHyphen = false;
    this.writer_1.append_jgojdo_k$('<!--');
    var tmp0_iterator = asCodePoints(text).iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var cp = tmp0_iterator.next_20eer_k$().data_1;
      // Inline function 'kotlin.toUInt' call
      // Inline function 'kotlin.code' call
      var this_0 = _Char___init__impl__6a9atx(45);
      var this_1 = Char__toInt_impl_vasixd(this_0);
      if (cp === _UInt___init__impl__l7qpdl(this_1)) {
        if (lastWasHyphen) {
          lastWasHyphen = false;
          this.writer_1.append_jgojdo_k$('&#x2d;');
        } else {
          lastWasHyphen = true;
          this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(45));
        }
      } else {
        appendXmlCodepoint(this.writer_1, this, cp, EscapeMode_MINIMAL_getInstance());
      }
    }
    this.writer_1.append_jgojdo_k$('-->');
  };
  protoOf(KtXmlWriter).text_x72pul_k$ = function (text) {
    finishPartialStartTag(this, false);
    writeEscapedText(this, text, EscapeMode_TEXTCONTENT_getInstance());
    this.lastTagDepth_1 = -1;
  };
  protoOf(KtXmlWriter).cdsect_yhnzeu_k$ = function (text) {
    finishPartialStartTag(this, false);
    var endPos = 0;
    this.writer_1.append_jgojdo_k$('<![CDATA[');
    var tmp0_iterator = asCodePoints(text).iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var cp = tmp0_iterator.next_20eer_k$().data_1;
      var tmp;
      // Inline function 'kotlin.UInt.compareTo' call
      var other = _UInt___init__impl__l7qpdl(32223);
      if (uintCompare(_UInt___get_data__impl__f0vqqw(cp), _UInt___get_data__impl__f0vqqw(other)) < 0) {
        // Inline function 'kotlin.UInt.toUShort' call
        // Inline function 'kotlin.toUShort' call
        var this_0 = _UInt___get_data__impl__f0vqqw(cp);
        var tmp$ret$2 = _UShort___init__impl__jigrne(toShort(this_0));
        tmp = _Char___init__impl__6a9atx_0(tmp$ret$2);
      } else {
        tmp = _Char___init__impl__6a9atx_0(_UShort___init__impl__jigrne(0));
      }
      var ch = tmp;
      if (ch === _Char___init__impl__6a9atx(93) ? endPos === 0 ? true : endPos === 1 : false) {
        endPos = endPos + 1 | 0;
        this.writer_1.append_am5a4z_k$(ch);
      } else if (ch === _Char___init__impl__6a9atx(62) ? endPos === 2 : false) {
        this.writer_1.append_jgojdo_k$('&gt;');
      } else if (ch === _Char___init__impl__6a9atx(93) ? endPos === 2 : false) {
        this.writer_1.append_am5a4z_k$(ch);
      } else {
        endPos = 0;
        appendXmlCodepoint(this.writer_1, this, cp, EscapeMode_MINIMAL_getInstance());
      }
    }
    this.writer_1.append_jgojdo_k$(']]>');
    this.lastTagDepth_1 = -1;
  };
  protoOf(KtXmlWriter).entityRef_cqd3i2_k$ = function (text) {
    finishPartialStartTag(this, false);
    this.writer_1.append_am5a4z_k$(_Char___init__impl__6a9atx(38)).append_jgojdo_k$(text).append_am5a4z_k$(_Char___init__impl__6a9atx(59));
    this.lastTagDepth_1 = -1;
  };
  protoOf(KtXmlWriter).ignorableWhitespace_7szqkg_k$ = function (text) {
    finishPartialStartTag(this, false);
    triggerStartDocument(this);
    var inductionVariable = 0;
    var last = text.length;
    while (inductionVariable < last) {
      var c = charSequenceGet(text, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      if (!(((c === _Char___init__impl__6a9atx(10) ? true : c === _Char___init__impl__6a9atx(13)) ? true : c === _Char___init__impl__6a9atx(9)) ? true : c === _Char___init__impl__6a9atx(32))) {
        throw IllegalArgumentException_init_$Create$('"' + text + '" is not ignorable whitespace');
      }
    }
    this.writer_1.append_jgojdo_k$(text);
    this.lastTagDepth_1 = -1;
  };
  protoOf(KtXmlWriter).attribute_ruzjv8_k$ = function (namespace, name, prefix, value) {
    if (namespace === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$()) {
      this.namespaceAttr_vkifxg_k$(name, value);
      return Unit_getInstance();
    } else {
      var tmp;
      // Inline function 'kotlin.text.isNullOrEmpty' call
      // Inline function 'kotlin.contracts.contract' call
      if (namespace == null ? true : charSequenceLength(namespace) === 0) {
        tmp = XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$() === name;
      } else {
        tmp = false;
      }
      if (tmp) {
        this.namespaceAttr_vkifxg_k$('', value);
        return Unit_getInstance();
      }
    }
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if (!(prefix == null)) {
      // Inline function 'kotlin.text.isNotEmpty' call
      tmp_2 = charSequenceLength(prefix) > 0;
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      tmp_1 = !(namespace == null);
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      // Inline function 'kotlin.text.isNotEmpty' call
      tmp_0 = charSequenceLength(namespace) > 0;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      this.setPrefix_e36xz8_k$(prefix, namespace);
      ensureNamespaceIfRepairing(this, namespace, prefix);
    }
    if (!this.isPartiallyOpenTag_1) {
      throw IllegalStateException_init_$Create$('illegal position for attribute');
    }
    var tmp_3;
    // Inline function 'kotlin.text.isNullOrEmpty' call
    // Inline function 'kotlin.contracts.contract' call
    if (!(prefix == null ? true : charSequenceLength(prefix) === 0)) {
      var tmp_4;
      if (!(this.getNamespaceUri_buhtgt_k$(prefix) == namespace)) {
        tmp_4 = this.getPrefix_r4en0f_k$(namespace);
      } else {
        tmp_4 = prefix;
      }
      tmp_3 = tmp_4;
    } else {
      tmp_3 = prefix;
    }
    var tmp0_elvis_lhs = tmp_3;
    var actualPrefix = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
    rawWriteAttribute(this, actualPrefix, name, value);
  };
  protoOf(KtXmlWriter).namespaceAttr_vkifxg_k$ = function (namespacePrefix, namespaceUri) {
    var existingNamespaceForPrefix = this.namespaceHolder_1.namespaceAtCurrentDepth_gfs28u_k$(namespacePrefix);
    if (!(existingNamespaceForPrefix == null)) {
      if (this.isRepairNamespaces_1)
        return Unit_getInstance();
      else if (!(existingNamespaceForPrefix === namespaceUri))
        throw IllegalStateException_init_$Create$('Attempting to set prefix to different values in the same tag');
      else
        throw IllegalStateException_init_$Create$('Namespace attribute duplicated');
    }
    this.namespaceHolder_1.addPrefixToContext_gkzdgb_k$(namespacePrefix, namespaceUri);
    if (!this.isPartiallyOpenTag_1) {
      throw IllegalStateException_init_$Create$('illegal position for attribute');
    }
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(namespacePrefix) > 0) {
      rawWriteAttribute(this, XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$(), namespacePrefix, namespaceUri);
    } else {
      rawWriteAttribute(this, '', XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$(), namespaceUri);
    }
  };
  protoOf(KtXmlWriter).endDocument_lstnba_k$ = function () {
    assert_0(this.get_depth_iq7qmy_k$() === 0);
    if (!this.state_1.equals(WriteState_InTagContent_getInstance())) {
      throw XmlException_init_$Create$_0('Attempting to end document when in invalid state: ' + this.state_1);
    }
    while (this.get_depth_iq7qmy_k$() > 0) {
      this.endTag_yzukbv_k$(namespaceAt(this, this.get_depth_iq7qmy_k$() - 1 | 0), prefixAt(this, this.get_depth_iq7qmy_k$() - 1 | 0), localNameAt(this, this.get_depth_iq7qmy_k$() - 1 | 0));
    }
    this.flush_shahbo_k$();
  };
  protoOf(KtXmlWriter).setPrefix_e36xz8_k$ = function (prefix, namespaceUri) {
    if (!(namespaceUri === this.getNamespaceUri_buhtgt_k$(prefix))) {
      this.namespaceHolder_1.addPrefixToContext_gkzdgb_k$(prefix, namespaceUri);
    }
  };
  protoOf(KtXmlWriter).getNamespaceUri_buhtgt_k$ = function (prefix) {
    return this.namespaceHolder_1.getNamespaceUri_83evzq_k$(prefix);
  };
  protoOf(KtXmlWriter).getPrefix_r4en0f_k$ = function (namespaceUri) {
    var tmp;
    if (namespaceUri == null) {
      tmp = null;
    } else {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.core.KtXmlWriter.getPrefix.<anonymous>' call
      tmp = this.namespaceHolder_1.getPrefix_2nmkkr_k$(namespaceUri);
    }
    return tmp;
  };
  protoOf(KtXmlWriter).close_yn9xrc_k$ = function () {
    this.namespaceHolder_1.clear_j9egeb_k$();
  };
  function asCodePoints(_this__u8e3s4) {
    return new asCodePoints$1(_this__u8e3s4);
  }
  function joinRepeated(_this__u8e3s4, repeats) {
    var it = _this__u8e3s4.iterator_jk1svi_k$();
    if (!it.hasNext_bitz1p_k$())
      return emptyList();
    // Inline function 'kotlin.collections.mutableListOf' call
    var result = ArrayList_init_$Create$();
    var pending = null;
    var inductionVariable = 0;
    if (inductionVariable < repeats)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var tmp1_iterator = _this__u8e3s4.iterator_jk1svi_k$();
        while (tmp1_iterator.hasNext_bitz1p_k$()) {
          var ev = tmp1_iterator.next_20eer_k$();
          if (pending == null) {
            pending = ev;
          } else if (pending.get_eventType_918hfv_k$().equals(EventType_COMMENT_getInstance()) ? true : !pending.get_eventType_918hfv_k$().equals(ev.get_eventType_918hfv_k$())) {
            result.add_utx5q5_k$(pending);
            pending = ev;
          } else if (ev.get_eventType_918hfv_k$().equals(pending.get_eventType_918hfv_k$())) {
            pending = new TextEvent(null, pending.get_eventType_918hfv_k$(), pending.get_text_wouvsm_k$() + ev.get_text_wouvsm_k$());
          }
        }
      }
       while (inductionVariable < repeats);
    if (!(pending == null)) {
      result.add_utx5q5_k$(pending);
    }
    return result;
  }
  function _set_nextPos__davg3o($this, _set____db54di) {
    $this.nextPos_1 = _set____db54di;
  }
  function _get_nextPos__cbcu9c($this) {
    return $this.nextPos_1;
  }
  function asCodePoints$1$iterator$1($this_asCodePoints) {
    this.$this_asCodePoints_1 = $this_asCodePoints;
    this.nextPos_1 = 0;
  }
  protoOf(asCodePoints$1$iterator$1).hasNext_bitz1p_k$ = function () {
    return this.nextPos_1 < charSequenceLength(this.$this_asCodePoints_1);
  };
  protoOf(asCodePoints$1$iterator$1).next_30mexz_k$ = function () {
    var tmp;
    if (isHighSurrogate(charSequenceGet(this.$this_asCodePoints_1, this.nextPos_1)) === true) {
      // Inline function 'kotlin.UInt.plus' call
      // Inline function 'kotlin.UInt.plus' call
      var this_0 = _UInt___init__impl__l7qpdl(65536);
      // Inline function 'kotlin.UInt.shl' call
      // Inline function 'kotlin.UInt.minus' call
      // Inline function 'kotlin.toUInt' call
      // Inline function 'kotlin.code' call
      var this_1 = charSequenceGet(this.$this_asCodePoints_1, this.nextPos_1);
      var this_2 = Char__toInt_impl_vasixd(this_1);
      var this_3 = _UInt___init__impl__l7qpdl(this_2);
      var other = _UInt___init__impl__l7qpdl(55296);
      var this_4 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_3) - _UInt___get_data__impl__f0vqqw(other) | 0);
      var other_0 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_4) << 10);
      var this_5 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_0) + _UInt___get_data__impl__f0vqqw(other_0) | 0);
      // Inline function 'kotlin.UInt.minus' call
      // Inline function 'kotlin.toUInt' call
      // Inline function 'kotlin.code' call
      var this_6 = charSequenceGet(this.$this_asCodePoints_1, this.nextPos_1 + 1 | 0);
      var this_7 = Char__toInt_impl_vasixd(this_6);
      var this_8 = _UInt___init__impl__l7qpdl(this_7);
      var other_1 = _UInt___init__impl__l7qpdl(56320);
      var other_2 = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_8) - _UInt___get_data__impl__f0vqqw(other_1) | 0);
      var codePoint = _UInt___init__impl__l7qpdl(_UInt___get_data__impl__f0vqqw(this_5) + _UInt___get_data__impl__f0vqqw(other_2) | 0);
      this.nextPos_1 = this.nextPos_1 + 2 | 0;
      tmp = codePoint;
    } else {
      // Inline function 'kotlin.also' call
      // Inline function 'kotlin.toUInt' call
      // Inline function 'kotlin.code' call
      var this_9 = charSequenceGet(this.$this_asCodePoints_1, this.nextPos_1);
      var this_10 = Char__toInt_impl_vasixd(this_9);
      var tmp$ret$10 = _UInt___init__impl__l7qpdl(this_10);
      var this_11 = new UInt(tmp$ret$10);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.core.<no name provided>.next.<anonymous>' call
      this_11.data_1;
      this.nextPos_1 = this.nextPos_1 + 1 | 0;
      tmp = this_11.data_1;
    }
    return tmp;
  };
  protoOf(asCodePoints$1$iterator$1).next_20eer_k$ = function () {
    return new UInt(this.next_30mexz_k$());
  };
  function asCodePoints$1($this_asCodePoints) {
    this.$this_asCodePoints_1 = $this_asCodePoints;
  }
  protoOf(asCodePoints$1).iterator_jk1svi_k$ = function () {
    return new asCodePoints$1$iterator$1(this.$this_asCodePoints_1);
  };
  var XmlVersion_XML10_instance;
  var XmlVersion_XML11_instance;
  function values_3() {
    return [XmlVersion_XML10_getInstance(), XmlVersion_XML11_getInstance()];
  }
  function valueOf_3(value) {
    switch (value) {
      case 'XML10':
        return XmlVersion_XML10_getInstance();
      case 'XML11':
        return XmlVersion_XML11_getInstance();
      default:
        XmlVersion_initEntries();
        THROW_IAE('No enum constant value.');
        break;
    }
  }
  function get_entries_3() {
    if ($ENTRIES_3 == null)
      $ENTRIES_3 = enumEntries(values_3());
    return $ENTRIES_3;
  }
  var XmlVersion_entriesInitialized;
  function XmlVersion_initEntries() {
    if (XmlVersion_entriesInitialized)
      return Unit_getInstance();
    XmlVersion_entriesInitialized = true;
    XmlVersion_XML10_instance = new XmlVersion('XML10', 0, '1.0');
    XmlVersion_XML11_instance = new XmlVersion('XML11', 1, '1.1');
  }
  var $ENTRIES_3;
  function XmlVersion(name, ordinal, versionString) {
    Enum.call(this, name, ordinal);
    this.versionString_1 = versionString;
  }
  protoOf(XmlVersion).get_versionString_blgteo_k$ = function () {
    return this.versionString_1;
  };
  function XmlVersion_XML10_getInstance() {
    XmlVersion_initEntries();
    return XmlVersion_XML10_instance;
  }
  function XmlVersion_XML11_getInstance() {
    XmlVersion_initEntries();
    return XmlVersion_XML11_instance;
  }
  function NamespaceHolder$namespaceContext$o$getPrefixesCompat$lambda(this$0, $namespaceURI) {
    return function (it) {
      return getNamespace(this$0, it) === $namespaceURI;
    };
  }
  function NamespaceHolder$namespaceContext$o$getPrefixesCompat$lambda_0(this$0) {
    return function (it) {
      return getPrefix(this$0, it);
    };
  }
  function _set_idx__4w7ld4($this, _set____db54di) {
    $this.idx_1 = _set____db54di;
  }
  function _get_idx__e6a6ic($this) {
    return $this.idx_1;
  }
  function _set_nextAutoPrefixNo__50yhpe($this, _set____db54di) {
    $this.nextAutoPrefixNo_1 = _set____db54di;
  }
  function _get_nextAutoPrefixNo__y42qs6($this) {
    return $this.nextAutoPrefixNo_1;
  }
  function _set_nameSpaces__oh4min($this, _set____db54di) {
    $this.nameSpaces_1 = _set____db54di;
  }
  function _get_nameSpaces__9ew1df($this) {
    return $this.nameSpaces_1;
  }
  function _set_namespaceCounts__j5gnx6($this, _set____db54di) {
    $this.namespaceCounts_1 = _set____db54di;
  }
  function _get_namespaceCounts__91qgem($this) {
    return $this.namespaceCounts_1;
  }
  function _set_depth__dghfxe_1($this, _set____db54di) {
    $this.depth_1 = _set____db54di;
  }
  function namespaceIndicesAt($this, depth) {
    var startIdx = depth === 0 ? 0 : arrayUseAtDepth($this, depth - 1 | 0) / 2 | 0;
    var endIdx = arrayUseAtDepth($this, depth) / 2 | 0;
    return until(startIdx, endIdx);
  }
  function arrayUseAtDepth($this, depth) {
    return imul($this.namespaceCounts_1[depth], 2);
  }
  function prefixArrayPos($this, pairPos) {
    return imul(pairPos, 2);
  }
  function nsArrayPos($this, pairPos) {
    return imul(pairPos, 2) + 1 | 0;
  }
  function setPrefix_0($this, pos, value) {
    var tmp = $this.nameSpaces_1;
    var tmp_0 = prefixArrayPos($this, pos);
    var tmp1_elvis_lhs = value == null ? null : toString(value);
    tmp[tmp_0] = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
  }
  function getPrefix($this, pos) {
    return ensureNotNull($this.nameSpaces_1[prefixArrayPos($this, pos)]);
  }
  function setNamespace($this, pos, value) {
    var tmp = $this.nameSpaces_1;
    var tmp_0 = nsArrayPos($this, pos);
    var tmp1_elvis_lhs = value == null ? null : toString(value);
    tmp[tmp_0] = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
  }
  function getNamespace($this, pos) {
    return ensureNotNull($this.nameSpaces_1[nsArrayPos($this, pos)]);
  }
  function enlargeNamespaceBuffer($this) {
    $this.nameSpaces_1 = copyOf_0($this.nameSpaces_1, imul($this.nameSpaces_1.length, 2));
  }
  function NamespaceHolder$namespaceContext$1(this$0) {
    this.this$0__1 = this$0;
  }
  protoOf(NamespaceHolder$namespaceContext$1).getNamespaceURI_859c43_k$ = function (prefix) {
    return this.this$0__1.getNamespaceUri_83evzq_k$(prefix);
  };
  protoOf(NamespaceHolder$namespaceContext$1).getPrefix_7o0aoe_k$ = function (namespaceURI) {
    return this.this$0__1.getPrefix_2nmkkr_k$(namespaceURI);
  };
  protoOf(NamespaceHolder$namespaceContext$1).freeze_kxzejt_k$ = function () {
    return SimpleNamespaceContext_init_$Create$_4(this.this$0__1);
  };
  protoOf(NamespaceHolder$namespaceContext$1).iterator_jk1svi_k$ = function () {
    return this.this$0__1.iterator_jk1svi_k$();
  };
  protoOf(NamespaceHolder$namespaceContext$1).getPrefixesCompat_d6ifqa_k$ = function (namespaceURI) {
    var tmp = asSequence_0(downTo(this.this$0__1.get_totalNamespaceCount_iuvl2n_k$() - 1 | 0, 0));
    var tmp_0 = filter(tmp, NamespaceHolder$namespaceContext$o$getPrefixesCompat$lambda(this.this$0__1, namespaceURI));
    return map(tmp_0, NamespaceHolder$namespaceContext$o$getPrefixesCompat$lambda_0(this.this$0__1)).iterator_jk1svi_k$();
  };
  function NamespaceHolder$iterator$1(this$0) {
    this.this$0__1 = this$0;
    this.idx_1 = 0;
  }
  protoOf(NamespaceHolder$iterator$1).hasNext_bitz1p_k$ = function () {
    return this.idx_1 < this.this$0__1.namespaceCounts_1[this.this$0__1.depth_1];
  };
  protoOf(NamespaceHolder$iterator$1).next_20eer_k$ = function () {
    // Inline function 'kotlin.also' call
    var this_0 = new NamespaceImpl(getPrefix(this.this$0__1, this.idx_1), getNamespace(this.this$0__1, this.idx_1));
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.core.impl.<no name provided>.next.<anonymous>' call
    this.idx_1 = this.idx_1 + 1 | 0;
    return this_0;
  };
  function NamespaceHolder() {
    this.nextAutoPrefixNo_1 = 1;
    var tmp = this;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp.nameSpaces_1 = fillArrayVal(Array(10), null);
    this.namespaceCounts_1 = new Int32Array(20);
    this.depth_1 = 0;
    var tmp_0 = this;
    tmp_0.namespaceContext_1 = new NamespaceHolder$namespaceContext$1(this);
  }
  protoOf(NamespaceHolder).get_depth_iq7qmy_k$ = function () {
    return this.depth_1;
  };
  protoOf(NamespaceHolder).get_namespacesAtCurrentDepth_6mysci_k$ = function () {
    // Inline function 'kotlin.collections.map' call
    var this_0 = namespaceIndicesAt(this, this.depth_1);
    // Inline function 'kotlin.collections.mapTo' call
    var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
    var tmp0_iterator = this_0.iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var item = tmp0_iterator.next_20eer_k$();
      // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.<get-namespacesAtCurrentDepth>.<anonymous>' call
      var tmp$ret$0 = new NamespaceImpl(getPrefix(this, item), getNamespace(this, item));
      destination.add_utx5q5_k$(tmp$ret$0);
    }
    return destination;
  };
  protoOf(NamespaceHolder).incDepth_t2y8xh_k$ = function () {
    this.depth_1 = this.depth_1 + 1 | 0;
    if (this.depth_1 >= this.namespaceCounts_1.length) {
      this.namespaceCounts_1 = copyOf_1(this.namespaceCounts_1, imul(this.namespaceCounts_1.length, 2));
    }
    this.namespaceCounts_1[this.depth_1] = this.depth_1 === 0 ? 0 : this.namespaceCounts_1[this.depth_1 - 1 | 0];
  };
  protoOf(NamespaceHolder).decDepth_8l9b73_k$ = function () {
    var progression = namespaceIndicesAt(this, this.depth_1);
    var inductionVariable = progression.get_first_irdx8n_k$();
    var last = progression.get_last_wopotb_k$();
    if (inductionVariable <= last)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        this.nameSpaces_1[prefixArrayPos(this, i)] = null;
        this.nameSpaces_1[nsArrayPos(this, i)] = null;
      }
       while (!(i === last));
    this.namespaceCounts_1[this.depth_1] = 0;
    this.depth_1 = this.depth_1 - 1 | 0;
  };
  protoOf(NamespaceHolder).get_totalNamespaceCount_iuvl2n_k$ = function () {
    return this.namespaceCounts_1[this.depth_1];
  };
  protoOf(NamespaceHolder).clear_j9egeb_k$ = function () {
    var tmp = this;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp.nameSpaces_1 = fillArrayVal(Array(10), null);
    this.namespaceCounts_1 = new Int32Array(20);
    this.depth_1 = 0;
  };
  protoOf(NamespaceHolder).addPrefixToContext_uj25lh_k$ = function (ns) {
    this.addPrefixToContext_gkzdgb_k$(ns.get_prefix_i78za3_k$(), ns.get_namespaceURI_g6nmhy_k$());
  };
  protoOf(NamespaceHolder).addPrefixToContext_gkzdgb_k$ = function (prefix, namespaceUri) {
    var prevCounts = this.depth_1 >= 1 ? this.namespaceCounts_1[this.depth_1 - 1 | 0] : 0;
    var inductionVariable = prevCounts;
    var last = this.namespaceCounts_1[this.depth_1];
    if (inductionVariable < last)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        if (equals(getPrefix(this, i), prefix) ? equals(getNamespace(this, i), namespaceUri) : false)
          return Unit_getInstance();
      }
       while (inductionVariable < last);
    var nextPair = this.namespaceCounts_1[this.depth_1];
    if (nsArrayPos(this, nextPair) >= this.nameSpaces_1.length) {
      enlargeNamespaceBuffer(this);
    }
    setPrefix_0(this, nextPair, prefix);
    setNamespace(this, nextPair, namespaceUri);
    var tmp1_array = this.namespaceCounts_1;
    var tmp2_index0 = this.depth_1;
    tmp1_array[tmp2_index0] = tmp1_array[tmp2_index0] + 1 | 0;
  };
  protoOf(NamespaceHolder).get_namespaceContext_n7n1ib_k$ = function () {
    return this.namespaceContext_1;
  };
  protoOf(NamespaceHolder).getNamespaceUri_83evzq_k$ = function (prefix) {
    var prefixStr = toString(prefix);
    var tmp;
    if (prefixStr === XMLConstants_getInstance().get_XML_NS_PREFIX_coe5ej_k$()) {
      return XMLConstants_getInstance().get_XML_NS_URI_kvobz7_k$();
    } else if (prefixStr === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$()) {
      return XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$();
    } else {
      var tmp$ret$1;
      $l$block: {
        // Inline function 'kotlin.collections.firstOrNull' call
        var tmp0_iterator = downTo(this.get_totalNamespaceCount_iuvl2n_k$() - 1 | 0, 0).iterator_jk1svi_k$();
        while (tmp0_iterator.hasNext_bitz1p_k$()) {
          var element = tmp0_iterator.next_20eer_k$();
          // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.getNamespaceUri.<anonymous>' call
          if (getPrefix(this, element) === prefixStr) {
            tmp$ret$1 = element;
            break $l$block;
          }
        }
        tmp$ret$1 = null;
      }
      var tmp0_safe_receiver = tmp$ret$1;
      var tmp_0;
      if (tmp0_safe_receiver == null) {
        tmp_0 = null;
      } else {
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.getNamespaceUri.<anonymous>' call
        tmp_0 = getNamespace(this, tmp0_safe_receiver);
      }
      var tmp1_elvis_lhs = tmp_0;
      var tmp_1;
      if (tmp1_elvis_lhs == null) {
        var tmp_2;
        // Inline function 'kotlin.text.isEmpty' call
        if (charSequenceLength(prefixStr) === 0) {
          tmp_2 = XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$();
        } else {
          tmp_2 = null;
        }
        tmp_1 = tmp_2;
      } else {
        tmp_1 = tmp1_elvis_lhs;
      }
      tmp = tmp_1;
    }
    return tmp;
  };
  protoOf(NamespaceHolder).getPrefix_2nmkkr_k$ = function (namespaceUri) {
    var namespaceUriStr = toString(namespaceUri);
    var tmp;
    if (namespaceUriStr === XMLConstants_getInstance().get_XML_NS_URI_kvobz7_k$()) {
      tmp = XMLConstants_getInstance().get_XML_NS_PREFIX_coe5ej_k$();
    } else if (namespaceUriStr === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$()) {
      tmp = XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$();
    } else if (namespaceUriStr === '') {
      var tmp_0;
      var tmp$ret$0;
      $l$block_0: {
        // Inline function 'kotlin.collections.none' call
        var this_0 = until(0, this.get_totalNamespaceCount_iuvl2n_k$());
        var tmp_1;
        if (isInterface(this_0, Collection)) {
          tmp_1 = this_0.isEmpty_y1axqb_k$();
        } else {
          tmp_1 = false;
        }
        if (tmp_1) {
          tmp$ret$0 = true;
          break $l$block_0;
        }
        var tmp0_iterator = this_0.iterator_jk1svi_k$();
        while (tmp0_iterator.hasNext_bitz1p_k$()) {
          var element = tmp0_iterator.next_20eer_k$();
          // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.getPrefix.<anonymous>' call
          // Inline function 'kotlin.text.isEmpty' call
          var this_1 = getPrefix(this, element);
          if (charSequenceLength(this_1) === 0) {
            tmp$ret$0 = false;
            break $l$block_0;
          }
        }
        tmp$ret$0 = true;
      }
      if (tmp$ret$0) {
        tmp_0 = XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$();
      } else {
        tmp_0 = null;
      }
      tmp = tmp_0;
    } else {
      var tmp$ret$6;
      $l$block_3: {
        // Inline function 'kotlin.collections.firstOrNull' call
        var tmp0_iterator_0 = downTo(this.get_totalNamespaceCount_iuvl2n_k$() - 1 | 0, 0).iterator_jk1svi_k$();
        while (tmp0_iterator_0.hasNext_bitz1p_k$()) {
          var element_0 = tmp0_iterator_0.next_20eer_k$();
          // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.getPrefix.<anonymous>' call
          var tmp_2;
          if (getNamespace(this, element_0) === namespaceUriStr) {
            var tmp$ret$3;
            $l$block_2: {
              // Inline function 'kotlin.collections.none' call
              var this_2 = until(element_0 + 1 | 0, this.get_totalNamespaceCount_iuvl2n_k$());
              var tmp_3;
              if (isInterface(this_2, Collection)) {
                tmp_3 = this_2.isEmpty_y1axqb_k$();
              } else {
                tmp_3 = false;
              }
              if (tmp_3) {
                tmp$ret$3 = true;
                break $l$block_2;
              }
              var tmp0_iterator_1 = this_2.iterator_jk1svi_k$();
              while (tmp0_iterator_1.hasNext_bitz1p_k$()) {
                var element_1 = tmp0_iterator_1.next_20eer_k$();
                // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.getPrefix.<anonymous>.<anonymous>' call
                if (getPrefix(this, element_0) === getPrefix(this, element_1)) {
                  tmp$ret$3 = false;
                  break $l$block_2;
                }
              }
              tmp$ret$3 = true;
            }
            tmp_2 = tmp$ret$3;
          } else {
            tmp_2 = false;
          }
          if (tmp_2) {
            tmp$ret$6 = element_0;
            break $l$block_3;
          }
        }
        tmp$ret$6 = null;
      }
      var tmp0_safe_receiver = tmp$ret$6;
      var tmp_4;
      if (tmp0_safe_receiver == null) {
        tmp_4 = null;
      } else {
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'nl.adaptivity.xmlutil.core.impl.NamespaceHolder.getPrefix.<anonymous>' call
        tmp_4 = getPrefix(this, tmp0_safe_receiver);
      }
      tmp = tmp_4;
    }
    return tmp;
  };
  protoOf(NamespaceHolder).iterator_jk1svi_k$ = function () {
    return new NamespaceHolder$iterator$1(this);
  };
  protoOf(NamespaceHolder).nextAutoPrefix_ts9tvw_k$ = function () {
    var prefix;
    do {
      prefix = 'n' + this.nextAutoPrefixNo_1;
    }
     while (!(this.getNamespaceUri_83evzq_k$(prefix) == null));
    return prefix;
  };
  protoOf(NamespaceHolder).namespaceAtCurrentDepth_gfs28u_k$ = function (prefix) {
    var progression = namespaceIndicesAt(this, this.depth_1);
    var nestedFirst = progression.get_first_irdx8n_k$();
    var nestedLast = progression.get_last_wopotb_k$();
    var inductionVariable = nestedFirst;
    var last = getProgressionLastElement(nestedFirst, nestedLast, 2);
    if (inductionVariable <= last)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 2 | 0;
        if (this.nameSpaces_1[prefixArrayPos(this, i)] === prefix) {
          return this.nameSpaces_1[nsArrayPos(this, i)];
        }
      }
       while (!(i === last));
    return null;
  };
  function _get_COMMENT__ww1phq($this) {
    return $this.COMMENT_1;
  }
  function toIndentSequence$sbToTextEvent(sb, result) {
    // Inline function 'kotlin.text.isNotEmpty' call
    if (charSequenceLength(sb) > 0) {
      var text = sb.toString();
      if (!isXmlWhitespace_1(text)) {
        throw XmlException_init_$Create$_0('Indents can only be whitespace or comments: ' + text);
      }
      result.add_utx5q5_k$(new TextEvent(null, EventType_IGNORABLE_WHITESPACE_getInstance(), text));
      sb.clear_1keqml_k$();
    }
  }
  function Companion_6() {
    Companion_instance_6 = this;
    this.COMMENT_1 = '<!---->';
  }
  protoOf(Companion_6).toIndentSequence_h7k4vw_k$ = function (_this__u8e3s4) {
    // Inline function 'kotlin.collections.mutableListOf' call
    var result = ArrayList_init_$Create$();
    var sb = StringBuilder_init_$Create$();
    var commentPos = 0;
    var inductionVariable = 0;
    var last = _this__u8e3s4.length;
    while (inductionVariable < last) {
      var ch = charSequenceGet(_this__u8e3s4, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      if (ch === _Char___init__impl__6a9atx(60)) {
        if (commentPos === 0) {
          commentPos = commentPos + 1 | 0;
        } else {
          sb.append_am5a4z_k$(ch);
        }
      } else if (ch === _Char___init__impl__6a9atx(33)) {
        if (commentPos === 1) {
          commentPos = commentPos + 1 | 0;
        } else {
          sb.append_am5a4z_k$(ch);
        }
      } else if (ch === _Char___init__impl__6a9atx(45)) {
        switch (commentPos) {
          case 2:
            commentPos = commentPos + 1 | 0;
            break;
          case 3:
            commentPos = commentPos + 1 | 0;
            toIndentSequence$sbToTextEvent(sb, result);
            break;
          case 4:
          case 5:
            commentPos = commentPos + 1 | 0;
            break;
          case 6:
            throw XmlException_init_$Create$_0('-- is not allowed to occur inside xml comment text');
          default:
            sb.append_am5a4z_k$(ch);
            break;
        }
      } else if (ch === _Char___init__impl__6a9atx(62)) {
        switch (commentPos) {
          case 6:
            commentPos = 0;
            result.add_utx5q5_k$(new TextEvent(null, EventType_COMMENT_getInstance(), sb.toString()));
            sb.clear_1keqml_k$();
            break;
          case 5:
            commentPos = 4;
            sb.append_22ad7x_k$('->');
            break;
          default:
            sb.append_am5a4z_k$(ch);
            break;
        }
      } else {
        switch (commentPos) {
          case 1:
          case 2:
          case 3:
            sb.append_xdc1zw_k$('<!---->', 0, commentPos);
            commentPos = 0;
            sb.append_am5a4z_k$(ch);
            break;
          case 0:
          case 4:
            sb.append_am5a4z_k$(ch);
            break;
          case 5:
            commentPos = 4;
            sb.append_am5a4z_k$(_Char___init__impl__6a9atx(45)).append_am5a4z_k$(ch);
            break;
          case 6:
            throw XmlException_init_$Create$_0('-- is not allowed to occur inside xml comment text');
        }
      }
    }
    if (commentPos > 0)
      throw XmlException_init_$Create$_0('Indent can not contain unclosed comment');
    toIndentSequence$sbToTextEvent(sb, result);
    return result;
  };
  var Companion_instance_6;
  function Companion_getInstance_7() {
    if (Companion_instance_6 == null)
      new Companion_6();
    return Companion_instance_6;
  }
  function PlatformXmlWriterBase$_get_indentString_$lambda_yiqku9(ev) {
    return ev.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$() === 3 ? '<!--' + ev.get_text_wouvsm_k$() + '-->' : ev.get_text_wouvsm_k$();
  }
  function PlatformXmlWriterBase(indentSequence) {
    Companion_getInstance_7();
    indentSequence = indentSequence === VOID ? emptyList() : indentSequence;
    this.indentSequence_1 = toList(indentSequence);
  }
  protoOf(PlatformXmlWriterBase).set_indentSequence_r8jc87_k$ = function (_set____db54di) {
    this.indentSequence_1 = _set____db54di;
  };
  protoOf(PlatformXmlWriterBase).get_indentSequence_chovoq_k$ = function () {
    return this.indentSequence_1;
  };
  protoOf(PlatformXmlWriterBase).set_indentString_30d8vk_k$ = function (value) {
    this.indentSequence_1 = Companion_getInstance_7().toIndentSequence_h7k4vw_k$(value);
  };
  protoOf(PlatformXmlWriterBase).get_indentString_li4jl2_k$ = function () {
    var tmp = this.indentSequence_1;
    return joinToString_0(tmp, VOID, VOID, VOID, VOID, VOID, PlatformXmlWriterBase$_get_indentString_$lambda_yiqku9);
  };
  protoOf(PlatformXmlWriterBase).set_indent_os83lr_k$ = function (value) {
    this.indentSequence_1 = listOf(new TextEvent(null, EventType_IGNORABLE_WHITESPACE_getInstance(), repeat(' ', value)));
  };
  protoOf(PlatformXmlWriterBase).get_indent_etpsj9_k$ = function () {
    // Inline function 'kotlin.collections.sumOf' call
    var sum = 0;
    var tmp0_iterator = this.indentSequence_1.iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var element = tmp0_iterator.next_20eer_k$();
      var tmp = sum;
      // Inline function 'nl.adaptivity.xmlutil.core.impl.PlatformXmlWriterBase.<get-indent>.<anonymous>' call
      sum = tmp + (element.get_eventType_918hfv_k$().get_ordinal_ip24qg_k$() === 3 ? 7 + element.get_text_wouvsm_k$().length | 0 : element.get_text_wouvsm_k$().length) | 0;
    }
    return sum;
  };
  function get_WHITESPACE() {
    _init_properties_chars_kt__oshz4b();
    return WHITESPACE;
  }
  var WHITESPACE;
  function isXmlWhitespace_1(_this__u8e3s4) {
    _init_properties_chars_kt__oshz4b();
    var tmp$ret$2;
    $l$block: {
      // Inline function 'kotlin.text.all' call
      var inductionVariable = 0;
      while (inductionVariable < charSequenceLength(_this__u8e3s4)) {
        var element = charSequenceGet(_this__u8e3s4, inductionVariable);
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'nl.adaptivity.xmlutil.core.impl.isXmlWhitespace.<anonymous>' call
        // Inline function 'kotlin.code' call
        var tmp$ret$0 = Char__toInt_impl_vasixd(element);
        if (!isXmlWhitespace_2(tmp$ret$0)) {
          tmp$ret$2 = false;
          break $l$block;
        }
      }
      tmp$ret$2 = true;
    }
    return tmp$ret$2;
  }
  function isXmlWhitespace_2(_this__u8e3s4) {
    _init_properties_chars_kt__oshz4b();
    return _this__u8e3s4 >= get_WHITESPACE().length ? false : get_WHITESPACE()[_this__u8e3s4];
  }
  var properties_initialized_chars_kt_qk0z7x;
  function _init_properties_chars_kt__oshz4b() {
    if (!properties_initialized_chars_kt_qk0z7x) {
      properties_initialized_chars_kt_qk0z7x = true;
      // Inline function 'kotlin.also' call
      var this_0 = booleanArray(33);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'nl.adaptivity.xmlutil.core.impl.WHITESPACE.<anonymous>' call
      // Inline function 'kotlin.code' call
      var this_1 = _Char___init__impl__6a9atx(9);
      this_0[Char__toInt_impl_vasixd(this_1)] = true;
      // Inline function 'kotlin.code' call
      var this_2 = _Char___init__impl__6a9atx(10);
      this_0[Char__toInt_impl_vasixd(this_2)] = true;
      // Inline function 'kotlin.code' call
      var this_3 = _Char___init__impl__6a9atx(13);
      this_0[Char__toInt_impl_vasixd(this_3)] = true;
      // Inline function 'kotlin.code' call
      var this_4 = _Char___init__impl__6a9atx(32);
      this_0[Char__toInt_impl_vasixd(this_4)] = true;
      WHITESPACE = this_0;
    }
  }
  function countIndentedLength(_this__u8e3s4) {
    // Inline function 'kotlin.text.fold' call
    var accumulator = 0;
    var inductionVariable = 0;
    while (inductionVariable < charSequenceLength(_this__u8e3s4)) {
      var element = charSequenceGet(_this__u8e3s4, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      // Inline function 'nl.adaptivity.xmlutil.core.internal.countIndentedLength.<anonymous>' call
      accumulator = accumulator + (element === _Char___init__impl__6a9atx(9) ? 8 : 1) | 0;
    }
    return accumulator;
  }
  function iterator(_this__u8e3s4) {
    return new NamedNodeMapIterator(_this__u8e3s4);
  }
  function _get_map__e6co1h($this) {
    return $this.map_1;
  }
  function _set_pos__4wcab5_0($this, _set____db54di) {
    $this.pos_1 = _set____db54di;
  }
  function _get_pos__e6evgd_1($this) {
    return $this.pos_1;
  }
  function NamedNodeMapIterator(map) {
    this.map_1 = map;
    this.pos_1 = 0;
  }
  protoOf(NamedNodeMapIterator).hasNext_bitz1p_k$ = function () {
    var tmp = this.pos_1;
    // Inline function 'nl.adaptivity.xmlutil.dom.getLength' call
    return tmp < this.map_1.length;
  };
  protoOf(NamedNodeMapIterator).next_20eer_k$ = function () {
    var tmp1 = this.pos_1;
    this.pos_1 = tmp1 + 1 | 0;
    var tmp = get_0(this.map_1, tmp1);
    return (!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE();
  };
  function get_0(_this__u8e3s4, index) {
    var tmp = _this__u8e3s4.item(index);
    return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
  }
  function NodeConsts() {
    NodeConsts_instance = this;
    this.ELEMENT_NODE_1 = 1;
    this.ATTRIBUTE_NODE_1 = 2;
    this.TEXT_NODE_1 = 3;
    this.CDATA_SECTION_NODE_1 = 4;
    this.ENTITY_REFERENCE_NODE_1 = 5;
    this.ENTITY_NODE_1 = 6;
    this.PROCESSING_INSTRUCTION_NODE_1 = 7;
    this.COMMENT_NODE_1 = 8;
    this.DOCUMENT_NODE_1 = 9;
    this.DOCUMENT_TYPE_NODE_1 = 10;
    this.DOCUMENT_FRAGMENT_NODE_1 = 11;
    this.NOTATION_NODE_1 = 12;
  }
  protoOf(NodeConsts).get_ELEMENT_NODE_xvg2j2_k$ = function () {
    return this.ELEMENT_NODE_1;
  };
  protoOf(NodeConsts).get_ATTRIBUTE_NODE_ynn1g2_k$ = function () {
    return this.ATTRIBUTE_NODE_1;
  };
  protoOf(NodeConsts).get_TEXT_NODE_x3rt91_k$ = function () {
    return this.TEXT_NODE_1;
  };
  protoOf(NodeConsts).get_CDATA_SECTION_NODE_v6gjhl_k$ = function () {
    return this.CDATA_SECTION_NODE_1;
  };
  protoOf(NodeConsts).get_ENTITY_REFERENCE_NODE_3pz5x3_k$ = function () {
    return this.ENTITY_REFERENCE_NODE_1;
  };
  protoOf(NodeConsts).get_ENTITY_NODE_5hhth_k$ = function () {
    return this.ENTITY_NODE_1;
  };
  protoOf(NodeConsts).get_PROCESSING_INSTRUCTION_NODE_34ol86_k$ = function () {
    return this.PROCESSING_INSTRUCTION_NODE_1;
  };
  protoOf(NodeConsts).get_COMMENT_NODE_eipp6d_k$ = function () {
    return this.COMMENT_NODE_1;
  };
  protoOf(NodeConsts).get_DOCUMENT_NODE_5zyovx_k$ = function () {
    return this.DOCUMENT_NODE_1;
  };
  protoOf(NodeConsts).get_DOCUMENT_TYPE_NODE_eh0gng_k$ = function () {
    return this.DOCUMENT_TYPE_NODE_1;
  };
  protoOf(NodeConsts).get_DOCUMENT_FRAGMENT_NODE_tz3fyi_k$ = function () {
    return this.DOCUMENT_FRAGMENT_NODE_1;
  };
  protoOf(NodeConsts).get_NOTATION_NODE_3e8xrq_k$ = function () {
    return this.NOTATION_NODE_1;
  };
  var NodeConsts_instance;
  function NodeConsts_getInstance() {
    if (NodeConsts_instance == null)
      new NodeConsts();
    return NodeConsts_instance;
  }
  function iterator_0(_this__u8e3s4) {
    return new NodeListIterator(_this__u8e3s4);
  }
  function _get_nodeList__vwy13f($this) {
    return $this.nodeList_1;
  }
  function _set_pos__4wcab5_1($this, _set____db54di) {
    $this.pos_1 = _set____db54di;
  }
  function _get_pos__e6evgd_2($this) {
    return $this.pos_1;
  }
  function NodeListIterator(nodeList) {
    this.nodeList_1 = nodeList;
    this.pos_1 = 0;
  }
  protoOf(NodeListIterator).hasNext_bitz1p_k$ = function () {
    var tmp = this.pos_1;
    // Inline function 'nl.adaptivity.xmlutil.dom.getLength' call
    return tmp < this.nodeList_1.length;
  };
  protoOf(NodeListIterator).next_20eer_k$ = function () {
    var tmp1 = this.pos_1;
    this.pos_1 = tmp1 + 1 | 0;
    var tmp2_elvis_lhs = this.nodeList_1.item(tmp1);
    var tmp;
    if (tmp2_elvis_lhs == null) {
      throw NoSuchElementException_init_$Create$_0('No item found in the iterator');
    } else {
      tmp = tmp2_elvis_lhs;
    }
    return tmp;
  };
  function ICompactFragment() {
  }
  function forEachAttr(_this__u8e3s4, body) {
    var l = _this__u8e3s4.length;
    var inductionVariable = 0;
    if (inductionVariable < l)
      do {
        var idx = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var tmp = _this__u8e3s4.item(idx);
        body((!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE());
      }
       while (inductionVariable < l);
  }
  function removeElementChildren(_this__u8e3s4) {
    var top = _this__u8e3s4;
    var cur = top.firstChild;
    while (!(cur == null)) {
      var n = cur.nextSibling;
      if (get_isElement(cur)) {
        top.removeChild(cur);
      }
      cur = n;
    }
  }
  function createElement(_this__u8e3s4, name) {
    return _this__u8e3s4.createElementNS(name.getNamespaceURI_665tvr_k$(), toCName(name));
  }
  function myLookupNamespaceURI(_this__u8e3s4, prefix) {
    var tmp;
    if (!(_this__u8e3s4.nodeType === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$())) {
      tmp = null;
    } else {
      // Inline function 'nl.adaptivity.xmlutil.util.filterTyped' call
      var this_0 = (!(_this__u8e3s4 == null) ? _this__u8e3s4 : THROW_CCE()).attributes;
      // Inline function 'kotlin.collections.mutableListOf' call
      var result = ArrayList_init_$Create$();
      // Inline function 'nl.adaptivity.xmlutil.util.forEachAttr' call
      var l = this_0.length;
      var inductionVariable = 0;
      if (inductionVariable < l)
        do {
          var idx = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          // Inline function 'nl.adaptivity.xmlutil.util.filterTyped.<anonymous>' call
          var tmp_0 = this_0.item(idx);
          var attr = (!(tmp_0 == null) ? !(tmp_0 == null) : false) ? tmp_0 : THROW_CCE();
          // Inline function 'nl.adaptivity.xmlutil.util.myLookupNamespaceURI.<anonymous>' call
          if ((prefix === '' ? attr.localName === 'xmlns' : false) ? true : attr.prefix === 'xmlns' ? attr.localName === prefix : false) {
            result.add_utx5q5_k$(attr);
          }
        }
         while (inductionVariable < l);
      var tmp0_safe_receiver = firstOrNull(result);
      var tmp2_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.value;
      var tmp_1;
      if (tmp2_elvis_lhs == null) {
        var tmp1_safe_receiver = _this__u8e3s4.parentNode;
        tmp_1 = tmp1_safe_receiver == null ? null : myLookupNamespaceURI(tmp1_safe_receiver, prefix);
      } else {
        tmp_1 = tmp2_elvis_lhs;
      }
      tmp = tmp_1;
    }
    return tmp;
  }
  function myLookupPrefix(_this__u8e3s4, namespaceUri) {
    if (!(_this__u8e3s4.nodeType === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$()))
      return null;
    var tmp = !(_this__u8e3s4 == null) ? _this__u8e3s4 : THROW_CCE();
    // Inline function 'kotlin.collections.mutableSetOf' call
    var tmp$ret$0 = LinkedHashSet_init_$Create$();
    return myLookupPrefixImpl(tmp, namespaceUri, tmp$ret$0);
  }
  function filterTyped(_this__u8e3s4, predicate) {
    // Inline function 'kotlin.collections.mutableListOf' call
    var result = ArrayList_init_$Create$();
    // Inline function 'nl.adaptivity.xmlutil.util.forEachAttr' call
    var l = _this__u8e3s4.length;
    var inductionVariable = 0;
    if (inductionVariable < l)
      do {
        var idx = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'nl.adaptivity.xmlutil.util.filterTyped.<anonymous>' call
        var tmp = _this__u8e3s4.item(idx);
        var attr = (!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE();
        if (predicate(attr)) {
          result.add_utx5q5_k$(attr);
        }
      }
       while (inductionVariable < l);
    return result;
  }
  function get_isElement(_this__u8e3s4) {
    return _this__u8e3s4.nodeType === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$();
  }
  function get_isText(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4.nodeType;
    return (tmp0_subject === NodeConsts_getInstance().get_ELEMENT_NODE_xvg2j2_k$() ? true : tmp0_subject === NodeConsts_getInstance().get_CDATA_SECTION_NODE_v6gjhl_k$()) ? true : false;
  }
  function myLookupPrefixImpl(_this__u8e3s4, namespaceUri, seenPrefixes) {
    var tmp0_safe_receiver = _this__u8e3s4.attributes;
    if (tmp0_safe_receiver == null)
      null;
    else {
      // Inline function 'nl.adaptivity.xmlutil.util.forEachAttr' call
      var l = tmp0_safe_receiver.length;
      var inductionVariable = 0;
      if (inductionVariable < l)
        do {
          var idx = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          // Inline function 'nl.adaptivity.xmlutil.util.myLookupPrefixImpl.<anonymous>' call
          var tmp = tmp0_safe_receiver.item(idx);
          var attr = (!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE();
          if (attr.prefix === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$())
            if (attr.value === namespaceUri ? !seenPrefixes.contains_aljjnj_k$(attr.localName) : false) {
              return attr.localName;
            } else {
              var tmp0_elvis_lhs = attr.localName;
              seenPrefixes.add_utx5q5_k$(tmp0_elvis_lhs == null ? attr.name : tmp0_elvis_lhs);
            }
           else {
            var tmp_0;
            // Inline function 'kotlin.text.isNullOrBlank' call
            var this_0 = attr.prefix;
            // Inline function 'kotlin.contracts.contract' call
            if (this_0 == null ? true : isBlank(this_0)) {
              tmp_0 = attr.localName === XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_883gnk_k$();
            } else {
              tmp_0 = false;
            }
            if (tmp_0)
              if (attr.value === namespaceUri ? !seenPrefixes.contains_aljjnj_k$(attr.localName) : false) {
                return '';
              } else {
                seenPrefixes.add_utx5q5_k$('');
              }
          }
        }
         while (inductionVariable < l);
    }
    var tmp_1 = _this__u8e3s4.parentNode;
    var tmp1_safe_receiver = (!(tmp_1 == null) ? !(tmp_1 == null) : false) ? tmp_1 : null;
    return tmp1_safe_receiver == null ? null : myLookupPrefixImpl(tmp1_safe_receiver, namespaceUri, seenPrefixes);
  }
  function _get_namespaceURI__7lp09y($this) {
    return $this.namespaceURI_1;
  }
  function _get_localPart__azw8d($this) {
    return $this.localPart_1;
  }
  function _get_prefix__wiwq7t_1($this) {
    return $this.prefix_1;
  }
  function QName_init_$Init$(namespaceURI, localPart, $this) {
    QName.call($this, namespaceURI, localPart, XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$());
    return $this;
  }
  function QName_init_$Create$(namespaceURI, localPart) {
    return QName_init_$Init$(namespaceURI, localPart, objectCreate(protoOf(QName)));
  }
  function QName_init_$Init$_0(localPart, $this) {
    QName.call($this, XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$(), localPart, XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$());
    return $this;
  }
  function QName_init_$Create$_0(localPart) {
    return QName_init_$Init$_0(localPart, objectCreate(protoOf(QName)));
  }
  function QName(namespaceURI, localPart, prefix) {
    this.namespaceURI_1 = namespaceURI;
    this.localPart_1 = localPart;
    this.prefix_1 = prefix;
  }
  protoOf(QName).getPrefix_bu8bd4_k$ = function () {
    return this.prefix_1;
  };
  protoOf(QName).getLocalPart_k3cdyw_k$ = function () {
    return this.localPart_1;
  };
  protoOf(QName).getNamespaceURI_665tvr_k$ = function () {
    return this.namespaceURI_1;
  };
  protoOf(QName).toString = function () {
    if (this.namespaceURI_1 === XMLConstants_getInstance().get_NULL_NS_URI_lh88gv_k$())
      return this.localPart_1;
    return '{' + this.namespaceURI_1 + '}' + this.localPart_1;
  };
  protoOf(QName).equals = function (other) {
    if (this === other)
      return true;
    if (other == null ? true : !(this.constructor == other.constructor))
      return false;
    if (!(other instanceof QName))
      THROW_CCE();
    if (!(this.namespaceURI_1 === other.namespaceURI_1))
      return false;
    if (!(this.localPart_1 === other.localPart_1))
      return false;
    return true;
  };
  protoOf(QName).hashCode = function () {
    var result = getStringHashCode(this.namespaceURI_1);
    result = imul(31, result) + getStringHashCode(this.localPart_1) | 0;
    return result;
  };
  function siblingsToFragment(_this__u8e3s4) {
    var tmp0_safe_receiver = _this__u8e3s4 instanceof DomReader ? _this__u8e3s4 : null;
    var d = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_delegate_i94tki_k$();
    var tmp2_subject = d == null ? null : d.nodeType;
    var tmp;
    if ((tmp2_subject == null ? null : tmp2_subject) === NodeConsts_getInstance().get_DOCUMENT_NODE_5zyovx_k$()) {
      tmp = (!(d == null) ? !(d == null) : false) ? d : THROW_CCE();
    } else {
      if (tmp2_subject == null) {
        var tmp_0 = new Document();
        tmp = !(tmp_0 == null) ? tmp_0 : THROW_CCE();
      } else {
        var tmp4_elvis_lhs = d.ownerDocument;
        var tmp_1;
        if (tmp4_elvis_lhs == null) {
          var tmp_2 = new Document();
          tmp_1 = !(tmp_2 == null) ? tmp_2 : THROW_CCE();
        } else {
          tmp_1 = tmp4_elvis_lhs;
        }
        tmp = tmp_1;
      }
    }
    var doc = tmp;
    var frag = doc.createDocumentFragment();
    var wrapperElement = doc.createElementNS('http://wrapperns', 'SDFKLJDSF:afjlfxkls');
    frag.appendChild(wrapperElement);
    if (!_this__u8e3s4.get_isStarted_wg74c2_k$()) {
      if (_this__u8e3s4.hasNext_bitz1p_k$()) {
        _this__u8e3s4.next_20eer_k$();
      } else {
        return CompactFragment_init_$Create$_0('');
      }
    }
    var startLocation = _this__u8e3s4.get_locationInfo_3kny30_k$();
    try {
      // Inline function 'kotlin.collections.mutableMapOf' call
      var missingNamespaces = LinkedHashMap_init_$Create$();
      var initialDepth = _this__u8e3s4.get_depth_iq7qmy_k$() - (_this__u8e3s4.get_eventType_918hfv_k$() === EventType_START_ELEMENT_getInstance() ? 1 : 0) | 0;
      var type = _this__u8e3s4.get_eventType_918hfv_k$();
      while ((!(type === EventType_END_DOCUMENT_getInstance()) ? !(type === EventType_END_ELEMENT_getInstance()) : false) ? _this__u8e3s4.get_depth_iq7qmy_k$() >= initialDepth : false) {
        var tmp5_subject = type;
        switch (tmp5_subject == null ? -1 : tmp5_subject.get_ordinal_ip24qg_k$()) {
          case 1:
            var out = new DomWriter(wrapperElement, true);
            addUndeclaredNamespaces(out, _this__u8e3s4, missingNamespaces);
            writeCurrent(_this__u8e3s4, out);
            writeElementContent(out, missingNamespaces, _this__u8e3s4);
            out.close_yn9xrc_k$();
            break;
          case 9:
          case 4:
            wrapperElement.appendChild(ensureNotNull(wrapperElement.ownerDocument).createTextNode(_this__u8e3s4.get_text_wouvsm_k$()));
            break;
          case 5:
            wrapperElement.appendChild(ensureNotNull(wrapperElement.ownerDocument).createCDATASection(_this__u8e3s4.get_text_wouvsm_k$()));
            break;
          case 3:
            wrapperElement.appendChild(ensureNotNull(wrapperElement.ownerDocument).createComment(_this__u8e3s4.get_text_wouvsm_k$()));
            break;
          case 8:
            throw XmlException_init_$Create$_0('Entity references are not expected here');
          case 10:
            throw AssertionError_init_$Create$('Attributes are not expected in the event stream');
          default:
            break;
        }
        type = _this__u8e3s4.hasNext_bitz1p_k$() ? _this__u8e3s4.next_20eer_k$() : null;
      }
      if (missingNamespaces.get_wei43m_k$('') === '') {
        missingNamespaces.remove_gppy8k_k$('');
      }
      var tmp_3 = asSequence_0(missingNamespaces.get_entries_p20ztl_k$());
      var tmp_4 = filter(tmp_3, siblingsToFragment$lambda);
      var ns = toList_0(map(tmp_4, siblingsToFragment$lambda_0(wrapperElement)));
      var tmp_5 = new XMLSerializer();
      var wrappedString = tmp_5.serializeToString(wrapperElement instanceof Node ? wrapperElement : THROW_CCE());
      // Inline function 'kotlin.text.substring' call
      var startIndex = indexOf(wrappedString, _Char___init__impl__6a9atx(62), 19) + 1 | 0;
      var endIndex = (wrappedString.length - 19 | 0) - 3 | 0;
      // Inline function 'kotlin.js.asDynamic' call
      var unwrappedString = wrappedString.substring(startIndex, endIndex);
      return CompactFragment_init_$Create$_3(ns, unwrappedString);
    } catch ($p) {
      if ($p instanceof XmlException) {
        var e = $p;
        throw XmlException_init_$Create$_1('Failure to parse children into string at ' + startLocation, e);
      } else {
        if ($p instanceof RuntimeException) {
          var e_0 = $p;
          throw XmlException_init_$Create$_1('Failure to parse children into string at ' + startLocation, e_0);
        } else {
          throw $p;
        }
      }
    }
  }
  function get_WRAPPERNAMESPACE() {
    return WRAPPERNAMESPACE;
  }
  var WRAPPERNAMESPACE;
  function get_WRAPPERQNAME() {
    return WRAPPERQNAME;
  }
  var WRAPPERQNAME;
  function siblingsToFragment$lambda(_name_for_destructuring_parameter_0__wldtmu) {
    // Inline function 'kotlin.collections.component1' call
    var prefix = _name_for_destructuring_parameter_0__wldtmu.get_key_18j28a_k$();
    // Inline function 'kotlin.collections.component2' call
    var uri = _name_for_destructuring_parameter_0__wldtmu.get_value_j01efc_k$();
    return !(prefix === '') ? true : !(uri === '');
  }
  function siblingsToFragment$lambda_0($wrapperElement) {
    return function (_name_for_destructuring_parameter_0__wldtmu) {
      // Inline function 'kotlin.collections.component1' call
      var prefix = _name_for_destructuring_parameter_0__wldtmu.get_key_18j28a_k$();
      // Inline function 'kotlin.collections.component2' call
      var uri = _name_for_destructuring_parameter_0__wldtmu.get_value_j01efc_k$();
      $wrapperElement.setAttributeNS(XMLConstants_getInstance().get_XMLNS_ATTRIBUTE_NS_URI_xtsf1b_k$(), prefix === '' ? 'xmlns' : 'xmlns:' + prefix, uri);
      return new NamespaceImpl(prefix, uri);
    };
  }
  function XmlStreaming() {
    XmlStreaming_instance = this;
  }
  protoOf(XmlStreaming).newWriter_7zqojx_k$ = function () {
    return DomWriter_init_$Create$();
  };
  protoOf(XmlStreaming).newWriter_bfk3de_k$ = function (dest) {
    return new DomWriter(!(dest == null) ? dest : THROW_CCE());
  };
  protoOf(XmlStreaming).newReader_cs677o_k$ = function (delegate) {
    return new DomReader(!(delegate == null) ? delegate : THROW_CCE());
  };
  protoOf(XmlStreaming).setFactory_ysoisn_k$ = function (factory) {
    if (!(factory == null))
      throw UnsupportedOperationException_init_$Create$("Javascript has no services, don't bother creating them");
  };
  protoOf(XmlStreaming).deSerialize_m0du0c_k$ = function (input, type) {
    var reason = 'JS does not support annotations';
    throw new NotImplementedError('An operation is not implemented: ' + reason);
  };
  protoOf(XmlStreaming).newReader_z0cnp6_k$ = function (input) {
    var str = toString(charSequenceGet(input, 0) === _Char___init__impl__6a9atx(65279) ? charSequenceSubSequence(input, 1, charSequenceLength(input)) : input);
    var tmp = (new DOMParser()).parseFromString(str, 'text/xml');
    return new DomReader(!(tmp == null) ? tmp : THROW_CCE());
  };
  protoOf(XmlStreaming).newReader_h3yxgz_k$ = function (reader) {
    return KtXmlReader_init_$Create$(reader);
  };
  protoOf(XmlStreaming).newGenericReader_6a8lwj_k$ = function (input) {
    return this.newGenericReader_69idvg_k$(new StringReader(input));
  };
  protoOf(XmlStreaming).newGenericReader_69idvg_k$ = function (reader) {
    return KtXmlReader_init_$Create$(reader);
  };
  protoOf(XmlStreaming).newWriter_25qwmn_k$ = function (output, repairNamespaces, omitXmlDecl) {
    return this.newWriter_jji8x2_k$(output, repairNamespaces, Companion_getInstance_4().from_imbmez_k$(omitXmlDecl));
  };
  protoOf(XmlStreaming).newWriter$default_im0at8_k$ = function (output, repairNamespaces, omitXmlDecl, $super) {
    repairNamespaces = repairNamespaces === VOID ? false : repairNamespaces;
    return $super === VOID ? this.newWriter_25qwmn_k$(output, repairNamespaces, omitXmlDecl) : $super.newWriter_25qwmn_k$.call(this, output, repairNamespaces, omitXmlDecl);
  };
  protoOf(XmlStreaming).newWriter_jji8x2_k$ = function (output, repairNamespaces, xmlDeclMode) {
    return new AppendingWriter(output, DomWriter_init_$Create$(xmlDeclMode));
  };
  protoOf(XmlStreaming).newWriter$default_3vemhe_k$ = function (output, repairNamespaces, xmlDeclMode, $super) {
    repairNamespaces = repairNamespaces === VOID ? false : repairNamespaces;
    xmlDeclMode = xmlDeclMode === VOID ? XmlDeclMode_None_getInstance() : xmlDeclMode;
    return $super === VOID ? this.newWriter_jji8x2_k$(output, repairNamespaces, xmlDeclMode) : $super.newWriter_jji8x2_k$.call(this, output, repairNamespaces, xmlDeclMode);
  };
  protoOf(XmlStreaming).newGenericWriter_9lek8f_k$ = function (output, isRepairNamespaces, xmlDeclMode) {
    return new KtXmlWriter(output, isRepairNamespaces, xmlDeclMode);
  };
  protoOf(XmlStreaming).newGenericWriter$default_21ygq1_k$ = function (output, isRepairNamespaces, xmlDeclMode, $super) {
    isRepairNamespaces = isRepairNamespaces === VOID ? false : isRepairNamespaces;
    xmlDeclMode = xmlDeclMode === VOID ? XmlDeclMode_None_getInstance() : xmlDeclMode;
    return $super === VOID ? this.newGenericWriter_9lek8f_k$(output, isRepairNamespaces, xmlDeclMode) : $super.newGenericWriter_9lek8f_k$.call(this, output, isRepairNamespaces, xmlDeclMode);
  };
  protoOf(XmlStreaming).newWriter_tjsl8q_k$ = function (writer, repairNamespaces, omitXmlDecl) {
    return this.newWriter_3zvlr3_k$(writer, repairNamespaces, Companion_getInstance_4().from_imbmez_k$(omitXmlDecl));
  };
  protoOf(XmlStreaming).newWriter$default_urzu8b_k$ = function (writer, repairNamespaces, omitXmlDecl, $super) {
    repairNamespaces = repairNamespaces === VOID ? false : repairNamespaces;
    return $super === VOID ? this.newWriter_tjsl8q_k$(writer, repairNamespaces, omitXmlDecl) : $super.newWriter_tjsl8q_k$.call(this, writer, repairNamespaces, omitXmlDecl);
  };
  protoOf(XmlStreaming).newWriter_3zvlr3_k$ = function (writer, repairNamespaces, xmlDeclMode) {
    return new WriterXmlWriter(writer, DomWriter_init_$Create$(xmlDeclMode));
  };
  protoOf(XmlStreaming).newWriter$default_ypi326_k$ = function (writer, repairNamespaces, xmlDeclMode, $super) {
    xmlDeclMode = xmlDeclMode === VOID ? XmlDeclMode_None_getInstance() : xmlDeclMode;
    return $super === VOID ? this.newWriter_3zvlr3_k$(writer, repairNamespaces, xmlDeclMode) : $super.newWriter_3zvlr3_k$.call(this, writer, repairNamespaces, xmlDeclMode);
  };
  var XmlStreaming_instance;
  function XmlStreaming_getInstance() {
    if (XmlStreaming_instance == null)
      new XmlStreaming();
    return XmlStreaming_instance;
  }
  function XmlStreamingFactory() {
  }
  function _get_target__ccs42i($this) {
    return $this.target_1;
  }
  function _get_delegate__idh0py_0($this) {
    return $this.delegate_1;
  }
  function AppendingWriter(target, delegate) {
    this.target_1 = target;
    this.delegate_1 = delegate;
  }
  protoOf(AppendingWriter).get_depth_iq7qmy_k$ = function () {
    return this.delegate_1.get_depth_iq7qmy_k$();
  };
  protoOf(AppendingWriter).set_indent_os83lr_k$ = function (value) {
    this.delegate_1.set_indent_os83lr_k$(value);
  };
  protoOf(AppendingWriter).get_indent_etpsj9_k$ = function () {
    return this.delegate_1.get_indent_etpsj9_k$();
  };
  protoOf(AppendingWriter).set_indentString_30d8vk_k$ = function (_set____db54di) {
    this.delegate_1.set_indentString_30d8vk_k$(_set____db54di);
  };
  protoOf(AppendingWriter).get_indentString_li4jl2_k$ = function () {
    return this.delegate_1.get_indentString_li4jl2_k$();
  };
  protoOf(AppendingWriter).get_namespaceContext_n7n1ib_k$ = function () {
    return this.delegate_1.get_namespaceContext_n7n1ib_k$();
  };
  protoOf(AppendingWriter).attribute_ruzjv8_k$ = function (namespace, name, prefix, value) {
    this.delegate_1.attribute_ruzjv8_k$(namespace, name, prefix, value);
  };
  protoOf(AppendingWriter).cdsect_yhnzeu_k$ = function (text) {
    this.delegate_1.cdsect_yhnzeu_k$(text);
  };
  protoOf(AppendingWriter).comment_dbctn9_k$ = function (text) {
    this.delegate_1.comment_dbctn9_k$(text);
  };
  protoOf(AppendingWriter).docdecl_aom8aw_k$ = function (text) {
    this.delegate_1.docdecl_aom8aw_k$(text);
  };
  protoOf(AppendingWriter).endDocument_lstnba_k$ = function () {
    this.delegate_1.endDocument_lstnba_k$();
  };
  protoOf(AppendingWriter).endTag_yzukbv_k$ = function (namespace, localName, prefix) {
    this.delegate_1.endTag_yzukbv_k$(namespace, localName, prefix);
  };
  protoOf(AppendingWriter).entityRef_cqd3i2_k$ = function (text) {
    this.delegate_1.entityRef_cqd3i2_k$(text);
  };
  protoOf(AppendingWriter).getNamespaceUri_buhtgt_k$ = function (prefix) {
    return this.delegate_1.getNamespaceUri_buhtgt_k$(prefix);
  };
  protoOf(AppendingWriter).getPrefix_r4en0f_k$ = function (namespaceUri) {
    return this.delegate_1.getPrefix_r4en0f_k$(namespaceUri);
  };
  protoOf(AppendingWriter).ignorableWhitespace_7szqkg_k$ = function (text) {
    this.delegate_1.ignorableWhitespace_7szqkg_k$(text);
  };
  protoOf(AppendingWriter).namespaceAttr_w2rp18_k$ = function (namespacePrefix, namespaceUri) {
    this.delegate_1.namespaceAttr_w2rp18_k$(namespacePrefix, namespaceUri);
  };
  protoOf(AppendingWriter).namespaceAttr_vkifxg_k$ = function (namespacePrefix, namespaceUri) {
    this.delegate_1.namespaceAttr_vkifxg_k$(namespacePrefix, namespaceUri);
  };
  protoOf(AppendingWriter).namespaceAttr_b6cim8_k$ = function (namespace) {
    this.delegate_1.namespaceAttr_b6cim8_k$(namespace);
  };
  protoOf(AppendingWriter).processingInstruction_2btz8x_k$ = function (text) {
    this.delegate_1.processingInstruction_2btz8x_k$(text);
  };
  protoOf(AppendingWriter).processingInstruction_tweoff_k$ = function (target, data) {
    this.delegate_1.processingInstruction_tweoff_k$(target, data);
  };
  protoOf(AppendingWriter).setPrefix_clkvdo_k$ = function (prefix, namespaceUri) {
    this.delegate_1.setPrefix_clkvdo_k$(prefix, namespaceUri);
  };
  protoOf(AppendingWriter).setPrefix_e36xz8_k$ = function (prefix, namespaceUri) {
    this.delegate_1.setPrefix_e36xz8_k$(prefix, namespaceUri);
  };
  protoOf(AppendingWriter).startDocument_dbnt67_k$ = function (version, encoding, standalone) {
    this.delegate_1.startDocument_dbnt67_k$(version, encoding, standalone);
  };
  protoOf(AppendingWriter).startTag_pjuzbi_k$ = function (namespace, localName, prefix) {
    this.delegate_1.startTag_pjuzbi_k$(namespace, localName, prefix);
  };
  protoOf(AppendingWriter).text_x72pul_k$ = function (text) {
    this.delegate_1.text_x72pul_k$(text);
  };
  protoOf(AppendingWriter).close_yn9xrc_k$ = function () {
    try {
      var xmls = new XMLSerializer();
      var tmp = this.delegate_1.get_target_juba8q_k$();
      var domText = xmls.serializeToString(tmp instanceof Node ? tmp : THROW_CCE());
      this.target_1.append_jgojdo_k$(domText);
    }finally {
      this.delegate_1.close_yn9xrc_k$();
    }
  };
  protoOf(AppendingWriter).flush_shahbo_k$ = function () {
    this.delegate_1.flush_shahbo_k$();
  };
  function _get_target__ccs42i_0($this) {
    return $this.target_1;
  }
  function _get_delegate__idh0py_1($this) {
    return $this.delegate_1;
  }
  function WriterXmlWriter(target, delegate) {
    this.target_1 = target;
    this.delegate_1 = delegate;
  }
  protoOf(WriterXmlWriter).get_depth_iq7qmy_k$ = function () {
    return this.delegate_1.get_depth_iq7qmy_k$();
  };
  protoOf(WriterXmlWriter).set_indent_os83lr_k$ = function (value) {
    this.delegate_1.set_indent_os83lr_k$(value);
  };
  protoOf(WriterXmlWriter).get_indent_etpsj9_k$ = function () {
    return this.delegate_1.get_indent_etpsj9_k$();
  };
  protoOf(WriterXmlWriter).set_indentString_30d8vk_k$ = function (_set____db54di) {
    this.delegate_1.set_indentString_30d8vk_k$(_set____db54di);
  };
  protoOf(WriterXmlWriter).get_indentString_li4jl2_k$ = function () {
    return this.delegate_1.get_indentString_li4jl2_k$();
  };
  protoOf(WriterXmlWriter).get_namespaceContext_n7n1ib_k$ = function () {
    return this.delegate_1.get_namespaceContext_n7n1ib_k$();
  };
  protoOf(WriterXmlWriter).attribute_ruzjv8_k$ = function (namespace, name, prefix, value) {
    this.delegate_1.attribute_ruzjv8_k$(namespace, name, prefix, value);
  };
  protoOf(WriterXmlWriter).cdsect_yhnzeu_k$ = function (text) {
    this.delegate_1.cdsect_yhnzeu_k$(text);
  };
  protoOf(WriterXmlWriter).comment_dbctn9_k$ = function (text) {
    this.delegate_1.comment_dbctn9_k$(text);
  };
  protoOf(WriterXmlWriter).docdecl_aom8aw_k$ = function (text) {
    this.delegate_1.docdecl_aom8aw_k$(text);
  };
  protoOf(WriterXmlWriter).endDocument_lstnba_k$ = function () {
    this.delegate_1.endDocument_lstnba_k$();
  };
  protoOf(WriterXmlWriter).endTag_yzukbv_k$ = function (namespace, localName, prefix) {
    this.delegate_1.endTag_yzukbv_k$(namespace, localName, prefix);
  };
  protoOf(WriterXmlWriter).entityRef_cqd3i2_k$ = function (text) {
    this.delegate_1.entityRef_cqd3i2_k$(text);
  };
  protoOf(WriterXmlWriter).getNamespaceUri_buhtgt_k$ = function (prefix) {
    return this.delegate_1.getNamespaceUri_buhtgt_k$(prefix);
  };
  protoOf(WriterXmlWriter).getPrefix_r4en0f_k$ = function (namespaceUri) {
    return this.delegate_1.getPrefix_r4en0f_k$(namespaceUri);
  };
  protoOf(WriterXmlWriter).ignorableWhitespace_7szqkg_k$ = function (text) {
    this.delegate_1.ignorableWhitespace_7szqkg_k$(text);
  };
  protoOf(WriterXmlWriter).namespaceAttr_w2rp18_k$ = function (namespacePrefix, namespaceUri) {
    this.delegate_1.namespaceAttr_w2rp18_k$(namespacePrefix, namespaceUri);
  };
  protoOf(WriterXmlWriter).namespaceAttr_vkifxg_k$ = function (namespacePrefix, namespaceUri) {
    this.delegate_1.namespaceAttr_vkifxg_k$(namespacePrefix, namespaceUri);
  };
  protoOf(WriterXmlWriter).namespaceAttr_b6cim8_k$ = function (namespace) {
    this.delegate_1.namespaceAttr_b6cim8_k$(namespace);
  };
  protoOf(WriterXmlWriter).processingInstruction_2btz8x_k$ = function (text) {
    this.delegate_1.processingInstruction_2btz8x_k$(text);
  };
  protoOf(WriterXmlWriter).processingInstruction_tweoff_k$ = function (target, data) {
    this.delegate_1.processingInstruction_tweoff_k$(target, data);
  };
  protoOf(WriterXmlWriter).setPrefix_clkvdo_k$ = function (prefix, namespaceUri) {
    this.delegate_1.setPrefix_clkvdo_k$(prefix, namespaceUri);
  };
  protoOf(WriterXmlWriter).setPrefix_e36xz8_k$ = function (prefix, namespaceUri) {
    this.delegate_1.setPrefix_e36xz8_k$(prefix, namespaceUri);
  };
  protoOf(WriterXmlWriter).startDocument_dbnt67_k$ = function (version, encoding, standalone) {
    this.delegate_1.startDocument_dbnt67_k$(version, encoding, standalone);
  };
  protoOf(WriterXmlWriter).startTag_pjuzbi_k$ = function (namespace, localName, prefix) {
    this.delegate_1.startTag_pjuzbi_k$(namespace, localName, prefix);
  };
  protoOf(WriterXmlWriter).text_x72pul_k$ = function (text) {
    this.delegate_1.text_x72pul_k$(text);
  };
  protoOf(WriterXmlWriter).close_yn9xrc_k$ = function () {
    try {
      var xmls = new XMLSerializer();
      var tmp = this.delegate_1.get_target_juba8q_k$();
      var domText = xmls.serializeToString(tmp instanceof Node ? tmp : THROW_CCE());
      var xmlDeclMode = this.delegate_1.get_xmlDeclMode_lc8ced_k$();
      if (!xmlDeclMode.equals(XmlDeclMode_None_getInstance())) {
        var tmp_0;
        if (xmlDeclMode.get_ordinal_ip24qg_k$() === 3) {
          var tmp1_elvis_lhs = this.delegate_1.get_requestedEncoding_9du5vc_k$();
          tmp_0 = tmp1_elvis_lhs == null ? 'UTF-8' : tmp1_elvis_lhs;
        } else {
          var tmp2_safe_receiver = this.delegate_1.get_requestedEncoding_9du5vc_k$();
          var tmp_1;
          if (tmp2_safe_receiver == null) {
            tmp_1 = null;
          } else {
            // Inline function 'kotlin.text.lowercase' call
            // Inline function 'kotlin.js.asDynamic' call
            tmp_1 = tmp2_safe_receiver.toLowerCase();
          }
          var tmp3_safe_receiver = tmp_1;
          tmp_0 = (tmp3_safe_receiver == null ? null : startsWith(tmp3_safe_receiver, 'utf-')) === false ? this.delegate_1.get_requestedEncoding_9du5vc_k$() : null;
        }
        var encoding = tmp_0;
        var tmp5_elvis_lhs = this.delegate_1.get_requestedVersion_7huwyb_k$();
        var xmlVersion = tmp5_elvis_lhs == null ? '1.0' : tmp5_elvis_lhs;
        this.target_1.write_mozxwr_k$('<?xml version="');
        this.target_1.write_mozxwr_k$(xmlVersion);
        this.target_1.write_mozxwr_k$('"');
        if (!(encoding == null)) {
          this.target_1.write_mozxwr_k$(' encoding="');
          this.target_1.write_mozxwr_k$(encoding);
          this.target_1.write_mozxwr_k$('"');
        }
        this.target_1.write_mozxwr_k$('?>');
        // Inline function 'kotlin.collections.isNotEmpty' call
        if (!this.delegate_1.get_indentSequence_chovoq_k$().isEmpty_y1axqb_k$()) {
          this.target_1.write_mozxwr_k$('\n');
        }
      }
      this.target_1.write_mozxwr_k$(domText);
    }finally {
      this.delegate_1.close_yn9xrc_k$();
    }
  };
  protoOf(WriterXmlWriter).flush_shahbo_k$ = function () {
    this.delegate_1.flush_shahbo_k$();
  };
  function NamespaceContext() {
  }
  function prefixesFor(_this__u8e3s4, namespaceURI) {
    var tmp = _this__u8e3s4.getPrefixes_8uhuv8_k$(namespaceURI);
    return isInterface(tmp, Iterator) ? tmp : THROW_CCE();
  }
  function NamespaceContextImpl() {
  }
  function IOException_init_$Init$($this) {
    Exception_init_$Init$($this);
    IOException.call($this);
    return $this;
  }
  function IOException_init_$Create$() {
    var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
    captureStack(tmp, IOException_init_$Create$);
    return tmp;
  }
  function IOException_init_$Init$_0(message, $this) {
    Exception_init_$Init$_0(message, $this);
    IOException.call($this);
    return $this;
  }
  function IOException_init_$Create$_0(message) {
    var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
    captureStack(tmp, IOException_init_$Create$_0);
    return tmp;
  }
  function IOException_init_$Init$_1(message, cause, $this) {
    Exception_init_$Init$_1(message, cause, $this);
    IOException.call($this);
    return $this;
  }
  function IOException_init_$Create$_1(message, cause) {
    var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
    captureStack(tmp, IOException_init_$Create$_1);
    return tmp;
  }
  function IOException_init_$Init$_2(cause, $this) {
    Exception_init_$Init$_2(cause, $this);
    IOException.call($this);
    return $this;
  }
  function IOException_init_$Create$_2(cause) {
    var tmp = IOException_init_$Init$_2(cause, objectCreate(protoOf(IOException)));
    captureStack(tmp, IOException_init_$Create$_2);
    return tmp;
  }
  function IOException() {
    captureStack(this, IOException);
  }
  function _get_buffer__tgqkad($this) {
    return $this.buffer_1;
  }
  function StringWriter() {
    Writer.call(this);
    this.buffer_1 = StringBuilder_init_$Create$();
  }
  protoOf(StringWriter).write_mozxwr_k$ = function (text) {
    this.buffer_1.append_22ad7x_k$(text);
  };
  protoOf(StringWriter).toString = function () {
    return this.buffer_1.toString();
  };
  protoOf(StringWriter).append_am5a4z_k$ = function (value) {
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.core.impl.multiplatform.StringWriter.append.<anonymous>' call
    this.buffer_1.append_am5a4z_k$(value);
    return this;
  };
  protoOf(StringWriter).append_jgojdo_k$ = function (value) {
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.core.impl.multiplatform.StringWriter.append.<anonymous>' call
    this.buffer_1.append_jgojdo_k$(value);
    return this;
  };
  protoOf(StringWriter).append_xdc1zw_k$ = function (value, startIndex, endIndex) {
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.core.impl.multiplatform.StringWriter.append.<anonymous>' call
    this.buffer_1.append_xdc1zw_k$(value, startIndex, endIndex);
    return this;
  };
  function use(_this__u8e3s4, block) {
    try {
      return block(_this__u8e3s4);
    }finally {
      _this__u8e3s4.close_yn9xrc_k$();
    }
  }
  function Language(value, prefix, suffix) {
    prefix = prefix === VOID ? '' : prefix;
    suffix = suffix === VOID ? '' : suffix;
    this.value_1 = value;
    this.prefix_1 = prefix;
    this.suffix_1 = suffix;
  }
  protoOf(Language).get_value_j01efc_k$ = function () {
    return this.value_1;
  };
  protoOf(Language).get_prefix_i78za3_k$ = function () {
    return this.prefix_1;
  };
  protoOf(Language).get_suffix_jo1v8a_k$ = function () {
    return this.suffix_1;
  };
  protoOf(Language).equals = function (other) {
    if (!(other instanceof Language))
      return false;
    var tmp0_other_with_cast = other instanceof Language ? other : THROW_CCE();
    if (!(this.value_1 === tmp0_other_with_cast.value_1))
      return false;
    if (!(this.prefix_1 === tmp0_other_with_cast.prefix_1))
      return false;
    if (!(this.suffix_1 === tmp0_other_with_cast.suffix_1))
      return false;
    return true;
  };
  protoOf(Language).hashCode = function () {
    var result = imul(getStringHashCode('value'), 127) ^ getStringHashCode(this.value_1);
    result = result + (imul(getStringHashCode('prefix'), 127) ^ getStringHashCode(this.prefix_1)) | 0;
    result = result + (imul(getStringHashCode('suffix'), 127) ^ getStringHashCode(this.suffix_1)) | 0;
    return result;
  };
  protoOf(Language).toString = function () {
    return '@nl.adaptivity.xmlutil.core.impl.multiplatform.Language(value=' + this.value_1 + ', prefix=' + this.prefix_1 + ', suffix=' + this.suffix_1 + ')';
  };
  function assert(value, lazyMessage) {
    if (!value) {
      console.error('Assertion failed: ' + lazyMessage());
    }
  }
  function assert_0(value) {
    if (!value) {
      console.error('Assertion failed');
    }
  }
  function get_name_0(_this__u8e3s4) {
    return get_js(_this__u8e3s4).name;
  }
  function Closeable() {
  }
  function Throws(exceptionClasses) {
    this.exceptionClasses_1 = exceptionClasses;
  }
  protoOf(Throws).get_exceptionClasses_vg3mw0_k$ = function () {
    return this.exceptionClasses_1;
  };
  protoOf(Throws).equals = function (other) {
    if (!(other instanceof Throws))
      return false;
    var tmp0_other_with_cast = other instanceof Throws ? other : THROW_CCE();
    if (!contentEquals(this.exceptionClasses_1, tmp0_other_with_cast.exceptionClasses_1))
      return false;
    return true;
  };
  protoOf(Throws).hashCode = function () {
    return imul(getStringHashCode('exceptionClasses'), 127) ^ hashCode(this.exceptionClasses_1);
  };
  protoOf(Throws).toString = function () {
    return '@nl.adaptivity.xmlutil.core.impl.multiplatform.Throws(exceptionClasses=' + toString(this.exceptionClasses_1) + ')';
  };
  function Writer() {
  }
  function AutoCloseable() {
  }
  function Reader() {
  }
  protoOf(Reader).read_22xsm_k$ = function () {
    var b = charArray(1);
    if (this.read_l2ukak_k$(b, 0, 1) < 0)
      return -1;
    // Inline function 'kotlin.code' call
    var this_0 = b[0];
    return Char__toInt_impl_vasixd(this_0);
  };
  function _get_source__4cuw5s($this) {
    return $this.source_1;
  }
  function StringReader_init_$Init$(source, $this) {
    StringReader.call($this, isCharSequence(source) ? source : THROW_CCE());
    return $this;
  }
  function StringReader_init_$Create$(source) {
    return StringReader_init_$Init$(source, objectCreate(protoOf(StringReader)));
  }
  function _set_srcOffset__hgi03y($this, _set____db54di) {
    $this.srcOffset_1 = _set____db54di;
  }
  function _get_srcOffset__o9rlgm($this) {
    return $this.srcOffset_1;
  }
  function StringReader(source) {
    Reader.call(this);
    this.source_1 = toString(source);
    this.srcOffset_1 = 0;
  }
  protoOf(StringReader).read_22xsm_k$ = function () {
    var tmp;
    if (this.srcOffset_1 >= this.source_1.length) {
      tmp = -1;
    } else {
      // Inline function 'kotlin.code' call
      var tmp1 = this.srcOffset_1;
      this.srcOffset_1 = tmp1 + 1 | 0;
      var this_0 = charSequenceGet(this.source_1, tmp1);
      tmp = Char__toInt_impl_vasixd(this_0);
    }
    return tmp;
  };
  protoOf(StringReader).read_l2ukak_k$ = function (buf, offset, len) {
    if (this.srcOffset_1 >= this.source_1.length)
      return -1;
    // Inline function 'kotlin.comparisons.minOf' call
    var b = this.source_1.length - this.srcOffset_1 | 0;
    var count = Math.min(len, b);
    var inductionVariable = 0;
    if (inductionVariable < count)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        buf[i + offset | 0] = charSequenceGet(this.source_1, this.srcOffset_1 + i | 0);
      }
       while (inductionVariable < count);
    this.srcOffset_1 = this.srcOffset_1 + count | 0;
    return count;
  };
  function getData(_this__u8e3s4) {
    return _this__u8e3s4.data;
  }
  function getLength(_this__u8e3s4) {
    return _this__u8e3s4.length;
  }
  function getLength_0(_this__u8e3s4) {
    return _this__u8e3s4.length;
  }
  function getTarget(_this__u8e3s4) {
    return _this__u8e3s4.target;
  }
  function getData_0(_this__u8e3s4) {
    return _this__u8e3s4.data;
  }
  function Factory() {
  }
  protoOf(Factory).deserialize_qjywab_k$ = function (reader) {
    return Companion_getInstance_8().deserialize_qjywab_k$(reader);
  };
  function CompactFragment_init_$Init$(namespaces, content, $this) {
    CompactFragment.call($this);
    $this.namespaces_1 = Companion_getInstance_2().from_ls380c_k$(namespaces);
    var tmp = $this;
    var tmp1_elvis_lhs = content == null ? null : toString(content);
    tmp.contentString_1 = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
    return $this;
  }
  function CompactFragment_init_$Create$(namespaces, content) {
    return CompactFragment_init_$Init$(namespaces, content, objectCreate(protoOf(CompactFragment)));
  }
  function CompactFragment_init_$Init$_0(content, $this) {
    CompactFragment_init_$Init$_3(emptyList(), content, $this);
    return $this;
  }
  function CompactFragment_init_$Create$_0(content) {
    return CompactFragment_init_$Init$_0(content, objectCreate(protoOf(CompactFragment)));
  }
  function CompactFragment_init_$Init$_1(documentFragment, $this) {
    CompactFragment_init_$Init$_0((new XMLSerializer()).serializeToString(documentFragment), $this);
    return $this;
  }
  function CompactFragment_init_$Create$_1(documentFragment) {
    return CompactFragment_init_$Init$_1(documentFragment, objectCreate(protoOf(CompactFragment)));
  }
  function CompactFragment_init_$Init$_2(node, $this) {
    CompactFragment_init_$Init$_0((new XMLSerializer()).serializeToString(node), $this);
    return $this;
  }
  function CompactFragment_init_$Create$_2(node) {
    return CompactFragment_init_$Init$_2(node, objectCreate(protoOf(CompactFragment)));
  }
  function CompactFragment_init_$Init$_3(namespaces, content, $this) {
    CompactFragment.call($this);
    $this.namespaces_1 = Companion_getInstance_2().from_ls380c_k$(namespaces);
    $this.contentString_1 = content;
    return $this;
  }
  function CompactFragment_init_$Create$_3(namespaces, content) {
    return CompactFragment_init_$Init$_3(namespaces, content, objectCreate(protoOf(CompactFragment)));
  }
  function CompactFragment_init_$Init$_4(orig, $this) {
    CompactFragment.call($this);
    $this.namespaces_1 = Companion_getInstance_2().from_ls380c_k$(orig.get_namespaces_hgkq2n_k$());
    $this.contentString_1 = orig.get_contentString_6m1e0v_k$();
    return $this;
  }
  function CompactFragment_init_$Create$_4(orig) {
    return CompactFragment_init_$Init$_4(orig, objectCreate(protoOf(CompactFragment)));
  }
  function Companion_7() {
    Companion_instance_7 = this;
    this.FACTORY_1 = new Factory();
  }
  protoOf(Companion_7).get_FACTORY_4x2133_k$ = function () {
    return this.FACTORY_1;
  };
  protoOf(Companion_7).deserialize_qjywab_k$ = function (reader) {
    return siblingsToFragment(reader);
  };
  var Companion_instance_7;
  function Companion_getInstance_8() {
    if (Companion_instance_7 == null)
      new Companion_7();
    return Companion_instance_7;
  }
  function CompactFragment$toString$lambda(it) {
    return '"' + it.get_prefix_i78za3_k$() + ' -> ' + it.get_namespaceURI_g6nmhy_k$() + '"';
  }
  protoOf(CompactFragment).get_isEmpty_zauvru_k$ = function () {
    // Inline function 'kotlin.text.isEmpty' call
    var this_0 = this.contentString_1;
    return charSequenceLength(this_0) === 0;
  };
  protoOf(CompactFragment).get_namespaces_hgkq2n_k$ = function () {
    return this.namespaces_1;
  };
  protoOf(CompactFragment).get_content_h02jrk_k$ = function () {
    var tmp = 0;
    var tmp_0 = this.contentString_1.length;
    var tmp_1 = charArray(tmp_0);
    while (tmp < tmp_0) {
      var tmp_2 = tmp;
      tmp_1[tmp_2] = charSequenceGet(this.contentString_1, tmp_2);
      tmp = tmp + 1 | 0;
    }
    return tmp_1;
  };
  protoOf(CompactFragment).get_contentString_6m1e0v_k$ = function () {
    return this.contentString_1;
  };
  protoOf(CompactFragment).serialize_cilu77_k$ = function (out) {
    // Inline function 'kotlin.let' call
    // Inline function 'kotlin.contracts.contract' call
    var reader = Companion_getInstance_9().from_oh97vu_k$(this);
    serialize(out, reader);
  };
  protoOf(CompactFragment).getXmlReader_rf4t18_k$ = function () {
    return Companion_getInstance_9().from_oh97vu_k$(this);
  };
  protoOf(CompactFragment).equals = function (other) {
    if (this === other)
      return true;
    if (other == null ? true : get_prototype(this) != get_prototype(other))
      return false;
    var that = (other == null ? true : isInterface(other, ICompactFragment)) ? other : THROW_CCE();
    if (!equals(this.namespaces_1, ensureNotNull(that).get_namespaces_hgkq2n_k$()))
      return false;
    return this.contentString_1 === that.get_contentString_6m1e0v_k$();
  };
  protoOf(CompactFragment).hashCode = function () {
    var result = hashCode(this.namespaces_1);
    result = imul(31, result) + getStringHashCode(this.contentString_1) | 0;
    return result;
  };
  protoOf(CompactFragment).toString = function () {
    // Inline function 'kotlin.text.buildString' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.util.CompactFragment.toString.<anonymous>' call
    this_0.append_22ad7x_k$('{namespaces=[');
    joinTo(this.namespaces_1, this_0, VOID, VOID, VOID, VOID, VOID, CompactFragment$toString$lambda);
    this_0.append_22ad7x_k$('], content=').append_22ad7x_k$(this.contentString_1).append_am5a4z_k$(_Char___init__impl__6a9atx(125));
    return this_0.toString();
  };
  function CompactFragment() {
    Companion_getInstance_8();
  }
  function get_prototype(_this__u8e3s4) {
    // Inline function 'nl.adaptivity.xmlutil.util.<get-prototype>.prototype' call
    return _this__u8e3s4.prototype;
  }
  function _get_prototype_$prototype_wp0qp9(o) {
    return o.prototype;
  }
  function FragmentNamespaceContext_init_$Init$(parent, prefixes, namespaces, $this) {
    SimpleNamespaceContext_init_$Init$_1(prefixes, namespaces, $this);
    FragmentNamespaceContext.call($this);
    $this.parent_1 = parent;
    return $this;
  }
  function FragmentNamespaceContext_init_$Create$(parent, prefixes, namespaces) {
    return FragmentNamespaceContext_init_$Init$(parent, prefixes, namespaces, objectCreate(protoOf(FragmentNamespaceContext)));
  }
  function FragmentNamespaceContext_init_$Init$_0(parent, original, $this) {
    SimpleNamespaceContext_init_$Init$_5(original, $this);
    FragmentNamespaceContext.call($this);
    $this.parent_1 = parent;
    return $this;
  }
  function FragmentNamespaceContext_init_$Create$_0(parent, original) {
    return FragmentNamespaceContext_init_$Init$_0(parent, original, objectCreate(protoOf(FragmentNamespaceContext)));
  }
  function getLocalNamespaceUri($this, prefix) {
    var inductionVariable = $this.get_size_woubt6_k$() - 1 | 0;
    if (0 <= inductionVariable)
      do {
        var i = inductionVariable;
        inductionVariable = inductionVariable + -1 | 0;
        if (prefix === $this.getPrefix_wrbewg_k$(i)) {
          return $this.getNamespaceURI_7dpe6n_k$(i);
        }
      }
       while (0 <= inductionVariable);
    return null;
  }
  function _get_WRAPPERPPREFIX__49r2zg($this) {
    return $this.WRAPPERPPREFIX_1;
  }
  function _get_WRAPPERNAMESPACE__hfk9sz($this) {
    return $this.WRAPPERNAMESPACE_1;
  }
  function getDelegate($this, text, wrapperNamespaceContext) {
    // Inline function 'kotlin.text.buildString' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.apply' call
    var this_0 = StringBuilder_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'nl.adaptivity.xmlutil.util.Companion.getDelegate.<anonymous>' call
    this_0.append_22ad7x_k$('<SDFKLJDSF:wrapper xmlns:SDFKLJDSF="http://wrapperns"');
    var tmp0_iterator = wrapperNamespaceContext.iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var ns = tmp0_iterator.next_20eer_k$();
      var prefix = ns.get_prefix_i78za3_k$();
      var uri = ns.get_namespaceURI_g6nmhy_k$();
      if (XMLConstants_getInstance().get_DEFAULT_NS_PREFIX_h2n08r_k$() === prefix) {
        this_0.append_22ad7x_k$(' xmlns');
      } else {
        this_0.append_22ad7x_k$(' xmlns:').append_22ad7x_k$(prefix);
      }
      this_0.append_22ad7x_k$('="').append_22ad7x_k$(xmlEncode(uri)).append_am5a4z_k$(_Char___init__impl__6a9atx(34));
    }
    this_0.append_22ad7x_k$(' >');
    var wrapper = this_0.toString();
    var actualInput = wrapper + text + '<\/SDFKLJDSF:wrapper>';
    var parser = new DOMParser();
    var tmp = parser.parseFromString(actualInput, 'text/xml');
    return new DomReader(!(tmp == null) ? tmp : THROW_CCE());
  }
  protoOf(FragmentNamespaceContext).get_parent_hy4reb_k$ = function () {
    return this.parent_1;
  };
  protoOf(FragmentNamespaceContext).freeze_kxzejt_k$ = function () {
    return this;
  };
  protoOf(FragmentNamespaceContext).getNamespaceURI_859c43_k$ = function (prefix) {
    var namespaceURI = protoOf(SimpleNamespaceContext).getNamespaceURI_859c43_k$.call(this, prefix);
    var tmp0_safe_receiver = this.parent_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      return tmp0_safe_receiver.getNamespaceURI_859c43_k$(prefix);
    }
    return namespaceURI;
  };
  protoOf(FragmentNamespaceContext).getPrefix_7o0aoe_k$ = function (namespaceURI) {
    var prefix = protoOf(SimpleNamespaceContext).getPrefix_7o0aoe_k$.call(this, namespaceURI);
    if (prefix == null ? !(this.parent_1 == null) : false) {
      return this.parent_1.getPrefix_7o0aoe_k$(namespaceURI);
    }
    return prefix;
  };
  protoOf(FragmentNamespaceContext).getPrefixes_8uhuv8_k$ = function (namespaceURI) {
    if (this.parent_1 == null) {
      return protoOf(SimpleNamespaceContext).getPrefixes_8uhuv8_k$.call(this, namespaceURI);
    }
    var prefixes = HashSet_init_$Create$();
    // Inline function 'kotlin.run' call
    // Inline function 'kotlin.contracts.contract' call
    var it = protoOf(SimpleNamespaceContext).getPrefixes_8uhuv8_k$.call(this, namespaceURI);
    while (it.hasNext_bitz1p_k$()) {
      prefixes.add_utx5q5_k$(it.next_20eer_k$());
    }
    var it_0 = this.parent_1.getPrefixes_8uhuv8_k$(namespaceURI);
    while (it_0.hasNext_bitz1p_k$()) {
      var prefix = it_0.next_20eer_k$();
      var localNamespaceUri = getLocalNamespaceUri(this, prefix);
      if (localNamespaceUri == null) {
        prefixes.add_utx5q5_k$(prefix);
      }
    }
    return prefixes.iterator_jk1svi_k$();
  };
  function FragmentNamespaceContext() {
  }
  function _set_localNamespaceContext__yq6ime($this, _set____db54di) {
    $this.localNamespaceContext_1 = _set____db54di;
  }
  function _get_localNamespaceContext__skk66q($this) {
    return $this.localNamespaceContext_1;
  }
  function extendNamespace($this) {
    var namespaceDecls = $this.get_delegate_i94tki_k$().get_namespaceDecls_1u0o6v_k$();
    var nscount = namespaceDecls.get_size_woubt6_k$();
    var tmp = 0;
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_0 = fillArrayVal(Array(nscount), null);
    while (tmp < nscount) {
      var tmp_1 = tmp;
      tmp_0[tmp_1] = namespaceDecls.get_c1px32_k$(tmp_1).get_prefix_i78za3_k$();
      tmp = tmp + 1 | 0;
    }
    var prefixes = tmp_0;
    var tmp_2 = 0;
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp_3 = fillArrayVal(Array(nscount), null);
    while (tmp_2 < nscount) {
      var tmp_4 = tmp_2;
      tmp_3[tmp_4] = namespaceDecls.get_c1px32_k$(tmp_4).get_namespaceURI_g6nmhy_k$();
      tmp_2 = tmp_2 + 1 | 0;
    }
    var namespaces = tmp_3;
    $this.localNamespaceContext_1 = FragmentNamespaceContext_init_$Create$($this.localNamespaceContext_1, prefixes, namespaces);
  }
  function Companion_8() {
    Companion_instance_8 = this;
    this.WRAPPERPPREFIX_1 = 'SDFKLJDSF';
    this.WRAPPERNAMESPACE_1 = 'http://wrapperns';
  }
  protoOf(Companion_8).from_oh97vu_k$ = function (fragment) {
    return new XMLFragmentStreamReader(fragment.get_contentString_6m1e0v_k$(), fragment.get_namespaces_hgkq2n_k$());
  };
  var Companion_instance_8;
  function Companion_getInstance_9() {
    if (Companion_instance_8 == null)
      new Companion_8();
    return Companion_instance_8;
  }
  function XMLFragmentStreamReader(text, wrapperNamespaceContext) {
    Companion_getInstance_9();
    XmlDelegatingReader.call(this, getDelegate(Companion_getInstance_9(), text, wrapperNamespaceContext));
    var tmp = this;
    // Inline function 'kotlin.emptyArray' call
    var tmp_0 = [];
    // Inline function 'kotlin.emptyArray' call
    var tmp$ret$1 = [];
    tmp.localNamespaceContext_1 = FragmentNamespaceContext_init_$Create$(null, tmp_0, tmp$ret$1);
    if (this.get_delegate_i94tki_k$().get_eventType_918hfv_k$() === EventType_START_ELEMENT_getInstance()) {
      extendNamespace(this);
    }
  }
  protoOf(XMLFragmentStreamReader).next_20eer_k$ = function () {
    var result = this.get_delegate_i94tki_k$().next_20eer_k$();
    switch (result.get_ordinal_ip24qg_k$()) {
      case 7:
        return result;
      case 0:
      case 11:
      case 6:
        return this.next_20eer_k$();
      case 1:
        if ('http://wrapperns' === this.get_delegate_i94tki_k$().get_namespaceURI_g6nmhy_k$())
          return this.next_20eer_k$();
        extendNamespace(this);
        break;
      case 2:
        if ('http://wrapperns' === this.get_delegate_i94tki_k$().get_namespaceURI_g6nmhy_k$()) {
          return this.get_delegate_i94tki_k$().next_20eer_k$();
        }

        var tmp = this;
        var tmp1_elvis_lhs = this.localNamespaceContext_1.parent_1;
        tmp.localNamespaceContext_1 = tmp1_elvis_lhs == null ? this.localNamespaceContext_1 : tmp1_elvis_lhs;
        break;
      default:
        break;
    }
    return result;
  };
  protoOf(XMLFragmentStreamReader).getNamespaceURI_859c43_k$ = function (prefix) {
    if ('SDFKLJDSF' === prefix)
      return null;
    return protoOf(XmlDelegatingReader).getNamespaceURI_859c43_k$.call(this, prefix);
  };
  protoOf(XMLFragmentStreamReader).getNamespacePrefix_8fyoot_k$ = function (namespaceUri) {
    if ('http://wrapperns' === namespaceUri)
      return null;
    return protoOf(XmlDelegatingReader).getNamespacePrefix_8fyoot_k$.call(this, namespaceUri);
  };
  protoOf(XMLFragmentStreamReader).get_namespaceContext_n7n1ib_k$ = function () {
    return this.localNamespaceContext_1;
  };
  function createDocument(rootElementName) {
    var tmp = document.implementation;
    var tmp0_elvis_lhs = rootElementName.getNamespaceURI_665tvr_k$();
    var tmp_0 = tmp.createDocument(tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs, toCName(rootElementName));
    return !(tmp_0 == null) ? tmp_0 : THROW_CCE();
  }
  //region block: post-declaration
  protoOf(DomReader$namespaceContext$1).plus_4d2jm7_k$ = plus_0;
  protoOf(DomReader$namespaceContext$1).getPrefixes_8uhuv8_k$ = getPrefixes;
  protoOf(DomReader).nextTag_ujozaf_k$ = nextTag;
  protoOf(DomReader).get_name_woqyms_k$ = get_name;
  protoOf(DomReader).require_glcost_k$ = require_0;
  protoOf(DomReader).require_e8zaef_k$ = require_1;
  protoOf(DomReader).getAttributeName_q93fq1_k$ = getAttributeName;
  protoOf(DomReader).getAttributeValue_j0o48g_k$ = getAttributeValue;
  protoOf(DomReader).isWhitespace_ujiz09_k$ = isWhitespace;
  protoOf(DomReader).isEndElement_c65r3f_k$ = isEndElement;
  protoOf(DomReader).isCharacters_eiwdzg_k$ = isCharacters;
  protoOf(DomReader).isStartElement_spryx0_k$ = isStartElement;
  protoOf(DomWriter$namespaceContext$1).getPrefixes_8uhuv8_k$ = getPrefixes;
  protoOf(PlatformXmlWriterBase).setPrefix_clkvdo_k$ = setPrefix;
  protoOf(PlatformXmlWriterBase).namespaceAttr_w2rp18_k$ = namespaceAttr;
  protoOf(PlatformXmlWriterBase).namespaceAttr_b6cim8_k$ = namespaceAttr_0;
  protoOf(PlatformXmlWriterBase).processingInstruction_tweoff_k$ = processingInstruction;
  protoOf(PlatformXmlWriterBase).startDocument$default_lmadgb_k$ = startDocument$default;
  protoOf(SimpleNamespace).component1_7eebsc_k$ = component1;
  protoOf(SimpleNamespace).component2_7eebsb_k$ = component2;
  protoOf(SimpleNamespaceContext).getPrefixes_8uhuv8_k$ = getPrefixes;
  protoOf(XmlBufferedReaderBase).get_name_woqyms_k$ = get_name;
  protoOf(XmlBufferedReaderBase).require_glcost_k$ = require_0;
  protoOf(XmlBufferedReaderBase).require_e8zaef_k$ = require_1;
  protoOf(XmlBufferedReaderBase).getAttributeName_q93fq1_k$ = getAttributeName;
  protoOf(XmlBufferedReaderBase).getAttributeValue_j0o48g_k$ = getAttributeValue;
  protoOf(XmlBufferedReaderBase).isWhitespace_ujiz09_k$ = isWhitespace;
  protoOf(XmlBufferedReaderBase).isEndElement_c65r3f_k$ = isEndElement;
  protoOf(XmlBufferedReaderBase).isCharacters_eiwdzg_k$ = isCharacters;
  protoOf(XmlBufferedReaderBase).isStartElement_spryx0_k$ = isStartElement;
  protoOf(NamespaceImpl).component1_7eebsc_k$ = component1;
  protoOf(NamespaceImpl).component2_7eebsb_k$ = component2;
  protoOf(KtXmlReader).get_name_woqyms_k$ = get_name;
  protoOf(KtXmlReader).require_e8zaef_k$ = require_1;
  protoOf(KtXmlReader).getAttributeName_q93fq1_k$ = getAttributeName;
  protoOf(KtXmlReader).getAttributeValue_j0o48g_k$ = getAttributeValue;
  protoOf(KtXmlReader).isEndElement_c65r3f_k$ = isEndElement;
  protoOf(KtXmlReader).isCharacters_eiwdzg_k$ = isCharacters;
  protoOf(KtXmlReader).isStartElement_spryx0_k$ = isStartElement;
  protoOf(NamespaceHolder$namespaceContext$1).plus_4d2jm7_k$ = plus_0;
  protoOf(NamespaceHolder$namespaceContext$1).getPrefixes_8uhuv8_k$ = getPrefixes;
  protoOf(AppendingWriter).startDocument$default_lmadgb_k$ = startDocument$default;
  protoOf(WriterXmlWriter).startDocument$default_lmadgb_k$ = startDocument$default;
  //endregion
  //region block: init
  WRAPPERNAMESPACE = 'http://wrapperns';
  WRAPPERQNAME = 'SDFKLJDSF:afjlfxkls';
  //endregion
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = XmlVersion_XML11_getInstance;
  _.$_$.b = EventType_CDSECT_getInstance;
  _.$_$.c = EventType_END_DOCUMENT_getInstance;
  _.$_$.d = EventType_END_ELEMENT_getInstance;
  _.$_$.e = EventType_IGNORABLE_WHITESPACE_getInstance;
  _.$_$.f = EventType_START_ELEMENT_getInstance;
  _.$_$.g = EventType_TEXT_getInstance;
  _.$_$.h = XmlDeclMode_Auto_getInstance;
  _.$_$.i = XmlDeclMode_Minimal_getInstance;
  _.$_$.j = XmlDeclMode_None_getInstance;
  _.$_$.k = startDocument$default;
  _.$_$.l = CompactFragment_init_$Create$_3;
  _.$_$.m = CompactFragment_init_$Create$_4;
  _.$_$.n = CompactFragment_init_$Create$_0;
  _.$_$.o = QName_init_$Create$_0;
  _.$_$.p = QName_init_$Create$;
  _.$_$.q = XmlException_init_$Create$_0;
  _.$_$.r = NodeConsts_getInstance;
  _.$_$.s = Companion_getInstance_1;
  _.$_$.t = QNameSerializer_getInstance;
  _.$_$.u = XMLConstants_getInstance;
  _.$_$.v = XmlStreaming_getInstance;
  _.$_$.w = StringWriter;
  _.$_$.x = assert_0;
  _.$_$.y = assert;
  _.$_$.z = get_name_0;
  _.$_$.a1 = countIndentedLength;
  _.$_$.b1 = iterator;
  _.$_$.c1 = iterator_0;
  _.$_$.d1 = createDocument;
  _.$_$.e1 = CompactFragment;
  _.$_$.f1 = ICompactFragment;
  _.$_$.g1 = DomWriter;
  _.$_$.h1 = getPrefixes;
  _.$_$.i1 = NamespaceContextImpl;
  _.$_$.j1 = QName;
  _.$_$.k1 = XmlBufferedReader;
  _.$_$.l1 = EndElementEvent;
  _.$_$.m1 = NamespaceImpl;
  _.$_$.n1 = get_indent;
  _.$_$.o1 = set_indent;
  _.$_$.p1 = namespaceAttr;
  _.$_$.q1 = namespaceAttr_0;
  _.$_$.r1 = processingInstruction;
  _.$_$.s1 = setPrefix;
  _.$_$.t1 = XmlWriter;
  _.$_$.u1 = allConsecutiveTextContent;
  _.$_$.v1 = allText;
  _.$_$.w1 = elementContentToFragment;
  _.$_$.x1 = elementToFragment;
  _.$_$.y1 = endTag;
  _.$_$.z1 = isEquivalent;
  _.$_$.a2 = readSimpleElement;
  _.$_$.b2 = siblingsToFragment;
  _.$_$.c2 = skipPreamble;
  _.$_$.d2 = smartStartTag_2;
  _.$_$.e2 = smartStartTag_0;
  _.$_$.f2 = toCName;
  _.$_$.g2 = toNamespace;
  _.$_$.h2 = toQname;
  _.$_$.i2 = writeAttribute;
  _.$_$.j2 = writeElement;
  _.$_$.k2 = xmlCollapseWhitespace;
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js')));

//# sourceMappingURL=xmlutil-core.js.map
