Exit Full View

Games Cupboard / gamescupboard-client / build / compileSync / main / productionExecutable / kotlin / korlibs-korgw.js

(function (root, factory) {
  if (typeof define === 'function' && define.amd)
    define(['exports', './korlibs-korio.js', './kotlin-kotlin-stdlib-js-ir.js', './korlibs-kds.js', './korlibs-kmem.js', './korlibs-korma.js', './korlibs-klogger.js', './korlibs-korim.js', './korlibs-klock.js', './kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js', './korlibs-krypto.js'], factory);
  else if (typeof exports === 'object')
    factory(module.exports, require('./korlibs-korio.js'), require('./kotlin-kotlin-stdlib-js-ir.js'), require('./korlibs-kds.js'), require('./korlibs-kmem.js'), require('./korlibs-korma.js'), require('./korlibs-klogger.js'), require('./korlibs-korim.js'), require('./korlibs-klock.js'), require('./kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js'), require('./korlibs-krypto.js'));
  else {
    if (typeof this['korlibs-korio'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-korio' was not found. Please, check whether 'korlibs-korio' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-kds'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-kds' was not found. Please, check whether 'korlibs-kds' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-kmem'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-kmem' was not found. Please, check whether 'korlibs-kmem' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-korma'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-korma' was not found. Please, check whether 'korlibs-korma' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-klogger'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-klogger' was not found. Please, check whether 'korlibs-klogger' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-korim'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-korim' was not found. Please, check whether 'korlibs-korim' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-klock'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-klock' was not found. Please, check whether 'korlibs-klock' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['kotlinx.coroutines-kotlinx-coroutines-core-js-ir'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'kotlinx.coroutines-kotlinx-coroutines-core-js-ir' was not found. Please, check whether 'kotlinx.coroutines-kotlinx-coroutines-core-js-ir' is loaded prior to 'korlibs-korgw'.");
    }
    if (typeof this['korlibs-krypto'] === 'undefined') {
      throw new Error("Error loading module 'korlibs-korgw'. Its dependency 'korlibs-krypto' was not found. Please, check whether 'korlibs-krypto' is loaded prior to 'korlibs-korgw'.");
    }
    root['korlibs-korgw'] = factory(typeof this['korlibs-korgw'] === 'undefined' ? {} : this['korlibs-korgw'], this['korlibs-korio'], this['kotlin-kotlin-stdlib-js-ir'], this['korlibs-kds'], this['korlibs-kmem'], this['korlibs-korma'], this['korlibs-klogger'], this['korlibs-korim'], this['korlibs-klock'], this['kotlinx.coroutines-kotlinx-coroutines-core-js-ir'], this['korlibs-krypto']);
  }
}(this, function (_, kotlin_com_soywiz_korlibs_korio_korio, kotlin_kotlin, kotlin_com_soywiz_korlibs_kds_kds, kotlin_com_soywiz_korlibs_kmem_kmem, kotlin_com_soywiz_korlibs_korma_korma, kotlin_com_soywiz_korlibs_klogger_klogger, kotlin_com_soywiz_korlibs_korim_korim, kotlin_com_soywiz_korlibs_klock_klock, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_com_soywiz_korlibs_krypto_krypto) {
  'use strict';
  //region block: imports
  var imul = Math.imul;
  var unsupported = kotlin_com_soywiz_korlibs_korio_korio.$_$.q1;
  var unsupported$default = kotlin_com_soywiz_korlibs_korio_korio.$_$.k3;
  var interfaceMeta = kotlin_kotlin.$_$.yc;
  var charSequenceGet = kotlin_kotlin.$_$.mc;
  var Unit_getInstance = kotlin_kotlin.$_$.k5;
  var Char__toByte_impl_7s7yt0 = kotlin_kotlin.$_$.w3;
  var numberToChar = kotlin_kotlin.$_$.sd;
  var Char = kotlin_kotlin.$_$.nh;
  var toString = kotlin_kotlin.$_$.hj;
  var classMeta = kotlin_kotlin.$_$.pc;
  var objectMeta = kotlin_kotlin.$_$.wd;
  var Mixin_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.k2;
  var OS_getInstance = kotlin_com_soywiz_korlibs_korio_korio.$_$.q4;
  var Extra = kotlin_com_soywiz_korlibs_kds_kds.$_$.g;
  var lazy = kotlin_kotlin.$_$.yi;
  var NotImplementedError_init_$Create$ = kotlin_kotlin.$_$.k1;
  var until = kotlin_kotlin.$_$.ye;
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m1;
  var toSet = kotlin_kotlin.$_$.va;
  var split$default = kotlin_kotlin.$_$.c1;
  var ensureNotNull = kotlin_kotlin.$_$.ri;
  var Companion_getInstance = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.v3;
  var Companion_getInstance_0 = kotlin_com_soywiz_korlibs_korma_korma.$_$.q5;
  var Console_getInstance = kotlin_com_soywiz_korlibs_klogger_klogger.$_$.e;
  var get_nextPowerOfTwo = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.d2;
  var THROW_CCE = kotlin_kotlin.$_$.di;
  var fastArrayListOf = kotlin_com_soywiz_korlibs_kds_kds.$_$.b1;
  var toList = kotlin_kotlin.$_$.ma;
  var toString_0 = kotlin_kotlin.$_$.ae;
  var isFloatArray = kotlin_kotlin.$_$.gd;
  var CoroutineImpl = kotlin_kotlin.$_$.yb;
  var SequenceScope = kotlin_kotlin.$_$.gf;
  var to = kotlin_kotlin.$_$.ij;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.gb;
  var Companion_getInstance_1 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.u3;
  var Enum = kotlin_kotlin.$_$.sh;
  var get_niceStr = kotlin_com_soywiz_korlibs_korio_korio.$_$.m2;
  var hashCode = kotlin_kotlin.$_$.xc;
  var Long = kotlin_kotlin.$_$.xh;
  var ForcedTexId = kotlin_com_soywiz_korlibs_korim_korim.$_$.r;
  var isInterface = kotlin_kotlin.$_$.id;
  var get_isPowerOfTwo = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.z1;
  var Closeable = kotlin_com_soywiz_korlibs_korio_korio.$_$.w;
  var equals = kotlin_kotlin.$_$.rc;
  var FloatArrayList = kotlin_com_soywiz_korlibs_kds_kds.$_$.l;
  var IntArrayList = kotlin_com_soywiz_korlibs_kds_kds.$_$.p;
  var FBuffer = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.c;
  var isIntArray = kotlin_kotlin.$_$.hd;
  var isShortArray = kotlin_kotlin.$_$.md;
  var isByteArray = kotlin_kotlin.$_$.bd;
  var noWhenBranchMatchedException = kotlin_kotlin.$_$.zi;
  var getNumberHashCode = kotlin_kotlin.$_$.uc;
  var FastArrayList_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.d2;
  var Companion_getInstance_2 = kotlin_com_soywiz_korlibs_korma_korma.$_$.r5;
  var PerformanceCounter_getInstance = kotlin_com_soywiz_korlibs_klock_klock.$_$.c1;
  var Companion_getInstance_3 = kotlin_com_soywiz_korlibs_klock_klock.$_$.e1;
  var TimeSpan = kotlin_com_soywiz_korlibs_klock_klock.$_$.c;
  var List = kotlin_kotlin.$_$.x5;
  var iterator = kotlin_kotlin.$_$.hf;
  var zip = kotlin_kotlin.$_$.bb;
  var joinToString$default = kotlin_kotlin.$_$.m;
  var Iterable = kotlin_kotlin.$_$.s5;
  var ByteUnits = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.a;
  var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.p1;
  var Pool_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.s2;
  var Companion_getInstance_4 = kotlin_com_soywiz_korlibs_korma_korma.$_$.t5;
  var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.x1;
  var HashMap_init_$Create$ = kotlin_kotlin.$_$.p1;
  var runBlockingNoJs$default = kotlin_com_soywiz_korlibs_korio_korio.$_$.g3;
  var _RGBA___get_rf__impl__kvz75k = kotlin_com_soywiz_korlibs_korim_korim.$_$.h3;
  var _RGBA___get_gf__impl__5gcu1f = kotlin_com_soywiz_korlibs_korim_korim.$_$.f3;
  var _RGBA___get_bf__impl__1xz5yg = kotlin_com_soywiz_korlibs_korim_korim.$_$.e3;
  var _RGBA___get_af__impl__vu36qv = kotlin_com_soywiz_korlibs_korim_korim.$_$.d3;
  var Colors_getInstance = kotlin_com_soywiz_korlibs_korim_korim.$_$.t3;
  var RGBA = kotlin_com_soywiz_korlibs_korim_korim.$_$.c1;
  var nextMultipleOf = kotlin_com_soywiz_korlibs_korma_korma.$_$.d3;
  var last = kotlin_kotlin.$_$.a9;
  var KMutableProperty0 = kotlin_kotlin.$_$.af;
  var getPropertyCallableRef = kotlin_kotlin.$_$.vc;
  var KMutableProperty1 = kotlin_kotlin.$_$.bf;
  var KProperty1 = kotlin_kotlin.$_$.ef;
  var SuspendFunction1 = kotlin_kotlin.$_$.ac;
  var finsert8 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.n1;
  var CompletableDeferred$default = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
  var NonRecursiveLock = kotlin_com_soywiz_korlibs_kds_kds.$_$.c;
  var Pool_init_$Create$_0 = kotlin_com_soywiz_korlibs_kds_kds.$_$.t2;
  var TGenDeque = kotlin_com_soywiz_korlibs_kds_kds.$_$.v;
  var get_hex = kotlin_com_soywiz_korlibs_krypto_krypto.$_$.c;
  var NotImplementedError = kotlin_kotlin.$_$.zh;
  var getOrNull = kotlin_kotlin.$_$.j8;
  var finsert4 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.m1;
  var finsert = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.o1;
  var finsert24 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.l1;
  var finsert16 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.k1;
  var TGenDeque_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.g2;
  var IntDeque = kotlin_com_soywiz_korlibs_kds_kds.$_$.q;
  var FloatDeque = kotlin_com_soywiz_korlibs_kds_kds.$_$.m;
  var ConcurrentPool_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.i2;
  var IntSet = kotlin_com_soywiz_korlibs_kds_kds.$_$.r;
  var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.x2;
  var toIntRound = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.d3;
  var _RectangleInt___get_rect__impl__gu7bbg = kotlin_com_soywiz_korlibs_korma_korma.$_$.s4;
  var RectangleInt = kotlin_com_soywiz_korlibs_korma_korma.$_$.q1;
  var numberToInt = kotlin_kotlin.$_$.ud;
  var getExtraTyped = kotlin_com_soywiz_korlibs_kds_kds.$_$.j1;
  var setExtra = kotlin_com_soywiz_korlibs_kds_kds.$_$.q1;
  var RuntimeException = kotlin_kotlin.$_$.ci;
  var RuntimeException_init_$Init$ = kotlin_kotlin.$_$.h3;
  var captureStack = kotlin_kotlin.$_$.jc;
  var replace$default = kotlin_kotlin.$_$.z;
  var isCharSequence = kotlin_kotlin.$_$.dd;
  var trim = kotlin_kotlin.$_$.kh;
  var toIntOrNull = kotlin_kotlin.$_$.qg;
  var PropertyThis_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.m2;
  var getOrNull_0 = kotlin_kotlin.$_$.k8;
  var arraycopy = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.s;
  var arraycopy_0 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.r;
  var FloatBitmap32 = kotlin_com_soywiz_korlibs_korim_korim.$_$.q;
  var arraycopy_1 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.m;
  var Bitmap8 = kotlin_com_soywiz_korlibs_korim_korim.$_$.a;
  var NativeImage = kotlin_com_soywiz_korlibs_korim_korim.$_$.u;
  var listOf = kotlin_kotlin.$_$.c9;
  var Matrix3D = kotlin_com_soywiz_korlibs_korma_korma.$_$.m1;
  var get_currentThreadId = kotlin_com_soywiz_korlibs_korio_korio.$_$.g1;
  var get_currentThreadName = kotlin_com_soywiz_korlibs_korio_korio.$_$.h1;
  var contains$default = kotlin_kotlin.$_$.q;
  var println = kotlin_kotlin.$_$.fc;
  var printStackTrace$default = kotlin_com_soywiz_korlibs_korio_korio.$_$.i3;
  var toLong = kotlin_kotlin.$_$.yd;
  var isArray = kotlin_kotlin.$_$.zc;
  var MajorOrder_COLUMN_getInstance = kotlin_com_soywiz_korlibs_korma_korma.$_$.p3;
  var copyToFloatWxH = kotlin_com_soywiz_korlibs_korma_korma.$_$.e2;
  var invalidOp = kotlin_com_soywiz_korlibs_korio_korio.$_$.j1;
  var arraycopy_2 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.u;
  var isBooleanArray = kotlin_kotlin.$_$.ad;
  var Vector3D = kotlin_com_soywiz_korlibs_korma_korma.$_$.u1;
  var _RGBAf___get_data__impl__yt2t4 = kotlin_com_soywiz_korlibs_korim_korim.$_$.l3;
  var RGBAf = kotlin_com_soywiz_korlibs_korim_korim.$_$.b1;
  var Point = kotlin_com_soywiz_korlibs_korma_korma.$_$.p1;
  var numberToDouble = kotlin_kotlin.$_$.td;
  var isNumber = kotlin_kotlin.$_$.kd;
  var launchImmediately = kotlin_com_soywiz_korlibs_korio_korio.$_$.c;
  var SuspendFunction0 = kotlin_kotlin.$_$.zb;
  var FastStringMap = kotlin_com_soywiz_korlibs_kds_kds.$_$.k;
  var get_niceStr_0 = kotlin_com_soywiz_korlibs_korio_korio.$_$.n2;
  var coerceAtLeast = kotlin_kotlin.$_$.me;
  var THROW_IAE = kotlin_kotlin.$_$.ei;
  var getProgressionLastElement = kotlin_kotlin.$_$.ec;
  var collectionSizeOrDefault = kotlin_kotlin.$_$.p6;
  var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.l1;
  var checkIndexOverflow = kotlin_kotlin.$_$.n6;
  var addAll = kotlin_kotlin.$_$.j6;
  var listOf_0 = kotlin_kotlin.$_$.d9;
  var sorted = kotlin_kotlin.$_$.y9;
  var distinct = kotlin_kotlin.$_$.t7;
  var toIntArrayList = kotlin_com_soywiz_korlibs_kds_kds.$_$.w1;
  var ByteCompanionObject_getInstance = kotlin_kotlin.$_$.t4;
  var ShortCompanionObject_getInstance = kotlin_kotlin.$_$.x4;
  var IntCompanionObject_getInstance = kotlin_kotlin.$_$.w4;
  var clamp01 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.b1;
  var linkedHashMapOf = kotlin_com_soywiz_korlibs_kds_kds.$_$.p1;
  var getStringHashCode = kotlin_kotlin.$_$.wc;
  var charSequenceLength = kotlin_kotlin.$_$.nc;
  var emptyList = kotlin_kotlin.$_$.w7;
  var reversed = kotlin_kotlin.$_$.q9;
  var HashSet_init_$Create$ = kotlin_kotlin.$_$.s1;
  var plus = kotlin_kotlin.$_$.m9;
  var Companion_getInstance_5 = kotlin_com_soywiz_korlibs_korio_korio.$_$.p4;
  var toList_0 = kotlin_kotlin.$_$.na;
  var Companion_getInstance_6 = kotlin_com_soywiz_korlibs_korio_korio.$_$.n4;
  var Indenter_init_$Create$ = kotlin_com_soywiz_korlibs_korio_korio.$_$.d4;
  var joinToString$default_0 = kotlin_kotlin.$_$.n;
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.p3;
  var contains$default_0 = kotlin_kotlin.$_$.r;
  var toList_1 = kotlin_kotlin.$_$.oa;
  var contentEquals = kotlin_kotlin.$_$.v6;
  var contentHashCode = kotlin_kotlin.$_$.a7;
  var plus_0 = kotlin_kotlin.$_$.k9;
  var get_invalidOp = kotlin_com_soywiz_korlibs_korio_korio.$_$.i1;
  var toFastList = kotlin_com_soywiz_korlibs_kds_kds.$_$.v1;
  var IntArrayList_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.p2;
  var nextAlignedTo = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.c2;
  var maxOrNull = kotlin_kotlin.$_$.i9;
  var fillArrayVal = kotlin_kotlin.$_$.tc;
  var FastArrayList = kotlin_com_soywiz_korlibs_kds_kds.$_$.h;
  var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.v1;
  var Companion_getInstance_7 = kotlin_com_soywiz_korlibs_korio_korio.$_$.m4;
  var Exception = kotlin_kotlin.$_$.uh;
  var Exception_init_$Init$ = kotlin_kotlin.$_$.m2;
  var Char__hashCode_impl_otmys = kotlin_kotlin.$_$.r3;
  var Companion_getInstance_8 = kotlin_com_soywiz_korlibs_klock_klock.$_$.b1;
  var FastIntMap = kotlin_com_soywiz_korlibs_kds_kds.$_$.j;
  var DateTime__hashCode_impl_yf0bc9 = kotlin_com_soywiz_korlibs_klock_klock.$_$.i;
  var niceStr = kotlin_com_soywiz_korlibs_korio_korio.$_$.o2;
  var get_lastIndex = kotlin_kotlin.$_$.u8;
  var Companion_getInstance_9 = kotlin_com_soywiz_korlibs_korma_korma.$_$.o5;
  var arraycopy_3 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.q;
  var arraycopy_4 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.o;
  var get_lastIndex_0 = kotlin_kotlin.$_$.x8;
  var get_degrees = kotlin_com_soywiz_korlibs_korma_korma.$_$.f2;
  var times = kotlin_com_soywiz_korlibs_korma_korma.$_$.r2;
  var Angle = kotlin_com_soywiz_korlibs_korma_korma.$_$.j1;
  var mapOf = kotlin_kotlin.$_$.g9;
  var Key = kotlin_kotlin.$_$.vb;
  var ObservableProperty = kotlin_kotlin.$_$.ie;
  var delay = kotlin_com_soywiz_korlibs_korio_korio.$_$.r2;
  var TimeSpan__minus_impl_5w5v8s = kotlin_com_soywiz_korlibs_klock_klock.$_$.v;
  var TimeSpan__compareTo_impl_zidry4 = kotlin_com_soywiz_korlibs_klock_klock.$_$.m;
  var Signal_init_$Create$ = kotlin_com_soywiz_korlibs_korio_korio.$_$.z3;
  var Delegates_getInstance = kotlin_kotlin.$_$.z4;
  var booleanArray = kotlin_kotlin.$_$.ic;
  var getKClass = kotlin_kotlin.$_$.d;
  var invoke = kotlin_com_soywiz_korlibs_korio_korio.$_$.a;
  var cancelChildren$default = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.p;
  var printStackTrace = kotlin_kotlin.$_$.bj;
  var max = kotlin_com_soywiz_korlibs_klock_klock.$_$.f;
  var get = kotlin_kotlin.$_$.sb;
  var fold = kotlin_kotlin.$_$.rb;
  var minusKey = kotlin_kotlin.$_$.tb;
  var plus_1 = kotlin_kotlin.$_$.wb;
  var Element = kotlin_kotlin.$_$.ub;
  var DisposableHandle = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.t1;
  var CoroutineDispatcher = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.l1;
  var TGenQueue = kotlin_com_soywiz_korlibs_kds_kds.$_$.w;
  var Companion_getInstance_10 = kotlin_com_soywiz_korlibs_kds_kds.$_$.c3;
  var Companion_getInstance_11 = kotlin_com_soywiz_korlibs_klogger_klogger.$_$.f;
  var TimeSpan__plus_impl_qdd6zo = kotlin_com_soywiz_korlibs_klock_klock.$_$.x;
  var Companion_getInstance_12 = kotlin_kotlin.$_$.f5;
  var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.z3;
  var createFailure = kotlin_kotlin.$_$.qi;
  var Level_WARN_getInstance = kotlin_com_soywiz_korlibs_klogger_klogger.$_$.d;
  var roundMilliseconds = kotlin_com_soywiz_korlibs_klock_klock.$_$.g;
  var get_0 = kotlin_kotlin.$_$.mb;
  var minusKey_0 = kotlin_kotlin.$_$.nb;
  var Delay = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.s1;
  var DateTime__minus_impl_10njw8 = kotlin_com_soywiz_korlibs_klock_klock.$_$.j;
  var SizeInt = kotlin_com_soywiz_korlibs_korma_korma.$_$.s1;
  var hasExtra = kotlin_com_soywiz_korlibs_kds_kds.$_$.m1;
  var Companion_getInstance_13 = kotlin_com_soywiz_korlibs_korma_korma.$_$.u5;
  var get_size = kotlin_com_soywiz_korlibs_korma_korma.$_$.q2;
  var _RectangleInt___get_width__impl__gtay8w = kotlin_com_soywiz_korlibs_korma_korma.$_$.v4;
  var _RectangleInt___get_height__impl__gd473j = kotlin_com_soywiz_korlibs_korma_korma.$_$.p4;
  var _SizeInt___get_width__impl__swntg6 = kotlin_com_soywiz_korlibs_korma_korma.$_$.d5;
  var _SizeInt___get_height__impl__d3sy61 = kotlin_com_soywiz_korlibs_korma_korma.$_$.c5;
  var SizeInt__clone_impl_5edshq = kotlin_com_soywiz_korlibs_korma_korma.$_$.b5;
  var Property_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.l2;
  var clamp = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.d1;
  var toSet_0 = kotlin_kotlin.$_$.wa;
  var reversed_0 = kotlin_kotlin.$_$.ve;
  var toMutableList = kotlin_kotlin.$_$.sa;
  var HtmlNativeImage = kotlin_com_soywiz_korlibs_korim_korim.$_$.j1;
  var isInfinite = kotlin_kotlin.$_$.vi;
  var isNaN_0 = kotlin_kotlin.$_$.wi;
  var KProperty0 = kotlin_kotlin.$_$.df;
  var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.ej;
  var cancelAndJoin = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c;
  var toVfs = kotlin_com_soywiz_korlibs_korio_korio.$_$.s;
  var toHtmlNative = kotlin_com_soywiz_korlibs_korim_korim.$_$.l1;
  var MainScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.x1;
  var launchImmediately_0 = kotlin_com_soywiz_korlibs_korio_korio.$_$.d;
  var mapCapacity = kotlin_kotlin.$_$.e9;
  var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.u1;
  //endregion
  //region block: pre-declaration
  function enableDisable(cap, enable) {
    if (enable) {
      this.taa(cap);
    } else {
      this.saa(cap);
    }
  }
  function drawArraysInstanced(mode, first, count, instancecount) {
    unsupported('Not supported instanced drawing');
  }
  function drawElementsInstanced(mode, count, type, indices, instancecount) {
    unsupported('Not supported instanced drawing');
  }
  function vertexAttribDivisor(index, divisor) {
    unsupported$default(null, 1, null);
  }
  function renderbufferStorageMultisample(target, samples, internalformat, width, height) {
    unsupported('Not supported MSAA');
  }
  function texImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations) {
    unsupported('Not supported MSAA');
  }
  KmlGlWithExtensions.prototype = Object.create(KmlGl.prototype);
  KmlGlWithExtensions.prototype.constructor = KmlGlWithExtensions;
  AG$UniformValues$iterator$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AG$UniformValues$iterator$slambda.prototype.constructor = AG$UniformValues$iterator$slambda;
  BlendEquation.prototype = Object.create(Enum.prototype);
  BlendEquation.prototype.constructor = BlendEquation;
  BlendFactor.prototype = Object.create(Enum.prototype);
  BlendFactor.prototype.constructor = BlendFactor;
  function get_depth() {
    return 1;
  }
  TextureTargetKind.prototype = Object.create(Enum.prototype);
  TextureTargetKind.prototype.constructor = TextureTargetKind;
  BufferKind.prototype = Object.create(Enum.prototype);
  BufferKind.prototype.constructor = BufferKind;
  DrawType.prototype = Object.create(Enum.prototype);
  DrawType.prototype.constructor = DrawType;
  IndexType.prototype = Object.create(Enum.prototype);
  IndexType.prototype.constructor = IndexType;
  ReadKind.prototype = Object.create(Enum.prototype);
  ReadKind.prototype.constructor = ReadKind;
  StencilOp.prototype = Object.create(Enum.prototype);
  StencilOp.prototype.constructor = StencilOp;
  TriangleFace.prototype = Object.create(Enum.prototype);
  TriangleFace.prototype.constructor = TriangleFace;
  CompareMode.prototype = Object.create(Enum.prototype);
  CompareMode.prototype.constructor = CompareMode;
  CullFace.prototype = Object.create(Enum.prototype);
  CullFace.prototype.constructor = CullFace;
  FrontFace.prototype = Object.create(Enum.prototype);
  FrontFace.prototype.constructor = FrontFace;
  function setSize$default(x, y, width, height, fullWidth, fullHeight, $mask0, $handler) {
    if (!(($mask0 & 16) === 0))
      fullWidth = width;
    if (!(($mask0 & 32) === 0))
      fullHeight = height;
    var tmp;
    if ($handler == null) {
      this.yb1(x, y, width, height, fullWidth, fullHeight);
      tmp = Unit_getInstance();
    } else {
      tmp = $handler(x, y, width, height, fullWidth, fullHeight);
    }
    return tmp;
  }
  function init() {
    return Unit_getInstance();
  }
  function set() {
    return Unit_getInstance();
  }
  function unset() {
    return Unit_getInstance();
  }
  RenderBuffer.prototype = Object.create(BaseRenderBufferImpl.prototype);
  RenderBuffer.prototype.constructor = RenderBuffer;
  GlRenderBuffer.prototype = Object.create(RenderBuffer.prototype);
  GlRenderBuffer.prototype.constructor = GlRenderBuffer;
  AG$contextLost$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AG$contextLost$slambda.prototype.constructor = AG$contextLost$slambda;
  AG$flip$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AG$flip$slambda.prototype.constructor = AG$flip$slambda;
  AG$commandsSync$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AG$commandsSync$slambda.prototype.constructor = AG$commandsSync$slambda;
  AGTarget.prototype = Object.create(Enum.prototype);
  AGTarget.prototype.constructor = AGTarget;
  AGEnable.prototype = Object.create(Enum.prototype);
  AGEnable.prototype.constructor = AGEnable;
  function listStart() {
    return Unit_getInstance();
  }
  function get_out() {
    return Output_getInstance();
  }
  function atan(y, x) {
    return Func_init_$Create$_0('atan', [y, x], null, 4, null);
  }
  function texture2D(sampler, coord) {
    return Func_init_$Create$('texture2D', [sampler, coord], VarType_Float4_getInstance());
  }
  function pow(b, e) {
    return Func_init_$Create$_0('pow', [b, e], null, 4, null);
  }
  function sqrt(v) {
    return Func_init_$Create$_0('sqrt', [v], null, 4, null);
  }
  function abs(v) {
    return Func_init_$Create$_0('abs', [v], null, 4, null);
  }
  function fract(v) {
    return Func_init_$Create$_0('fract', [v], null, 4, null);
  }
  function clamp_0(v, min, max) {
    return Func_init_$Create$_0('clamp', [v, min, max], null, 4, null);
  }
  function smoothstep(a, b, c) {
    return Func_init_$Create$_0('smoothstep', [a, b, c], null, 4, null);
  }
  function get_lit(_this__u8e3s4) {
    return new FloatLiteral(_this__u8e3s4);
  }
  function vec2(ops) {
    return new Vector(VarType_Float2_getInstance(), ops);
  }
  function vec4(ops) {
    return new Vector(VarType_Float4_getInstance(), ops);
  }
  function get_1(_this__u8e3s4, swizzle) {
    return new Swizzle(_this__u8e3s4, swizzle);
  }
  function get_x(_this__u8e3s4) {
    return this.jb5(_this__u8e3s4, 'x');
  }
  function get_y(_this__u8e3s4) {
    return this.jb5(_this__u8e3s4, 'y');
  }
  function get_z(_this__u8e3s4) {
    return this.jb5(_this__u8e3s4, 'z');
  }
  function get_w(_this__u8e3s4) {
    return this.jb5(_this__u8e3s4, 'w');
  }
  function unaryMinus(_this__u8e3s4) {
    return new Unop('-', _this__u8e3s4);
  }
  function not(_this__u8e3s4) {
    return new Unop('!', _this__u8e3s4);
  }
  function minus(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '-', that);
  }
  function plus_2(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '+', that);
  }
  function times_0(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '*', that);
  }
  function div(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '/', that);
  }
  function eq(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '==', that);
  }
  function ne(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '!=', that);
  }
  function lt(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '<', that);
  }
  function le(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '<=', that);
  }
  function gt(_this__u8e3s4, that) {
    return new Binop(_this__u8e3s4, '>', that);
  }
  function get_u_Tex() {
    return DefaultShaders_getInstance().gas_1;
  }
  function get_u_ProjMat() {
    return DefaultShaders_getInstance().ias_1;
  }
  function get_u_ViewMat() {
    return DefaultShaders_getInstance().jas_1;
  }
  function get_a_Pos() {
    return DefaultShaders_getInstance().kas_1;
  }
  function get_a_Tex() {
    return DefaultShaders_getInstance().las_1;
  }
  function get_v_Tex() {
    return DefaultShaders_getInstance().nas_1;
  }
  function get_t_Temp0() {
    return DefaultShaders_getInstance().pas_1;
  }
  function get_t_Temp1() {
    return DefaultShaders_getInstance().qas_1;
  }
  ProgramBuilderDefault.prototype = Object.create(Builder.prototype);
  ProgramBuilderDefault.prototype.constructor = ProgramBuilderDefault;
  AGOpengl$createMainRenderBuffer$o$init$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AGOpengl$createMainRenderBuffer$o$init$slambda.prototype.constructor = AGOpengl$createMainRenderBuffer$o$init$slambda;
  AGOpengl$createMainRenderBuffer$o$set$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AGOpengl$createMainRenderBuffer$o$set$slambda.prototype.constructor = AGOpengl$createMainRenderBuffer$o$set$slambda;
  AGOpengl$createMainRenderBuffer$o$unset$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AGOpengl$createMainRenderBuffer$o$unset$slambda.prototype.constructor = AGOpengl$createMainRenderBuffer$o$unset$slambda;
  ShaderException.prototype = Object.create(RuntimeException.prototype);
  ShaderException.prototype.constructor = ShaderException;
  AGOpengl$createMainRenderBuffer$1.prototype = Object.create(BaseRenderBufferImpl.prototype);
  AGOpengl$createMainRenderBuffer$1.prototype.constructor = AGOpengl$createMainRenderBuffer$1;
  AGOpengl.prototype = Object.create(AG.prototype);
  AGOpengl.prototype.constructor = AGOpengl;
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.prototype = Object.create(CoroutineImpl.prototype);
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.prototype.constructor = AGQueueProcessorOpenGL$textureBindEnsuring$slambda;
  DummyAG.prototype = Object.create(AG.prototype);
  DummyAG.prototype.constructor = DummyAG;
  LogBaseAG.prototype = Object.create(DummyAG.prototype);
  LogBaseAG.prototype.constructor = LogBaseAG;
  PrintAG.prototype = Object.create(LogBaseAG.prototype);
  PrintAG.prototype.constructor = PrintAG;
  Kind.prototype = Object.create(Enum.prototype);
  Kind.prototype.constructor = Kind;
  LogTexture.prototype = Object.create(Texture.prototype);
  LogTexture.prototype.constructor = LogTexture;
  LogBuffer.prototype = Object.create(Buffer.prototype);
  LogBuffer.prototype.constructor = LogBuffer;
  LogRenderBuffer.prototype = Object.create(RenderBuffer.prototype);
  LogRenderBuffer.prototype.constructor = LogRenderBuffer;
  function precToString(prec) {
    var tmp;
    if (!this.n3o().qbn_1) {
      tmp = '';
    } else {
      var tmp0_subject = prec;
      var tmp0 = tmp0_subject.q2_1;
      var tmp_0;
      switch (tmp0) {
        case 0:
          tmp_0 = '';
          break;
        case 1:
          tmp_0 = 'lowp ';
          break;
        case 2:
          tmp_0 = 'mediump ';
          break;
        case 3:
          tmp_0 = 'highp ';
          break;
        default:
          noWhenBranchMatchedException();
          break;
      }
      tmp = tmp_0;
    }
    return tmp;
  }
  function typeToString(type) {
    var tmp0_subject = type;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        tmp = 'void';
        break;
      case 21:
        tmp = 'vec4';
        break;
      case 1:
        tmp = 'mat2';
        break;
      case 2:
        tmp = 'mat3';
        break;
      case 3:
        tmp = 'mat4';
        break;
      case 4:
        tmp = 'sampler1D';
        break;
      case 5:
        tmp = this.n3o().ubn_1.yba_1 ? 'samplerExternalOES' : 'sampler2D';
        break;
      case 6:
        tmp = 'sampler3D';
        break;
      case 7:
        tmp = 'samplerCube';
        break;
      default:
        var tmp1_subject = type.cbl_1;
        var tmp0_0 = tmp1_subject.q2_1;
        var tmp_0;
        switch (tmp0_0) {
          case 0:
            var tmp2_subject = type.dbl_1;
            var tmp_1;
            switch (tmp2_subject) {
              case 1:
                tmp_1 = 'bool';
                break;
              case 2:
                tmp_1 = 'bvec2';
                break;
              case 3:
                tmp_1 = 'bvec3';
                break;
              case 4:
                tmp_1 = 'bvec4';
                break;
              default:
                errorType(this, type);
                break;
            }

            tmp_0 = tmp_1;
            break;
          case 1:
          case 2:
          case 3:
          case 4:
          case 6:
            var tmp3_subject = type.dbl_1;
            var tmp_2;
            switch (tmp3_subject) {
              case 1:
                tmp_2 = 'float';
                break;
              case 2:
                tmp_2 = 'vec2';
                break;
              case 3:
                tmp_2 = 'vec3';
                break;
              case 4:
                tmp_2 = 'vec4';
                break;
              default:
                errorType(this, type);
                break;
            }

            tmp_0 = tmp_2;
            break;
          case 5:
            var tmp4_subject = type.dbl_1;
            var tmp_3;
            switch (tmp4_subject) {
              case 1:
                tmp_3 = 'int';
                break;
              case 2:
                tmp_3 = 'ivec2';
                break;
              case 3:
                tmp_3 = 'ivec3';
                break;
              case 4:
                tmp_3 = 'ivec4';
                break;
              default:
                errorType(this, type);
                break;
            }

            tmp_0 = tmp_3;
            break;
          default:
            noWhenBranchMatchedException();
            break;
        }

        tmp = tmp_0;
        break;
    }
    return tmp;
  }
  function get_arrayDecl(_this__u8e3s4) {
    return !(_this__u8e3s4.ib6_1 === 1) ? '[' + _this__u8e3s4.ib6_1 + ']' : '';
  }
  function get_IN() {
    return this.n3o().jbx();
  }
  function get_OUT() {
    return this.n3o().obx();
  }
  function get_UNIFORM() {
    return this.n3o().nbx();
  }
  GlobalsProgramVisitor.prototype = Object.create(Visitor.prototype);
  GlobalsProgramVisitor.prototype.constructor = GlobalsProgramVisitor;
  GlslBodyGenerator.prototype = Object.create(Visitor.prototype);
  GlslBodyGenerator.prototype.constructor = GlslBodyGenerator;
  Stms.prototype = Object.create(Stm.prototype);
  Stms.prototype.constructor = Stms;
  Set.prototype = Object.create(Stm.prototype);
  Set.prototype.constructor = Set;
  Return.prototype = Object.create(Stm.prototype);
  Return.prototype.constructor = Return;
  Break.prototype = Object.create(Stm.prototype);
  Break.prototype.constructor = Break;
  Continue.prototype = Object.create(Stm.prototype);
  Continue.prototype.constructor = Continue;
  Discard.prototype = Object.create(Stm.prototype);
  Discard.prototype.constructor = Discard;
  If.prototype = Object.create(Stm.prototype);
  If.prototype.constructor = If;
  ForSimple.prototype = Object.create(Stm.prototype);
  ForSimple.prototype.constructor = ForSimple;
  Raw.prototype = Object.create(Stm.prototype);
  Raw.prototype.constructor = Raw;
  Ternary.prototype = Object.create(Operand.prototype);
  Ternary.prototype.constructor = Ternary;
  Unop.prototype = Object.create(Operand.prototype);
  Unop.prototype.constructor = Unop;
  Binop.prototype = Object.create(Operand.prototype);
  Binop.prototype.constructor = Binop;
  IntLiteral.prototype = Object.create(Operand.prototype);
  IntLiteral.prototype.constructor = IntLiteral;
  FloatLiteral.prototype = Object.create(Operand.prototype);
  FloatLiteral.prototype.constructor = FloatLiteral;
  BoolLiteral.prototype = Object.create(Operand.prototype);
  BoolLiteral.prototype.constructor = BoolLiteral;
  Vector.prototype = Object.create(Operand.prototype);
  Vector.prototype.constructor = Vector;
  Swizzle.prototype = Object.create(Operand.prototype);
  Swizzle.prototype.constructor = Swizzle;
  ArrayAccess.prototype = Object.create(Operand.prototype);
  ArrayAccess.prototype.constructor = ArrayAccess;
  BaseFunc.prototype = Object.create(Operand.prototype);
  BaseFunc.prototype.constructor = BaseFunc;
  Func.prototype = Object.create(BaseFunc.prototype);
  Func.prototype.constructor = Func;
  CustomFunc.prototype = Object.create(BaseFunc.prototype);
  CustomFunc.prototype.constructor = CustomFunc;
  Variable.prototype = Object.create(Operand.prototype);
  Variable.prototype.constructor = Variable;
  Uniform.prototype = Object.create(Variable.prototype);
  Uniform.prototype.constructor = Uniform;
  Attribute.prototype = Object.create(Variable.prototype);
  Attribute.prototype.constructor = Attribute;
  VarType.prototype = Object.create(Enum.prototype);
  VarType.prototype.constructor = VarType;
  Varying.prototype = Object.create(Variable.prototype);
  Varying.prototype.constructor = Varying;
  Precision.prototype = Object.create(Enum.prototype);
  Precision.prototype.constructor = Precision;
  Shader$uniforms$1$1.prototype = Object.create(Visitor.prototype);
  Shader$uniforms$1$1.prototype.constructor = Shader$uniforms$1$1;
  Shader$attributes$1$1.prototype = Object.create(Visitor.prototype);
  Shader$attributes$1$1.prototype.constructor = Shader$attributes$1$1;
  Output.prototype = Object.create(Varying.prototype);
  Output.prototype.constructor = Output;
  Temp.prototype = Object.create(Variable.prototype);
  Temp.prototype.constructor = Temp;
  VarKind.prototype = Object.create(Enum.prototype);
  VarKind.prototype.constructor = VarKind;
  ShaderType.prototype = Object.create(Enum.prototype);
  ShaderType.prototype.constructor = ShaderType;
  Arg.prototype = Object.create(Variable.prototype);
  Arg.prototype.constructor = Arg;
  TypedEvent.prototype = Object.create(Event.prototype);
  TypedEvent.prototype.constructor = TypedEvent;
  PreventDefaultException.prototype = Object.create(Exception.prototype);
  PreventDefaultException.prototype.constructor = PreventDefaultException;
  Type.prototype = Object.create(Enum.prototype);
  Type.prototype.constructor = Type;
  ScrollDeltaMode.prototype = Object.create(Enum.prototype);
  ScrollDeltaMode.prototype.constructor = ScrollDeltaMode;
  MouseEvent.prototype = Object.create(Event.prototype);
  MouseEvent.prototype.constructor = MouseEvent;
  Type_0.prototype = Object.create(Enum.prototype);
  Type_0.prototype.constructor = Type_0;
  ReshapeEvent.prototype = Object.create(TypedEvent.prototype);
  ReshapeEvent.prototype.constructor = ReshapeEvent;
  Type_1.prototype = Object.create(Enum.prototype);
  Type_1.prototype.constructor = Type_1;
  KeyEvent.prototype = Object.create(Event.prototype);
  KeyEvent.prototype.constructor = KeyEvent;
  GamePadUpdateEvent.prototype = Object.create(Event.prototype);
  GamePadUpdateEvent.prototype.constructor = GamePadUpdateEvent;
  Type_2.prototype = Object.create(Enum.prototype);
  Type_2.prototype.constructor = Type_2;
  GamePadConnectionEvent.prototype = Object.create(Event.prototype);
  GamePadConnectionEvent.prototype.constructor = GamePadConnectionEvent;
  Type_3.prototype = Object.create(Enum.prototype);
  Type_3.prototype.constructor = Type_3;
  GestureEvent.prototype = Object.create(Event.prototype);
  GestureEvent.prototype.constructor = GestureEvent;
  Type_4.prototype = Object.create(Enum.prototype);
  Type_4.prototype.constructor = Type_4;
  TouchEvent.prototype = Object.create(Event.prototype);
  TouchEvent.prototype.constructor = TouchEvent;
  Status.prototype = Object.create(Enum.prototype);
  Status.prototype.constructor = Status;
  Kind_0.prototype = Object.create(Enum.prototype);
  Kind_0.prototype.constructor = Kind_0;
  Type_5.prototype = Object.create(Enum.prototype);
  Type_5.prototype.constructor = Type_5;
  DropFileEvent.prototype = Object.create(Event.prototype);
  DropFileEvent.prototype.constructor = DropFileEvent;
  ResumeEvent.prototype = Object.create(TypedEvent.prototype);
  ResumeEvent.prototype.constructor = ResumeEvent;
  PauseEvent.prototype = Object.create(TypedEvent.prototype);
  PauseEvent.prototype.constructor = PauseEvent;
  StopEvent.prototype = Object.create(TypedEvent.prototype);
  StopEvent.prototype.constructor = StopEvent;
  DestroyEvent.prototype = Object.create(TypedEvent.prototype);
  DestroyEvent.prototype.constructor = DestroyEvent;
  RenderEvent.prototype = Object.create(Event.prototype);
  RenderEvent.prototype.constructor = RenderEvent;
  InitEvent.prototype = Object.create(TypedEvent.prototype);
  InitEvent.prototype.constructor = InitEvent;
  DisposeEvent.prototype = Object.create(TypedEvent.prototype);
  DisposeEvent.prototype.constructor = DisposeEvent;
  FullScreenEvent.prototype = Object.create(TypedEvent.prototype);
  FullScreenEvent.prototype.constructor = FullScreenEvent;
  Mode.prototype = Object.create(Enum.prototype);
  Mode.prototype.constructor = Mode;
  Key_0.prototype = Object.create(Enum.prototype);
  Key_0.prototype.constructor = Key_0;
  StandardGamepadMapping.prototype = Object.create(GamepadMapping.prototype);
  StandardGamepadMapping.prototype.constructor = StandardGamepadMapping;
  Companion_41.prototype = Object.create(StandardGamepadMapping.prototype);
  Companion_41.prototype.constructor = Companion_41;
  GameButton.prototype = Object.create(Enum.prototype);
  GameButton.prototype.constructor = GameButton;
  BatteryStatus.prototype = Object.create(Enum.prototype);
  BatteryStatus.prototype.constructor = BatteryStatus;
  MouseButton.prototype = Object.create(Enum.prototype);
  MouseButton.prototype.constructor = MouseButton;
  SoftKeyboardReturnKeyType.prototype = Object.create(Enum.prototype);
  SoftKeyboardReturnKeyType.prototype.constructor = SoftKeyboardReturnKeyType;
  SoftKeyboardType.prototype = Object.create(Enum.prototype);
  SoftKeyboardType.prototype.constructor = SoftKeyboardType;
  Cursor.prototype = Object.create(Enum.prototype);
  Cursor.prototype.constructor = Cursor;
  Quality.prototype = Object.create(Enum.prototype);
  Quality.prototype.constructor = Quality;
  GameWindow$loop$slambda.prototype = Object.create(CoroutineImpl.prototype);
  GameWindow$loop$slambda.prototype.constructor = GameWindow$loop$slambda;
  _no_name_provided__qut3iv.prototype = Object.create(ObservableProperty.prototype);
  _no_name_provided__qut3iv.prototype.constructor = _no_name_provided__qut3iv;
  $waitCloseCOROUTINE$1.prototype = Object.create(CoroutineImpl.prototype);
  $waitCloseCOROUTINE$1.prototype.constructor = $waitCloseCOROUTINE$1;
  $loopCOROUTINE$2.prototype = Object.create(CoroutineImpl.prototype);
  $loopCOROUTINE$2.prototype.constructor = $loopCOROUTINE$2;
  GameWindow.prototype = Object.create(Mixin.prototype);
  GameWindow.prototype.constructor = GameWindow;
  GameWindowCoroutineDispatcher.prototype = Object.create(CoroutineDispatcher.prototype);
  GameWindowCoroutineDispatcher.prototype.constructor = GameWindowCoroutineDispatcher;
  function get_pt(_this__u8e3s4) {
    return new PT(_this__u8e3s4);
  }
  function get_percent(_this__u8e3s4) {
    return new Ratio(_this__u8e3s4 / 100.0);
  }
  UiButton.prototype = Object.create(UiComponent.prototype);
  UiButton.prototype.constructor = UiButton;
  UiContainer.prototype = Object.create(UiComponent.prototype);
  UiContainer.prototype.constructor = UiContainer;
  UiStandardCursor.prototype = Object.create(Enum.prototype);
  UiStandardCursor.prototype.constructor = UiStandardCursor;
  UiLabel.prototype = Object.create(UiComponent.prototype);
  UiLabel.prototype.constructor = UiLabel;
  UiTextField.prototype = Object.create(UiComponent.prototype);
  UiTextField.prototype.constructor = UiTextField;
  VerticalUiLayout.prototype = Object.create(LineUiLayout.prototype);
  VerticalUiLayout.prototype.constructor = VerticalUiLayout;
  LayoutDirection.prototype = Object.create(Enum.prototype);
  LayoutDirection.prototype.constructor = LayoutDirection;
  HorizontalUiLayout.prototype = Object.create(LineUiLayout.prototype);
  HorizontalUiLayout.prototype.constructor = HorizontalUiLayout;
  Fixed.prototype = Object.create(Length.prototype);
  Fixed.prototype.constructor = Fixed;
  Variable_0.prototype = Object.create(Length.prototype);
  Variable_0.prototype.constructor = Variable_0;
  function get_size_0() {
    return 100;
  }
  function get_pixelsPerInch() {
    return 96.0;
  }
  function get_pixelRatio() {
    return this.cco() / 96.0;
  }
  PT.prototype = Object.create(Fixed.prototype);
  PT.prototype.constructor = PT;
  Ratio.prototype = Object.create(Variable_0.prototype);
  Ratio.prototype.constructor = Ratio;
  Binop_0.prototype = Object.create(Length.prototype);
  Binop_0.prototype.constructor = Binop_0;
  KmlGlJsCanvas.prototype = Object.create(KmlGlWithExtensions.prototype);
  KmlGlJsCanvas.prototype.constructor = KmlGlJsCanvas;
  AGWebgl.prototype = Object.create(AGOpengl.prototype);
  AGWebgl.prototype.constructor = AGWebgl;
  Nimbus_111_1420_Safari_GamepadMapping.prototype = Object.create(GamepadMapping.prototype);
  Nimbus_111_1420_Safari_GamepadMapping.prototype.constructor = Nimbus_111_1420_Safari_GamepadMapping;
  JsGameWindow.prototype = Object.create(GameWindow.prototype);
  JsGameWindow.prototype.constructor = JsGameWindow;
  NodeJsGameWindow.prototype = Object.create(JsGameWindow.prototype);
  NodeJsGameWindow.prototype.constructor = NodeJsGameWindow;
  BrowserCanvasJsGameWindow$close$slambda.prototype = Object.create(CoroutineImpl.prototype);
  BrowserCanvasJsGameWindow$close$slambda.prototype.constructor = BrowserCanvasJsGameWindow$close$slambda;
  BrowserCanvasJsGameWindow$loop$slambda.prototype = Object.create(CoroutineImpl.prototype);
  BrowserCanvasJsGameWindow$loop$slambda.prototype.constructor = BrowserCanvasJsGameWindow$loop$slambda;
  $loopCOROUTINE$3.prototype = Object.create(CoroutineImpl.prototype);
  $loopCOROUTINE$3.prototype.constructor = $loopCOROUTINE$3;
  BrowserCanvasJsGameWindow.prototype = Object.create(JsGameWindow.prototype);
  BrowserCanvasJsGameWindow.prototype.constructor = BrowserCanvasJsGameWindow;
  //endregion
  function IKmlGl() {
  }
  IKmlGl.$metadata$ = interfaceMeta('IKmlGl');
  function putAsciiString(_this__u8e3s4, str) {
    var n = 0;
    var indexedObject = str;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var c = charSequenceGet(indexedObject, inductionVariable);
      inductionVariable = inductionVariable + 1 | 0;
      var tmp$ret$0;
      // Inline function 'com.soywiz.kmem.size' call
      var tmp0__get_size__8hfv5c = _this__u8e3s4.r4w_1;
      tmp$ret$0 = tmp0__get_size__8hfv5c.byteLength;
      if (tmp$ret$0 >= n) {
        var tmp1 = n;
        n = tmp1 + 1 | 0;
        _this__u8e3s4.q4x(tmp1, Char__toByte_impl_7s7yt0(c));
      }
    }
    var tmp$ret$1;
    // Inline function 'com.soywiz.kmem.size' call
    var tmp1__get_size__amak0f = _this__u8e3s4.r4w_1;
    tmp$ret$1 = tmp1__get_size__amak0f.byteLength;
    if (tmp$ret$1 >= n) {
      var tmp2 = n;
      n = tmp2 + 1 | 0;
      _this__u8e3s4.q4x(tmp2, 0);
    }
    return _this__u8e3s4;
  }
  function toAsciiString(_this__u8e3s4) {
    var out = '';
    var inductionVariable = 0;
    var tmp$ret$0;
    // Inline function 'com.soywiz.kmem.size' call
    var tmp0__get_size__8hfv5c = _this__u8e3s4.r4w_1;
    tmp$ret$0 = tmp0__get_size__8hfv5c.byteLength;
    var last = tmp$ret$0;
    if (inductionVariable < last)
      $l$loop: do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var b = _this__u8e3s4.o4x(n);
        if (b === 0)
          break $l$loop;
        out = out + new Char(numberToChar(b));
      }
       while (inductionVariable < last);
    return out;
  }
  function KmlGl$ContextInfo$current$lambda() {
    return null;
  }
  function ContextInfo() {
    var tmp = this;
    tmp.aab_1 = KmlGl$ContextInfo$current$lambda;
  }
  ContextInfo.prototype.toString = function () {
    return 'current=' + toString(this.aab_1());
  };
  ContextInfo.$metadata$ = classMeta('ContextInfo');
  function Companion() {
    Companion_instance = this;
    this.bab_1 = 256;
    this.cab_1 = 1024;
    this.dab_1 = 16384;
    this.eab_1 = 0;
    this.fab_1 = 1;
    this.gab_1 = 0;
    this.hab_1 = 1;
    this.iab_1 = 2;
    this.jab_1 = 3;
    this.kab_1 = 4;
    this.lab_1 = 5;
    this.mab_1 = 6;
    this.nab_1 = 0;
    this.oab_1 = 1;
    this.pab_1 = 768;
    this.qab_1 = 769;
    this.rab_1 = 770;
    this.sab_1 = 771;
    this.tab_1 = 772;
    this.uab_1 = 773;
    this.vab_1 = 774;
    this.wab_1 = 775;
    this.xab_1 = 776;
    this.yab_1 = 32774;
    this.zab_1 = 32777;
    this.aac_1 = 32777;
    this.bac_1 = 34877;
    this.cac_1 = 32778;
    this.dac_1 = 32779;
    this.eac_1 = 32968;
    this.fac_1 = 32969;
    this.gac_1 = 32970;
    this.hac_1 = 32971;
    this.iac_1 = 32769;
    this.jac_1 = 32770;
    this.kac_1 = 32771;
    this.lac_1 = 32772;
    this.mac_1 = 32773;
    this.nac_1 = 34962;
    this.oac_1 = 34963;
    this.pac_1 = 34964;
    this.qac_1 = 34965;
    this.rac_1 = 35040;
    this.sac_1 = 35044;
    this.tac_1 = 35048;
    this.uac_1 = 34660;
    this.vac_1 = 34661;
    this.wac_1 = 34342;
    this.xac_1 = 1028;
    this.yac_1 = 1029;
    this.zac_1 = 1032;
    this.aad_1 = 3553;
    this.bad_1 = 32879;
    this.cad_1 = 2884;
    this.dad_1 = 3042;
    this.ead_1 = 3024;
    this.fad_1 = 2960;
    this.gad_1 = 2929;
    this.had_1 = 3089;
    this.iad_1 = 32823;
    this.jad_1 = 32926;
    this.kad_1 = 32928;
    this.lad_1 = 0;
    this.mad_1 = 1280;
    this.nad_1 = 1281;
    this.oad_1 = 1282;
    this.pad_1 = 1285;
    this.qad_1 = 2304;
    this.rad_1 = 2305;
    this.sad_1 = 2849;
    this.tad_1 = 33901;
    this.uad_1 = 33902;
    this.vad_1 = 2885;
    this.wad_1 = 2886;
    this.xad_1 = 2928;
    this.yad_1 = 2930;
    this.zad_1 = 2931;
    this.aae_1 = 2932;
    this.bae_1 = 2961;
    this.cae_1 = 2962;
    this.dae_1 = 2964;
    this.eae_1 = 2965;
    this.fae_1 = 2966;
    this.gae_1 = 2967;
    this.hae_1 = 2963;
    this.iae_1 = 2968;
    this.jae_1 = 34816;
    this.kae_1 = 34817;
    this.lae_1 = 34818;
    this.mae_1 = 34819;
    this.nae_1 = 36003;
    this.oae_1 = 36004;
    this.pae_1 = 36005;
    this.qae_1 = 2978;
    this.rae_1 = 3088;
    this.sae_1 = 3106;
    this.tae_1 = 3107;
    this.uae_1 = 3317;
    this.vae_1 = 3333;
    this.wae_1 = 3379;
    this.xae_1 = 3386;
    this.yae_1 = 3408;
    this.zae_1 = 3410;
    this.aaf_1 = 3411;
    this.baf_1 = 3412;
    this.caf_1 = 3413;
    this.daf_1 = 3414;
    this.eaf_1 = 3415;
    this.faf_1 = 10752;
    this.gaf_1 = 32824;
    this.haf_1 = 32873;
    this.iaf_1 = 32936;
    this.jaf_1 = 32937;
    this.kaf_1 = 32938;
    this.laf_1 = 32939;
    this.maf_1 = 34466;
    this.naf_1 = 34467;
    this.oaf_1 = 4352;
    this.paf_1 = 4353;
    this.qaf_1 = 4354;
    this.raf_1 = 33170;
    this.saf_1 = 5120;
    this.taf_1 = 5121;
    this.uaf_1 = 5122;
    this.vaf_1 = 5123;
    this.waf_1 = 5124;
    this.xaf_1 = 5125;
    this.yaf_1 = 5126;
    this.zaf_1 = 5132;
    this.aag_1 = 6402;
    this.bag_1 = 6406;
    this.cag_1 = 6407;
    this.dag_1 = 6408;
    this.eag_1 = 6409;
    this.fag_1 = 6410;
    this.gag_1 = 32819;
    this.hag_1 = 32820;
    this.iag_1 = 33635;
    this.jag_1 = 35632;
    this.kag_1 = 35633;
    this.lag_1 = 34921;
    this.mag_1 = 36347;
    this.nag_1 = 36348;
    this.oag_1 = 35661;
    this.pag_1 = 35660;
    this.qag_1 = 34930;
    this.rag_1 = 36349;
    this.sag_1 = 35663;
    this.tag_1 = 35712;
    this.uag_1 = 35714;
    this.vag_1 = 35715;
    this.wag_1 = 35717;
    this.xag_1 = 35718;
    this.yag_1 = 35719;
    this.zag_1 = 35721;
    this.aah_1 = 35722;
    this.bah_1 = 35724;
    this.cah_1 = 35725;
    this.dah_1 = 512;
    this.eah_1 = 513;
    this.fah_1 = 514;
    this.gah_1 = 515;
    this.hah_1 = 516;
    this.iah_1 = 517;
    this.jah_1 = 518;
    this.kah_1 = 519;
    this.lah_1 = 7680;
    this.mah_1 = 7681;
    this.nah_1 = 7682;
    this.oah_1 = 7683;
    this.pah_1 = 5386;
    this.qah_1 = 34055;
    this.rah_1 = 34056;
    this.sah_1 = 7936;
    this.tah_1 = 7937;
    this.uah_1 = 7938;
    this.vah_1 = 7939;
    this.wah_1 = 9728;
    this.xah_1 = 9729;
    this.yah_1 = 9984;
    this.zah_1 = 9985;
    this.aai_1 = 9986;
    this.bai_1 = 9987;
    this.cai_1 = 10240;
    this.dai_1 = 10241;
    this.eai_1 = 10242;
    this.fai_1 = 10243;
    this.gai_1 = 32882;
    this.hai_1 = 5890;
    this.iai_1 = 34067;
    this.jai_1 = 34068;
    this.kai_1 = 34069;
    this.lai_1 = 34070;
    this.mai_1 = 34071;
    this.nai_1 = 34072;
    this.oai_1 = 34073;
    this.pai_1 = 34074;
    this.qai_1 = 34076;
    this.rai_1 = 33984;
    this.sai_1 = 33985;
    this.tai_1 = 33986;
    this.uai_1 = 33987;
    this.vai_1 = 33988;
    this.wai_1 = 33989;
    this.xai_1 = 33990;
    this.yai_1 = 33991;
    this.zai_1 = 33992;
    this.aaj_1 = 33993;
    this.baj_1 = 33994;
    this.caj_1 = 33995;
    this.daj_1 = 33996;
    this.eaj_1 = 33997;
    this.faj_1 = 33998;
    this.gaj_1 = 33999;
    this.haj_1 = 34000;
    this.iaj_1 = 34001;
    this.jaj_1 = 34002;
    this.kaj_1 = 34003;
    this.laj_1 = 34004;
    this.maj_1 = 34005;
    this.naj_1 = 34006;
    this.oaj_1 = 34007;
    this.paj_1 = 34008;
    this.qaj_1 = 34009;
    this.raj_1 = 34010;
    this.saj_1 = 34011;
    this.taj_1 = 34012;
    this.uaj_1 = 34013;
    this.vaj_1 = 34014;
    this.waj_1 = 34015;
    this.xaj_1 = 34016;
    this.yaj_1 = 10497;
    this.zaj_1 = 33071;
    this.aak_1 = 33648;
    this.bak_1 = 35664;
    this.cak_1 = 35665;
    this.dak_1 = 35666;
    this.eak_1 = 35667;
    this.fak_1 = 35668;
    this.gak_1 = 35669;
    this.hak_1 = 35670;
    this.iak_1 = 35671;
    this.jak_1 = 35672;
    this.kak_1 = 35673;
    this.lak_1 = 35674;
    this.mak_1 = 35675;
    this.nak_1 = 35676;
    this.oak_1 = 35678;
    this.pak_1 = 35680;
    this.qak_1 = 34338;
    this.rak_1 = 34339;
    this.sak_1 = 34340;
    this.tak_1 = 34341;
    this.uak_1 = 34922;
    this.vak_1 = 34373;
    this.wak_1 = 34975;
    this.xak_1 = 35738;
    this.yak_1 = 35739;
    this.zak_1 = 35713;
    this.aal_1 = 35716;
    this.bal_1 = 35720;
    this.cal_1 = 36346;
    this.dal_1 = 36344;
    this.eal_1 = 36345;
    this.fal_1 = 36336;
    this.gal_1 = 36337;
    this.hal_1 = 36338;
    this.ial_1 = 36339;
    this.jal_1 = 36340;
    this.kal_1 = 36341;
    this.lal_1 = 36160;
    this.mal_1 = 36161;
    this.nal_1 = 32854;
    this.oal_1 = 32855;
    this.pal_1 = 36194;
    this.qal_1 = 33189;
    this.ral_1 = 6401;
    this.sal_1 = 36168;
    this.tal_1 = 36162;
    this.ual_1 = 36163;
    this.val_1 = 36164;
    this.wal_1 = 36176;
    this.xal_1 = 36177;
    this.yal_1 = 36178;
    this.zal_1 = 36179;
    this.aam_1 = 36180;
    this.bam_1 = 36181;
    this.cam_1 = 36048;
    this.dam_1 = 36049;
    this.eam_1 = 36050;
    this.fam_1 = 36051;
    this.gam_1 = 36064;
    this.ham_1 = 36096;
    this.iam_1 = 33306;
    this.jam_1 = 34041;
    this.kam_1 = 36128;
    this.lam_1 = 0;
    this.mam_1 = 36053;
    this.nam_1 = 36054;
    this.oam_1 = 36055;
    this.pam_1 = 36057;
    this.qam_1 = 36061;
    this.ram_1 = 36006;
    this.sam_1 = 36007;
    this.tam_1 = 34024;
    this.uam_1 = 1286;
    this.vam_1 = 37120;
    this.wam_1 = 34836;
    this.xam_1 = 3313;
    this.yam_1 = 3314;
    this.zam_1 = 3316;
    this.aan_1 = 3315;
    this.ban_1 = 3312;
    this.can_1 = 37441;
    this.dan_1 = 36197;
  }
  Companion.prototype.ean = function () {
    return this.vah_1;
  };
  Companion.prototype.fan = function () {
    return this.aal_1;
  };
  Companion.$metadata$ = objectMeta('Companion');
  var Companion_instance;
  function Companion_getInstance_14() {
    if (Companion_instance == null)
      new Companion();
    return Companion_instance;
  }
  function KmlGl() {
    Companion_getInstance_14();
    var tmp = this;
    tmp.gan_1 = Mixin_init_$Create$(null, 1, null);
    this.han_1 = new ContextInfo();
  }
  KmlGl.prototype.e4v = function (_set____db54di) {
    this.gan_1.e4v(_set____db54di);
  };
  KmlGl.prototype.f4v = function () {
    return this.gan_1.f4v();
  };
  KmlGl.prototype.ian = function () {
    return false;
  };
  KmlGl.prototype.jan = function () {
    return false;
  };
  KmlGl.prototype.kan = function () {
    return OS_getInstance().s4y();
  };
  KmlGl.prototype.lan = function () {
    return false;
  };
  KmlGl.prototype.man = function () {
    return false;
  };
  KmlGl.prototype.nan = function () {
    Companion_getInstance_14();
    return 1;
  };
  KmlGl.prototype.oan = function () {
    Companion_getInstance_14();
    return 5126;
  };
  KmlGl.prototype.pan = function () {
    Companion_getInstance_14();
    return 35632;
  };
  KmlGl.prototype.qan = function () {
    Companion_getInstance_14();
    return 35633;
  };
  KmlGl.prototype.ran = function () {
    Companion_getInstance_14();
    return 35714;
  };
  KmlGl.prototype.san = function () {
    Companion_getInstance_14();
    return 35724;
  };
  KmlGl.prototype.ean = function () {
    Companion_getInstance_14();
    return 7939;
  };
  KmlGl.prototype.tan = function () {
    Companion_getInstance_14();
    return 35713;
  };
  KmlGl.prototype.fan = function () {
    Companion_getInstance_14();
    return 35716;
  };
  KmlGl.prototype.uan = function () {
    return Unit_getInstance();
  };
  KmlGl.$metadata$ = classMeta('KmlGl', [Extra, IKmlGl, AGFeatures]);
  function Companion_0() {
    Companion_instance_0 = this;
    this.vaq_1 = 33309;
  }
  Companion_0.$metadata$ = objectMeta('Companion');
  var Companion_instance_0;
  function Companion_getInstance_15() {
    if (Companion_instance_0 == null)
      new Companion_0();
    return Companion_instance_0;
  }
  function KmlGlWithExtensions$isFloatTextureSupported$delegate$lambda(this$0) {
    return function () {
      return this$0.w3f().r('GL_OES_texture_float') ? true : this$0.w3f().r('GL_ARB_texture_float');
    };
  }
  function KmlGlWithExtensions() {
    Companion_getInstance_15();
    KmlGl.call(this);
    this.yaq_1 = null;
    var tmp = this;
    tmp.zaq_1 = lazy(KmlGlWithExtensions$isFloatTextureSupported$delegate$lambda(this));
  }
  KmlGlWithExtensions.prototype.aar = function (name, index) {
    throw NotImplementedError_init_$Create$(null, 1, null);
  };
  KmlGlWithExtensions.prototype.w3f = function () {
    if (this.yaq_1 == null) {
      var tmp = this;
      var tmp_0;
      try {
        Companion_getInstance_15();
        var numExtensions = getIntegerv(this, 33309);
        if (numExtensions <= 0) {
          // Inline function 'kotlin.TODO' call
          throw NotImplementedError_init_$Create$(null, 1, null);
        }
        var tmp$ret$4;
        // Inline function 'kotlin.collections.mapNotNull' call
        var tmp0_mapNotNull = until(0, numExtensions);
        var tmp$ret$3;
        // Inline function 'kotlin.collections.mapNotNullTo' call
        var tmp0_mapNotNullTo = ArrayList_init_$Create$();
        // Inline function 'kotlin.collections.forEach' call
        var inductionVariable = tmp0_mapNotNull.r1_1;
        var last = tmp0_mapNotNull.s1_1;
        if (inductionVariable <= last)
          do {
            var element = inductionVariable;
            inductionVariable = inductionVariable + 1 | 0;
            // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
            var tmp$ret$1;
            // Inline function 'com.soywiz.kgl.KmlGlWithExtensions.<get-extensions>.<anonymous>' call
            var tmp$ret$0;
            // Inline function 'com.soywiz.kgl.KmlGl.EXTENSIONS' call
            Companion_getInstance_14();
            tmp$ret$0 = 7939;
            tmp$ret$1 = this.aar(tmp$ret$0, element);
            var tmp0_safe_receiver = tmp$ret$1;
            if (tmp0_safe_receiver == null)
              null;
            else {
              var tmp$ret$2;
              // Inline function 'kotlin.let' call
              // Inline function 'kotlin.contracts.contract' call
              tmp0_mapNotNullTo.c(tmp0_safe_receiver);
              tmp$ret$2 = Unit_getInstance();
            }
          }
           while (!(element === last));
        tmp$ret$3 = tmp0_mapNotNullTo;
        tmp$ret$4 = tmp$ret$3;
        tmp_0 = toSet(tmp$ret$4);
      } catch ($p) {
        var tmp_1;
        if ($p instanceof Error) {
          var tmp$ret$5;
          // Inline function 'com.soywiz.kgl.KmlGl.EXTENSIONS' call
          Companion_getInstance_14();
          tmp$ret$5 = 7939;
          var tmp_2 = this.qap(tmp$ret$5);
          tmp_1 = toSet(split$default(tmp_2, [' '], false, 0, 6, null));
        } else {
          throw $p;
        }
        tmp_0 = tmp_1;
      }
      tmp.yaq_1 = tmp_0;
    }
    return ensureNotNull(this.yaq_1);
  };
  KmlGlWithExtensions.$metadata$ = classMeta('KmlGlWithExtensions', undefined, undefined, undefined, undefined, KmlGl.prototype);
  var tempFBufferByte;
  function get_tempFBuffer1() {
    init_properties_KmlGlExt_kt_tmzlag();
    return tempFBuffer1;
  }
  var tempFBuffer1;
  var tempFBuffer4;
  function getIntegerv(_this__u8e3s4, pname) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.getIntegerv.<anonymous>' call
    _this__u8e3s4.map(pname, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function tempInt1Buffer(value, block) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, value);
    block(tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    return tmp$ret$1;
  }
  function deleteBuffer(_this__u8e3s4, id) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, id);
    // Inline function 'com.soywiz.kgl.deleteBuffer.<anonymous>' call
    _this__u8e3s4.oao(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
  }
  function genBuffer(_this__u8e3s4) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.genBuffer.<anonymous>' call
    _this__u8e3s4.eap(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function genTexture(_this__u8e3s4) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.genTexture.<anonymous>' call
    _this__u8e3s4.iap(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function deleteTexture(_this__u8e3s4, id) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, id);
    // Inline function 'com.soywiz.kgl.deleteTexture.<anonymous>' call
    _this__u8e3s4.tao(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
  }
  function deleteRenderbuffer(_this__u8e3s4, id) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, id);
    // Inline function 'com.soywiz.kgl.deleteRenderbuffer.<anonymous>' call
    _this__u8e3s4.rao(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
  }
  function deleteFramebuffer(_this__u8e3s4, id) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, id);
    // Inline function 'com.soywiz.kgl.deleteFramebuffer.<anonymous>' call
    _this__u8e3s4.pao(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
  }
  function genRenderbuffer(_this__u8e3s4) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.genRenderbuffer.<anonymous>' call
    _this__u8e3s4.hap(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function genFramebuffer(_this__u8e3s4) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.genFramebuffer.<anonymous>' call
    _this__u8e3s4.gap(1, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function getProgramiv(_this__u8e3s4, program, type) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.getProgramiv.<anonymous>' call
    _this__u8e3s4.nap(program, type, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function getShaderiv(_this__u8e3s4, shader, type) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$2;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer' call
    var tmp$ret$1;
    // Inline function 'kotlin.let' call
    var tmp0_let = _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4();
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.tempInt1Buffer.<anonymous>' call
    tmp0_let.r4x(0, 0);
    // Inline function 'com.soywiz.kgl.getShaderiv.<anonymous>' call
    _this__u8e3s4.oap(shader, type, tmp0_let);
    tmp$ret$0 = tmp0_let.p4x(0);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  }
  function getShaderInfoLog(_this__u8e3s4, shader) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$7;
    // Inline function 'com.soywiz.kgl.getInfoLog' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.INFO_LOG_LENGTH' call
    Companion_getInstance_14();
    tmp$ret$0 = 35716;
    var size = getShaderiv(_this__u8e3s4, shader, tmp$ret$0);
    var tmp$ret$6;
    // Inline function 'com.soywiz.kmem.fbuffer' call
    var tmp0_fbuffer = 4;
    var tmp$ret$5;
    // Inline function 'kotlin.run' call
    var tmp0_run = Companion_getInstance().p4w(tmp0_fbuffer);
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$4;
    // Inline function 'com.soywiz.kgl.getInfoLog.<anonymous>' call
    var tmp$ret$3;
    // Inline function 'com.soywiz.kmem.fbuffer' call
    var tmp$ret$2;
    // Inline function 'kotlin.run' call
    var tmp0_run_0 = Companion_getInstance().p4w(size);
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$1;
    // Inline function 'com.soywiz.kgl.getInfoLog.<anonymous>.<anonymous>' call
    _this__u8e3s4.pap(shader, size, tmp0_run, tmp0_run_0);
    tmp$ret$1 = toAsciiString(tmp0_run_0);
    tmp$ret$2 = tmp$ret$1;
    tmp$ret$3 = tmp$ret$2;
    tmp$ret$4 = tmp$ret$3;
    tmp$ret$5 = tmp$ret$4;
    tmp$ret$6 = tmp$ret$5;
    tmp$ret$7 = tmp$ret$6;
    return tmp$ret$7;
  }
  function getInfoLog(_this__u8e3s4, obj, getiv, getInfoLog) {
    init_properties_KmlGlExt_kt_tmzlag();
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.INFO_LOG_LENGTH' call
    Companion_getInstance_14();
    tmp$ret$0 = 35716;
    var size = getiv(obj, tmp$ret$0);
    var tmp$ret$6;
    // Inline function 'com.soywiz.kmem.fbuffer' call
    var tmp0_fbuffer = 4;
    var tmp$ret$5;
    // Inline function 'kotlin.run' call
    var tmp0_run = Companion_getInstance().p4w(tmp0_fbuffer);
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$4;
    // Inline function 'com.soywiz.kgl.getInfoLog.<anonymous>' call
    var tmp$ret$3;
    // Inline function 'com.soywiz.kmem.fbuffer' call
    var tmp$ret$2;
    // Inline function 'kotlin.run' call
    var tmp0_run_0 = Companion_getInstance().p4w(size);
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$1;
    // Inline function 'com.soywiz.kgl.getInfoLog.<anonymous>.<anonymous>' call
    getInfoLog(obj, size, tmp0_run, tmp0_run_0);
    tmp$ret$1 = toAsciiString(tmp0_run_0);
    tmp$ret$2 = tmp$ret$1;
    tmp$ret$3 = tmp$ret$2;
    tmp$ret$4 = tmp$ret$3;
    tmp$ret$5 = tmp$ret$4;
    tmp$ret$6 = tmp$ret$5;
    return tmp$ret$6;
  }
  function _get_tempFBuffer1_$accessor$x5nv6d_dnlkx4() {
    init_properties_KmlGlExt_kt_tmzlag();
    return get_tempFBuffer1();
  }
  var properties_initialized_KmlGlExt_kt_yrhd4c;
  function init_properties_KmlGlExt_kt_tmzlag() {
    if (properties_initialized_KmlGlExt_kt_yrhd4c) {
    } else {
      properties_initialized_KmlGlExt_kt_yrhd4c = true;
      tempFBufferByte = Companion_getInstance().p4w(1);
      tempFBuffer1 = Companion_getInstance().p4w(4);
      tempFBuffer4 = Companion_getInstance().p4w(16);
    }
  }
  function AGFeatures() {
  }
  AGFeatures.$metadata$ = interfaceMeta('AGFeatures');
  var BlendEquation_ADD_instance;
  var BlendEquation_SUBTRACT_instance;
  var BlendEquation_REVERSE_SUBTRACT_instance;
  function Companion_1() {
    Companion_instance_1 = this;
    this.bar_1 = values();
  }
  Companion_1.$metadata$ = objectMeta('Companion');
  var Companion_instance_1;
  function Companion_getInstance_16() {
    BlendEquation_initEntries();
    if (Companion_instance_1 == null)
      new Companion_1();
    return Companion_instance_1;
  }
  function values() {
    return [BlendEquation_ADD_getInstance(), BlendEquation_SUBTRACT_getInstance(), BlendEquation_REVERSE_SUBTRACT_getInstance()];
  }
  var BlendEquation_entriesInitialized;
  function BlendEquation_initEntries() {
    if (BlendEquation_entriesInitialized)
      return Unit_getInstance();
    BlendEquation_entriesInitialized = true;
    BlendEquation_ADD_instance = new BlendEquation('ADD', 0, '+');
    BlendEquation_SUBTRACT_instance = new BlendEquation('SUBTRACT', 1, '-');
    BlendEquation_REVERSE_SUBTRACT_instance = new BlendEquation('REVERSE_SUBTRACT', 2, 'r-');
    Companion_getInstance_16();
  }
  var BlendFactor_DESTINATION_ALPHA_instance;
  var BlendFactor_DESTINATION_COLOR_instance;
  var BlendFactor_ONE_instance;
  var BlendFactor_ONE_MINUS_DESTINATION_ALPHA_instance;
  var BlendFactor_ONE_MINUS_DESTINATION_COLOR_instance;
  var BlendFactor_ONE_MINUS_SOURCE_ALPHA_instance;
  var BlendFactor_ONE_MINUS_SOURCE_COLOR_instance;
  var BlendFactor_SOURCE_ALPHA_instance;
  var BlendFactor_SOURCE_COLOR_instance;
  var BlendFactor_ZERO_instance;
  function Companion_2() {
    Companion_instance_2 = this;
    this.car_1 = values_0();
  }
  Companion_2.$metadata$ = objectMeta('Companion');
  var Companion_instance_2;
  function Companion_getInstance_17() {
    BlendFactor_initEntries();
    if (Companion_instance_2 == null)
      new Companion_2();
    return Companion_instance_2;
  }
  function values_0() {
    return [BlendFactor_DESTINATION_ALPHA_getInstance(), BlendFactor_DESTINATION_COLOR_getInstance(), BlendFactor_ONE_getInstance(), BlendFactor_ONE_MINUS_DESTINATION_ALPHA_getInstance(), BlendFactor_ONE_MINUS_DESTINATION_COLOR_getInstance(), BlendFactor_ONE_MINUS_SOURCE_ALPHA_getInstance(), BlendFactor_ONE_MINUS_SOURCE_COLOR_getInstance(), BlendFactor_SOURCE_ALPHA_getInstance(), BlendFactor_SOURCE_COLOR_getInstance(), BlendFactor_ZERO_getInstance()];
  }
  var BlendFactor_entriesInitialized;
  function BlendFactor_initEntries() {
    if (BlendFactor_entriesInitialized)
      return Unit_getInstance();
    BlendFactor_entriesInitialized = true;
    BlendFactor_DESTINATION_ALPHA_instance = new BlendFactor('DESTINATION_ALPHA', 0, 'dstA');
    BlendFactor_DESTINATION_COLOR_instance = new BlendFactor('DESTINATION_COLOR', 1, 'dstRGB');
    BlendFactor_ONE_instance = new BlendFactor('ONE', 2, '1');
    BlendFactor_ONE_MINUS_DESTINATION_ALPHA_instance = new BlendFactor('ONE_MINUS_DESTINATION_ALPHA', 3, '(1 - dstA)');
    BlendFactor_ONE_MINUS_DESTINATION_COLOR_instance = new BlendFactor('ONE_MINUS_DESTINATION_COLOR', 4, '(1 - dstRGB)');
    BlendFactor_ONE_MINUS_SOURCE_ALPHA_instance = new BlendFactor('ONE_MINUS_SOURCE_ALPHA', 5, '(1 - srcA)');
    BlendFactor_ONE_MINUS_SOURCE_COLOR_instance = new BlendFactor('ONE_MINUS_SOURCE_COLOR', 6, '(1 - srcRGB)');
    BlendFactor_SOURCE_ALPHA_instance = new BlendFactor('SOURCE_ALPHA', 7, 'srcA');
    BlendFactor_SOURCE_COLOR_instance = new BlendFactor('SOURCE_COLOR', 8, 'srcRGB');
    BlendFactor_ZERO_instance = new BlendFactor('ZERO', 9, '0');
    Companion_getInstance_17();
  }
  function Scissor_init_$Init$(rect, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      rect = Companion_getInstance_0().zp();
    Scissor.call($this, rect);
    return $this;
  }
  function Scissor_init_$Create$(rect, $mask0, $marker) {
    return Scissor_init_$Init$(rect, $mask0, $marker, Object.create(Scissor.prototype));
  }
  function Companion_3() {
    Companion_instance_3 = this;
  }
  Companion_3.$metadata$ = objectMeta('Companion');
  var Companion_instance_3;
  function Companion_getInstance_18() {
    if (Companion_instance_3 == null)
      new Companion_3();
    return Companion_instance_3;
  }
  function Blending_init_$Init$(srcRGB, dstRGB, srcA, dstA, eqRGB, eqA, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      srcA = srcRGB;
    if (!(($mask0 & 8) === 0))
      dstA = dstRGB;
    if (!(($mask0 & 16) === 0))
      eqRGB = BlendEquation_ADD_getInstance();
    if (!(($mask0 & 32) === 0))
      eqA = eqRGB;
    Blending.call($this, srcRGB, dstRGB, srcA, dstA, eqRGB, eqA);
    return $this;
  }
  function Blending_init_$Create$(srcRGB, dstRGB, srcA, dstA, eqRGB, eqA, $mask0, $marker) {
    return Blending_init_$Init$(srcRGB, dstRGB, srcA, dstA, eqRGB, eqA, $mask0, $marker, Object.create(Blending.prototype));
  }
  function Blending_init_$Init$_0(src, dst, eq, $this) {
    Blending.call($this, src, dst, src, dst, eq, eq);
    return $this;
  }
  function Blending_init_$Init$_1(src, dst, eq, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      eq = BlendEquation_ADD_getInstance();
    Blending_init_$Init$_0(src, dst, eq, $this);
    return $this;
  }
  function Blending_init_$Create$_0(src, dst, eq, $mask0, $marker) {
    return Blending_init_$Init$_1(src, dst, eq, $mask0, $marker, Object.create(Blending.prototype));
  }
  function Companion_4() {
    Companion_instance_4 = this;
    var tmp = this;
    var tmp_0 = BlendFactor_ONE_getInstance();
    var tmp_1 = BlendFactor_ZERO_getInstance();
    var tmp_2 = BlendFactor_ONE_getInstance();
    var tmp_3 = BlendFactor_ZERO_getInstance();
    tmp.dar_1 = Blending_init_$Create$(tmp_0, tmp_1, tmp_2, tmp_3, null, null, 48, null);
    var tmp_4 = this;
    var tmp_5 = BlendFactor_SOURCE_ALPHA_getInstance();
    var tmp_6 = BlendFactor_ONE_MINUS_SOURCE_ALPHA_getInstance();
    var tmp_7 = BlendFactor_ONE_getInstance();
    var tmp_8 = BlendFactor_ONE_MINUS_SOURCE_ALPHA_getInstance();
    tmp_4.ear_1 = Blending_init_$Create$(tmp_5, tmp_6, tmp_7, tmp_8, null, null, 48, null);
    var tmp_9 = this;
    var tmp_10 = BlendFactor_ONE_getInstance();
    var tmp_11 = BlendFactor_ONE_MINUS_SOURCE_ALPHA_getInstance();
    tmp_9.far_1 = Blending_init_$Create$_0(tmp_10, tmp_11, null, 4, null);
    var tmp_12 = this;
    var tmp_13 = BlendFactor_SOURCE_ALPHA_getInstance();
    var tmp_14 = BlendFactor_DESTINATION_ALPHA_getInstance();
    var tmp_15 = BlendFactor_ONE_getInstance();
    var tmp_16 = BlendFactor_ONE_getInstance();
    tmp_12.gar_1 = Blending_init_$Create$(tmp_13, tmp_14, tmp_15, tmp_16, null, null, 48, null);
    var tmp_17 = this;
    var tmp_18 = BlendFactor_ONE_getInstance();
    var tmp_19 = BlendFactor_ONE_getInstance();
    var tmp_20 = BlendFactor_ONE_getInstance();
    var tmp_21 = BlendFactor_ONE_getInstance();
    tmp_17.har_1 = Blending_init_$Create$(tmp_18, tmp_19, tmp_20, tmp_21, null, null, 48, null);
  }
  Companion_4.$metadata$ = objectMeta('Companion');
  var Companion_instance_4;
  function Companion_getInstance_19() {
    if (Companion_instance_4 == null)
      new Companion_4();
    return Companion_instance_4;
  }
  function AG$SyncBitmapSourceList$Companion$NIL$lambda() {
    return null;
  }
  function Companion_5() {
    Companion_instance_5 = this;
    var tmp = this;
    tmp.iar_1 = new SyncBitmapSourceList(true, 0, 0, 0, AG$SyncBitmapSourceList$Companion$NIL$lambda);
  }
  Companion_5.$metadata$ = objectMeta('Companion');
  var Companion_instance_5;
  function Companion_getInstance_20() {
    if (Companion_instance_5 == null)
      new Companion_5();
    return Companion_instance_5;
  }
  function AG$SyncBitmapSource$Companion$NIL$lambda() {
    return null;
  }
  function Companion_6() {
    Companion_instance_6 = this;
    var tmp = this;
    tmp.jar_1 = new SyncBitmapSource(true, 0, 0, AG$SyncBitmapSource$Companion$NIL$lambda);
  }
  Companion_6.$metadata$ = objectMeta('Companion');
  var Companion_instance_6;
  function Companion_getInstance_21() {
    if (Companion_instance_6 == null)
      new Companion_6();
    return Companion_instance_6;
  }
  var TextureTargetKind_TEXTURE_2D_instance;
  var TextureTargetKind_TEXTURE_3D_instance;
  var TextureTargetKind_TEXTURE_CUBE_MAP_instance;
  var TextureTargetKind_EXTERNAL_TEXTURE_instance;
  function Companion_7() {
    Companion_instance_7 = this;
    this.kar_1 = values_1();
  }
  Companion_7.$metadata$ = objectMeta('Companion');
  var Companion_instance_7;
  function Companion_getInstance_22() {
    TextureTargetKind_initEntries();
    if (Companion_instance_7 == null)
      new Companion_7();
    return Companion_instance_7;
  }
  function values_1() {
    return [TextureTargetKind_TEXTURE_2D_getInstance(), TextureTargetKind_TEXTURE_3D_getInstance(), TextureTargetKind_TEXTURE_CUBE_MAP_getInstance(), TextureTargetKind_EXTERNAL_TEXTURE_getInstance()];
  }
  var TextureTargetKind_entriesInitialized;
  function TextureTargetKind_initEntries() {
    if (TextureTargetKind_entriesInitialized)
      return Unit_getInstance();
    TextureTargetKind_entriesInitialized = true;
    TextureTargetKind_TEXTURE_2D_instance = new TextureTargetKind('TEXTURE_2D', 0, 2);
    TextureTargetKind_TEXTURE_3D_instance = new TextureTargetKind('TEXTURE_3D', 1, 3);
    TextureTargetKind_TEXTURE_CUBE_MAP_instance = new TextureTargetKind('TEXTURE_CUBE_MAP', 2, 3);
    TextureTargetKind_EXTERNAL_TEXTURE_instance = new TextureTargetKind('EXTERNAL_TEXTURE', 3, 2);
    Companion_getInstance_22();
  }
  function Texture_init_$Init$($outer, premultiplied, targetKind, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      targetKind = TextureTargetKind_TEXTURE_2D_getInstance();
    Texture.call($this, $outer, premultiplied, targetKind);
    return $this;
  }
  function checkBitmaps($this, bmp) {
    if (!bmp.s7y_1) {
      Console_getInstance().r50(['Trying to upload a non-premultiplied bitmap: ' + bmp + '. This will cause rendering artifacts']);
    }
  }
  function AG$Texture$upload$lambda($list) {
    return function () {
      return $list;
    };
  }
  function AG$Texture$upload$lambda_0($bmp) {
    return function () {
      return $bmp;
    };
  }
  function TextureUnit_init_$Init$(texture, linear, trilinear, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      texture = null;
    if (!(($mask0 & 2) === 0))
      linear = true;
    if (!(($mask0 & 4) === 0))
      trilinear = null;
    TextureUnit.call($this, texture, linear, trilinear);
    return $this;
  }
  function TextureUnit_init_$Create$(texture, linear, trilinear, $mask0, $marker) {
    return TextureUnit_init_$Init$(texture, linear, trilinear, $mask0, $marker, Object.create(TextureUnit.prototype));
  }
  var BufferKind_INDEX_instance;
  var BufferKind_VERTEX_instance;
  var BufferKind_entriesInitialized;
  function BufferKind_initEntries() {
    if (BufferKind_entriesInitialized)
      return Unit_getInstance();
    BufferKind_entriesInitialized = true;
    BufferKind_INDEX_instance = new BufferKind('INDEX', 0);
    BufferKind_VERTEX_instance = new BufferKind('VERTEX', 1);
  }
  function allocateMem($this, size) {
    if ($this.nar_1 == null ? true : ensureNotNull($this.nar_1).s4w_1 < size) {
      $this.nar_1 = Companion_getInstance().p4w(get_nextPowerOfTwo(size));
    }
    return ensureNotNull($this.nar_1);
  }
  function getLen($this, len, dataSize) {
    return len >= 0 ? len : dataSize;
  }
  function _upload($this, data, offset, length) {
    $this.nar_1 = data;
    $this.oar_1 = offset;
    $this.par_1 = length;
    $this.mar_1 = true;
    $this.tar();
    return $this;
  }
  var DrawType_POINTS_instance;
  var DrawType_LINE_STRIP_instance;
  var DrawType_LINE_LOOP_instance;
  var DrawType_LINES_instance;
  var DrawType_TRIANGLES_instance;
  var DrawType_TRIANGLE_STRIP_instance;
  var DrawType_TRIANGLE_FAN_instance;
  function Companion_8() {
    Companion_instance_8 = this;
    this.uar_1 = values_2();
  }
  Companion_8.$metadata$ = objectMeta('Companion');
  var Companion_instance_8;
  function Companion_getInstance_23() {
    DrawType_initEntries();
    if (Companion_instance_8 == null)
      new Companion_8();
    return Companion_instance_8;
  }
  function values_2() {
    return [DrawType_POINTS_getInstance(), DrawType_LINE_STRIP_getInstance(), DrawType_LINE_LOOP_getInstance(), DrawType_LINES_getInstance(), DrawType_TRIANGLES_getInstance(), DrawType_TRIANGLE_STRIP_getInstance(), DrawType_TRIANGLE_FAN_getInstance()];
  }
  var DrawType_entriesInitialized;
  function DrawType_initEntries() {
    if (DrawType_entriesInitialized)
      return Unit_getInstance();
    DrawType_entriesInitialized = true;
    DrawType_POINTS_instance = new DrawType('POINTS', 0);
    DrawType_LINE_STRIP_instance = new DrawType('LINE_STRIP', 1);
    DrawType_LINE_LOOP_instance = new DrawType('LINE_LOOP', 2);
    DrawType_LINES_instance = new DrawType('LINES', 3);
    DrawType_TRIANGLES_instance = new DrawType('TRIANGLES', 4);
    DrawType_TRIANGLE_STRIP_instance = new DrawType('TRIANGLE_STRIP', 5);
    DrawType_TRIANGLE_FAN_instance = new DrawType('TRIANGLE_FAN', 6);
    Companion_getInstance_23();
  }
  var IndexType_UBYTE_instance;
  var IndexType_USHORT_instance;
  var IndexType_UINT_instance;
  function Companion_9() {
    Companion_instance_9 = this;
    this.var_1 = values_3();
  }
  Companion_9.$metadata$ = objectMeta('Companion');
  var Companion_instance_9;
  function Companion_getInstance_24() {
    IndexType_initEntries();
    if (Companion_instance_9 == null)
      new Companion_9();
    return Companion_instance_9;
  }
  function values_3() {
    return [IndexType_UBYTE_getInstance(), IndexType_USHORT_getInstance(), IndexType_UINT_getInstance()];
  }
  var IndexType_entriesInitialized;
  function IndexType_initEntries() {
    if (IndexType_entriesInitialized)
      return Unit_getInstance();
    IndexType_entriesInitialized = true;
    IndexType_UBYTE_instance = new IndexType('UBYTE', 0);
    IndexType_USHORT_instance = new IndexType('USHORT', 1);
    IndexType_UINT_instance = new IndexType('UINT', 2);
    Companion_getInstance_24();
  }
  var ReadKind_COLOR_instance;
  var ReadKind_DEPTH_instance;
  var ReadKind_STENCIL_instance;
  function Companion_10() {
    Companion_instance_10 = this;
    this.war_1 = values_4();
  }
  Companion_10.$metadata$ = objectMeta('Companion');
  var Companion_instance_10;
  function Companion_getInstance_25() {
    ReadKind_initEntries();
    if (Companion_instance_10 == null)
      new Companion_10();
    return Companion_instance_10;
  }
  function values_4() {
    return [ReadKind_COLOR_getInstance(), ReadKind_DEPTH_getInstance(), ReadKind_STENCIL_getInstance()];
  }
  var ReadKind_entriesInitialized;
  function ReadKind_initEntries() {
    if (ReadKind_entriesInitialized)
      return Unit_getInstance();
    ReadKind_entriesInitialized = true;
    ReadKind_COLOR_instance = new ReadKind('COLOR', 0, 4);
    ReadKind_DEPTH_instance = new ReadKind('DEPTH', 1, 4);
    ReadKind_STENCIL_instance = new ReadKind('STENCIL', 2, 1);
    Companion_getInstance_25();
  }
  var StencilOp_DECREMENT_SATURATE_instance;
  var StencilOp_DECREMENT_WRAP_instance;
  var StencilOp_INCREMENT_SATURATE_instance;
  var StencilOp_INCREMENT_WRAP_instance;
  var StencilOp_INVERT_instance;
  var StencilOp_KEEP_instance;
  var StencilOp_SET_instance;
  var StencilOp_ZERO_instance;
  function Companion_11() {
    Companion_instance_11 = this;
    this.xar_1 = values_5();
  }
  Companion_11.$metadata$ = objectMeta('Companion');
  var Companion_instance_11;
  function Companion_getInstance_26() {
    StencilOp_initEntries();
    if (Companion_instance_11 == null)
      new Companion_11();
    return Companion_instance_11;
  }
  function values_5() {
    return [StencilOp_DECREMENT_SATURATE_getInstance(), StencilOp_DECREMENT_WRAP_getInstance(), StencilOp_INCREMENT_SATURATE_getInstance(), StencilOp_INCREMENT_WRAP_getInstance(), StencilOp_INVERT_getInstance(), StencilOp_KEEP_getInstance(), StencilOp_SET_getInstance(), StencilOp_ZERO_getInstance()];
  }
  var StencilOp_entriesInitialized;
  function StencilOp_initEntries() {
    if (StencilOp_entriesInitialized)
      return Unit_getInstance();
    StencilOp_entriesInitialized = true;
    StencilOp_DECREMENT_SATURATE_instance = new StencilOp('DECREMENT_SATURATE', 0);
    StencilOp_DECREMENT_WRAP_instance = new StencilOp('DECREMENT_WRAP', 1);
    StencilOp_INCREMENT_SATURATE_instance = new StencilOp('INCREMENT_SATURATE', 2);
    StencilOp_INCREMENT_WRAP_instance = new StencilOp('INCREMENT_WRAP', 3);
    StencilOp_INVERT_instance = new StencilOp('INVERT', 4);
    StencilOp_KEEP_instance = new StencilOp('KEEP', 5);
    StencilOp_SET_instance = new StencilOp('SET', 6);
    StencilOp_ZERO_instance = new StencilOp('ZERO', 7);
    Companion_getInstance_26();
  }
  var TriangleFace_FRONT_instance;
  var TriangleFace_BACK_instance;
  var TriangleFace_FRONT_AND_BACK_instance;
  var TriangleFace_NONE_instance;
  function Companion_12() {
    Companion_instance_12 = this;
    this.yar_1 = values_6();
  }
  Companion_12.$metadata$ = objectMeta('Companion');
  var Companion_instance_12;
  function Companion_getInstance_27() {
    TriangleFace_initEntries();
    if (Companion_instance_12 == null)
      new Companion_12();
    return Companion_instance_12;
  }
  function values_6() {
    return [TriangleFace_FRONT_getInstance(), TriangleFace_BACK_getInstance(), TriangleFace_FRONT_AND_BACK_getInstance(), TriangleFace_NONE_getInstance()];
  }
  var TriangleFace_entriesInitialized;
  function TriangleFace_initEntries() {
    if (TriangleFace_entriesInitialized)
      return Unit_getInstance();
    TriangleFace_entriesInitialized = true;
    TriangleFace_FRONT_instance = new TriangleFace('FRONT', 0);
    TriangleFace_BACK_instance = new TriangleFace('BACK', 1);
    TriangleFace_FRONT_AND_BACK_instance = new TriangleFace('FRONT_AND_BACK', 2);
    TriangleFace_NONE_instance = new TriangleFace('NONE', 3);
    Companion_getInstance_27();
  }
  var CompareMode_ALWAYS_instance;
  var CompareMode_EQUAL_instance;
  var CompareMode_GREATER_instance;
  var CompareMode_GREATER_EQUAL_instance;
  var CompareMode_LESS_instance;
  var CompareMode_LESS_EQUAL_instance;
  var CompareMode_NEVER_instance;
  var CompareMode_NOT_EQUAL_instance;
  function Companion_13() {
    Companion_instance_13 = this;
    this.zar_1 = values_7();
  }
  Companion_13.$metadata$ = objectMeta('Companion');
  var Companion_instance_13;
  function Companion_getInstance_28() {
    CompareMode_initEntries();
    if (Companion_instance_13 == null)
      new Companion_13();
    return Companion_instance_13;
  }
  function values_7() {
    return [CompareMode_ALWAYS_getInstance(), CompareMode_EQUAL_getInstance(), CompareMode_GREATER_getInstance(), CompareMode_GREATER_EQUAL_getInstance(), CompareMode_LESS_getInstance(), CompareMode_LESS_EQUAL_getInstance(), CompareMode_NEVER_getInstance(), CompareMode_NOT_EQUAL_getInstance()];
  }
  var CompareMode_entriesInitialized;
  function CompareMode_initEntries() {
    if (CompareMode_entriesInitialized)
      return Unit_getInstance();
    CompareMode_entriesInitialized = true;
    CompareMode_ALWAYS_instance = new CompareMode('ALWAYS', 0);
    CompareMode_EQUAL_instance = new CompareMode('EQUAL', 1);
    CompareMode_GREATER_instance = new CompareMode('GREATER', 2);
    CompareMode_GREATER_EQUAL_instance = new CompareMode('GREATER_EQUAL', 3);
    CompareMode_LESS_instance = new CompareMode('LESS', 4);
    CompareMode_LESS_EQUAL_instance = new CompareMode('LESS_EQUAL', 5);
    CompareMode_NEVER_instance = new CompareMode('NEVER', 6);
    CompareMode_NOT_EQUAL_instance = new CompareMode('NOT_EQUAL', 7);
    Companion_getInstance_28();
  }
  function ColorMaskState_init_$Init$(value, $this) {
    ColorMaskState.call($this, value, value, value, value);
    return $this;
  }
  function ColorMaskState_init_$Create$(value) {
    return ColorMaskState_init_$Init$(value, Object.create(ColorMaskState.prototype));
  }
  function ColorMaskState_init_$Init$_0(value, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      value = true;
    ColorMaskState_init_$Init$(value, $this);
    return $this;
  }
  function ColorMaskState_init_$Create$_0(value, $mask0, $marker) {
    return ColorMaskState_init_$Init$_0(value, $mask0, $marker, Object.create(ColorMaskState.prototype));
  }
  function Companion_14() {
    Companion_instance_14 = this;
    var tmp = this;
    tmp.aas_1 = ColorMaskState_init_$Create$_0(false, 1, null);
  }
  Companion_14.$metadata$ = objectMeta('Companion');
  var Companion_instance_14;
  function Companion_getInstance_29() {
    if (Companion_instance_14 == null)
      new Companion_14();
    return Companion_instance_14;
  }
  var CullFace_BOTH_instance;
  var CullFace_FRONT_instance;
  var CullFace_BACK_instance;
  function Companion_15() {
    Companion_instance_15 = this;
    this.bas_1 = values_8();
  }
  Companion_15.$metadata$ = objectMeta('Companion');
  var Companion_instance_15;
  function Companion_getInstance_30() {
    CullFace_initEntries();
    if (Companion_instance_15 == null)
      new Companion_15();
    return Companion_instance_15;
  }
  function values_8() {
    return [CullFace_BOTH_getInstance(), CullFace_FRONT_getInstance(), CullFace_BACK_getInstance()];
  }
  var CullFace_entriesInitialized;
  function CullFace_initEntries() {
    if (CullFace_entriesInitialized)
      return Unit_getInstance();
    CullFace_entriesInitialized = true;
    CullFace_BOTH_instance = new CullFace('BOTH', 0);
    CullFace_FRONT_instance = new CullFace('FRONT', 1);
    CullFace_BACK_instance = new CullFace('BACK', 2);
    Companion_getInstance_30();
  }
  var FrontFace_BOTH_instance;
  var FrontFace_CCW_instance;
  var FrontFace_CW_instance;
  function Companion_16() {
    Companion_instance_16 = this;
    this.cas_1 = values_9();
  }
  Companion_16.$metadata$ = objectMeta('Companion');
  var Companion_instance_16;
  function Companion_getInstance_31() {
    FrontFace_initEntries();
    if (Companion_instance_16 == null)
      new Companion_16();
    return Companion_instance_16;
  }
  function values_9() {
    return [FrontFace_BOTH_getInstance(), FrontFace_CCW_getInstance(), FrontFace_CW_getInstance()];
  }
  var FrontFace_entriesInitialized;
  function FrontFace_initEntries() {
    if (FrontFace_entriesInitialized)
      return Unit_getInstance();
    FrontFace_entriesInitialized = true;
    FrontFace_BOTH_instance = new FrontFace('BOTH', 0);
    FrontFace_CCW_instance = new FrontFace('CCW', 1);
    FrontFace_CW_instance = new FrontFace('CW', 2);
    Companion_getInstance_31();
  }
  function RenderState_init_$Init$(depthFunc, depthMask, depthNear, depthFar, lineWidth, frontFace, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      depthFunc = CompareMode_ALWAYS_getInstance();
    if (!(($mask0 & 2) === 0))
      depthMask = true;
    if (!(($mask0 & 4) === 0))
      depthNear = 0.0;
    if (!(($mask0 & 8) === 0))
      depthFar = 1.0;
    if (!(($mask0 & 16) === 0))
      lineWidth = 1.0;
    if (!(($mask0 & 32) === 0))
      frontFace = FrontFace_BOTH_getInstance();
    RenderState.call($this, depthFunc, depthMask, depthNear, depthFar, lineWidth, frontFace);
    return $this;
  }
  function RenderState_init_$Create$(depthFunc, depthMask, depthNear, depthFar, lineWidth, frontFace, $mask0, $marker) {
    return RenderState_init_$Init$(depthFunc, depthMask, depthNear, depthFar, lineWidth, frontFace, $mask0, $marker, Object.create(RenderState.prototype));
  }
  function Companion_17() {
    Companion_instance_17 = this;
    var tmp = this;
    tmp.das_1 = RenderState_init_$Create$(null, false, 0.0, 0.0, 0.0, null, 63, null);
  }
  Companion_17.$metadata$ = objectMeta('Companion');
  var Companion_instance_17;
  function Companion_getInstance_32() {
    if (Companion_instance_17 == null)
      new Companion_17();
    return Companion_instance_17;
  }
  function StencilState_init_$Init$(enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      enabled = false;
    if (!(($mask0 & 2) === 0))
      triangleFace = TriangleFace_FRONT_AND_BACK_getInstance();
    if (!(($mask0 & 4) === 0))
      compareMode = CompareMode_ALWAYS_getInstance();
    if (!(($mask0 & 8) === 0))
      actionOnBothPass = StencilOp_KEEP_getInstance();
    if (!(($mask0 & 16) === 0))
      actionOnDepthFail = StencilOp_KEEP_getInstance();
    if (!(($mask0 & 32) === 0))
      actionOnDepthPassStencilFail = StencilOp_KEEP_getInstance();
    if (!(($mask0 & 64) === 0))
      referenceValue = 0;
    if (!(($mask0 & 128) === 0))
      readMask = 255;
    if (!(($mask0 & 256) === 0))
      writeMask = 255;
    StencilState.call($this, enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask);
    return $this;
  }
  function StencilState_init_$Create$(enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask, $mask0, $marker) {
    return StencilState_init_$Init$(enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask, $mask0, $marker, Object.create(StencilState.prototype));
  }
  function Companion_18() {
    Companion_instance_18 = this;
    var tmp = this;
    tmp.eas_1 = StencilState_init_$Create$(false, null, null, null, null, null, 0, 0, 0, 511, null);
  }
  Companion_18.$metadata$ = objectMeta('Companion');
  var Companion_instance_18;
  function Companion_getInstance_33() {
    if (Companion_instance_18 == null)
      new Companion_18();
    return Companion_instance_18;
  }
  function _VertexArrayObject___init__impl__y6yvd1(list) {
    return list;
  }
  function _VertexArrayObject___get_list__impl__xj772i($this) {
    return $this;
  }
  function VertexArrayObject__toString_impl_u6lqlp($this) {
    return 'VertexArrayObject(list=' + $this + ')';
  }
  function VertexArrayObject__hashCode_impl_8fftsu($this) {
    return $this.hashCode();
  }
  function VertexArrayObject__equals_impl_1qz5vq($this, other) {
    if (!(other instanceof VertexArrayObject))
      return false;
    var tmp0_other_with_cast = other instanceof VertexArrayObject ? other.fas_1 : THROW_CCE();
    if (!$this.equals(tmp0_other_with_cast))
      return false;
    return true;
  }
  function VertexData_init_$Init$(_buffer, layout, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      layout = ProgramLayout_init_$Create$([]);
    VertexData.call($this, _buffer, layout);
    return $this;
  }
  function VertexData_init_$Create$(_buffer, layout, $mask0, $marker) {
    return VertexData_init_$Init$(_buffer, layout, $mask0, $marker, Object.create(VertexData.prototype));
  }
  function Batch_init_$Init$(vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0)) {
      vertexData = fastArrayListOf([VertexData_init_$Create$(null, null, 2, null)]);
    }
    if (!(($mask0 & 2) === 0))
      program = DefaultShaders_getInstance().bat_1;
    if (!(($mask0 & 4) === 0))
      type = DrawType_TRIANGLES_getInstance();
    if (!(($mask0 & 8) === 0))
      vertexCount = 0;
    if (!(($mask0 & 16) === 0))
      indices = null;
    if (!(($mask0 & 32) === 0))
      indexType = IndexType_USHORT_getInstance();
    if (!(($mask0 & 64) === 0))
      offset = 0;
    if (!(($mask0 & 128) === 0))
      blending = Companion_getInstance_19().ear_1;
    if (!(($mask0 & 256) === 0))
      uniforms = Companion_getInstance_34().dat_1;
    if (!(($mask0 & 512) === 0)) {
      stencil = StencilState_init_$Create$(false, null, null, null, null, null, 0, 0, 0, 511, null);
    }
    if (!(($mask0 & 1024) === 0)) {
      colorMask = ColorMaskState_init_$Create$_0(false, 1, null);
    }
    if (!(($mask0 & 2048) === 0)) {
      renderState = RenderState_init_$Create$(null, false, 0.0, 0.0, 0.0, null, 63, null);
    }
    if (!(($mask0 & 4096) === 0))
      scissor = null;
    if (!(($mask0 & 8192) === 0))
      instances = 1;
    Batch.call($this, vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances);
    return $this;
  }
  function Batch_init_$Create$(vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances, $mask0, $marker) {
    return Batch_init_$Init$(vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances, $mask0, $marker, Object.create(Batch.prototype));
  }
  function ensureSingleVertexData($this) {
    if ($this.sat_1.p()) {
      $this.sat_1.c(VertexData_init_$Create$(null, null, 2, null));
    }
    $this.eat_1 = $this.sat_1;
  }
  function Companion_19() {
    Companion_instance_19 = this;
    this.dat_1 = new UniformValues();
  }
  Companion_19.prototype.tat = function (value) {
    if (!(value == null) ? isFloatArray(value) : false)
      return toString_0(toList(value));
    return toString(value);
  };
  Companion_19.$metadata$ = objectMeta('Companion');
  var Companion_instance_19;
  function Companion_getInstance_34() {
    if (Companion_instance_19 == null)
      new Companion_19();
    return Companion_instance_19;
  }
  function UniformValues_init_$Init$(pairs, $this) {
    UniformValues.call($this);
    var indexedObject = pairs;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var pair = indexedObject[inductionVariable];
      inductionVariable = inductionVariable + 1 | 0;
      $this.yat(pair.d_1, pair.e_1);
    }
    return $this;
  }
  function UniformValues_init_$Create$(pairs) {
    return UniformValues_init_$Init$(pairs, Object.create(UniformValues.prototype));
  }
  function AG$UniformValues$iterator$slambda(this$0, resultContinuation) {
    this.hau_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AG$UniformValues$iterator$slambda.prototype.nau = function ($this$iterator, $cont) {
    var tmp = this.oau($this$iterator, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AG$UniformValues$iterator$slambda.prototype.w7 = function (p1, $cont) {
    return this.nau(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
  };
  AG$UniformValues$iterator$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 4;
            this.jau_1 = until(0, this.hau_1.i()).j();
            this.o7_1 = 1;
            continue $sm;
          case 1:
            if (!this.jau_1.k()) {
              this.o7_1 = 3;
              continue $sm;
            }

            this.kau_1 = this.jau_1.l();
            var tmp_0 = this;
            tmp_0.lau_1 = this.hau_1.wat_1.m(this.kau_1);
            var tmp_1 = this;
            tmp_1.mau_1 = this.hau_1.xat_1.m(this.kau_1);
            this.o7_1 = 2;
            suspendResult = this.iau_1.h5(to(this.lau_1, this.mau_1), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 2:
            this.o7_1 = 1;
            continue $sm;
          case 3:
            return Unit_getInstance();
          case 4:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 4) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AG$UniformValues$iterator$slambda.prototype.oau = function ($this$iterator, completion) {
    var i = new AG$UniformValues$iterator$slambda(this.hau_1, completion);
    i.iau_1 = $this$iterator;
    return i;
  };
  AG$UniformValues$iterator$slambda.$metadata$ = classMeta('AG$UniformValues$iterator$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AG$UniformValues$iterator$slambda_0(this$0, resultContinuation) {
    var i = new AG$UniformValues$iterator$slambda(this$0, resultContinuation);
    var l = function ($this$iterator, $cont) {
      return i.nau($this$iterator, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function AG$UniformValues$toString$lambda(it) {
    return '' + it.d_1 + '=' + Companion_getInstance_34().tat(it.e_1);
  }
  function AGStats_init_$Init$(texturesCount, texturesMemory, buffersCount, buffersMemory, renderBuffersCount, renderBuffersMemory, texturesCreated, texturesDeleted, programCount, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      texturesCount = 0;
    if (!(($mask0 & 2) === 0))
      texturesMemory = Companion_getInstance_1().i4z(0);
    if (!(($mask0 & 4) === 0))
      buffersCount = 0;
    if (!(($mask0 & 8) === 0))
      buffersMemory = Companion_getInstance_1().i4z(0);
    if (!(($mask0 & 16) === 0))
      renderBuffersCount = 0;
    if (!(($mask0 & 32) === 0))
      renderBuffersMemory = Companion_getInstance_1().i4z(0);
    if (!(($mask0 & 64) === 0))
      texturesCreated = 0;
    if (!(($mask0 & 128) === 0))
      texturesDeleted = 0;
    if (!(($mask0 & 256) === 0))
      programCount = 0;
    AGStats.call($this, texturesCount, texturesMemory, buffersCount, buffersMemory, renderBuffersCount, renderBuffersMemory, texturesCreated, texturesDeleted, programCount);
    return $this;
  }
  function AGStats_init_$Create$(texturesCount, texturesMemory, buffersCount, buffersMemory, renderBuffersCount, renderBuffersMemory, texturesCreated, texturesDeleted, programCount, $mask0, $marker) {
    return AGStats_init_$Init$(texturesCount, texturesMemory, buffersCount, buffersMemory, renderBuffersCount, renderBuffersMemory, texturesCreated, texturesDeleted, programCount, $mask0, $marker, Object.create(AGStats.prototype));
  }
  function AG_init_$Init$(checked, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      checked = false;
    AG.call($this, checked);
    return $this;
  }
  function Companion_20() {
    Companion_instance_20 = this;
    this.pau_1 = 96.0;
  }
  Companion_20.$metadata$ = objectMeta('Companion');
  var Companion_instance_20;
  function Companion_getInstance_35() {
    if (Companion_instance_20 == null)
      new Companion_20();
    return Companion_instance_20;
  }
  function BlendEquation(name, ordinal, op) {
    Enum.call(this, name, ordinal);
    this.sau_1 = op;
  }
  BlendEquation.$metadata$ = classMeta('BlendEquation', undefined, undefined, undefined, undefined, Enum.prototype);
  function BlendFactor(name, ordinal, op) {
    Enum.call(this, name, ordinal);
    this.vau_1 = op;
  }
  BlendFactor.$metadata$ = classMeta('BlendFactor', undefined, undefined, undefined, undefined, Enum.prototype);
  function Scissor(rect) {
    Companion_getInstance_18();
    this.wau_1 = rect;
    this.xau_1 = x$factory(this.wau_1);
    this.yau_1 = y$factory(this.wau_1);
    this.zau_1 = width$factory(this.wau_1);
    this.aav_1 = height$factory(this.wau_1);
  }
  Scissor.prototype.bav = function () {
    return this.wau_1;
  };
  Scissor.prototype.w8w = function (_set____db54di) {
    var tmp0_setValue = x$factory_0();
    return this.xau_1.set(_set____db54di);
  };
  Scissor.prototype.d1n = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = x$factory_1();
    tmp$ret$0 = this.xau_1.get();
    return tmp$ret$0;
  };
  Scissor.prototype.o7c = function (_set____db54di) {
    var tmp0_setValue = y$factory_0();
    return this.yau_1.set(_set____db54di);
  };
  Scissor.prototype.e1n = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = y$factory_1();
    tmp$ret$0 = this.yau_1.get();
    return tmp$ret$0;
  };
  Scissor.prototype.cav = function (_set____db54di) {
    var tmp0_setValue = width$factory_0();
    return this.zau_1.set(_set____db54di);
  };
  Scissor.prototype.d72 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = width$factory_1();
    tmp$ret$0 = this.zau_1.get();
    return tmp$ret$0;
  };
  Scissor.prototype.p7c = function (_set____db54di) {
    var tmp0_setValue = height$factory_0();
    return this.aav_1.set(_set____db54di);
  };
  Scissor.prototype.e72 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = height$factory_1();
    tmp$ret$0 = this.aav_1.get();
    return tmp$ret$0;
  };
  Scissor.prototype.y73 = function () {
    return this.e1n();
  };
  Scissor.prototype.b74 = function () {
    return this.d1n();
  };
  Scissor.prototype.z73 = function () {
    return this.d1n() + this.d72();
  };
  Scissor.prototype.a74 = function () {
    return this.e1n() + this.e72();
  };
  Scissor.prototype.u72 = function (x, y, width, height) {
    this.w8w(x);
    this.o7c(y);
    this.cav(width);
    this.p7c(height);
    return this;
  };
  Scissor.prototype.t7c = function (x, y, width, height) {
    return this.u72(x, y, width, height);
  };
  Scissor.prototype.dav = function (rect) {
    return this.u72(rect.v71_1, rect.w71_1, rect.x71_1, rect.y71_1);
  };
  Scissor.prototype.toString = function () {
    return 'Scissor(x=' + get_niceStr(this.d1n()) + ', y=' + get_niceStr(this.e1n()) + ', width=' + get_niceStr(this.d72()) + ', height=' + get_niceStr(this.e72()) + ')';
  };
  Scissor.prototype.hashCode = function () {
    return this.wau_1.hashCode();
  };
  Scissor.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Scissor))
      return false;
    var tmp0_other_with_cast = other instanceof Scissor ? other : THROW_CCE();
    if (!this.wau_1.equals(tmp0_other_with_cast.wau_1))
      return false;
    return true;
  };
  Scissor.$metadata$ = classMeta('Scissor');
  function Blending(srcRGB, dstRGB, srcA, dstA, eqRGB, eqA) {
    Companion_getInstance_19();
    this.eav_1 = srcRGB;
    this.fav_1 = dstRGB;
    this.gav_1 = srcA;
    this.hav_1 = dstA;
    this.iav_1 = eqRGB;
    this.jav_1 = eqA;
    this.kav_1 = ((this.eav_1.equals(BlendFactor_ONE_getInstance()) ? this.fav_1.equals(BlendFactor_ZERO_getInstance()) : false) ? this.gav_1.equals(BlendFactor_ONE_getInstance()) : false) ? this.hav_1.equals(BlendFactor_ZERO_getInstance()) : false;
    this.lav_1 = !this.kav_1;
    var tmp = this;
    var tmp$ret$6;
    // Inline function 'com.soywiz.kds.hashCode' call
    var tmp0_hashCode = this.eav_1;
    var tmp1_hashCode = this.fav_1;
    var tmp2_hashCode = this.gav_1;
    var tmp3_hashCode = this.hav_1;
    var tmp4_hashCode = this.iav_1;
    var tmp5_hashCode = this.jav_1;
    var hash = 7;
    var tmp_0 = imul(31, hash);
    var tmp$ret$0;
    // Inline function 'kotlin.hashCode' call
    var tmp0_safe_receiver = tmp0_hashCode;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
    tmp$ret$0 = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
    hash = tmp_0 + tmp$ret$0 | 0;
    var tmp_1 = imul(31, hash);
    var tmp$ret$1;
    // Inline function 'kotlin.hashCode' call
    var tmp0_safe_receiver_0 = tmp1_hashCode;
    var tmp1_elvis_lhs_0 = tmp0_safe_receiver_0 == null ? null : hashCode(tmp0_safe_receiver_0);
    tmp$ret$1 = tmp1_elvis_lhs_0 == null ? 0 : tmp1_elvis_lhs_0;
    hash = tmp_1 + tmp$ret$1 | 0;
    var tmp_2 = imul(31, hash);
    var tmp$ret$2;
    // Inline function 'kotlin.hashCode' call
    var tmp0_safe_receiver_1 = tmp2_hashCode;
    var tmp1_elvis_lhs_1 = tmp0_safe_receiver_1 == null ? null : hashCode(tmp0_safe_receiver_1);
    tmp$ret$2 = tmp1_elvis_lhs_1 == null ? 0 : tmp1_elvis_lhs_1;
    hash = tmp_2 + tmp$ret$2 | 0;
    var tmp_3 = imul(31, hash);
    var tmp$ret$3;
    // Inline function 'kotlin.hashCode' call
    var tmp0_safe_receiver_2 = tmp3_hashCode;
    var tmp1_elvis_lhs_2 = tmp0_safe_receiver_2 == null ? null : hashCode(tmp0_safe_receiver_2);
    tmp$ret$3 = tmp1_elvis_lhs_2 == null ? 0 : tmp1_elvis_lhs_2;
    hash = tmp_3 + tmp$ret$3 | 0;
    var tmp_4 = imul(31, hash);
    var tmp$ret$4;
    // Inline function 'kotlin.hashCode' call
    var tmp0_safe_receiver_3 = tmp4_hashCode;
    var tmp1_elvis_lhs_3 = tmp0_safe_receiver_3 == null ? null : hashCode(tmp0_safe_receiver_3);
    tmp$ret$4 = tmp1_elvis_lhs_3 == null ? 0 : tmp1_elvis_lhs_3;
    hash = tmp_4 + tmp$ret$4 | 0;
    var tmp_5 = imul(31, hash);
    var tmp$ret$5;
    // Inline function 'kotlin.hashCode' call
    var tmp0_safe_receiver_4 = tmp5_hashCode;
    var tmp1_elvis_lhs_4 = tmp0_safe_receiver_4 == null ? null : hashCode(tmp0_safe_receiver_4);
    tmp$ret$5 = tmp1_elvis_lhs_4 == null ? 0 : tmp1_elvis_lhs_4;
    hash = tmp_5 + tmp$ret$5 | 0;
    tmp$ret$6 = hash;
    tmp.mav_1 = tmp$ret$6;
  }
  Blending.prototype.nav = function () {
    return this.eav_1;
  };
  Blending.prototype.oav = function () {
    return this.fav_1;
  };
  Blending.prototype.pav = function () {
    return this.gav_1;
  };
  Blending.prototype.qav = function () {
    return this.hav_1;
  };
  Blending.prototype.rav = function () {
    return this.iav_1;
  };
  Blending.prototype.sav = function () {
    return this.jav_1;
  };
  Blending.prototype.toString = function () {
    return 'Blending(outRGB = (srcRGB * ' + this.eav_1.vau_1 + ') ' + this.iav_1.sau_1 + ' (dstRGB * ' + this.fav_1.vau_1 + '), outA = (srcA * ' + this.gav_1.vau_1 + ') ' + this.jav_1.sau_1 + ' (dstA * ' + this.hav_1.vau_1 + '))';
  };
  Blending.prototype.hashCode = function () {
    return this.mav_1;
  };
  Blending.prototype.equals = function (other) {
    var tmp;
    if (this === other) {
      tmp = true;
    } else {
      var tmp_0;
      var tmp_1;
      var tmp_2;
      var tmp_3;
      var tmp_4;
      var tmp_5;
      if (other instanceof Blending) {
        tmp_5 = this.eav_1.equals(other.eav_1);
      } else {
        tmp_5 = false;
      }
      if (tmp_5) {
        tmp_4 = this.fav_1.equals(other.fav_1);
      } else {
        tmp_4 = false;
      }
      if (tmp_4) {
        tmp_3 = this.gav_1.equals(other.gav_1);
      } else {
        tmp_3 = false;
      }
      if (tmp_3) {
        tmp_2 = this.hav_1.equals(other.hav_1);
      } else {
        tmp_2 = false;
      }
      if (tmp_2) {
        tmp_1 = this.iav_1.equals(other.iav_1);
      } else {
        tmp_1 = false;
      }
      if (tmp_1) {
        tmp_0 = this.jav_1.equals(other.jav_1);
      } else {
        tmp_0 = false;
      }
      tmp = tmp_0;
    }
    return tmp;
  };
  Blending.$metadata$ = classMeta('Blending');
  function BitmapSourceBase() {
  }
  BitmapSourceBase.$metadata$ = interfaceMeta('BitmapSourceBase');
  function SyncBitmapSourceList(rgba, width, height, depth, gen) {
    Companion_getInstance_20();
    this.vav_1 = rgba;
    this.wav_1 = width;
    this.xav_1 = height;
    this.yav_1 = depth;
    this.zav_1 = gen;
  }
  SyncBitmapSourceList.prototype.tav = function () {
    return this.vav_1;
  };
  SyncBitmapSourceList.prototype.d72 = function () {
    return this.wav_1;
  };
  SyncBitmapSourceList.prototype.e72 = function () {
    return this.xav_1;
  };
  SyncBitmapSourceList.prototype.uav = function () {
    return this.yav_1;
  };
  SyncBitmapSourceList.prototype.toString = function () {
    return 'SyncBitmapSourceList(rgba=' + this.vav_1 + ', width=' + this.wav_1 + ', height=' + this.xav_1 + ')';
  };
  SyncBitmapSourceList.$metadata$ = classMeta('SyncBitmapSourceList', [BitmapSourceBase]);
  function SyncBitmapSource(rgba, width, height, gen) {
    Companion_getInstance_21();
    this.aaw_1 = rgba;
    this.baw_1 = width;
    this.caw_1 = height;
    this.daw_1 = gen;
  }
  SyncBitmapSource.prototype.tav = function () {
    return this.aaw_1;
  };
  SyncBitmapSource.prototype.d72 = function () {
    return this.baw_1;
  };
  SyncBitmapSource.prototype.e72 = function () {
    return this.caw_1;
  };
  SyncBitmapSource.prototype.toString = function () {
    return 'SyncBitmapSource(rgba=' + this.aaw_1 + ', width=' + this.baw_1 + ', height=' + this.caw_1 + ')';
  };
  SyncBitmapSource.$metadata$ = classMeta('SyncBitmapSource', [BitmapSourceBase]);
  function AsyncBitmapSource() {
  }
  AsyncBitmapSource.$metadata$ = classMeta('AsyncBitmapSource', [BitmapSourceBase]);
  function TextureTargetKind(name, ordinal, dims) {
    Enum.call(this, name, ordinal);
    this.gaw_1 = dims;
  }
  TextureTargetKind.$metadata$ = classMeta('TextureTargetKind', undefined, undefined, undefined, undefined, Enum.prototype);
  function Texture($outer, premultiplied, targetKind) {
    this.yaw_1 = $outer;
    this.haw_1 = premultiplied;
    this.iaw_1 = targetKind;
    this.jaw_1 = false;
    this.kaw_1 = false;
    this.law_1 = false;
    this.maw_1 = Companion_getInstance_21().jar_1;
    this.naw_1 = false;
    this.oaw_1 = false;
    this.paw_1 = false;
    this.qaw_1 = null;
    this.raw_1 = false;
    this.saw_1 = this.yaw_1.jay();
    var tmp = this;
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.Texture.texId.<anonymous>' call
    var tmp0__anonymous__q1qw7t = this.yaw_1.hay_1;
    tmp$ret$0 = tmp0__anonymous__q1qw7t.vay();
    var result = tmp$ret$0;
    if (!this.yaw_1.xay()) {
      this.yaw_1.way(this.yaw_1.hay_1);
    }
    tmp$ret$1 = result;
    tmp.taw_1 = tmp$ret$1;
    this.uaw_1 = null;
    var tmp0_this = this.yaw_1;
    var tmp1 = tmp0_this.iax_1;
    tmp0_this.iax_1 = tmp1 + 1 | 0;
    var tmp2_this = this.yaw_1;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp2_this.kax_1;
    tmp0_plusAssign.c(this);
    this.vaw_1 = Companion_getInstance_1().j4z(new Long(0, 0));
    this.waw_1 = false;
    this.xaw_1 = false;
  }
  Texture.prototype.b7z = function () {
    return this.haw_1;
  };
  Texture.prototype.yay = function (_set____db54di) {
    this.jaw_1 = _set____db54di;
  };
  Texture.prototype.zay = function () {
    var tmp0_safe_receiver = this.uaw_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w8f();
    return tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
  };
  Texture.prototype.aaz = function () {
    var tmp0_safe_receiver = this.uaw_1;
    var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.x8f();
    var tmp;
    if (tmp1_safe_receiver == null) {
      tmp = null;
    } else {
      var tmp$ret$1;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.Texture.<get-implForcedTexTarget>.<anonymous>' call
      tmp$ret$0 = fromGl(Companion_getInstance_22(), tmp1_safe_receiver);
      tmp$ret$1 = tmp$ret$0;
      tmp = tmp$ret$1;
    }
    var tmp2_elvis_lhs = tmp;
    return tmp2_elvis_lhs == null ? this.iaw_1 : tmp2_elvis_lhs;
  };
  Texture.prototype.baz = function () {
    this.naw_1 = false;
    this.oaw_1 = false;
    this.paw_1 = false;
  };
  Texture.prototype.caz = function (list, width, height) {
    // Inline function 'com.soywiz.kds.iterators.fastForEach' call
    var n = 0;
    while (n < list.i()) {
      // Inline function 'com.soywiz.korag.Texture.upload.<anonymous>' call
      var tmp0 = n;
      n = tmp0 + 1 | 0;
      var tmp0__anonymous__q1qw7t = list.m(tmp0);
      checkBitmaps(this, tmp0__anonymous__q1qw7t);
    }
    var tmp = list.i();
    var tmp_0 = new SyncBitmapSourceList(true, width, height, tmp, AG$Texture$upload$lambda(list));
    return this.daz(tmp_0, false, 2, null);
  };
  Texture.prototype.eaz = function (bmp, mipmaps) {
    var tmp0_safe_receiver = bmp;
    if (tmp0_safe_receiver == null)
      null;
    else {
      var tmp$ret$0;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      checkBitmaps(this, tmp0_safe_receiver);
      tmp$ret$0 = Unit_getInstance();
    }
    var tmp = this;
    tmp.uaw_1 = (bmp == null ? true : isInterface(bmp, ForcedTexId)) ? bmp : null;
    var tmp_0;
    if (!(bmp == null)) {
      var tmp_1 = bmp.p7y_1 > 8;
      var tmp_2 = bmp.d72();
      var tmp_3 = bmp.e72();
      tmp_0 = new SyncBitmapSource(tmp_1, tmp_2, tmp_3, AG$Texture$upload$lambda_0(bmp));
    } else {
      tmp_0 = Companion_getInstance_21().jar_1;
    }
    return this.faz(tmp_0, mipmaps);
  };
  Texture.prototype.gaz = function (bmp, mipmaps, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      mipmaps = false;
    return this.eaz(bmp, mipmaps);
  };
  Texture.prototype.faz = function (source, mipmaps) {
    this.maw_1 = source;
    this.vaw_1 = Companion_getInstance_1().i4z(imul(imul(imul(source.d72(), source.e72()), source.uav()), 4));
    this.haz();
    this.baz();
    this.kaw_1 = mipmaps;
    return this;
  };
  Texture.prototype.daz = function (source, mipmaps, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      mipmaps = false;
    return this.faz(source, mipmaps);
  };
  Texture.prototype.haz = function () {
  };
  Texture.prototype.iaz = function (source, requestMipmaps) {
    return (requestMipmaps ? get_isPowerOfTwo(source.d72()) : false) ? get_isPowerOfTwo(source.e72()) : false;
  };
  Texture.prototype.x2c = function () {
    if (!this.xaw_1) {
      this.xaw_1 = true;
      this.maw_1 = Companion_getInstance_21().jar_1;
      this.qaw_1 = null;
      var tmp0_this = this.yaw_1;
      var tmp1 = tmp0_this.jax_1;
      tmp0_this.jax_1 = tmp1 + 1 | 0;
      var tmp2_this = this.yaw_1;
      // Inline function 'kotlin.collections.minusAssign' call
      var tmp0_minusAssign = tmp2_this.kax_1;
      tmp0_minusAssign.c5(this);
    }
    if (!this.waw_1) {
      this.waw_1 = true;
      if (this.saw_1 === this.yaw_1.jay()) {
        if (!(this.taw_1 === 0)) {
          var tmp$ret$0;
          // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
          // Inline function 'kotlin.contracts.contract' call
          var tmp1__anonymous__uwfjfc = this.yaw_1.hay_1;
          tmp1__anonymous__uwfjfc.jaz(this.taw_1);
          var result = Unit_getInstance();
          if (!this.yaw_1.xay()) {
            this.yaw_1.way(this.yaw_1.hay_1);
          }
          tmp$ret$0 = result;
          this.taw_1 = 0;
        }
      } else {
      }
    } else {
    }
  };
  Texture.prototype.toString = function () {
    return 'AGOpengl.GlTexture(' + this.taw_1 + ', pre=' + this.b7z() + ')';
  };
  Texture.prototype.kaz = function () {
    this.naw_1 = true;
    return this;
  };
  Texture.$metadata$ = classMeta('Texture', [Closeable]);
  function TextureUnit(texture, linear, trilinear) {
    this.laz_1 = texture;
    this.maz_1 = linear;
    this.naz_1 = trilinear;
  }
  TextureUnit.prototype.p8m = function () {
    return this.laz_1;
  };
  TextureUnit.prototype.oaz = function (texture, linear, trilinear) {
    this.laz_1 = texture;
    this.maz_1 = linear;
    this.naz_1 = trilinear;
  };
  TextureUnit.prototype.paz = function (texture, linear, trilinear, $mask0, $handler) {
    if (!(($mask0 & 4) === 0))
      trilinear = null;
    return this.oaz(texture, linear, trilinear);
  };
  TextureUnit.prototype.toString = function () {
    return 'TextureUnit(texture=' + this.laz_1 + ', linear=' + this.maz_1 + ', trilinear=' + this.naz_1 + ')';
  };
  TextureUnit.prototype.hashCode = function () {
    var result = this.laz_1 == null ? 0 : hashCode(this.laz_1);
    result = imul(result, 31) + (this.maz_1 | 0) | 0;
    result = imul(result, 31) + (this.naz_1 == null ? 0 : this.naz_1 | 0) | 0;
    return result;
  };
  TextureUnit.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof TextureUnit))
      return false;
    var tmp0_other_with_cast = other instanceof TextureUnit ? other : THROW_CCE();
    if (!equals(this.laz_1, tmp0_other_with_cast.laz_1))
      return false;
    if (!(this.maz_1 === tmp0_other_with_cast.maz_1))
      return false;
    if (!(this.naz_1 == tmp0_other_with_cast.naz_1))
      return false;
    return true;
  };
  TextureUnit.$metadata$ = classMeta('TextureUnit');
  function BufferKind(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  BufferKind.$metadata$ = classMeta('BufferKind', undefined, undefined, undefined, undefined, Enum.prototype);
  function Buffer($outer, list) {
    this.sar_1 = $outer;
    this.lar_1 = list;
    this.mar_1 = false;
    this.nar_1 = null;
    this.oar_1 = 0;
    this.par_1 = 0;
    this.qar_1 = Companion_getInstance_1().i4z(0);
    var tmp0_this = this.sar_1;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.lax_1;
    tmp0_plusAssign.c(this);
    this.rar_1 = this.lar_1.qaz();
  }
  Buffer.prototype.tar = function () {
    this.qar_1 = Companion_getInstance_1().i4z(this.par_1);
  };
  Buffer.prototype.raz = function (data, offset, length) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = allocateMem(this, length);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.Buffer.upload.<anonymous>' call
    tmp0_also.e4y(0, data, offset, length);
    tmp$ret$0 = tmp0_also;
    return _upload(this, tmp$ret$0, 0, length);
  };
  Buffer.prototype.saz = function (data, offset, length) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = allocateMem(this, imul(length, 4));
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.Buffer.upload.<anonymous>' call
    tmp0_also.h4y(0, data, offset, length);
    tmp$ret$0 = tmp0_also;
    return _upload(this, tmp$ret$0, 0, imul(length, 4));
  };
  Buffer.prototype.taz = function (data, offset, length, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      offset = 0;
    if (!(($mask0 & 4) === 0))
      length = data.length;
    return this.saz(data, offset, length);
  };
  Buffer.prototype.uaz = function (data, offset, length) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = allocateMem(this, imul(length, 4));
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.Buffer.upload.<anonymous>' call
    tmp0_also.g4y(0, data, offset, length);
    tmp$ret$0 = tmp0_also;
    return _upload(this, tmp$ret$0, 0, imul(length, 4));
  };
  Buffer.prototype.vaz = function (data, offset, length) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = allocateMem(this, imul(length, 2));
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.Buffer.upload.<anonymous>' call
    tmp0_also.f4y(0, data, offset, length);
    tmp$ret$0 = tmp0_also;
    return _upload(this, tmp$ret$0, 0, imul(length, 2));
  };
  Buffer.prototype.waz = function (data, offset, length) {
    return _upload(this, data, offset, length);
  };
  Buffer.prototype.xaz = function (data, offset, length, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      offset = 0;
    if (!(($mask0 & 4) === 0))
      length = data.s4w_1;
    return this.waz(data, offset, length);
  };
  Buffer.prototype.yaz = function (data, offset, length) {
    var tmp0_subject = data;
    var tmp;
    if (isByteArray(tmp0_subject)) {
      tmp = this.raz(data, offset, getLen(this, length, data.length));
    } else {
      if (isShortArray(tmp0_subject)) {
        tmp = this.vaz(data, offset, getLen(this, length, data.length));
      } else {
        if (isIntArray(tmp0_subject)) {
          tmp = this.uaz(data, offset, getLen(this, length, data.length));
        } else {
          if (isFloatArray(tmp0_subject)) {
            tmp = this.saz(data, offset, getLen(this, length, data.length));
          } else {
            if (tmp0_subject instanceof FBuffer) {
              tmp = this.waz(data, offset, getLen(this, length, data.s4w_1));
            } else {
              if (tmp0_subject instanceof IntArrayList) {
                tmp = this.uaz(data.h4o_1, offset, getLen(this, length, data.i()));
              } else {
                if (tmp0_subject instanceof FloatArrayList) {
                  tmp = this.saz(data.a4o_1, offset, getLen(this, length, data.i()));
                } else {
                  throw NotImplementedError_init_$Create$(null, 1, null);
                }
              }
            }
          }
        }
      }
    }
    return tmp;
  };
  Buffer.$metadata$ = classMeta('Buffer');
  function DrawType(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  DrawType.$metadata$ = classMeta('DrawType', undefined, undefined, undefined, undefined, Enum.prototype);
  function IndexType(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  IndexType.$metadata$ = classMeta('IndexType', undefined, undefined, undefined, undefined, Enum.prototype);
  function ReadKind(name, ordinal, size) {
    Enum.call(this, name, ordinal);
    this.bb0_1 = size;
  }
  ReadKind.$metadata$ = classMeta('ReadKind', undefined, undefined, undefined, undefined, Enum.prototype);
  function StencilOp(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  StencilOp.$metadata$ = classMeta('StencilOp', undefined, undefined, undefined, undefined, Enum.prototype);
  function TriangleFace(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  TriangleFace.$metadata$ = classMeta('TriangleFace', undefined, undefined, undefined, undefined, Enum.prototype);
  function CompareMode(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  CompareMode.prototype.eb0 = function () {
    var tmp0_subject = this;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        tmp = CompareMode_NEVER_getInstance();
        break;
      case 1:
        tmp = CompareMode_NOT_EQUAL_getInstance();
        break;
      case 2:
        tmp = CompareMode_LESS_EQUAL_getInstance();
        break;
      case 3:
        tmp = CompareMode_LESS_getInstance();
        break;
      case 4:
        tmp = CompareMode_GREATER_EQUAL_getInstance();
        break;
      case 5:
        tmp = CompareMode_GREATER_getInstance();
        break;
      case 6:
        tmp = CompareMode_ALWAYS_getInstance();
        break;
      case 7:
        tmp = CompareMode_EQUAL_getInstance();
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  };
  CompareMode.$metadata$ = classMeta('CompareMode', undefined, undefined, undefined, undefined, Enum.prototype);
  function ColorMaskState(red, green, blue, alpha) {
    Companion_getInstance_29();
    this.fb0_1 = red;
    this.gb0_1 = green;
    this.hb0_1 = blue;
    this.ib0_1 = alpha;
  }
  ColorMaskState.prototype.toString = function () {
    return 'ColorMaskState(red=' + this.fb0_1 + ', green=' + this.gb0_1 + ', blue=' + this.hb0_1 + ', alpha=' + this.ib0_1 + ')';
  };
  ColorMaskState.prototype.hashCode = function () {
    var result = this.fb0_1 | 0;
    result = imul(result, 31) + (this.gb0_1 | 0) | 0;
    result = imul(result, 31) + (this.hb0_1 | 0) | 0;
    result = imul(result, 31) + (this.ib0_1 | 0) | 0;
    return result;
  };
  ColorMaskState.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof ColorMaskState))
      return false;
    var tmp0_other_with_cast = other instanceof ColorMaskState ? other : THROW_CCE();
    if (!(this.fb0_1 === tmp0_other_with_cast.fb0_1))
      return false;
    if (!(this.gb0_1 === tmp0_other_with_cast.gb0_1))
      return false;
    if (!(this.hb0_1 === tmp0_other_with_cast.hb0_1))
      return false;
    if (!(this.ib0_1 === tmp0_other_with_cast.ib0_1))
      return false;
    return true;
  };
  ColorMaskState.$metadata$ = classMeta('ColorMaskState');
  function CullFace(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  CullFace.$metadata$ = classMeta('CullFace', undefined, undefined, undefined, undefined, Enum.prototype);
  function FrontFace(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  FrontFace.$metadata$ = classMeta('FrontFace', undefined, undefined, undefined, undefined, Enum.prototype);
  function RenderState(depthFunc, depthMask, depthNear, depthFar, lineWidth, frontFace) {
    Companion_getInstance_32();
    this.jb0_1 = depthFunc;
    this.kb0_1 = depthMask;
    this.lb0_1 = depthNear;
    this.mb0_1 = depthFar;
    this.nb0_1 = lineWidth;
    this.ob0_1 = frontFace;
  }
  RenderState.prototype.pb0 = function () {
    return this.jb0_1;
  };
  RenderState.prototype.qb0 = function () {
    return this.ob0_1;
  };
  RenderState.prototype.toString = function () {
    return 'RenderState(depthFunc=' + this.jb0_1 + ', depthMask=' + this.kb0_1 + ', depthNear=' + this.lb0_1 + ', depthFar=' + this.mb0_1 + ', lineWidth=' + this.nb0_1 + ', frontFace=' + this.ob0_1 + ')';
  };
  RenderState.prototype.hashCode = function () {
    var result = this.jb0_1.hashCode();
    result = imul(result, 31) + (this.kb0_1 | 0) | 0;
    result = imul(result, 31) + getNumberHashCode(this.lb0_1) | 0;
    result = imul(result, 31) + getNumberHashCode(this.mb0_1) | 0;
    result = imul(result, 31) + getNumberHashCode(this.nb0_1) | 0;
    result = imul(result, 31) + this.ob0_1.hashCode() | 0;
    return result;
  };
  RenderState.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof RenderState))
      return false;
    var tmp0_other_with_cast = other instanceof RenderState ? other : THROW_CCE();
    if (!this.jb0_1.equals(tmp0_other_with_cast.jb0_1))
      return false;
    if (!(this.kb0_1 === tmp0_other_with_cast.kb0_1))
      return false;
    if (!equals(this.lb0_1, tmp0_other_with_cast.lb0_1))
      return false;
    if (!equals(this.mb0_1, tmp0_other_with_cast.mb0_1))
      return false;
    if (!equals(this.nb0_1, tmp0_other_with_cast.nb0_1))
      return false;
    if (!this.ob0_1.equals(tmp0_other_with_cast.ob0_1))
      return false;
    return true;
  };
  RenderState.$metadata$ = classMeta('RenderState');
  function StencilState(enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask) {
    Companion_getInstance_33();
    this.rb0_1 = enabled;
    this.sb0_1 = triangleFace;
    this.tb0_1 = compareMode;
    this.ub0_1 = actionOnBothPass;
    this.vb0_1 = actionOnDepthFail;
    this.wb0_1 = actionOnDepthPassStencilFail;
    this.xb0_1 = referenceValue;
    this.yb0_1 = readMask;
    this.zb0_1 = writeMask;
  }
  StencilState.prototype.ab1 = function (enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask) {
    return new StencilState(enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask);
  };
  StencilState.prototype.bb1 = function (enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      enabled = this.rb0_1;
    if (!(($mask0 & 2) === 0))
      triangleFace = this.sb0_1;
    if (!(($mask0 & 4) === 0))
      compareMode = this.tb0_1;
    if (!(($mask0 & 8) === 0))
      actionOnBothPass = this.ub0_1;
    if (!(($mask0 & 16) === 0))
      actionOnDepthFail = this.vb0_1;
    if (!(($mask0 & 32) === 0))
      actionOnDepthPassStencilFail = this.wb0_1;
    if (!(($mask0 & 64) === 0))
      referenceValue = this.xb0_1;
    if (!(($mask0 & 128) === 0))
      readMask = this.yb0_1;
    if (!(($mask0 & 256) === 0))
      writeMask = this.zb0_1;
    return this.ab1(enabled, triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail, referenceValue, readMask, writeMask);
  };
  StencilState.prototype.toString = function () {
    return 'StencilState(enabled=' + this.rb0_1 + ', triangleFace=' + this.sb0_1 + ', compareMode=' + this.tb0_1 + ', actionOnBothPass=' + this.ub0_1 + ', actionOnDepthFail=' + this.vb0_1 + ', actionOnDepthPassStencilFail=' + this.wb0_1 + ', referenceValue=' + this.xb0_1 + ', readMask=' + this.yb0_1 + ', writeMask=' + this.zb0_1 + ')';
  };
  StencilState.prototype.hashCode = function () {
    var result = this.rb0_1 | 0;
    result = imul(result, 31) + this.sb0_1.hashCode() | 0;
    result = imul(result, 31) + this.tb0_1.hashCode() | 0;
    result = imul(result, 31) + this.ub0_1.hashCode() | 0;
    result = imul(result, 31) + this.vb0_1.hashCode() | 0;
    result = imul(result, 31) + this.wb0_1.hashCode() | 0;
    result = imul(result, 31) + this.xb0_1 | 0;
    result = imul(result, 31) + this.yb0_1 | 0;
    result = imul(result, 31) + this.zb0_1 | 0;
    return result;
  };
  StencilState.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof StencilState))
      return false;
    var tmp0_other_with_cast = other instanceof StencilState ? other : THROW_CCE();
    if (!(this.rb0_1 === tmp0_other_with_cast.rb0_1))
      return false;
    if (!this.sb0_1.equals(tmp0_other_with_cast.sb0_1))
      return false;
    if (!this.tb0_1.equals(tmp0_other_with_cast.tb0_1))
      return false;
    if (!this.ub0_1.equals(tmp0_other_with_cast.ub0_1))
      return false;
    if (!this.vb0_1.equals(tmp0_other_with_cast.vb0_1))
      return false;
    if (!this.wb0_1.equals(tmp0_other_with_cast.wb0_1))
      return false;
    if (!(this.xb0_1 === tmp0_other_with_cast.xb0_1))
      return false;
    if (!(this.yb0_1 === tmp0_other_with_cast.yb0_1))
      return false;
    if (!(this.zb0_1 === tmp0_other_with_cast.zb0_1))
      return false;
    return true;
  };
  StencilState.$metadata$ = classMeta('StencilState');
  function VertexArrayObject(list) {
    this.fas_1 = list;
  }
  VertexArrayObject.prototype.toString = function () {
    return VertexArrayObject__toString_impl_u6lqlp(this.fas_1);
  };
  VertexArrayObject.prototype.hashCode = function () {
    return VertexArrayObject__hashCode_impl_8fftsu(this.fas_1);
  };
  VertexArrayObject.prototype.equals = function (other) {
    return VertexArrayObject__equals_impl_1qz5vq(this.fas_1, other);
  };
  VertexArrayObject.$metadata$ = classMeta('VertexArrayObject');
  function VertexData(_buffer, layout) {
    this.cb1_1 = _buffer;
    this.db1_1 = layout;
  }
  VertexData.prototype.eb1 = function () {
    return this.db1_1;
  };
  VertexData.prototype.a4x = function () {
    return ensureNotNull(this.cb1_1);
  };
  VertexData.prototype.toString = function () {
    return 'VertexData(_buffer=' + this.cb1_1 + ', layout=' + this.db1_1 + ')';
  };
  VertexData.prototype.hashCode = function () {
    var result = this.cb1_1 == null ? 0 : hashCode(this.cb1_1);
    result = imul(result, 31) + hashCode(this.db1_1) | 0;
    return result;
  };
  VertexData.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof VertexData))
      return false;
    var tmp0_other_with_cast = other instanceof VertexData ? other : THROW_CCE();
    if (!equals(this.cb1_1, tmp0_other_with_cast.cb1_1))
      return false;
    if (!equals(this.db1_1, tmp0_other_with_cast.db1_1))
      return false;
    return true;
  };
  VertexData.$metadata$ = classMeta('VertexData');
  function Batch(vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances) {
    this.eat_1 = vertexData;
    this.fat_1 = program;
    this.gat_1 = type;
    this.hat_1 = vertexCount;
    this.iat_1 = indices;
    this.jat_1 = indexType;
    this.kat_1 = offset;
    this.lat_1 = blending;
    this.mat_1 = uniforms;
    this.nat_1 = stencil;
    this.oat_1 = colorMask;
    this.pat_1 = renderState;
    this.qat_1 = scissor;
    this.rat_1 = instances;
    this.sat_1 = FastArrayList_init_$Create$();
  }
  Batch.prototype.fb1 = function (_set____db54di) {
    this.eat_1 = _set____db54di;
  };
  Batch.prototype.gb1 = function (_set____db54di) {
    this.fat_1 = _set____db54di;
  };
  Batch.prototype.hb1 = function (_set____db54di) {
    this.gat_1 = _set____db54di;
  };
  Batch.prototype.ib1 = function (_set____db54di) {
    this.hat_1 = _set____db54di;
  };
  Batch.prototype.jb1 = function (_set____db54di) {
    this.iat_1 = _set____db54di;
  };
  Batch.prototype.kb1 = function (_set____db54di) {
    this.jat_1 = _set____db54di;
  };
  Batch.prototype.lb1 = function (_set____db54di) {
    this.kat_1 = _set____db54di;
  };
  Batch.prototype.mb1 = function (_set____db54di) {
    this.lat_1 = _set____db54di;
  };
  Batch.prototype.nb1 = function (_set____db54di) {
    this.mat_1 = _set____db54di;
  };
  Batch.prototype.ob1 = function (_set____db54di) {
    this.nat_1 = _set____db54di;
  };
  Batch.prototype.pb1 = function (_set____db54di) {
    this.oat_1 = _set____db54di;
  };
  Batch.prototype.qb1 = function (_set____db54di) {
    this.pat_1 = _set____db54di;
  };
  Batch.prototype.rb1 = function (_set____db54di) {
    this.qat_1 = _set____db54di;
  };
  Batch.prototype.sb1 = function (_set____db54di) {
    this.rat_1 = _set____db54di;
  };
  Batch.prototype.tb1 = function (value) {
    ensureSingleVertexData(this);
    this.sat_1.m(0).cb1_1 = value;
  };
  Batch.prototype.ub1 = function (value) {
    ensureSingleVertexData(this);
    this.sat_1.m(0).db1_1 = value;
  };
  Batch.prototype.toString = function () {
    return 'Batch(vertexData=' + this.eat_1 + ', program=' + this.fat_1 + ', type=' + this.gat_1 + ', vertexCount=' + this.hat_1 + ', indices=' + this.iat_1 + ', indexType=' + this.jat_1 + ', offset=' + this.kat_1 + ', blending=' + this.lat_1 + ', uniforms=' + this.mat_1 + ', stencil=' + this.nat_1 + ', colorMask=' + this.oat_1 + ', renderState=' + this.pat_1 + ', scissor=' + this.qat_1 + ', instances=' + this.rat_1 + ')';
  };
  Batch.prototype.hashCode = function () {
    var result = this.eat_1.hashCode();
    result = imul(result, 31) + this.fat_1.hashCode() | 0;
    result = imul(result, 31) + this.gat_1.hashCode() | 0;
    result = imul(result, 31) + this.hat_1 | 0;
    result = imul(result, 31) + (this.iat_1 == null ? 0 : hashCode(this.iat_1)) | 0;
    result = imul(result, 31) + this.jat_1.hashCode() | 0;
    result = imul(result, 31) + this.kat_1 | 0;
    result = imul(result, 31) + this.lat_1.hashCode() | 0;
    result = imul(result, 31) + hashCode(this.mat_1) | 0;
    result = imul(result, 31) + this.nat_1.hashCode() | 0;
    result = imul(result, 31) + this.oat_1.hashCode() | 0;
    result = imul(result, 31) + this.pat_1.hashCode() | 0;
    result = imul(result, 31) + (this.qat_1 == null ? 0 : this.qat_1.hashCode()) | 0;
    result = imul(result, 31) + this.rat_1 | 0;
    return result;
  };
  Batch.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Batch))
      return false;
    var tmp0_other_with_cast = other instanceof Batch ? other : THROW_CCE();
    if (!this.eat_1.equals(tmp0_other_with_cast.eat_1))
      return false;
    if (!this.fat_1.equals(tmp0_other_with_cast.fat_1))
      return false;
    if (!this.gat_1.equals(tmp0_other_with_cast.gat_1))
      return false;
    if (!(this.hat_1 === tmp0_other_with_cast.hat_1))
      return false;
    if (!equals(this.iat_1, tmp0_other_with_cast.iat_1))
      return false;
    if (!this.jat_1.equals(tmp0_other_with_cast.jat_1))
      return false;
    if (!(this.kat_1 === tmp0_other_with_cast.kat_1))
      return false;
    if (!this.lat_1.equals(tmp0_other_with_cast.lat_1))
      return false;
    if (!equals(this.mat_1, tmp0_other_with_cast.mat_1))
      return false;
    if (!this.nat_1.equals(tmp0_other_with_cast.nat_1))
      return false;
    if (!this.oat_1.equals(tmp0_other_with_cast.oat_1))
      return false;
    if (!this.pat_1.equals(tmp0_other_with_cast.pat_1))
      return false;
    if (!equals(this.qat_1, tmp0_other_with_cast.qat_1))
      return false;
    if (!(this.rat_1 === tmp0_other_with_cast.rat_1))
      return false;
    return true;
  };
  Batch.$metadata$ = classMeta('Batch');
  function BaseRenderBuffer() {
  }
  BaseRenderBuffer.$metadata$ = interfaceMeta('BaseRenderBuffer', [Closeable]);
  function RenderBufferConsts() {
    RenderBufferConsts_instance = this;
    this.db2_1 = 128;
    this.eb2_1 = 128;
  }
  RenderBufferConsts.$metadata$ = objectMeta('RenderBufferConsts');
  var RenderBufferConsts_instance;
  function RenderBufferConsts_getInstance() {
    if (RenderBufferConsts_instance == null)
      new RenderBufferConsts();
    return RenderBufferConsts_instance;
  }
  function BaseRenderBufferImpl($outer) {
    this.ob2_1 = $outer;
    this.fb2_1 = 0;
    this.gb2_1 = 0;
    var tmp = this;
    RenderBufferConsts_getInstance();
    tmp.hb2_1 = 128;
    var tmp_0 = this;
    RenderBufferConsts_getInstance();
    tmp_0.ib2_1 = 128;
    var tmp_1 = this;
    RenderBufferConsts_getInstance();
    tmp_1.jb2_1 = 128;
    var tmp_2 = this;
    RenderBufferConsts_getInstance();
    tmp_2.kb2_1 = 128;
    this.lb2_1 = Companion_getInstance_2().h7d();
    this.mb2_1 = null;
    this.nb2_1 = Companion_getInstance_1().i4z(0);
    var tmp0_this = this.ob2_1;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.qax_1;
    tmp0_plusAssign.c(this);
  }
  BaseRenderBufferImpl.prototype.a9g = function (_set____db54di) {
    this.fb2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.d1n = function () {
    return this.fb2_1;
  };
  BaseRenderBufferImpl.prototype.b9g = function (_set____db54di) {
    this.gb2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.e1n = function () {
    return this.gb2_1;
  };
  BaseRenderBufferImpl.prototype.r9d = function (_set____db54di) {
    this.hb2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.d72 = function () {
    return this.hb2_1;
  };
  BaseRenderBufferImpl.prototype.q9d = function (_set____db54di) {
    this.ib2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.e72 = function () {
    return this.ib2_1;
  };
  BaseRenderBufferImpl.prototype.pb2 = function (_set____db54di) {
    this.jb2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.vb1 = function () {
    return this.jb2_1;
  };
  BaseRenderBufferImpl.prototype.qb2 = function (_set____db54di) {
    this.kb2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.wb1 = function () {
    return this.kb2_1;
  };
  BaseRenderBufferImpl.prototype.xb1 = function () {
    return this.mb2_1;
  };
  BaseRenderBufferImpl.prototype.rb2 = function (_set____db54di) {
    this.nb2_1 = _set____db54di;
  };
  BaseRenderBufferImpl.prototype.yb1 = function (x, y, width, height, fullWidth, fullHeight) {
    this.rb2(Companion_getInstance_1().i4z(imul(imul(fullWidth, fullHeight), 8)));
    this.a9g(x);
    this.b9g(y);
    this.r9d(width);
    this.q9d(height);
    this.pb2(fullWidth);
    this.qb2(fullHeight);
  };
  BaseRenderBufferImpl.prototype.x2c = function () {
    var tmp0_this = this.ob2_1;
    // Inline function 'kotlin.collections.minusAssign' call
    var tmp0_minusAssign = tmp0_this.qax_1;
    tmp0_minusAssign.c5(this);
  };
  BaseRenderBufferImpl.$metadata$ = classMeta('BaseRenderBufferImpl', [BaseRenderBuffer]);
  function RenderBuffer($outer) {
    this.jb3_1 = $outer;
    BaseRenderBufferImpl.call(this, $outer);
    this.cb3_1 = -1;
    this.db3_1 = -1;
    this.eb3_1 = null;
    this.fb3_1 = 1;
    this.gb3_1 = true;
    this.hb3_1 = true;
    this.ib3_1 = true;
  }
  RenderBuffer.prototype.u9z = function () {
    if (!(this.db3_1 === this.jb3_1.jay())) {
      this.db3_1 = this.jb3_1.jay();
      var tmp = this;
      var tmp$ret$0;
      // Inline function 'kotlin.apply' call
      var tmp0_apply = this.jb3_1.kb3(true, null, 2, null).kaz();
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.korag.RenderBuffer.<get-tex>.<anonymous>' call
      tmp0_apply.jaw_1 = true;
      tmp$ret$0 = tmp0_apply;
      tmp.eb3_1 = tmp$ret$0;
    }
    return ensureNotNull(this.eb3_1);
  };
  RenderBuffer.prototype.yb1 = function (x, y, width, height, fullWidth, fullHeight) {
    if (((((!(this.d1n() === x) ? true : !(this.e1n() === y)) ? true : !(this.d72() === width)) ? true : !(this.e72() === height)) ? true : !(this.vb1() === fullWidth)) ? true : !(this.wb1() === fullHeight)) {
      BaseRenderBufferImpl.prototype.yb1.call(this, x, y, width, height, fullWidth, fullHeight);
      this.ib3_1 = true;
    }
  };
  RenderBuffer.prototype.lb3 = function (samples) {
    if (!(this.fb3_1 === samples)) {
      this.fb3_1 = samples;
      this.ib3_1 = true;
    }
  };
  RenderBuffer.prototype.mb3 = function (hasDepth, hasStencil) {
    if (!(this.gb3_1 === hasDepth) ? true : !(this.hb3_1 === hasStencil)) {
      this.gb3_1 = hasDepth;
      this.hb3_1 = hasStencil;
      this.ib3_1 = true;
    }
  };
  RenderBuffer.prototype.bb2 = function () {
    return Unit_getInstance();
  };
  RenderBuffer.prototype.x2c = function () {
    BaseRenderBufferImpl.prototype.x2c.call(this);
    this.db3_1 = -1;
    var tmp0_safe_receiver = this.eb3_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.x2c();
    }
    this.eb3_1 = null;
  };
  RenderBuffer.$metadata$ = classMeta('RenderBuffer', undefined, undefined, undefined, undefined, BaseRenderBufferImpl.prototype);
  function GlRenderBuffer($outer) {
    this.hb4_1 = $outer;
    RenderBuffer.call(this, $outer);
    var tmp = this;
    var tmp0_this = this.hb4_1;
    var tmp1 = tmp0_this.tax_1;
    tmp0_this.tax_1 = tmp1 + 1 | 0;
    tmp.fb4_1 = tmp1;
    this.gb4_1 = -1;
  }
  GlRenderBuffer.prototype.bb2 = function () {
    this.hb4_1.ib4(this);
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0__anonymous__q1qw7t = this.hb4_1.hay_1;
    if (this.ib3_1) {
      if (this.gb4_1 < 0) {
        this.gb4_1 = tmp0__anonymous__q1qw7t.jb4();
      }
      tmp0__anonymous__q1qw7t.kb4(this.gb4_1, this.u9z().taw_1, this.d72(), this.e72(), this.hb3_1, this.gb3_1);
    }
    tmp0__anonymous__q1qw7t.lb4(this.gb4_1);
    var result = Unit_getInstance();
    if (!this.hb4_1.xay()) {
      this.hb4_1.way(this.hb4_1.hay_1);
    }
    tmp$ret$0 = result;
  };
  GlRenderBuffer.prototype.x2c = function () {
    RenderBuffer.prototype.x2c.call(this);
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0__anonymous__q1qw7t = this.hb4_1.hay_1;
    var tmp;
    if (this.gb4_1 >= 0) {
      tmp0__anonymous__q1qw7t.mb4(this.gb4_1);
      this.gb4_1 = -1;
      tmp = Unit_getInstance();
    }
    var result = tmp;
    if (!this.hb4_1.xay()) {
      this.hb4_1.way(this.hb4_1.hay_1);
    }
    tmp$ret$0 = result;
  };
  GlRenderBuffer.prototype.toString = function () {
    return 'GlRenderBuffer[' + this.fb4_1 + '](' + this.d72() + ', ' + this.e72() + ')';
  };
  GlRenderBuffer.$metadata$ = classMeta('GlRenderBuffer', undefined, undefined, undefined, undefined, RenderBuffer.prototype);
  function TextureDrawer($outer) {
    this.tb4_1 = $outer;
    this.nb4_1 = 4;
    this.ob4_1 = this.tb4_1.ub4();
    this.pb4_1 = ProgramLayout_init_$Create$([DefaultShaders_getInstance().kas_1, DefaultShaders_getInstance().las_1]);
    this.qb4_1 = Companion_getInstance().p4w(imul(this.nb4_1, this.pb4_1.cb5_1));
    var tmp = this;
    var tmp$ret$2;
    // Inline function 'com.soywiz.korag.shader.VertexShader' call
    var builder = Builder_init_$Create$_0(ShaderType_VERTEX_getInstance());
    // Inline function 'com.soywiz.korag.TextureDrawer.program.<anonymous>' call
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.DefaultShaders.invoke' call
    var tmp0_invoke = DefaultShaders_getInstance();
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.TextureDrawer.program.<anonymous>.<anonymous>' call
    builder.fb5(tmp0_invoke.nas_1, tmp0_invoke.las_1);
    builder.fb5(builder.l6t(), builder.hb5([tmp0_invoke.kas_1, builder.gb5(0.0), builder.gb5(1.0)]));
    tmp$ret$0 = tmp0_invoke;
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = VertexShader_0(builder.ib5());
    var tmp_0 = tmp$ret$2;
    var tmp$ret$5;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_0 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.TextureDrawer.program.<anonymous>' call
    var tmp$ret$4;
    // Inline function 'com.soywiz.korag.DefaultShaders.invoke' call
    var tmp0_invoke_0 = DefaultShaders_getInstance();
    var tmp$ret$3;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.TextureDrawer.program.<anonymous>.<anonymous>' call
    builder_0.fb5(builder_0.l6t(), builder_0.kb5(tmp0_invoke_0.gas_1, builder_0.jb5(tmp0_invoke_0.nas_1, 'xy')));
    tmp$ret$3 = tmp0_invoke_0;
    tmp$ret$4 = tmp$ret$3;
    tmp$ret$5 = FragmentShader_0(builder_0.ib5());
    var tmp_1 = tmp$ret$5;
    tmp.rb4_1 = Program_init_$Create$(tmp_0, tmp_1, null, 4, null);
    this.sb4_1 = new UniformValues();
  }
  TextureDrawer.$metadata$ = classMeta('TextureDrawer');
  function AgProgram($outer, program, programConfig) {
    this.pb5_1 = $outer;
    this.lb5_1 = program;
    this.mb5_1 = programConfig;
    this.nb5_1 = -1;
    this.ob5_1 = 0;
  }
  AgProgram.prototype.qb5 = function () {
    return this.lb5_1;
  };
  AgProgram.prototype.rb5 = function () {
    return this.mb5_1;
  };
  AgProgram.prototype.sb5 = function (_set____db54di) {
    this.nb5_1 = _set____db54di;
  };
  AgProgram.prototype.tb5 = function (_set____db54di) {
    this.ob5_1 = _set____db54di;
  };
  AgProgram.prototype.ub5 = function (list) {
    if (!(this.nb5_1 === this.pb5_1.jay())) {
      var tmp$ret$1;
      // Inline function 'com.soywiz.klock.measureTime' call
      var start = PerformanceCounter_getInstance().u1h();
      // Inline function 'com.soywiz.korag.AgProgram.ensure.<anonymous>' call
      var tmp0_this = this.pb5_1;
      var tmp1 = tmp0_this.zax_1;
      tmp0_this.zax_1 = tmp1 + 1 | 0;
      this.ob5_1 = list.vb5(this.lb5_1, this.mb5_1);
      this.nb5_1 = this.pb5_1.jay();
      var end = PerformanceCounter_getInstance().u1h();
      var tmp$ret$0;
      // Inline function 'com.soywiz.klock.microseconds' call
      var tmp0__get_microseconds__mq1imi = end - start;
      tmp$ret$0 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi);
      tmp$ret$1 = tmp$ret$0;
      var time = tmp$ret$1;
      if (Companion_getInstance_38().cb6()) {
        Console_getInstance().p50(['AG: Created program ' + this.lb5_1.yb5_1 + ' with id ' + this.ob5_1 + ' in time=' + new TimeSpan(time)]);
      }
    }
  };
  AgProgram.prototype.db6 = function (list) {
    this.ub5(list);
    list.saq(this.ob5_1);
  };
  AgProgram.$metadata$ = classMeta('AgProgram');
  function UniformValues() {
    Companion_getInstance_34();
    this.uat_1 = FastArrayList_init_$Create$();
    this.vat_1 = FastArrayList_init_$Create$();
    var tmp = this;
    var tmp_0 = this.uat_1;
    tmp.wat_1 = isInterface(tmp_0, List) ? tmp_0 : THROW_CCE();
    var tmp_1 = this;
    var tmp_2 = this.vat_1;
    tmp_1.xat_1 = isInterface(tmp_2, List) ? tmp_2 : THROW_CCE();
  }
  UniformValues.prototype.v3 = function () {
    return this.wat_1;
  };
  UniformValues.prototype.i = function () {
    return this.uat_1.i();
  };
  UniformValues.prototype.t4o = function () {
    return !(this.i() === 0);
  };
  UniformValues.prototype.eb6 = function (block) {
    var inductionVariable = 0;
    var last = this.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        block(this.wat_1.m(n), this.xat_1.m(n));
      }
       while (inductionVariable < last);
  };
  UniformValues.prototype.x7 = function () {
    this.uat_1.x7();
    this.vat_1.x7();
  };
  UniformValues.prototype.fb6 = function (uniform) {
    var inductionVariable = 0;
    var last = this.uat_1.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        if (this.uat_1.m(n).hb6_1 === uniform.hb6_1)
          return this.vat_1.m(n);
      }
       while (inductionVariable < last);
    return null;
  };
  UniformValues.prototype.nb6 = function (uniform, value) {
    return this.yat(uniform, value);
  };
  UniformValues.prototype.ob6 = function (uniform, value) {
    if (value == null) {
      this.pb6(uniform);
    } else {
      this.yat(uniform, value);
    }
  };
  UniformValues.prototype.yat = function (uniform, value) {
    var inductionVariable = 0;
    var last = this.uat_1.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        if (this.uat_1.m(n).hb6_1 === uniform.hb6_1) {
          this.vat_1.a5(n, value);
          return this;
        }
      }
       while (inductionVariable < last);
    this.uat_1.c(uniform);
    this.vat_1.c(value);
    return this;
  };
  UniformValues.prototype.pb6 = function (uniform) {
    var inductionVariable = 0;
    var last = this.uat_1.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        if (this.uat_1.m(n).hb6_1 === uniform.hb6_1) {
          this.uat_1.z4(n);
          this.vat_1.z4(n);
          return Unit_getInstance();
        }
      }
       while (inductionVariable < last);
  };
  UniformValues.prototype.qb6 = function (uniforms) {
    if (uniforms == null)
      return this;
    var inductionVariable = 0;
    var last = uniforms.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        this.yat(uniforms.uat_1.m(n), uniforms.vat_1.m(n));
      }
       while (inductionVariable < last);
    return this;
  };
  UniformValues.prototype.rb6 = function (uniforms) {
    this.x7();
    this.qb6(uniforms);
  };
  UniformValues.prototype.j = function () {
    return iterator(AG$UniformValues$iterator$slambda_0(this, null));
  };
  UniformValues.prototype.toString = function () {
    var tmp = zip(this.v3(), this.xat_1);
    return '{' + joinToString$default(tmp, ', ', null, null, 0, null, AG$UniformValues$toString$lambda, 30, null) + '}';
  };
  UniformValues.$metadata$ = classMeta('UniformValues', [Iterable]);
  function AGStats(texturesCount, texturesMemory, buffersCount, buffersMemory, renderBuffersCount, renderBuffersMemory, texturesCreated, texturesDeleted, programCount) {
    this.sb6_1 = texturesCount;
    this.tb6_1 = texturesMemory;
    this.ub6_1 = buffersCount;
    this.vb6_1 = buffersMemory;
    this.wb6_1 = renderBuffersCount;
    this.xb6_1 = renderBuffersMemory;
    this.yb6_1 = texturesCreated;
    this.zb6_1 = texturesDeleted;
    this.ab7_1 = programCount;
  }
  AGStats.prototype.toString = function () {
    return 'AGStats(textures[' + this.sb6_1 + '] = ' + new ByteUnits(this.tb6_1) + ', buffers[' + this.ub6_1 + '] = ' + new ByteUnits(this.vb6_1) + ', renderBuffers[' + this.wb6_1 + '] = ' + new ByteUnits(this.xb6_1) + ', programs[' + this.ab7_1 + '])';
  };
  AGStats.$metadata$ = classMeta('AGStats');
  function AG$contextLost$slambda(this$0, resultContinuation) {
    this.jb7_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AG$contextLost$slambda.prototype.h2n = function ($this$runBlockingNoJs, $cont) {
    var tmp = this.i2n($this$runBlockingNoJs, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AG$contextLost$slambda.prototype.w7 = function (p1, $cont) {
    return this.h2n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
  };
  AG$contextLost$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.jb7_1.hay_1.lb7(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AG$contextLost$slambda.prototype.i2n = function ($this$runBlockingNoJs, completion) {
    var i = new AG$contextLost$slambda(this.jb7_1, completion);
    i.kb7_1 = $this$runBlockingNoJs;
    return i;
  };
  AG$contextLost$slambda.$metadata$ = classMeta('AG$contextLost$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AG$contextLost$slambda_0(this$0, resultContinuation) {
    var i = new AG$contextLost$slambda(this$0, resultContinuation);
    var l = function ($this$runBlockingNoJs, $cont) {
      return i.h2n($this$runBlockingNoJs, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function AG$tempVertexBufferPool$lambda(this$0) {
    return function (it) {
      return this$0.ub4();
    };
  }
  function AG$tempIndexBufferPool$lambda(this$0) {
    return function (it) {
      return this$0.ub4();
    };
  }
  function AG$tempTexturePool$lambda(this$0) {
    return function (it) {
      return this$0.vay();
    };
  }
  function AG$dummyTexture$delegate$lambda(this$0) {
    return function () {
      return this$0.vay();
    };
  }
  function AG$renderBuffers$lambda(this$0) {
    return function (it) {
      return this$0.mb7();
    };
  }
  function AG$mainRenderBuffer$delegate$lambda(this$0) {
    return function () {
      var tmp0_subject = this$0.rax_1;
      var tmp0 = tmp0_subject.q2_1;
      var tmp;
      switch (tmp0) {
        case 0:
          tmp = this$0.nb7();
          break;
        case 1:
          tmp = this$0.mb7();
          break;
        default:
          noWhenBranchMatchedException();
          break;
      }
      return tmp;
    };
  }
  function AG$flip$slambda(this$0, resultContinuation) {
    this.wb7_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AG$flip$slambda.prototype.h2n = function ($this$runBlockingNoJs, $cont) {
    var tmp = this.i2n($this$runBlockingNoJs, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AG$flip$slambda.prototype.w7 = function (p1, $cont) {
    return this.h2n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
  };
  AG$flip$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.wb7_1.hay_1.lb7(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AG$flip$slambda.prototype.i2n = function ($this$runBlockingNoJs, completion) {
    var i = new AG$flip$slambda(this.wb7_1, completion);
    i.xb7_1 = $this$runBlockingNoJs;
    return i;
  };
  AG$flip$slambda.$metadata$ = classMeta('AG$flip$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AG$flip$slambda_0(this$0, resultContinuation) {
    var i = new AG$flip$slambda(this$0, resultContinuation);
    var l = function ($this$runBlockingNoJs, $cont) {
      return i.h2n($this$runBlockingNoJs, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function AG$textureDrawer$delegate$lambda(this$0) {
    return function () {
      return new TextureDrawer(this$0);
    };
  }
  function AG$drawTempTexture$delegate$lambda(this$0) {
    return function () {
      return this$0.vay();
    };
  }
  function AG$commandsSync$slambda(this$0, resultContinuation) {
    this.gb8_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AG$commandsSync$slambda.prototype.h2n = function ($this$runBlockingNoJs, $cont) {
    var tmp = this.i2n($this$runBlockingNoJs, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AG$commandsSync$slambda.prototype.w7 = function (p1, $cont) {
    return this.h2n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
  };
  AG$commandsSync$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.gb8_1.hay_1.lb7(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AG$commandsSync$slambda.prototype.i2n = function ($this$runBlockingNoJs, completion) {
    var i = new AG$commandsSync$slambda(this.gb8_1, completion);
    i.hb8_1 = $this$runBlockingNoJs;
    return i;
  };
  AG$commandsSync$slambda.$metadata$ = classMeta('AG$commandsSync$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AG$commandsSync$slambda_0(this$0, resultContinuation) {
    var i = new AG$commandsSync$slambda(this$0, resultContinuation);
    var l = function ($this$runBlockingNoJs, $cont) {
      return i.h2n($this$runBlockingNoJs, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function BlendEquation_ADD_getInstance() {
    BlendEquation_initEntries();
    return BlendEquation_ADD_instance;
  }
  function BlendEquation_SUBTRACT_getInstance() {
    BlendEquation_initEntries();
    return BlendEquation_SUBTRACT_instance;
  }
  function BlendEquation_REVERSE_SUBTRACT_getInstance() {
    BlendEquation_initEntries();
    return BlendEquation_REVERSE_SUBTRACT_instance;
  }
  function BlendFactor_DESTINATION_ALPHA_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_DESTINATION_ALPHA_instance;
  }
  function BlendFactor_DESTINATION_COLOR_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_DESTINATION_COLOR_instance;
  }
  function BlendFactor_ONE_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_ONE_instance;
  }
  function BlendFactor_ONE_MINUS_DESTINATION_ALPHA_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_ONE_MINUS_DESTINATION_ALPHA_instance;
  }
  function BlendFactor_ONE_MINUS_DESTINATION_COLOR_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_ONE_MINUS_DESTINATION_COLOR_instance;
  }
  function BlendFactor_ONE_MINUS_SOURCE_ALPHA_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_ONE_MINUS_SOURCE_ALPHA_instance;
  }
  function BlendFactor_ONE_MINUS_SOURCE_COLOR_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_ONE_MINUS_SOURCE_COLOR_instance;
  }
  function BlendFactor_SOURCE_ALPHA_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_SOURCE_ALPHA_instance;
  }
  function BlendFactor_SOURCE_COLOR_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_SOURCE_COLOR_instance;
  }
  function BlendFactor_ZERO_getInstance() {
    BlendFactor_initEntries();
    return BlendFactor_ZERO_instance;
  }
  function TextureTargetKind_TEXTURE_2D_getInstance() {
    TextureTargetKind_initEntries();
    return TextureTargetKind_TEXTURE_2D_instance;
  }
  function TextureTargetKind_TEXTURE_3D_getInstance() {
    TextureTargetKind_initEntries();
    return TextureTargetKind_TEXTURE_3D_instance;
  }
  function TextureTargetKind_TEXTURE_CUBE_MAP_getInstance() {
    TextureTargetKind_initEntries();
    return TextureTargetKind_TEXTURE_CUBE_MAP_instance;
  }
  function TextureTargetKind_EXTERNAL_TEXTURE_getInstance() {
    TextureTargetKind_initEntries();
    return TextureTargetKind_EXTERNAL_TEXTURE_instance;
  }
  function BufferKind_INDEX_getInstance() {
    BufferKind_initEntries();
    return BufferKind_INDEX_instance;
  }
  function BufferKind_VERTEX_getInstance() {
    BufferKind_initEntries();
    return BufferKind_VERTEX_instance;
  }
  function DrawType_POINTS_getInstance() {
    DrawType_initEntries();
    return DrawType_POINTS_instance;
  }
  function DrawType_LINE_STRIP_getInstance() {
    DrawType_initEntries();
    return DrawType_LINE_STRIP_instance;
  }
  function DrawType_LINE_LOOP_getInstance() {
    DrawType_initEntries();
    return DrawType_LINE_LOOP_instance;
  }
  function DrawType_LINES_getInstance() {
    DrawType_initEntries();
    return DrawType_LINES_instance;
  }
  function DrawType_TRIANGLES_getInstance() {
    DrawType_initEntries();
    return DrawType_TRIANGLES_instance;
  }
  function DrawType_TRIANGLE_STRIP_getInstance() {
    DrawType_initEntries();
    return DrawType_TRIANGLE_STRIP_instance;
  }
  function DrawType_TRIANGLE_FAN_getInstance() {
    DrawType_initEntries();
    return DrawType_TRIANGLE_FAN_instance;
  }
  function IndexType_UBYTE_getInstance() {
    IndexType_initEntries();
    return IndexType_UBYTE_instance;
  }
  function IndexType_USHORT_getInstance() {
    IndexType_initEntries();
    return IndexType_USHORT_instance;
  }
  function IndexType_UINT_getInstance() {
    IndexType_initEntries();
    return IndexType_UINT_instance;
  }
  function ReadKind_COLOR_getInstance() {
    ReadKind_initEntries();
    return ReadKind_COLOR_instance;
  }
  function ReadKind_DEPTH_getInstance() {
    ReadKind_initEntries();
    return ReadKind_DEPTH_instance;
  }
  function ReadKind_STENCIL_getInstance() {
    ReadKind_initEntries();
    return ReadKind_STENCIL_instance;
  }
  function StencilOp_DECREMENT_SATURATE_getInstance() {
    StencilOp_initEntries();
    return StencilOp_DECREMENT_SATURATE_instance;
  }
  function StencilOp_DECREMENT_WRAP_getInstance() {
    StencilOp_initEntries();
    return StencilOp_DECREMENT_WRAP_instance;
  }
  function StencilOp_INCREMENT_SATURATE_getInstance() {
    StencilOp_initEntries();
    return StencilOp_INCREMENT_SATURATE_instance;
  }
  function StencilOp_INCREMENT_WRAP_getInstance() {
    StencilOp_initEntries();
    return StencilOp_INCREMENT_WRAP_instance;
  }
  function StencilOp_INVERT_getInstance() {
    StencilOp_initEntries();
    return StencilOp_INVERT_instance;
  }
  function StencilOp_KEEP_getInstance() {
    StencilOp_initEntries();
    return StencilOp_KEEP_instance;
  }
  function StencilOp_SET_getInstance() {
    StencilOp_initEntries();
    return StencilOp_SET_instance;
  }
  function StencilOp_ZERO_getInstance() {
    StencilOp_initEntries();
    return StencilOp_ZERO_instance;
  }
  function TriangleFace_FRONT_getInstance() {
    TriangleFace_initEntries();
    return TriangleFace_FRONT_instance;
  }
  function TriangleFace_BACK_getInstance() {
    TriangleFace_initEntries();
    return TriangleFace_BACK_instance;
  }
  function TriangleFace_FRONT_AND_BACK_getInstance() {
    TriangleFace_initEntries();
    return TriangleFace_FRONT_AND_BACK_instance;
  }
  function TriangleFace_NONE_getInstance() {
    TriangleFace_initEntries();
    return TriangleFace_NONE_instance;
  }
  function CompareMode_ALWAYS_getInstance() {
    CompareMode_initEntries();
    return CompareMode_ALWAYS_instance;
  }
  function CompareMode_EQUAL_getInstance() {
    CompareMode_initEntries();
    return CompareMode_EQUAL_instance;
  }
  function CompareMode_GREATER_getInstance() {
    CompareMode_initEntries();
    return CompareMode_GREATER_instance;
  }
  function CompareMode_GREATER_EQUAL_getInstance() {
    CompareMode_initEntries();
    return CompareMode_GREATER_EQUAL_instance;
  }
  function CompareMode_LESS_getInstance() {
    CompareMode_initEntries();
    return CompareMode_LESS_instance;
  }
  function CompareMode_LESS_EQUAL_getInstance() {
    CompareMode_initEntries();
    return CompareMode_LESS_EQUAL_instance;
  }
  function CompareMode_NEVER_getInstance() {
    CompareMode_initEntries();
    return CompareMode_NEVER_instance;
  }
  function CompareMode_NOT_EQUAL_getInstance() {
    CompareMode_initEntries();
    return CompareMode_NOT_EQUAL_instance;
  }
  function CullFace_BOTH_getInstance() {
    CullFace_initEntries();
    return CullFace_BOTH_instance;
  }
  function CullFace_FRONT_getInstance() {
    CullFace_initEntries();
    return CullFace_FRONT_instance;
  }
  function CullFace_BACK_getInstance() {
    CullFace_initEntries();
    return CullFace_BACK_instance;
  }
  function FrontFace_BOTH_getInstance() {
    FrontFace_initEntries();
    return FrontFace_BOTH_instance;
  }
  function FrontFace_CCW_getInstance() {
    FrontFace_initEntries();
    return FrontFace_CCW_instance;
  }
  function FrontFace_CW_getInstance() {
    FrontFace_initEntries();
    return FrontFace_CW_instance;
  }
  function AG(checked) {
    Companion_getInstance_35();
    this.zaw_1 = checked;
    var tmp = this;
    tmp.aax_1 = Mixin_init_$Create$(null, 1, null);
    var tmp_0 = this;
    tmp_0.bax_1 = Pool_init_$Create$(0, AG$tempVertexBufferPool$lambda(this), 1, null);
    var tmp_1 = this;
    tmp_1.cax_1 = Pool_init_$Create$(0, AG$tempIndexBufferPool$lambda(this), 1, null);
    var tmp_2 = this;
    tmp_2.dax_1 = Pool_init_$Create$(0, AG$tempTexturePool$lambda(this), 1, null);
    this.eax_1 = Companion_getInstance_4().v7d(2048, 2048);
    this.fax_1 = 1.0;
    this.gax_1 = 1.0;
    this.hax_1 = 96.0;
    this.iax_1 = 0;
    this.jax_1 = 0;
    this.kax_1 = LinkedHashSet_init_$Create$();
    this.lax_1 = LinkedHashSet_init_$Create$();
    var tmp_3 = this;
    tmp_3.max_1 = lazy(AG$dummyTexture$delegate$lambda(this));
    var tmp_4 = this;
    tmp_4.nax_1 = Batch_init_$Create$(null, null, null, 0, null, null, 0, null, null, null, null, null, null, 0, 16383, null);
    this.oax_1 = LinkedHashSet_init_$Create$();
    var tmp_5 = this;
    tmp_5.pax_1 = Pool_init_$Create$(0, AG$renderBuffers$lambda(this), 1, null);
    this.qax_1 = LinkedHashSet_init_$Create$();
    this.rax_1 = AGTarget_DISPLAY_getInstance();
    var tmp_6 = this;
    tmp_6.sax_1 = lazy(AG$mainRenderBuffer$delegate$lambda(this));
    this.tax_1 = 0;
    this.uax_1 = Companion_getInstance_0().zp();
    this.vax_1 = Companion_getInstance_0().zp();
    this.wax_1 = FastArrayList_init_$Create$();
    this.xax_1 = null;
    this.yax_1 = false;
    this.zax_1 = 0;
    this.aay_1 = HashMap_init_$Create$();
    this.bay_1 = HashMap_init_$Create$();
    var tmp_7 = this;
    tmp_7.cay_1 = lazy(AG$textureDrawer$delegate$lambda(this));
    this.day_1 = true;
    var tmp_8 = this;
    tmp_8.eay_1 = lazy(AG$drawTempTexture$delegate$lambda(this));
    this.fay_1 = new AGGlobalState(this.zaw_1);
    this.gay_1 = contextVersion$factory(this.fay_1);
    this.hay_1 = this.fay_1.ub8();
    var tmp_9 = this;
    tmp_9.iay_1 = AGStats_init_$Create$(0, null, 0, null, 0, null, 0, 0, 0, 511, null);
  }
  AG.prototype.e4v = function (_set____db54di) {
    this.aax_1.e4v(_set____db54di);
  };
  AG.prototype.f4v = function () {
    return this.aax_1.f4v();
  };
  AG.prototype.vb8 = function () {
    Console_getInstance().p50(['AG.contextLost()', this]);
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.AG.commandsSync' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0__anonymous__q1qw7t = this.hay_1;
    tmp0__anonymous__q1qw7t.vb8();
    var result = Unit_getInstance();
    if (this.xay()) {
      runBlockingNoJs$default(null, AG$contextLost$slambda_0(this, null), 1, null);
    } else {
      this.way(this.hay_1);
    }
    tmp$ret$0 = result;
  };
  AG.prototype.wb8 = function () {
    return this.dax_1;
  };
  AG.prototype.xb8 = function () {
    return this.fax_1;
  };
  AG.prototype.yb8 = function () {
    return this.gax_1;
  };
  AG.prototype.zb8 = function () {
    return this.xb8() * this.yb8();
  };
  AG.prototype.ab9 = function () {
  };
  AG.prototype.bb9 = function (x, y, width, height, fullWidth, fullHeight) {
    this.cb9().yb1(x, y, width, height, fullWidth, fullHeight);
  };
  AG.prototype.db9 = function () {
    return this.cb9().d72();
  };
  AG.prototype.eb9 = function () {
    return this.cb9().e72();
  };
  AG.prototype.fb9 = function () {
    var tmp0_safe_receiver = this.xax_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.d72();
    return tmp1_elvis_lhs == null ? this.cb9().d72() : tmp1_elvis_lhs;
  };
  AG.prototype.gb9 = function () {
    var tmp0_safe_receiver = this.xax_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.e72();
    return tmp1_elvis_lhs == null ? this.cb9().e72() : tmp1_elvis_lhs;
  };
  AG.prototype.vay = function () {
    return this.kb3(true, null, 2, null);
  };
  AG.prototype.hb9 = function (premultiplied, targetKind) {
    return new Texture(this, premultiplied, targetKind);
  };
  AG.prototype.kb3 = function (premultiplied, targetKind, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      targetKind = TextureTargetKind_TEXTURE_2D_getInstance();
    return $handler == null ? this.hb9(premultiplied, targetKind) : $handler(premultiplied, targetKind);
  };
  AG.prototype.ub4 = function () {
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsNoWaitNoExecute' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.AG.createBuffer.<anonymous>' call
    var tmp0__anonymous__q1qw7t = this.hay_1;
    tmp$ret$0 = new Buffer(this, tmp0__anonymous__q1qw7t);
    tmp$ret$1 = tmp$ret$0;
    return tmp$ret$1;
  };
  AG.prototype.ib9 = function () {
    return this.ub4();
  };
  AG.prototype.jb9 = function () {
    return this.ub4();
  };
  AG.prototype.kb9 = function (attributes, layoutSize) {
    return new VertexData(this.jb9(), ProgramLayout_init_$Create$_0(attributes.slice(), layoutSize));
  };
  AG.prototype.lb9 = function (attributes, layoutSize, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      layoutSize = null;
    return this.kb9(attributes, layoutSize);
  };
  AG.prototype.mb9 = function (vertices, program, type, vertexLayout, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = this.nax_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.AG.draw.<anonymous>' call
    tmp0_also.tb1(vertices);
    tmp0_also.fat_1 = program;
    tmp0_also.gat_1 = type;
    tmp0_also.ub1(vertexLayout);
    tmp0_also.hat_1 = vertexCount;
    tmp0_also.iat_1 = indices;
    tmp0_also.jat_1 = indexType;
    tmp0_also.kat_1 = offset;
    tmp0_also.lat_1 = blending;
    tmp0_also.mat_1 = uniforms;
    tmp0_also.nat_1 = stencil;
    tmp0_also.oat_1 = colorMask;
    tmp0_also.pat_1 = renderState;
    tmp0_also.qat_1 = scissor;
    tmp0_also.rat_1 = instances;
    tmp$ret$0 = tmp0_also;
    return this.nb9(tmp$ret$0);
  };
  AG.prototype.ob9 = function (vertices, program, type, vertexLayout, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances, $mask0, $handler) {
    if (!(($mask0 & 32) === 0))
      indices = null;
    if (!(($mask0 & 64) === 0))
      indexType = IndexType_USHORT_getInstance();
    if (!(($mask0 & 128) === 0))
      offset = 0;
    if (!(($mask0 & 256) === 0))
      blending = Companion_getInstance_19().ear_1;
    if (!(($mask0 & 512) === 0))
      uniforms = Companion_getInstance_34().dat_1;
    if (!(($mask0 & 1024) === 0))
      stencil = Companion_getInstance_33().eas_1;
    if (!(($mask0 & 2048) === 0))
      colorMask = Companion_getInstance_29().aas_1;
    if (!(($mask0 & 4096) === 0))
      renderState = Companion_getInstance_32().das_1;
    if (!(($mask0 & 8192) === 0))
      scissor = null;
    if (!(($mask0 & 16384) === 0))
      instances = 1;
    return this.mb9(vertices, program, type, vertexLayout, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances);
  };
  AG.prototype.pb9 = function (vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = this.nax_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.AG.drawV2.<anonymous>' call
    tmp0_also.eat_1 = vertexData;
    tmp0_also.fat_1 = program;
    tmp0_also.gat_1 = type;
    tmp0_also.hat_1 = vertexCount;
    tmp0_also.iat_1 = indices;
    tmp0_also.jat_1 = indexType;
    tmp0_also.kat_1 = offset;
    tmp0_also.lat_1 = blending;
    tmp0_also.mat_1 = uniforms;
    tmp0_also.nat_1 = stencil;
    tmp0_also.oat_1 = colorMask;
    tmp0_also.pat_1 = renderState;
    tmp0_also.qat_1 = scissor;
    tmp0_also.rat_1 = instances;
    tmp$ret$0 = tmp0_also;
    return this.nb9(tmp$ret$0);
  };
  AG.prototype.qb9 = function (vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances, $mask0, $handler) {
    if (!(($mask0 & 16) === 0))
      indices = null;
    if (!(($mask0 & 32) === 0))
      indexType = IndexType_USHORT_getInstance();
    if (!(($mask0 & 64) === 0))
      offset = 0;
    if (!(($mask0 & 128) === 0))
      blending = Companion_getInstance_19().ear_1;
    if (!(($mask0 & 256) === 0))
      uniforms = Companion_getInstance_34().dat_1;
    if (!(($mask0 & 512) === 0))
      stencil = Companion_getInstance_33().eas_1;
    if (!(($mask0 & 1024) === 0))
      colorMask = Companion_getInstance_29().aas_1;
    if (!(($mask0 & 2048) === 0))
      renderState = Companion_getInstance_32().das_1;
    if (!(($mask0 & 4096) === 0))
      scissor = null;
    if (!(($mask0 & 8192) === 0))
      instances = 1;
    return this.pb9(vertexData, program, type, vertexCount, indices, indexType, offset, blending, uniforms, stencil, colorMask, renderState, scissor, instances);
  };
  AG.prototype.nb9 = function (batch) {
    var instances = batch.rat_1;
    var program = batch.fat_1;
    var type = batch.gat_1;
    var vertexCount = batch.hat_1;
    var indices = batch.iat_1;
    var indexType = batch.jat_1;
    var offset = batch.kat_1;
    var blending = batch.lat_1;
    var uniforms = batch.mat_1;
    var stencil = batch.nat_1;
    var colorMask = batch.oat_1;
    var renderState = batch.pat_1;
    var scissor = batch.qat_1;
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0__anonymous__q1qw7t = this.hay_1;
    setScissorState(tmp0__anonymous__q1qw7t, this, scissor);
    this.ub9(program, this.tb9(uniforms) ? Companion_getInstance_42().sb9_1 : Companion_getInstance_42().rb9_1).db6(tmp0__anonymous__q1qw7t);
    var tmp0_vertexArrayObjectSet = _VertexArrayObject___init__impl__y6yvd1(batch.eat_1);
    var vaoId = tmp0__anonymous__q1qw7t.vb9();
    var tmp;
    try {
      tmp0__anonymous__q1qw7t.wb9(vaoId, tmp0_vertexArrayObjectSet);
      tmp0__anonymous__q1qw7t.xb9(vaoId);
      var tmp$ret$0;
      $l$block: {
        // Inline function 'com.soywiz.kds.Pool.alloc' call
        var tmp0_alloc = tmp0__anonymous__q1qw7t.tay_1;
        var temp = tmp0_alloc.t4t();
        try {
          var tmp0_elvis_lhs = uniforms;
          tmp0__anonymous__q1qw7t.yb9(temp, tmp0_elvis_lhs == null ? new UniformValues() : tmp0_elvis_lhs);
          tmp0__anonymous__q1qw7t.zb9(temp);
          setState(tmp0__anonymous__q1qw7t, blending, stencil, colorMask, renderState);
          tmp0__anonymous__q1qw7t.aba(type, vertexCount, offset, instances, !(indices == null) ? indexType : null, indices);
          tmp$ret$0 = Unit_getInstance();
          break $l$block;
        }finally {
          tmp0_alloc.u4t(temp);
        }
      }
      tmp = tmp$ret$0;
    }finally {
      tmp0__anonymous__q1qw7t.xb9(0);
      tmp0__anonymous__q1qw7t.bba(vaoId);
    }
    var result = tmp;
    if (!this.xay()) {
      this.way(this.hay_1);
    }
    tmp$ret$1 = result;
  };
  AG.prototype.tb9 = function (_this__u8e3s4) {
    var useExternalSampler = false;
    // Inline function 'com.soywiz.korag.UniformValues.fastForEach' call
    var inductionVariable = 0;
    var last = _this__u8e3s4.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korag.AG.useExternalSampler.<anonymous>' call
        var tmp0__anonymous__q1qw7t = _this__u8e3s4.wat_1.m(n);
        var tmp1__anonymous__uwfjfc = _this__u8e3s4.xat_1.m(n);
        var uniformType = tmp0__anonymous__q1qw7t.h68();
        var tmp0_subject = uniformType;
        var tmp0 = tmp0_subject.q2_1;
        if (tmp0 === 5) {
          var tmp$ret$2;
          // Inline function 'com.soywiz.kds.fastCastTo' call
          var tmp$ret$1;
          // Inline function 'kotlin.js.unsafeCast' call
          var tmp$ret$0;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$0 = tmp1__anonymous__uwfjfc;
          tmp$ret$1 = tmp$ret$0;
          tmp$ret$2 = tmp$ret$1;
          var unit = tmp$ret$2;
          var tmp$ret$5;
          // Inline function 'com.soywiz.kds.fastCastTo' call
          var tmp0_fastCastTo = unit.laz_1;
          var tmp$ret$4;
          // Inline function 'kotlin.js.unsafeCast' call
          var tmp$ret$3;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$3 = tmp0_fastCastTo;
          tmp$ret$4 = tmp$ret$3;
          tmp$ret$5 = tmp$ret$4;
          var tex = tmp$ret$5;
          if (!(tex == null)) {
            if (tex.aaz().equals(TextureTargetKind_EXTERNAL_TEXTURE_getInstance())) {
              useExternalSampler = true;
            }
          }
        } else
        ;
      }
       while (inductionVariable < last);
    return useExternalSampler;
  };
  AG.prototype.dba = function () {
    return Unit_getInstance();
  };
  AG.prototype.cb9 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = mainRenderBuffer$factory();
    tmp$ret$0 = this.sax_1.l1();
    return tmp$ret$0;
  };
  AG.prototype.nb7 = function () {
    return new BaseRenderBufferImpl(this);
  };
  AG.prototype.ib4 = function (buffer) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0__anonymous__q1qw7t = this.hay_1;
    tmp0__anonymous__q1qw7t.uaq(buffer.d1n(), buffer.e1n(), buffer.d72(), buffer.e72());
    var result = Unit_getInstance();
    if (!this.xay()) {
      this.way(this.hay_1);
    }
    tmp$ret$0 = result;
  };
  AG.prototype.mb7 = function () {
    return new GlRenderBuffer(this);
  };
  AG.prototype.eba = function () {
    this.dba();
    this.pax_1.v4t(this.oax_1);
    var tmp$ret$0;
    // Inline function 'kotlin.collections.isNotEmpty' call
    var tmp0_isNotEmpty = this.oax_1;
    tmp$ret$0 = !tmp0_isNotEmpty.p();
    if (tmp$ret$0) {
      this.oax_1.x7();
    }
    this.fba();
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsSync' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp1__anonymous__uwfjfc = this.hay_1;
    tmp1__anonymous__uwfjfc.a2z();
    var result = Unit_getInstance();
    if (this.xay()) {
      runBlockingNoJs$default(null, AG$flip$slambda_0(this, null), 1, null);
    } else {
      this.way(this.hay_1);
    }
    tmp$ret$1 = result;
  };
  AG.prototype.fba = function () {
    return Unit_getInstance();
  };
  AG.prototype.gba = function () {
  };
  AG.prototype.hba = function (color, depth, stencil, clearColor, clearDepth, clearStencil, scissor) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0__anonymous__q1qw7t = this.hay_1;
    setScissorState(tmp0__anonymous__q1qw7t, this, scissor);
    if (clearColor) {
      tmp0__anonymous__q1qw7t.iao(true, true, true, true);
      tmp0__anonymous__q1qw7t.fao(_RGBA___get_rf__impl__kvz75k(color), _RGBA___get_gf__impl__5gcu1f(color), _RGBA___get_bf__impl__1xz5yg(color), _RGBA___get_af__impl__vu36qv(color));
    }
    if (clearDepth) {
      tmp0__anonymous__q1qw7t.vao(true);
      tmp0__anonymous__q1qw7t.iba(depth);
    }
    if (clearStencil) {
      tmp0__anonymous__q1qw7t.yap(-1);
      tmp0__anonymous__q1qw7t.hao(stencil);
    }
    tmp0__anonymous__q1qw7t.jba(clearColor, clearDepth, clearStencil);
    var result = Unit_getInstance();
    if (!this.xay()) {
      this.way(this.hay_1);
    }
    tmp$ret$0 = result;
  };
  AG.prototype.kba = function (color, depth, stencil, clearColor, clearDepth, clearStencil, scissor, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      color = Colors_getInstance().x7z_1;
    if (!(($mask0 & 2) === 0))
      depth = 1.0;
    if (!(($mask0 & 4) === 0))
      stencil = 0;
    if (!(($mask0 & 8) === 0))
      clearColor = true;
    if (!(($mask0 & 16) === 0))
      clearDepth = true;
    if (!(($mask0 & 32) === 0))
      clearStencil = true;
    if (!(($mask0 & 64) === 0))
      scissor = null;
    var tmp;
    if ($handler == null) {
      this.hba(color, depth, stencil, clearColor, clearDepth, clearStencil, scissor);
      tmp = Unit_getInstance();
    } else {
      var tmp_0 = color;
      tmp = $handler(tmp_0 == null ? null : new RGBA(tmp_0), depth, stencil, clearColor, clearDepth, clearStencil, scissor);
    }
    return tmp;
  };
  AG.prototype.lba = function () {
    var tmp0_elvis_lhs = this.xax_1;
    return tmp0_elvis_lhs == null ? this.cb9() : tmp0_elvis_lhs;
  };
  AG.prototype.mba = function () {
    return this.lba() === this.cb9();
  };
  AG.prototype.nba = function () {
    return !this.mba();
  };
  AG.prototype.oba = function () {
    return this.nba();
  };
  AG.prototype.pba = function (rb, callback) {
    this.qba(rb);
    try {
      callback(rb);
    }finally {
      this.rba();
    }
  };
  AG.prototype.sba = function (width) {
    return this.yax_1 ? nextMultipleOf(width, 64) : width;
  };
  AG.prototype.tba = function (height) {
    return this.yax_1 ? nextMultipleOf(height, 64) : height;
  };
  AG.prototype.uba = function (width, height, hasDepth, hasStencil, msamples, block) {
    var rb = this.vba(width, height, hasDepth, hasStencil, msamples);
    try {
      block(rb);
    }finally {
      this.wba(rb);
    }
  };
  AG.prototype.vba = function (width, height, hasDepth, hasStencil, msamples) {
    var tmp$ret$0;
    // Inline function 'kotlin.math.max' call
    tmp$ret$0 = Math.max(width, 64);
    var realWidth = this.sba(tmp$ret$0);
    var tmp$ret$1;
    // Inline function 'kotlin.math.max' call
    tmp$ret$1 = Math.max(height, 64);
    var realHeight = this.tba(tmp$ret$1);
    var rb = this.pax_1.t4t();
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.oax_1;
    tmp0_plusAssign.c(rb);
    rb.yb1(0, 0, realWidth, realHeight, realWidth, realHeight);
    rb.mb3(hasDepth, hasStencil);
    rb.lb3(msamples);
    return rb;
  };
  AG.prototype.wba = function (rb) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.minusAssign' call
    var tmp0_minusAssign = tmp0_this.oax_1;
    tmp0_minusAssign.c5(rb);
    this.pax_1.u4t(rb);
  };
  AG.prototype.xba = function (renderBuffer) {
    var old = this.xax_1;
    var tmp0_safe_receiver = this.xax_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.cb2();
    }
    this.xax_1 = renderBuffer;
    var tmp1_safe_receiver = renderBuffer;
    if (tmp1_safe_receiver == null)
      null;
    else {
      tmp1_safe_receiver.bb2();
    }
    return old;
  };
  AG.prototype.qba = function (renderBuffer) {
    this.wax_1.c(this.xax_1);
    this.xba(renderBuffer);
  };
  AG.prototype.rba = function () {
    this.xba(last(this.wax_1));
    this.wax_1.z4(this.wax_1.i() - 1 | 0);
  };
  AG.prototype.ub9 = function (program, config) {
    var map = config.yba_1 ? this.bay_1 : this.aay_1;
    var tmp$ret$1;
    // Inline function 'kotlin.collections.getOrPut' call
    var value = map.q(program);
    var tmp;
    if (value == null) {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.AG.getProgram.<anonymous>' call
      tmp$ret$0 = new AgProgram(this, program, config);
      var answer = tmp$ret$0;
      map.a(program, answer);
      tmp = answer;
    } else {
      tmp = value;
    }
    tmp$ret$1 = tmp;
    return tmp$ret$1;
  };
  AG.prototype.zba = function (program, config, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      config = Companion_getInstance_42().rb9_1;
    return this.ub9(program, config);
  };
  AG.prototype.abb = function (_set____db54di) {
    var tmp0_setValue = contextVersion$factory_0();
    return this.gay_1.set(_set____db54di);
  };
  AG.prototype.jay = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = contextVersion$factory_1();
    tmp$ret$0 = this.gay_1.get();
    return tmp$ret$0;
  };
  AG.prototype.bbb = function () {
    return this.hay_1;
  };
  AG.prototype.xay = function () {
    return false;
  };
  AG.prototype.cbb = function (block) {
    // Inline function 'kotlin.contracts.contract' call
    var result = block(this.hay_1);
    if (this.xay()) {
      runBlockingNoJs$default(null, AG$commandsSync$slambda_0(this, null), 1, null);
    } else {
      this.way(this.hay_1);
    }
    return result;
  };
  AG.prototype.dbb = function (block) {
    // Inline function 'kotlin.contracts.contract' call
    var result = block(this.hay_1);
    if (!this.xay()) {
      this.way(this.hay_1);
    }
    return result;
  };
  AG.prototype.ebb = function (block) {
    // Inline function 'kotlin.contracts.contract' call
    return block(this.hay_1);
  };
  AG.prototype.way = function (list) {
    return this.fbb(list);
  };
  AG.prototype.fbb = function (list) {
  };
  AG.$metadata$ = classMeta('AG', [AGFeatures, Extra]);
  var AGTarget_DISPLAY_instance;
  var AGTarget_OFFSCREEN_instance;
  var AGTarget_entriesInitialized;
  function AGTarget_initEntries() {
    if (AGTarget_entriesInitialized)
      return Unit_getInstance();
    AGTarget_entriesInitialized = true;
    AGTarget_DISPLAY_instance = new AGTarget('DISPLAY', 0);
    AGTarget_OFFSCREEN_instance = new AGTarget('OFFSCREEN', 1);
  }
  function AGTarget(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  AGTarget.$metadata$ = classMeta('AGTarget', undefined, undefined, undefined, undefined, Enum.prototype);
  function AGWindow() {
  }
  AGWindow.$metadata$ = interfaceMeta('AGWindow', [AGContainer]);
  function AGConfig_init_$Init$(antialiasHint, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      antialiasHint = true;
    AGConfig.call($this, antialiasHint);
    return $this;
  }
  function AGConfig_init_$Create$(antialiasHint, $mask0, $marker) {
    return AGConfig_init_$Init$(antialiasHint, $mask0, $marker, Object.create(AGConfig.prototype));
  }
  function AGConfig(antialiasHint) {
    this.gbb_1 = antialiasHint;
  }
  AGConfig.prototype.toString = function () {
    return 'AGConfig(antialiasHint=' + this.gbb_1 + ')';
  };
  AGConfig.prototype.hashCode = function () {
    return this.gbb_1 | 0;
  };
  AGConfig.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof AGConfig))
      return false;
    var tmp0_other_with_cast = other instanceof AGConfig ? other : THROW_CCE();
    if (!(this.gbb_1 === tmp0_other_with_cast.gbb_1))
      return false;
    return true;
  };
  AGConfig.$metadata$ = classMeta('AGConfig');
  function AGContainer() {
  }
  AGContainer.$metadata$ = interfaceMeta('AGContainer');
  function AGTarget_DISPLAY_getInstance() {
    AGTarget_initEntries();
    return AGTarget_DISPLAY_instance;
  }
  function contextVersion$factory($b0) {
    return getPropertyCallableRef('contextVersion', 0, KMutableProperty0, function () {
      return $b0.jb8_1;
    }, function (value) {
      $b0.jb8_1 = value;
      return Unit_getInstance();
    });
  }
  function x$factory($b0) {
    return getPropertyCallableRef('x', 0, KMutableProperty0, function () {
      return $b0.v71_1;
    }, function (value) {
      $b0.v71_1 = value;
      return Unit_getInstance();
    });
  }
  function y$factory($b0) {
    return getPropertyCallableRef('y', 0, KMutableProperty0, function () {
      return $b0.w71_1;
    }, function (value) {
      $b0.w71_1 = value;
      return Unit_getInstance();
    });
  }
  function width$factory($b0) {
    return getPropertyCallableRef('width', 0, KMutableProperty0, function () {
      return $b0.x71_1;
    }, function (value) {
      $b0.x71_1 = value;
      return Unit_getInstance();
    });
  }
  function height$factory($b0) {
    return getPropertyCallableRef('height', 0, KMutableProperty0, function () {
      return $b0.y71_1;
    }, function (value) {
      $b0.y71_1 = value;
      return Unit_getInstance();
    });
  }
  function x$factory_0() {
    return getPropertyCallableRef('x', 1, KMutableProperty1, function (receiver) {
      return receiver.d1n();
    }, function (receiver, value) {
      return receiver.w8w(value);
    });
  }
  function x$factory_1() {
    return getPropertyCallableRef('x', 1, KMutableProperty1, function (receiver) {
      return receiver.d1n();
    }, function (receiver, value) {
      return receiver.w8w(value);
    });
  }
  function y$factory_0() {
    return getPropertyCallableRef('y', 1, KMutableProperty1, function (receiver) {
      return receiver.e1n();
    }, function (receiver, value) {
      return receiver.o7c(value);
    });
  }
  function y$factory_1() {
    return getPropertyCallableRef('y', 1, KMutableProperty1, function (receiver) {
      return receiver.e1n();
    }, function (receiver, value) {
      return receiver.o7c(value);
    });
  }
  function width$factory_0() {
    return getPropertyCallableRef('width', 1, KMutableProperty1, function (receiver) {
      return receiver.d72();
    }, function (receiver, value) {
      return receiver.cav(value);
    });
  }
  function width$factory_1() {
    return getPropertyCallableRef('width', 1, KMutableProperty1, function (receiver) {
      return receiver.d72();
    }, function (receiver, value) {
      return receiver.cav(value);
    });
  }
  function height$factory_0() {
    return getPropertyCallableRef('height', 1, KMutableProperty1, function (receiver) {
      return receiver.e72();
    }, function (receiver, value) {
      return receiver.p7c(value);
    });
  }
  function height$factory_1() {
    return getPropertyCallableRef('height', 1, KMutableProperty1, function (receiver) {
      return receiver.e72();
    }, function (receiver, value) {
      return receiver.p7c(value);
    });
  }
  function mainRenderBuffer$factory() {
    return getPropertyCallableRef('mainRenderBuffer', 1, KProperty1, function (receiver) {
      return receiver.cb9();
    }, null);
  }
  function contextVersion$factory_0() {
    return getPropertyCallableRef('contextVersion', 1, KMutableProperty1, function (receiver) {
      return receiver.jay();
    }, function (receiver, value) {
      return receiver.abb(value);
    });
  }
  function contextVersion$factory_1() {
    return getPropertyCallableRef('contextVersion', 1, KMutableProperty1, function (receiver) {
      return receiver.jay();
    }, function (receiver, value) {
      return receiver.abb(value);
    });
  }
  function CMD($this, cmd) {
    return finsert8(0, cmd, 24);
  }
  function readExtra($this) {
    return $this.ray_1.lbb();
  }
  function readFloat($this) {
    return $this.ray_1.mbb();
  }
  function readInt($this) {
    return $this.ray_1.nbb();
  }
  function readTakeMore($this) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
    var tmp0_invoke = $this.oay_1;
    $this.ray_1.x7();
    if ($this.qay_1.i() > 0) {
      $this.pay_1.u4t($this.ray_1);
      $this.ray_1 = $this.qay_1.s4p();
      return true;
    }
    return false;
  }
  function writeListFlush($this) {
    var tmp$ret$1;
    // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
    var tmp0_invoke = $this.oay_1;
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.korag.AGList.writeListFlush.<anonymous>' call
      if ($this.say_1.p()) {
        tmp$ret$0 = Unit_getInstance();
        break $l$block;
      }
      $this.qay_1.h4q($this.say_1);
      $this.say_1 = $this.pay_1.t4t();
    }
    tmp$ret$1 = tmp$ret$0;
  }
  function Companion_21() {
    Companion_instance_21 = this;
    this.obb_1 = 249;
    this.pbb_1 = 250;
    this.qbb_1 = 251;
    this.rbb_1 = 252;
    this.sbb_1 = 253;
    this.tbb_1 = 254;
    this.ubb_1 = 255;
    this.vbb_1 = 0;
    this.wbb_1 = 1;
    this.xbb_1 = 2;
    this.ybb_1 = 3;
    this.zbb_1 = 4;
    this.abc_1 = 5;
    this.bbc_1 = 6;
    this.cbc_1 = 7;
    this.dbc_1 = 8;
    this.ebc_1 = 9;
    this.fbc_1 = 10;
    this.gbc_1 = 11;
    this.hbc_1 = 12;
    this.ibc_1 = 16;
    this.jbc_1 = 17;
    this.kbc_1 = 18;
    this.lbc_1 = 19;
    this.mbc_1 = 48;
    this.nbc_1 = 49;
    this.obc_1 = 50;
    this.pbc_1 = 51;
    this.qbc_1 = 64;
    this.rbc_1 = 65;
    this.sbc_1 = 66;
    this.tbc_1 = 67;
    this.ubc_1 = 68;
    this.vbc_1 = 80;
    this.wbc_1 = 96;
    this.xbc_1 = 112;
    this.ybc_1 = 113;
    this.zbc_1 = 114;
    this.abd_1 = 115;
    this.bbd_1 = 116;
    this.cbd_1 = 128;
    this.dbd_1 = 129;
    this.ebd_1 = 130;
    this.fbd_1 = 144;
    this.gbd_1 = 145;
    this.hbd_1 = 146;
    this.ibd_1 = 147;
    this.jbd_1 = 160;
    this.kbd_1 = 161;
    this.lbd_1 = 162;
    this.mbd_1 = 163;
    this.nbd_1 = 176;
    this.obd_1 = 177;
    this.pbd_1 = 178;
    this.qbd_1 = 179;
    this.rbd_1 = 192;
    this.sbd_1 = 193;
    this.tbd_1 = 194;
    this.ubd_1 = 195;
  }
  Companion_21.$metadata$ = objectMeta('Companion');
  var Companion_instance_21;
  function Companion_getInstance_36() {
    if (Companion_instance_21 == null)
      new Companion_21();
    return Companion_instance_21;
  }
  function AGList$listDataPool$lambda(it) {
    it.x7();
    return Unit_getInstance();
  }
  function AGList$listDataPool$lambda_0(it) {
    return new AGListData();
  }
  function AGList$tempUBOs$lambda(this$0) {
    return function (it) {
      return this$0.vbd();
    };
  }
  function AGList$uniformValuesPool$lambda(it) {
    return new UniformValues();
  }
  function AGList(globalState) {
    Companion_getInstance_36();
    this.kay_1 = globalState;
    this.lay_1 = contextVersion$factory_2(this.kay_1);
    this.may_1 = Companion_getInstance_0().zp();
    var tmp = this;
    tmp.nay_1 = CompletableDeferred$default(null, 1, null);
    this.oay_1 = new NonRecursiveLock();
    var tmp_0 = this;
    var tmp_1 = AGList$listDataPool$lambda;
    tmp_0.pay_1 = Pool_init_$Create$_0(tmp_1, 0, AGList$listDataPool$lambda_0, 2, null);
    this.qay_1 = new TGenDeque(16);
    this.ray_1 = this.pay_1.t4t();
    this.say_1 = this.pay_1.t4t();
    var tmp_2 = this;
    tmp_2.tay_1 = Pool_init_$Create$(0, AGList$tempUBOs$lambda(this), 1, null);
    var tmp_3 = this;
    tmp_3.uay_1 = Pool_init_$Create$(0, AGList$uniformValuesPool$lambda, 1, null);
  }
  AGList.prototype.wbd = function () {
    return this.tay_1;
  };
  AGList.prototype.xbd = function (_this__u8e3s4, maxCount) {
    var pending = maxCount;
    var processor = _this__u8e3s4;
    processor.ybd();
    $l$loop: while (true) {
      var tmp0 = pending;
      pending = tmp0 - 1 | 0;
      if (tmp0 === 0)
        break $l$loop;
      var tmp;
      if (this.ray_1.p()) {
        var tmp$ret$0;
        // Inline function 'kotlin.collections.isNotEmpty' call
        var tmp0_isNotEmpty = this.qay_1;
        tmp$ret$0 = !tmp0_isNotEmpty.p();
        tmp = tmp$ret$0;
      } else {
        tmp = false;
      }
      if (tmp) {
        readTakeMore(this);
      }
      if (this.ray_1.p())
        return false;
      var data = this.ray_1.g1c();
      var tmp$ret$1;
      // Inline function 'com.soywiz.kmem.extract8' call
      tmp$ret$1 = (data >>> 24 | 0) & 255;
      var cmd = tmp$ret$1;
      var tmp1_subject = cmd;
      Companion_getInstance_36();
      if (tmp1_subject === 249) {
        processor.mj();
      } else {
        Companion_getInstance_36();
        if (tmp1_subject === 255) {
          processor.a2z();
          this.nay_1.x1z(Unit_getInstance());
          return true;
        } else {
          Companion_getInstance_36();
          if (tmp1_subject === 250) {
            processor.vb8();
          } else {
            Companion_getInstance_36();
            if (tmp1_subject === 8) {
              var tmp_0 = Companion_getInstance_28().zar_1;
              var tmp$ret$2;
              // Inline function 'com.soywiz.kmem.extract4' call
              tmp$ret$2 = (data >>> 0 | 0) & 15;
              processor.ebf(tmp_0[tmp$ret$2]);
            } else {
              Companion_getInstance_36();
              if (tmp1_subject === 1) {
                var tmp_1 = Companion_getInstance_37().cbf_1;
                var tmp$ret$3;
                // Inline function 'com.soywiz.kmem.extract4' call
                tmp$ret$3 = (data >>> 0 | 0) & 15;
                processor.dbf(tmp_1[tmp$ret$3], true);
              } else {
                Companion_getInstance_36();
                if (tmp1_subject === 2) {
                  var tmp_2 = Companion_getInstance_37().cbf_1;
                  var tmp$ret$4;
                  // Inline function 'com.soywiz.kmem.extract4' call
                  tmp$ret$4 = (data >>> 0 | 0) & 15;
                  processor.dbf(tmp_2[tmp$ret$4], false);
                } else {
                  Companion_getInstance_36();
                  if (tmp1_subject === 3) {
                    var tmp$ret$6;
                    // Inline function 'com.soywiz.kmem.extract' call
                    var tmp$ret$5;
                    // Inline function 'com.soywiz.kmem.extract1' call
                    tmp$ret$5 = (data >>> 0 | 0) & 1;
                    tmp$ret$6 = !(tmp$ret$5 === 0);
                    var tmp_3 = tmp$ret$6;
                    var tmp$ret$8;
                    // Inline function 'com.soywiz.kmem.extract' call
                    var tmp$ret$7;
                    // Inline function 'com.soywiz.kmem.extract1' call
                    tmp$ret$7 = (data >>> 1 | 0) & 1;
                    tmp$ret$8 = !(tmp$ret$7 === 0);
                    var tmp_4 = tmp$ret$8;
                    var tmp$ret$10;
                    // Inline function 'com.soywiz.kmem.extract' call
                    var tmp$ret$9;
                    // Inline function 'com.soywiz.kmem.extract1' call
                    tmp$ret$9 = (data >>> 2 | 0) & 1;
                    tmp$ret$10 = !(tmp$ret$9 === 0);
                    var tmp_5 = tmp$ret$10;
                    var tmp$ret$12;
                    // Inline function 'com.soywiz.kmem.extract' call
                    var tmp$ret$11;
                    // Inline function 'com.soywiz.kmem.extract1' call
                    tmp$ret$11 = (data >>> 3 | 0) & 1;
                    tmp$ret$12 = !(tmp$ret$11 === 0);
                    processor.iao(tmp_3, tmp_4, tmp_5, tmp$ret$12);
                  } else {
                    Companion_getInstance_36();
                    if (tmp1_subject === 4) {
                      var tmp_6 = Companion_getInstance_16().bar_1;
                      var tmp$ret$13;
                      // Inline function 'com.soywiz.kmem.extract4' call
                      tmp$ret$13 = (data >>> 0 | 0) & 15;
                      var tmp_7 = tmp_6[tmp$ret$13];
                      var tmp_8 = Companion_getInstance_16().bar_1;
                      var tmp$ret$14;
                      // Inline function 'com.soywiz.kmem.extract4' call
                      tmp$ret$14 = (data >>> 4 | 0) & 15;
                      processor.bbf(tmp_7, tmp_8[tmp$ret$14]);
                    } else {
                      Companion_getInstance_36();
                      if (tmp1_subject === 5) {
                        var tmp_9 = Companion_getInstance_17().car_1;
                        var tmp$ret$15;
                        // Inline function 'com.soywiz.kmem.extract4' call
                        tmp$ret$15 = (data >>> 0 | 0) & 15;
                        var tmp_10 = tmp_9[tmp$ret$15];
                        var tmp_11 = Companion_getInstance_17().car_1;
                        var tmp$ret$16;
                        // Inline function 'com.soywiz.kmem.extract4' call
                        tmp$ret$16 = (data >>> 4 | 0) & 15;
                        var tmp_12 = tmp_11[tmp$ret$16];
                        var tmp_13 = Companion_getInstance_17().car_1;
                        var tmp$ret$17;
                        // Inline function 'com.soywiz.kmem.extract4' call
                        tmp$ret$17 = (data >>> 8 | 0) & 15;
                        var tmp_14 = tmp_13[tmp$ret$17];
                        var tmp_15 = Companion_getInstance_17().car_1;
                        var tmp$ret$18;
                        // Inline function 'com.soywiz.kmem.extract4' call
                        tmp$ret$18 = (data >>> 12 | 0) & 15;
                        processor.abf(tmp_10, tmp_12, tmp_14, tmp_15[tmp$ret$18]);
                      } else {
                        Companion_getInstance_36();
                        if (tmp1_subject === 6) {
                          var tmp_16 = Companion_getInstance_30().bas_1;
                          var tmp$ret$19;
                          // Inline function 'com.soywiz.kmem.extract4' call
                          tmp$ret$19 = (data >>> 0 | 0) & 15;
                          processor.zbe(tmp_16[tmp$ret$19]);
                        } else {
                          Companion_getInstance_36();
                          if (tmp1_subject === 7) {
                            var tmp_17 = Companion_getInstance_31().cas_1;
                            var tmp$ret$20;
                            // Inline function 'com.soywiz.kmem.extract4' call
                            tmp$ret$20 = (data >>> 0 | 0) & 15;
                            processor.ybe(tmp_17[tmp$ret$20]);
                          } else {
                            Companion_getInstance_36();
                            if (tmp1_subject === 48) {
                              var tmp$ret$21;
                              // Inline function 'com.soywiz.kmem.extract16' call
                              tmp$ret$21 = (data >>> 0 | 0) & 65535;
                              processor.xbe(tmp$ret$21, readExtra(this), readExtra(this));
                            } else {
                              Companion_getInstance_36();
                              if (tmp1_subject === 49) {
                                var tmp$ret$22;
                                // Inline function 'com.soywiz.kmem.extract16' call
                                tmp$ret$22 = (data >>> 0 | 0) & 65535;
                                var programId = tmp$ret$22;
                                processor.wbe(programId);
                                this.kay_1.pb8_1.ibe(programId);
                              } else {
                                Companion_getInstance_36();
                                if (tmp1_subject === 50) {
                                  var tmp$ret$23;
                                  // Inline function 'com.soywiz.kmem.extract16' call
                                  tmp$ret$23 = (data >>> 0 | 0) & 65535;
                                  processor.vbe(tmp$ret$23);
                                } else {
                                  Companion_getInstance_36();
                                  if (tmp1_subject === 253) {
                                    var tmp_18 = Companion_getInstance_23().uar_1;
                                    var tmp$ret$24;
                                    // Inline function 'com.soywiz.kmem.extract4' call
                                    tmp$ret$24 = (data >>> 0 | 0) & 15;
                                    var tmp_19 = tmp_18[tmp$ret$24];
                                    var tmp_20 = readInt(this);
                                    var tmp_21 = readInt(this);
                                    var tmp_22 = readInt(this);
                                    var tmp_23 = Companion_getInstance_24().var_1;
                                    var tmp$ret$25;
                                    // Inline function 'com.soywiz.kmem.extract4' call
                                    tmp$ret$25 = (data >>> 4 | 0) & 15;
                                    processor.aba(tmp_19, tmp_20, tmp_21, tmp_22, getOrNull(tmp_23, tmp$ret$25), readExtra(this));
                                  } else {
                                    Companion_getInstance_36();
                                    if (tmp1_subject === 251) {
                                      var tmp_24 = readInt(this);
                                      var tmp_25 = readInt(this);
                                      var tmp_26 = readInt(this);
                                      var tmp_27 = readInt(this);
                                      var tmp_28 = readExtra(this);
                                      var tmp_29 = Companion_getInstance_25().war_1;
                                      var tmp$ret$26;
                                      // Inline function 'com.soywiz.kmem.extract4' call
                                      tmp$ret$26 = (data >>> 0 | 0) & 15;
                                      processor.ube(tmp_24, tmp_25, tmp_26, tmp_27, tmp_28, tmp_29[tmp$ret$26]);
                                    } else {
                                      Companion_getInstance_36();
                                      if (tmp1_subject === 252) {
                                        var tmp_30 = readInt(this);
                                        var tmp_31 = readInt(this);
                                        var tmp_32 = readInt(this);
                                        var tmp_33 = readInt(this);
                                        var tmp_34 = readInt(this);
                                        var tmp_35 = Companion_getInstance_25().war_1;
                                        var tmp$ret$27;
                                        // Inline function 'com.soywiz.kmem.extract4' call
                                        tmp$ret$27 = (data >>> 0 | 0) & 15;
                                        processor.tbe(tmp_30, tmp_31, tmp_32, tmp_33, tmp_34, tmp_35[tmp$ret$27]);
                                      } else {
                                        Companion_getInstance_36();
                                        if (tmp1_subject === 80) {
                                          processor.sbe(readExtra(this), readExtra(this));
                                        } else {
                                          Companion_getInstance_36();
                                          if (tmp1_subject === 9) {
                                            var tmp$ret$29;
                                            // Inline function 'com.soywiz.kmem.extract' call
                                            var tmp$ret$28;
                                            // Inline function 'com.soywiz.kmem.extract1' call
                                            tmp$ret$28 = (data >>> 0 | 0) & 1;
                                            tmp$ret$29 = !(tmp$ret$28 === 0);
                                            processor.vao(tmp$ret$29);
                                          } else {
                                            Companion_getInstance_36();
                                            if (tmp1_subject === 10) {
                                              processor.rbe(readFloat(this), readFloat(this));
                                            } else {
                                              Companion_getInstance_36();
                                              if (tmp1_subject === 254) {
                                                readExtra(this).x1z(Unit_getInstance());
                                              } else {
                                                Companion_getInstance_36();
                                                if (tmp1_subject === 128) {
                                                  var tmp_36 = Companion_getInstance_28().zar_1;
                                                  var tmp$ret$30;
                                                  // Inline function 'com.soywiz.kmem.extract4' call
                                                  tmp$ret$30 = (data >>> 0 | 0) & 15;
                                                  var tmp_37 = tmp_36[tmp$ret$30];
                                                  var tmp$ret$31;
                                                  // Inline function 'com.soywiz.kmem.extract8' call
                                                  tmp$ret$31 = (data >>> 8 | 0) & 255;
                                                  var tmp_38 = tmp$ret$31;
                                                  var tmp$ret$32;
                                                  // Inline function 'com.soywiz.kmem.extract8' call
                                                  tmp$ret$32 = (data >>> 16 | 0) & 255;
                                                  processor.qbe(tmp_37, tmp_38, tmp$ret$32);
                                                } else {
                                                  Companion_getInstance_36();
                                                  if (tmp1_subject === 129) {
                                                    var tmp_39 = Companion_getInstance_26().xar_1;
                                                    var tmp$ret$33;
                                                    // Inline function 'com.soywiz.kmem.extract4' call
                                                    tmp$ret$33 = (data >>> 0 | 0) & 15;
                                                    var tmp_40 = tmp_39[tmp$ret$33];
                                                    var tmp_41 = Companion_getInstance_26().xar_1;
                                                    var tmp$ret$34;
                                                    // Inline function 'com.soywiz.kmem.extract4' call
                                                    tmp$ret$34 = (data >>> 4 | 0) & 15;
                                                    var tmp_42 = tmp_41[tmp$ret$34];
                                                    var tmp_43 = Companion_getInstance_26().xar_1;
                                                    var tmp$ret$35;
                                                    // Inline function 'com.soywiz.kmem.extract4' call
                                                    tmp$ret$35 = (data >>> 8 | 0) & 15;
                                                    processor.pbe(tmp_40, tmp_42, tmp_43[tmp$ret$35]);
                                                  } else {
                                                    Companion_getInstance_36();
                                                    if (tmp1_subject === 130) {
                                                      processor.yap(readInt(this));
                                                    } else {
                                                      Companion_getInstance_36();
                                                      if (tmp1_subject === 11) {
                                                        processor.vap(readInt(this), readInt(this), readInt(this), readInt(this));
                                                      } else {
                                                        Companion_getInstance_36();
                                                        if (tmp1_subject === 12) {
                                                          processor.uaq(readInt(this), readInt(this), readInt(this), readInt(this));
                                                        } else {
                                                          Companion_getInstance_36();
                                                          if (tmp1_subject === 16) {
                                                            var tmp$ret$37;
                                                            // Inline function 'com.soywiz.kmem.extract' call
                                                            var tmp$ret$36;
                                                            // Inline function 'com.soywiz.kmem.extract1' call
                                                            tmp$ret$36 = (data >>> 0 | 0) & 1;
                                                            tmp$ret$37 = !(tmp$ret$36 === 0);
                                                            var tmp_44 = tmp$ret$37;
                                                            var tmp$ret$39;
                                                            // Inline function 'com.soywiz.kmem.extract' call
                                                            var tmp$ret$38;
                                                            // Inline function 'com.soywiz.kmem.extract1' call
                                                            tmp$ret$38 = (data >>> 1 | 0) & 1;
                                                            tmp$ret$39 = !(tmp$ret$38 === 0);
                                                            var tmp_45 = tmp$ret$39;
                                                            var tmp$ret$41;
                                                            // Inline function 'com.soywiz.kmem.extract' call
                                                            var tmp$ret$40;
                                                            // Inline function 'com.soywiz.kmem.extract1' call
                                                            tmp$ret$40 = (data >>> 2 | 0) & 1;
                                                            tmp$ret$41 = !(tmp$ret$40 === 0);
                                                            processor.jba(tmp_44, tmp_45, tmp$ret$41);
                                                          } else {
                                                            Companion_getInstance_36();
                                                            if (tmp1_subject === 17) {
                                                              processor.fao(readFloat(this), readFloat(this), readFloat(this), readFloat(this));
                                                            } else {
                                                              Companion_getInstance_36();
                                                              if (tmp1_subject === 18) {
                                                                processor.iba(readFloat(this));
                                                              } else {
                                                                Companion_getInstance_36();
                                                                if (tmp1_subject === 19) {
                                                                  var tmp$ret$42;
                                                                  // Inline function 'com.soywiz.kmem.extract24' call
                                                                  tmp$ret$42 = (data >>> 0 | 0) & 16777215;
                                                                  processor.hao(tmp$ret$42);
                                                                } else {
                                                                  Companion_getInstance_36();
                                                                  if (tmp1_subject === 144) {
                                                                    var tmp$ret$43;
                                                                    // Inline function 'com.soywiz.kmem.extract16' call
                                                                    tmp$ret$43 = (data >>> 0 | 0) & 65535;
                                                                    processor.obe(tmp$ret$43);
                                                                  } else {
                                                                    Companion_getInstance_36();
                                                                    if (tmp1_subject === 145) {
                                                                      var tmp$ret$44;
                                                                      // Inline function 'com.soywiz.kmem.extract16' call
                                                                      tmp$ret$44 = (data >>> 0 | 0) & 65535;
                                                                      var id = tmp$ret$44;
                                                                      processor.bba(id);
                                                                      this.kay_1.mb8_1.ibe(id);
                                                                    } else {
                                                                      Companion_getInstance_36();
                                                                      if (tmp1_subject === 146) {
                                                                        var tmp$ret$45;
                                                                        // Inline function 'com.soywiz.kmem.extract16' call
                                                                        tmp$ret$45 = (data >>> 0 | 0) & 65535;
                                                                        processor.wb9(tmp$ret$45, _VertexArrayObject___init__impl__y6yvd1(readExtra(this)));
                                                                      } else {
                                                                        Companion_getInstance_36();
                                                                        if (tmp1_subject === 147) {
                                                                          var tmp$ret$46;
                                                                          // Inline function 'com.soywiz.kmem.extract16' call
                                                                          tmp$ret$46 = (data >>> 0 | 0) & 65535;
                                                                          processor.xb9(tmp$ret$46);
                                                                        } else {
                                                                          Companion_getInstance_36();
                                                                          if (tmp1_subject === 160) {
                                                                            var tmp$ret$47;
                                                                            // Inline function 'com.soywiz.kmem.extract16' call
                                                                            tmp$ret$47 = (data >>> 0 | 0) & 65535;
                                                                            processor.nbe(tmp$ret$47);
                                                                          } else {
                                                                            Companion_getInstance_36();
                                                                            if (tmp1_subject === 161) {
                                                                              var tmp$ret$48;
                                                                              // Inline function 'com.soywiz.kmem.extract16' call
                                                                              tmp$ret$48 = (data >>> 0 | 0) & 65535;
                                                                              var id_0 = tmp$ret$48;
                                                                              processor.mbe(id_0);
                                                                              this.kay_1.nb8_1.ibe(id_0);
                                                                            } else {
                                                                              Companion_getInstance_36();
                                                                              if (tmp1_subject === 162) {
                                                                                var ubo = readExtra(this);
                                                                                var tmp$ret$49;
                                                                                // Inline function 'com.soywiz.kmem.extract16' call
                                                                                tmp$ret$49 = (data >>> 0 | 0) & 65535;
                                                                                processor.yb9(tmp$ret$49, ubo);
                                                                                this.uay_1.u4t(ubo);
                                                                              } else {
                                                                                Companion_getInstance_36();
                                                                                if (tmp1_subject === 163) {
                                                                                  var tmp$ret$50;
                                                                                  // Inline function 'com.soywiz.kmem.extract16' call
                                                                                  tmp$ret$50 = (data >>> 0 | 0) & 65535;
                                                                                  processor.zb9(tmp$ret$50);
                                                                                } else {
                                                                                  Companion_getInstance_36();
                                                                                  if (tmp1_subject === 176) {
                                                                                    var tmp$ret$51;
                                                                                    // Inline function 'com.soywiz.kmem.extract16' call
                                                                                    tmp$ret$51 = (data >>> 0 | 0) & 65535;
                                                                                    processor.lbe(tmp$ret$51);
                                                                                  } else {
                                                                                    Companion_getInstance_36();
                                                                                    if (tmp1_subject === 177) {
                                                                                      var tmp$ret$52;
                                                                                      // Inline function 'com.soywiz.kmem.extract16' call
                                                                                      tmp$ret$52 = (data >>> 0 | 0) & 65535;
                                                                                      processor.kbe(tmp$ret$52);
                                                                                    } else {
                                                                                      Companion_getInstance_36();
                                                                                      if (tmp1_subject === 64) {
                                                                                        var tmp$ret$53;
                                                                                        // Inline function 'com.soywiz.kmem.extract16' call
                                                                                        tmp$ret$53 = (data >>> 0 | 0) & 65535;
                                                                                        processor.jbe(tmp$ret$53);
                                                                                      } else {
                                                                                        Companion_getInstance_36();
                                                                                        if (tmp1_subject === 65) {
                                                                                          var tmp$ret$54;
                                                                                          // Inline function 'com.soywiz.kmem.extract16' call
                                                                                          tmp$ret$54 = (data >>> 0 | 0) & 65535;
                                                                                          var textureId = tmp$ret$54;
                                                                                          processor.dbe(textureId);
                                                                                          this.kay_1.qb8_1.ibe(textureId);
                                                                                        } else {
                                                                                          Companion_getInstance_36();
                                                                                          if (tmp1_subject === 67) {
                                                                                            var tmp$ret$55;
                                                                                            // Inline function 'com.soywiz.kmem.extract16' call
                                                                                            tmp$ret$55 = (data >>> 0 | 0) & 65535;
                                                                                            var tmp_46 = tmp$ret$55;
                                                                                            var tmp_47 = Companion_getInstance_22().kar_1;
                                                                                            var tmp$ret$56;
                                                                                            // Inline function 'com.soywiz.kmem.extract4' call
                                                                                            tmp$ret$56 = (data >>> 16 | 0) & 15;
                                                                                            processor.cbe(tmp_46, tmp_47[tmp$ret$56], readInt(this));
                                                                                          } else {
                                                                                            Companion_getInstance_36();
                                                                                            if (tmp1_subject === 68) {
                                                                                              processor.bbe(readExtra(this));
                                                                                            } else {
                                                                                              Companion_getInstance_36();
                                                                                              if (tmp1_subject === 66) {
                                                                                                var tmp$ret$57;
                                                                                                // Inline function 'com.soywiz.kmem.extract16' call
                                                                                                tmp$ret$57 = (data >>> 0 | 0) & 65535;
                                                                                                var tmp_48 = tmp$ret$57;
                                                                                                var tmp_49 = Companion_getInstance_22().kar_1;
                                                                                                var tmp$ret$58;
                                                                                                // Inline function 'com.soywiz.kmem.extract4' call
                                                                                                tmp$ret$58 = (data >>> 16 | 0) & 15;
                                                                                                var tmp_50 = tmp_49[tmp$ret$58];
                                                                                                var tmp_51 = readInt(this);
                                                                                                var tmp_52 = readExtra(this);
                                                                                                var tmp_53 = readExtra(this);
                                                                                                var tmp$ret$60;
                                                                                                // Inline function 'com.soywiz.kmem.extract' call
                                                                                                var tmp$ret$59;
                                                                                                // Inline function 'com.soywiz.kmem.extract1' call
                                                                                                tmp$ret$59 = (data >>> 20 | 0) & 1;
                                                                                                tmp$ret$60 = !(tmp$ret$59 === 0);
                                                                                                var tmp_54 = tmp$ret$60;
                                                                                                var tmp$ret$62;
                                                                                                // Inline function 'com.soywiz.kmem.extract' call
                                                                                                var tmp$ret$61;
                                                                                                // Inline function 'com.soywiz.kmem.extract1' call
                                                                                                tmp$ret$61 = (data >>> 21 | 0) & 1;
                                                                                                tmp$ret$62 = !(tmp$ret$61 === 0);
                                                                                                processor.abe(tmp_48, tmp_50, tmp_51, tmp_52, tmp_53, tmp_54, tmp$ret$62);
                                                                                              } else {
                                                                                                Companion_getInstance_36();
                                                                                                if (tmp1_subject === 192) {
                                                                                                  var tmp$ret$63;
                                                                                                  // Inline function 'com.soywiz.kmem.extract16' call
                                                                                                  tmp$ret$63 = (data >>> 0 | 0) & 65535;
                                                                                                  processor.zbd(tmp$ret$63);
                                                                                                } else {
                                                                                                  Companion_getInstance_36();
                                                                                                  if (tmp1_subject === 193) {
                                                                                                    var tmp$ret$64;
                                                                                                    // Inline function 'com.soywiz.kmem.extract16' call
                                                                                                    tmp$ret$64 = (data >>> 0 | 0) & 65535;
                                                                                                    processor.mb4(tmp$ret$64);
                                                                                                  } else {
                                                                                                    Companion_getInstance_36();
                                                                                                    if (tmp1_subject === 194) {
                                                                                                      var tmp$ret$65;
                                                                                                      // Inline function 'com.soywiz.kmem.extract16' call
                                                                                                      tmp$ret$65 = (data >>> 0 | 0) & 65535;
                                                                                                      var tmp_55 = tmp$ret$65;
                                                                                                      var tmp_56 = readInt(this);
                                                                                                      var tmp_57 = readInt(this);
                                                                                                      var tmp_58 = readInt(this);
                                                                                                      var tmp$ret$67;
                                                                                                      // Inline function 'com.soywiz.kmem.extractBool' call
                                                                                                      var tmp$ret$66;
                                                                                                      // Inline function 'com.soywiz.kmem.extract1' call
                                                                                                      tmp$ret$66 = (data >>> 17 | 0) & 1;
                                                                                                      tmp$ret$67 = !(tmp$ret$66 === 0);
                                                                                                      var tmp_59 = tmp$ret$67;
                                                                                                      var tmp$ret$69;
                                                                                                      // Inline function 'com.soywiz.kmem.extractBool' call
                                                                                                      var tmp$ret$68;
                                                                                                      // Inline function 'com.soywiz.kmem.extract1' call
                                                                                                      tmp$ret$68 = (data >>> 18 | 0) & 1;
                                                                                                      tmp$ret$69 = !(tmp$ret$68 === 0);
                                                                                                      processor.kb4(tmp_55, tmp_56, tmp_57, tmp_58, tmp_59, tmp$ret$69);
                                                                                                    } else {
                                                                                                      Companion_getInstance_36();
                                                                                                      if (tmp1_subject === 195) {
                                                                                                        var tmp$ret$70;
                                                                                                        // Inline function 'com.soywiz.kmem.extract16' call
                                                                                                        tmp$ret$70 = (data >>> 0 | 0) & 65535;
                                                                                                        processor.lb4(tmp$ret$70);
                                                                                                      } else {
                                                                                                        var tmp1_TODO = 'Unknown AG command ' + get_hex(cmd);
                                                                                                        throw new NotImplementedError('An operation is not implemented: ' + tmp1_TODO);
                                                                                                      }
                                                                                                    }
                                                                                                  }
                                                                                                }
                                                                                              }
                                                                                            }
                                                                                          }
                                                                                        }
                                                                                      }
                                                                                    }
                                                                                  }
                                                                                }
                                                                              }
                                                                            }
                                                                          }
                                                                        }
                                                                      }
                                                                    }
                                                                  }
                                                                }
                                                              }
                                                            }
                                                          }
                                                        }
                                                      }
                                                    }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    return false;
  };
  AGList.prototype.fbf = function (kind) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    return tmp.m4o(finsert4(CMD(tmp_0, 1), kind.q2_1, 0));
  };
  AGList.prototype.gbf = function (kind) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    return tmp.m4o(finsert4(CMD(tmp_0, 2), kind.q2_1, 0));
  };
  AGList.prototype.hbf = function (deferred) {
    this.say_1.ibf(deferred);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 254));
  };
  AGList.prototype.lb7 = function ($cont) {
    var deferred = CompletableDeferred$default(null, 1, null);
    this.hbf(deferred);
    return deferred.y1w($cont);
  };
  AGList.prototype.jbf = function (kind, enable, block) {
    if (enable) {
      this.fbf(kind);
      block();
    } else {
      this.gbf(kind);
    }
  };
  AGList.prototype.kbf = function () {
    writeListFlush(this);
  };
  AGList.prototype.vb8 = function () {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 250));
  };
  AGList.prototype.iao = function (red, green, blue, alpha) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert(finsert(finsert(finsert(CMD(tmp_0, 3), red, 0), green, 1), blue, 2), alpha, 3));
  };
  AGList.prototype.vao = function (depth) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert(CMD(tmp_0, 9), depth, 0));
  };
  AGList.prototype.fao = function (red, green, blue, alpha) {
    this.say_1.lbf(red, green, blue, alpha);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 17));
  };
  AGList.prototype.iba = function (depth) {
    this.say_1.mbf(depth);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 18));
  };
  AGList.prototype.hao = function (stencil) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert24(CMD(tmp_0, 19), stencil, 0));
  };
  AGList.prototype.jba = function (color, depth, stencil) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert(finsert(finsert(CMD(tmp_0, 16), color, 0), depth, 1), stencil, 2));
  };
  AGList.prototype.rbe = function (near, far) {
    this.say_1.nbf(near, far);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 10));
  };
  AGList.prototype.bbf = function (rgb, a) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert4(finsert4(CMD(tmp_0, 4), rgb.q2_1, 0), a.q2_1, 4));
  };
  AGList.prototype.abf = function (srcRgb, dstRgb, srcA, dstA) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert4(finsert4(finsert4(finsert4(CMD(tmp_0, 5), srcRgb.q2_1, 0), dstRgb.q2_1, 4), srcA.q2_1, 8), dstA.q2_1, 12));
  };
  AGList.prototype.zbe = function (face) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert4(CMD(tmp_0, 6), face.q2_1, 0));
  };
  AGList.prototype.ybe = function (face) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert4(CMD(tmp_0, 7), face.q2_1, 0));
  };
  AGList.prototype.vap = function (x, y, width, height) {
    this.say_1.obf(x, y, width, height);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 11));
  };
  AGList.prototype.uaq = function (x, y, width, height) {
    this.say_1.obf(x, y, width, height);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 12));
  };
  AGList.prototype.a2z = function () {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 255));
    this.kbf();
  };
  AGList.prototype.ebf = function (depthTest) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert4(CMD(tmp_0, 8), depthTest.q2_1, 0));
  };
  AGList.prototype.vb5 = function (program, programConfig) {
    var programId = this.kay_1.pb8_1.t4t();
    this.say_1.ibf(program);
    this.say_1.ibf(programConfig);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 48), programId, 0));
    return programId;
  };
  AGList.prototype.saq = function (programId) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 50), programId, 0));
  };
  AGList.prototype.pbf = function (program) {
    program.ub5(this);
    this.saq(program.ob5_1);
  };
  AGList.prototype.vay = function () {
    var textureId = this.kay_1.qb8_1.t4t();
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 64), textureId, 0));
    return textureId;
  };
  AGList.prototype.jaz = function (textureId) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 65), textureId, 0));
  };
  AGList.prototype.aba = function (type, vertexCount, offset, instances, indexType, indices) {
    this.say_1.qbf(vertexCount, offset, instances);
    this.say_1.ibf(indices);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    var tmp_1 = finsert4(CMD(tmp_0, 253), type.q2_1, 0);
    var tmp0_safe_receiver = indexType;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q2_1;
    tmp.m4o(finsert4(tmp_1, tmp1_elvis_lhs == null ? 15 : tmp1_elvis_lhs, 4));
  };
  AGList.prototype.rbf = function (type, vertexCount, offset, instances, indexType, indices, $mask0, $handler) {
    if (!(($mask0 & 4) === 0))
      offset = 0;
    if (!(($mask0 & 8) === 0))
      instances = 1;
    if (!(($mask0 & 16) === 0))
      indexType = null;
    if (!(($mask0 & 32) === 0))
      indices = null;
    return this.aba(type, vertexCount, offset, instances, indexType, indices);
  };
  AGList.prototype.qbe = function (compareMode, referenceValue, readMask) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert8(finsert8(finsert4(CMD(tmp_0, 128), compareMode.q2_1, 0), referenceValue, 8), readMask, 16));
  };
  AGList.prototype.pbe = function (actionOnDepthFail, actionOnDepthPassStencilFail, actionOnBothPass) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert8(finsert4(finsert4(CMD(tmp_0, 129), actionOnDepthFail.q2_1, 0), actionOnDepthPassStencilFail.q2_1, 4), actionOnBothPass.q2_1, 8));
  };
  AGList.prototype.yap = function (writeMask) {
    this.say_1.sbf(writeMask);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(CMD(tmp_0, 130));
  };
  AGList.prototype.vb9 = function () {
    var id = this.kay_1.mb8_1.t4t();
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 144), id, 0));
    return id;
  };
  AGList.prototype.bba = function (id) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 145), id, 0));
  };
  AGList.prototype.wb9 = function (id, vao) {
    this.say_1.ibf(_VertexArrayObject___get_list__impl__xj772i(vao));
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 146), id, 0));
  };
  AGList.prototype.xb9 = function (id) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 147), id, 0));
  };
  AGList.prototype.vbd = function () {
    var id = this.kay_1.nb8_1.t4t();
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 160), id, 0));
    return id;
  };
  AGList.prototype.mbe = function (id) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 161), id, 0));
  };
  AGList.prototype.yb9 = function (id, ubo) {
    var uboCopy = this.uay_1.t4t();
    uboCopy.rb6(ubo);
    this.say_1.ibf(uboCopy);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 162), id, 0));
  };
  AGList.prototype.zb9 = function (id) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 163), id, 0));
  };
  AGList.prototype.qaz = function () {
    var id = this.kay_1.ob8_1.t4t();
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 176), id, 0));
    return id;
  };
  AGList.prototype.jb4 = function () {
    var id = this.kay_1.rb8_1.t4t();
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 192), id, 0));
    return id;
  };
  AGList.prototype.mb4 = function (id) {
    this.kay_1.nb8_1.ibe(id);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 193), id, 0));
  };
  AGList.prototype.kb4 = function (id, textureId, width, height, hasStencil, hasDepth) {
    this.say_1.qbf(textureId, width, height);
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert(finsert(finsert16(CMD(tmp_0, 194), id, 0), hasStencil, 17), hasDepth, 18));
  };
  AGList.prototype.lb4 = function (id) {
    var tmp = this.say_1;
    var tmp_0 = Companion_getInstance_36();
    Companion_getInstance_36();
    tmp.m4o(finsert16(CMD(tmp_0, 195), id, 0));
  };
  AGList.$metadata$ = classMeta('AGList');
  function AGGlobalState(checked) {
    this.ib8_1 = checked;
    this.jb8_1 = 0;
    this.kb8_1 = new Long(-1, -1);
    this.lb8_1 = null;
    this.mb8_1 = new AGManagedObjectPool('vao', this.ib8_1);
    this.nb8_1 = new AGManagedObjectPool('ubo', this.ib8_1);
    this.ob8_1 = new AGManagedObjectPool('buffer', this.ib8_1);
    this.pb8_1 = new AGManagedObjectPool('program', this.ib8_1);
    this.qb8_1 = new AGManagedObjectPool('texture', this.ib8_1);
    this.rb8_1 = new AGManagedObjectPool('frame', this.ib8_1);
    this.sb8_1 = new NonRecursiveLock();
    this.tb8_1 = TGenDeque_init_$Create$();
  }
  AGGlobalState.prototype.ub8 = function () {
    return new AGList(this);
  };
  AGGlobalState.$metadata$ = classMeta('AGGlobalState');
  function AGListData() {
    this.hbb_1 = new IntDeque(128);
    this.ibb_1 = new IntDeque(16);
    this.jbb_1 = new FloatDeque(16);
    this.kbb_1 = new TGenDeque(16);
  }
  AGListData.prototype.p = function () {
    return this.hbb_1.p();
  };
  AGListData.prototype.x7 = function () {
    this.hbb_1.x7();
    this.ibb_1.x7();
    this.jbb_1.x7();
    this.kbb_1.x7();
  };
  AGListData.prototype.ibf = function (v0) {
    this.kbb_1.h4q(v0);
  };
  AGListData.prototype.mbf = function (v0) {
    this.jbb_1.x4q(v0);
  };
  AGListData.prototype.nbf = function (v0, v1) {
    this.jbb_1.x4q(v0);
    this.jbb_1.x4q(v1);
  };
  AGListData.prototype.lbf = function (v0, v1, v2, v3) {
    this.jbb_1.x4q(v0);
    this.jbb_1.x4q(v1);
    this.jbb_1.x4q(v2);
    this.jbb_1.x4q(v3);
  };
  AGListData.prototype.sbf = function (v0) {
    this.ibb_1.u4p(v0);
  };
  AGListData.prototype.qbf = function (v0, v1, v2) {
    this.ibb_1.u4p(v0);
    this.ibb_1.u4p(v1);
    this.ibb_1.u4p(v2);
  };
  AGListData.prototype.obf = function (v0, v1, v2, v3) {
    this.ibb_1.u4p(v0);
    this.ibb_1.u4p(v1);
    this.ibb_1.u4p(v2);
    this.ibb_1.u4p(v3);
  };
  AGListData.prototype.m4o = function (v0) {
    this.hbb_1.u4p(v0);
  };
  AGListData.prototype.lbb = function () {
    var tmp$ret$2;
    // Inline function 'com.soywiz.kds.fastCastTo' call
    var tmp0_fastCastTo = this.kbb_1.s4p();
    var tmp$ret$1;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_fastCastTo;
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return tmp$ret$2;
  };
  AGListData.prototype.mbb = function () {
    return this.jbb_1.s4p();
  };
  AGListData.prototype.nbb = function () {
    return this.ibb_1.s4p();
  };
  AGListData.prototype.g1c = function () {
    return this.hbb_1.s4p();
  };
  AGListData.$metadata$ = classMeta('AGListData');
  var AGEnable_BLEND_instance;
  var AGEnable_CULL_FACE_instance;
  var AGEnable_DEPTH_instance;
  var AGEnable_SCISSOR_instance;
  var AGEnable_STENCIL_instance;
  function Companion_22() {
    Companion_instance_22 = this;
    this.cbf_1 = values_10();
  }
  Companion_22.$metadata$ = objectMeta('Companion');
  var Companion_instance_22;
  function Companion_getInstance_37() {
    AGEnable_initEntries();
    if (Companion_instance_22 == null)
      new Companion_22();
    return Companion_instance_22;
  }
  function values_10() {
    return [AGEnable_BLEND_getInstance(), AGEnable_CULL_FACE_getInstance(), AGEnable_DEPTH_getInstance(), AGEnable_SCISSOR_getInstance(), AGEnable_STENCIL_getInstance()];
  }
  var AGEnable_entriesInitialized;
  function AGEnable_initEntries() {
    if (AGEnable_entriesInitialized)
      return Unit_getInstance();
    AGEnable_entriesInitialized = true;
    AGEnable_BLEND_instance = new AGEnable('BLEND', 0);
    AGEnable_CULL_FACE_instance = new AGEnable('CULL_FACE', 1);
    AGEnable_DEPTH_instance = new AGEnable('DEPTH', 2);
    AGEnable_SCISSOR_instance = new AGEnable('SCISSOR', 3);
    AGEnable_STENCIL_instance = new AGEnable('STENCIL', 4);
    Companion_getInstance_37();
  }
  function AGEnable(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  AGEnable.$metadata$ = classMeta('AGEnable', undefined, undefined, undefined, undefined, Enum.prototype);
  function AGManagedObjectPool$pool$lambda(it) {
    return it + 1 | 0;
  }
  function AGManagedObjectPool(name, checked) {
    this.ebe_1 = name;
    this.fbe_1 = checked;
    var tmp = this;
    tmp.gbe_1 = ConcurrentPool_init_$Create$(null, 0, AGManagedObjectPool$pool$lambda, 3, null);
    this.hbe_1 = new IntSet();
  }
  AGManagedObjectPool.prototype.tbf = function () {
    return this.fbe_1;
  };
  AGManagedObjectPool.prototype.t4t = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = this.gbe_1.t4t();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.AGManagedObjectPool.alloc.<anonymous>' call
    if (this.fbe_1) {
      this.hbe_1.u4p(tmp0_also);
    }
    tmp$ret$0 = tmp0_also;
    return tmp$ret$0;
  };
  AGManagedObjectPool.prototype.ibe = function (value) {
    if (this.fbe_1) {
      if (!this.hbe_1.v9(value)) {
        // Inline function 'kotlin.error' call
        var tmp0_error = 'Not allocated ' + value + ' in ' + this.ebe_1;
        throw IllegalStateException_init_$Create$(toString_0(tmp0_error));
      }
      this.hbe_1.v4p(value);
    }
    this.gbe_1.u4t(value);
  };
  AGManagedObjectPool.$metadata$ = classMeta('AGManagedObjectPool');
  function processBlockingAll(_this__u8e3s4, list) {
    var tmp$ret$1;
    // Inline function 'kotlin.with' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.processBlocking.<anonymous>' call
    tmp$ret$0 = list.xbd(_this__u8e3s4, -1);
    tmp$ret$1 = tmp$ret$0;
    return Unit_getInstance();
  }
  function AGEnable_BLEND_getInstance() {
    AGEnable_initEntries();
    return AGEnable_BLEND_instance;
  }
  function AGEnable_CULL_FACE_getInstance() {
    AGEnable_initEntries();
    return AGEnable_CULL_FACE_instance;
  }
  function AGEnable_DEPTH_getInstance() {
    AGEnable_initEntries();
    return AGEnable_DEPTH_instance;
  }
  function AGEnable_SCISSOR_getInstance() {
    AGEnable_initEntries();
    return AGEnable_SCISSOR_instance;
  }
  function AGEnable_STENCIL_getInstance() {
    AGEnable_initEntries();
    return AGEnable_STENCIL_instance;
  }
  function contextVersion$factory_2($b0) {
    return getPropertyCallableRef('contextVersion', 0, KMutableProperty0, function () {
      return $b0.jb8_1;
    }, function (value) {
      $b0.jb8_1 = value;
      return Unit_getInstance();
    });
  }
  function disableScissor(_this__u8e3s4) {
    return _this__u8e3s4.gbf(AGEnable_SCISSOR_getInstance());
  }
  function useProgram(_this__u8e3s4, ag, program) {
    _this__u8e3s4.pbf(ag.zba(program, null, 2, null));
  }
  function vertexArrayObjectSet(_this__u8e3s4, vao, block) {
    var vaoId = _this__u8e3s4.vb9();
    try {
      _this__u8e3s4.wb9(vaoId, vao);
      _this__u8e3s4.xb9(vaoId);
      block();
    }finally {
      _this__u8e3s4.xb9(0);
      _this__u8e3s4.bba(vaoId);
    }
  }
  function uniformsSet(_this__u8e3s4, uniforms, block) {
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.Pool.alloc' call
      var tmp0_alloc = _this__u8e3s4.tay_1;
      var temp = tmp0_alloc.t4t();
      try {
        var tmp0_elvis_lhs = uniforms;
        _this__u8e3s4.yb9(temp, tmp0_elvis_lhs == null ? new UniformValues() : tmp0_elvis_lhs);
        _this__u8e3s4.zb9(temp);
        tmp$ret$0 = block();
        break $l$block;
      }finally {
        tmp0_alloc.u4t(temp);
      }
    }
  }
  function setScissorState(_this__u8e3s4, ag, scissor) {
    return setScissorState_0(_this__u8e3s4, ag.xax_1, ag.cb9(), scissor);
  }
  function setStencilState(_this__u8e3s4, stencil) {
    if (!(stencil == null) ? stencil.rb0_1 : false) {
      _this__u8e3s4.fbf(AGEnable_STENCIL_getInstance());
      _this__u8e3s4.qbe(stencil.tb0_1, stencil.xb0_1, stencil.yb0_1);
      _this__u8e3s4.pbe(stencil.vb0_1, stencil.wb0_1, stencil.ub0_1);
      _this__u8e3s4.yap(stencil.zb0_1);
    } else {
      _this__u8e3s4.gbf(AGEnable_STENCIL_getInstance());
      _this__u8e3s4.yap(0);
    }
  }
  function setColorMaskState(_this__u8e3s4, colorMask) {
    var tmp0_safe_receiver = colorMask;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fb0_1;
    var tmp = tmp1_elvis_lhs == null ? true : tmp1_elvis_lhs;
    var tmp2_safe_receiver = colorMask;
    var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.gb0_1;
    var tmp_0 = tmp3_elvis_lhs == null ? true : tmp3_elvis_lhs;
    var tmp4_safe_receiver = colorMask;
    var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.hb0_1;
    var tmp_1 = tmp5_elvis_lhs == null ? true : tmp5_elvis_lhs;
    var tmp6_safe_receiver = colorMask;
    var tmp7_elvis_lhs = tmp6_safe_receiver == null ? null : tmp6_safe_receiver.ib0_1;
    _this__u8e3s4.iao(tmp, tmp_0, tmp_1, tmp7_elvis_lhs == null ? true : tmp7_elvis_lhs);
  }
  function setBlendingState(_this__u8e3s4, blending) {
    var tmp0_elvis_lhs = blending;
    var blending_0 = tmp0_elvis_lhs == null ? Companion_getInstance_19().ear_1 : tmp0_elvis_lhs;
    // Inline function 'com.soywiz.korag.AGList.enableDisable' call
    var tmp0_enableDisable = AGEnable_BLEND_getInstance();
    var tmp1_enableDisable = blending_0.lav_1;
    if (tmp1_enableDisable) {
      _this__u8e3s4.fbf(tmp0_enableDisable);
      // Inline function 'com.soywiz.korag.setBlendingState.<anonymous>' call
      _this__u8e3s4.bbf(blending_0.iav_1, blending_0.jav_1);
      _this__u8e3s4.abf(blending_0.eav_1, blending_0.fav_1, blending_0.gav_1, blending_0.hav_1);
    } else {
      _this__u8e3s4.gbf(tmp0_enableDisable);
    }
  }
  function enableCullFace(_this__u8e3s4) {
    return _this__u8e3s4.fbf(AGEnable_CULL_FACE_getInstance());
  }
  function disableCullFace(_this__u8e3s4) {
    return _this__u8e3s4.gbf(AGEnable_CULL_FACE_getInstance());
  }
  function setState(_this__u8e3s4, blending, stencil, colorMask, renderState) {
    setBlendingState(_this__u8e3s4, blending);
    setRenderState(_this__u8e3s4, renderState);
    setColorMaskState(_this__u8e3s4, colorMask);
    setStencilState(_this__u8e3s4, stencil);
  }
  function setScissorState_0(_this__u8e3s4, currentRenderBuffer, mainRenderBuffer, scissor) {
    if (currentRenderBuffer == null)
      return Unit_getInstance();
    var finalScissorBL = _this__u8e3s4.may_1;
    var realBackWidth = mainRenderBuffer.vb1();
    var realBackHeight = mainRenderBuffer.wb1();
    if (currentRenderBuffer === mainRenderBuffer) {
      var realScissors = finalScissorBL;
      var tmp0_safe_receiver = realScissors;
      if (tmp0_safe_receiver == null)
        null;
      else
        tmp0_safe_receiver.u72(0.0, 0.0, realBackWidth, realBackHeight);
      if (!(scissor == null)) {
        _this__u8e3s4.may_1.u72(currentRenderBuffer.d1n() + scissor.d1n(), (currentRenderBuffer.e1n() + currentRenderBuffer.e72() | 0) - (scissor.e1n() + scissor.e72()), scissor.d72(), scissor.e72());
        var tmp1_safe_receiver = realScissors;
        realScissors = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.z7c(_this__u8e3s4.may_1, realScissors);
      }
      var renderBufferScissor = currentRenderBuffer.xb1();
      var tmp = renderBufferScissor;
      if (!((tmp == null ? null : new RectangleInt(tmp)) == null)) {
        var tmp2_safe_receiver = realScissors;
        realScissors = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.z7c(_RectangleInt___get_rect__impl__gu7bbg(renderBufferScissor), realScissors);
      }
      _this__u8e3s4.fbf(AGEnable_SCISSOR_getInstance());
      if (!(realScissors == null)) {
        _this__u8e3s4.vap(numberToInt(realScissors.v71_1), numberToInt(realScissors.w71_1), numberToInt(realScissors.x71_1), numberToInt(realScissors.y71_1));
      } else {
        _this__u8e3s4.vap(0, 0, 0, 0);
      }
    } else {
      // Inline function 'com.soywiz.korag.AGList.enableDisable' call
      var tmp0_enableDisable = AGEnable_SCISSOR_getInstance();
      var tmp1_enableDisable = !(scissor == null);
      if (tmp1_enableDisable) {
        _this__u8e3s4.fbf(tmp0_enableDisable);
        // Inline function 'com.soywiz.korag.setScissorState.<anonymous>' call
        _this__u8e3s4.vap(toIntRound(ensureNotNull(scissor).d1n()), toIntRound(scissor.e1n()), toIntRound(scissor.d72()), toIntRound(scissor.e72()));
      } else {
        _this__u8e3s4.gbf(tmp0_enableDisable);
      }
    }
  }
  function setRenderState(_this__u8e3s4, renderState) {
    // Inline function 'com.soywiz.korag.AGList.enableDisable' call
    var tmp0_enableDisable = AGEnable_CULL_FACE_getInstance();
    var tmp1_enableDisable = !renderState.ob0_1.equals(FrontFace_BOTH_getInstance());
    if (tmp1_enableDisable) {
      _this__u8e3s4.fbf(tmp0_enableDisable);
      // Inline function 'com.soywiz.korag.setRenderState.<anonymous>' call
      _this__u8e3s4.ybe(renderState.ob0_1);
    } else {
      _this__u8e3s4.gbf(tmp0_enableDisable);
    }
    _this__u8e3s4.vao(renderState.kb0_1);
    _this__u8e3s4.rbe(renderState.lb0_1, renderState.mb0_1);
    // Inline function 'com.soywiz.korag.AGList.enableDisable' call
    var tmp2_enableDisable = AGEnable_DEPTH_getInstance();
    var tmp3_enableDisable = !renderState.jb0_1.equals(CompareMode_ALWAYS_getInstance());
    if (tmp3_enableDisable) {
      _this__u8e3s4.fbf(tmp2_enableDisable);
      // Inline function 'com.soywiz.korag.setRenderState.<anonymous>' call
      _this__u8e3s4.ebf(renderState.jb0_1);
    } else {
      _this__u8e3s4.gbf(tmp2_enableDisable);
    }
  }
  function AGQueueProcessor() {
  }
  AGQueueProcessor.$metadata$ = interfaceMeta('AGQueueProcessor');
  function DefaultShaders() {
    DefaultShaders_instance = this;
    var tmp = this;
    var tmp_0 = VarType_Sampler2D_getInstance();
    tmp.gas_1 = Uniform_init_$Create$('u_Tex', tmp_0, null, 4, null);
    var tmp_1 = this;
    var tmp_2 = VarType_Sampler2D_getInstance();
    tmp_1.has_1 = Uniform_init_$Create$('u_Tex2', tmp_2, null, 4, null);
    var tmp_3 = this;
    var tmp_4 = VarType_Mat4_getInstance();
    tmp_3.ias_1 = Uniform_init_$Create$('u_ProjMat', tmp_4, null, 4, null);
    var tmp_5 = this;
    var tmp_6 = VarType_Mat4_getInstance();
    tmp_5.jas_1 = Uniform_init_$Create$('u_ViewMat', tmp_6, null, 4, null);
    this.kas_1 = Attribute_init_$Create$('a_Pos', VarType_Float2_getInstance(), false, Precision_HIGH_getInstance());
    this.las_1 = Attribute_init_$Create$('a_Tex', VarType_Float2_getInstance(), false, Precision_MEDIUM_getInstance());
    this.mas_1 = Attribute_init_$Create$('a_Col', VarType_Byte4_getInstance(), true, Precision_LOW_getInstance());
    this.nas_1 = Varying_init_$Create$('v_Tex', VarType_Float2_getInstance(), Precision_MEDIUM_getInstance());
    var tmp_7 = this;
    var tmp_8 = VarType_Byte4_getInstance();
    tmp_7.oas_1 = Varying_init_$Create$_0('v_Col', tmp_8, null, 4, null);
    var tmp_9 = this;
    var tmp_10 = VarType_Float4_getInstance();
    tmp_9.pas_1 = Temp_init_$Create$_0(0, tmp_10, null, 4, null);
    var tmp_11 = this;
    var tmp_12 = VarType_Float4_getInstance();
    tmp_11.qas_1 = Temp_init_$Create$_0(1, tmp_12, null, 4, null);
    var tmp_13 = this;
    var tmp_14 = VarType_Mat2_getInstance();
    tmp_13.ras_1 = Temp_init_$Create$_0(2, tmp_14, null, 4, null);
    var tmp_15 = this;
    tmp_15.sas_1 = TextureUnit_init_$Create$(null, false, null, 7, null);
    this.tas_1 = ProgramLayout_init_$Create$([this.kas_1, this.las_1, this.mas_1]);
    var tmp_16 = this;
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.VertexShader' call
    var builder = Builder_init_$Create$_0(ShaderType_VERTEX_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.VERTEX_DEFAULT.<anonymous>' call
    builder.fb5(DefaultShaders_getInstance().nas_1, DefaultShaders_getInstance().las_1);
    builder.fb5(DefaultShaders_getInstance().oas_1, DefaultShaders_getInstance().mas_1);
    builder.fb5(builder.l6t(), builder.ubf(builder.ubf(DefaultShaders_getInstance().ias_1, DefaultShaders_getInstance().jas_1), builder.hb5([DefaultShaders_getInstance().kas_1, builder.gb5(0.0), builder.gb5(1.0)])));
    tmp$ret$0 = VertexShader_0(builder.ib5());
    tmp_16.uas_1 = tmp$ret$0;
    var tmp_17 = this;
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_0 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.FRAGMENT_DEBUG.<anonymous>' call
    builder_0.fb5(builder_0.l6t(), builder_0.hb5([builder_0.gb5(1.0), builder_0.gb5(1.0), builder_0.gb5(0.0), builder_0.gb5(1.0)]));
    tmp$ret$1 = FragmentShader_0(builder_0.ib5());
    tmp_17.vas_1 = tmp$ret$1;
    var tmp_18 = this;
    var tmp$ret$2;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_1 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.FRAGMENT_SOLID_COLOR.<anonymous>' call
    builder_1.fb5(builder_1.l6t(), DefaultShaders_getInstance().oas_1);
    tmp$ret$2 = FragmentShader_0(builder_1.ib5());
    tmp_18.was_1 = tmp$ret$2;
    var tmp_19 = this;
    var tmp$ret$3;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_2 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.PROGRAM_TINTED_TEXTURE.<anonymous>' call
    builder_2.fb5(builder_2.l6t(), builder_2.ubf(builder_2.jb5(builder_2.kb5(DefaultShaders_getInstance().gas_1, builder_2.jb5(DefaultShaders_getInstance().nas_1, 'xy')), 'rgba'), DefaultShaders_getInstance().oas_1));
    tmp$ret$3 = FragmentShader_0(builder_2.ib5());
    tmp_19.xas_1 = new Program(this.uas_1, tmp$ret$3, 'PROGRAM_TINTED_TEXTURE');
    var tmp_20 = this;
    var tmp$ret$4;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_3 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.PROGRAM_TINTED_TEXTURE_PREMULT.<anonymous>' call
    builder_3.fb5(DefaultShaders_getInstance().pas_1, builder_3.kb5(DefaultShaders_getInstance().gas_1, builder_3.jb5(DefaultShaders_getInstance().nas_1, 'xy')));
    builder_3.fb5(builder_3.jb5(DefaultShaders_getInstance().pas_1, 'rgb'), builder_3.vbf(builder_3.jb5(DefaultShaders_getInstance().pas_1, 'rgb'), builder_3.jb5(DefaultShaders_getInstance().pas_1, 'a')));
    builder_3.fb5(builder_3.l6t(), builder_3.ubf(builder_3.jb5(DefaultShaders_getInstance().pas_1, 'rgba'), DefaultShaders_getInstance().oas_1));
    tmp$ret$4 = FragmentShader_0(builder_3.ib5());
    tmp_20.yas_1 = new Program(this.uas_1, tmp$ret$4, 'PROGRAM_TINTED_TEXTURE');
    this.zas_1 = new Program(this.uas_1, this.was_1, 'PROGRAM_SOLID_COLOR');
    this.aat_1 = ProgramLayout_init_$Create$([this.kas_1]);
    var tmp_21 = this;
    var tmp$ret$5;
    // Inline function 'com.soywiz.korag.shader.VertexShader' call
    var builder_4 = Builder_init_$Create$_0(ShaderType_VERTEX_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.PROGRAM_DEBUG.<anonymous>' call
    builder_4.fb5(builder_4.l6t(), builder_4.hb5([DefaultShaders_getInstance().kas_1, builder_4.gb5(0.0), builder_4.gb5(1.0)]));
    tmp$ret$5 = VertexShader_0(builder_4.ib5());
    var tmp_22 = tmp$ret$5;
    var tmp$ret$6;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_5 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.PROGRAM_DEBUG.<anonymous>' call
    builder_5.fb5(builder_5.l6t(), builder_5.hb5([builder_5.gb5(1.0), builder_5.gb5(0.0), builder_5.gb5(0.0), builder_5.gb5(1.0)]));
    tmp$ret$6 = FragmentShader_0(builder_5.ib5());
    tmp_21.bat_1 = new Program(tmp_22, tmp$ret$6, 'PROGRAM_DEBUG');
    var tmp_23 = this;
    var tmp$ret$7;
    // Inline function 'com.soywiz.korag.shader.VertexShader' call
    var builder_6 = Builder_init_$Create$_0(ShaderType_VERTEX_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.PROGRAM_DEBUG_WITH_PROJ.<anonymous>' call
    builder_6.fb5(builder_6.l6t(), builder_6.ubf(builder_6.ubf(DefaultShaders_getInstance().ias_1, DefaultShaders_getInstance().jas_1), builder_6.hb5([DefaultShaders_getInstance().kas_1, builder_6.gb5(0.0), builder_6.gb5(1.0)])));
    tmp$ret$7 = VertexShader_0(builder_6.ib5());
    var tmp_24 = tmp$ret$7;
    var tmp$ret$8;
    // Inline function 'com.soywiz.korag.shader.FragmentShader' call
    var builder_7 = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    // Inline function 'com.soywiz.korag.DefaultShaders.PROGRAM_DEBUG_WITH_PROJ.<anonymous>' call
    builder_7.fb5(builder_7.l6t(), builder_7.hb5([builder_7.gb5(1.0), builder_7.gb5(0.0), builder_7.gb5(0.0), builder_7.gb5(1.0)]));
    tmp$ret$8 = FragmentShader_0(builder_7.ib5());
    tmp_23.cat_1 = new Program(tmp_24, tmp$ret$8, 'PROGRAM_DEBUG_WITH_PROJ');
  }
  DefaultShaders.prototype.wbf = function () {
    return this.gas_1;
  };
  DefaultShaders.prototype.xbf = function () {
    return this.ias_1;
  };
  DefaultShaders.prototype.ybf = function () {
    return this.jas_1;
  };
  DefaultShaders.prototype.zbf = function () {
    return this.kas_1;
  };
  DefaultShaders.prototype.abg = function () {
    return this.las_1;
  };
  DefaultShaders.prototype.bbg = function () {
    return this.mas_1;
  };
  DefaultShaders.prototype.cbg = function () {
    return this.nas_1;
  };
  DefaultShaders.prototype.dbg = function () {
    return this.oas_1;
  };
  DefaultShaders.prototype.ebg = function () {
    return this.pas_1;
  };
  DefaultShaders.prototype.fbg = function () {
    return this.aat_1;
  };
  DefaultShaders.prototype.gbg = function (callback) {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    callback(this);
    tmp$ret$0 = this;
    return tmp$ret$0;
  };
  DefaultShaders.$metadata$ = objectMeta('DefaultShaders');
  var DefaultShaders_instance;
  function DefaultShaders_getInstance() {
    if (DefaultShaders_instance == null)
      new DefaultShaders();
    return DefaultShaders_instance;
  }
  function VertexShaderDefault(callback) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = new ProgramBuilderDefault();
    // Inline function 'kotlin.contracts.contract' call
    callback(tmp0_also);
    tmp$ret$0 = tmp0_also;
    return VertexShader_0(tmp$ret$0.ib5());
  }
  function ProgramBuilderDefault() {
    Builder_init_$Init$(null, 1, null, this);
  }
  ProgramBuilderDefault.$metadata$ = classMeta('ProgramBuilderDefault', [IDefaultShaders], undefined, undefined, undefined, Builder.prototype);
  function FragmentShaderDefault(callback) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = new ProgramBuilderDefault();
    // Inline function 'kotlin.contracts.contract' call
    callback(tmp0_also);
    tmp$ret$0 = tmp0_also;
    return FragmentShader_0(tmp$ret$0.ib5());
  }
  function IDefaultShaders() {
  }
  IDefaultShaders.$metadata$ = interfaceMeta('IDefaultShaders');
  function get_versionString(_this__u8e3s4) {
    init_properties_AGOpengl_kt_a4gmd();
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.PropertyThis.getValue' call
      var tmp0_getValue = versionString$factory();
      var tmp0_elvis_lhs = versionString$delegate.k4v_1;
      var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
      if (res == null) {
        var r = versionString$delegate.l4v_1(_this__u8e3s4);
        // Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
        var tmp0_elvis_lhs_0 = versionString$delegate.k4v_1;
        setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
        tmp$ret$0 = r;
        break $l$block;
      }
      tmp$ret$0 = res;
    }
    return tmp$ret$0;
  }
  var versionString$delegate;
  function get_versionInt(_this__u8e3s4) {
    init_properties_AGOpengl_kt_a4gmd();
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.PropertyThis.getValue' call
      var tmp0_getValue = versionInt$factory();
      var tmp0_elvis_lhs = versionInt$delegate.k4v_1;
      var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
      if (res == null) {
        var r = versionInt$delegate.l4v_1(_this__u8e3s4);
        // Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
        var tmp0_elvis_lhs_0 = versionInt$delegate.k4v_1;
        setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
        tmp$ret$0 = r;
        break $l$block;
      }
      tmp$ret$0 = res;
    }
    return tmp$ret$0;
  }
  var versionInt$delegate;
  function AGOpengl$createMainRenderBuffer$o$init$slambda(this$0, resultContinuation) {
    this.xbh_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AGOpengl$createMainRenderBuffer$o$init$slambda.prototype.h2n = function ($this$runBlockingNoJs, $cont) {
    var tmp = this.i2n($this$runBlockingNoJs, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AGOpengl$createMainRenderBuffer$o$init$slambda.prototype.w7 = function (p1, $cont) {
    return this.h2n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
  };
  AGOpengl$createMainRenderBuffer$o$init$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.xbh_1.hay_1.lb7(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AGOpengl$createMainRenderBuffer$o$init$slambda.prototype.i2n = function ($this$runBlockingNoJs, completion) {
    var i = new AGOpengl$createMainRenderBuffer$o$init$slambda(this.xbh_1, completion);
    i.ybh_1 = $this$runBlockingNoJs;
    return i;
  };
  AGOpengl$createMainRenderBuffer$o$init$slambda.$metadata$ = classMeta('AGOpengl$createMainRenderBuffer$o$init$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AGOpengl$createMainRenderBuffer$o$init$slambda_0(this$0, resultContinuation) {
    var i = new AGOpengl$createMainRenderBuffer$o$init$slambda(this$0, resultContinuation);
    var l = function ($this$runBlockingNoJs, $cont) {
      return i.h2n($this$runBlockingNoJs, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function AGOpengl$createMainRenderBuffer$o$set$slambda(this$0, resultContinuation) {
    this.hbi_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AGOpengl$createMainRenderBuffer$o$set$slambda.prototype.h2n = function ($this$runBlockingNoJs, $cont) {
    var tmp = this.i2n($this$runBlockingNoJs, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AGOpengl$createMainRenderBuffer$o$set$slambda.prototype.w7 = function (p1, $cont) {
    return this.h2n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
  };
  AGOpengl$createMainRenderBuffer$o$set$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.hbi_1.hay_1.lb7(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AGOpengl$createMainRenderBuffer$o$set$slambda.prototype.i2n = function ($this$runBlockingNoJs, completion) {
    var i = new AGOpengl$createMainRenderBuffer$o$set$slambda(this.hbi_1, completion);
    i.ibi_1 = $this$runBlockingNoJs;
    return i;
  };
  AGOpengl$createMainRenderBuffer$o$set$slambda.$metadata$ = classMeta('AGOpengl$createMainRenderBuffer$o$set$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AGOpengl$createMainRenderBuffer$o$set$slambda_0(this$0, resultContinuation) {
    var i = new AGOpengl$createMainRenderBuffer$o$set$slambda(this$0, resultContinuation);
    var l = function ($this$runBlockingNoJs, $cont) {
      return i.h2n($this$runBlockingNoJs, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function AGOpengl$createMainRenderBuffer$o$unset$slambda(this$0, resultContinuation) {
    this.rbi_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  AGOpengl$createMainRenderBuffer$o$unset$slambda.prototype.h2n = function ($this$runBlockingNoJs, $cont) {
    var tmp = this.i2n($this$runBlockingNoJs, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AGOpengl$createMainRenderBuffer$o$unset$slambda.prototype.w7 = function (p1, $cont) {
    return this.h2n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
  };
  AGOpengl$createMainRenderBuffer$o$unset$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.rbi_1.hay_1.lb7(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AGOpengl$createMainRenderBuffer$o$unset$slambda.prototype.i2n = function ($this$runBlockingNoJs, completion) {
    var i = new AGOpengl$createMainRenderBuffer$o$unset$slambda(this.rbi_1, completion);
    i.sbi_1 = $this$runBlockingNoJs;
    return i;
  };
  AGOpengl$createMainRenderBuffer$o$unset$slambda.$metadata$ = classMeta('AGOpengl$createMainRenderBuffer$o$unset$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
  function AGOpengl$createMainRenderBuffer$o$unset$slambda_0(this$0, resultContinuation) {
    var i = new AGOpengl$createMainRenderBuffer$o$unset$slambda(this$0, resultContinuation);
    var l = function ($this$runBlockingNoJs, $cont) {
      return i.h2n($this$runBlockingNoJs, $cont);
    };
    l.$arity = 1;
    return l;
  }
  function AGOpengl_init_$Init$(checked, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      checked = false;
    AGOpengl.call($this, checked);
    return $this;
  }
  function ShaderException(str, error, errorInt, gl, debugName, type) {
    RuntimeException_init_$Init$('Error Compiling Shader : ' + debugName + ' type=' + type + ' : ' + get_hex(errorInt) + " : '" + error + "' : source='" + str + "', gl.versionInt=" + get_versionInt(gl) + ", gl.versionString='" + get_versionString(gl) + "', gl=" + gl, this);
    this.tbi_1 = str;
    this.ubi_1 = error;
    this.vbi_1 = errorInt;
    this.wbi_1 = gl;
    this.xbi_1 = debugName;
    this.ybi_1 = type;
    captureStack(this, ShaderException);
  }
  ShaderException.$metadata$ = classMeta('ShaderException', undefined, undefined, undefined, undefined, RuntimeException.prototype);
  function _get_glProcessor__a47enw($this) {
    if ($this.kbk_1 == null)
      $this.kbk_1 = new AGQueueProcessorOpenGL($this.lbk(), $this.fay_1);
    return ensureNotNull($this.kbk_1);
  }
  function AGOpengl$createMainRenderBuffer$1(this$0, $backBufferTextureBinding2d, $backBufferRenderBufferBinding, $backBufferFrameBufferBinding) {
    this.wbk_1 = this$0;
    this.xbk_1 = $backBufferTextureBinding2d;
    this.ybk_1 = $backBufferRenderBufferBinding;
    this.zbk_1 = $backBufferFrameBufferBinding;
    BaseRenderBufferImpl.call(this, this$0);
  }
  AGOpengl$createMainRenderBuffer$1.prototype.ab2 = function () {
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsSync' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.gl.<no name provided>.init.<anonymous>' call
    var tmp0__anonymous__q1qw7t = this.wbk_1.hay_1;
    tmp$ret$0 = Unit_getInstance();
    var result = tmp$ret$0;
    if (this.wbk_1.xay()) {
      runBlockingNoJs$default(null, AGOpengl$createMainRenderBuffer$o$init$slambda_0(this.wbk_1, null), 1, null);
    } else {
      this.wbk_1.way(this.wbk_1.hay_1);
    }
    tmp$ret$1 = result;
    var tmp = this.wbk_1.lbk();
    Companion_getInstance_14();
    this.xbk_1._v = getIntegerv(tmp, 32873);
    var tmp_0 = this.wbk_1.lbk();
    Companion_getInstance_14();
    this.ybk_1._v = getIntegerv(tmp_0, 36007);
    var tmp_1 = this.wbk_1.lbk();
    Companion_getInstance_14();
    this.zbk_1._v = getIntegerv(tmp_1, 36006);
  };
  AGOpengl$createMainRenderBuffer$1.prototype.bb2 = function () {
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsSync' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.gl.<no name provided>.set.<anonymous>' call
    var tmp0__anonymous__q1qw7t = this.wbk_1.hay_1;
    tmp$ret$0 = Unit_getInstance();
    var result = tmp$ret$0;
    if (this.wbk_1.xay()) {
      runBlockingNoJs$default(null, AGOpengl$createMainRenderBuffer$o$set$slambda_0(this.wbk_1, null), 1, null);
    } else {
      this.wbk_1.way(this.wbk_1.hay_1);
    }
    tmp$ret$1 = result;
    this.wbk_1.ib4(this);
    var tmp = this.wbk_1.lbk();
    Companion_getInstance_14();
    tmp.aao(3553, this.xbk_1._v);
    var tmp_0 = this.wbk_1.lbk();
    Companion_getInstance_14();
    tmp_0.zan(36161, this.ybk_1._v);
    var tmp_1 = this.wbk_1.lbk();
    Companion_getInstance_14();
    tmp_1.yan(36160, this.zbk_1._v);
  };
  AGOpengl$createMainRenderBuffer$1.prototype.cb2 = function () {
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.AG.commandsSync' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.gl.<no name provided>.unset.<anonymous>' call
    var tmp0__anonymous__q1qw7t = this.wbk_1.hay_1;
    tmp$ret$0 = Unit_getInstance();
    var result = tmp$ret$0;
    if (this.wbk_1.xay()) {
      runBlockingNoJs$default(null, AGOpengl$createMainRenderBuffer$o$unset$slambda_0(this.wbk_1, null), 1, null);
    } else {
      this.wbk_1.way(this.wbk_1.hay_1);
    }
    tmp$ret$1 = result;
    var tmp = this.wbk_1.lbk();
    Companion_getInstance_14();
    this.xbk_1._v = getIntegerv(tmp, 32873);
    var tmp_0 = this.wbk_1.lbk();
    Companion_getInstance_14();
    this.ybk_1._v = getIntegerv(tmp_0, 36007);
    var tmp_1 = this.wbk_1.lbk();
    Companion_getInstance_14();
    this.zbk_1._v = getIntegerv(tmp_1, 36006);
  };
  AGOpengl$createMainRenderBuffer$1.$metadata$ = classMeta(undefined, undefined, undefined, undefined, undefined, BaseRenderBufferImpl.prototype);
  function AGOpengl(checked) {
    AG.call(this, checked);
    this.jbk_1 = true;
    this.kbk_1 = null;
  }
  AGOpengl.prototype.nb7 = function () {
    var backBufferTextureBinding2d = {_v: 0};
    var backBufferRenderBufferBinding = {_v: 0};
    var backBufferFrameBufferBinding = {_v: 0};
    return new AGOpengl$createMainRenderBuffer$1(this, backBufferTextureBinding2d, backBufferRenderBufferBinding, backBufferFrameBufferBinding);
  };
  AGOpengl.prototype.fbb = function (list) {
    list.kbf();
    var tmp0_safe_receiver = _get_glProcessor__a47enw(this);
    if (tmp0_safe_receiver == null)
      null;
    else {
      var tmp$ret$2;
      // Inline function 'com.soywiz.korag.processBlockingAll' call
      var tmp$ret$1;
      // Inline function 'kotlin.with' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.processBlocking.<anonymous>' call
      tmp$ret$0 = list.xbd(tmp0_safe_receiver, -1);
      tmp$ret$1 = tmp$ret$0;
      tmp$ret$2 = Unit_getInstance();
    }
  };
  AGOpengl.$metadata$ = classMeta('AGOpengl', undefined, undefined, undefined, undefined, AG.prototype);
  function versionString$delegate$lambda($this$$receiver) {
    init_properties_AGOpengl_kt_a4gmd();
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.SHADING_LANGUAGE_VERSION' call
    Companion_getInstance_14();
    tmp$ret$0 = 35724;
    return $this$$receiver.qap(tmp$ret$0);
  }
  function versionInt$delegate$lambda($this$$receiver) {
    init_properties_AGOpengl_kt_a4gmd();
    var tmp$ret$0;
    // Inline function 'kotlin.text.trim' call
    var tmp = get_versionString($this$$receiver);
    var tmp0_trim = replace$default(tmp, '.', '', false, 4, null);
    tmp$ret$0 = toString_0(trim(isCharSequence(tmp0_trim) ? tmp0_trim : THROW_CCE()));
    var tmp0_elvis_lhs = toIntOrNull(tmp$ret$0);
    return tmp0_elvis_lhs == null ? 100 : tmp0_elvis_lhs;
  }
  function versionString$factory() {
    return getPropertyCallableRef('versionString', 1, KProperty1, function (receiver) {
      return get_versionString(receiver);
    }, null);
  }
  function versionInt$factory() {
    return getPropertyCallableRef('versionInt', 1, KProperty1, function (receiver) {
      return get_versionInt(receiver);
    }, null);
  }
  var properties_initialized_AGOpengl_kt_5em8g9;
  function init_properties_AGOpengl_kt_a4gmd() {
    if (properties_initialized_AGOpengl_kt_5em8g9) {
    } else {
      properties_initialized_AGOpengl_kt_5em8g9 = true;
      versionString$delegate = PropertyThis_init_$Create$(null, versionString$delegate$lambda, 1, null);
      versionInt$delegate = PropertyThis_init_$Create$(null, versionInt$delegate$lambda, 1, null);
    }
  }
  function fromGl(_this__u8e3s4, value) {
    var tmp0_subject = value;
    var tmp;
    Companion_getInstance_14();
    if (tmp0_subject === 3553) {
      tmp = TextureTargetKind_TEXTURE_2D_getInstance();
    } else {
      Companion_getInstance_14();
      if (tmp0_subject === 32879) {
        tmp = TextureTargetKind_TEXTURE_3D_getInstance();
      } else {
        Companion_getInstance_14();
        if (tmp0_subject === 34067) {
          tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
        } else {
          Companion_getInstance_14();
          if (tmp0_subject === 36197) {
            tmp = TextureTargetKind_EXTERNAL_TEXTURE_getInstance();
          } else {
            Companion_getInstance_14();
            if (tmp0_subject === 34069) {
              tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
            } else {
              Companion_getInstance_14();
              if (tmp0_subject === 34070) {
                tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
              } else {
                Companion_getInstance_14();
                if (tmp0_subject === 34071) {
                  tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
                } else {
                  Companion_getInstance_14();
                  if (tmp0_subject === 34072) {
                    tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
                  } else {
                    Companion_getInstance_14();
                    if (tmp0_subject === 34073) {
                      tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
                    } else {
                      Companion_getInstance_14();
                      if (tmp0_subject === 34074) {
                        tmp = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance();
                      } else {
                        var tmp0_TODO = 'Unknown TextureTargetKind: ' + value;
                        throw new NotImplementedError('An operation is not implemented: ' + tmp0_TODO);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    return tmp;
  }
  function toGl(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 3042;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 2884;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 2929;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 3089;
        break;
      case 4:
        Companion_getInstance_14();
        tmp = 2960;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_0(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 32774;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 32778;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 32779;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_1(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 772;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 774;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 1;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 773;
        break;
      case 4:
        Companion_getInstance_14();
        tmp = 775;
        break;
      case 5:
        Companion_getInstance_14();
        tmp = 771;
        break;
      case 6:
        Companion_getInstance_14();
        tmp = 769;
        break;
      case 7:
        Companion_getInstance_14();
        tmp = 770;
        break;
      case 8:
        Companion_getInstance_14();
        tmp = 768;
        break;
      case 9:
        Companion_getInstance_14();
        tmp = 0;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_2(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 1032;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 1028;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 1029;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_3(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 2305;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 2304;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 2305;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_4(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 519;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 514;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 516;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 518;
        break;
      case 4:
        Companion_getInstance_14();
        tmp = 513;
        break;
      case 5:
        Companion_getInstance_14();
        tmp = 515;
        break;
      case 6:
        Companion_getInstance_14();
        tmp = 512;
        break;
      case 7:
        Companion_getInstance_14();
        tmp = 517;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_5(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 34963;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 34962;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_6(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 0;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 3;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 2;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 1;
        break;
      case 5:
        Companion_getInstance_14();
        tmp = 5;
        break;
      case 6:
        Companion_getInstance_14();
        tmp = 6;
        break;
      case 4:
        Companion_getInstance_14();
        tmp = 4;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_7(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 5121;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 5123;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 5125;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_8(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 7683;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 34056;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 7682;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 34055;
        break;
      case 4:
        Companion_getInstance_14();
        tmp = 5386;
        break;
      case 5:
        Companion_getInstance_14();
        tmp = 7680;
        break;
      case 6:
        Companion_getInstance_14();
        tmp = 7681;
        break;
      case 7:
        Companion_getInstance_14();
        tmp = 0;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_9(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4.cbl_1;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 35670;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 5120;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 5121;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 5122;
        break;
      case 4:
        Companion_getInstance_14();
        tmp = 5123;
        break;
      case 5:
        Companion_getInstance_14();
        tmp = 5125;
        break;
      case 6:
        Companion_getInstance_14();
        tmp = 5126;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function toGl_10(_this__u8e3s4) {
    var tmp0_subject = _this__u8e3s4;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        tmp = 3553;
        break;
      case 1:
        Companion_getInstance_14();
        tmp = 32879;
        break;
      case 2:
        Companion_getInstance_14();
        tmp = 34067;
        break;
      case 3:
        Companion_getInstance_14();
        tmp = 36197;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  }
  function FastResources(create) {
    this.gbl_1 = create;
    var tmp = this;
    var tmp$ret$0;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp$ret$0 = ArrayList_init_$Create$();
    tmp.hbl_1 = tmp$ret$0;
  }
  FastResources.prototype.m = function (id) {
    return this.k4q(id);
  };
  FastResources.prototype.k4q = function (id) {
    return getOrNull_0(this.hbl_1, id);
  };
  FastResources.prototype.ibl = function (id) {
    var tmp0_elvis_lhs = this.k4q(id);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      var tmp$ret$0;
      // Inline function 'kotlin.also' call
      var tmp0_also = this.gbl_1(id);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.korag.gl.FastResources.getOrCreate.<anonymous>' call
      while (this.hbl_1.i() <= id) {
        this.hbl_1.c(null);
      }
      this.hbl_1.a5(id, tmp0_also);
      tmp$ret$0 = tmp0_also;
      tmp = tmp$ret$0;
    } else {
      tmp = tmp0_elvis_lhs;
    }
    return tmp;
  };
  FastResources.prototype.jbl = function (id) {
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = this.k4q(id);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.gl.FastResources.tryGetAndDelete.<anonymous>' call
    this.kbl(id);
    tmp$ret$0 = tmp0_also;
    return tmp$ret$0;
  };
  FastResources.prototype.kbl = function (id) {
    if (id < this.hbl_1.i()) {
      this.hbl_1.a5(id, null);
    }
  };
  FastResources.$metadata$ = classMeta('FastResources');
  function ProgramInfo(id) {
    this.lbl_1 = id;
    this.mbl_1 = null;
  }
  ProgramInfo.$metadata$ = classMeta('ProgramInfo');
  function programUseExt($this, program) {
    var tmp0_safe_receiver = program;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.lbm($this.nbl_1);
    }
    $this.rbl_1 = program;
  }
  function BufferInfo(id) {
    this.mbm_1 = id;
    this.nbm_1 = 0;
    this.obm_1 = -1;
  }
  BufferInfo.$metadata$ = classMeta('BufferInfo');
  function bindBuffer($this, buffer, target) {
    var tmp0_elvis_lhs = $this.sbl_1.m(buffer.rar_1);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      return Unit_getInstance();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var bufferInfo = tmp;
    if (!(bufferInfo.obm_1 === $this.obl_1.jb8_1)) {
      bufferInfo.obm_1 = $this.obl_1.jb8_1;
      buffer.mar_1 = true;
      bufferInfo.nbm_1 = 0;
    }
    if (bufferInfo.nbm_1 <= 0) {
      bufferInfo.nbm_1 = genBuffer($this.nbl_1);
    }
    $this.nbl_1.xan(toGl_5(target), bufferInfo.nbm_1);
    if (buffer.mar_1) {
      var mem = buffer.nar_1;
      if (!(mem == null)) {
        var tmp_0 = toGl_5(target);
        var tmp_1 = buffer.par_1;
        Companion_getInstance_14();
        $this.nbl_1.dao(tmp_0, tmp_1, mem, 35044);
      }
    }
  }
  function ensureVaoIndex($this, index) {
    while ($this.tbl_1.i() <= index) {
      $this.tbl_1.c(null);
    }
    return index;
  }
  function ensureUboIndex($this, index) {
    while ($this.vbl_1.i() <= index) {
      $this.vbl_1.c(null);
    }
    return index;
  }
  function TextureInfo(id) {
    this.pbm_1 = id;
    this.qbm_1 = -1;
  }
  TextureInfo.$metadata$ = classMeta('TextureInfo');
  function createBufferForBitmap($this, bmp, premultiplied) {
    var tmp0_subject = bmp;
    var tmp;
    if (tmp0_subject == null) {
      tmp = null;
    } else {
      if (tmp0_subject instanceof NativeImage) {
        unsupported('Should not call createBufferForBitmap with a NativeImage');
      } else {
        if (tmp0_subject instanceof Bitmap8) {
          var tmp$ret$0;
          // Inline function 'kotlin.also' call
          var tmp0_also = Companion_getInstance().p4w(bmp.g7z());
          // Inline function 'kotlin.contracts.contract' call
          // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.createBufferForBitmap.<anonymous>' call
          arraycopy_1(bmp.s3l(), 0, tmp0_also.u4w_1, 0, bmp.g7z());
          tmp$ret$0 = tmp0_also;
          tmp = tmp$ret$0;
        } else {
          if (tmp0_subject instanceof FloatBitmap32) {
            var tmp$ret$1;
            // Inline function 'kotlin.also' call
            var tmp1_also = Companion_getInstance().p4w(imul(imul(bmp.g7z(), 4), 4));
            // Inline function 'kotlin.contracts.contract' call
            // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.createBufferForBitmap.<anonymous>' call
            arraycopy_0(bmp.d8f_1, 0, tmp1_also.x4w_1, 0, imul(bmp.g7z(), 4));
            tmp$ret$1 = tmp1_also;
            tmp = tmp$ret$1;
          } else {
            var tmp$ret$2;
            // Inline function 'kotlin.also' call
            var tmp2_also = Companion_getInstance().p4w(imul(bmp.g7z(), 4));
            // Inline function 'kotlin.contracts.contract' call
            // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.createBufferForBitmap.<anonymous>' call
            var abmp = premultiplied ? bmp.w86().g89() : bmp.w86().h89();
            arraycopy(abmp.r86_1, 0, tmp2_also.w4w_1, 0, abmp.g7z());
            tmp$ret$2 = tmp2_also;
            tmp = tmp$ret$2;
          }
        }
      }
    }
    return tmp;
  }
  function prepareTexImage2D($this) {
    if ($this.nbl_1.jan()) {
      Companion_getInstance_14();
      Companion_getInstance_14();
      $this.nbl_1.sap(3313, 0);
      Companion_getInstance_14();
      Companion_getInstance_14();
      $this.nbl_1.sap(3312, 1);
    }
  }
  function FrameBufferInfo($outer) {
    this.abn_1 = $outer;
    this.rbm_1 = -1;
    this.sbm_1 = -1;
    this.tbm_1 = -1;
    this.ubm_1 = -1;
    this.vbm_1 = -1;
    this.wbm_1 = -1;
    this.xbm_1 = false;
    this.ybm_1 = false;
    this.zbm_1 = 1;
  }
  FrameBufferInfo.prototype.bbn = function (_set____db54di) {
    this.tbm_1 = _set____db54di;
  };
  FrameBufferInfo.prototype.cbn = function (_set____db54di) {
    this.ubm_1 = _set____db54di;
  };
  FrameBufferInfo.prototype.dbn = function () {
    return this.ybm_1 ? this.xbm_1 : false;
  };
  FrameBufferInfo.$metadata$ = classMeta('FrameBufferInfo');
  function AGQueueProcessorOpenGL$programs$lambda(it) {
    return new ProgramInfo(it);
  }
  function AGQueueProcessorOpenGL$buffers$lambda(it) {
    return new BufferInfo(it);
  }
  function AGQueueProcessorOpenGL$textures$lambda(it) {
    return new TextureInfo(it);
  }
  function AGQueueProcessorOpenGL$textureBindEnsuring$slambda($tex, $source, resultContinuation) {
    this.mbn_1 = $tex;
    this.nbn_1 = $source;
    CoroutineImpl.call(this, resultContinuation);
  }
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.prototype.z56 = function ($cont) {
    var tmp = this.k53($cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.prototype.to = function ($cont) {
    return this.z56($cont);
  };
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.nbn_1.pbn_1(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            var ARGUMENT = suspendResult;
            var ARGUMENT_0 = listOf(ARGUMENT);
            this.mbn_1.qaw_1 = ARGUMENT_0;
            this.mbn_1.paw_1 = true;
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.prototype.k53 = function (completion) {
    var i = new AGQueueProcessorOpenGL$textureBindEnsuring$slambda(this.mbn_1, this.nbn_1, completion);
    return i;
  };
  AGQueueProcessorOpenGL$textureBindEnsuring$slambda.$metadata$ = classMeta('AGQueueProcessorOpenGL$textureBindEnsuring$slambda', undefined, undefined, undefined, [0], CoroutineImpl.prototype);
  function AGQueueProcessorOpenGL$textureBindEnsuring$slambda_0($tex, $source, resultContinuation) {
    var i = new AGQueueProcessorOpenGL$textureBindEnsuring$slambda($tex, $source, resultContinuation);
    var l = function ($cont) {
      return i.z56($cont);
    };
    l.$arity = 0;
    return l;
  }
  function AGQueueProcessorOpenGL$frameBuffers$lambda(this$0) {
    return function (it) {
      return new FrameBufferInfo(this$0);
    };
  }
  function AGQueueProcessorOpenGL(gl, globalState) {
    this.nbl_1 = gl;
    this.obl_1 = globalState;
    var tmp = this;
    var tmp_0 = this.nbl_1.ian();
    var tmp_1 = this.nbl_1.kan();
    tmp.pbl_1 = GlslConfig_init_$Create$(tmp_0, 0, false, tmp_1, null, 22, null);
    var tmp_2 = this;
    tmp_2.qbl_1 = new FastResources(AGQueueProcessorOpenGL$programs$lambda);
    this.rbl_1 = null;
    var tmp_3 = this;
    tmp_3.sbl_1 = new FastResources(AGQueueProcessorOpenGL$buffers$lambda);
    var tmp_4 = this;
    var tmp$ret$0;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp$ret$0 = ArrayList_init_$Create$();
    tmp_4.tbl_1 = tmp$ret$0;
    this.ubl_1 = null;
    var tmp_5 = this;
    var tmp$ret$1;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp$ret$1 = ArrayList_init_$Create$();
    tmp_5.vbl_1 = tmp$ret$1;
    this.wbl_1 = 1024;
    this.xbl_1 = Companion_getInstance().p4w(imul(64, this.wbl_1));
    this.ybl_1 = Companion_getInstance().p4w(16);
    this.zbl_1 = Companion_getInstance().p4w(36);
    this.abm_1 = Companion_getInstance().p4w(64);
    var tmp_6 = this;
    var tmp$ret$2;
    // Inline function 'com.soywiz.kmem.FBuffer.f32' call
    var tmp0__get_f32__2k2skm = this.xbl_1;
    tmp$ret$2 = tmp0__get_f32__2k2skm.x4w_1;
    tmp_6.bbm_1 = tmp$ret$2;
    this.cbm_1 = new Float32Array(imul(16, this.wbl_1));
    var tmp_7 = this;
    var tmp$ret$5;
    // Inline function 'kotlin.arrayOf' call
    var tmp0_arrayOf = [new Matrix3D()];
    var tmp$ret$4;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp$ret$3;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$3 = tmp0_arrayOf;
    tmp$ret$4 = tmp$ret$3;
    tmp$ret$5 = tmp$ret$4;
    tmp_7.dbm_1 = tmp$ret$5;
    var tmp_8 = this;
    tmp_8.ebm_1 = new FastResources(AGQueueProcessorOpenGL$textures$lambda);
    var tmp_9 = this;
    tmp_9.fbm_1 = new FastResources(AGQueueProcessorOpenGL$frameBuffers$lambda(this));
  }
  AGQueueProcessorOpenGL.prototype.jay = function () {
    return this.obl_1.jb8_1;
  };
  AGQueueProcessorOpenGL.prototype.ybd = function () {
    if (this.obl_1.kb8_1.equals(new Long(-1, -1))) {
      this.obl_1.kb8_1 = get_currentThreadId();
      this.obl_1.lb8_1 = get_currentThreadName();
      var tmp0_safe_receiver = get_currentThreadName();
      var tmp;
      if (tmp0_safe_receiver == null) {
        tmp = null;
      } else {
        tmp = contains$default(tmp0_safe_receiver, 'DefaultDispatcher-worker', false, 2, null);
      }
      if (tmp === true) {
        println('DefaultDispatcher-worker!');
        printStackTrace$default(null, 1, null);
      }
    }
    if (!this.obl_1.kb8_1.equals(get_currentThreadId())) {
      println('AGQueueProcessorOpenGL.listStart: CALLED FROM DIFFERENT THREAD! ' + this.obl_1.lb8_1 + ':' + toString_0(this.obl_1.kb8_1) + ' != ' + get_currentThreadName() + ':' + toString_0(get_currentThreadId()));
      printStackTrace$default(null, 1, null);
    }
  };
  AGQueueProcessorOpenGL.prototype.vb8 = function () {
    var tmp0_this = this.obl_1;
    var tmp1 = tmp0_this.jb8_1;
    tmp0_this.jb8_1 = tmp1 + 1 | 0;
    this.nbl_1.uan();
  };
  AGQueueProcessorOpenGL.prototype.mj = function () {
    this.nbl_1.mj();
  };
  AGQueueProcessorOpenGL.prototype.a2z = function () {
    this.nbl_1.mj();
  };
  AGQueueProcessorOpenGL.prototype.dbf = function (kind, enable) {
    this.nbl_1.uaa(toGl(kind), enable);
  };
  AGQueueProcessorOpenGL.prototype.iao = function (red, green, blue, alpha) {
    this.nbl_1.iao(red, green, blue, alpha);
  };
  AGQueueProcessorOpenGL.prototype.bbf = function (rgb, a) {
    this.nbl_1.bao(toGl_0(rgb), toGl_0(a));
  };
  AGQueueProcessorOpenGL.prototype.abf = function (srcRgb, dstRgb, srcA, dstA) {
    this.nbl_1.cao(toGl_1(srcRgb), toGl_1(dstRgb), toGl_1(srcA), toGl_1(dstA));
  };
  AGQueueProcessorOpenGL.prototype.zbe = function (face) {
    this.nbl_1.nao(toGl_2(face));
  };
  AGQueueProcessorOpenGL.prototype.ybe = function (face) {
    this.nbl_1.dap(toGl_3(face));
  };
  AGQueueProcessorOpenGL.prototype.ebf = function (depthTest) {
    this.nbl_1.uao(toGl_4(depthTest));
  };
  AGQueueProcessorOpenGL.prototype.xbe = function (programId, program, config) {
    var tmp = this.qbl_1.ibl(programId);
    var tmp_0 = GLShaderCompiler_getInstance();
    var tmp0_elvis_lhs = config;
    var tmp_1 = this.pbl_1.vbn(false, 0, false, false, tmp0_elvis_lhs == null ? this.pbl_1.ubn_1 : tmp0_elvis_lhs, 15, null);
    tmp.mbl_1 = tmp_0.wbn(this.nbl_1, tmp_1, program, null, program.yb5_1, 8, null);
  };
  AGQueueProcessorOpenGL.prototype.wbe = function (programId) {
    var tmp0_elvis_lhs = this.qbl_1.jbl(programId);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      return Unit_getInstance();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var program = tmp;
    var tmp1_safe_receiver = program.mbl_1;
    if (tmp1_safe_receiver == null)
      null;
    else {
      tmp1_safe_receiver.xbn(this.nbl_1);
    }
    if (this.rbl_1 === program.mbl_1) {
      this.rbl_1 = null;
    }
    program.mbl_1 = null;
  };
  AGQueueProcessorOpenGL.prototype.vbe = function (programId) {
    var tmp0_safe_receiver = this.qbl_1.m(programId);
    programUseExt(this, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.mbl_1);
  };
  AGQueueProcessorOpenGL.prototype.lbe = function (id) {
    this.sbl_1.ibl(id);
  };
  AGQueueProcessorOpenGL.prototype.kbe = function (id) {
    var tmp0_safe_receiver = this.sbl_1.jbl(id);
    if (tmp0_safe_receiver == null)
      null;
    else {
      var tmp$ret$0;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      deleteBuffer(this.nbl_1, tmp0_safe_receiver.nbm_1);
      tmp0_safe_receiver.nbm_1 = 0;
      tmp$ret$0 = Unit_getInstance();
    }
  };
  AGQueueProcessorOpenGL.prototype.aba = function (type, vertexCount, offset, instances, indexType, indices) {
    var tmp0_safe_receiver = indices;
    if (tmp0_safe_receiver == null)
      null;
    else {
      var tmp$ret$0;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      bindBuffer(this, tmp0_safe_receiver, BufferKind_INDEX_getInstance());
      tmp$ret$0 = Unit_getInstance();
    }
    if (!(indexType == null)) {
      if (!(instances === 1)) {
        this.nbl_1.waa(toGl_6(type), vertexCount, toGl_7(indexType), offset, instances);
      } else {
        this.nbl_1.zao(toGl_6(type), vertexCount, toGl_7(indexType), offset);
      }
    } else {
      if (!(instances === 1)) {
        this.nbl_1.vaa(toGl_6(type), offset, vertexCount, instances);
      } else {
        this.nbl_1.yao(toGl_6(type), offset, vertexCount);
      }
    }
  };
  AGQueueProcessorOpenGL.prototype.sbe = function (layout, data) {
    // Inline function 'com.soywiz.kds.iterators.fastForEach' call
    var tmp0_fastForEach = layout.xb4_1;
    var n = 0;
    while (n < tmp0_fastForEach.i()) {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.uniformsSet.<anonymous>' call
      var tmp0 = n;
      n = tmp0 + 1 | 0;
      var tmp1__anonymous__uwfjfc = tmp0_fastForEach.m(tmp0);
      tmp$ret$0 = Unit_getInstance();
    }
    // Inline function 'kotlin.TODO' call
    throw NotImplementedError_init_$Create$(null, 1, null);
  };
  AGQueueProcessorOpenGL.prototype.vao = function (depth) {
    this.nbl_1.vao(depth);
  };
  AGQueueProcessorOpenGL.prototype.rbe = function (near, far) {
    this.nbl_1.wao(near, far);
  };
  AGQueueProcessorOpenGL.prototype.qbe = function (compareMode, referenceValue, readMask) {
    this.nbl_1.xap(toGl_4(compareMode), referenceValue, readMask);
  };
  AGQueueProcessorOpenGL.prototype.pbe = function (actionOnDepthFail, actionOnDepthPassStencilFail, actionOnBothPass) {
    this.nbl_1.zap(toGl_8(actionOnDepthFail), toGl_8(actionOnDepthPassStencilFail), toGl_8(actionOnBothPass));
  };
  AGQueueProcessorOpenGL.prototype.yap = function (writeMask) {
    this.nbl_1.yap(writeMask);
  };
  AGQueueProcessorOpenGL.prototype.vap = function (x, y, width, height) {
    this.nbl_1.vap(x, y, width, height);
  };
  AGQueueProcessorOpenGL.prototype.uaq = function (x, y, width, height) {
    this.nbl_1.uaq(x, y, width, height);
  };
  AGQueueProcessorOpenGL.prototype.jba = function (color, depth, stencil) {
    var mask = 0;
    if (color) {
      var tmp = mask;
      Companion_getInstance_14();
      mask = tmp | 16384;
    }
    if (depth) {
      var tmp_0 = mask;
      Companion_getInstance_14();
      mask = tmp_0 | 256;
    }
    if (stencil) {
      var tmp_1 = mask;
      Companion_getInstance_14();
      mask = tmp_1 | 1024;
    }
    this.nbl_1.eao(mask);
  };
  AGQueueProcessorOpenGL.prototype.fao = function (red, green, blue, alpha) {
    this.nbl_1.fao(red, green, blue, alpha);
  };
  AGQueueProcessorOpenGL.prototype.iba = function (depth) {
    this.nbl_1.gao(depth);
  };
  AGQueueProcessorOpenGL.prototype.hao = function (stencil) {
    this.nbl_1.hao(stencil);
  };
  AGQueueProcessorOpenGL.prototype.obe = function (id) {
  };
  AGQueueProcessorOpenGL.prototype.bba = function (id) {
    if (id < this.tbl_1.i()) {
      this.tbl_1.a5(id, null);
    }
  };
  AGQueueProcessorOpenGL.prototype.wb9 = function (id, vao) {
    this.tbl_1.a5(ensureVaoIndex(this, id), new VertexArrayObject(vao));
  };
  AGQueueProcessorOpenGL.prototype.xb9 = function (id) {
    var prevVao = this.ubl_1;
    var tmp = getOrNull_0(this.tbl_1, id);
    var vao = tmp == null ? null : tmp.fas_1;
    var cprogram = this.rbl_1;
    this.ubl_1 = vao;
    var tmp_0 = vao;
    if ((tmp_0 == null ? null : new VertexArrayObject(tmp_0)) == null) {
      var rvao = prevVao;
      var tmp0_safe_receiver = rvao;
      var tmp_1;
      var tmp_2 = tmp0_safe_receiver;
      if ((tmp_2 == null ? null : new VertexArrayObject(tmp_2)) == null) {
        tmp_1 = null;
      } else {
        tmp_1 = _VertexArrayObject___get_list__impl__xj772i(tmp0_safe_receiver);
      }
      var tmp1_safe_receiver = tmp_1;
      if (tmp1_safe_receiver == null)
        null;
      else {
        // Inline function 'com.soywiz.kds.FastArrayList.fastForEach' call
        var array = tmp1_safe_receiver.b4r_1;
        var n = 0;
        while (n < array.length) {
          // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.vaoUse.<anonymous>' call
          var tmp$ret$1;
          // Inline function 'kotlin.js.unsafeCast' call
          var tmp0 = n;
          n = tmp0 + 1 | 0;
          var tmp0_unsafeCast = array[tmp0];
          var tmp$ret$0;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$0 = tmp0_unsafeCast;
          tmp$ret$1 = tmp$ret$0;
          var tmp0__anonymous__q1qw7t = tmp$ret$1;
          var vattrs = tmp0__anonymous__q1qw7t.db1_1.xb4_1;
          // Inline function 'com.soywiz.kds.iterators.fastForEach' call
          var n_0 = 0;
          while (n_0 < vattrs.i()) {
            // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.vaoUse.<anonymous>.<anonymous>' call
            var tmp0_0 = n_0;
            n_0 = tmp0_0 + 1 | 0;
            var tmp0__anonymous__q1qw7t_0 = vattrs.m(tmp0_0);
            if (tmp0__anonymous__q1qw7t_0.hbo_1) {
              var tmp1_elvis_lhs = tmp0__anonymous__q1qw7t_0.jbo_1;
              var tmp_3;
              if (tmp1_elvis_lhs == null) {
                var tmp0_safe_receiver_0 = cprogram;
                tmp_3 = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.kbo(this.nbl_1, tmp0__anonymous__q1qw7t_0.hb6_1);
              } else {
                tmp_3 = tmp1_elvis_lhs;
              }
              var tmp2_elvis_lhs = tmp_3;
              var loc = tmp2_elvis_lhs == null ? 0 : tmp2_elvis_lhs;
              if (loc >= 0) {
                if (!(tmp0__anonymous__q1qw7t_0.ibo_1 === 0)) {
                  this.nbl_1.xaa(loc, 0);
                }
                this.nbl_1.xao(loc);
              }
            }
          }
        }
      }
    } else {
      var rvao_0 = vao;
      // Inline function 'com.soywiz.kds.FastArrayList.fastForEach' call
      var tmp1_fastForEach = _VertexArrayObject___get_list__impl__xj772i(rvao_0);
      var array_0 = tmp1_fastForEach.b4r_1;
      var n_1 = 0;
      while (n_1 < array_0.length) {
        // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.vaoUse.<anonymous>' call
        var tmp$ret$3;
        // Inline function 'kotlin.js.unsafeCast' call
        var tmp0_1 = n_1;
        n_1 = tmp0_1 + 1 | 0;
        var tmp0_unsafeCast_0 = array_0[tmp0_1];
        var tmp$ret$2;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$2 = tmp0_unsafeCast_0;
        tmp$ret$3 = tmp$ret$2;
        var tmp2__anonymous__z9zvc9 = tmp$ret$3;
        var vertices = tmp2__anonymous__z9zvc9.a4x();
        var vertexLayout = tmp2__anonymous__z9zvc9.db1_1;
        var vattrs_0 = vertexLayout.xb4_1;
        var vattrspos = vertexLayout.ab5_1;
        bindBuffer(this, vertices, BufferKind_VERTEX_getInstance());
        var totalSize = vertexLayout.cb5_1;
        var inductionVariable = 0;
        var last = vattrspos.i();
        if (inductionVariable < last)
          $l$loop: do {
            var n_2 = inductionVariable;
            inductionVariable = inductionVariable + 1 | 0;
            var att = vattrs_0.m(n_2);
            if (!att.hbo_1)
              continue $l$loop;
            var off = vattrspos.m(n_2);
            var tmp2_elvis_lhs_0 = att.jbo_1;
            var tmp_4;
            if (tmp2_elvis_lhs_0 == null) {
              var tmp1_safe_receiver_0 = cprogram;
              tmp_4 = tmp1_safe_receiver_0 == null ? null : tmp1_safe_receiver_0.kbo(this.nbl_1, att.hb6_1);
            } else {
              tmp_4 = tmp2_elvis_lhs_0;
            }
            var tmp3_elvis_lhs = tmp_4;
            var loc_0 = tmp3_elvis_lhs == null ? 0 : tmp3_elvis_lhs;
            var glElementType = toGl_9(att.h68());
            var elementCount = att.h68().dbl_1;
            if (loc_0 >= 0) {
              this.nbl_1.aap(loc_0);
              this.nbl_1.taq(loc_0, elementCount, glElementType, att.fbo_1, totalSize, toLong(off));
              if (!(att.ibo_1 === 0)) {
                this.nbl_1.xaa(loc_0, att.ibo_1);
              }
            }
          }
           while (inductionVariable < last);
      }
    }
  };
  AGQueueProcessorOpenGL.prototype.nbe = function (id) {
  };
  AGQueueProcessorOpenGL.prototype.mbe = function (id) {
    if (id < this.vbl_1.i()) {
      this.vbl_1.a5(id, null);
    }
  };
  AGQueueProcessorOpenGL.prototype.yb9 = function (id, ubo) {
    this.vbl_1.a5(ensureUboIndex(this, id), ubo);
  };
  AGQueueProcessorOpenGL.prototype.zb9 = function (id) {
    var tmp0_elvis_lhs = this.vbl_1.m(id);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      return Unit_getInstance();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var uniforms = tmp;
    var tmp1_elvis_lhs = this.rbl_1;
    var tmp_0;
    if (tmp1_elvis_lhs == null) {
      return Unit_getInstance();
    } else {
      tmp_0 = tmp1_elvis_lhs;
    }
    var glProgram = tmp_0;
    var textureUnit = 0;
    var inductionVariable = 0;
    var last = uniforms.wat_1.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var uniform = uniforms.wat_1.m(n);
        var uniformName = uniform.hb6_1;
        var uniformType = uniform.h68();
        var value = uniforms.xat_1.m(n);
        var location = glProgram.lbo(this.nbl_1, uniformName);
        var declArrayCount = uniform.ib6_1;
        var stride = uniform.h68().dbl_1;
        var tmp3_subject = uniformType;
        var tmp0 = tmp3_subject.q2_1;
        switch (tmp0) {
          case 5:
          case 7:
            var tmp$ret$2;
            // Inline function 'com.soywiz.kds.fastCastTo' call
            var tmp$ret$1;
            // Inline function 'kotlin.js.unsafeCast' call
            var tmp$ret$0;
            // Inline function 'kotlin.js.asDynamic' call
            tmp$ret$0 = value;
            tmp$ret$1 = tmp$ret$0;
            tmp$ret$2 = tmp$ret$1;

            var unit = tmp$ret$2;
            Companion_getInstance_14();
            this.nbl_1.van(33984 + textureUnit | 0);
            var tex = unit.laz_1;
            if (!(tex == null)) {
              this.bbe(tex);
              this.mbo(tex);
              var tmp_1 = unit.maz_1;
              var tmp4_elvis_lhs = unit.naz_1;
              this.nbo(tex, tmp_1, tmp4_elvis_lhs == null ? unit.maz_1 : tmp4_elvis_lhs);
            } else {
              Companion_getInstance_14();
              this.nbl_1.aao(3553, 0);
            }

            this.nbl_1.faq(location, textureUnit);
            var tmp5 = textureUnit;
            textureUnit = tmp5 + 1 | 0;
            ;
            break;
          case 1:
          case 2:
          case 3:
            var tmp$ret$6;
            // Inline function 'com.soywiz.kds.fastCastTo' call
            var tmp6_subject = value;
            var tmp_2;
            if (isArray(tmp6_subject)) {
              tmp_2 = value;
            } else {
              if (tmp6_subject instanceof Matrix3D) {
                var tmp$ret$3;
                // Inline function 'kotlin.also' call
                var tmp0_also = this.dbm_1;
                // Inline function 'kotlin.contracts.contract' call
                // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.uboUse.<anonymous>' call
                tmp0_also[0].v79(value);
                tmp$ret$3 = tmp0_also;
                tmp_2 = tmp$ret$3;
              } else {
                throw IllegalStateException_init_$Create$('Not an array or a matrix3d');
              }
            }
            var tmp1_fastCastTo = tmp_2;
            var tmp$ret$5;
            // Inline function 'kotlin.js.unsafeCast' call
            var tmp$ret$4;
            // Inline function 'kotlin.js.asDynamic' call
            tmp$ret$4 = tmp1_fastCastTo;
            tmp$ret$5 = tmp$ret$4;
            tmp$ret$6 = tmp$ret$5;

            var matArray = tmp$ret$6;
            var tmp$ret$7;
            // Inline function 'kotlin.math.min' call
            var tmp2_min = matArray.length;
            tmp$ret$7 = Math.min(declArrayCount, tmp2_min);

            var arrayCount = tmp$ret$7;
            var tmp7_subject = uniformType;
            var tmp0_0 = tmp7_subject.q2_1;
            {
              var matSize;
              switch (tmp0_0) {
                case 1:
                  matSize = 2;
                  break;
                case 2:
                  matSize = 3;
                  break;
                case 3:
                  matSize = 4;
                  break;
                default:
                  matSize = -1;
                  break;
              }
            }

            var inductionVariable_0 = 0;
            if (inductionVariable_0 < arrayCount)
              do {
                var n_0 = inductionVariable_0;
                inductionVariable_0 = inductionVariable_0 + 1 | 0;
                copyToFloatWxH(matArray[n_0], this.cbm_1, matSize, matSize, MajorOrder_COLUMN_getInstance(), imul(n_0, stride));
              }
               while (inductionVariable_0 < arrayCount);
            setFloats(this.xbl_1, 0, this.cbm_1, 0, imul(stride, arrayCount));
            ;
            if (this.nbl_1.lan()) {
              var tmp9_subject = uniformType;
              var tmp0_1 = tmp9_subject.q2_1;
              {
                var tb;
                switch (tmp0_1) {
                  case 1:
                    tb = this.ybl_1;
                    break;
                  case 2:
                    tb = this.zbl_1;
                    break;
                  case 3:
                    tb = this.abm_1;
                    break;
                  default:
                    tb = this.abm_1;
                    break;
                }
              }
              var inductionVariable_1 = 0;
              if (inductionVariable_1 < arrayCount)
                do {
                  var n_1 = inductionVariable_1;
                  inductionVariable_1 = inductionVariable_1 + 1 | 0;
                  var tmp11_subject = arrayCount;
                  var itLocation = tmp11_subject === 1 ? location : this.nbl_1.kap(glProgram.gbm_1, uniform.kb6_1[n_1]);
                  var tmp$ret$8;
                  // Inline function 'com.soywiz.kmem.FBuffer.f32' call
                  var tmp3__get_f32__fkdv2v = this.xbl_1;
                  tmp$ret$8 = tmp3__get_f32__fkdv2v.x4w_1;
                  var tmp_3 = tmp$ret$8;
                  var tmp_4 = imul(n_1, stride);
                  var tmp$ret$9;
                  // Inline function 'com.soywiz.kmem.FBuffer.f32' call
                  tmp$ret$9 = tb.x4w_1;
                  arraycopy_2(tmp_3, tmp_4, tmp$ret$9, 0, stride);
                  var tmp12_subject = uniform.h68();
                  var tmp0_2 = tmp12_subject.q2_1;
                  switch (tmp0_2) {
                    case 1:
                      this.nbl_1.paq(itLocation, 1, false, tb);
                      ;
                      break;
                    case 2:
                      this.nbl_1.qaq(itLocation, 1, false, tb);
                      ;
                      break;
                    case 3:
                      this.nbl_1.raq(itLocation, 1, false, tb);
                      ;
                      break;
                    default:
                      invalidOp("Don't know how to set uniform matrix " + uniform.h68());
                      break;
                  }
                }
                 while (inductionVariable_1 < arrayCount);
            } else {
              var tmp13_subject = uniform.h68();
              var tmp0_3 = tmp13_subject.q2_1;
              switch (tmp0_3) {
                case 1:
                  this.nbl_1.paq(location, arrayCount, false, this.xbl_1);
                  ;
                  break;
                case 2:
                  this.nbl_1.qaq(location, arrayCount, false, this.xbl_1);
                  ;
                  break;
                case 3:
                  this.nbl_1.raq(location, arrayCount, false, this.xbl_1);
                  ;
                  break;
                default:
                  invalidOp("Don't know how to set uniform matrix " + uniform.h68());
                  break;
              }
            }

            break;
          case 17:
          case 18:
          case 19:
          case 20:
            var tmp14_subject = value;
            if (typeof tmp14_subject === 'boolean') {
              var tmp$ret$10;
              // Inline function 'com.soywiz.kmem.toInt' call
              var tmp4_toInt = value;
              tmp$ret$10 = tmp4_toInt ? 1 : 0;
              this.nbl_1.faq(location, tmp$ret$10);
            } else {
              if (isBooleanArray(tmp14_subject)) {
                var tmp15_subject = uniformType.dbl_1;
                switch (tmp15_subject) {
                  case 1:
                    var tmp$ret$11;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp5_toInt = value[0];
                    tmp$ret$11 = tmp5_toInt ? 1 : 0;

                    this.nbl_1.faq(location, tmp$ret$11);
                    ;
                    break;
                  case 2:
                    var tmp$ret$12;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp6_toInt = value[0];
                    tmp$ret$12 = tmp6_toInt ? 1 : 0;

                    var tmp_5 = tmp$ret$12;
                    var tmp$ret$13;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp7_toInt = value[1];
                    tmp$ret$13 = tmp7_toInt ? 1 : 0;

                    this.nbl_1.iaq(location, tmp_5, tmp$ret$13);
                    ;
                    break;
                  case 3:
                    var tmp$ret$14;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp8_toInt = value[0];
                    tmp$ret$14 = tmp8_toInt ? 1 : 0;

                    var tmp_6 = tmp$ret$14;
                    var tmp$ret$15;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp9_toInt = value[1];
                    tmp$ret$15 = tmp9_toInt ? 1 : 0;

                    var tmp_7 = tmp$ret$15;
                    var tmp$ret$16;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp10_toInt = value[2];
                    tmp$ret$16 = tmp10_toInt ? 1 : 0;

                    this.nbl_1.laq(location, tmp_6, tmp_7, tmp$ret$16);
                    ;
                    break;
                  case 4:
                    var tmp$ret$17;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp11_toInt = value[0];
                    tmp$ret$17 = tmp11_toInt ? 1 : 0;

                    var tmp_8 = tmp$ret$17;
                    var tmp$ret$18;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp12_toInt = value[1];
                    tmp$ret$18 = tmp12_toInt ? 1 : 0;

                    var tmp_9 = tmp$ret$18;
                    var tmp$ret$19;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp13_toInt = value[2];
                    tmp$ret$19 = tmp13_toInt ? 1 : 0;

                    var tmp_10 = tmp$ret$19;
                    var tmp$ret$20;
                    // Inline function 'com.soywiz.kmem.toInt' call
                    var tmp14_toInt = value[3];
                    tmp$ret$20 = tmp14_toInt ? 1 : 0;

                    this.nbl_1.oaq(location, tmp_8, tmp_9, tmp_10, tmp$ret$20);
                    ;
                    break;
                }
              } else {
                throw NotImplementedError_init_$Create$(null, 1, null);
              }
            }

            break;
          case 9:
          case 10:
          case 11:
          case 12:
            var arrayCount_0 = declArrayCount;
            var tmp16_subject = value;
            if (typeof tmp16_subject === 'boolean') {
              var tmp$ret$21;
              // Inline function 'com.soywiz.kmem.toInt' call
              var tmp15_toInt = value;
              tmp$ret$21 = tmp15_toInt ? 1 : 0;
              this.xbl_1.s4x(0, tmp$ret$21);
            } else {
              if (isNumber(tmp16_subject)) {
                this.xbl_1.x4x(0, numberToDouble(value));
              } else {
                if (tmp16_subject instanceof Vector3D) {
                  setFloats(this.xbl_1, 0, value.b7e_1, 0, stride);
                } else {
                  if (isFloatArray(tmp16_subject)) {
                    var tmp$ret$22;
                    // Inline function 'kotlin.math.min' call
                    var tmp16_min = value.length / stride | 0;
                    tmp$ret$22 = Math.min(declArrayCount, tmp16_min);
                    arrayCount_0 = tmp$ret$22;
                    setFloats(this.xbl_1, 0, value, 0, imul(stride, arrayCount_0));
                  } else {
                    if (tmp16_subject instanceof Point) {
                      this.xbl_1.s4x(0, value.o7a());
                      this.xbl_1.s4x(1, value.p7a());
                    } else {
                      if (tmp16_subject instanceof RGBAf) {
                        setFloats(this.xbl_1, 0, _RGBAf___get_data__impl__yt2t4(value.obo_1), 0, stride);
                      } else {
                        if (tmp16_subject instanceof RGBA) {
                          if (stride >= 1) {
                            this.xbl_1.s4x(0, _RGBA___get_rf__impl__kvz75k(value.n8k_1));
                          }
                          if (stride >= 2) {
                            this.xbl_1.s4x(1, _RGBA___get_gf__impl__5gcu1f(value.n8k_1));
                          }
                          if (stride >= 3) {
                            this.xbl_1.s4x(2, _RGBA___get_bf__impl__1xz5yg(value.n8k_1));
                          }
                          if (stride >= 4) {
                            this.xbl_1.s4x(3, _RGBA___get_af__impl__vu36qv(value.n8k_1));
                          }
                        } else {
                          if (isArray(tmp16_subject)) {
                            var tmp$ret$23;
                            // Inline function 'kotlin.math.min' call
                            var tmp17_min = value.length;
                            tmp$ret$23 = Math.min(declArrayCount, tmp17_min);
                            arrayCount_0 = tmp$ret$23;
                            var inductionVariable_2 = 0;
                            var last_0 = value.length;
                            if (inductionVariable_2 < last_0)
                              do {
                                var n_2 = inductionVariable_2;
                                inductionVariable_2 = inductionVariable_2 + 1 | 0;
                                var tmp_11 = value[n_2];
                                var vector = tmp_11 instanceof Vector3D ? tmp_11 : THROW_CCE();
                                setFloats(this.xbl_1, imul(n_2, stride), vector.b7e_1, 0, stride);
                              }
                               while (inductionVariable_2 < last_0);
                          } else {
                            var tmp18_error = "Unknown type '" + toString_0(value) + "'";
                            throw IllegalStateException_init_$Create$(toString_0(tmp18_error));
                          }
                        }
                      }
                    }
                  }
                }
              }
            }

            if (this.nbl_1.lan()) {
              var tb_0 = this.ybl_1;
              var inductionVariable_3 = 0;
              var last_1 = arrayCount_0;
              if (inductionVariable_3 < last_1)
                do {
                  var n_3 = inductionVariable_3;
                  inductionVariable_3 = inductionVariable_3 + 1 | 0;
                  var tmp19_subject = arrayCount_0;
                  var itLocation_0 = tmp19_subject === 1 ? location : this.nbl_1.kap(glProgram.gbm_1, uniform.kb6_1[n_3]);
                  var tmp$ret$24;
                  // Inline function 'com.soywiz.kmem.FBuffer.f32' call
                  tmp$ret$24 = tb_0.x4w_1;
                  var f32 = tmp$ret$24;
                  var tmp$ret$25;
                  // Inline function 'com.soywiz.kmem.FBuffer.f32' call
                  var tmp19__get_f32__kettxw = this.xbl_1;
                  tmp$ret$25 = tmp19__get_f32__kettxw.x4w_1;
                  var tmp_12 = tmp$ret$25;
                  var tmp$ret$26;
                  // Inline function 'com.soywiz.kmem.FBuffer.f32' call
                  tmp$ret$26 = tb_0.x4w_1;
                  arraycopy_2(tmp_12, 0, tmp$ret$26, 0, stride);
                  var tmp20_subject = uniform.h68();
                  var tmp0_4 = tmp20_subject.q2_1;
                  switch (tmp0_4) {
                    case 9:
                      var tmp$ret$28;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$27;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$27 = f32;
                      tmp$ret$28 = tmp$ret$27[0];

                      this.nbl_1.daq(itLocation_0, tmp$ret$28);
                      ;
                      break;
                    case 10:
                      var tmp$ret$30;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$29;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$29 = f32;
                      tmp$ret$30 = tmp$ret$29[0];

                      var tmp_13 = tmp$ret$30;
                      var tmp$ret$32;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$31;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$31 = f32;
                      tmp$ret$32 = tmp$ret$31[1];

                      this.nbl_1.gaq(itLocation_0, tmp_13, tmp$ret$32);
                      ;
                      break;
                    case 11:
                      var tmp$ret$34;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$33;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$33 = f32;
                      tmp$ret$34 = tmp$ret$33[0];

                      var tmp_14 = tmp$ret$34;
                      var tmp$ret$36;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$35;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$35 = f32;
                      tmp$ret$36 = tmp$ret$35[1];

                      var tmp_15 = tmp$ret$36;
                      var tmp$ret$38;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$37;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$37 = f32;
                      tmp$ret$38 = tmp$ret$37[2];

                      this.nbl_1.jaq(itLocation_0, tmp_14, tmp_15, tmp$ret$38);
                      ;
                      break;
                    case 12:
                      var tmp$ret$40;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$39;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$39 = f32;
                      tmp$ret$40 = tmp$ret$39[0];

                      var tmp_16 = tmp$ret$40;
                      var tmp$ret$42;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$41;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$41 = f32;
                      tmp$ret$42 = tmp$ret$41[1];

                      var tmp_17 = tmp$ret$42;
                      var tmp$ret$44;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$43;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$43 = f32;
                      tmp$ret$44 = tmp$ret$43[2];

                      var tmp_18 = tmp$ret$44;
                      var tmp$ret$46;
                      // Inline function 'com.soywiz.kmem.get' call
                      var tmp$ret$45;
                      // Inline function 'kotlin.js.asDynamic' call
                      tmp$ret$45 = f32;
                      tmp$ret$46 = tmp$ret$45[3];

                      this.nbl_1.maq(itLocation_0, tmp_16, tmp_17, tmp_18, tmp$ret$46);
                      ;
                      break;
                    default:
                      ;
                      break;
                  }
                }
                 while (inductionVariable_3 < last_1);
            } else {
              var tb_1 = this.xbl_1;
              var tmp$ret$47;
              // Inline function 'com.soywiz.kmem.FBuffer.f32' call
              tmp$ret$47 = tb_1.x4w_1;
              var f32_0 = tmp$ret$47;
              if (arrayCount_0 === 1) {
                var tmp21_subject = uniform.h68();
                var tmp0_5 = tmp21_subject.q2_1;
                switch (tmp0_5) {
                  case 9:
                    var tmp$ret$49;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$48;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$48 = f32_0;
                    tmp$ret$49 = tmp$ret$48[0];

                    this.nbl_1.daq(location, tmp$ret$49);
                    ;
                    break;
                  case 10:
                    var tmp$ret$51;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$50;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$50 = f32_0;
                    tmp$ret$51 = tmp$ret$50[0];

                    var tmp_19 = tmp$ret$51;
                    var tmp$ret$53;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$52;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$52 = f32_0;
                    tmp$ret$53 = tmp$ret$52[1];

                    this.nbl_1.gaq(location, tmp_19, tmp$ret$53);
                    ;
                    break;
                  case 11:
                    var tmp$ret$55;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$54;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$54 = f32_0;
                    tmp$ret$55 = tmp$ret$54[0];

                    var tmp_20 = tmp$ret$55;
                    var tmp$ret$57;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$56;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$56 = f32_0;
                    tmp$ret$57 = tmp$ret$56[1];

                    var tmp_21 = tmp$ret$57;
                    var tmp$ret$59;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$58;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$58 = f32_0;
                    tmp$ret$59 = tmp$ret$58[2];

                    this.nbl_1.jaq(location, tmp_20, tmp_21, tmp$ret$59);
                    ;
                    break;
                  case 12:
                    var tmp$ret$61;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$60;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$60 = f32_0;
                    tmp$ret$61 = tmp$ret$60[0];

                    var tmp_22 = tmp$ret$61;
                    var tmp$ret$63;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$62;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$62 = f32_0;
                    tmp$ret$63 = tmp$ret$62[1];

                    var tmp_23 = tmp$ret$63;
                    var tmp$ret$65;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$64;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$64 = f32_0;
                    tmp$ret$65 = tmp$ret$64[2];

                    var tmp_24 = tmp$ret$65;
                    var tmp$ret$67;
                    // Inline function 'com.soywiz.kmem.get' call
                    var tmp$ret$66;
                    // Inline function 'kotlin.js.asDynamic' call
                    tmp$ret$66 = f32_0;
                    tmp$ret$67 = tmp$ret$66[3];

                    this.nbl_1.maq(location, tmp_22, tmp_23, tmp_24, tmp$ret$67);
                    ;
                    break;
                  default:
                    ;
                    break;
                }
              } else {
                var tmp22_subject = uniform.h68();
                var tmp0_6 = tmp22_subject.q2_1;
                switch (tmp0_6) {
                  case 9:
                    this.nbl_1.eaq(location, arrayCount_0, this.xbl_1);
                    ;
                    break;
                  case 10:
                    this.nbl_1.haq(location, arrayCount_0, this.xbl_1);
                    ;
                    break;
                  case 11:
                    this.nbl_1.kaq(location, arrayCount_0, this.xbl_1);
                    ;
                    break;
                  case 12:
                    this.nbl_1.naq(location, arrayCount_0, this.xbl_1);
                    ;
                    break;
                  default:
                    ;
                    break;
                }
              }
            }

            break;
          default:
            invalidOp("Don't know how to set uniform " + uniform.h68());
            break;
        }
      }
       while (inductionVariable < last);
  };
  AGQueueProcessorOpenGL.prototype.nbo = function (tex, linear, trilinear) {
    var tmp;
    if (tex.law_1) {
      var tmp_0;
      if (linear) {
        var tmp_1;
        if (trilinear) {
          Companion_getInstance_14();
          tmp_1 = 9987;
        } else {
          Companion_getInstance_14();
          tmp_1 = 9985;
        }
        tmp_0 = tmp_1;
      } else {
        var tmp_2;
        if (trilinear) {
          Companion_getInstance_14();
          tmp_2 = 9986;
        } else {
          Companion_getInstance_14();
          tmp_2 = 9984;
        }
        tmp_0 = tmp_2;
      }
      tmp = tmp_0;
    } else {
      var tmp_3;
      if (linear) {
        Companion_getInstance_14();
        tmp_3 = 9729;
      } else {
        Companion_getInstance_14();
        tmp_3 = 9728;
      }
      tmp = tmp_3;
    }
    var minFilter = tmp;
    var tmp_4;
    if (linear) {
      Companion_getInstance_14();
      tmp_4 = 9729;
    } else {
      Companion_getInstance_14();
      tmp_4 = 9728;
    }
    var magFilter = tmp_4;
    var tmp_5 = toGl_10(tex.aaz());
    Companion_getInstance_14();
    this.nbl_1.caq(tmp_5, 10241, minFilter);
    var tmp_6 = toGl_10(tex.aaz());
    Companion_getInstance_14();
    this.nbl_1.caq(tmp_6, 10240, magFilter);
  };
  AGQueueProcessorOpenGL.prototype.mbo = function (tex) {
    var tmp = toGl_10(tex.aaz());
    Companion_getInstance_14();
    Companion_getInstance_14();
    this.nbl_1.caq(tmp, 10242, 33071);
    var tmp_0 = toGl_10(tex.aaz());
    Companion_getInstance_14();
    Companion_getInstance_14();
    this.nbl_1.caq(tmp_0, 10243, 33071);
    if (tex.aaz().gaw_1 >= 3) {
      var tmp_1 = toGl_10(tex.aaz());
      Companion_getInstance_14();
      Companion_getInstance_14();
      this.nbl_1.caq(tmp_1, 32882, 33071);
    }
  };
  AGQueueProcessorOpenGL.prototype.ube = function (x, y, width, height, data, kind) {
    var tmp0_subject = data;
    var tmp;
    if (isIntArray(tmp0_subject)) {
      tmp = 4;
    } else {
      if (isFloatArray(tmp0_subject)) {
        tmp = 4;
      } else {
        if (isByteArray(tmp0_subject)) {
          tmp = 1;
        } else {
          throw NotImplementedError_init_$Create$(null, 1, null);
        }
      }
    }
    var bytesPerPixel = tmp;
    var area = imul(width, height);
    var tmp$ret$1;
    // Inline function 'com.soywiz.kmem.fbuffer' call
    var tmp0_fbuffer = imul(area, bytesPerPixel);
    var tmp$ret$0;
    // Inline function 'kotlin.run' call
    var tmp0_run = Companion_getInstance().p4w(tmp0_fbuffer);
    // Inline function 'kotlin.contracts.contract' call
    var tmp0_subject_0 = kind;
    var tmp0 = tmp0_subject_0.q2_1;
    switch (tmp0) {
      case 0:
        Companion_getInstance_14();
        Companion_getInstance_14();
        this.nbl_1.tap(x, y, width, height, 6408, 5121, tmp0_run);
        ;
        break;
      case 1:
        Companion_getInstance_14();
        Companion_getInstance_14();
        this.nbl_1.tap(x, y, width, height, 6402, 5126, tmp0_run);
        ;
        break;
      case 2:
        Companion_getInstance_14();
        Companion_getInstance_14();
        this.nbl_1.tap(x, y, width, height, 6401, 5121, tmp0_run);
        ;
        break;
    }
    var tmp1_subject = data;
    var tmp_0;
    if (isIntArray(tmp1_subject)) {
      tmp0_run.j4y(0, data, 0, area);
      tmp_0 = Unit_getInstance();
    } else {
      if (isFloatArray(tmp1_subject)) {
        tmp0_run.k4y(0, data, 0, area);
        tmp_0 = Unit_getInstance();
      } else {
        if (isByteArray(tmp1_subject)) {
          tmp0_run.i4y(0, data, 0, area);
          tmp_0 = Unit_getInstance();
        } else {
          throw NotImplementedError_init_$Create$(null, 1, null);
        }
      }
    }
    tmp$ret$0 = tmp_0;
    tmp$ret$1 = tmp$ret$0;
  };
  AGQueueProcessorOpenGL.prototype.tbe = function (textureId, x, y, width, height, kind) {
    this.cbe(textureId, TextureTargetKind_TEXTURE_2D_getInstance(), -1);
    Companion_getInstance_14();
    Companion_getInstance_14();
    this.nbl_1.kao(3553, 0, 6408, x, y, width, height, 0);
  };
  AGQueueProcessorOpenGL.prototype.jbe = function (textureId) {
    var tex = this.ebm_1.ibl(textureId);
    tex.qbm_1 = genTexture(this.nbl_1);
  };
  AGQueueProcessorOpenGL.prototype.dbe = function (textureId) {
    var tmp0_elvis_lhs = this.ebm_1.jbl(textureId);
    var tmp;
    if (tmp0_elvis_lhs == null) {
      return Unit_getInstance();
    } else {
      tmp = tmp0_elvis_lhs;
    }
    var tex = tmp;
    if (tex.qbm_1 <= 0)
      return Unit_getInstance();
    deleteTexture(this.nbl_1, tex.qbm_1);
    tex.qbm_1 = 0;
  };
  AGQueueProcessorOpenGL.prototype.cbe = function (textureId, target, implForcedTexId) {
    var tmp$ret$1;
    // Inline function 'kotlin.takeIf' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp;
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.textureBind.<anonymous>' call
    tmp$ret$0 = implForcedTexId >= 0;
    if (tmp$ret$0) {
      tmp = implForcedTexId;
    } else {
      tmp = null;
    }
    tmp$ret$1 = tmp;
    var tmp1_elvis_lhs = tmp$ret$1;
    var tmp_0;
    if (tmp1_elvis_lhs == null) {
      var tmp0_safe_receiver = this.ebm_1.m(textureId);
      tmp_0 = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qbm_1;
    } else {
      tmp_0 = tmp1_elvis_lhs;
    }
    var tmp2_elvis_lhs = tmp_0;
    var glId = tmp2_elvis_lhs == null ? 0 : tmp2_elvis_lhs;
    this.nbl_1.aao(toGl_10(target), glId);
  };
  AGQueueProcessorOpenGL.prototype.bbe = function (tex) {
    if (tex == null) {
      Companion_getInstance_14();
      return this.nbl_1.aao(3553, 0);
    }
    if (!(tex.saw_1 === this.jay())) {
      println('Texture context lost, recreating: texId=' + tex.taw_1 + ', source=' + tex.maw_1);
      tex.saw_1 = this.jay();
      tex.baz();
      this.jbe(tex.taw_1);
    }
    this.cbe(tex.taw_1, tex.aaz(), tex.zay());
    if (!(tex.uaw_1 == null))
      return Unit_getInstance();
    if (tex.jaw_1)
      return Unit_getInstance();
    var source = tex.maw_1;
    if (tex.naw_1)
      return Unit_getInstance();
    if (!tex.oaw_1) {
      tex.oaw_1 = true;
      var tmp0_subject = source;
      if (tmp0_subject instanceof SyncBitmapSourceList) {
        tex.qaw_1 = source.zav_1();
        tex.paw_1 = true;
      } else {
        if (tmp0_subject instanceof SyncBitmapSource) {
          tex.qaw_1 = listOf(source.daw_1());
          tex.paw_1 = true;
        } else {
          if (tmp0_subject instanceof AsyncBitmapSource) {
            launchImmediately(source.obn_1, AGQueueProcessorOpenGL$textureBindEnsuring$slambda_0(tex, source, null));
          }
        }
      }
    }
    if (tex.paw_1) {
      tex.naw_1 = true;
      tex.oaw_1 = false;
      tex.paw_1 = false;
      try {
        var bmps = tex.qaw_1;
        var requestMipmaps = tex.kaw_1;
        tex.law_1 = tex.iaz(source, requestMipmaps);
        if (!(bmps == null)) {
          var iterator = bmps.j();
          var index = 0;
          while (iterator.k()) {
            var index_0 = index;
            index = index + 1 | 0;
            var rbmp = iterator.l();
            this.pbo(tex.taw_1, tex.aaz(), index_0, rbmp, tex.maw_1, tex.law_1, tex.b7z());
          }
        } else {
          this.pbo(tex.taw_1, tex.aaz(), 0, null, tex.maw_1, tex.law_1, tex.b7z());
        }
      }finally {
        tex.qaw_1 = null;
        tex.raw_1 = true;
      }
    }
    return Unit_getInstance();
  };
  AGQueueProcessorOpenGL.prototype.abe = function (textureId, target, index, bmp, source, doMipmaps, premultiplied) {
    this.pbo(textureId, target, index, bmp, source, doMipmaps, premultiplied);
  };
  AGQueueProcessorOpenGL.prototype.pbo = function (textureId, target, index, bmp, source, doMipmaps, premultiplied) {
    var bytesPerPixel = source.tav() ? 4 : 1;
    var isFloat = bmp instanceof FloatBitmap32;
    var tmp;
    if (source.tav()) {
      Companion_getInstance_14();
      tmp = 6408;
    } else {
      Companion_getInstance_14();
      tmp = 6409;
    }
    var type = tmp;
    var tmp0_subject = target;
    var tmp0 = tmp0_subject.q2_1;
    var tmp_0;
    if (tmp0 === 2) {
      Companion_getInstance_14();
      tmp_0 = 34069 + index | 0;
    } else {
      tmp_0 = toGl_10(target);
    }
    var texTarget = tmp_0;
    if (bmp == null) {
      var tmp_1 = toGl_10(target);
      var tmp_2 = source.d72();
      var tmp_3 = source.e72();
      Companion_getInstance_14();
      this.nbl_1.aaq(tmp_1, 0, type, tmp_2, tmp_3, 0, type, 5121, null);
    } else {
      if (bmp instanceof NativeImage) {
        if (!(bmp.g7z() === 0)) {
          prepareTexImage2D(this);
          Companion_getInstance_14();
          this.nbl_1.baq(texTarget, 0, type, type, 5121, bmp);
        }
      } else {
        var buffer = createBufferForBitmap(this, bmp, premultiplied);
        if (((!(buffer == null) ? !(source.d72() === 0) : false) ? !(source.e72() === 0) : false) ? !(buffer.s4w_1 === 0) : false) {
          prepareTexImage2D(this);
          var tmp_4;
          if (isFloat ? this.nbl_1.man() ? true : !this.nbl_1.lan() : false) {
            Companion_getInstance_14();
            tmp_4 = 34836;
          } else {
            tmp_4 = type;
          }
          var internalFormat = tmp_4;
          var format = type;
          var tmp_5;
          if (isFloat) {
            Companion_getInstance_14();
            tmp_5 = 5126;
          } else {
            Companion_getInstance_14();
            tmp_5 = 5121;
          }
          var texType = tmp_5;
          this.nbl_1.aaq(texTarget, 0, internalFormat, source.d72(), source.e72(), 0, format, texType, buffer);
        }
      }
    }
    if (doMipmaps) {
      this.nbl_1.fap(texTarget);
    }
  };
  AGQueueProcessorOpenGL.prototype.zbd = function (id) {
    this.fbm_1.ibl(id);
  };
  AGQueueProcessorOpenGL.prototype.mb4 = function (id) {
    var fb = this.fbm_1.k4q(id);
    if (!(fb == null)) {
      var tmp$ret$0;
      // Inline function 'kotlin.also' call
      deleteRenderbuffer(this.nbl_1, fb.tbm_1);
      var tmp0_also = Unit_getInstance();
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.frameBufferDelete.<anonymous>' call
      fb.tbm_1 = -1;
      tmp$ret$0 = tmp0_also;
      var tmp$ret$1;
      // Inline function 'kotlin.also' call
      deleteFramebuffer(this.nbl_1, fb.ubm_1);
      var tmp1_also = Unit_getInstance();
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.korag.gl.AGQueueProcessorOpenGL.frameBufferDelete.<anonymous>' call
      fb.ubm_1 = -1;
      tmp$ret$1 = tmp1_also;
    }
    this.fbm_1.kbl(id);
  };
  AGQueueProcessorOpenGL.prototype.kb4 = function (id, textureId, width, height, hasStencil, hasDepth) {
    var fb = this.fbm_1.ibl(id);
    var tmp0_safe_receiver = this.ebm_1.k4q(textureId);
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qbm_1;
    var glTexId = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
    var nsamples = 1;
    var dirty = (((((!(fb.vbm_1 === width) ? true : !(fb.wbm_1 === height)) ? true : !(fb.xbm_1 === hasDepth)) ? true : !(fb.ybm_1 === hasStencil)) ? true : !(fb.zbm_1 === nsamples)) ? true : !(fb.rbm_1 === this.jay())) ? true : !(fb.sbm_1 === glTexId);
    if (dirty) {
      fb.vbm_1 = width;
      fb.wbm_1 = height;
      fb.xbm_1 = hasDepth;
      fb.ybm_1 = hasStencil;
      fb.zbm_1 = nsamples;
      fb.sbm_1 = glTexId;
      if (!(fb.rbm_1 === this.jay())) {
        fb.rbm_1 = this.jay();
        fb.tbm_1 = genRenderbuffer(this.nbl_1);
        fb.ubm_1 = genFramebuffer(this.nbl_1);
      }
      var doMsaa = false;
      var tmp;
      if (doMsaa) {
        Companion_getInstance_14();
        tmp = 37120;
      } else {
        Companion_getInstance_14();
        tmp = 3553;
      }
      var texTarget = tmp;
      Companion_getInstance_14();
      this.nbl_1.aao(3553, fb.sbm_1);
      Companion_getInstance_14();
      Companion_getInstance_14();
      this.nbl_1.caq(texTarget, 10240, 9729);
      Companion_getInstance_14();
      Companion_getInstance_14();
      this.nbl_1.caq(texTarget, 10241, 9729);
      if (doMsaa) {
        var tmp_0 = fb.zbm_1;
        Companion_getInstance_14();
        this.nbl_1.zaa(texTarget, tmp_0, 6408, fb.vbm_1, fb.wbm_1, false);
      } else {
        Companion_getInstance_14();
        var tmp_1 = fb.vbm_1;
        var tmp_2 = fb.wbm_1;
        Companion_getInstance_14();
        Companion_getInstance_14();
        this.nbl_1.aaq(texTarget, 0, 6408, tmp_1, tmp_2, 0, 6408, 5121, null);
      }
      this.nbl_1.aao(texTarget, 0);
      Companion_getInstance_14();
      this.nbl_1.zan(36161, fb.tbm_1);
      var tmp_3;
      if (fb.dbn()) {
        Companion_getInstance_14();
        tmp_3 = 34041;
      } else if (fb.ybm_1) {
        Companion_getInstance_14();
        tmp_3 = 36168;
      } else if (fb.xbm_1) {
        Companion_getInstance_14();
        tmp_3 = 6402;
      } else {
        tmp_3 = 0;
      }
      var internalFormat = tmp_3;
      if (!(internalFormat === 0)) {
        if (doMsaa) {
          Companion_getInstance_14();
          this.nbl_1.yaa(36161, fb.zbm_1, internalFormat, fb.vbm_1, fb.wbm_1);
        } else {
          Companion_getInstance_14();
          this.nbl_1.uap(36161, internalFormat, fb.vbm_1, fb.wbm_1);
        }
      }
      Companion_getInstance_14();
      this.nbl_1.zan(36161, 0);
    }
  };
  AGQueueProcessorOpenGL.prototype.lb4 = function (id) {
    var fb = this.fbm_1.ibl(id);
    Companion_getInstance_14();
    this.nbl_1.yan(36160, fb.ubm_1);
    Companion_getInstance_14();
    Companion_getInstance_14();
    Companion_getInstance_14();
    this.nbl_1.cap(36160, 36064, 3553, fb.sbm_1, 0);
    var tmp;
    if (fb.dbn()) {
      Companion_getInstance_14();
      tmp = 33306;
    } else if (fb.ybm_1) {
      Companion_getInstance_14();
      tmp = 36128;
    } else if (fb.xbm_1) {
      Companion_getInstance_14();
      tmp = 36096;
    } else {
      tmp = 0;
    }
    var internalFormat = tmp;
    if (!(internalFormat === 0)) {
      Companion_getInstance_14();
      Companion_getInstance_14();
      this.nbl_1.bap(36160, internalFormat, 36161, fb.tbm_1);
    } else {
      Companion_getInstance_14();
      Companion_getInstance_14();
      Companion_getInstance_14();
      this.nbl_1.bap(36160, 36128, 36161, 0);
      Companion_getInstance_14();
      Companion_getInstance_14();
      Companion_getInstance_14();
      this.nbl_1.bap(36096, 36128, 36161, 0);
    }
  };
  AGQueueProcessorOpenGL.$metadata$ = classMeta('AGQueueProcessorOpenGL', [AGQueueProcessor]);
  function GLProgramInfo(programId, vertexId, fragmentId) {
    this.gbm_1 = programId;
    this.hbm_1 = vertexId;
    this.ibm_1 = fragmentId;
    this.jbm_1 = FastStringMap();
    this.kbm_1 = FastStringMap();
  }
  GLProgramInfo.prototype.qbo = function () {
    return this.gbm_1;
  };
  GLProgramInfo.prototype.kbo = function (gl, name) {
    var tmp$ret$2;
    $l$block: {
      // Inline function 'com.soywiz.kds.getOrPut' call
      var tmp0_getOrPut = this.jbm_1;
      var tmp$ret$1;
      // Inline function 'com.soywiz.kds.get' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = tmp0_getOrPut;
      tmp$ret$1 = tmp$ret$0.get(name);
      var res = tmp$ret$1;
      if (!(res == null)) {
        tmp$ret$2 = res;
        break $l$block;
      }
      var tmp$ret$3;
      // Inline function 'com.soywiz.korag.gl.GLProgramInfo.getAttribLocation.<anonymous>' call
      tmp$ret$3 = gl.jap(this.gbm_1, name);
      var out = tmp$ret$3;
      var tmp$ret$6;
      // Inline function 'com.soywiz.kds.set' call
      var tmp$ret$5;
      // Inline function 'kotlin.run' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$4;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$4 = tmp0_getOrPut;
      tmp$ret$5 = tmp$ret$4.set(name, out);
      tmp$ret$6 = tmp$ret$5;
      tmp$ret$2 = out;
    }
    return tmp$ret$2;
  };
  GLProgramInfo.prototype.lbo = function (gl, name) {
    var tmp$ret$2;
    $l$block: {
      // Inline function 'com.soywiz.kds.getOrPut' call
      var tmp0_getOrPut = this.kbm_1;
      var tmp$ret$1;
      // Inline function 'com.soywiz.kds.get' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = tmp0_getOrPut;
      tmp$ret$1 = tmp$ret$0.get(name);
      var res = tmp$ret$1;
      if (!(res == null)) {
        tmp$ret$2 = res;
        break $l$block;
      }
      var tmp$ret$3;
      // Inline function 'com.soywiz.korag.gl.GLProgramInfo.getUniformLocation.<anonymous>' call
      tmp$ret$3 = gl.kap(this.gbm_1, name);
      var out = tmp$ret$3;
      var tmp$ret$6;
      // Inline function 'com.soywiz.kds.set' call
      var tmp$ret$5;
      // Inline function 'kotlin.run' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$4;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$4 = tmp0_getOrPut;
      tmp$ret$5 = tmp$ret$4.set(name, out);
      tmp$ret$6 = tmp$ret$5;
      tmp$ret$2 = out;
    }
    return tmp$ret$2;
  };
  GLProgramInfo.prototype.lbm = function (gl) {
    gl.saq(this.gbm_1);
  };
  GLProgramInfo.prototype.xbn = function (gl) {
    if (!(this.hbm_1 === 0)) {
      gl.sao(this.hbm_1);
    }
    if (!(this.ibm_1 === 0)) {
      gl.sao(this.ibm_1);
    }
    if (!(this.gbm_1 === 0)) {
      gl.qao(this.gbm_1);
    }
    this.hbm_1 = 0;
    this.ibm_1 = 0;
    this.gbm_1 = 0;
  };
  GLProgramInfo.prototype.toString = function () {
    return 'GLProgramInfo(programId=' + this.gbm_1 + ', vertexId=' + this.hbm_1 + ', fragmentId=' + this.ibm_1 + ')';
  };
  GLProgramInfo.prototype.hashCode = function () {
    var result = this.gbm_1;
    result = imul(result, 31) + this.hbm_1 | 0;
    result = imul(result, 31) + this.ibm_1 | 0;
    return result;
  };
  GLProgramInfo.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof GLProgramInfo))
      return false;
    var tmp0_other_with_cast = other instanceof GLProgramInfo ? other : THROW_CCE();
    if (!(this.gbm_1 === tmp0_other_with_cast.gbm_1))
      return false;
    if (!(this.hbm_1 === tmp0_other_with_cast.hbm_1))
      return false;
    if (!(this.ibm_1 === tmp0_other_with_cast.ibm_1))
      return false;
    return true;
  };
  GLProgramInfo.$metadata$ = classMeta('GLProgramInfo');
  function createShader($this, gl, type, str, debugName) {
    var shaderId = gl.mao(type);
    gl.wap(shaderId, str);
    gl.jao(shaderId);
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.COMPILE_STATUS' call
    Companion_getInstance_14();
    tmp$ret$0 = 35713;
    var out = getShaderiv(gl, shaderId, tmp$ret$0);
    var errorInt = gl.lap();
    var tmp$ret$1;
    // Inline function 'com.soywiz.kgl.KmlGl.GTRUE' call
    Companion_getInstance_14();
    tmp$ret$1 = 1;
    if (!(out === tmp$ret$1)) {
      var error = getShaderInfoLog(gl, shaderId);
      throw new ShaderException(str, error, errorInt, gl, debugName, type);
    }
    return shaderId;
  }
  function GLShaderCompiler() {
    GLShaderCompiler_instance = this;
  }
  GLShaderCompiler.prototype.rbo = function (gl, config, program, glSlVersion, debugName) {
    var id = gl.lao();
    var tmp0_elvis_lhs = glSlVersion;
    var guessedGlSlVersion = tmp0_elvis_lhs == null ? get_versionInt(gl) : tmp0_elvis_lhs;
    var tmp1_safe_receiver = Companion_getInstance_38().sbo();
    var tmp3_elvis_lhs = tmp1_safe_receiver == null ? null : toIntOrNull(tmp1_safe_receiver);
    var tmp;
    if (tmp3_elvis_lhs == null) {
      var tmp2_subject = guessedGlSlVersion;
      tmp = tmp2_subject === 460 ? 460 : (300 <= tmp2_subject ? tmp2_subject <= 450 : false) ? 100 : guessedGlSlVersion;
    } else {
      tmp = tmp3_elvis_lhs;
    }
    var usedGlSlVersion = tmp;
    if (Companion_getInstance_38().cb6()) {
      Console_getInstance().n50(['GLSL version: requested=' + glSlVersion + ', guessed=' + guessedGlSlVersion + ', forced=' + Companion_getInstance_38().sbo() + '. used=' + usedGlSlVersion]);
    }
    var tmp$ret$3;
    // Inline function 'com.soywiz.korag.gl.GLShaderCompiler.createShaderCompat' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.FRAGMENT_SHADER' call
    Companion_getInstance_14();
    tmp$ret$0 = 35632;
    var tmp0_createShaderCompat = tmp$ret$0;
    var tmp_0;
    try {
      var tmp$ret$1;
      // Inline function 'com.soywiz.korag.gl.GLShaderCompiler.programCreate.<anonymous>' call
      tmp$ret$1 = toNewGlslString(program.xb5_1, config.vbn(false, usedGlSlVersion, true, false, null, 25, null));
      tmp_0 = createShader(this, gl, tmp0_createShaderCompat, tmp$ret$1, debugName);
    } catch ($p) {
      var tmp_1;
      if ($p instanceof ShaderException) {
        var tmp$ret$2;
        // Inline function 'com.soywiz.korag.gl.GLShaderCompiler.programCreate.<anonymous>' call
        tmp$ret$2 = toNewGlslString(program.xb5_1, config.vbn(false, usedGlSlVersion, false, false, null, 25, null));
        tmp_1 = createShader(this, gl, tmp0_createShaderCompat, tmp$ret$2, debugName);
      } else {
        throw $p;
      }
      tmp_0 = tmp_1;
    }
    tmp$ret$3 = tmp_0;
    var fragmentShaderId = tmp$ret$3;
    var tmp$ret$7;
    // Inline function 'com.soywiz.korag.gl.GLShaderCompiler.createShaderCompat' call
    var tmp$ret$4;
    // Inline function 'com.soywiz.kgl.KmlGl.VERTEX_SHADER' call
    Companion_getInstance_14();
    tmp$ret$4 = 35633;
    var tmp1_createShaderCompat = tmp$ret$4;
    var tmp_2;
    try {
      var tmp$ret$5;
      // Inline function 'com.soywiz.korag.gl.GLShaderCompiler.programCreate.<anonymous>' call
      tmp$ret$5 = toNewGlslString(program.wb5_1, config.vbn(false, usedGlSlVersion, true, false, null, 25, null));
      tmp_2 = createShader(this, gl, tmp1_createShaderCompat, tmp$ret$5, debugName);
    } catch ($p) {
      var tmp_3;
      if ($p instanceof ShaderException) {
        var tmp$ret$6;
        // Inline function 'com.soywiz.korag.gl.GLShaderCompiler.programCreate.<anonymous>' call
        tmp$ret$6 = toNewGlslString(program.wb5_1, config.vbn(false, usedGlSlVersion, false, false, null, 25, null));
        tmp_3 = createShader(this, gl, tmp1_createShaderCompat, tmp$ret$6, debugName);
      } else {
        throw $p;
      }
      tmp_2 = tmp_3;
    }
    tmp$ret$7 = tmp_2;
    var vertexShaderId = tmp$ret$7;
    gl.wan(id, fragmentShaderId);
    gl.wan(id, vertexShaderId);
    gl.rap(id);
    var tmp$ret$8;
    // Inline function 'com.soywiz.kgl.KmlGl.LINK_STATUS' call
    Companion_getInstance_14();
    tmp$ret$8 = 35714;
    var linkStatus = getProgramiv(gl, id, tmp$ret$8);
    return new GLProgramInfo(id, vertexShaderId, fragmentShaderId);
  };
  GLShaderCompiler.prototype.wbn = function (gl, config, program, glSlVersion, debugName, $mask0, $handler) {
    if (!(($mask0 & 8) === 0))
      glSlVersion = null;
    return this.rbo(gl, config, program, glSlVersion, debugName);
  };
  GLShaderCompiler.$metadata$ = objectMeta('GLShaderCompiler');
  var GLShaderCompiler_instance;
  function GLShaderCompiler_getInstance() {
    if (GLShaderCompiler_instance == null)
      new GLShaderCompiler();
    return GLShaderCompiler_instance;
  }
  function setFloats(_this__u8e3s4, offset, data, dataOffset, count) {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.internal.setFloats.<anonymous>' call
    var inductionVariable = 0;
    if (inductionVariable < count)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        _this__u8e3s4.s4x(offset + n | 0, data[dataOffset + n | 0]);
      }
       while (inductionVariable < count);
    tmp$ret$0 = _this__u8e3s4;
    return tmp$ret$0;
  }
  function DummyAG_init_$Init$(width, height, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      width = 640;
    if (!(($mask0 & 2) === 0))
      height = 480;
    DummyAG.call($this, width, height);
    return $this;
  }
  function DummyAG_init_$Create$(width, height, $mask0, $marker) {
    return DummyAG_init_$Init$(width, height, $mask0, $marker, Object.create(DummyAG.prototype));
  }
  function DummyAG(width, height) {
    AG_init_$Init$(false, 1, null, this);
    this.dbq_1 = new Object();
    this.ebq_1 = width;
    this.fbq_1 = height;
  }
  DummyAG.prototype.db9 = function () {
    return this.ebq_1;
  };
  DummyAG.prototype.eb9 = function () {
    return this.fbq_1;
  };
  DummyAG.$metadata$ = classMeta('DummyAG', undefined, undefined, undefined, undefined, AG.prototype);
  function PrintAG_init_$Init$(width, height, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      width = 640;
    if (!(($mask0 & 2) === 0))
      height = 480;
    PrintAG.call($this, width, height);
    return $this;
  }
  function PrintAG_init_$Create$(width, height, $mask0, $marker) {
    return PrintAG_init_$Init$(width, height, $mask0, $marker, Object.create(PrintAG.prototype));
  }
  function PrintAG(width, height) {
    LogBaseAG.call(this, width, height);
  }
  PrintAG.prototype.bbs = function (str, kind) {
    println('PrintAG: ' + str);
  };
  PrintAG.$metadata$ = classMeta('PrintAG', undefined, undefined, undefined, undefined, LogBaseAG.prototype);
  var Kind_DRAW_instance;
  var Kind_DRAW_DETAILS_instance;
  var Kind_CLEAR_instance;
  var Kind_METRICS_instance;
  var Kind_FLIP_instance;
  var Kind_READ_instance;
  var Kind_REPAINT_instance;
  var Kind_DISPOSE_instance;
  var Kind_TEXTURE_UPLOAD_instance;
  var Kind_CLOSE_instance;
  var Kind_FRAME_BUFFER_instance;
  var Kind_BUFFER_instance;
  var Kind_TEXTURE_instance;
  var Kind_SHADER_instance;
  var Kind_OTHER_instance;
  var Kind_UNIFORM_instance;
  var Kind_UNIFORM_VALUES_instance;
  var Kind_SCISSORS_instance;
  var Kind_VIEWPORT_instance;
  var Kind_VERTEX_instance;
  var Kind_ENABLE_DISABLE_instance;
  var Kind_CONTEXT_LOST_instance;
  var Kind_FLUSH_instance;
  var Kind_entriesInitialized;
  function Kind_initEntries() {
    if (Kind_entriesInitialized)
      return Unit_getInstance();
    Kind_entriesInitialized = true;
    Kind_DRAW_instance = new Kind('DRAW', 0);
    Kind_DRAW_DETAILS_instance = new Kind('DRAW_DETAILS', 1);
    Kind_CLEAR_instance = new Kind('CLEAR', 2);
    Kind_METRICS_instance = new Kind('METRICS', 3);
    Kind_FLIP_instance = new Kind('FLIP', 4);
    Kind_READ_instance = new Kind('READ', 5);
    Kind_REPAINT_instance = new Kind('REPAINT', 6);
    Kind_DISPOSE_instance = new Kind('DISPOSE', 7);
    Kind_TEXTURE_UPLOAD_instance = new Kind('TEXTURE_UPLOAD', 8);
    Kind_CLOSE_instance = new Kind('CLOSE', 9);
    Kind_FRAME_BUFFER_instance = new Kind('FRAME_BUFFER', 10);
    Kind_BUFFER_instance = new Kind('BUFFER', 11);
    Kind_TEXTURE_instance = new Kind('TEXTURE', 12);
    Kind_SHADER_instance = new Kind('SHADER', 13);
    Kind_OTHER_instance = new Kind('OTHER', 14);
    Kind_UNIFORM_instance = new Kind('UNIFORM', 15);
    Kind_UNIFORM_VALUES_instance = new Kind('UNIFORM_VALUES', 16);
    Kind_SCISSORS_instance = new Kind('SCISSORS', 17);
    Kind_VIEWPORT_instance = new Kind('VIEWPORT', 18);
    Kind_VERTEX_instance = new Kind('VERTEX', 19);
    Kind_ENABLE_DISABLE_instance = new Kind('ENABLE_DISABLE', 20);
    Kind_CONTEXT_LOST_instance = new Kind('CONTEXT_LOST', 21);
    Kind_FLUSH_instance = new Kind('FLUSH', 22);
  }
  function LogBaseAG$agProcessor$o$draw$lambda(it) {
    var tmp;
    if (typeof it === 'number') {
      tmp = get_niceStr_0(it);
    } else {
      tmp = toString_0(it);
    }
    return tmp;
  }
  function Kind(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Kind.$metadata$ = classMeta('Kind', undefined, undefined, undefined, undefined, Enum.prototype);
  function LogTexture($outer, id, premultiplied) {
    this.qbu_1 = $outer;
    Texture_init_$Init$($outer, premultiplied, null, 4, null, this);
    this.pbu_1 = id;
  }
  LogTexture.prototype.c1n = function () {
    return this.pbu_1;
  };
  LogTexture.prototype.haz = function () {
    this.qbu_1.bbs('' + this + '.uploadedBitmap(' + this.maw_1 + ', ' + this.maw_1.d72() + ', ' + this.maw_1.e72() + ')', Kind_TEXTURE_UPLOAD_getInstance());
  };
  LogTexture.prototype.x2c = function () {
    Texture.prototype.x2c.call(this);
    this.qbu_1.bbs('' + this + '.close()', Kind_CLOSE_getInstance());
  };
  LogTexture.prototype.toString = function () {
    return 'Texture[' + this.pbu_1 + ']';
  };
  LogTexture.$metadata$ = classMeta('LogTexture', undefined, undefined, undefined, undefined, Texture.prototype);
  function LogBuffer($outer, id, list) {
    this.abv_1 = $outer;
    Buffer.call(this, $outer, list);
    this.zbu_1 = id;
  }
  LogBuffer.prototype.c1n = function () {
    return this.zbu_1;
  };
  LogBuffer.prototype.bbv = function () {
    return this.nar_1;
  };
  LogBuffer.prototype.cbv = function () {
    return this.oar_1;
  };
  LogBuffer.prototype.tar = function () {
    Buffer.prototype.tar.call(this);
    this.abv_1.bbs('' + this + '.afterSetMem(mem[' + ensureNotNull(this.nar_1).s4w_1 + '])', Kind_BUFFER_getInstance());
  };
  LogBuffer.prototype.toString = function () {
    return 'Buffer[' + this.zbu_1 + ']';
  };
  LogBuffer.$metadata$ = classMeta('LogBuffer', undefined, undefined, undefined, undefined, Buffer.prototype);
  function LogRenderBuffer($outer, id, isMain) {
    this.xbv_1 = $outer;
    RenderBuffer.call(this, $outer);
    this.vbv_1 = id;
    this.wbv_1 = isMain;
    if (this.wbv_1) {
      var tmp = this.xbv_1.db9();
      var tmp_0 = this.xbv_1.eb9();
      this.zb1(0, 0, tmp, tmp_0, 0, 0, 48, null);
    }
  }
  LogRenderBuffer.prototype.c1n = function () {
    return this.vbv_1;
  };
  LogRenderBuffer.prototype.yb1 = function (x, y, width, height, fullWidth, fullHeight) {
    RenderBuffer.prototype.yb1.call(this, x, y, width, height, fullWidth, fullHeight);
    this.xbv_1.bbs('' + this + '.setSize(' + width + ', ' + height + ')', Kind_FRAME_BUFFER_getInstance());
  };
  LogRenderBuffer.prototype.bb2 = function () {
    return this.xbv_1.bbs('' + this + '.set()', Kind_FRAME_BUFFER_getInstance());
  };
  LogRenderBuffer.prototype.x2c = function () {
    return this.xbv_1.bbs('' + this + '.close()', Kind_FRAME_BUFFER_getInstance());
  };
  LogRenderBuffer.prototype.toString = function () {
    return 'RenderBuffer[' + this.vbv_1 + ']';
  };
  LogRenderBuffer.$metadata$ = classMeta('LogRenderBuffer', undefined, undefined, undefined, undefined, RenderBuffer.prototype);
  function VertexAttributeEx(index, attribute, pos, data) {
    this.ybv_1 = index;
    this.zbv_1 = attribute;
    this.abw_1 = pos;
    this.bbw_1 = data;
    this.cbw_1 = this.bbw_1.db1_1;
    var tmp = this;
    var tmp_0 = this.bbw_1.a4x();
    tmp.dbw_1 = tmp_0 instanceof LogBuffer ? tmp_0 : THROW_CCE();
  }
  VertexAttributeEx.prototype.ebw = function () {
    return this.zbv_1;
  };
  VertexAttributeEx.prototype.toString = function () {
    return 'VertexAttributeEx(index=' + this.ybv_1 + ', attribute=' + this.zbv_1 + ', pos=' + this.abw_1 + ', data=' + this.bbw_1 + ')';
  };
  VertexAttributeEx.prototype.hashCode = function () {
    var result = this.ybv_1;
    result = imul(result, 31) + this.zbv_1.hashCode() | 0;
    result = imul(result, 31) + this.abw_1 | 0;
    result = imul(result, 31) + this.bbw_1.hashCode() | 0;
    return result;
  };
  VertexAttributeEx.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof VertexAttributeEx))
      return false;
    var tmp0_other_with_cast = other instanceof VertexAttributeEx ? other : THROW_CCE();
    if (!(this.ybv_1 === tmp0_other_with_cast.ybv_1))
      return false;
    if (!this.zbv_1.equals(tmp0_other_with_cast.zbv_1))
      return false;
    if (!(this.abw_1 === tmp0_other_with_cast.abw_1))
      return false;
    if (!this.bbw_1.equals(tmp0_other_with_cast.bbw_1))
      return false;
    return true;
  };
  VertexAttributeEx.$metadata$ = classMeta('VertexAttributeEx');
  function LogBaseAG$agProcessor$1(this$0) {
    this.gbw_1 = this$0;
    this.fbw_1 = fastArrayListOf([]);
  }
  LogBaseAG$agProcessor$1.prototype.mj = function () {
    return this.gbw_1.bbs('flush', Kind_FLUSH_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.a2z = function () {
    return this.gbw_1.bbs('finish', Kind_CLOSE_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.vb8 = function () {
    this.gbw_1.bbs('contextLost', Kind_CONTEXT_LOST_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.dbf = function (kind, enable) {
    this.gbw_1.bbs((enable ? 'enable' : 'disable') + ': ' + kind, Kind_ENABLE_DISABLE_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.tbe = function (textureId, x, y, width, height, kind) {
    this.gbw_1.bbs('readPixelsToTexture(' + textureId + ', ' + x + ', ' + y + ', ' + width + ', ' + height + ', ' + kind + ')', Kind_READ_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.ube = function (x, y, width, height, data, kind) {
    return this.gbw_1.bbs('readPixels(' + x + ', ' + y + ', ' + width + ', ' + height + ', ' + kind + ')', Kind_READ_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.aba = function (type, vertexCount, offset, instances, indexType, indices) {
    var tmp;
    if (!(indices == null)) {
      var indexMem = ensureNotNull((indices instanceof LogBuffer ? indices : THROW_CCE()).bbv());
      var range = until(offset, offset + vertexCount | 0);
      var tmp0_subject = indexType;
      var tmp0 = tmp0_subject == null ? -1 : tmp0_subject.q2_1;
      var tmp_0;
      switch (tmp0) {
        case 0:
          var tmp$ret$2;
          // Inline function 'com.soywiz.kds.mapInt' call
          var tmp$ret$1;
          // Inline function 'kotlin.also' call
          var tmp0_also = new IntArrayList((coerceAtLeast(range.w() - range.v() | 0, 0) / range.t1_1 | 0) + 1 | 0);
          // Inline function 'kotlin.contracts.contract' call
          // Inline function 'com.soywiz.kds.mapInt.<anonymous>' call
          var nestedFirst = range.v();
          var nestedLast = range.w();
          var stepArg = range.t1_1;
          if (stepArg <= 0)
            THROW_IAE('Step must be positive, was: ' + stepArg + '.');
          var inductionVariable = nestedFirst;
          var last = getProgressionLastElement(nestedFirst, nestedLast, stepArg);
          var step = stepArg;
          if (inductionVariable <= last)
            do {
              var v = inductionVariable;
              inductionVariable = inductionVariable + step | 0;
              var tmp$ret$0;
              // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
              tmp$ret$0 = indexMem.t4x(v);
              tmp0_also.m4o(tmp$ret$0);
            }
             while (!(v === last));
          tmp$ret$1 = tmp0_also;
          tmp$ret$2 = tmp$ret$1;

          tmp_0 = tmp$ret$2;
          break;
        case 1:
          var tmp$ret$5;
          // Inline function 'com.soywiz.kds.mapInt' call
          var tmp$ret$4;
          // Inline function 'kotlin.also' call
          var tmp0_also_0 = new IntArrayList((coerceAtLeast(range.w() - range.v() | 0, 0) / range.t1_1 | 0) + 1 | 0);
          // Inline function 'kotlin.contracts.contract' call
          // Inline function 'com.soywiz.kds.mapInt.<anonymous>' call
          var nestedFirst_0 = range.v();
          var nestedLast_0 = range.w();
          var stepArg_0 = range.t1_1;
          if (stepArg_0 <= 0)
            THROW_IAE('Step must be positive, was: ' + stepArg_0 + '.');
          var inductionVariable_0 = nestedFirst_0;
          var last_0 = getProgressionLastElement(nestedFirst_0, nestedLast_0, stepArg_0);
          var step_0 = stepArg_0;
          if (inductionVariable_0 <= last_0)
            do {
              var v_0 = inductionVariable_0;
              inductionVariable_0 = inductionVariable_0 + step_0 | 0;
              var tmp$ret$3;
              // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
              tmp$ret$3 = indexMem.u4x(v_0);
              tmp0_also_0.m4o(tmp$ret$3);
            }
             while (!(v_0 === last_0));
          tmp$ret$4 = tmp0_also_0;
          tmp$ret$5 = tmp$ret$4;

          tmp_0 = tmp$ret$5;
          break;
        case 2:
          var tmp$ret$8;
          // Inline function 'com.soywiz.kds.mapInt' call
          var tmp$ret$7;
          // Inline function 'kotlin.also' call
          var tmp0_also_1 = new IntArrayList((coerceAtLeast(range.w() - range.v() | 0, 0) / range.t1_1 | 0) + 1 | 0);
          // Inline function 'kotlin.contracts.contract' call
          // Inline function 'com.soywiz.kds.mapInt.<anonymous>' call
          var nestedFirst_1 = range.v();
          var nestedLast_1 = range.w();
          var stepArg_1 = range.t1_1;
          if (stepArg_1 <= 0)
            THROW_IAE('Step must be positive, was: ' + stepArg_1 + '.');
          var inductionVariable_1 = nestedFirst_1;
          var last_1 = getProgressionLastElement(nestedFirst_1, nestedLast_1, stepArg_1);
          var step_1 = stepArg_1;
          if (inductionVariable_1 <= last_1)
            do {
              var v_1 = inductionVariable_1;
              inductionVariable_1 = inductionVariable_1 + step_1 | 0;
              var tmp$ret$6;
              // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
              tmp$ret$6 = indexMem.w4x(v_1);
              tmp0_also_1.m4o(tmp$ret$6);
            }
             while (!(v_1 === last_1));
          tmp$ret$7 = tmp0_also_1;
          tmp$ret$8 = tmp$ret$7;

          tmp_0 = tmp$ret$8;
          break;
        case -1:
          tmp_0 = null;
          break;
        default:
          noWhenBranchMatchedException();
          break;
      }
      tmp = tmp_0;
    } else {
      tmp = null;
    }
    var _indices = tmp;
    var tmp1_elvis_lhs = _indices;
    var tmp_1;
    if (tmp1_elvis_lhs == null) {
      var tmp$ret$11;
      // Inline function 'com.soywiz.kds.mapInt' call
      var tmp0_mapInt = until(0, vertexCount);
      var tmp$ret$10;
      // Inline function 'kotlin.also' call
      var tmp0_also_2 = new IntArrayList((coerceAtLeast(tmp0_mapInt.w() - tmp0_mapInt.v() | 0, 0) / tmp0_mapInt.t1_1 | 0) + 1 | 0);
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.kds.mapInt.<anonymous>' call
      var nestedFirst_2 = tmp0_mapInt.v();
      var nestedLast_2 = tmp0_mapInt.w();
      var stepArg_2 = tmp0_mapInt.t1_1;
      if (stepArg_2 <= 0)
        THROW_IAE('Step must be positive, was: ' + stepArg_2 + '.');
      var inductionVariable_2 = nestedFirst_2;
      var last_2 = getProgressionLastElement(nestedFirst_2, nestedLast_2, stepArg_2);
      var step_2 = stepArg_2;
      if (inductionVariable_2 <= last_2)
        do {
          var v_2 = inductionVariable_2;
          inductionVariable_2 = inductionVariable_2 + step_2 | 0;
          var tmp$ret$9;
          // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
          tmp$ret$9 = offset + v_2 | 0;
          tmp0_also_2.m4o(tmp$ret$9);
        }
         while (!(v_2 === last_2));
      tmp$ret$10 = tmp0_also_2;
      tmp$ret$11 = tmp$ret$10;
      tmp_1 = tmp$ret$11;
    } else {
      tmp_1 = tmp1_elvis_lhs;
    }
    var _indicesSure = tmp_1;
    this.gbw_1.bbs('draw: ' + type + ', offset=' + offset + ', count=' + vertexCount + ', instances=' + instances + ', indexType=' + indexType, Kind_DRAW_getInstance());
    this.gbw_1.bbs('::draw.indices: ' + _indicesSure, Kind_DRAW_DETAILS_getInstance());
    var tmp$ret$17;
    // Inline function 'kotlin.collections.flatMap' call
    var tmp1_flatMap = this.fbw_1;
    var tmp$ret$16;
    // Inline function 'kotlin.collections.flatMapTo' call
    var tmp0_flatMapTo = ArrayList_init_$Create$();
    var tmp0_iterator = tmp1_flatMap.j();
    while (tmp0_iterator.k()) {
      var element = tmp0_iterator.l();
      var tmp$ret$15;
      // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
      var tmp$ret$14;
      // Inline function 'kotlin.collections.mapIndexed' call
      var tmp0_mapIndexed = zip(element.db1_1.xb4_1, element.db1_1.ab5_1);
      var tmp$ret$13;
      // Inline function 'kotlin.collections.mapIndexedTo' call
      var tmp0_mapIndexedTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapIndexed, 10));
      var index = 0;
      var tmp0_iterator_0 = tmp0_mapIndexed.j();
      while (tmp0_iterator_0.k()) {
        var item = tmp0_iterator_0.l();
        var tmp$ret$12;
        // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>.<anonymous>' call
        var tmp1 = index;
        index = tmp1 + 1 | 0;
        var tmp1__anonymous__uwfjfc = checkIndexOverflow(tmp1);
        tmp$ret$12 = new VertexAttributeEx(tmp1__anonymous__uwfjfc, item.d_1, item.e_1, element);
        tmp0_mapIndexedTo.c(tmp$ret$12);
      }
      tmp$ret$13 = tmp0_mapIndexedTo;
      tmp$ret$14 = tmp$ret$13;
      tmp$ret$15 = tmp$ret$14;
      var list = tmp$ret$15;
      addAll(tmp0_flatMapTo, list);
    }
    tmp$ret$16 = tmp0_flatMapTo;
    tmp$ret$17 = tmp$ret$16;
    var vertexLayoutAttributesEx = tmp$ret$17;
    var tmp_2 = this.fbw_1.i();
    var tmp$ret$20;
    // Inline function 'kotlin.collections.map' call
    var tmp$ret$19;
    // Inline function 'kotlin.collections.mapTo' call
    var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(vertexLayoutAttributesEx, 10));
    var tmp0_iterator_1 = vertexLayoutAttributesEx.j();
    while (tmp0_iterator_1.k()) {
      var item_0 = tmp0_iterator_1.l();
      var tmp$ret$18;
      // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
      tmp$ret$18 = item_0.zbv_1;
      tmp0_mapTo.c(tmp$ret$18);
    }
    tmp$ret$19 = tmp0_mapTo;
    tmp$ret$20 = tmp$ret$19;
    this.gbw_1.bbs('::draw.attributes[' + tmp_2 + ']: ' + tmp$ret$20, Kind_DRAW_DETAILS_getInstance());
    var tmp2_iterator = listOf_0([false, true]).j();
    while (tmp2_iterator.k()) {
      var doInstances = tmp2_iterator.l();
      var tmp_3;
      if (doInstances) {
        var tmp_4 = 0;
        var tmp_5 = instances;
        var tmp_6 = new Int32Array(tmp_5);
        while (tmp_4 < tmp_5) {
          var tmp_7 = tmp_4;
          var tmp$ret$21;
          // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
          tmp$ret$21 = tmp_7;
          tmp_6[tmp_7] = tmp$ret$21;
          tmp_4 = tmp_4 + 1 | 0;
        }
        tmp_3 = toIntArrayList(tmp_6);
      } else {
        tmp_3 = distinct(sorted(_indicesSure));
      }
      var tmp3_iterator = tmp_3.j();
      while (tmp3_iterator.k()) {
        var index_0 = tmp3_iterator.l();
        var tmp$ret$22;
        // Inline function 'kotlin.collections.arrayListOf' call
        tmp$ret$22 = ArrayList_init_$Create$();
        var attributes = tmp$ret$22;
        var tmp4_iterator = vertexLayoutAttributesEx.j();
        $l$loop: while (tmp4_iterator.k()) {
          var vlae = tmp4_iterator.l();
          if (vlae.zbv_1.ibo_1 === 0 === doInstances)
            continue $l$loop;
          var attribute = vlae.zbv_1;
          var vm = ensureNotNull(vlae.dbw_1.bbv());
          var attributeType = attribute.h68();
          var o = (imul(index_0, vlae.cbw_1.cb5_1) + vlae.abw_1 | 0) + vlae.dbw_1.cbv() | 0;
          var acount = attributeType.dbl_1;
          var tmp5_subject = attributeType.cbl_1;
          var tmp0_0 = tmp5_subject.q2_1;
          var tmp_8;
          switch (tmp0_0) {
            case 0:
              var tmp$ret$28;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$25;
              // Inline function 'kotlin.collections.map' call
              var tmp2_map = until(0, acount);
              var tmp$ret$24;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp2_map, 10));
              var inductionVariable_3 = tmp2_map.r1_1;
              var last_3 = tmp2_map.s1_1;
              if (inductionVariable_3 <= last_3)
                do {
                  var item_1 = inductionVariable_3;
                  inductionVariable_3 = inductionVariable_3 + 1 | 0;
                  var tmp$ret$23;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$23 = vm.y4x(o + imul(item_1, 1) | 0);
                  tmp0_mapTo_0.c(tmp$ret$23);
                }
                 while (!(item_1 === last_3));
              tmp$ret$24 = tmp0_mapTo_0;
              tmp$ret$25 = tmp$ret$24;
              var tmp3_map = tmp$ret$25;
              var tmp$ret$27;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
              var tmp0_iterator_2 = tmp3_map.j();
              while (tmp0_iterator_2.k()) {
                var item_2 = tmp0_iterator_2.l();
                var tmp$ret$26;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$26 = attribute.fbo_1 ? item_2 / ByteCompanionObject_getInstance().ef_1 : item_2;
                tmp0_mapTo_1.c(tmp$ret$26);
              }
              tmp$ret$27 = tmp0_mapTo_1;
              tmp$ret$28 = tmp$ret$27;

              tmp_8 = tmp$ret$28;
              break;
            case 1:
              var tmp$ret$34;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$31;
              // Inline function 'kotlin.collections.map' call
              var tmp4_map = until(0, acount);
              var tmp$ret$30;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp4_map, 10));
              var inductionVariable_4 = tmp4_map.r1_1;
              var last_4 = tmp4_map.s1_1;
              if (inductionVariable_4 <= last_4)
                do {
                  var item_3 = inductionVariable_4;
                  inductionVariable_4 = inductionVariable_4 + 1 | 0;
                  var tmp$ret$29;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$29 = vm.y4x(o + imul(item_3, 1) | 0);
                  tmp0_mapTo_2.c(tmp$ret$29);
                }
                 while (!(item_3 === last_4));
              tmp$ret$30 = tmp0_mapTo_2;
              tmp$ret$31 = tmp$ret$30;
              var tmp5_map = tmp$ret$31;
              var tmp$ret$33;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp5_map, 10));
              var tmp0_iterator_3 = tmp5_map.j();
              while (tmp0_iterator_3.k()) {
                var item_4 = tmp0_iterator_3.l();
                var tmp$ret$32;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$32 = attribute.fbo_1 ? item_4 / ByteCompanionObject_getInstance().ef_1 : item_4;
                tmp0_mapTo_3.c(tmp$ret$32);
              }
              tmp$ret$33 = tmp0_mapTo_3;
              tmp$ret$34 = tmp$ret$33;

              tmp_8 = tmp$ret$34;
              break;
            case 2:
              var tmp$ret$40;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$37;
              // Inline function 'kotlin.collections.map' call
              var tmp6_map = until(0, acount);
              var tmp$ret$36;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp6_map, 10));
              var inductionVariable_5 = tmp6_map.r1_1;
              var last_5 = tmp6_map.s1_1;
              if (inductionVariable_5 <= last_5)
                do {
                  var item_5 = inductionVariable_5;
                  inductionVariable_5 = inductionVariable_5 + 1 | 0;
                  var tmp$ret$35;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$35 = vm.z4x(o + imul(item_5, 1) | 0);
                  tmp0_mapTo_4.c(tmp$ret$35);
                }
                 while (!(item_5 === last_5));
              tmp$ret$36 = tmp0_mapTo_4;
              tmp$ret$37 = tmp$ret$36;
              var tmp7_map = tmp$ret$37;
              var tmp$ret$39;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_5 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp7_map, 10));
              var tmp0_iterator_4 = tmp7_map.j();
              while (tmp0_iterator_4.k()) {
                var item_6 = tmp0_iterator_4.l();
                var tmp$ret$38;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$38 = attribute.fbo_1 ? item_6 / 255 : item_6;
                tmp0_mapTo_5.c(tmp$ret$38);
              }
              tmp$ret$39 = tmp0_mapTo_5;
              tmp$ret$40 = tmp$ret$39;

              tmp_8 = tmp$ret$40;
              break;
            case 3:
              var tmp$ret$46;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$43;
              // Inline function 'kotlin.collections.map' call
              var tmp8_map = until(0, acount);
              var tmp$ret$42;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_6 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp8_map, 10));
              var inductionVariable_6 = tmp8_map.r1_1;
              var last_6 = tmp8_map.s1_1;
              if (inductionVariable_6 <= last_6)
                do {
                  var item_7 = inductionVariable_6;
                  inductionVariable_6 = inductionVariable_6 + 1 | 0;
                  var tmp$ret$41;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$41 = vm.a4y(o + imul(item_7, 2) | 0);
                  tmp0_mapTo_6.c(tmp$ret$41);
                }
                 while (!(item_7 === last_6));
              tmp$ret$42 = tmp0_mapTo_6;
              tmp$ret$43 = tmp$ret$42;
              var tmp9_map = tmp$ret$43;
              var tmp$ret$45;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_7 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp9_map, 10));
              var tmp0_iterator_5 = tmp9_map.j();
              while (tmp0_iterator_5.k()) {
                var item_8 = tmp0_iterator_5.l();
                var tmp$ret$44;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$44 = attribute.fbo_1 ? item_8 / ShortCompanionObject_getInstance().mf_1 : item_8;
                tmp0_mapTo_7.c(tmp$ret$44);
              }
              tmp$ret$45 = tmp0_mapTo_7;
              tmp$ret$46 = tmp$ret$45;

              tmp_8 = tmp$ret$46;
              break;
            case 4:
              var tmp$ret$52;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$49;
              // Inline function 'kotlin.collections.map' call
              var tmp10_map = until(0, acount);
              var tmp$ret$48;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_8 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp10_map, 10));
              var inductionVariable_7 = tmp10_map.r1_1;
              var last_7 = tmp10_map.s1_1;
              if (inductionVariable_7 <= last_7)
                do {
                  var item_9 = inductionVariable_7;
                  inductionVariable_7 = inductionVariable_7 + 1 | 0;
                  var tmp$ret$47;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$47 = vm.b4y(o + imul(item_9, 2) | 0);
                  tmp0_mapTo_8.c(tmp$ret$47);
                }
                 while (!(item_9 === last_7));
              tmp$ret$48 = tmp0_mapTo_8;
              tmp$ret$49 = tmp$ret$48;
              var tmp11_map = tmp$ret$49;
              var tmp$ret$51;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_9 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp11_map, 10));
              var tmp0_iterator_6 = tmp11_map.j();
              while (tmp0_iterator_6.k()) {
                var item_10 = tmp0_iterator_6.l();
                var tmp$ret$50;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$50 = attribute.fbo_1 ? item_10 / 65535 : item_10;
                tmp0_mapTo_9.c(tmp$ret$50);
              }
              tmp$ret$51 = tmp0_mapTo_9;
              tmp$ret$52 = tmp$ret$51;

              tmp_8 = tmp$ret$52;
              break;
            case 5:
              var tmp$ret$58;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$55;
              // Inline function 'kotlin.collections.map' call
              var tmp12_map = until(0, acount);
              var tmp$ret$54;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_10 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp12_map, 10));
              var inductionVariable_8 = tmp12_map.r1_1;
              var last_8 = tmp12_map.s1_1;
              if (inductionVariable_8 <= last_8)
                do {
                  var item_11 = inductionVariable_8;
                  inductionVariable_8 = inductionVariable_8 + 1 | 0;
                  var tmp$ret$53;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$53 = vm.c4y(o + imul(item_11, 4) | 0);
                  tmp0_mapTo_10.c(tmp$ret$53);
                }
                 while (!(item_11 === last_8));
              tmp$ret$54 = tmp0_mapTo_10;
              tmp$ret$55 = tmp$ret$54;
              var tmp13_map = tmp$ret$55;
              var tmp$ret$57;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_11 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp13_map, 10));
              var tmp0_iterator_7 = tmp13_map.j();
              while (tmp0_iterator_7.k()) {
                var item_12 = tmp0_iterator_7.l();
                var tmp$ret$56;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$56 = attribute.fbo_1 ? item_12 / IntCompanionObject_getInstance().o1_1 : item_12;
                tmp0_mapTo_11.c(tmp$ret$56);
              }
              tmp$ret$57 = tmp0_mapTo_11;
              tmp$ret$58 = tmp$ret$57;

              tmp_8 = tmp$ret$58;
              break;
            case 6:
              var tmp$ret$64;
              // Inline function 'kotlin.collections.map' call
              var tmp$ret$61;
              // Inline function 'kotlin.collections.map' call
              var tmp14_map = until(0, acount);
              var tmp$ret$60;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_12 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp14_map, 10));
              var inductionVariable_9 = tmp14_map.r1_1;
              var last_9 = tmp14_map.s1_1;
              if (inductionVariable_9 <= last_9)
                do {
                  var item_13 = inductionVariable_9;
                  inductionVariable_9 = inductionVariable_9 + 1 | 0;
                  var tmp$ret$59;
                  // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                  tmp$ret$59 = vm.d4y(o + imul(item_13, 4) | 0);
                  tmp0_mapTo_12.c(tmp$ret$59);
                }
                 while (!(item_13 === last_9));
              tmp$ret$60 = tmp0_mapTo_12;
              tmp$ret$61 = tmp$ret$60;
              var tmp15_map = tmp$ret$61;
              var tmp$ret$63;
              // Inline function 'kotlin.collections.mapTo' call
              var tmp0_mapTo_13 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp15_map, 10));
              var tmp0_iterator_8 = tmp15_map.j();
              while (tmp0_iterator_8.k()) {
                var item_14 = tmp0_iterator_8.l();
                var tmp$ret$62;
                // Inline function 'com.soywiz.korag.log.<no name provided>.draw.<anonymous>' call
                tmp$ret$62 = attribute.fbo_1 ? clamp01(item_14) : item_14;
                tmp0_mapTo_13.c(tmp$ret$62);
              }
              tmp$ret$63 = tmp0_mapTo_13;
              tmp$ret$64 = tmp$ret$63;

              tmp_8 = tmp$ret$64;
              break;
            default:
              noWhenBranchMatchedException();
              break;
          }
          var info = tmp_8;
          // Inline function 'kotlin.collections.plusAssign' call
          var tmp16_plusAssign = attribute.hb6_1 + '[' + joinToString$default(info, ',', null, null, 0, null, LogBaseAG$agProcessor$o$draw$lambda, 30, null) + ']';
          attributes.c(tmp16_plusAssign);
        }
        if (doInstances) {
          var tmp$ret$65;
          // Inline function 'kotlin.collections.isNotEmpty' call
          tmp$ret$65 = !attributes.p();
          if (tmp$ret$65) {
            this.gbw_1.bbs('::draw.instance[' + index_0 + ']: ' + joinToString$default(attributes, ', ', null, null, 0, null, null, 62, null), Kind_DRAW_DETAILS_getInstance());
          }
        } else {
          this.gbw_1.bbs('::draw.vertex[' + index_0 + ']: ' + joinToString$default(attributes, ', ', null, null, 0, null, null, 62, null), Kind_DRAW_DETAILS_getInstance());
        }
      }
    }
  };
  LogBaseAG$agProcessor$1.prototype.lbe = function (id) {
    return this.gbw_1.bbs('bufferCreate: ' + id, Kind_BUFFER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.kbe = function (id) {
    return this.gbw_1.bbs('bufferDelete: ' + id, Kind_BUFFER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.sbe = function (layout, data) {
    return this.gbw_1.bbs('uniformsSet: ' + layout, Kind_UNIFORM_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.nbe = function (id) {
    return this.gbw_1.bbs('uboCreate: ' + id, Kind_UNIFORM_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.mbe = function (id) {
    return this.gbw_1.bbs('uboDelete: ' + id, Kind_UNIFORM_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.yb9 = function (id, ubo) {
    this.gbw_1.bbs('uboSet: ' + id, Kind_UNIFORM_getInstance());
    // Inline function 'com.soywiz.korag.UniformValues.fastForEach' call
    var inductionVariable = 0;
    var last = ubo.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korag.log.<no name provided>.uboSet.<anonymous>' call
        var tmp0__anonymous__q1qw7t = ubo.wat_1.m(n);
        var tmp1__anonymous__uwfjfc = ubo.xat_1.m(n);
        this.gbw_1.bbs('uboSet.uniform: ' + tmp0__anonymous__q1qw7t + ' = ' + Companion_getInstance_34().tat(tmp1__anonymous__uwfjfc), Kind_UNIFORM_VALUES_getInstance());
      }
       while (inductionVariable < last);
  };
  LogBaseAG$agProcessor$1.prototype.zb9 = function (id) {
    return this.gbw_1.bbs('uboUse: ' + id, Kind_UNIFORM_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.zbe = function (face) {
    return this.gbw_1.bbs('cullFace: ' + face, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.ybe = function (face) {
    return this.gbw_1.bbs('frontFace: ' + face, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.bbf = function (rgb, a) {
    return this.gbw_1.bbs('blendEquation: ' + rgb + ', ' + a, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.abf = function (srcRgb, dstRgb, srcA, dstA) {
    return this.gbw_1.bbs('blendFunction: ' + srcRgb + ', ' + dstRgb + ', ' + srcA + ', ' + dstA, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.iao = function (red, green, blue, alpha) {
    return this.gbw_1.bbs('colorMask: ' + red + ', ' + green + ', ' + blue + ', ' + alpha, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.ebf = function (depthTest) {
    return this.gbw_1.bbs('depthFunction: ' + depthTest, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.vao = function (depth) {
    return this.gbw_1.bbs('depthMask: ' + depth, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.rbe = function (near, far) {
    return this.gbw_1.bbs('depthRange: ' + near + ', ' + far, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.qbe = function (compareMode, referenceValue, readMask) {
    return this.gbw_1.bbs('stencilFunction: ' + compareMode + ', ' + referenceValue + ', ' + readMask, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.pbe = function (actionOnDepthFail, actionOnDepthPassStencilFail, actionOnBothPass) {
    return this.gbw_1.bbs('stencilOperation: ' + actionOnDepthFail + ', ' + actionOnDepthPassStencilFail + ', ' + actionOnBothPass, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.yap = function (writeMask) {
    return this.gbw_1.bbs('stencilMask: ' + writeMask, Kind_OTHER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.vap = function (x, y, width, height) {
    return this.gbw_1.bbs('scissor: ' + x + ', ' + y + ', ' + width + ', ' + height, Kind_SCISSORS_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.uaq = function (x, y, width, height) {
    return this.gbw_1.bbs('viewport: ' + x + ', ' + y + ', ' + width + ', ' + height, Kind_VIEWPORT_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.jba = function (color, depth, stencil) {
    return this.gbw_1.bbs('clear: color=' + color + ', depth=' + depth + ', stencil=' + stencil, Kind_CLEAR_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.fao = function (red, green, blue, alpha) {
    return this.gbw_1.bbs('createColor: ' + red + ', ' + green + ', ' + blue + ', ' + alpha, Kind_CLEAR_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.iba = function (depth) {
    return this.gbw_1.bbs('createDepth: ' + depth, Kind_CLEAR_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.hao = function (stencil) {
    return this.gbw_1.bbs('createStencil: ' + stencil, Kind_CLEAR_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.xbe = function (programId, program, programConfig) {
    var tmp = ShaderType_FRAGMENT_getInstance();
    var fragmentGlSl = GlslGenerator_init_$Create$(tmp, null, 2, null).jbw(program.xb5_1);
    var tmp_0 = ShaderType_VERTEX_getInstance();
    var vertexGlSl = GlslGenerator_init_$Create$(tmp_0, null, 2, null).jbw(program.wb5_1);
    this.gbw_1.bbs('programCreate: ' + programId + ', ' + program + ', ' + programConfig + '\nprogramCreate.fragment:' + fragmentGlSl + '\nprogramCreate.vertex:' + vertexGlSl, Kind_SHADER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.wbe = function (programId) {
    return this.gbw_1.bbs('programDelete: ' + programId, Kind_SHADER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.vbe = function (programId) {
    return this.gbw_1.bbs('programUse: ' + programId, Kind_SHADER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.obe = function (id) {
    return this.gbw_1.bbs('vaoCreate: ' + id, Kind_VERTEX_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.bba = function (id) {
    return this.gbw_1.bbs('vaoDelete: ' + id, Kind_VERTEX_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.wb9 = function (id, vao) {
    this.gbw_1.bbs('vaoSet: ' + id + ', ' + new VertexArrayObject(vao), Kind_VERTEX_getInstance());
    this.fbw_1 = _VertexArrayObject___get_list__impl__xj772i(vao);
  };
  LogBaseAG$agProcessor$1.prototype.xb9 = function (id) {
    return this.gbw_1.bbs('vaoUse: ' + id, Kind_VERTEX_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.jbe = function (textureId) {
    return this.gbw_1.bbs('textureCreate: ' + textureId, Kind_TEXTURE_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.dbe = function (textureId) {
    return this.gbw_1.bbs('textureDelete: ' + textureId, Kind_TEXTURE_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.abe = function (textureId, target, index, bmp, source, doMipmaps, premultiplied) {
    this.gbw_1.bbs('textureUpdate: ' + textureId + ', ' + target + ', ' + index + ', ' + bmp + ', ' + source + ', ' + doMipmaps + ', ' + premultiplied, Kind_TEXTURE_UPLOAD_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.cbe = function (textureId, target, implForcedTexId) {
    return this.gbw_1.bbs('textureBind: ' + textureId, Kind_TEXTURE_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.bbe = function (tex) {
    return this.gbw_1.bbs('textureBindEnsuring: ' + tex, Kind_TEXTURE_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.zbd = function (id) {
    return this.gbw_1.bbs('frameBufferCreate: ' + id, Kind_FRAME_BUFFER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.mb4 = function (id) {
    return this.gbw_1.bbs('frameBufferDelete: ' + id, Kind_FRAME_BUFFER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.kb4 = function (id, textureId, width, height, hasStencil, hasDepth) {
    return this.gbw_1.bbs('frameBufferSet: ' + id + ', ' + textureId + ', size=(' + width + ', ' + height + '), hasStencil=' + hasStencil + ', hasDepth=' + hasDepth, Kind_FRAME_BUFFER_getInstance());
  };
  LogBaseAG$agProcessor$1.prototype.lb4 = function (id) {
    return this.gbw_1.bbs('frameBufferUse: ' + id, Kind_FRAME_BUFFER_getInstance());
  };
  LogBaseAG$agProcessor$1.$metadata$ = classMeta(undefined, [AGQueueProcessor]);
  function Kind_DRAW_getInstance() {
    Kind_initEntries();
    return Kind_DRAW_instance;
  }
  function Kind_DRAW_DETAILS_getInstance() {
    Kind_initEntries();
    return Kind_DRAW_DETAILS_instance;
  }
  function Kind_CLEAR_getInstance() {
    Kind_initEntries();
    return Kind_CLEAR_instance;
  }
  function Kind_FLIP_getInstance() {
    Kind_initEntries();
    return Kind_FLIP_instance;
  }
  function Kind_READ_getInstance() {
    Kind_initEntries();
    return Kind_READ_instance;
  }
  function Kind_DISPOSE_getInstance() {
    Kind_initEntries();
    return Kind_DISPOSE_instance;
  }
  function Kind_TEXTURE_UPLOAD_getInstance() {
    Kind_initEntries();
    return Kind_TEXTURE_UPLOAD_instance;
  }
  function Kind_CLOSE_getInstance() {
    Kind_initEntries();
    return Kind_CLOSE_instance;
  }
  function Kind_FRAME_BUFFER_getInstance() {
    Kind_initEntries();
    return Kind_FRAME_BUFFER_instance;
  }
  function Kind_BUFFER_getInstance() {
    Kind_initEntries();
    return Kind_BUFFER_instance;
  }
  function Kind_TEXTURE_getInstance() {
    Kind_initEntries();
    return Kind_TEXTURE_instance;
  }
  function Kind_SHADER_getInstance() {
    Kind_initEntries();
    return Kind_SHADER_instance;
  }
  function Kind_OTHER_getInstance() {
    Kind_initEntries();
    return Kind_OTHER_instance;
  }
  function Kind_UNIFORM_getInstance() {
    Kind_initEntries();
    return Kind_UNIFORM_instance;
  }
  function Kind_UNIFORM_VALUES_getInstance() {
    Kind_initEntries();
    return Kind_UNIFORM_VALUES_instance;
  }
  function Kind_SCISSORS_getInstance() {
    Kind_initEntries();
    return Kind_SCISSORS_instance;
  }
  function Kind_VIEWPORT_getInstance() {
    Kind_initEntries();
    return Kind_VIEWPORT_instance;
  }
  function Kind_VERTEX_getInstance() {
    Kind_initEntries();
    return Kind_VERTEX_instance;
  }
  function Kind_ENABLE_DISABLE_getInstance() {
    Kind_initEntries();
    return Kind_ENABLE_DISABLE_instance;
  }
  function Kind_CONTEXT_LOST_getInstance() {
    Kind_initEntries();
    return Kind_CONTEXT_LOST_instance;
  }
  function Kind_FLUSH_getInstance() {
    Kind_initEntries();
    return Kind_FLUSH_instance;
  }
  function LogBaseAG(width, height) {
    DummyAG.call(this, width, height);
    this.pbt_1 = width;
    this.qbt_1 = height;
    this.rbt_1 = 0;
    this.sbt_1 = 0;
    this.tbt_1 = 0;
    this.ubt_1 = 0;
    this.vbt_1 = linkedHashMapOf([]);
    var tmp = this;
    tmp.wbt_1 = new LogBaseAG$agProcessor$1(this);
  }
  LogBaseAG.prototype.bbs = function (str, kind) {
  };
  LogBaseAG.prototype.hba = function (color, depth, stencil, clearColor, clearDepth, clearStencil, scissor) {
    this.bbs('clear(' + new RGBA(color) + ', ' + depth + ', ' + stencil + ', ' + clearColor + ', ' + clearDepth + ', ' + clearStencil + ')', Kind_CLEAR_getInstance());
  };
  LogBaseAG.prototype.db9 = function () {
    return this.pbt_1;
  };
  LogBaseAG.prototype.eb9 = function () {
    return this.qbt_1;
  };
  LogBaseAG.prototype.hb9 = function (premultiplied, targetKind) {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    var tmp0_this = this;
    var tmp1 = tmp0_this.rbt_1;
    tmp0_this.rbt_1 = tmp1 + 1 | 0;
    var tmp0_apply = new LogTexture(this, tmp1, premultiplied);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.log.LogBaseAG.createTexture.<anonymous>' call
    this.bbs('createTexture():' + tmp0_apply.pbu_1, Kind_TEXTURE_getInstance());
    tmp$ret$0 = tmp0_apply;
    return tmp$ret$0;
  };
  LogBaseAG.prototype.ub4 = function () {
    var tmp$ret$2;
    // Inline function 'com.soywiz.korag.AG.commandsNoWait' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$1;
    // Inline function 'com.soywiz.korag.log.LogBaseAG.createBuffer.<anonymous>' call
    var tmp0__anonymous__q1qw7t = this.hay_1;
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    var tmp0_this = this;
    var tmp1 = tmp0_this.sbt_1;
    tmp0_this.sbt_1 = tmp1 + 1 | 0;
    var tmp0_apply = new LogBuffer(this, tmp1, this.hay_1);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.log.LogBaseAG.createBuffer.<anonymous>.<anonymous>' call
    this.bbs('createBuffer():' + tmp0_apply.zbu_1, Kind_BUFFER_getInstance());
    tmp$ret$0 = tmp0_apply;
    tmp$ret$1 = tmp$ret$0;
    var result = tmp$ret$1;
    if (!this.xay()) {
      this.way(this.hay_1);
    }
    tmp$ret$2 = result;
    return tmp$ret$2;
  };
  LogBaseAG.prototype.fbb = function (list) {
    list.kbf();
    var tmp$ret$2;
    // Inline function 'com.soywiz.korag.processBlockingAll' call
    var tmp0_processBlockingAll = this.wbt_1;
    var tmp$ret$1;
    // Inline function 'kotlin.with' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.processBlocking.<anonymous>' call
    tmp$ret$0 = list.xbd(tmp0_processBlockingAll, -1);
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = Unit_getInstance();
  };
  LogBaseAG.prototype.dba = function () {
    return this.bbs('disposeTemporalPerFrameStuff()', Kind_DISPOSE_getInstance());
  };
  LogBaseAG.prototype.mb7 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    var tmp0_this = this;
    var tmp1 = tmp0_this.tbt_1;
    tmp0_this.tbt_1 = tmp1 + 1 | 0;
    var tmp0_apply = new LogRenderBuffer(this, tmp1, false);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.log.LogBaseAG.createRenderBuffer.<anonymous>' call
    this.bbs('createRenderBuffer():' + tmp0_apply.vbv_1, Kind_FRAME_BUFFER_getInstance());
    tmp$ret$0 = tmp0_apply;
    return tmp$ret$0;
  };
  LogBaseAG.prototype.nb7 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    var tmp0_this = this;
    var tmp1 = tmp0_this.tbt_1;
    tmp0_this.tbt_1 = tmp1 + 1 | 0;
    var tmp0_apply = new LogRenderBuffer(this, tmp1, true);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.log.LogBaseAG.createMainRenderBuffer.<anonymous>' call
    this.bbs('createMainRenderBuffer():' + tmp0_apply.vbv_1, Kind_FRAME_BUFFER_getInstance());
    tmp$ret$0 = tmp0_apply;
    return tmp$ret$0;
  };
  LogBaseAG.prototype.fba = function () {
    return this.bbs('flipInternal()', Kind_FLIP_getInstance());
  };
  LogBaseAG.$metadata$ = classMeta('LogBaseAG', undefined, undefined, undefined, undefined, DummyAG.prototype);
  function toNewGlslString(_this__u8e3s4, config) {
    return toNewGlslStringResult(_this__u8e3s4, config).lbw_1;
  }
  function toNewGlslStringResult(_this__u8e3s4, config) {
    return (new GlslGenerator(_this__u8e3s4.pbw_1, config)).ybw(_this__u8e3s4);
  }
  function GlslGenerator_init_$Init$(kind, config, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0)) {
      config = GlslConfig_init_$Create$(false, 0, false, false, null, 31, null);
    }
    GlslGenerator.call($this, kind, config);
    return $this;
  }
  function GlslGenerator_init_$Create$(kind, config, $mask0, $marker) {
    return GlslGenerator_init_$Init$(kind, config, $mask0, $marker, Object.create(GlslGenerator.prototype));
  }
  function Companion_23() {
    Companion_instance_23 = this;
  }
  Companion_23.prototype.sbo = function () {
    return Companion_getInstance_39().sbo();
  };
  Companion_23.prototype.cb6 = function () {
    return Companion_getInstance_39().cb6();
  };
  Companion_23.$metadata$ = objectMeta('Companion');
  var Companion_instance_23;
  function Companion_getInstance_38() {
    if (Companion_instance_23 == null)
      new Companion_23();
    return Companion_instance_23;
  }
  function Result(generator, result, attributes, uniforms, varyings) {
    this.kbw_1 = generator;
    this.lbw_1 = result;
    this.mbw_1 = attributes;
    this.nbw_1 = uniforms;
    this.obw_1 = varyings;
  }
  Result.prototype.toString = function () {
    return 'Result(generator=' + this.kbw_1 + ', result=' + this.lbw_1 + ', attributes=' + this.mbw_1 + ', uniforms=' + this.nbw_1 + ', varyings=' + this.obw_1 + ')';
  };
  Result.prototype.hashCode = function () {
    var result = hashCode(this.kbw_1);
    result = imul(result, 31) + getStringHashCode(this.lbw_1) | 0;
    result = imul(result, 31) + hashCode(this.mbw_1) | 0;
    result = imul(result, 31) + hashCode(this.nbw_1) | 0;
    result = imul(result, 31) + hashCode(this.obw_1) | 0;
    return result;
  };
  Result.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Result))
      return false;
    var tmp0_other_with_cast = other instanceof Result ? other : THROW_CCE();
    if (!equals(this.kbw_1, tmp0_other_with_cast.kbw_1))
      return false;
    if (!(this.lbw_1 === tmp0_other_with_cast.lbw_1))
      return false;
    if (!equals(this.mbw_1, tmp0_other_with_cast.mbw_1))
      return false;
    if (!equals(this.nbw_1, tmp0_other_with_cast.nbw_1))
      return false;
    if (!equals(this.obw_1, tmp0_other_with_cast.obw_1))
      return false;
    return true;
  };
  Result.$metadata$ = classMeta('Result');
  function GlslGenerator$generateResult$lambda(this$0, $types, $allFuncs) {
    return function ($this$invoke) {
      var tmp;
      if (this$0.ian()) {
        if (!this$0.kan()) {
          if (this$0.dbx()) {
            $this$invoke.d6u('#version ' + this$0.s3r() + ' compatibility');
          } else {
            $this$invoke.d6u('#version ' + this$0.s3r());
          }
        }
        if (this$0.ibw_1.ubn_1.yba_1) {
          $this$invoke.d6u('#extension GL_OES_EGL_image_external : require');
        }
        $this$invoke.d6u('#ifdef GL_ES');
        var tmp$ret$0;
        // Inline function 'com.soywiz.korio.util.Indenter.indent' call
        $this$invoke.f6u();
        try {
          // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>.<anonymous>' call
          $this$invoke.d6u('precision highp float;');
          $this$invoke.d6u('precision highp int;');
          $this$invoke.d6u('precision lowp sampler2D;');
          $this$invoke.d6u('precision lowp samplerCube;');
        }finally {
          $this$invoke.g6u();
        }
        tmp$ret$0 = $this$invoke;
        $this$invoke.d6u('#else');
        var tmp$ret$1;
        // Inline function 'com.soywiz.korio.util.Indenter.indent' call
        $this$invoke.f6u();
        try {
          // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>.<anonymous>' call
          $this$invoke.d6u('  #define highp ');
          $this$invoke.d6u('  #define mediump ');
          $this$invoke.d6u('  #define lowp ');
        }finally {
          $this$invoke.g6u();
        }
        tmp$ret$1 = $this$invoke;
        $this$invoke.d6u('#endif');
        tmp = Unit_getInstance();
      }
      var tmp0_iterator = $types.fbx_1.j();
      while (tmp0_iterator.k()) {
        var it = tmp0_iterator.l();
        $this$invoke.d6u(this$0.jbx() + ' ' + this$0.kbx(it.jb6_1) + this$0.lbx(it.h68()) + ' ' + it.hb6_1 + this$0.mbx(it) + ';');
      }
      var tmp1_iterator = $types.hbx_1.j();
      while (tmp1_iterator.k()) {
        var it_0 = tmp1_iterator.l();
        $this$invoke.d6u(this$0.nbx() + ' ' + this$0.kbx(it_0.jb6_1) + this$0.lbx(it_0.h68()) + ' ' + it_0.hb6_1 + this$0.mbx(it_0) + ';');
      }
      var tmp2_iterator = $types.gbx_1.j();
      $l$loop: while (tmp2_iterator.k()) {
        var it_1 = tmp2_iterator.l();
        if (it_1 instanceof Output)
          continue $l$loop;
        if (this$0.ibw_1.qbx() ? it_1.hb6_1 === this$0.ibw_1.pbx() : false) {
          $this$invoke.d6u('layout(location=0) ' + this$0.obx() + ' ' + this$0.kbx(it_1.jb6_1) + this$0.lbx(it_1.h68()) + ' ' + it_1.hb6_1 + ';');
        } else {
          $this$invoke.d6u(this$0.obx() + ' ' + this$0.kbx(it_1.jb6_1) + this$0.lbx(it_1.h68()) + ' ' + it_1.hb6_1 + ';');
        }
      }
      var tmp3_iterator = $allFuncs.j();
      while (tmp3_iterator.k()) {
        var func = tmp3_iterator.l();
        var gen = new GlslBodyGenerator(this$0.hbw_1, this$0.ibw_1);
        gen.sbx(func);
        var tmp$ret$4;
        // Inline function 'kotlin.collections.map' call
        var tmp0_map = func.vbx_1;
        var tmp$ret$3;
        // Inline function 'kotlin.collections.mapTo' call
        var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
        var tmp0_iterator_0 = tmp0_map.j();
        while (tmp0_iterator_0.k()) {
          var item = tmp0_iterator_0.l();
          var tmp$ret$2;
          // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>.<anonymous>' call
          tmp$ret$2 = this$0.lbx(item.e_1) + ' ' + item.d_1;
          tmp0_mapTo.c(tmp$ret$2);
        }
        tmp$ret$3 = tmp0_mapTo;
        tmp$ret$4 = tmp$ret$3;
        var argsStrings = tmp$ret$4;
        var tmp$ret$7;
        // Inline function 'com.soywiz.korio.util.Indenter.line' call
        var tmp_0 = this$0.lbx(func.ubx_1);
        var tmp1_line = tmp_0 + ' ' + func.tbx_1 + '(' + joinToString$default(argsStrings, ', ', null, null, 0, null, null, 62, null) + ')';
        var tmp_1;
        var tmp$ret$5;
        // Inline function 'kotlin.text.isEmpty' call
        tmp$ret$5 = charSequenceLength(tmp1_line) === 0;
        if (tmp$ret$5) {
          tmp_1 = '{';
        } else {
          tmp_1 = tmp1_line + ' {';
        }
        $this$invoke.d6u(tmp_1);
        var tmp$ret$6;
        // Inline function 'com.soywiz.korio.util.Indenter.indent' call
        $this$invoke.f6u();
        try {
          // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>.<anonymous>' call
          var tmp0_iterator_1 = gen.bby_1.j();
          while (tmp0_iterator_1.k()) {
            var temp = tmp0_iterator_1.l();
            $this$invoke.d6u(this$0.kbx(temp.jb6_1) + this$0.lbx(temp.h68()) + ' ' + temp.hb6_1 + ';');
          }
          $this$invoke.c6u(gen.cby_1);
        }finally {
          $this$invoke.g6u();
        }
        tmp$ret$6 = $this$invoke;
        $this$invoke.d6u('}');
        tmp$ret$7 = $this$invoke;
      }
      return Unit_getInstance();
    };
  }
  function GlslGenerator(kind, config) {
    Companion_getInstance_38();
    this.hbw_1 = kind;
    this.ibw_1 = config;
  }
  GlslGenerator.prototype.n3o = function () {
    return this.ibw_1;
  };
  GlslGenerator.prototype.ian = function () {
    return this.ibw_1.qbn_1;
  };
  GlslGenerator.prototype.s3r = function () {
    return this.ibw_1.rbn_1;
  };
  GlslGenerator.prototype.dbx = function () {
    return this.ibw_1.sbn_1;
  };
  GlslGenerator.prototype.kan = function () {
    return this.ibw_1.tbn_1;
  };
  GlslGenerator.prototype.ybw = function (shader) {
    return this.dby(shader.qbw_1, shader.rbw_1);
  };
  GlslGenerator.prototype.dby = function (root, funcs) {
    var types = new GlobalsProgramVisitor();
    if (this.hbw_1.equals(ShaderType_FRAGMENT_getInstance()) ? this.ibw_1.qbx() : false) {
      var tmp = this.ibw_1.pbx();
      var tmp_0 = VarType_Float4_getInstance();
      types.gbx_1.c(Varying_init_$Create$_0(tmp, tmp_0, null, 4, null));
    }
    var tmp_1 = VarType_TVOID_getInstance();
    var tmp$ret$0;
    // Inline function 'kotlin.collections.listOf' call
    tmp$ret$0 = emptyList();
    var mainFunc = new FuncDecl('main', tmp_1, tmp$ret$0, root);
    types.sbx(mainFunc);
    var tmp$ret$5;
    // Inline function 'kotlin.collections.distinctBy' call
    var tmp$ret$3;
    // Inline function 'kotlin.collections.filter' call
    var tmp$ret$2;
    // Inline function 'kotlin.collections.filterTo' call
    var tmp0_filterTo = ArrayList_init_$Create$();
    var tmp0_iterator = funcs.j();
    while (tmp0_iterator.k()) {
      var element = tmp0_iterator.l();
      var tmp$ret$1;
      // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>' call
      tmp$ret$1 = types.ibx_1.r(element.xbx_1);
      if (tmp$ret$1) {
        tmp0_filterTo.c(element);
      }
    }
    tmp$ret$2 = tmp0_filterTo;
    tmp$ret$3 = tmp$ret$2;
    var tmp0_distinctBy = reversed(tmp$ret$3);
    var set = HashSet_init_$Create$();
    var list = ArrayList_init_$Create$();
    var tmp0_iterator_0 = tmp0_distinctBy.j();
    while (tmp0_iterator_0.k()) {
      var e = tmp0_iterator_0.l();
      var tmp$ret$4;
      // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>' call
      tmp$ret$4 = e.xbx_1.eby_1;
      var key = tmp$ret$4;
      if (set.c(key)) {
        list.c(e);
      }
    }
    tmp$ret$5 = list;
    var customFuncs = tmp$ret$5;
    var tmp0_iterator_1 = funcs.j();
    while (tmp0_iterator_1.k()) {
      var func = tmp0_iterator_1.l();
      types.sbx(mainFunc);
    }
    var allFuncs = plus(customFuncs, listOf(mainFunc));
    var tmp$ret$6;
    // Inline function 'kotlin.also' call
    var tmp_2 = Companion_getInstance_5();
    var tmp1_also = tmp_2.z6s(GlslGenerator$generateResult$lambda(this, types, allFuncs)).toString();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.shader.gl.GlslGenerator.generateResult.<anonymous>' call
    if (Companion_getInstance_39().cb6()) {
      Console_getInstance().p50(['GlSlGenerator.version: ' + this.s3r()]);
      Console_getInstance().o50(['GlSlGenerator:\n' + tmp1_also]);
    }
    tmp$ret$6 = tmp1_also;
    var result = tmp$ret$6;
    var tmp_3;
    if (root instanceof Raw) {
      var tmp_4 = Companion_getInstance_39().zbw_1;
      tmp_3 = root.jby(tmp_4, null, 2, null);
    } else {
      tmp_3 = result;
    }
    return new Result(this, tmp_3, toList_0(types.fbx_1), toList_0(types.hbx_1), toList_0(types.gbx_1));
  };
  GlslGenerator.prototype.kby = function (root, funcs) {
    return this.dby(root, funcs).lbw_1;
  };
  GlslGenerator.prototype.jbw = function (root) {
    return this.kby(root.qbw_1, root.rbw_1);
  };
  GlslGenerator.$metadata$ = classMeta('GlslGenerator', [BaseGlslGenerator]);
  function errorType($this, type) {
    invalidOp("Don't know how to serialize type " + type);
  }
  function BaseGlslGenerator() {
  }
  BaseGlslGenerator.$metadata$ = interfaceMeta('BaseGlslGenerator');
  function GlslConfig_init_$Init$(gles, version, compatibility, android, programConfig, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      gles = true;
    if (!(($mask0 & 2) === 0))
      version = Companion_getInstance_39().abx_1;
    if (!(($mask0 & 4) === 0))
      compatibility = true;
    if (!(($mask0 & 8) === 0))
      android = false;
    if (!(($mask0 & 16) === 0))
      programConfig = Companion_getInstance_42().rb9_1;
    GlslConfig.call($this, gles, version, compatibility, android, programConfig);
    return $this;
  }
  function GlslConfig_init_$Create$(gles, version, compatibility, android, programConfig, $mask0, $marker) {
    return GlslConfig_init_$Init$(gles, version, compatibility, android, programConfig, $mask0, $marker, Object.create(GlslConfig.prototype));
  }
  function Companion_24() {
    Companion_instance_24 = this;
    this.zbw_1 = 'GLSL';
    this.abx_1 = 100;
    this.bbx_1 = 'fragColor';
    this.cbx_1 = 'gl_FragColor';
  }
  Companion_24.prototype.lby = function () {
    return this.zbw_1;
  };
  Companion_24.prototype.sbo = function () {
    return Companion_getInstance_6().c19('FORCE_GLSL_VERSION');
  };
  Companion_24.prototype.cb6 = function () {
    return Companion_getInstance_6().c19('DEBUG_GLSL') === 'true';
  };
  Companion_24.$metadata$ = objectMeta('Companion');
  var Companion_instance_24;
  function Companion_getInstance_39() {
    if (Companion_instance_24 == null)
      new Companion_24();
    return Companion_instance_24;
  }
  function GlslConfig(gles, version, compatibility, android, programConfig) {
    Companion_getInstance_39();
    this.qbn_1 = gles;
    this.rbn_1 = version;
    this.sbn_1 = compatibility;
    this.tbn_1 = android;
    this.ubn_1 = programConfig;
  }
  GlslConfig.prototype.qbx = function () {
    return false;
  };
  GlslConfig.prototype.jbx = function () {
    return this.qbx() ? 'in' : 'attribute';
  };
  GlslConfig.prototype.obx = function () {
    return this.qbx() ? 'out' : 'varying';
  };
  GlslConfig.prototype.nbx = function () {
    return 'uniform';
  };
  GlslConfig.prototype.pbx = function () {
    return this.qbx() ? Companion_getInstance_39().bbx_1 : Companion_getInstance_39().cbx_1;
  };
  GlslConfig.prototype.mby = function (gles, version, compatibility, android, programConfig) {
    return new GlslConfig(gles, version, compatibility, android, programConfig);
  };
  GlslConfig.prototype.vbn = function (gles, version, compatibility, android, programConfig, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      gles = this.qbn_1;
    if (!(($mask0 & 2) === 0))
      version = this.rbn_1;
    if (!(($mask0 & 4) === 0))
      compatibility = this.sbn_1;
    if (!(($mask0 & 8) === 0))
      android = this.tbn_1;
    if (!(($mask0 & 16) === 0))
      programConfig = this.ubn_1;
    return this.mby(gles, version, compatibility, android, programConfig);
  };
  GlslConfig.prototype.toString = function () {
    return 'GlslConfig(gles=' + this.qbn_1 + ', version=' + this.rbn_1 + ', compatibility=' + this.sbn_1 + ', android=' + this.tbn_1 + ', programConfig=' + this.ubn_1 + ')';
  };
  GlslConfig.prototype.hashCode = function () {
    var result = this.qbn_1 | 0;
    result = imul(result, 31) + this.rbn_1 | 0;
    result = imul(result, 31) + (this.sbn_1 | 0) | 0;
    result = imul(result, 31) + (this.tbn_1 | 0) | 0;
    result = imul(result, 31) + this.ubn_1.hashCode() | 0;
    return result;
  };
  GlslConfig.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof GlslConfig))
      return false;
    var tmp0_other_with_cast = other instanceof GlslConfig ? other : THROW_CCE();
    if (!(this.qbn_1 === tmp0_other_with_cast.qbn_1))
      return false;
    if (!(this.rbn_1 === tmp0_other_with_cast.rbn_1))
      return false;
    if (!(this.sbn_1 === tmp0_other_with_cast.sbn_1))
      return false;
    if (!(this.tbn_1 === tmp0_other_with_cast.tbn_1))
      return false;
    if (!this.ubn_1.equals(tmp0_other_with_cast.ubn_1))
      return false;
    return true;
  };
  GlslConfig.$metadata$ = classMeta('GlslConfig');
  function GlobalsProgramVisitor() {
    Visitor.call(this, Unit_getInstance());
    this.fbx_1 = LinkedHashSet_init_$Create$();
    this.gbx_1 = LinkedHashSet_init_$Create$();
    this.hbx_1 = LinkedHashSet_init_$Create$();
    this.ibx_1 = LinkedHashSet_init_$Create$();
  }
  GlobalsProgramVisitor.prototype.nby = function () {
    return this.ibx_1;
  };
  GlobalsProgramVisitor.prototype.oby = function (attribute) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.fbx_1;
    tmp0_plusAssign.c(attribute);
  };
  GlobalsProgramVisitor.prototype.pby = function (attribute) {
    this.oby(attribute);
    return Unit_getInstance();
  };
  GlobalsProgramVisitor.prototype.qby = function (varying) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.gbx_1;
    tmp0_plusAssign.c(varying);
  };
  GlobalsProgramVisitor.prototype.rby = function (varying) {
    this.qby(varying);
    return Unit_getInstance();
  };
  GlobalsProgramVisitor.prototype.sby = function (uniform) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.hbx_1;
    tmp0_plusAssign.c(uniform);
  };
  GlobalsProgramVisitor.prototype.tby = function (uniform) {
    this.sby(uniform);
    return Unit_getInstance();
  };
  GlobalsProgramVisitor.prototype.uby = function (func) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.ibx_1;
    var tmp1_plusAssign = func.wby_1;
    tmp0_plusAssign.c(tmp1_plusAssign);
  };
  GlobalsProgramVisitor.prototype.xby = function (func) {
    this.uby(func);
    return Unit_getInstance();
  };
  GlobalsProgramVisitor.$metadata$ = classMeta('GlobalsProgramVisitor', undefined, undefined, undefined, undefined, Visitor.prototype);
  function GlslBodyGenerator$visit$lambda(this$0) {
    return function (it) {
      return this$0.ibz(it);
    };
  }
  function GlslBodyGenerator$visit$lambda_0(this$0) {
    return function (it) {
      return this$0.ibz(it);
    };
  }
  function GlslBodyGenerator(kind, config) {
    Visitor.call(this, '');
    this.zbx_1 = kind;
    this.aby_1 = config;
    this.bby_1 = LinkedHashSet_init_$Create$();
    var tmp = this;
    tmp.cby_1 = Indenter_init_$Create$(null, 1, null);
  }
  GlslBodyGenerator.prototype.n3o = function () {
    return this.aby_1;
  };
  GlslBodyGenerator.prototype.ybz = function () {
    return this.bby_1;
  };
  GlslBodyGenerator.prototype.zbz = function () {
    return this.cby_1;
  };
  GlslBodyGenerator.prototype.zby = function (stms) {
    var tmp0_iterator = stms.ac0_1.j();
    while (tmp0_iterator.k()) {
      var stm = tmp0_iterator.l();
      this.yby(stm);
    }
  };
  GlslBodyGenerator.prototype.cbz = function (stm) {
    this.cby_1.d6u(this.ibz(stm.bc0_1) + ' = ' + this.ibz(stm.cc0_1) + ';');
  };
  GlslBodyGenerator.prototype.dbz = function (stm) {
    this.cby_1.d6u('discard;');
  };
  GlslBodyGenerator.prototype.ebz = function (stm) {
    this.cby_1.d6u('break;');
  };
  GlslBodyGenerator.prototype.fbz = function (stm) {
    this.cby_1.d6u('continue;');
  };
  GlslBodyGenerator.prototype.hbz = function (stm) {
    var result = stm.dc0_1;
    if (!(result == null)) {
      this.cby_1.d6u('return ' + this.ibz(result) + ';');
    } else {
      this.cby_1.d6u('return;');
    }
  };
  GlslBodyGenerator.prototype.ubz = function (operand) {
    var tmp = this.lbx(operand.fc0_1) + '(';
    return tmp + joinToString$default_0(operand.gc0_1, ', ', null, null, 0, null, GlslBodyGenerator$visit$lambda(this), 30, null) + ')';
  };
  GlslBodyGenerator.prototype.pbz = function (operand) {
    return '(' + operand.ic0_1 + '(' + this.ibz(operand.jc0_1) + ')' + ')';
  };
  GlslBodyGenerator.prototype.qbz = function (operand) {
    return '(' + this.ibz(operand.lc0_1) + ' ' + operand.mc0_1 + ' ' + this.ibz(operand.nc0_1) + ')';
  };
  GlslBodyGenerator.prototype.jbz = function (func) {
    var tmp = func.t2() + '(';
    var tmp_0 = func.pc0();
    return tmp + joinToString$default(tmp_0, ', ', null, null, 0, null, GlslBodyGenerator$visit$lambda_0(this), 30, null) + ')';
  };
  GlslBodyGenerator.prototype.rbz = function (ternary) {
    return '((' + this.ibz(ternary.rc0_1) + ') ? (' + this.ibz(ternary.sc0_1) + ') : (' + this.ibz(ternary.tc0_1) + '))';
  };
  GlslBodyGenerator.prototype.abz = function (stm) {
    var tmp$ret$6;
    // Inline function 'kotlin.apply' call
    var tmp0_apply = this.cby_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.shader.gl.GlslBodyGenerator.visit.<anonymous>' call
    var tmp$ret$2;
    // Inline function 'com.soywiz.korio.util.Indenter.line' call
    var tmp0_line = 'if (' + this.ibz(stm.uc0_1) + ')';
    var tmp;
    var tmp$ret$0;
    // Inline function 'kotlin.text.isEmpty' call
    tmp$ret$0 = charSequenceLength(tmp0_line) === 0;
    if (tmp$ret$0) {
      tmp = '{';
    } else {
      tmp = tmp0_line + ' {';
    }
    tmp0_apply.d6u(tmp);
    var tmp$ret$1;
    // Inline function 'com.soywiz.korio.util.Indenter.indent' call
    tmp0_apply.f6u();
    try {
      // Inline function 'com.soywiz.korag.shader.gl.GlslBodyGenerator.visit.<anonymous>.<anonymous>' call
      this.yby(stm.vc0_1);
    }finally {
      tmp0_apply.g6u();
    }
    tmp$ret$1 = tmp0_apply;
    tmp0_apply.d6u('}');
    tmp$ret$2 = tmp0_apply;
    if (!(stm.wc0_1 == null)) {
      var tmp$ret$5;
      // Inline function 'com.soywiz.korio.util.Indenter.line' call
      var tmp_0;
      var tmp$ret$3;
      // Inline function 'kotlin.text.isEmpty' call
      tmp$ret$3 = charSequenceLength('else') === 0;
      if (tmp$ret$3) {
        tmp_0 = '{';
      } else {
        tmp_0 = 'else {';
      }
      tmp0_apply.d6u(tmp_0);
      var tmp$ret$4;
      // Inline function 'com.soywiz.korio.util.Indenter.indent' call
      tmp0_apply.f6u();
      try {
        // Inline function 'com.soywiz.korag.shader.gl.GlslBodyGenerator.visit.<anonymous>.<anonymous>' call
        this.yby(ensureNotNull(stm.wc0_1));
      }finally {
        tmp0_apply.g6u();
      }
      tmp$ret$4 = tmp0_apply;
      tmp0_apply.d6u('}');
      tmp$ret$5 = tmp0_apply;
    }
    tmp$ret$6 = tmp0_apply;
  };
  GlslBodyGenerator.prototype.bbz = function (stm) {
    var tmp$ret$3;
    // Inline function 'kotlin.apply' call
    var tmp0_apply = this.cby_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.shader.gl.GlslBodyGenerator.visit.<anonymous>' call
    var varType = this.lbx(stm.xc0_1.h68());
    var loopVar = this.lbz(stm.xc0_1);
    var min = this.ibz(stm.yc0_1);
    var maxExclusive = this.ibz(stm.zc0_1);
    var tmp$ret$2;
    // Inline function 'com.soywiz.korio.util.Indenter.line' call
    var tmp0_line = 'for (' + varType + ' ' + loopVar + ' = (' + min + '); ' + loopVar + ' < (' + maxExclusive + '); ' + loopVar + '++)';
    var tmp;
    var tmp$ret$0;
    // Inline function 'kotlin.text.isEmpty' call
    tmp$ret$0 = charSequenceLength(tmp0_line) === 0;
    if (tmp$ret$0) {
      tmp = '{';
    } else {
      tmp = tmp0_line + ' {';
    }
    tmp0_apply.d6u(tmp);
    var tmp$ret$1;
    // Inline function 'com.soywiz.korio.util.Indenter.indent' call
    tmp0_apply.f6u();
    try {
      // Inline function 'com.soywiz.korag.shader.gl.GlslBodyGenerator.visit.<anonymous>.<anonymous>' call
      this.yby(stm.ac1_1);
    }finally {
      tmp0_apply.g6u();
    }
    tmp$ret$1 = tmp0_apply;
    tmp0_apply.d6u('}');
    tmp$ret$2 = tmp0_apply;
    tmp$ret$3 = tmp0_apply;
  };
  GlslBodyGenerator.prototype.gbz = function (stm) {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    var tmp0_apply = this.cby_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.shader.gl.GlslBodyGenerator.visit.<anonymous>' call
    var tmp = Companion_getInstance_39().zbw_1;
    tmp0_apply.d6u(stm.jby(tmp, null, 2, null));
    tmp$ret$0 = tmp0_apply;
  };
  GlslBodyGenerator.prototype.lbz = function (operand) {
    Visitor.prototype.lbz.call(this, operand);
    var tmp0_subject = operand;
    var tmp;
    if (tmp0_subject instanceof Output) {
      var tmp1_subject = this.zbx_1;
      var tmp0 = tmp1_subject.q2_1;
      var tmp_0;
      switch (tmp0) {
        case 0:
          tmp_0 = 'gl_Position';
          break;
        case 1:
          tmp_0 = this.aby_1.pbx();
          break;
        default:
          noWhenBranchMatchedException();
          break;
      }
      tmp = tmp_0;
    } else {
      tmp = operand.hb6_1;
    }
    return tmp;
  };
  GlslBodyGenerator.prototype.mbz = function (temp) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.bby_1;
    tmp0_plusAssign.c(temp);
    return Visitor.prototype.mbz.call(this, temp);
  };
  GlslBodyGenerator.prototype.obz = function (output) {
    return Visitor.prototype.obz.call(this, output);
  };
  GlslBodyGenerator.prototype.vbz = function (operand) {
    return '' + operand.cc1_1;
  };
  GlslBodyGenerator.prototype.wbz = function (operand) {
    var str = '' + operand.ec1_1;
    var tmp;
    var tmp_0 = _Char___init__impl__6a9atx(46);
    if (contains$default_0(str, tmp_0, false, 2, null)) {
      tmp = str;
    } else {
      tmp = str + '.0';
    }
    return tmp;
  };
  GlslBodyGenerator.prototype.xbz = function (operand) {
    return '' + operand.gc1_1;
  };
  GlslBodyGenerator.prototype.sbz = function (operand) {
    return this.ibz(operand.ic1_1) + '.' + operand.jc1_1;
  };
  GlslBodyGenerator.prototype.tbz = function (operand) {
    return this.ibz(operand.lc1_1) + '[' + this.ibz(operand.mc1_1) + ']';
  };
  GlslBodyGenerator.$metadata$ = classMeta('GlslBodyGenerator', [BaseGlslGenerator], undefined, undefined, undefined, Visitor.prototype);
  function Func_init_$Init$(name, ops, type, $this) {
    Func.call($this, name, toList_1(ops), type);
    return $this;
  }
  function Func_init_$Create$(name, ops, type) {
    return Func_init_$Init$(name, ops, type, Object.create(Func.prototype));
  }
  function Func_init_$Init$_0(name, ops, type, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      type = VarType_Float1_getInstance();
    Func_init_$Init$(name, ops, type, $this);
    return $this;
  }
  function Func_init_$Create$_0(name, ops, type, $mask0, $marker) {
    return Func_init_$Init$_0(name, ops, type, $mask0, $marker, Object.create(Func.prototype));
  }
  function If_init_$Init$(cond, tbody, fbody, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      fbody = null;
    If.call($this, cond, tbody, fbody);
    return $this;
  }
  function If_init_$Create$(cond, tbody, fbody, $mask0, $marker) {
    return If_init_$Init$(cond, tbody, fbody, $mask0, $marker, Object.create(If.prototype));
  }
  function Stms(stms) {
    Stm.call(this);
    this.ac0_1 = stms;
  }
  Stms.prototype.toString = function () {
    return 'Stms(stms=' + this.ac0_1 + ')';
  };
  Stms.prototype.hashCode = function () {
    return hashCode(this.ac0_1);
  };
  Stms.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Stms))
      return false;
    var tmp0_other_with_cast = other instanceof Stms ? other : THROW_CCE();
    if (!equals(this.ac0_1, tmp0_other_with_cast.ac0_1))
      return false;
    return true;
  };
  Stms.$metadata$ = classMeta('Stms', undefined, undefined, undefined, undefined, Stm.prototype);
  function Set(to, from) {
    Stm.call(this);
    this.bc0_1 = to;
    this.cc0_1 = from;
  }
  Set.prototype.toString = function () {
    return 'Set(to=' + this.bc0_1 + ', from=' + this.cc0_1 + ')';
  };
  Set.prototype.hashCode = function () {
    var result = hashCode(this.bc0_1);
    result = imul(result, 31) + hashCode(this.cc0_1) | 0;
    return result;
  };
  Set.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Set))
      return false;
    var tmp0_other_with_cast = other instanceof Set ? other : THROW_CCE();
    if (!equals(this.bc0_1, tmp0_other_with_cast.bc0_1))
      return false;
    if (!equals(this.cc0_1, tmp0_other_with_cast.cc0_1))
      return false;
    return true;
  };
  Set.$metadata$ = classMeta('Set', undefined, undefined, undefined, undefined, Stm.prototype);
  function Return(result) {
    Stm.call(this);
    this.dc0_1 = result;
  }
  Return.prototype.toString = function () {
    return 'Return(result=' + this.dc0_1 + ')';
  };
  Return.prototype.hashCode = function () {
    return this.dc0_1 == null ? 0 : hashCode(this.dc0_1);
  };
  Return.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Return))
      return false;
    var tmp0_other_with_cast = other instanceof Return ? other : THROW_CCE();
    if (!equals(this.dc0_1, tmp0_other_with_cast.dc0_1))
      return false;
    return true;
  };
  Return.$metadata$ = classMeta('Return', undefined, undefined, undefined, undefined, Stm.prototype);
  function Break() {
  }
  Break.$metadata$ = objectMeta('Break', undefined, undefined, undefined, undefined, Stm.prototype);
  function Continue() {
  }
  Continue.$metadata$ = objectMeta('Continue', undefined, undefined, undefined, undefined, Stm.prototype);
  function Discard() {
    Discard_instance = this;
    Stm.call(this);
  }
  Discard.prototype.toString = function () {
    return 'Discard';
  };
  Discard.$metadata$ = objectMeta('Discard', undefined, undefined, undefined, undefined, Stm.prototype);
  var Discard_instance;
  function Discard_getInstance() {
    if (Discard_instance == null)
      new Discard();
    return Discard_instance;
  }
  function If(cond, tbody, fbody) {
    Stm.call(this);
    this.uc0_1 = cond;
    this.vc0_1 = tbody;
    this.wc0_1 = fbody;
  }
  If.prototype.nc1 = function () {
    return this.uc0_1;
  };
  If.prototype.oc1 = function () {
    return this.vc0_1;
  };
  If.prototype.pc1 = function () {
    return this.wc0_1;
  };
  If.prototype.toString = function () {
    return 'If(cond=' + this.uc0_1 + ', tbody=' + this.vc0_1 + ', fbody=' + this.wc0_1 + ')';
  };
  If.prototype.hashCode = function () {
    var result = hashCode(this.uc0_1);
    result = imul(result, 31) + hashCode(this.vc0_1) | 0;
    result = imul(result, 31) + (this.wc0_1 == null ? 0 : hashCode(this.wc0_1)) | 0;
    return result;
  };
  If.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof If))
      return false;
    var tmp0_other_with_cast = other instanceof If ? other : THROW_CCE();
    if (!equals(this.uc0_1, tmp0_other_with_cast.uc0_1))
      return false;
    if (!equals(this.vc0_1, tmp0_other_with_cast.vc0_1))
      return false;
    if (!equals(this.wc0_1, tmp0_other_with_cast.wc0_1))
      return false;
    return true;
  };
  If.$metadata$ = classMeta('If', undefined, undefined, undefined, undefined, Stm.prototype);
  function ForSimple() {
  }
  ForSimple.prototype.qc1 = function () {
    return this.xc0_1;
  };
  ForSimple.prototype.b7x = function () {
    return this.yc0_1;
  };
  ForSimple.prototype.rc1 = function () {
    return this.zc0_1;
  };
  ForSimple.prototype.sc1 = function () {
    return this.ac1_1;
  };
  ForSimple.$metadata$ = classMeta('ForSimple', undefined, undefined, undefined, undefined, Stm.prototype);
  function Raw() {
  }
  Raw.prototype.tc1 = function (name) {
    return this.hby_1.q(name);
  };
  Raw.prototype.uc1 = function (name, default_0) {
    var tmp0_elvis_lhs = this.tc1(name);
    return tmp0_elvis_lhs == null ? default_0 : tmp0_elvis_lhs;
  };
  Raw.prototype.jby = function (name, default_0, $mask0, $handler) {
    if (!(($mask0 & 2) === 0))
      default_0 = '';
    return this.uc1(name, default_0);
  };
  Raw.$metadata$ = classMeta('Raw', undefined, undefined, undefined, undefined, Stm.prototype);
  function Program$ExpressionBuilder$Companion$INSTANCE$1() {
  }
  Program$ExpressionBuilder$Companion$INSTANCE$1.$metadata$ = classMeta(undefined, [ExpressionBuilder]);
  function Companion_25() {
    Companion_instance_25 = this;
    var tmp = this;
    tmp.vc1_1 = new Program$ExpressionBuilder$Companion$INSTANCE$1();
  }
  Companion_25.prototype.wc1 = function (block) {
    return block(this.vc1_1);
  };
  Companion_25.$metadata$ = objectMeta('Companion');
  var Companion_instance_25;
  function Companion_getInstance_40() {
    if (Companion_instance_25 == null)
      new Companion_25();
    return Companion_instance_25;
  }
  function Builder_init_$Init$(context, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      context = new BuilderContext();
    Builder.call($this, context);
    return $this;
  }
  function Builder_init_$Init$_0(parent, $this) {
    Builder.call($this, parent.db5_1);
    return $this;
  }
  function Builder_init_$Create$(parent) {
    return Builder_init_$Init$_0(parent, Object.create(Builder.prototype));
  }
  function Builder_init_$Init$_1(type, $this) {
    Builder_init_$Init$(null, 1, null, $this);
    return $this;
  }
  function Builder_init_$Create$_0(type) {
    return Builder_init_$Init$_1(type, Object.create(Builder.prototype));
  }
  function Program$Builder$IF_ELSE_BINARY_LOOKUP$lambda($block, $max) {
    return function ($this$null) {
      $block($this$null, $max);
      return Unit_getInstance();
    };
  }
  function Program$Builder$IF_ELSE_BINARY_LOOKUP$lambda_0($ref, $middle, $max, $block) {
    return function ($this$null) {
      $this$null.nbg($ref, $middle + 1 | 0, $max, $block);
      return Unit_getInstance();
    };
  }
  function Program$Builder$IF_ELSE_LIST$lambda($ref, $min, $max, $block) {
    return function ($this$null) {
      $this$null.obg($ref, $min + 1 | 0, $max, $block);
      return Unit_getInstance();
    };
  }
  function Program_init_$Init$(vertex, fragment, name, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      name = 'program-' + vertex.sbw_1 + '-' + fragment.sbw_1;
    Program.call($this, vertex, fragment, name);
    return $this;
  }
  function Program_init_$Create$(vertex, fragment, name, $mask0, $marker) {
    return Program_init_$Init$(vertex, fragment, name, $mask0, $marker, Object.create(Program.prototype));
  }
  function Ternary() {
  }
  Ternary.$metadata$ = classMeta('Ternary', undefined, undefined, undefined, undefined, Operand.prototype);
  function Unop(op, right) {
    Operand.call(this, right.h68());
    this.ic0_1 = op;
    this.jc0_1 = right;
  }
  Unop.prototype.toString = function () {
    return 'Unop(op=' + this.ic0_1 + ', right=' + this.jc0_1 + ')';
  };
  Unop.prototype.hashCode = function () {
    var result = getStringHashCode(this.ic0_1);
    result = imul(result, 31) + hashCode(this.jc0_1) | 0;
    return result;
  };
  Unop.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Unop))
      return false;
    var tmp0_other_with_cast = other instanceof Unop ? other : THROW_CCE();
    if (!(this.ic0_1 === tmp0_other_with_cast.ic0_1))
      return false;
    if (!equals(this.jc0_1, tmp0_other_with_cast.jc0_1))
      return false;
    return true;
  };
  Unop.$metadata$ = classMeta('Unop', undefined, undefined, undefined, undefined, Operand.prototype);
  function Binop(left, op, right) {
    Operand.call(this, left.h68());
    this.lc0_1 = left;
    this.mc0_1 = op;
    this.nc0_1 = right;
  }
  Binop.prototype.toString = function () {
    return 'Binop(left=' + this.lc0_1 + ', op=' + this.mc0_1 + ', right=' + this.nc0_1 + ')';
  };
  Binop.prototype.hashCode = function () {
    var result = hashCode(this.lc0_1);
    result = imul(result, 31) + getStringHashCode(this.mc0_1) | 0;
    result = imul(result, 31) + hashCode(this.nc0_1) | 0;
    return result;
  };
  Binop.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Binop))
      return false;
    var tmp0_other_with_cast = other instanceof Binop ? other : THROW_CCE();
    if (!equals(this.lc0_1, tmp0_other_with_cast.lc0_1))
      return false;
    if (!(this.mc0_1 === tmp0_other_with_cast.mc0_1))
      return false;
    if (!equals(this.nc0_1, tmp0_other_with_cast.nc0_1))
      return false;
    return true;
  };
  Binop.$metadata$ = classMeta('Binop', undefined, undefined, undefined, undefined, Operand.prototype);
  function IntLiteral() {
  }
  IntLiteral.$metadata$ = classMeta('IntLiteral', undefined, undefined, undefined, undefined, Operand.prototype);
  function FloatLiteral(value) {
    Operand.call(this, VarType_Float1_getInstance());
    this.ec1_1 = value;
  }
  FloatLiteral.prototype.toString = function () {
    return 'FloatLiteral(value=' + this.ec1_1 + ')';
  };
  FloatLiteral.prototype.hashCode = function () {
    return getNumberHashCode(this.ec1_1);
  };
  FloatLiteral.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof FloatLiteral))
      return false;
    var tmp0_other_with_cast = other instanceof FloatLiteral ? other : THROW_CCE();
    if (!equals(this.ec1_1, tmp0_other_with_cast.ec1_1))
      return false;
    return true;
  };
  FloatLiteral.$metadata$ = classMeta('FloatLiteral', undefined, undefined, undefined, undefined, Operand.prototype);
  function BoolLiteral() {
  }
  BoolLiteral.$metadata$ = classMeta('BoolLiteral', undefined, undefined, undefined, undefined, Operand.prototype);
  function Vector(type, ops) {
    Operand.call(this, type);
    this.fc0_1 = type;
    this.gc0_1 = ops;
  }
  Vector.prototype.h68 = function () {
    return this.fc0_1;
  };
  Vector.prototype.equals = function (other) {
    var tmp;
    var tmp_0;
    if (other instanceof Vector) {
      tmp_0 = this.fc0_1.equals(other.fc0_1);
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = contentEquals(this.gc0_1, other.gc0_1);
    } else {
      tmp = false;
    }
    return tmp;
  };
  Vector.prototype.hashCode = function () {
    return imul(this.fc0_1.hashCode(), 7) + contentHashCode(this.gc0_1) | 0;
  };
  Vector.prototype.toString = function () {
    return 'Vector(type=' + this.fc0_1 + ', ops=' + toString_0(this.gc0_1) + ')';
  };
  Vector.$metadata$ = classMeta('Vector', undefined, undefined, undefined, undefined, Operand.prototype);
  function Swizzle(left, swizzle) {
    Operand.call(this, left.h68().xc1(swizzle.length));
    this.ic1_1 = left;
    this.jc1_1 = swizzle;
  }
  Swizzle.prototype.toString = function () {
    return 'Swizzle(left=' + this.ic1_1 + ', swizzle=' + this.jc1_1 + ')';
  };
  Swizzle.prototype.hashCode = function () {
    var result = hashCode(this.ic1_1);
    result = imul(result, 31) + getStringHashCode(this.jc1_1) | 0;
    return result;
  };
  Swizzle.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Swizzle))
      return false;
    var tmp0_other_with_cast = other instanceof Swizzle ? other : THROW_CCE();
    if (!equals(this.ic1_1, tmp0_other_with_cast.ic1_1))
      return false;
    if (!(this.jc1_1 === tmp0_other_with_cast.jc1_1))
      return false;
    return true;
  };
  Swizzle.$metadata$ = classMeta('Swizzle', undefined, undefined, undefined, undefined, Operand.prototype);
  function ArrayAccess() {
  }
  ArrayAccess.$metadata$ = classMeta('ArrayAccess', undefined, undefined, undefined, undefined, Operand.prototype);
  function BaseFunc(type) {
    Operand.call(this, type);
  }
  BaseFunc.$metadata$ = classMeta('BaseFunc', undefined, undefined, undefined, undefined, Operand.prototype);
  function Func(name, ops, type) {
    BaseFunc.call(this, type);
    this.zc1_1 = name;
    this.ac2_1 = ops;
    this.bc2_1 = type;
  }
  Func.prototype.t2 = function () {
    return this.zc1_1;
  };
  Func.prototype.pc0 = function () {
    return this.ac2_1;
  };
  Func.prototype.h68 = function () {
    return this.bc2_1;
  };
  Func.prototype.toString = function () {
    return 'Func(name=' + this.zc1_1 + ', ops=' + this.ac2_1 + ', type=' + this.bc2_1 + ')';
  };
  Func.prototype.hashCode = function () {
    var result = getStringHashCode(this.zc1_1);
    result = imul(result, 31) + hashCode(this.ac2_1) | 0;
    result = imul(result, 31) + this.bc2_1.hashCode() | 0;
    return result;
  };
  Func.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Func))
      return false;
    var tmp0_other_with_cast = other instanceof Func ? other : THROW_CCE();
    if (!(this.zc1_1 === tmp0_other_with_cast.zc1_1))
      return false;
    if (!equals(this.ac2_1, tmp0_other_with_cast.ac2_1))
      return false;
    if (!this.bc2_1.equals(tmp0_other_with_cast.bc2_1))
      return false;
    return true;
  };
  Func.$metadata$ = classMeta('Func', undefined, undefined, undefined, undefined, BaseFunc.prototype);
  function CustomFunc() {
  }
  CustomFunc.$metadata$ = classMeta('CustomFunc', undefined, undefined, undefined, undefined, BaseFunc.prototype);
  function FuncRef(name, rettype, args) {
    this.eby_1 = name;
    this.fby_1 = rettype;
    this.gby_1 = args;
  }
  FuncRef.prototype.t2 = function () {
    return this.eby_1;
  };
  FuncRef.prototype.toString = function () {
    return 'FuncRef(name=' + this.eby_1 + ', rettype=' + this.fby_1 + ', args=' + this.gby_1 + ')';
  };
  FuncRef.prototype.hashCode = function () {
    var result = getStringHashCode(this.eby_1);
    result = imul(result, 31) + this.fby_1.hashCode() | 0;
    result = imul(result, 31) + hashCode(this.gby_1) | 0;
    return result;
  };
  FuncRef.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof FuncRef))
      return false;
    var tmp0_other_with_cast = other instanceof FuncRef ? other : THROW_CCE();
    if (!(this.eby_1 === tmp0_other_with_cast.eby_1))
      return false;
    if (!this.fby_1.equals(tmp0_other_with_cast.fby_1))
      return false;
    if (!equals(this.gby_1, tmp0_other_with_cast.gby_1))
      return false;
    return true;
  };
  FuncRef.$metadata$ = classMeta('FuncRef');
  function Stm() {
  }
  Stm.$metadata$ = classMeta('Stm');
  function BuilderContext() {
    var tmp = this;
    var tmp$ret$0;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp$ret$0 = ArrayList_init_$Create$();
    tmp.cc2_1 = tmp$ret$0;
    this.dc2_1 = 3;
  }
  BuilderContext.$metadata$ = classMeta('BuilderContext');
  function ExpressionBuilder() {
  }
  ExpressionBuilder.$metadata$ = interfaceMeta('ExpressionBuilder');
  function Builder(context) {
    this.db5_1 = context;
    var tmp = this;
    var tmp$ret$0;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp$ret$0 = ArrayList_init_$Create$();
    tmp.eb5_1 = tmp$ret$0;
  }
  Builder.prototype.hbg = function () {
    return this.eb5_1;
  };
  Builder.prototype.ibg = function () {
    return Builder_init_$Create$(this);
  };
  Builder.prototype.jbg = function () {
    return new Stms(toList_0(this.eb5_1));
  };
  Builder.prototype.kbg = function () {
    return toList_0(this.db5_1.cc2_1);
  };
  Builder.prototype.ib5 = function () {
    return to(this.jbg(), this.kbg());
  };
  Builder.prototype.lbg = function (_this__u8e3s4, callback) {
    var body = this.ibg();
    callback(body);
    _this__u8e3s4.wc0_1 = body.jbg();
  };
  Builder.prototype.mbg = function (cond, callback) {
    var body = this.ibg();
    callback(body);
    var tmp = body.jbg();
    var stmIf = If_init_$Create$(cond, tmp, null, 4, null);
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.eb5_1;
    tmp0_plusAssign.c(stmIf);
    return stmIf;
  };
  Builder.prototype.nbg = function (ref, min, max, block) {
    if (min >= max) {
      block(this, min);
    } else if ((max - min | 0) <= 1) {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.shader.Builder.IF' call
      var tmp0_IF = this.jbh(ref, this.gb5(min));
      var body = this.ibg();
      // Inline function 'com.soywiz.korag.shader.Builder.IF_ELSE_BINARY_LOOKUP.<anonymous>' call
      block(body, min);
      var tmp = body.jbg();
      var stmIf = If_init_$Create$(tmp0_IF, tmp, null, 4, null);
      var tmp0_this = this;
      // Inline function 'kotlin.collections.plusAssign' call
      var tmp0_plusAssign = tmp0_this.eb5_1;
      tmp0_plusAssign.c(stmIf);
      tmp$ret$0 = stmIf;
      var tmp_0 = tmp$ret$0;
      this.lbg(tmp_0, Program$Builder$IF_ELSE_BINARY_LOOKUP$lambda(block, max));
    } else {
      var middle = (min + max | 0) / 2 | 0;
      var tmp$ret$1;
      // Inline function 'com.soywiz.korag.shader.Builder.IF' call
      var tmp1_IF = this.mbh(ref, this.gb5(middle));
      var body_0 = this.ibg();
      // Inline function 'com.soywiz.korag.shader.Builder.IF_ELSE_BINARY_LOOKUP.<anonymous>' call
      body_0.nbg(ref, min, middle, block);
      var tmp_1 = body_0.jbg();
      var stmIf_0 = If_init_$Create$(tmp1_IF, tmp_1, null, 4, null);
      var tmp0_this_0 = this;
      // Inline function 'kotlin.collections.plusAssign' call
      var tmp0_plusAssign_0 = tmp0_this_0.eb5_1;
      tmp0_plusAssign_0.c(stmIf_0);
      tmp$ret$1 = stmIf_0;
      var tmp_2 = tmp$ret$1;
      this.lbg(tmp_2, Program$Builder$IF_ELSE_BINARY_LOOKUP$lambda_0(ref, middle, max, block));
    }
  };
  Builder.prototype.obg = function (ref, min, max, block) {
    if (min >= max) {
      block(this, min);
    } else {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.shader.Builder.IF' call
      var tmp0_IF = this.jbh(ref, this.gb5(min));
      var body = this.ibg();
      // Inline function 'com.soywiz.korag.shader.Builder.IF_ELSE_LIST.<anonymous>' call
      block(body, min);
      var tmp = body.jbg();
      var stmIf = If_init_$Create$(tmp0_IF, tmp, null, 4, null);
      var tmp0_this = this;
      // Inline function 'kotlin.collections.plusAssign' call
      var tmp0_plusAssign = tmp0_this.eb5_1;
      tmp0_plusAssign.c(stmIf);
      tmp$ret$0 = stmIf;
      var tmp_0 = tmp$ret$0;
      this.lbg(tmp_0, Program$Builder$IF_ELSE_LIST$lambda(ref, min, max, block));
    }
  };
  Builder.prototype.fb5 = function (target, expr) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.eb5_1;
    var tmp1_plusAssign = new Set(target, expr);
    tmp0_plusAssign.c(tmp1_plusAssign);
  };
  Builder.prototype.pbg = function () {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.eb5_1;
    var tmp1_plusAssign = Discard_getInstance();
    tmp0_plusAssign.c(tmp1_plusAssign);
  };
  Builder.prototype.qbg = function (operand) {
    var tmp0_this = this;
    // Inline function 'kotlin.collections.plusAssign' call
    var tmp0_plusAssign = tmp0_this.eb5_1;
    var tmp1_plusAssign = new Return(operand);
    tmp0_plusAssign.c(tmp1_plusAssign);
  };
  Builder.prototype.rbg = function (operand, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      operand = null;
    return this.qbg(operand);
  };
  Builder.prototype.sbg = function (type) {
    var tmp0_this = this.db5_1;
    var tmp1 = tmp0_this.dc2_1;
    tmp0_this.dc2_1 = tmp1 + 1 | 0;
    return Temp_init_$Create$(tmp1, type, 1, null, 8, null);
  };
  Builder.$metadata$ = classMeta('Builder', [VarTypeAccessor, ExpressionBuilder]);
  function Visitor(default_0) {
    this.rbx_1 = default_0;
  }
  Visitor.prototype.sbx = function (func) {
    this.yby(func.wbx_1);
  };
  Visitor.prototype.yby = function (stm) {
    var tmp0_subject = stm;
    var tmp;
    if (tmp0_subject == null) {
      tmp = Unit_getInstance();
    } else {
      if (tmp0_subject instanceof Stms) {
        this.zby(stm);
        tmp = Unit_getInstance();
      } else {
        if (tmp0_subject instanceof Set) {
          this.cbz(stm);
          tmp = Unit_getInstance();
        } else {
          if (tmp0_subject instanceof If) {
            this.abz(stm);
            tmp = Unit_getInstance();
          } else {
            if (tmp0_subject instanceof ForSimple) {
              this.bbz(stm);
              tmp = Unit_getInstance();
            } else {
              if (tmp0_subject instanceof Discard) {
                this.dbz(stm);
                tmp = Unit_getInstance();
              } else {
                if (tmp0_subject instanceof Continue) {
                  this.fbz(stm);
                  tmp = Unit_getInstance();
                } else {
                  if (tmp0_subject instanceof Break) {
                    this.ebz(stm);
                    tmp = Unit_getInstance();
                  } else {
                    if (tmp0_subject instanceof Raw) {
                      this.gbz(stm);
                      tmp = Unit_getInstance();
                    } else {
                      if (tmp0_subject instanceof Return) {
                        this.hbz(stm);
                        tmp = Unit_getInstance();
                      } else {
                        noWhenBranchMatchedException();
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    return tmp;
  };
  Visitor.prototype.zby = function (stms) {
    var tmp0_iterator = stms.ac0_1.j();
    while (tmp0_iterator.k()) {
      var stm = tmp0_iterator.l();
      this.yby(stm);
    }
  };
  Visitor.prototype.abz = function (stm) {
    this.ibz(stm.uc0_1);
    this.yby(stm.vc0_1);
    this.yby(stm.wc0_1);
  };
  Visitor.prototype.bbz = function (stm) {
    this.lbz(stm.xc0_1);
    this.ibz(stm.yc0_1);
    this.yby(stm.ac1_1);
  };
  Visitor.prototype.cbz = function (stm) {
    this.ibz(stm.cc0_1);
    this.ibz(stm.bc0_1);
  };
  Visitor.prototype.dbz = function (stm) {
  };
  Visitor.prototype.ebz = function (stm) {
  };
  Visitor.prototype.fbz = function (stm) {
  };
  Visitor.prototype.gbz = function (stm) {
    this.yby(stm.iby_1);
  };
  Visitor.prototype.hbz = function (stm) {
    var tmp0_safe_receiver = stm.dc0_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      var tmp$ret$1;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.shader.Visitor.visit.<anonymous>' call
      tmp$ret$0 = this.ibz(tmp0_safe_receiver);
      tmp$ret$1 = tmp$ret$0;
    }
  };
  Visitor.prototype.ibz = function (operand) {
    var tmp0_subject = operand;
    var tmp;
    if (tmp0_subject instanceof Variable) {
      tmp = this.lbz(operand);
    } else {
      if (tmp0_subject instanceof Unop) {
        tmp = this.pbz(operand);
      } else {
        if (tmp0_subject instanceof Binop) {
          tmp = this.qbz(operand);
        } else {
          if (tmp0_subject instanceof Ternary) {
            tmp = this.rbz(operand);
          } else {
            if (tmp0_subject instanceof BoolLiteral) {
              tmp = this.xbz(operand);
            } else {
              if (tmp0_subject instanceof IntLiteral) {
                tmp = this.vbz(operand);
              } else {
                if (tmp0_subject instanceof FloatLiteral) {
                  tmp = this.wbz(operand);
                } else {
                  if (tmp0_subject instanceof Vector) {
                    tmp = this.ubz(operand);
                  } else {
                    if (tmp0_subject instanceof Swizzle) {
                      tmp = this.sbz(operand);
                    } else {
                      if (tmp0_subject instanceof ArrayAccess) {
                        tmp = this.tbz(operand);
                      } else {
                        if (tmp0_subject instanceof BaseFunc) {
                          tmp = this.jbz(operand);
                        } else {
                          invalidOp("Don't know how to visit operand " + operand);
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    return tmp;
  };
  Visitor.prototype.jbz = function (func) {
    var tmp0_iterator = func.pc0().j();
    while (tmp0_iterator.k()) {
      var op = tmp0_iterator.l();
      this.ibz(op);
    }
    var tmp1_subject = func;
    var tmp;
    if (tmp1_subject instanceof Func) {
      tmp = this.kbz(func);
    } else {
      if (tmp1_subject instanceof CustomFunc) {
        tmp = this.xby(func);
      } else {
        invalidOp("Don't know how to visit func " + func);
      }
    }
    return tmp;
  };
  Visitor.prototype.kbz = function (func) {
    return this.rbx_1;
  };
  Visitor.prototype.xby = function (func) {
    return this.rbx_1;
  };
  Visitor.prototype.lbz = function (operand) {
    var tmp0_subject = operand;
    var tmp;
    if (tmp0_subject instanceof Attribute) {
      tmp = this.pby(operand);
    } else {
      if (tmp0_subject instanceof Varying) {
        tmp = this.rby(operand);
      } else {
        if (tmp0_subject instanceof Uniform) {
          tmp = this.tby(operand);
        } else {
          if (tmp0_subject instanceof Output) {
            tmp = this.obz(operand);
          } else {
            if (tmp0_subject instanceof Temp) {
              tmp = this.mbz(operand);
            } else {
              if (tmp0_subject instanceof Arg) {
                tmp = this.nbz(operand);
              } else {
                noWhenBranchMatchedException();
              }
            }
          }
        }
      }
    }
    return tmp;
  };
  Visitor.prototype.mbz = function (temp) {
    return this.rbx_1;
  };
  Visitor.prototype.nbz = function (arg) {
    return this.rbx_1;
  };
  Visitor.prototype.pby = function (attribute) {
    return this.rbx_1;
  };
  Visitor.prototype.rby = function (varying) {
    return this.rbx_1;
  };
  Visitor.prototype.tby = function (uniform) {
    return this.rbx_1;
  };
  Visitor.prototype.obz = function (output) {
    return this.rbx_1;
  };
  Visitor.prototype.pbz = function (operand) {
    this.ibz(operand.jc0_1);
    return this.rbx_1;
  };
  Visitor.prototype.qbz = function (operand) {
    this.ibz(operand.lc0_1);
    this.ibz(operand.nc0_1);
    return this.rbx_1;
  };
  Visitor.prototype.rbz = function (operand) {
    this.ibz(operand.rc0_1);
    this.ibz(operand.sc0_1);
    this.ibz(operand.tc0_1);
    return this.rbx_1;
  };
  Visitor.prototype.sbz = function (operand) {
    this.ibz(operand.ic1_1);
    return this.rbx_1;
  };
  Visitor.prototype.tbz = function (operand) {
    this.ibz(operand.lc1_1);
    this.ibz(operand.mc1_1);
    return this.rbx_1;
  };
  Visitor.prototype.ubz = function (operand) {
    var indexedObject = operand.gc0_1;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var op = indexedObject[inductionVariable];
      inductionVariable = inductionVariable + 1 | 0;
      this.ibz(op);
    }
    return this.rbx_1;
  };
  Visitor.prototype.vbz = function (operand) {
    return this.rbx_1;
  };
  Visitor.prototype.wbz = function (operand) {
    return this.rbx_1;
  };
  Visitor.prototype.xbz = function (operand) {
    return this.rbx_1;
  };
  Visitor.$metadata$ = classMeta('Visitor');
  function Program(vertex, fragment, name) {
    this.wb5_1 = vertex;
    this.xb5_1 = fragment;
    this.yb5_1 = name;
    this.zb5_1 = plus_0(this.wb5_1.wbw_1, this.xb5_1.wbw_1);
    this.ab6_1 = plus_0(this.wb5_1.xbw_1, this.xb5_1.xbw_1);
    this.bb6_1 = (imul(this.wb5_1.hashCode(), 11) + imul(this.xb5_1.hashCode(), 7) | 0) + getStringHashCode(this.yb5_1) | 0;
  }
  Program.prototype.ec2 = function () {
    return this.wb5_1;
  };
  Program.prototype.y3b = function () {
    return this.xb5_1;
  };
  Program.prototype.hashCode = function () {
    return this.bb6_1;
  };
  Program.prototype.equals = function (other) {
    var tmp;
    if (this === other) {
      tmp = true;
    } else {
      var tmp_0;
      var tmp_1;
      var tmp_2;
      if (other instanceof Program) {
        tmp_2 = this.wb5_1.equals(other.wb5_1);
      } else {
        tmp_2 = false;
      }
      if (tmp_2) {
        tmp_1 = this.xb5_1.equals(other.xb5_1);
      } else {
        tmp_1 = false;
      }
      if (tmp_1) {
        tmp_0 = this.yb5_1 === other.yb5_1;
      } else {
        tmp_0 = false;
      }
      tmp = tmp_0;
    }
    return tmp;
  };
  Program.prototype.x2c = function () {
  };
  Program.prototype.toString = function () {
    var tmp$ret$2;
    // Inline function 'kotlin.collections.map' call
    var tmp0_map = this.ab6_1;
    var tmp$ret$1;
    // Inline function 'kotlin.collections.mapTo' call
    var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
    var tmp0_iterator = tmp0_map.j();
    while (tmp0_iterator.k()) {
      var item = tmp0_iterator.l();
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.shader.Program.toString.<anonymous>' call
      tmp$ret$0 = item.hb6_1;
      tmp0_mapTo.c(tmp$ret$0);
    }
    tmp$ret$1 = tmp0_mapTo;
    tmp$ret$2 = tmp$ret$1;
    var tmp = tmp$ret$2;
    var tmp$ret$5;
    // Inline function 'kotlin.collections.map' call
    var tmp1_map = this.zb5_1;
    var tmp$ret$4;
    // Inline function 'kotlin.collections.mapTo' call
    var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
    var tmp0_iterator_0 = tmp1_map.j();
    while (tmp0_iterator_0.k()) {
      var item_0 = tmp0_iterator_0.l();
      var tmp$ret$3;
      // Inline function 'com.soywiz.korag.shader.Program.toString.<anonymous>' call
      tmp$ret$3 = item_0.hb6_1;
      tmp0_mapTo_0.c(tmp$ret$3);
    }
    tmp$ret$4 = tmp0_mapTo_0;
    tmp$ret$5 = tmp$ret$4;
    return 'Program(name=' + this.yb5_1 + ', attributes=' + tmp + ', uniforms=' + tmp$ret$5 + ')';
  };
  Program.prototype.fc2 = function (vertex, fragment, name) {
    return new Program(vertex, fragment, name);
  };
  Program.prototype.gc2 = function (vertex, fragment, name, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      vertex = this.wb5_1;
    if (!(($mask0 & 2) === 0))
      fragment = this.xb5_1;
    if (!(($mask0 & 4) === 0))
      name = this.yb5_1;
    return this.fc2(vertex, fragment, name);
  };
  Program.$metadata$ = classMeta('Program', [Closeable]);
  function Uniform_init_$Init$(name, type, precision, $this) {
    Uniform.call($this, name, type, 1, precision);
    return $this;
  }
  function Uniform_init_$Init$_0(name, type, precision, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      precision = Precision_DEFAULT_getInstance();
    Uniform_init_$Init$(name, type, precision, $this);
    return $this;
  }
  function Uniform_init_$Create$(name, type, precision, $mask0, $marker) {
    return Uniform_init_$Init$_0(name, type, precision, $mask0, $marker, Object.create(Uniform.prototype));
  }
  function Uniform(name, type, arrayCount, precision) {
    Variable.call(this, name, type, arrayCount, precision);
  }
  Uniform.prototype.toString = function () {
    return 'Uniform(' + this.hb6_1 + ')';
  };
  Uniform.prototype.equals = function (other) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mequals' call
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if (other instanceof Uniform) {
      tmp_2 = this.lb6_1 === other.lb6_1;
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      tmp_1 = this.h68().equals(other.h68());
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = this.ib6_1 === other.ib6_1;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this.hb6_1 === other.hb6_1;
    } else {
      tmp = false;
    }
    tmp$ret$0 = tmp;
    return tmp$ret$0;
  };
  Uniform.prototype.hashCode = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mhashcode' call
    tmp$ret$0 = (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
    return tmp$ret$0;
  };
  Uniform.$metadata$ = classMeta('Uniform', undefined, undefined, undefined, undefined, Variable.prototype);
  function Attribute_init_$Init$(name, type, normalized, offset, active, precision, divisor, fixedLocation, $mask0, $marker, $this) {
    if (!(($mask0 & 8) === 0))
      offset = null;
    if (!(($mask0 & 16) === 0))
      active = true;
    if (!(($mask0 & 32) === 0))
      precision = Precision_DEFAULT_getInstance();
    if (!(($mask0 & 64) === 0))
      divisor = 0;
    if (!(($mask0 & 128) === 0))
      fixedLocation = null;
    Attribute.call($this, name, type, normalized, offset, active, precision, divisor, fixedLocation);
    return $this;
  }
  function Attribute_init_$Init$_0(name, type, normalized, precision, $this) {
    Attribute_init_$Init$(name, type, normalized, null, true, precision, 0, null, 192, null, $this);
    return $this;
  }
  function Attribute_init_$Create$(name, type, normalized, precision) {
    return Attribute_init_$Init$_0(name, type, normalized, precision, Object.create(Attribute.prototype));
  }
  function Attribute_init_$Init$_1(name, type, normalized, precision, $mask0, $marker, $this) {
    if (!(($mask0 & 8) === 0))
      precision = Precision_DEFAULT_getInstance();
    Attribute_init_$Init$_0(name, type, normalized, precision, $this);
    return $this;
  }
  function Attribute_init_$Create$_0(name, type, normalized, precision, $mask0, $marker) {
    return Attribute_init_$Init$_1(name, type, normalized, precision, $mask0, $marker, Object.create(Attribute.prototype));
  }
  function Attribute(name, type, normalized, offset, active, precision, divisor, fixedLocation) {
    Variable_init_$Init$(name, type, precision, this);
    this.fbo_1 = normalized;
    this.gbo_1 = offset;
    this.hbo_1 = active;
    this.ibo_1 = divisor;
    this.jbo_1 = fixedLocation;
  }
  Attribute.prototype.c7b = function () {
    return this.fbo_1;
  };
  Attribute.prototype.u9k = function () {
    return this.gbo_1;
  };
  Attribute.prototype.jc2 = function () {
    return this.hbo_1;
  };
  Attribute.prototype.kc2 = function () {
    return this.ibo_1;
  };
  Attribute.prototype.lc2 = function () {
    return this.jbo_1;
  };
  Attribute.prototype.toString = function () {
    return 'Attribute(' + this.hb6_1 + ')';
  };
  Attribute.prototype.equals = function (other) {
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mequals' call
    var tmp_2;
    var tmp_3;
    var tmp_4;
    var tmp_5;
    if (other instanceof Attribute) {
      tmp_5 = this.lb6_1 === other.lb6_1;
    } else {
      tmp_5 = false;
    }
    if (tmp_5) {
      tmp_4 = this.h68().equals(other.h68());
    } else {
      tmp_4 = false;
    }
    if (tmp_4) {
      tmp_3 = this.ib6_1 === other.ib6_1;
    } else {
      tmp_3 = false;
    }
    if (tmp_3) {
      tmp_2 = this.hb6_1 === other.hb6_1;
    } else {
      tmp_2 = false;
    }
    tmp$ret$0 = tmp_2;
    if (tmp$ret$0) {
      tmp_1 = this.fbo_1 === (other instanceof Attribute ? other : THROW_CCE()).fbo_1;
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = this.gbo_1 == other.gbo_1;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this.hbo_1 === other.hbo_1;
    } else {
      tmp = false;
    }
    return tmp;
  };
  Attribute.prototype.hashCode = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mhashcode' call
    tmp$ret$0 = (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
    var out = tmp$ret$0;
    out = imul(out, 7);
    out = out + (this.fbo_1 | 0) | 0;
    out = imul(out, 7);
    var tmp = out;
    var tmp$ret$1;
    // Inline function 'kotlin.hashCode' call
    var tmp0_hashCode = this.gbo_1;
    var tmp0_safe_receiver = tmp0_hashCode;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
    tmp$ret$1 = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
    out = tmp + tmp$ret$1 | 0;
    out = imul(out, 7);
    out = out + (this.hbo_1 | 0) | 0;
    return out;
  };
  Attribute.$metadata$ = classMeta('Attribute', undefined, undefined, undefined, undefined, Variable.prototype);
  function VarType_init_$Init$(name, ordinal, kind, elementCount, isMatrix, $mask0, $marker, $this) {
    if (!(($mask0 & 16) === 0))
      isMatrix = false;
    VarType.call($this, name, ordinal, kind, elementCount, isMatrix);
    return $this;
  }
  function VarType_init_$Create$(name, ordinal, kind, elementCount, isMatrix, $mask0, $marker) {
    return VarType_init_$Init$(name, ordinal, kind, elementCount, isMatrix, $mask0, $marker, Object.create(VarType.prototype));
  }
  var VarType_TVOID_instance;
  var VarType_Mat2_instance;
  var VarType_Mat3_instance;
  var VarType_Mat4_instance;
  var VarType_Sampler1D_instance;
  var VarType_Sampler2D_instance;
  var VarType_Sampler3D_instance;
  var VarType_SamplerCube_instance;
  var VarType_Int1_instance;
  var VarType_Float1_instance;
  var VarType_Float2_instance;
  var VarType_Float3_instance;
  var VarType_Float4_instance;
  var VarType_Short1_instance;
  var VarType_Short2_instance;
  var VarType_Short3_instance;
  var VarType_Short4_instance;
  var VarType_Bool1_instance;
  var VarType_Bool2_instance;
  var VarType_Bool3_instance;
  var VarType_Bool4_instance;
  var VarType_Byte4_instance;
  var VarType_SByte1_instance;
  var VarType_SByte2_instance;
  var VarType_SByte3_instance;
  var VarType_SByte4_instance;
  var VarType_UByte1_instance;
  var VarType_UByte2_instance;
  var VarType_UByte3_instance;
  var VarType_UByte4_instance;
  var VarType_SShort1_instance;
  var VarType_SShort2_instance;
  var VarType_SShort3_instance;
  var VarType_SShort4_instance;
  var VarType_UShort1_instance;
  var VarType_UShort2_instance;
  var VarType_UShort3_instance;
  var VarType_UShort4_instance;
  var VarType_SInt1_instance;
  var VarType_SInt2_instance;
  var VarType_SInt3_instance;
  var VarType_SInt4_instance;
  function Companion_26() {
    Companion_instance_26 = this;
  }
  Companion_26.prototype.mc2 = function (count) {
    var tmp0_subject = count;
    var tmp;
    switch (tmp0_subject) {
      case 0:
        tmp = VarType_TVOID_getInstance();
        break;
      case 1:
        tmp = VarType_SByte1_getInstance();
        break;
      case 2:
        tmp = VarType_SByte2_getInstance();
        break;
      case 3:
        tmp = VarType_SByte3_getInstance();
        break;
      case 4:
        tmp = VarType_SByte4_getInstance();
        break;
      default:
        get_invalidOp();
        break;
    }
    return tmp;
  };
  Companion_26.prototype.nc2 = function (count) {
    var tmp0_subject = count;
    var tmp;
    switch (tmp0_subject) {
      case 0:
        tmp = VarType_TVOID_getInstance();
        break;
      case 1:
        tmp = VarType_UByte1_getInstance();
        break;
      case 2:
        tmp = VarType_UByte2_getInstance();
        break;
      case 3:
        tmp = VarType_UByte3_getInstance();
        break;
      case 4:
        tmp = VarType_UByte4_getInstance();
        break;
      default:
        get_invalidOp();
        break;
    }
    return tmp;
  };
  Companion_26.prototype.oc2 = function (count) {
    var tmp0_subject = count;
    var tmp;
    switch (tmp0_subject) {
      case 0:
        tmp = VarType_TVOID_getInstance();
        break;
      case 1:
        tmp = VarType_SShort1_getInstance();
        break;
      case 2:
        tmp = VarType_SShort2_getInstance();
        break;
      case 3:
        tmp = VarType_SShort3_getInstance();
        break;
      case 4:
        tmp = VarType_SShort4_getInstance();
        break;
      default:
        get_invalidOp();
        break;
    }
    return tmp;
  };
  Companion_26.prototype.pc2 = function (count) {
    var tmp0_subject = count;
    var tmp;
    switch (tmp0_subject) {
      case 0:
        tmp = VarType_TVOID_getInstance();
        break;
      case 1:
        tmp = VarType_UShort1_getInstance();
        break;
      case 2:
        tmp = VarType_UShort2_getInstance();
        break;
      case 3:
        tmp = VarType_UShort3_getInstance();
        break;
      case 4:
        tmp = VarType_UShort4_getInstance();
        break;
      default:
        get_invalidOp();
        break;
    }
    return tmp;
  };
  Companion_26.prototype.qc2 = function (count) {
    var tmp0_subject = count;
    var tmp;
    switch (tmp0_subject) {
      case 0:
        tmp = VarType_TVOID_getInstance();
        break;
      case 1:
        tmp = VarType_SInt1_getInstance();
        break;
      case 2:
        tmp = VarType_SInt2_getInstance();
        break;
      case 3:
        tmp = VarType_SInt3_getInstance();
        break;
      case 4:
        tmp = VarType_SInt4_getInstance();
        break;
      default:
        get_invalidOp();
        break;
    }
    return tmp;
  };
  Companion_26.prototype.rc2 = function (count) {
    var tmp0_subject = count;
    var tmp;
    switch (tmp0_subject) {
      case 0:
        tmp = VarType_TVOID_getInstance();
        break;
      case 1:
        tmp = VarType_Float1_getInstance();
        break;
      case 2:
        tmp = VarType_Float2_getInstance();
        break;
      case 3:
        tmp = VarType_Float3_getInstance();
        break;
      case 4:
        tmp = VarType_Float4_getInstance();
        break;
      default:
        get_invalidOp();
        break;
    }
    return tmp;
  };
  Companion_26.$metadata$ = objectMeta('Companion');
  var Companion_instance_26;
  function Companion_getInstance_41() {
    VarType_initEntries();
    if (Companion_instance_26 == null)
      new Companion_26();
    return Companion_instance_26;
  }
  var VarType_entriesInitialized;
  function VarType_initEntries() {
    if (VarType_entriesInitialized)
      return Unit_getInstance();
    VarType_entriesInitialized = true;
    var tmp = VarKind_TBYTE_getInstance();
    VarType_TVOID_instance = VarType_init_$Create$('TVOID', 0, tmp, 0, false, 16, null);
    VarType_Mat2_instance = new VarType('Mat2', 1, VarKind_TFLOAT_getInstance(), 4, true);
    VarType_Mat3_instance = new VarType('Mat3', 2, VarKind_TFLOAT_getInstance(), 9, true);
    VarType_Mat4_instance = new VarType('Mat4', 3, VarKind_TFLOAT_getInstance(), 16, true);
    var tmp_0 = VarKind_TINT_getInstance();
    VarType_Sampler1D_instance = VarType_init_$Create$('Sampler1D', 4, tmp_0, 1, false, 16, null);
    var tmp_1 = VarKind_TINT_getInstance();
    VarType_Sampler2D_instance = VarType_init_$Create$('Sampler2D', 5, tmp_1, 1, false, 16, null);
    var tmp_2 = VarKind_TINT_getInstance();
    VarType_Sampler3D_instance = VarType_init_$Create$('Sampler3D', 6, tmp_2, 1, false, 16, null);
    var tmp_3 = VarKind_TINT_getInstance();
    VarType_SamplerCube_instance = VarType_init_$Create$('SamplerCube', 7, tmp_3, 1, false, 16, null);
    var tmp_4 = VarKind_TINT_getInstance();
    VarType_Int1_instance = VarType_init_$Create$('Int1', 8, tmp_4, 1, false, 16, null);
    var tmp_5 = VarKind_TFLOAT_getInstance();
    VarType_Float1_instance = VarType_init_$Create$('Float1', 9, tmp_5, 1, false, 16, null);
    var tmp_6 = VarKind_TFLOAT_getInstance();
    VarType_Float2_instance = VarType_init_$Create$('Float2', 10, tmp_6, 2, false, 16, null);
    var tmp_7 = VarKind_TFLOAT_getInstance();
    VarType_Float3_instance = VarType_init_$Create$('Float3', 11, tmp_7, 3, false, 16, null);
    var tmp_8 = VarKind_TFLOAT_getInstance();
    VarType_Float4_instance = VarType_init_$Create$('Float4', 12, tmp_8, 4, false, 16, null);
    var tmp_9 = VarKind_TSHORT_getInstance();
    VarType_Short1_instance = VarType_init_$Create$('Short1', 13, tmp_9, 1, false, 16, null);
    var tmp_10 = VarKind_TSHORT_getInstance();
    VarType_Short2_instance = VarType_init_$Create$('Short2', 14, tmp_10, 2, false, 16, null);
    var tmp_11 = VarKind_TSHORT_getInstance();
    VarType_Short3_instance = VarType_init_$Create$('Short3', 15, tmp_11, 3, false, 16, null);
    var tmp_12 = VarKind_TSHORT_getInstance();
    VarType_Short4_instance = VarType_init_$Create$('Short4', 16, tmp_12, 4, false, 16, null);
    var tmp_13 = VarKind_TBOOL_getInstance();
    VarType_Bool1_instance = VarType_init_$Create$('Bool1', 17, tmp_13, 1, false, 16, null);
    var tmp_14 = VarKind_TBOOL_getInstance();
    VarType_Bool2_instance = VarType_init_$Create$('Bool2', 18, tmp_14, 2, false, 16, null);
    var tmp_15 = VarKind_TBOOL_getInstance();
    VarType_Bool3_instance = VarType_init_$Create$('Bool3', 19, tmp_15, 3, false, 16, null);
    var tmp_16 = VarKind_TBOOL_getInstance();
    VarType_Bool4_instance = VarType_init_$Create$('Bool4', 20, tmp_16, 4, false, 16, null);
    var tmp_17 = VarKind_TUNSIGNED_BYTE_getInstance();
    VarType_Byte4_instance = VarType_init_$Create$('Byte4', 21, tmp_17, 4, false, 16, null);
    var tmp_18 = VarKind_TBYTE_getInstance();
    VarType_SByte1_instance = VarType_init_$Create$('SByte1', 22, tmp_18, 1, false, 16, null);
    var tmp_19 = VarKind_TBYTE_getInstance();
    VarType_SByte2_instance = VarType_init_$Create$('SByte2', 23, tmp_19, 2, false, 16, null);
    var tmp_20 = VarKind_TBYTE_getInstance();
    VarType_SByte3_instance = VarType_init_$Create$('SByte3', 24, tmp_20, 3, false, 16, null);
    var tmp_21 = VarKind_TBYTE_getInstance();
    VarType_SByte4_instance = VarType_init_$Create$('SByte4', 25, tmp_21, 4, false, 16, null);
    var tmp_22 = VarKind_TUNSIGNED_BYTE_getInstance();
    VarType_UByte1_instance = VarType_init_$Create$('UByte1', 26, tmp_22, 1, false, 16, null);
    var tmp_23 = VarKind_TUNSIGNED_BYTE_getInstance();
    VarType_UByte2_instance = VarType_init_$Create$('UByte2', 27, tmp_23, 2, false, 16, null);
    var tmp_24 = VarKind_TUNSIGNED_BYTE_getInstance();
    VarType_UByte3_instance = VarType_init_$Create$('UByte3', 28, tmp_24, 3, false, 16, null);
    var tmp_25 = VarKind_TUNSIGNED_BYTE_getInstance();
    VarType_UByte4_instance = VarType_init_$Create$('UByte4', 29, tmp_25, 4, false, 16, null);
    var tmp_26 = VarKind_TSHORT_getInstance();
    VarType_SShort1_instance = VarType_init_$Create$('SShort1', 30, tmp_26, 1, false, 16, null);
    var tmp_27 = VarKind_TSHORT_getInstance();
    VarType_SShort2_instance = VarType_init_$Create$('SShort2', 31, tmp_27, 2, false, 16, null);
    var tmp_28 = VarKind_TSHORT_getInstance();
    VarType_SShort3_instance = VarType_init_$Create$('SShort3', 32, tmp_28, 3, false, 16, null);
    var tmp_29 = VarKind_TSHORT_getInstance();
    VarType_SShort4_instance = VarType_init_$Create$('SShort4', 33, tmp_29, 4, false, 16, null);
    var tmp_30 = VarKind_TUNSIGNED_SHORT_getInstance();
    VarType_UShort1_instance = VarType_init_$Create$('UShort1', 34, tmp_30, 1, false, 16, null);
    var tmp_31 = VarKind_TUNSIGNED_SHORT_getInstance();
    VarType_UShort2_instance = VarType_init_$Create$('UShort2', 35, tmp_31, 2, false, 16, null);
    var tmp_32 = VarKind_TUNSIGNED_SHORT_getInstance();
    VarType_UShort3_instance = VarType_init_$Create$('UShort3', 36, tmp_32, 3, false, 16, null);
    var tmp_33 = VarKind_TUNSIGNED_SHORT_getInstance();
    VarType_UShort4_instance = VarType_init_$Create$('UShort4', 37, tmp_33, 4, false, 16, null);
    var tmp_34 = VarKind_TINT_getInstance();
    VarType_SInt1_instance = VarType_init_$Create$('SInt1', 38, tmp_34, 1, false, 16, null);
    var tmp_35 = VarKind_TINT_getInstance();
    VarType_SInt2_instance = VarType_init_$Create$('SInt2', 39, tmp_35, 2, false, 16, null);
    var tmp_36 = VarKind_TINT_getInstance();
    VarType_SInt3_instance = VarType_init_$Create$('SInt3', 40, tmp_36, 3, false, 16, null);
    var tmp_37 = VarKind_TINT_getInstance();
    VarType_SInt4_instance = VarType_init_$Create$('SInt4', 41, tmp_37, 4, false, 16, null);
    Companion_getInstance_41();
  }
  function VarType(name, ordinal, kind, elementCount, isMatrix) {
    Enum.call(this, name, ordinal);
    this.cbl_1 = kind;
    this.dbl_1 = elementCount;
    this.ebl_1 = isMatrix;
    this.fbl_1 = imul(this.cbl_1.uc2_1, this.dbl_1);
  }
  VarType.prototype.pr = function () {
    return this.cbl_1;
  };
  VarType.prototype.vc2 = function () {
    return this.dbl_1;
  };
  VarType.prototype.xc1 = function (length) {
    var tmp0_subject = this.cbl_1;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 1:
        tmp = Companion_getInstance_41().mc2(length);
        break;
      case 2:
        tmp = Companion_getInstance_41().nc2(length);
        break;
      case 3:
        tmp = Companion_getInstance_41().oc2(length);
        break;
      case 4:
        tmp = Companion_getInstance_41().pc2(length);
        break;
      case 5:
        tmp = Companion_getInstance_41().qc2(length);
        break;
      case 6:
        tmp = Companion_getInstance_41().rc2(length);
        break;
      default:
        throw NotImplementedError_init_$Create$(null, 1, null);
    }
    return tmp;
  };
  VarType.prototype.wc2 = function () {
    return this.fbl_1;
  };
  VarType.$metadata$ = classMeta('VarType', undefined, undefined, undefined, undefined, Enum.prototype);
  function Varying_init_$Init$(name, type, precision, $this) {
    Varying.call($this, name, type, 1, precision);
    return $this;
  }
  function Varying_init_$Create$(name, type, precision) {
    return Varying_init_$Init$(name, type, precision, Object.create(Varying.prototype));
  }
  function Varying_init_$Init$_0(name, type, precision, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      precision = Precision_DEFAULT_getInstance();
    Varying_init_$Init$(name, type, precision, $this);
    return $this;
  }
  function Varying_init_$Create$_0(name, type, precision, $mask0, $marker) {
    return Varying_init_$Init$_0(name, type, precision, $mask0, $marker, Object.create(Varying.prototype));
  }
  function Varying(name, type, arrayCount, precision) {
    Variable.call(this, name, type, arrayCount, precision);
  }
  Varying.prototype.toString = function () {
    return 'Varying(' + this.hb6_1 + ')';
  };
  Varying.prototype.equals = function (other) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mequals' call
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if (other instanceof Varying) {
      tmp_2 = this.lb6_1 === other.lb6_1;
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      tmp_1 = this.h68().equals(other.h68());
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = this.ib6_1 === other.ib6_1;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this.hb6_1 === other.hb6_1;
    } else {
      tmp = false;
    }
    tmp$ret$0 = tmp;
    return tmp$ret$0;
  };
  Varying.prototype.hashCode = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mhashcode' call
    tmp$ret$0 = (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
    return tmp$ret$0;
  };
  Varying.$metadata$ = classMeta('Varying', undefined, undefined, undefined, undefined, Variable.prototype);
  var Precision_DEFAULT_instance;
  var Precision_LOW_instance;
  var Precision_MEDIUM_instance;
  var Precision_HIGH_instance;
  var Precision_entriesInitialized;
  function Precision_initEntries() {
    if (Precision_entriesInitialized)
      return Unit_getInstance();
    Precision_entriesInitialized = true;
    Precision_DEFAULT_instance = new Precision('DEFAULT', 0);
    Precision_LOW_instance = new Precision('LOW', 1);
    Precision_MEDIUM_instance = new Precision('MEDIUM', 2);
    Precision_HIGH_instance = new Precision('HIGH', 3);
  }
  function Precision(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Precision.$metadata$ = classMeta('Precision', undefined, undefined, undefined, undefined, Enum.prototype);
  function Operand(type) {
    this.cba_1 = type;
  }
  Operand.prototype.h68 = function () {
    return this.cba_1;
  };
  Operand.$metadata$ = classMeta('Operand');
  function ProgramLayout_init_$Init$(attributes, $this) {
    ProgramLayout.call($this, toFastList(attributes), null);
    return $this;
  }
  function ProgramLayout_init_$Create$(attributes) {
    return ProgramLayout_init_$Init$(attributes, Object.create(ProgramLayout.prototype));
  }
  function ProgramLayout_init_$Init$_0(attributes, layoutSize, $this) {
    ProgramLayout.call($this, toFastList(attributes), layoutSize);
    return $this;
  }
  function ProgramLayout_init_$Create$_0(attributes, layoutSize) {
    return ProgramLayout_init_$Init$_0(attributes, layoutSize, Object.create(ProgramLayout.prototype));
  }
  function ProgramLayout$toString$lambda(it) {
    return it.hb6_1;
  }
  function ProgramLayout(attr, layoutSize) {
    this.vb4_1 = layoutSize;
    this.wb4_1 = attr;
    this.xb4_1 = attr;
    this.yb4_1 = 0;
    var tmp = this;
    var tmp$ret$2;
    // Inline function 'kotlin.collections.map' call
    var tmp0_map = this.wb4_1;
    var tmp$ret$1;
    // Inline function 'kotlin.collections.mapTo' call
    var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
    var tmp0_iterator = tmp0_map.j();
    while (tmp0_iterator.k()) {
      var item = tmp0_iterator.l();
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.shader.ProgramLayout.alignments.<anonymous>' call
      var a = item.h68().cbl_1.uc2_1;
      tmp$ret$0 = a <= 1 ? 1 : a;
      tmp0_mapTo.c(tmp$ret$0);
    }
    tmp$ret$1 = tmp0_mapTo;
    tmp$ret$2 = tmp$ret$1;
    tmp.zb4_1 = tmp$ret$2;
    var tmp_0 = this;
    var tmp$ret$5;
    // Inline function 'com.soywiz.kds.mapInt' call
    var tmp0_mapInt = this.wb4_1;
    var tmp$ret$4;
    // Inline function 'kotlin.also' call
    var tmp0_also = IntArrayList_init_$Create$(0, 1, null);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.kds.mapInt.<anonymous>' call
    var tmp0_iterator_0 = tmp0_mapInt.j();
    while (tmp0_iterator_0.k()) {
      var v = tmp0_iterator_0.l();
      var tmp$ret$3;
      // Inline function 'com.soywiz.korag.shader.ProgramLayout.attributePositions.<anonymous>' call
      if (!(v.gbo_1 == null)) {
        this.yb4_1 = v.gbo_1;
      } else {
        this.yb4_1 = nextAlignedTo(this.yb4_1, v.h68().cbl_1.uc2_1);
      }
      var out = this.yb4_1;
      var tmp0_this = this;
      tmp0_this.yb4_1 = tmp0_this.yb4_1 + v.h68().fbl_1 | 0;
      tmp$ret$3 = out;
      tmp0_also.m4o(tmp$ret$3);
    }
    tmp$ret$4 = tmp0_also;
    tmp$ret$5 = tmp$ret$4;
    tmp_0.ab5_1 = tmp$ret$5;
    var tmp_1 = this;
    var tmp0_elvis_lhs = maxOrNull(this.zb4_1);
    tmp_1.bb5_1 = tmp0_elvis_lhs == null ? 1 : tmp0_elvis_lhs;
    var tmp_2 = this;
    var tmp0_elvis_lhs_0 = this.vb4_1;
    tmp_2.cb5_1 = tmp0_elvis_lhs_0 == null ? nextAlignedTo(this.yb4_1, this.bb5_1) : tmp0_elvis_lhs_0;
  }
  ProgramLayout.prototype.o3p = function () {
    return this.xb4_1;
  };
  ProgramLayout.prototype.xc2 = function () {
    return this.ab5_1;
  };
  ProgramLayout.prototype.yc2 = function () {
    return this.cb5_1;
  };
  ProgramLayout.prototype.toString = function () {
    return 'VertexLayout[' + joinToString$default(this.wb4_1, ', ', null, null, 0, null, ProgramLayout$toString$lambda, 30, null) + ']';
  };
  ProgramLayout.$metadata$ = classMeta('ProgramLayout');
  function Shader_init_$Init$(type, stm, funcs, name, $mask0, $marker, $this) {
    if (!(($mask0 & 8) === 0))
      name = null;
    Shader.call($this, type, stm, funcs, name);
    return $this;
  }
  function Shader_init_$Create$(type, stm, funcs, name, $mask0, $marker) {
    return Shader_init_$Init$(type, stm, funcs, name, $mask0, $marker, Object.create(Shader.prototype));
  }
  function Shader$uniforms$1$1($out) {
    this.ac3_1 = $out;
    Visitor.call(this, Unit_getInstance());
  }
  Shader$uniforms$1$1.prototype.sby = function (uniform) {
    // Inline function 'kotlin.collections.plusAssign' call
    this.ac3_1.c(uniform);
  };
  Shader$uniforms$1$1.prototype.tby = function (uniform) {
    this.sby(uniform);
    return Unit_getInstance();
  };
  Shader$uniforms$1$1.$metadata$ = classMeta(undefined, undefined, undefined, undefined, undefined, Visitor.prototype);
  function Shader$attributes$1$1($out) {
    this.cc3_1 = $out;
    Visitor.call(this, Unit_getInstance());
  }
  Shader$attributes$1$1.prototype.oby = function (attribute) {
    // Inline function 'kotlin.collections.plusAssign' call
    this.cc3_1.c(attribute);
  };
  Shader$attributes$1$1.prototype.pby = function (attribute) {
    this.oby(attribute);
    return Unit_getInstance();
  };
  Shader$attributes$1$1.$metadata$ = classMeta(undefined, undefined, undefined, undefined, undefined, Visitor.prototype);
  function Shader(type, stm, funcs, name) {
    this.pbw_1 = type;
    this.qbw_1 = stm;
    this.rbw_1 = funcs;
    this.sbw_1 = name;
    this.tbw_1 = hashCode(this.qbw_1);
    this.ubw_1 = hashCode(this.rbw_1);
    this.vbw_1 = (imul(this.pbw_1.hashCode(), 17) + this.tbw_1 | 0) + imul(this.ubw_1, 53) | 0;
    var tmp = this;
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = LinkedHashSet_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.shader.Shader.uniforms.<anonymous>' call
    (new Shader$uniforms$1$1(tmp0_also)).yby(this.qbw_1);
    tmp$ret$0 = tmp0_also;
    tmp.wbw_1 = toSet(tmp$ret$0);
    var tmp_0 = this;
    var tmp$ret$1;
    // Inline function 'kotlin.also' call
    var tmp0_also_0 = LinkedHashSet_init_$Create$();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korag.shader.Shader.attributes.<anonymous>' call
    (new Shader$attributes$1$1(tmp0_also_0)).yby(this.qbw_1);
    tmp$ret$1 = tmp0_also_0;
    tmp_0.xbw_1 = toSet(tmp$ret$1);
  }
  Shader.prototype.dc3 = function () {
    return this.qbw_1;
  };
  Shader.prototype.equals = function (other) {
    var tmp;
    if (this === other) {
      tmp = true;
    } else {
      var tmp_0;
      var tmp_1;
      var tmp_2;
      var tmp_3;
      if (other instanceof Shader) {
        tmp_3 = this.pbw_1.equals(other.pbw_1);
      } else {
        tmp_3 = false;
      }
      if (tmp_3) {
        tmp_2 = this.vbw_1 === other.vbw_1;
      } else {
        tmp_2 = false;
      }
      if (tmp_2) {
        tmp_1 = equals(this.qbw_1, other.qbw_1);
      } else {
        tmp_1 = false;
      }
      if (tmp_1) {
        tmp_0 = equals(this.rbw_1, other.rbw_1);
      } else {
        tmp_0 = false;
      }
      tmp = tmp_0;
    }
    return tmp;
  };
  Shader.prototype.hashCode = function () {
    return this.vbw_1;
  };
  Shader.prototype.toString = function () {
    return 'Shader(type=' + this.pbw_1 + ', stm=' + this.qbw_1 + ', funcs=' + this.rbw_1 + ', name=' + this.sbw_1 + ')';
  };
  Shader.$metadata$ = classMeta('Shader');
  function Output() {
    Output_instance = this;
    var tmp = VarType_Float4_getInstance();
    Varying_init_$Init$_0('out', tmp, null, 4, null, this);
  }
  Output.prototype.toString = function () {
    return 'Output';
  };
  Output.prototype.equals = function (other) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mequals' call
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if (other instanceof Output) {
      tmp_2 = this.lb6_1 === other.lb6_1;
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      tmp_1 = this.h68().equals(other.h68());
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = this.ib6_1 === other.ib6_1;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this.hb6_1 === other.hb6_1;
    } else {
      tmp = false;
    }
    tmp$ret$0 = tmp;
    return tmp$ret$0;
  };
  Output.prototype.hashCode = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mhashcode' call
    tmp$ret$0 = (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
    return tmp$ret$0;
  };
  Output.$metadata$ = objectMeta('Output', undefined, undefined, undefined, undefined, Varying.prototype);
  var Output_instance;
  function Output_getInstance() {
    if (Output_instance == null)
      new Output();
    return Output_instance;
  }
  function Temp_init_$Init$(id, type, arrayCount, precision, $mask0, $marker, $this) {
    if (!(($mask0 & 8) === 0))
      precision = Precision_DEFAULT_getInstance();
    Temp.call($this, id, type, arrayCount, precision);
    return $this;
  }
  function Temp_init_$Create$(id, type, arrayCount, precision, $mask0, $marker) {
    return Temp_init_$Init$(id, type, arrayCount, precision, $mask0, $marker, Object.create(Temp.prototype));
  }
  function Temp_init_$Init$_0(id, type, precision, $this) {
    Temp.call($this, id, type, 1, precision);
    return $this;
  }
  function Temp_init_$Init$_1(id, type, precision, $mask0, $marker, $this) {
    if (!(($mask0 & 4) === 0))
      precision = Precision_DEFAULT_getInstance();
    Temp_init_$Init$_0(id, type, precision, $this);
    return $this;
  }
  function Temp_init_$Create$_0(id, type, precision, $mask0, $marker) {
    return Temp_init_$Init$_1(id, type, precision, $mask0, $marker, Object.create(Temp.prototype));
  }
  function Temp(id, type, arrayCount, precision) {
    Variable.call(this, 'temp' + id, type, arrayCount, precision);
  }
  Temp.prototype.toString = function () {
    return 'Temp(' + this.hb6_1 + ')';
  };
  Temp.prototype.equals = function (other) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mequals' call
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if (other instanceof Temp) {
      tmp_2 = this.lb6_1 === other.lb6_1;
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      tmp_1 = this.h68().equals(other.h68());
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = this.ib6_1 === other.ib6_1;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this.hb6_1 === other.hb6_1;
    } else {
      tmp = false;
    }
    tmp$ret$0 = tmp;
    return tmp$ret$0;
  };
  Temp.prototype.hashCode = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mhashcode' call
    tmp$ret$0 = (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
    return tmp$ret$0;
  };
  Temp.$metadata$ = classMeta('Temp', undefined, undefined, undefined, undefined, Variable.prototype);
  function VertexShader(callback) {
    var builder = Builder_init_$Create$_0(ShaderType_VERTEX_getInstance());
    callback(builder);
    return VertexShader_0(builder.ib5());
  }
  function FragmentShader(callback) {
    var builder = Builder_init_$Create$_0(ShaderType_FRAGMENT_getInstance());
    callback(builder);
    return FragmentShader_0(builder.ib5());
  }
  function ProgramConfig_init_$Init$(externalTextureSampler, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      externalTextureSampler = false;
    ProgramConfig.call($this, externalTextureSampler);
    return $this;
  }
  function ProgramConfig_init_$Create$(externalTextureSampler, $mask0, $marker) {
    return ProgramConfig_init_$Init$(externalTextureSampler, $mask0, $marker, Object.create(ProgramConfig.prototype));
  }
  function Companion_27() {
    Companion_instance_27 = this;
    var tmp = this;
    tmp.rb9_1 = ProgramConfig_init_$Create$(false, 1, null);
    this.sb9_1 = new ProgramConfig(true);
  }
  Companion_27.$metadata$ = objectMeta('Companion');
  var Companion_instance_27;
  function Companion_getInstance_42() {
    if (Companion_instance_27 == null)
      new Companion_27();
    return Companion_instance_27;
  }
  function ProgramConfig(externalTextureSampler) {
    Companion_getInstance_42();
    this.yba_1 = externalTextureSampler;
  }
  ProgramConfig.prototype.toString = function () {
    return 'ProgramConfig(externalTextureSampler=' + this.yba_1 + ')';
  };
  ProgramConfig.prototype.hashCode = function () {
    return this.yba_1 | 0;
  };
  ProgramConfig.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof ProgramConfig))
      return false;
    var tmp0_other_with_cast = other instanceof ProgramConfig ? other : THROW_CCE();
    if (!(this.yba_1 === tmp0_other_with_cast.yba_1))
      return false;
    return true;
  };
  ProgramConfig.$metadata$ = classMeta('ProgramConfig');
  var VarKind_TBOOL_instance;
  var VarKind_TBYTE_instance;
  var VarKind_TUNSIGNED_BYTE_instance;
  var VarKind_TSHORT_instance;
  var VarKind_TUNSIGNED_SHORT_instance;
  var VarKind_TINT_instance;
  var VarKind_TFLOAT_instance;
  var VarKind_entriesInitialized;
  function VarKind_initEntries() {
    if (VarKind_entriesInitialized)
      return Unit_getInstance();
    VarKind_entriesInitialized = true;
    VarKind_TBOOL_instance = new VarKind('TBOOL', 0, 1);
    VarKind_TBYTE_instance = new VarKind('TBYTE', 1, 1);
    VarKind_TUNSIGNED_BYTE_instance = new VarKind('TUNSIGNED_BYTE', 2, 1);
    VarKind_TSHORT_instance = new VarKind('TSHORT', 3, 2);
    VarKind_TUNSIGNED_SHORT_instance = new VarKind('TUNSIGNED_SHORT', 4, 2);
    VarKind_TINT_instance = new VarKind('TINT', 5, 4);
    VarKind_TFLOAT_instance = new VarKind('TFLOAT', 6, 4);
  }
  function VarKind(name, ordinal, bytesSize) {
    Enum.call(this, name, ordinal);
    this.uc2_1 = bytesSize;
  }
  VarKind.prototype.wc2 = function () {
    return this.uc2_1;
  };
  VarKind.$metadata$ = classMeta('VarKind', undefined, undefined, undefined, undefined, Enum.prototype);
  function Variable_init_$Init$(name, type, precision, $this) {
    Variable.call($this, name, type, 1, precision);
    return $this;
  }
  function Variable(name, type, arrayCount, precision) {
    Operand.call(this, type);
    this.hb6_1 = name;
    this.ib6_1 = arrayCount;
    this.jb6_1 = precision;
    var tmp = this;
    var tmp_0 = 0;
    var tmp_1 = this.ib6_1;
    var tmp$ret$0;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp$ret$0 = fillArrayVal(Array(tmp_1), null);
    var tmp_2 = tmp$ret$0;
    while (tmp_0 < tmp_1) {
      var tmp_3 = tmp_0;
      var tmp$ret$1;
      // Inline function 'com.soywiz.korag.shader.Variable.indexNames.<anonymous>' call
      tmp$ret$1 = this.hb6_1 + '[' + tmp_3 + ']';
      tmp_2[tmp_3] = tmp$ret$1;
      tmp_0 = tmp_0 + 1 | 0;
    }
    tmp.kb6_1 = tmp_2;
    this.lb6_1 = 0;
    this.mb6_1 = null;
  }
  Variable.prototype.t2 = function () {
    return this.hb6_1;
  };
  Variable.prototype.hc2 = function () {
    return this.ib6_1;
  };
  Variable.prototype.ec3 = function () {
    return this.jb6_1;
  };
  Variable.prototype.c1n = function () {
    return this.lb6_1;
  };
  Variable.prototype.ic2 = function () {
    return (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
  };
  Variable.prototype.equals = function (other) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mequals' call
    var tmp;
    var tmp_0;
    var tmp_1;
    var tmp_2;
    if (other instanceof Variable) {
      tmp_2 = this.lb6_1 === other.lb6_1;
    } else {
      tmp_2 = false;
    }
    if (tmp_2) {
      tmp_1 = this.h68().equals(other.h68());
    } else {
      tmp_1 = false;
    }
    if (tmp_1) {
      tmp_0 = this.ib6_1 === other.ib6_1;
    } else {
      tmp_0 = false;
    }
    if (tmp_0) {
      tmp = this.hb6_1 === other.hb6_1;
    } else {
      tmp = false;
    }
    tmp$ret$0 = tmp;
    return tmp$ret$0;
  };
  Variable.prototype.hashCode = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korag.shader.Variable.mhashcode' call
    tmp$ret$0 = (this.lb6_1 + imul(this.h68().hashCode(), 7) | 0) + imul(getStringHashCode(this.hb6_1), 11) | 0;
    return tmp$ret$0;
  };
  Variable.$metadata$ = classMeta('Variable', undefined, undefined, undefined, undefined, Operand.prototype);
  function FuncDecl(name, rettype, args, stm) {
    this.tbx_1 = name;
    this.ubx_1 = rettype;
    this.vbx_1 = args;
    this.wbx_1 = stm;
    this.xbx_1 = new FuncRef(this.tbx_1, this.ubx_1, this.vbx_1);
  }
  FuncDecl.prototype.fc3 = function () {
    return this.xbx_1;
  };
  FuncDecl.prototype.toString = function () {
    return 'FuncDecl(name=' + this.tbx_1 + ', rettype=' + this.ubx_1 + ', args=' + this.vbx_1 + ', stm=' + this.wbx_1 + ')';
  };
  FuncDecl.prototype.hashCode = function () {
    var result = getStringHashCode(this.tbx_1);
    result = imul(result, 31) + this.ubx_1.hashCode() | 0;
    result = imul(result, 31) + hashCode(this.vbx_1) | 0;
    result = imul(result, 31) + hashCode(this.wbx_1) | 0;
    return result;
  };
  FuncDecl.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof FuncDecl))
      return false;
    var tmp0_other_with_cast = other instanceof FuncDecl ? other : THROW_CCE();
    if (!(this.tbx_1 === tmp0_other_with_cast.tbx_1))
      return false;
    if (!this.ubx_1.equals(tmp0_other_with_cast.ubx_1))
      return false;
    if (!equals(this.vbx_1, tmp0_other_with_cast.vbx_1))
      return false;
    if (!equals(this.wbx_1, tmp0_other_with_cast.wbx_1))
      return false;
    return true;
  };
  FuncDecl.$metadata$ = classMeta('FuncDecl');
  function VarTypeAccessor() {
  }
  VarTypeAccessor.$metadata$ = interfaceMeta('VarTypeAccessor');
  var ShaderType_VERTEX_instance;
  var ShaderType_FRAGMENT_instance;
  var ShaderType_entriesInitialized;
  function ShaderType_initEntries() {
    if (ShaderType_entriesInitialized)
      return Unit_getInstance();
    ShaderType_entriesInitialized = true;
    ShaderType_VERTEX_instance = new ShaderType('VERTEX', 0);
    ShaderType_FRAGMENT_instance = new ShaderType('FRAGMENT', 1);
  }
  function ShaderType(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  ShaderType.$metadata$ = classMeta('ShaderType', undefined, undefined, undefined, undefined, Enum.prototype);
  function Arg() {
  }
  Arg.$metadata$ = classMeta('Arg', undefined, undefined, undefined, undefined, Variable.prototype);
  function VertexShader_0(info) {
    return VertexShader_1(info.d_1, info.e_1);
  }
  function FragmentShader_0(info) {
    return FragmentShader_1(info.d_1, info.e_1);
  }
  function VertexShader_1(stm, funcs) {
    var tmp = ShaderType_VERTEX_getInstance();
    return Shader_init_$Create$(tmp, stm, funcs, null, 8, null);
  }
  function FragmentShader_1(stm, funcs) {
    var tmp = ShaderType_FRAGMENT_getInstance();
    return Shader_init_$Create$(tmp, stm, funcs, null, 8, null);
  }
  function VarType_TVOID_getInstance() {
    VarType_initEntries();
    return VarType_TVOID_instance;
  }
  function VarType_Mat2_getInstance() {
    VarType_initEntries();
    return VarType_Mat2_instance;
  }
  function VarType_Mat4_getInstance() {
    VarType_initEntries();
    return VarType_Mat4_instance;
  }
  function VarType_Sampler2D_getInstance() {
    VarType_initEntries();
    return VarType_Sampler2D_instance;
  }
  function VarType_Float1_getInstance() {
    VarType_initEntries();
    return VarType_Float1_instance;
  }
  function VarType_Float2_getInstance() {
    VarType_initEntries();
    return VarType_Float2_instance;
  }
  function VarType_Float3_getInstance() {
    VarType_initEntries();
    return VarType_Float3_instance;
  }
  function VarType_Float4_getInstance() {
    VarType_initEntries();
    return VarType_Float4_instance;
  }
  function VarType_Bool1_getInstance() {
    VarType_initEntries();
    return VarType_Bool1_instance;
  }
  function VarType_Byte4_getInstance() {
    VarType_initEntries();
    return VarType_Byte4_instance;
  }
  function VarType_SByte1_getInstance() {
    VarType_initEntries();
    return VarType_SByte1_instance;
  }
  function VarType_SByte2_getInstance() {
    VarType_initEntries();
    return VarType_SByte2_instance;
  }
  function VarType_SByte3_getInstance() {
    VarType_initEntries();
    return VarType_SByte3_instance;
  }
  function VarType_SByte4_getInstance() {
    VarType_initEntries();
    return VarType_SByte4_instance;
  }
  function VarType_UByte1_getInstance() {
    VarType_initEntries();
    return VarType_UByte1_instance;
  }
  function VarType_UByte2_getInstance() {
    VarType_initEntries();
    return VarType_UByte2_instance;
  }
  function VarType_UByte3_getInstance() {
    VarType_initEntries();
    return VarType_UByte3_instance;
  }
  function VarType_UByte4_getInstance() {
    VarType_initEntries();
    return VarType_UByte4_instance;
  }
  function VarType_SShort1_getInstance() {
    VarType_initEntries();
    return VarType_SShort1_instance;
  }
  function VarType_SShort2_getInstance() {
    VarType_initEntries();
    return VarType_SShort2_instance;
  }
  function VarType_SShort3_getInstance() {
    VarType_initEntries();
    return VarType_SShort3_instance;
  }
  function VarType_SShort4_getInstance() {
    VarType_initEntries();
    return VarType_SShort4_instance;
  }
  function VarType_UShort1_getInstance() {
    VarType_initEntries();
    return VarType_UShort1_instance;
  }
  function VarType_UShort2_getInstance() {
    VarType_initEntries();
    return VarType_UShort2_instance;
  }
  function VarType_UShort3_getInstance() {
    VarType_initEntries();
    return VarType_UShort3_instance;
  }
  function VarType_UShort4_getInstance() {
    VarType_initEntries();
    return VarType_UShort4_instance;
  }
  function VarType_SInt1_getInstance() {
    VarType_initEntries();
    return VarType_SInt1_instance;
  }
  function VarType_SInt2_getInstance() {
    VarType_initEntries();
    return VarType_SInt2_instance;
  }
  function VarType_SInt3_getInstance() {
    VarType_initEntries();
    return VarType_SInt3_instance;
  }
  function VarType_SInt4_getInstance() {
    VarType_initEntries();
    return VarType_SInt4_instance;
  }
  function Precision_DEFAULT_getInstance() {
    Precision_initEntries();
    return Precision_DEFAULT_instance;
  }
  function Precision_LOW_getInstance() {
    Precision_initEntries();
    return Precision_LOW_instance;
  }
  function Precision_MEDIUM_getInstance() {
    Precision_initEntries();
    return Precision_MEDIUM_instance;
  }
  function Precision_HIGH_getInstance() {
    Precision_initEntries();
    return Precision_HIGH_instance;
  }
  function VarKind_TBOOL_getInstance() {
    VarKind_initEntries();
    return VarKind_TBOOL_instance;
  }
  function VarKind_TBYTE_getInstance() {
    VarKind_initEntries();
    return VarKind_TBYTE_instance;
  }
  function VarKind_TUNSIGNED_BYTE_getInstance() {
    VarKind_initEntries();
    return VarKind_TUNSIGNED_BYTE_instance;
  }
  function VarKind_TSHORT_getInstance() {
    VarKind_initEntries();
    return VarKind_TSHORT_instance;
  }
  function VarKind_TUNSIGNED_SHORT_getInstance() {
    VarKind_initEntries();
    return VarKind_TUNSIGNED_SHORT_instance;
  }
  function VarKind_TINT_getInstance() {
    VarKind_initEntries();
    return VarKind_TINT_instance;
  }
  function VarKind_TFLOAT_getInstance() {
    VarKind_initEntries();
    return VarKind_TFLOAT_instance;
  }
  function ShaderType_VERTEX_getInstance() {
    ShaderType_initEntries();
    return ShaderType_VERTEX_instance;
  }
  function ShaderType_FRAGMENT_getInstance() {
    ShaderType_initEntries();
    return ShaderType_FRAGMENT_instance;
  }
  function Event() {
    this.gc3_1 = null;
    this.hc3_1 = false;
  }
  Event.prototype.ic3 = function () {
    this.hc3_1 = true;
  };
  Event.$metadata$ = classMeta('Event');
  function TypedEvent(type) {
    Event.call(this);
    this.lc3_1 = type;
  }
  TypedEvent.$metadata$ = classMeta('TypedEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  function preventDefault(reason) {
    throw new PreventDefaultException(reason);
  }
  function getHandlersFor($this, clazz) {
    if ($this.mc3_1 == null)
      return null;
    var tmp0_safe_receiver = $this.mc3_1;
    var tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q(clazz);
    return (tmp == null ? true : tmp instanceof FastArrayList) ? tmp : null;
  }
  function getHandlersForCreate($this, clazz) {
    if ($this.mc3_1 == null)
      $this.mc3_1 = LinkedHashMap_init_$Create$();
    var tmp$ret$1;
    // Inline function 'kotlin.collections.getOrPut' call
    var tmp0_getOrPut = ensureNotNull($this.mc3_1);
    var value = tmp0_getOrPut.q(clazz);
    var tmp;
    if (value == null) {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korev.Mixin.getHandlersForCreate.<anonymous>' call
      tmp$ret$0 = FastArrayList_init_$Create$();
      var answer = tmp$ret$0;
      tmp0_getOrPut.a(clazz, answer);
      tmp = answer;
    } else {
      tmp = value;
    }
    tmp$ret$1 = tmp;
    var tmp_0 = tmp$ret$1;
    return tmp_0 instanceof FastArrayList ? tmp_0 : THROW_CCE();
  }
  function EventDispatcher$Mixin$addEventListener$lambda($handlers, $handler) {
    return function () {
      $handlers.c5($handler);
      return Unit_getInstance();
    };
  }
  function Mixin() {
    this.mc3_1 = null;
  }
  Mixin.prototype.nc3 = function (clazz, handler) {
    var handlers = getHandlersForCreate(this, clazz);
    // Inline function 'kotlin.collections.plusAssign' call
    handlers.c(handler);
    var tmp = Companion_getInstance_7();
    return tmp.p5y(EventDispatcher$Mixin$addEventListener$lambda(handlers, handler));
  };
  Mixin.prototype.oc3 = function (clazz, event) {
    if (this.mc3_1 == null)
      return Unit_getInstance();
    var tmp0_safe_receiver = getHandlersFor(this, clazz);
    if (tmp0_safe_receiver == null)
      null;
    else {
      // Inline function 'com.soywiz.kds.FastArrayList.fastForEach' call
      var array = tmp0_safe_receiver.b4r_1;
      var n = 0;
      while (n < array.length) {
        // Inline function 'com.soywiz.korev.Mixin.dispatch.<anonymous>' call
        var tmp$ret$1;
        // Inline function 'kotlin.js.unsafeCast' call
        var tmp0 = n;
        n = tmp0 + 1 | 0;
        var tmp0_unsafeCast = array[tmp0];
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_unsafeCast;
        tmp$ret$1 = tmp$ret$0;
        var tmp0__anonymous__q1qw7t = tmp$ret$1;
        tmp0__anonymous__q1qw7t(event);
      }
    }
  };
  Mixin.$metadata$ = classMeta('Mixin', [EventDispatcher]);
  function EventDispatcher() {
  }
  EventDispatcher.$metadata$ = interfaceMeta('EventDispatcher');
  function PreventDefaultException(reason) {
    Exception_init_$Init$(this);
    this.pc3_1 = reason;
    captureStack(this, PreventDefaultException);
  }
  PreventDefaultException.$metadata$ = classMeta('PreventDefaultException', undefined, undefined, undefined, undefined, Exception.prototype);
  function invoke_0(_this__u8e3s4, callback) {
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    callback(_this__u8e3s4);
    tmp$ret$0 = _this__u8e3s4;
    return tmp$ret$0;
  }
  function EventResult_init_$Init$(iterationCount, resultCount, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      iterationCount = 0;
    if (!(($mask0 & 2) === 0))
      resultCount = 0;
    EventResult.call($this, iterationCount, resultCount);
    return $this;
  }
  function EventResult_init_$Create$(iterationCount, resultCount, $mask0, $marker) {
    return EventResult_init_$Init$(iterationCount, resultCount, $mask0, $marker, Object.create(EventResult.prototype));
  }
  function EventResult(iterationCount, resultCount) {
    this.qc3_1 = iterationCount;
    this.rc3_1 = resultCount;
  }
  EventResult.prototype.d2p = function () {
    this.qc3_1 = 0;
    this.rc3_1 = 0;
  };
  EventResult.prototype.toString = function () {
    return 'EventResult(iterationCount=' + this.qc3_1 + ', resultCount=' + this.rc3_1 + ')';
  };
  EventResult.prototype.hashCode = function () {
    var result = this.qc3_1;
    result = imul(result, 31) + this.rc3_1 | 0;
    return result;
  };
  EventResult.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof EventResult))
      return false;
    var tmp0_other_with_cast = other instanceof EventResult ? other : THROW_CCE();
    if (!(this.qc3_1 === tmp0_other_with_cast.qc3_1))
      return false;
    if (!(this.rc3_1 === tmp0_other_with_cast.rc3_1))
      return false;
    return true;
  };
  EventResult.$metadata$ = classMeta('EventResult');
  function EventListenerFastMap() {
    this.sc3_1 = FastArrayList_init_$Create$();
    this.tc3_1 = FastArrayList_init_$Create$();
    var tmp = this;
    tmp.uc3_1 = IntArrayList_init_$Create$(0, 1, null);
  }
  EventListenerFastMap.prototype.i = function () {
    return this.sc3_1.i();
  };
  EventListenerFastMap.prototype.vc3 = function (block) {
    var inductionVariable = 0;
    var last = this.i();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        block(this.sc3_1.m(n), this.tc3_1.m(n), this.uc3_1.m(n));
      }
       while (inductionVariable < last);
  };
  EventListenerFastMap.prototype.wc3 = function (key, value, count) {
    var index = this.xc3(key);
    var tmp;
    if (index < 0) {
      this.sc3_1.c(key);
      this.tc3_1.c(value);
      this.uc3_1.m4o(count >= 0 ? count : 0);
      tmp = this.sc3_1.i() - 1 | 0;
    } else {
      this.sc3_1.a5(index, key);
      if (!(value == null)) {
        this.tc3_1.a5(index, value);
      }
      if (count >= 0) {
        this.uc3_1.r4o(index, count);
      }
      tmp = index;
    }
    return tmp;
  };
  EventListenerFastMap.prototype.yc3 = function (key, value, count, $mask0, $handler) {
    if (!(($mask0 & 4) === 0))
      count = -1;
    return this.wc3(key, value, count);
  };
  EventListenerFastMap.prototype.xc3 = function (key) {
    return this.sc3_1.y(key);
  };
  EventListenerFastMap.prototype.zc3 = function (key) {
    var index = this.xc3(key);
    return index >= 0 ? this.uc3_1.t4n(index) : 0;
  };
  EventListenerFastMap.prototype.ac4 = function (key, count) {
    if (this.xc3(key) < 0) {
      this.wc3(key, null, 0);
    }
    this.uc3_1.r4o(this.xc3(key), count);
  };
  EventListenerFastMap.prototype.bc4 = function (key) {
    var index = this.xc3(key);
    if (index < 0)
      return null;
    return this.tc3_1.m(index);
  };
  EventListenerFastMap.prototype.cc4 = function (key, gen) {
    var index = this.xc3(key);
    if (index < 0 ? true : this.tc3_1.m(index) == null) {
      var value = gen();
      this.yc3(key, value, 0, 4, null);
      return value;
    }
    return ensureNotNull(this.tc3_1.m(index));
  };
  EventListenerFastMap.$metadata$ = classMeta('EventListenerFastMap');
  var Type_MOVE_instance;
  var Type_DRAG_instance;
  var Type_UP_instance;
  var Type_DOWN_instance;
  var Type_CLICK_instance;
  var Type_ENTER_instance;
  var Type_EXIT_instance;
  var Type_SCROLL_instance;
  var Type_entriesInitialized;
  function Type_initEntries() {
    if (Type_entriesInitialized)
      return Unit_getInstance();
    Type_entriesInitialized = true;
    Type_MOVE_instance = new Type('MOVE', 0);
    Type_DRAG_instance = new Type('DRAG', 1);
    Type_UP_instance = new Type('UP', 2);
    Type_DOWN_instance = new Type('DOWN', 3);
    Type_CLICK_instance = new Type('CLICK', 4);
    Type_ENTER_instance = new Type('ENTER', 5);
    Type_EXIT_instance = new Type('EXIT', 6);
    Type_SCROLL_instance = new Type('SCROLL', 7);
  }
  var ScrollDeltaMode_PIXEL_instance;
  var ScrollDeltaMode_LINE_instance;
  var ScrollDeltaMode_PAGE_instance;
  var ScrollDeltaMode_entriesInitialized;
  function ScrollDeltaMode_initEntries() {
    if (ScrollDeltaMode_entriesInitialized)
      return Unit_getInstance();
    ScrollDeltaMode_entriesInitialized = true;
    ScrollDeltaMode_PIXEL_instance = new ScrollDeltaMode('PIXEL', 0, 1.0);
    ScrollDeltaMode_LINE_instance = new ScrollDeltaMode('LINE', 1, 10.0);
    ScrollDeltaMode_PAGE_instance = new ScrollDeltaMode('PAGE', 2, 100.0);
  }
  function MouseEvent_init_$Init$(type, id, x, y, button, buttons, scrollDeltaX, scrollDeltaY, scrollDeltaZ, isShiftDown, isCtrlDown, isAltDown, isMetaDown, scaleCoords, emulated, scrollDeltaMode, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      type = Type_MOVE_getInstance();
    if (!(($mask0 & 2) === 0))
      id = 0;
    if (!(($mask0 & 4) === 0))
      x = 0;
    if (!(($mask0 & 8) === 0))
      y = 0;
    if (!(($mask0 & 16) === 0))
      button = MouseButton_NONE_getInstance();
    if (!(($mask0 & 32) === 0))
      buttons = 0;
    if (!(($mask0 & 64) === 0))
      scrollDeltaX = 0.0;
    if (!(($mask0 & 128) === 0))
      scrollDeltaY = 0.0;
    if (!(($mask0 & 256) === 0))
      scrollDeltaZ = 0.0;
    if (!(($mask0 & 512) === 0))
      isShiftDown = false;
    if (!(($mask0 & 1024) === 0))
      isCtrlDown = false;
    if (!(($mask0 & 2048) === 0))
      isAltDown = false;
    if (!(($mask0 & 4096) === 0))
      isMetaDown = false;
    if (!(($mask0 & 8192) === 0))
      scaleCoords = true;
    if (!(($mask0 & 16384) === 0))
      emulated = false;
    if (!(($mask0 & 32768) === 0))
      scrollDeltaMode = ScrollDeltaMode_LINE_getInstance();
    MouseEvent.call($this, type, id, x, y, button, buttons, scrollDeltaX, scrollDeltaY, scrollDeltaZ, isShiftDown, isCtrlDown, isAltDown, isMetaDown, scaleCoords, emulated, scrollDeltaMode);
    return $this;
  }
  function MouseEvent_init_$Create$(type, id, x, y, button, buttons, scrollDeltaX, scrollDeltaY, scrollDeltaZ, isShiftDown, isCtrlDown, isAltDown, isMetaDown, scaleCoords, emulated, scrollDeltaMode, $mask0, $marker) {
    return MouseEvent_init_$Init$(type, id, x, y, button, buttons, scrollDeltaX, scrollDeltaY, scrollDeltaZ, isShiftDown, isCtrlDown, isAltDown, isMetaDown, scaleCoords, emulated, scrollDeltaMode, $mask0, $marker, Object.create(MouseEvent.prototype));
  }
  function Type(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function ScrollDeltaMode(name, ordinal, scale) {
    Enum.call(this, name, ordinal);
    this.fc4_1 = scale;
  }
  ScrollDeltaMode.prototype.gc4 = function (value, target) {
    return value * (this.fc4_1 / target.fc4_1);
  };
  ScrollDeltaMode.$metadata$ = classMeta('ScrollDeltaMode', undefined, undefined, undefined, undefined, Enum.prototype);
  function MouseEvent$requestLock$lambda() {
    return Unit_getInstance();
  }
  function Type_MOVE_getInstance() {
    Type_initEntries();
    return Type_MOVE_instance;
  }
  function Type_DRAG_getInstance() {
    Type_initEntries();
    return Type_DRAG_instance;
  }
  function Type_UP_getInstance() {
    Type_initEntries();
    return Type_UP_instance;
  }
  function Type_DOWN_getInstance() {
    Type_initEntries();
    return Type_DOWN_instance;
  }
  function Type_CLICK_getInstance() {
    Type_initEntries();
    return Type_CLICK_instance;
  }
  function Type_ENTER_getInstance() {
    Type_initEntries();
    return Type_ENTER_instance;
  }
  function Type_EXIT_getInstance() {
    Type_initEntries();
    return Type_EXIT_instance;
  }
  function Type_SCROLL_getInstance() {
    Type_initEntries();
    return Type_SCROLL_instance;
  }
  function ScrollDeltaMode_PIXEL_getInstance() {
    ScrollDeltaMode_initEntries();
    return ScrollDeltaMode_PIXEL_instance;
  }
  function ScrollDeltaMode_LINE_getInstance() {
    ScrollDeltaMode_initEntries();
    return ScrollDeltaMode_LINE_instance;
  }
  function ScrollDeltaMode_PAGE_getInstance() {
    ScrollDeltaMode_initEntries();
    return ScrollDeltaMode_PAGE_instance;
  }
  function MouseEvent(type, id, x, y, button, buttons, scrollDeltaX, scrollDeltaY, scrollDeltaZ, isShiftDown, isCtrlDown, isAltDown, isMetaDown, scaleCoords, emulated, scrollDeltaMode) {
    Event.call(this);
    this.jc4_1 = type;
    this.kc4_1 = id;
    this.lc4_1 = x;
    this.mc4_1 = y;
    this.nc4_1 = button;
    this.oc4_1 = buttons;
    this.pc4_1 = scrollDeltaX;
    this.qc4_1 = scrollDeltaY;
    this.rc4_1 = scrollDeltaZ;
    this.sc4_1 = isShiftDown;
    this.tc4_1 = isCtrlDown;
    this.uc4_1 = isAltDown;
    this.vc4_1 = isMetaDown;
    this.wc4_1 = scaleCoords;
    this.xc4_1 = emulated;
    this.yc4_1 = scrollDeltaMode;
    this.zc4_1 = null;
    var tmp = this;
    tmp.ac5_1 = MouseEvent$requestLock$lambda;
  }
  MouseEvent.prototype.bc5 = function (_set____db54di) {
    this.jc4_1 = _set____db54di;
  };
  MouseEvent.prototype.cc5 = function (_set____db54di) {
    this.kc4_1 = _set____db54di;
  };
  MouseEvent.prototype.a9g = function (_set____db54di) {
    this.lc4_1 = _set____db54di;
  };
  MouseEvent.prototype.b9g = function (_set____db54di) {
    this.mc4_1 = _set____db54di;
  };
  MouseEvent.prototype.dc5 = function (_set____db54di) {
    this.nc4_1 = _set____db54di;
  };
  MouseEvent.prototype.ec5 = function (_set____db54di) {
    this.oc4_1 = _set____db54di;
  };
  MouseEvent.prototype.fc5 = function (_set____db54di) {
    this.sc4_1 = _set____db54di;
  };
  MouseEvent.prototype.gc5 = function (_set____db54di) {
    this.tc4_1 = _set____db54di;
  };
  MouseEvent.prototype.hc5 = function (_set____db54di) {
    this.uc4_1 = _set____db54di;
  };
  MouseEvent.prototype.ic5 = function (_set____db54di) {
    this.vc4_1 = _set____db54di;
  };
  MouseEvent.prototype.jc5 = function (_set____db54di) {
    this.wc4_1 = _set____db54di;
  };
  MouseEvent.prototype.kc5 = function (_set____db54di) {
    this.xc4_1 = _set____db54di;
  };
  MouseEvent.prototype.lc5 = function () {
    return this.jc4_1.equals(Type_DRAG_getInstance());
  };
  MouseEvent.prototype.mc5 = function () {
    return this.jc4_1.equals(Type_UP_getInstance());
  };
  MouseEvent.prototype.nc5 = function () {
    return this.jc4_1.equals(Type_DOWN_getInstance());
  };
  MouseEvent.prototype.oc5 = function () {
    return this.jc4_1.equals(Type_CLICK_getInstance());
  };
  MouseEvent.prototype.pc5 = function (other) {
    this.jc4_1 = other.jc4_1;
    this.kc4_1 = other.kc4_1;
    this.lc4_1 = other.lc4_1;
    this.mc4_1 = other.mc4_1;
    this.nc4_1 = other.nc4_1;
    this.oc4_1 = other.oc4_1;
    this.pc4_1 = other.pc4_1;
    this.qc4_1 = other.qc4_1;
    this.rc4_1 = other.rc4_1;
    this.sc4_1 = other.sc4_1;
    this.tc4_1 = other.tc4_1;
    this.uc4_1 = other.uc4_1;
    this.vc4_1 = other.vc4_1;
    this.wc4_1 = other.wc4_1;
    this.xc4_1 = other.xc4_1;
    this.yc4_1 = other.yc4_1;
  };
  MouseEvent.prototype.qc5 = function (mode) {
    return this.yc4_1.gc4(this.pc4_1, mode);
  };
  MouseEvent.prototype.rc5 = function (mode) {
    return this.yc4_1.gc4(this.qc4_1, mode);
  };
  MouseEvent.prototype.sc5 = function (mode, x, y, z) {
    this.yc4_1 = mode;
    this.pc4_1 = x;
    this.qc4_1 = y;
    this.rc4_1 = z;
  };
  MouseEvent.prototype.tc5 = function () {
    return this.qc5(ScrollDeltaMode_PIXEL_getInstance());
  };
  MouseEvent.prototype.uc5 = function () {
    return this.rc5(ScrollDeltaMode_PIXEL_getInstance());
  };
  MouseEvent.prototype.toString = function () {
    return 'MouseEvent(type=' + this.jc4_1 + ', id=' + this.kc4_1 + ', x=' + this.lc4_1 + ', y=' + this.mc4_1 + ', button=' + this.nc4_1 + ', buttons=' + this.oc4_1 + ', scrollDeltaX=' + this.pc4_1 + ', scrollDeltaY=' + this.qc4_1 + ', scrollDeltaZ=' + this.rc4_1 + ', isShiftDown=' + this.sc4_1 + ', isCtrlDown=' + this.tc4_1 + ', isAltDown=' + this.uc4_1 + ', isMetaDown=' + this.vc4_1 + ', scaleCoords=' + this.wc4_1 + ', emulated=' + this.xc4_1 + ', scrollDeltaMode=' + this.yc4_1 + ')';
  };
  MouseEvent.prototype.hashCode = function () {
    var result = this.jc4_1.hashCode();
    result = imul(result, 31) + this.kc4_1 | 0;
    result = imul(result, 31) + this.lc4_1 | 0;
    result = imul(result, 31) + this.mc4_1 | 0;
    result = imul(result, 31) + this.nc4_1.hashCode() | 0;
    result = imul(result, 31) + this.oc4_1 | 0;
    result = imul(result, 31) + getNumberHashCode(this.pc4_1) | 0;
    result = imul(result, 31) + getNumberHashCode(this.qc4_1) | 0;
    result = imul(result, 31) + getNumberHashCode(this.rc4_1) | 0;
    result = imul(result, 31) + (this.sc4_1 | 0) | 0;
    result = imul(result, 31) + (this.tc4_1 | 0) | 0;
    result = imul(result, 31) + (this.uc4_1 | 0) | 0;
    result = imul(result, 31) + (this.vc4_1 | 0) | 0;
    result = imul(result, 31) + (this.wc4_1 | 0) | 0;
    result = imul(result, 31) + (this.xc4_1 | 0) | 0;
    result = imul(result, 31) + this.yc4_1.hashCode() | 0;
    return result;
  };
  MouseEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof MouseEvent))
      return false;
    var tmp0_other_with_cast = other instanceof MouseEvent ? other : THROW_CCE();
    if (!this.jc4_1.equals(tmp0_other_with_cast.jc4_1))
      return false;
    if (!(this.kc4_1 === tmp0_other_with_cast.kc4_1))
      return false;
    if (!(this.lc4_1 === tmp0_other_with_cast.lc4_1))
      return false;
    if (!(this.mc4_1 === tmp0_other_with_cast.mc4_1))
      return false;
    if (!this.nc4_1.equals(tmp0_other_with_cast.nc4_1))
      return false;
    if (!(this.oc4_1 === tmp0_other_with_cast.oc4_1))
      return false;
    if (!equals(this.pc4_1, tmp0_other_with_cast.pc4_1))
      return false;
    if (!equals(this.qc4_1, tmp0_other_with_cast.qc4_1))
      return false;
    if (!equals(this.rc4_1, tmp0_other_with_cast.rc4_1))
      return false;
    if (!(this.sc4_1 === tmp0_other_with_cast.sc4_1))
      return false;
    if (!(this.tc4_1 === tmp0_other_with_cast.tc4_1))
      return false;
    if (!(this.uc4_1 === tmp0_other_with_cast.uc4_1))
      return false;
    if (!(this.vc4_1 === tmp0_other_with_cast.vc4_1))
      return false;
    if (!(this.wc4_1 === tmp0_other_with_cast.wc4_1))
      return false;
    if (!(this.xc4_1 === tmp0_other_with_cast.xc4_1))
      return false;
    if (!this.yc4_1.equals(tmp0_other_with_cast.yc4_1))
      return false;
    return true;
  };
  MouseEvent.$metadata$ = classMeta('MouseEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  var Type_FOCUS_instance;
  var Type_BLUR_instance;
  var Type_entriesInitialized_0;
  function Type_initEntries_0() {
    if (Type_entriesInitialized_0)
      return Unit_getInstance();
    Type_entriesInitialized_0 = true;
    Type_FOCUS_instance = new Type_0('FOCUS', 0);
    Type_BLUR_instance = new Type_0('BLUR', 1);
  }
  function Type_0(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type_0.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function Type_BLUR_getInstance() {
    Type_initEntries_0();
    return Type_BLUR_instance;
  }
  function ReshapeEvent_init_$Init$(x, y, width, height, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      x = 0;
    if (!(($mask0 & 2) === 0))
      y = 0;
    if (!(($mask0 & 4) === 0))
      width = 0;
    if (!(($mask0 & 8) === 0))
      height = 0;
    ReshapeEvent.call($this, x, y, width, height);
    return $this;
  }
  function ReshapeEvent_init_$Create$(x, y, width, height, $mask0, $marker) {
    return ReshapeEvent_init_$Init$(x, y, width, height, $mask0, $marker, Object.create(ReshapeEvent.prototype));
  }
  function Companion_28() {
    Companion_instance_28 = this;
  }
  Companion_28.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_28;
  function Companion_getInstance_43() {
    if (Companion_instance_28 == null)
      new Companion_28();
    return Companion_instance_28;
  }
  function ReshapeEvent(x, y, width, height) {
    Companion_getInstance_43();
    TypedEvent.call(this, Companion_getInstance_43());
    this.yc5_1 = x;
    this.zc5_1 = y;
    this.ac6_1 = width;
    this.bc6_1 = height;
  }
  ReshapeEvent.prototype.a9g = function (_set____db54di) {
    this.yc5_1 = _set____db54di;
  };
  ReshapeEvent.prototype.b9g = function (_set____db54di) {
    this.zc5_1 = _set____db54di;
  };
  ReshapeEvent.prototype.r9d = function (_set____db54di) {
    this.ac6_1 = _set____db54di;
  };
  ReshapeEvent.prototype.q9d = function (_set____db54di) {
    this.bc6_1 = _set____db54di;
  };
  ReshapeEvent.prototype.toString = function () {
    return 'ReshapeEvent(x=' + this.yc5_1 + ', y=' + this.zc5_1 + ', width=' + this.ac6_1 + ', height=' + this.bc6_1 + ')';
  };
  ReshapeEvent.prototype.hashCode = function () {
    var result = this.yc5_1;
    result = imul(result, 31) + this.zc5_1 | 0;
    result = imul(result, 31) + this.ac6_1 | 0;
    result = imul(result, 31) + this.bc6_1 | 0;
    return result;
  };
  ReshapeEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof ReshapeEvent))
      return false;
    var tmp0_other_with_cast = other instanceof ReshapeEvent ? other : THROW_CCE();
    if (!(this.yc5_1 === tmp0_other_with_cast.yc5_1))
      return false;
    if (!(this.zc5_1 === tmp0_other_with_cast.zc5_1))
      return false;
    if (!(this.ac6_1 === tmp0_other_with_cast.ac6_1))
      return false;
    if (!(this.bc6_1 === tmp0_other_with_cast.bc6_1))
      return false;
    return true;
  };
  ReshapeEvent.$metadata$ = classMeta('ReshapeEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  var Type_UP_instance_0;
  var Type_DOWN_instance_0;
  var Type_TYPE_instance;
  var Type_entriesInitialized_1;
  function Type_initEntries_1() {
    if (Type_entriesInitialized_1)
      return Unit_getInstance();
    Type_entriesInitialized_1 = true;
    Type_UP_instance_0 = new Type_1('UP', 0);
    Type_DOWN_instance_0 = new Type_1('DOWN', 1);
    Type_TYPE_instance = new Type_1('TYPE', 2);
  }
  function KeyEvent_init_$Init$(type, id, key, keyCode, character, shift, ctrl, alt, meta, str, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      type = Type_UP_getInstance_0();
    if (!(($mask0 & 2) === 0))
      id = 0;
    if (!(($mask0 & 4) === 0))
      key = Key_UP_getInstance();
    if (!(($mask0 & 8) === 0))
      keyCode = 0;
    if (!(($mask0 & 16) === 0))
      character = _Char___init__impl__6a9atx(0);
    if (!(($mask0 & 32) === 0))
      shift = false;
    if (!(($mask0 & 64) === 0))
      ctrl = false;
    if (!(($mask0 & 128) === 0))
      alt = false;
    if (!(($mask0 & 256) === 0))
      meta = false;
    if (!(($mask0 & 512) === 0))
      str = null;
    KeyEvent.call($this, type, id, key, keyCode, character, shift, ctrl, alt, meta, str);
    return $this;
  }
  function KeyEvent_init_$Create$(type, id, key, keyCode, character, shift, ctrl, alt, meta, str, $mask0, $marker) {
    return KeyEvent_init_$Init$(type, id, key, keyCode, character, shift, ctrl, alt, meta, str, $mask0, $marker, Object.create(KeyEvent.prototype));
  }
  function Type_1(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type_1.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function Type_UP_getInstance_0() {
    Type_initEntries_1();
    return Type_UP_instance_0;
  }
  function Type_DOWN_getInstance_0() {
    Type_initEntries_1();
    return Type_DOWN_instance_0;
  }
  function Type_TYPE_getInstance() {
    Type_initEntries_1();
    return Type_TYPE_instance;
  }
  function KeyEvent(type, id, key, keyCode, character, shift, ctrl, alt, meta, str) {
    Event.call(this);
    this.ec6_1 = type;
    this.fc6_1 = id;
    this.gc6_1 = key;
    this.hc6_1 = keyCode;
    this.ic6_1 = character;
    this.jc6_1 = shift;
    this.kc6_1 = ctrl;
    this.lc6_1 = alt;
    this.mc6_1 = meta;
    this.nc6_1 = str;
    this.oc6_1 = Companion_getInstance_3().l1h_1;
  }
  KeyEvent.prototype.bc5 = function (_set____db54di) {
    this.ec6_1 = _set____db54di;
  };
  KeyEvent.prototype.cc5 = function (_set____db54di) {
    this.fc6_1 = _set____db54di;
  };
  KeyEvent.prototype.pc6 = function (_set____db54di) {
    this.gc6_1 = _set____db54di;
  };
  KeyEvent.prototype.k1 = function () {
    return this.gc6_1;
  };
  KeyEvent.prototype.qc6 = function (_set____db54di) {
    this.hc6_1 = _set____db54di;
  };
  KeyEvent.prototype.rc6 = function (_set____db54di) {
    this.ic6_1 = _set____db54di;
  };
  KeyEvent.prototype.sc6 = function () {
    return this.ic6_1;
  };
  KeyEvent.prototype.tc6 = function (_set____db54di) {
    this.jc6_1 = _set____db54di;
  };
  KeyEvent.prototype.uc6 = function () {
    return this.jc6_1;
  };
  KeyEvent.prototype.vc6 = function (_set____db54di) {
    this.kc6_1 = _set____db54di;
  };
  KeyEvent.prototype.wc6 = function () {
    return this.kc6_1;
  };
  KeyEvent.prototype.xc6 = function (_set____db54di) {
    this.lc6_1 = _set____db54di;
  };
  KeyEvent.prototype.yc6 = function (_set____db54di) {
    this.mc6_1 = _set____db54di;
  };
  KeyEvent.prototype.zc6 = function () {
    return this.mc6_1;
  };
  KeyEvent.prototype.nc5 = function () {
    return this.ec6_1.equals(Type_DOWN_getInstance_0());
  };
  KeyEvent.prototype.ac7 = function () {
    var tmp0_elvis_lhs = this.nc6_1;
    return tmp0_elvis_lhs == null ? '' + new Char(this.ic6_1) : tmp0_elvis_lhs;
  };
  KeyEvent.prototype.toString = function () {
    return 'KeyEvent(type=' + this.ec6_1 + ', id=' + this.fc6_1 + ', key=' + this.gc6_1 + ', keyCode=' + this.hc6_1 + ', character=' + new Char(this.ic6_1) + ', shift=' + this.jc6_1 + ', ctrl=' + this.kc6_1 + ', alt=' + this.lc6_1 + ', meta=' + this.mc6_1 + ', str=' + this.nc6_1 + ')';
  };
  KeyEvent.prototype.hashCode = function () {
    var result = this.ec6_1.hashCode();
    result = imul(result, 31) + this.fc6_1 | 0;
    result = imul(result, 31) + this.gc6_1.hashCode() | 0;
    result = imul(result, 31) + this.hc6_1 | 0;
    result = imul(result, 31) + Char__hashCode_impl_otmys(this.ic6_1) | 0;
    result = imul(result, 31) + (this.jc6_1 | 0) | 0;
    result = imul(result, 31) + (this.kc6_1 | 0) | 0;
    result = imul(result, 31) + (this.lc6_1 | 0) | 0;
    result = imul(result, 31) + (this.mc6_1 | 0) | 0;
    result = imul(result, 31) + (this.nc6_1 == null ? 0 : getStringHashCode(this.nc6_1)) | 0;
    return result;
  };
  KeyEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof KeyEvent))
      return false;
    var tmp0_other_with_cast = other instanceof KeyEvent ? other : THROW_CCE();
    if (!this.ec6_1.equals(tmp0_other_with_cast.ec6_1))
      return false;
    if (!(this.fc6_1 === tmp0_other_with_cast.fc6_1))
      return false;
    if (!this.gc6_1.equals(tmp0_other_with_cast.gc6_1))
      return false;
    if (!(this.hc6_1 === tmp0_other_with_cast.hc6_1))
      return false;
    if (!equals(new Char(this.ic6_1), new Char(tmp0_other_with_cast.ic6_1)))
      return false;
    if (!(this.jc6_1 === tmp0_other_with_cast.jc6_1))
      return false;
    if (!(this.kc6_1 === tmp0_other_with_cast.kc6_1))
      return false;
    if (!(this.lc6_1 === tmp0_other_with_cast.lc6_1))
      return false;
    if (!(this.mc6_1 === tmp0_other_with_cast.mc6_1))
      return false;
    if (!(this.nc6_1 == tmp0_other_with_cast.nc6_1))
      return false;
    return true;
  };
  KeyEvent.$metadata$ = classMeta('KeyEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  function TEvent() {
  }
  TEvent.$metadata$ = interfaceMeta('TEvent');
  function EventType() {
  }
  EventType.$metadata$ = interfaceMeta('EventType');
  function GamePadUpdateEvent_init_$Init$(gamepadsLength, gamepads, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      gamepadsLength = 0;
    if (!(($mask0 & 2) === 0)) {
      var tmp = 0;
      var tmp_0 = 8;
      var tmp$ret$0;
      var tmp$ret$0_0;
      // Inline function 'kotlin.arrayOfNulls' call
      tmp$ret$0 = fillArrayVal(Array(tmp_0), null);
      tmp$ret$0_0 = Unit_getInstance();
      var tmp_1 = tmp$ret$0;
      while (tmp < tmp_0) {
        var tmp_2 = tmp;
        var tmp$ret$1;
        var tmp$ret$1_0;
        // Inline function 'com.soywiz.korev.GamePadUpdateEvent.<init>.<anonymous>' call
        tmp$ret$1 = GamepadInfo_init_$Create$(tmp_2, false, null, null, null, 0, null, 0, 0, 0.0, null, 0, null, 8190, null);
        tmp$ret$1_0 = Unit_getInstance();
        tmp_1[tmp_2] = tmp$ret$1;
        tmp = tmp + 1 | 0;
      }
      gamepads = tmp_1;
    }
    GamePadUpdateEvent.call($this, gamepadsLength, gamepads);
    return $this;
  }
  function GamePadUpdateEvent_init_$Create$(gamepadsLength, gamepads, $mask0, $marker) {
    return GamePadUpdateEvent_init_$Init$(gamepadsLength, gamepads, $mask0, $marker, Object.create(GamePadUpdateEvent.prototype));
  }
  function Companion_29() {
    Companion_instance_29 = this;
  }
  Companion_29.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_29;
  function Companion_getInstance_44() {
    if (Companion_instance_29 == null)
      new Companion_29();
    return Companion_instance_29;
  }
  function GamePadUpdateEvent(gamepadsLength, gamepads) {
    Companion_getInstance_44();
    Event.call(this);
    this.dc7_1 = gamepadsLength;
    this.ec7_1 = gamepads;
  }
  GamePadUpdateEvent.prototype.toString = function () {
    var tmp$ret$2;
    // Inline function 'kotlin.collections.filter' call
    var tmp0_filter = this.ec7_1;
    var tmp$ret$1;
    // Inline function 'kotlin.collections.filterTo' call
    var tmp0_filterTo = ArrayList_init_$Create$();
    var indexedObject = tmp0_filter;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var element = indexedObject[inductionVariable];
      inductionVariable = inductionVariable + 1 | 0;
      var tmp$ret$0;
      // Inline function 'com.soywiz.korev.GamePadUpdateEvent.toString.<anonymous>' call
      tmp$ret$0 = element.gc7_1;
      if (tmp$ret$0) {
        tmp0_filterTo.c(element);
      }
    }
    tmp$ret$1 = tmp0_filterTo;
    tmp$ret$2 = tmp$ret$1;
    return 'GamePadUpdateEvent(' + tmp$ret$2 + ')';
  };
  GamePadUpdateEvent.prototype.hashCode = function () {
    var result = this.dc7_1;
    result = imul(result, 31) + hashCode(this.ec7_1) | 0;
    return result;
  };
  GamePadUpdateEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof GamePadUpdateEvent))
      return false;
    var tmp0_other_with_cast = other instanceof GamePadUpdateEvent ? other : THROW_CCE();
    if (!(this.dc7_1 === tmp0_other_with_cast.dc7_1))
      return false;
    if (!equals(this.ec7_1, tmp0_other_with_cast.ec7_1))
      return false;
    return true;
  };
  GamePadUpdateEvent.$metadata$ = classMeta('GamePadUpdateEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  var Type_CONNECTED_instance;
  var Type_DISCONNECTED_instance;
  var Type_entriesInitialized_2;
  function Type_initEntries_2() {
    if (Type_entriesInitialized_2)
      return Unit_getInstance();
    Type_entriesInitialized_2 = true;
    Type_CONNECTED_instance = new Type_2('CONNECTED', 0);
    Type_DISCONNECTED_instance = new Type_2('DISCONNECTED', 1);
  }
  function GamePadConnectionEvent_init_$Init$(type, gamepad, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      type = Type_CONNECTED_getInstance();
    if (!(($mask0 & 2) === 0))
      gamepad = 0;
    GamePadConnectionEvent.call($this, type, gamepad);
    return $this;
  }
  function GamePadConnectionEvent_init_$Create$(type, gamepad, $mask0, $marker) {
    return GamePadConnectionEvent_init_$Init$(type, gamepad, $mask0, $marker, Object.create(GamePadConnectionEvent.prototype));
  }
  function Type_2(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type_2.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function Type_CONNECTED_getInstance() {
    Type_initEntries_2();
    return Type_CONNECTED_instance;
  }
  function Type_DISCONNECTED_getInstance() {
    Type_initEntries_2();
    return Type_DISCONNECTED_instance;
  }
  function GamePadConnectionEvent(type, gamepad) {
    Event.call(this);
    this.vc7_1 = type;
    this.wc7_1 = gamepad;
  }
  GamePadConnectionEvent.prototype.bc5 = function (_set____db54di) {
    this.vc7_1 = _set____db54di;
  };
  GamePadConnectionEvent.prototype.xc7 = function (_set____db54di) {
    this.wc7_1 = _set____db54di;
  };
  GamePadConnectionEvent.prototype.toString = function () {
    return 'GamePadConnectionEvent(type=' + this.vc7_1 + ', gamepad=' + this.wc7_1 + ')';
  };
  GamePadConnectionEvent.prototype.hashCode = function () {
    var result = this.vc7_1.hashCode();
    result = imul(result, 31) + this.wc7_1 | 0;
    return result;
  };
  GamePadConnectionEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof GamePadConnectionEvent))
      return false;
    var tmp0_other_with_cast = other instanceof GamePadConnectionEvent ? other : THROW_CCE();
    if (!this.vc7_1.equals(tmp0_other_with_cast.vc7_1))
      return false;
    if (!(this.wc7_1 === tmp0_other_with_cast.wc7_1))
      return false;
    return true;
  };
  GamePadConnectionEvent.$metadata$ = classMeta('GamePadConnectionEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  var Type_MAGNIFY_instance;
  var Type_ROTATE_instance;
  var Type_SWIPE_instance;
  var Type_SMART_MAGNIFY_instance;
  var Type_entriesInitialized_3;
  function Type_initEntries_3() {
    if (Type_entriesInitialized_3)
      return Unit_getInstance();
    Type_entriesInitialized_3 = true;
    Type_MAGNIFY_instance = new Type_3('MAGNIFY', 0);
    Type_ROTATE_instance = new Type_3('ROTATE', 1);
    Type_SWIPE_instance = new Type_3('SWIPE', 2);
    Type_SMART_MAGNIFY_instance = new Type_3('SMART_MAGNIFY', 3);
  }
  function GestureEvent_init_$Init$(type, id, amountX, amountY, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      type = Type_MAGNIFY_getInstance();
    if (!(($mask0 & 2) === 0))
      id = 0;
    if (!(($mask0 & 4) === 0))
      amountX = 0.0;
    if (!(($mask0 & 8) === 0))
      amountY = 0.0;
    GestureEvent.call($this, type, id, amountX, amountY);
    return $this;
  }
  function GestureEvent_init_$Create$(type, id, amountX, amountY, $mask0, $marker) {
    return GestureEvent_init_$Init$(type, id, amountX, amountY, $mask0, $marker, Object.create(GestureEvent.prototype));
  }
  function Type_3(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type_3.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function Type_MAGNIFY_getInstance() {
    Type_initEntries_3();
    return Type_MAGNIFY_instance;
  }
  function GestureEvent(type, id, amountX, amountY) {
    Event.call(this);
    this.ac8_1 = type;
    this.bc8_1 = id;
    this.cc8_1 = amountX;
    this.dc8_1 = amountY;
  }
  GestureEvent.prototype.toString = function () {
    return 'GestureEvent(type=' + this.ac8_1 + ', id=' + this.bc8_1 + ', amountX=' + this.cc8_1 + ', amountY=' + this.dc8_1 + ')';
  };
  GestureEvent.prototype.hashCode = function () {
    var result = this.ac8_1.hashCode();
    result = imul(result, 31) + this.bc8_1 | 0;
    result = imul(result, 31) + getNumberHashCode(this.cc8_1) | 0;
    result = imul(result, 31) + getNumberHashCode(this.dc8_1) | 0;
    return result;
  };
  GestureEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof GestureEvent))
      return false;
    var tmp0_other_with_cast = other instanceof GestureEvent ? other : THROW_CCE();
    if (!this.ac8_1.equals(tmp0_other_with_cast.ac8_1))
      return false;
    if (!(this.bc8_1 === tmp0_other_with_cast.bc8_1))
      return false;
    if (!equals(this.cc8_1, tmp0_other_with_cast.cc8_1))
      return false;
    if (!equals(this.dc8_1, tmp0_other_with_cast.dc8_1))
      return false;
    return true;
  };
  GestureEvent.$metadata$ = classMeta('GestureEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  var Type_START_instance;
  var Type_END_instance;
  var Type_MOVE_instance_0;
  var Type_HOVER_instance;
  var Type_UNKNOWN_instance;
  var Type_entriesInitialized_4;
  function Type_initEntries_4() {
    if (Type_entriesInitialized_4)
      return Unit_getInstance();
    Type_entriesInitialized_4 = true;
    Type_START_instance = new Type_4('START', 0);
    Type_END_instance = new Type_4('END', 1);
    Type_MOVE_instance_0 = new Type_4('MOVE', 2);
    Type_HOVER_instance = new Type_4('HOVER', 3);
    Type_UNKNOWN_instance = new Type_4('UNKNOWN', 4);
  }
  function TouchEvent_init_$Init$(type, screen, currentTime, scaleCoords, emulated, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      type = Type_START_getInstance();
    if (!(($mask0 & 2) === 0))
      screen = 0;
    if (!(($mask0 & 4) === 0))
      currentTime = Companion_getInstance_8().z1g_1;
    if (!(($mask0 & 8) === 0))
      scaleCoords = true;
    if (!(($mask0 & 16) === 0))
      emulated = false;
    TouchEvent.call($this, type, screen, currentTime, scaleCoords, emulated);
    return $this;
  }
  function TouchEvent_init_$Create$(type, screen, currentTime, scaleCoords, emulated, $mask0, $marker) {
    return TouchEvent_init_$Init$(type, screen, currentTime, scaleCoords, emulated, $mask0, $marker, Object.create(TouchEvent.prototype));
  }
  function Type_4(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type_4.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function Companion_30() {
    Companion_instance_30 = this;
    this.ec8_1 = 10;
  }
  Companion_30.$metadata$ = objectMeta('Companion');
  var Companion_instance_30;
  function Companion_getInstance_45() {
    if (Companion_instance_30 == null)
      new Companion_30();
    return Companion_instance_30;
  }
  function TouchEvent$toString$lambda(it) {
    return it.toString();
  }
  function Type_START_getInstance() {
    Type_initEntries_4();
    return Type_START_instance;
  }
  function Type_END_getInstance() {
    Type_initEntries_4();
    return Type_END_instance;
  }
  function Type_MOVE_getInstance_0() {
    Type_initEntries_4();
    return Type_MOVE_instance_0;
  }
  function TouchEvent(type, screen, currentTime, scaleCoords, emulated) {
    Companion_getInstance_45();
    Event.call(this);
    this.hc8_1 = type;
    this.ic8_1 = screen;
    this.jc8_1 = currentTime;
    this.kc8_1 = scaleCoords;
    this.lc8_1 = emulated;
    var tmp = this;
    var tmp_0 = 0;
    var tmp_1 = Companion_getInstance_45().ec8_1;
    var tmp$ret$0;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp$ret$0 = fillArrayVal(Array(tmp_1), null);
    var tmp_2 = tmp$ret$0;
    while (tmp_0 < tmp_1) {
      var tmp_3 = tmp_0;
      var tmp$ret$1;
      // Inline function 'com.soywiz.korev.TouchEvent.bufferTouches.<anonymous>' call
      tmp$ret$1 = Touch_init_$Create$(tmp_3, 0, 0.0, 0.0, 0.0, null, null, null, 254, null);
      tmp_2[tmp_3] = tmp$ret$1;
      tmp_0 = tmp_0 + 1 | 0;
    }
    tmp.mc8_1 = tmp_2;
    this.nc8_1 = FastArrayList_init_$Create$();
    this.oc8_1 = FastArrayList_init_$Create$();
    this.pc8_1 = FastIntMap();
  }
  TouchEvent.prototype.qc8 = function () {
    return this.nc8_1;
  };
  TouchEvent.prototype.rc8 = function () {
    return this.oc8_1;
  };
  TouchEvent.prototype.sc8 = function () {
    return this.pc8_1;
  };
  TouchEvent.prototype.tc8 = function () {
    return this.nc8_1;
  };
  TouchEvent.prototype.uc8 = function () {
    return this.oc8_1;
  };
  TouchEvent.prototype.vc8 = function () {
    return this.tc8().i();
  };
  TouchEvent.prototype.wc8 = function (id) {
    var tmp$ret$1;
    // Inline function 'com.soywiz.kds.get' call
    var tmp0_get = this.pc8_1;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_get;
    tmp$ret$1 = tmp$ret$0.get(id);
    return tmp$ret$1;
  };
  TouchEvent.prototype.toString = function () {
    var tmp = this.hc8_1;
    var tmp_0 = this.vc8();
    var tmp_1 = this.tc8();
    return 'TouchEvent[' + tmp + '][' + tmp_0 + '](' + joinToString$default(tmp_1, ', ', null, null, 0, null, TouchEvent$toString$lambda, 30, null) + ')';
  };
  TouchEvent.prototype.xc8 = function (type) {
    this.hc8_1 = type;
    this.jc8_1 = Companion_getInstance_8().d1h();
    this.nc8_1.x7();
    // Inline function 'com.soywiz.kds.clear' call
    var tmp0_clear = this.pc8_1;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_clear;
    tmp$ret$0.clear();
  };
  TouchEvent.prototype.yc8 = function () {
    this.oc8_1.x7();
    // Inline function 'com.soywiz.kds.iterators.fastForEach' call
    var tmp0_fastForEach = this.tc8();
    var n = 0;
    while (n < tmp0_fastForEach.i()) {
      // Inline function 'com.soywiz.korev.TouchEvent.endFrame.<anonymous>' call
      var tmp0 = n;
      n = tmp0 + 1 | 0;
      var tmp1__anonymous__uwfjfc = tmp0_fastForEach.m(tmp0);
      if (tmp1__anonymous__uwfjfc.c1u()) {
        this.oc8_1.c(tmp1__anonymous__uwfjfc);
      }
    }
  };
  TouchEvent.prototype.ic9 = function (id) {
    var tmp$ret$1;
    // Inline function 'com.soywiz.kds.get' call
    var tmp0_get = this.pc8_1;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_get;
    tmp$ret$1 = tmp$ret$0.get(id);
    var tmp0_elvis_lhs = tmp$ret$1;
    return tmp0_elvis_lhs == null ? this.jc9(id) : tmp0_elvis_lhs;
  };
  TouchEvent.prototype.jc9 = function (id) {
    var touch = this.mc8_1[this.nc8_1.i()];
    touch.ac9_1 = id;
    this.nc8_1.c(touch);
    // Inline function 'com.soywiz.kds.set' call
    var tmp0_set = this.pc8_1;
    var tmp1_set = touch.ac9_1;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_set;
    tmp$ret$0.set(tmp1_set, touch);
    return touch;
  };
  TouchEvent.prototype.kc9 = function (id, x, y, status, force, kind, button) {
    var touch = this.ic9(id);
    touch.bc9_1 = x;
    touch.cc9_1 = y;
    touch.ec9_1 = status;
    touch.dc9_1 = force;
    touch.fc9_1 = kind;
    touch.gc9_1 = button;
  };
  TouchEvent.prototype.lc9 = function (id, x, y, status, force, kind, button, $mask0, $handler) {
    if (!(($mask0 & 8) === 0))
      status = Status_KEEP_getInstance();
    if (!(($mask0 & 16) === 0))
      force = 1.0;
    if (!(($mask0 & 32) === 0))
      kind = Kind_FINGER_getInstance();
    if (!(($mask0 & 64) === 0))
      button = MouseButton_LEFT_getInstance();
    return this.kc9(id, x, y, status, force, kind, button);
  };
  TouchEvent.prototype.mc9 = function (touch) {
    this.kc9(touch.ac9_1, touch.bc9_1, touch.cc9_1, touch.ec9_1, touch.dc9_1, touch.fc9_1, touch.gc9_1);
  };
  TouchEvent.prototype.nc9 = function (other) {
    this.hc8_1 = other.hc8_1;
    this.ic8_1 = other.ic8_1;
    this.jc8_1 = other.jc8_1;
    this.kc8_1 = other.kc8_1;
    this.lc8_1 = other.lc8_1;
    var inductionVariable = 0;
    var last = Companion_getInstance_45().ec8_1;
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        this.mc8_1[n].oc9(other.mc8_1[n]);
      }
       while (inductionVariable < last);
    this.nc8_1.x7();
    this.oc8_1.x7();
    // Inline function 'com.soywiz.kds.clear' call
    var tmp0_clear = this.pc8_1;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_clear;
    tmp$ret$0.clear();
    // Inline function 'com.soywiz.kds.iterators.fastForEach' call
    var tmp1_fastForEach = other.tc8();
    var n_0 = 0;
    while (n_0 < tmp1_fastForEach.i()) {
      // Inline function 'com.soywiz.korev.TouchEvent.copyFrom.<anonymous>' call
      var tmp0 = n_0;
      n_0 = tmp0 + 1 | 0;
      var tmp2__anonymous__z9zvc9 = tmp1_fastForEach.m(tmp0);
      var touch = this.mc8_1[tmp2__anonymous__z9zvc9.zc8_1];
      this.nc8_1.c(touch);
      if (touch.c1u()) {
        this.oc8_1.c(touch);
      }
      // Inline function 'com.soywiz.kds.set' call
      var tmp0_set = this.pc8_1;
      var tmp1_set = touch.ac9_1;
      var tmp$ret$1;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$1 = tmp0_set;
      tmp$ret$1.set(tmp1_set, touch);
    }
  };
  TouchEvent.prototype.pc9 = function () {
    return this.hc8_1.equals(Type_START_getInstance());
  };
  TouchEvent.prototype.qc9 = function () {
    return this.hc8_1.equals(Type_END_getInstance());
  };
  TouchEvent.prototype.hashCode = function () {
    var result = this.hc8_1.hashCode();
    result = imul(result, 31) + this.ic8_1 | 0;
    result = imul(result, 31) + DateTime__hashCode_impl_yf0bc9(this.jc8_1) | 0;
    result = imul(result, 31) + (this.kc8_1 | 0) | 0;
    result = imul(result, 31) + (this.lc8_1 | 0) | 0;
    return result;
  };
  TouchEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof TouchEvent))
      return false;
    var tmp0_other_with_cast = other instanceof TouchEvent ? other : THROW_CCE();
    if (!this.hc8_1.equals(tmp0_other_with_cast.hc8_1))
      return false;
    if (!(this.ic8_1 === tmp0_other_with_cast.ic8_1))
      return false;
    if (!equals(this.jc8_1, tmp0_other_with_cast.jc8_1))
      return false;
    if (!(this.kc8_1 === tmp0_other_with_cast.kc8_1))
      return false;
    if (!(this.lc8_1 === tmp0_other_with_cast.lc8_1))
      return false;
    return true;
  };
  TouchEvent.$metadata$ = classMeta('TouchEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  var Status_ADD_instance;
  var Status_KEEP_instance;
  var Status_REMOVE_instance;
  var Status_entriesInitialized;
  function Status_initEntries() {
    if (Status_entriesInitialized)
      return Unit_getInstance();
    Status_entriesInitialized = true;
    Status_ADD_instance = new Status('ADD', 0);
    Status_KEEP_instance = new Status('KEEP', 1);
    Status_REMOVE_instance = new Status('REMOVE', 2);
  }
  var Kind_FINGER_instance;
  var Kind_MOUSE_instance;
  var Kind_STYLUS_instance;
  var Kind_ERASER_instance;
  var Kind_UNKNOWN_instance;
  var Kind_entriesInitialized_0;
  function Kind_initEntries_0() {
    if (Kind_entriesInitialized_0)
      return Unit_getInstance();
    Kind_entriesInitialized_0 = true;
    Kind_FINGER_instance = new Kind_0('FINGER', 0);
    Kind_MOUSE_instance = new Kind_0('MOUSE', 1);
    Kind_STYLUS_instance = new Kind_0('STYLUS', 2);
    Kind_ERASER_instance = new Kind_0('ERASER', 3);
    Kind_UNKNOWN_instance = new Kind_0('UNKNOWN', 4);
  }
  function Touch_init_$Init$(index, id, x, y, force, status, kind, button, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      index = -1;
    if (!(($mask0 & 2) === 0))
      id = -1;
    if (!(($mask0 & 4) === 0))
      x = 0.0;
    if (!(($mask0 & 8) === 0))
      y = 0.0;
    if (!(($mask0 & 16) === 0))
      force = 1.0;
    if (!(($mask0 & 32) === 0))
      status = Status_KEEP_getInstance();
    if (!(($mask0 & 64) === 0))
      kind = Kind_FINGER_getInstance();
    if (!(($mask0 & 128) === 0))
      button = MouseButton_LEFT_getInstance();
    Touch.call($this, index, id, x, y, force, status, kind, button);
    return $this;
  }
  function Touch_init_$Create$(index, id, x, y, force, status, kind, button, $mask0, $marker) {
    return Touch_init_$Init$(index, id, x, y, force, status, kind, button, $mask0, $marker, Object.create(Touch.prototype));
  }
  function Status(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Status.$metadata$ = classMeta('Status', undefined, undefined, undefined, undefined, Enum.prototype);
  function Kind_0(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Kind_0.$metadata$ = classMeta('Kind', undefined, undefined, undefined, undefined, Enum.prototype);
  function Companion_31() {
    Companion_instance_31 = this;
    var tmp = this;
    tmp.rc9_1 = Touch_init_$Create$(-1, 0, 0.0, 0.0, 0.0, null, null, null, 254, null);
  }
  Companion_31.$metadata$ = objectMeta('Companion');
  var Companion_instance_31;
  function Companion_getInstance_46() {
    if (Companion_instance_31 == null)
      new Companion_31();
    return Companion_instance_31;
  }
  function Status_ADD_getInstance() {
    Status_initEntries();
    return Status_ADD_instance;
  }
  function Status_KEEP_getInstance() {
    Status_initEntries();
    return Status_KEEP_instance;
  }
  function Status_REMOVE_getInstance() {
    Status_initEntries();
    return Status_REMOVE_instance;
  }
  function Kind_FINGER_getInstance() {
    Kind_initEntries_0();
    return Kind_FINGER_instance;
  }
  function Kind_MOUSE_getInstance() {
    Kind_initEntries_0();
    return Kind_MOUSE_instance;
  }
  function Touch(index, id, x, y, force, status, kind, button) {
    Companion_getInstance_46();
    this.zc8_1 = index;
    this.ac9_1 = id;
    this.bc9_1 = x;
    this.cc9_1 = y;
    this.dc9_1 = force;
    this.ec9_1 = status;
    this.fc9_1 = kind;
    this.gc9_1 = button;
    var tmp = this;
    tmp.hc9_1 = Mixin_init_$Create$(null, 1, null);
  }
  Touch.prototype.m4 = function () {
    return this.zc8_1;
  };
  Touch.prototype.c1n = function () {
    return this.ac9_1;
  };
  Touch.prototype.d1n = function () {
    return this.bc9_1;
  };
  Touch.prototype.e1n = function () {
    return this.cc9_1;
  };
  Touch.prototype.sc9 = function (_set____db54di) {
    this.ec9_1 = _set____db54di;
  };
  Touch.prototype.m3q = function () {
    return this.ec9_1;
  };
  Touch.prototype.e4v = function (_set____db54di) {
    this.hc9_1.e4v(_set____db54di);
  };
  Touch.prototype.f4v = function () {
    return this.hc9_1.f4v();
  };
  Touch.prototype.c1u = function () {
    return !this.ec9_1.equals(Status_REMOVE_getInstance());
  };
  Touch.prototype.oc9 = function (other) {
    this.ac9_1 = other.ac9_1;
    this.bc9_1 = other.bc9_1;
    this.cc9_1 = other.cc9_1;
    this.dc9_1 = other.dc9_1;
    this.ec9_1 = other.ec9_1;
    this.fc9_1 = other.fc9_1;
    this.gc9_1 = other.gc9_1;
  };
  Touch.prototype.hashCode = function () {
    return this.zc8_1;
  };
  Touch.prototype.equals = function (other) {
    var tmp;
    if (other instanceof Touch) {
      tmp = this.zc8_1 === other.zc8_1;
    } else {
      tmp = false;
    }
    return tmp;
  };
  Touch.prototype.toString = function () {
    return 'Touch(index=' + this.zc8_1 + ', id=' + this.ac9_1 + ', x=' + this.bc9_1 + ', y=' + this.cc9_1 + ', force=' + this.dc9_1 + ', status=' + this.ec9_1 + ', kind=' + this.fc9_1 + ', button=' + this.gc9_1 + ')';
  };
  Touch.$metadata$ = classMeta('Touch', [Extra]);
  var Type_START_instance_0;
  var Type_END_instance_0;
  var Type_DROP_instance;
  var Type_entriesInitialized_5;
  function Type_initEntries_5() {
    if (Type_entriesInitialized_5)
      return Unit_getInstance();
    Type_entriesInitialized_5 = true;
    Type_START_instance_0 = new Type_5('START', 0);
    Type_END_instance_0 = new Type_5('END', 1);
    Type_DROP_instance = new Type_5('DROP', 2);
  }
  function DropFileEvent_init_$Init$(type, files, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      type = Type_START_getInstance_0();
    if (!(($mask0 & 2) === 0))
      files = null;
    DropFileEvent.call($this, type, files);
    return $this;
  }
  function DropFileEvent_init_$Create$(type, files, $mask0, $marker) {
    return DropFileEvent_init_$Init$(type, files, $mask0, $marker, Object.create(DropFileEvent.prototype));
  }
  function Type_5(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Type_5.$metadata$ = classMeta('Type', [EventType], undefined, undefined, undefined, Enum.prototype);
  function Type_START_getInstance_0() {
    Type_initEntries_5();
    return Type_START_instance_0;
  }
  function Type_END_getInstance_0() {
    Type_initEntries_5();
    return Type_END_instance_0;
  }
  function Type_DROP_getInstance() {
    Type_initEntries_5();
    return Type_DROP_instance;
  }
  function DropFileEvent(type, files) {
    Event.call(this);
    this.vc9_1 = type;
    this.wc9_1 = files;
  }
  DropFileEvent.prototype.bc5 = function (_set____db54di) {
    this.vc9_1 = _set____db54di;
  };
  DropFileEvent.prototype.xc9 = function (_set____db54di) {
    this.wc9_1 = _set____db54di;
  };
  DropFileEvent.prototype.toString = function () {
    return 'DropFileEvent(type=' + this.vc9_1 + ', files=' + this.wc9_1 + ')';
  };
  DropFileEvent.prototype.hashCode = function () {
    var result = this.vc9_1.hashCode();
    result = imul(result, 31) + (this.wc9_1 == null ? 0 : hashCode(this.wc9_1)) | 0;
    return result;
  };
  DropFileEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof DropFileEvent))
      return false;
    var tmp0_other_with_cast = other instanceof DropFileEvent ? other : THROW_CCE();
    if (!this.vc9_1.equals(tmp0_other_with_cast.vc9_1))
      return false;
    if (!equals(this.wc9_1, tmp0_other_with_cast.wc9_1))
      return false;
    return true;
  };
  DropFileEvent.$metadata$ = classMeta('DropFileEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  function Companion_32() {
    Companion_instance_32 = this;
  }
  Companion_32.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_32;
  function Companion_getInstance_47() {
    if (Companion_instance_32 == null)
      new Companion_32();
    return Companion_instance_32;
  }
  function ResumeEvent() {
    Companion_getInstance_47();
    TypedEvent.call(this, Companion_getInstance_47());
  }
  ResumeEvent.$metadata$ = classMeta('ResumeEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  function Companion_33() {
    Companion_instance_33 = this;
  }
  Companion_33.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_33;
  function Companion_getInstance_48() {
    if (Companion_instance_33 == null)
      new Companion_33();
    return Companion_instance_33;
  }
  function PauseEvent() {
    Companion_getInstance_48();
    TypedEvent.call(this, Companion_getInstance_48());
  }
  PauseEvent.$metadata$ = classMeta('PauseEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  function Companion_34() {
    Companion_instance_34 = this;
  }
  Companion_34.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_34;
  function Companion_getInstance_49() {
    if (Companion_instance_34 == null)
      new Companion_34();
    return Companion_instance_34;
  }
  function StopEvent() {
    Companion_getInstance_49();
    TypedEvent.call(this, Companion_getInstance_49());
  }
  StopEvent.$metadata$ = classMeta('StopEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  function Companion_35() {
    Companion_instance_35 = this;
  }
  Companion_35.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_35;
  function Companion_getInstance_50() {
    if (Companion_instance_35 == null)
      new Companion_35();
    return Companion_instance_35;
  }
  function DestroyEvent() {
    Companion_getInstance_50();
    TypedEvent.call(this, Companion_getInstance_50());
  }
  DestroyEvent.$metadata$ = classMeta('DestroyEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  function Companion_36() {
    Companion_instance_36 = this;
  }
  Companion_36.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_36;
  function Companion_getInstance_51() {
    if (Companion_instance_36 == null)
      new Companion_36();
    return Companion_instance_36;
  }
  function RenderEvent() {
    Companion_getInstance_51();
    Event.call(this);
    this.aca_1 = true;
    this.bca_1 = true;
  }
  RenderEvent.prototype.cca = function (_set____db54di) {
    this.aca_1 = _set____db54di;
  };
  RenderEvent.prototype.dca = function (_set____db54di) {
    this.bca_1 = _set____db54di;
  };
  RenderEvent.$metadata$ = classMeta('RenderEvent', [TEvent], undefined, undefined, undefined, Event.prototype);
  function Companion_37() {
    Companion_instance_37 = this;
  }
  Companion_37.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_37;
  function Companion_getInstance_52() {
    if (Companion_instance_37 == null)
      new Companion_37();
    return Companion_instance_37;
  }
  function InitEvent() {
    Companion_getInstance_52();
    TypedEvent.call(this, Companion_getInstance_52());
  }
  InitEvent.$metadata$ = classMeta('InitEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  function Companion_38() {
    Companion_instance_38 = this;
  }
  Companion_38.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_38;
  function Companion_getInstance_53() {
    if (Companion_instance_38 == null)
      new Companion_38();
    return Companion_instance_38;
  }
  function DisposeEvent() {
    Companion_getInstance_53();
    TypedEvent.call(this, Companion_getInstance_53());
  }
  DisposeEvent.$metadata$ = classMeta('DisposeEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  function FullScreenEvent_init_$Init$(fullscreen, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      fullscreen = false;
    FullScreenEvent.call($this, fullscreen);
    return $this;
  }
  function FullScreenEvent_init_$Create$(fullscreen, $mask0, $marker) {
    return FullScreenEvent_init_$Init$(fullscreen, $mask0, $marker, Object.create(FullScreenEvent.prototype));
  }
  function Companion_39() {
    Companion_instance_39 = this;
  }
  Companion_39.$metadata$ = objectMeta('Companion', [EventType]);
  var Companion_instance_39;
  function Companion_getInstance_54() {
    if (Companion_instance_39 == null)
      new Companion_39();
    return Companion_instance_39;
  }
  function FullScreenEvent(fullscreen) {
    Companion_getInstance_54();
    TypedEvent.call(this, Companion_getInstance_54());
    this.hca_1 = fullscreen;
  }
  FullScreenEvent.prototype.toString = function () {
    return 'FullScreenEvent(fullscreen=' + this.hca_1 + ')';
  };
  FullScreenEvent.prototype.hashCode = function () {
    return this.hca_1 | 0;
  };
  FullScreenEvent.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof FullScreenEvent))
      return false;
    var tmp0_other_with_cast = other instanceof FullScreenEvent ? other : THROW_CCE();
    if (!(this.hca_1 === tmp0_other_with_cast.hca_1))
      return false;
    return true;
  };
  FullScreenEvent.$metadata$ = classMeta('FullScreenEvent', undefined, undefined, undefined, undefined, TypedEvent.prototype);
  var Mode_JS_instance;
  var Mode_Android_instance;
  var Mode_IOS_instance;
  var Mode_entriesInitialized;
  function Mode_initEntries() {
    if (Mode_entriesInitialized)
      return Unit_getInstance();
    Mode_entriesInitialized = true;
    Mode_JS_instance = new Mode('JS', 0);
    Mode_Android_instance = new Mode('Android', 1);
    Mode_IOS_instance = new Mode('IOS', 2);
  }
  function Mode(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Mode.$metadata$ = classMeta('Mode', undefined, undefined, undefined, undefined, Enum.prototype);
  function Mode_JS_getInstance() {
    Mode_initEntries();
    return Mode_JS_instance;
  }
  function TouchBuilder() {
    var tmp = this;
    tmp.ica_1 = TouchEvent_init_$Create$(null, 0, null, false, false, 31, null);
    var tmp_0 = this;
    tmp_0.jca_1 = TouchEvent_init_$Create$(null, 0, null, false, false, 31, null);
    this.kca_1 = Mode_JS_getInstance();
  }
  TouchBuilder.prototype.lca = function () {
    return this.jca_1;
  };
  TouchBuilder.prototype.mca = function (type, scaleCoords) {
    this.jca_1.kc8_1 = scaleCoords;
    this.jca_1.xc8(type);
    var tmp0_subject = this.kca_1;
    var tmp0 = tmp0_subject.q2_1;
    if (tmp0 === 2) {
      this.jca_1.nc9(this.ica_1);
      this.jca_1.hc8_1 = type;
      var tmp$ret$2;
      // Inline function 'com.soywiz.kds.iterators.fastIterateRemove' call
      var tmp0_fastIterateRemove = this.jca_1.nc8_1;
      var n = 0;
      var m = 0;
      while (n < tmp0_fastIterateRemove.i()) {
        if (m >= 0 ? !(m === n) : false) {
          tmp0_fastIterateRemove.a5(m, tmp0_fastIterateRemove.m(n));
        }
        var tmp$ret$1;
        // Inline function 'com.soywiz.korev.TouchBuilder.startFrame.<anonymous>' call
        var tmp1__anonymous__uwfjfc = tmp0_fastIterateRemove.m(n);
        var tmp;
        if (tmp1__anonymous__uwfjfc.c1u()) {
          tmp1__anonymous__uwfjfc.ec9_1 = Status_KEEP_getInstance();
          tmp = false;
        } else {
          // Inline function 'com.soywiz.kds.remove' call
          var tmp0_remove = this.jca_1.pc8_1;
          var tmp1_remove = tmp1__anonymous__uwfjfc.ac9_1;
          var tmp$ret$0;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$0 = tmp0_remove;
          tmp$ret$0.delete(tmp1_remove);
          tmp = true;
        }
        tmp$ret$1 = tmp;
        if (tmp$ret$1) {
          var tmp0_0 = m;
          m = tmp0_0 - 1 | 0;
        }
        var tmp1 = n;
        n = tmp1 + 1 | 0;
        var tmp2 = m;
        m = tmp2 + 1 | 0;
      }
      while (tmp0_fastIterateRemove.i() > m) {
        tmp0_fastIterateRemove.z4(tmp0_fastIterateRemove.i() - 1 | 0);
      }
      tmp$ret$2 = tmp0_fastIterateRemove;
    } else
    ;
  };
  TouchBuilder.prototype.nca = function () {
    var tmp0_subject = this.kca_1;
    var tmp0 = tmp0_subject.q2_1;
    switch (tmp0) {
      case 0:
        // Inline function 'com.soywiz.kds.iterators.fastForEach' call
        var tmp0_fastForEach = this.ica_1.tc8();
        var n = 0;
        while (n < tmp0_fastForEach.i()) {
          // Inline function 'com.soywiz.korev.TouchBuilder.endFrame.<anonymous>' call
          var tmp0_0 = n;
          n = tmp0_0 + 1 | 0;
          var tmp1__anonymous__uwfjfc = tmp0_fastForEach.m(tmp0_0);
          if (this.jca_1.wc8(tmp1__anonymous__uwfjfc.ac9_1) == null) {
            if (tmp1__anonymous__uwfjfc.c1u()) {
              tmp1__anonymous__uwfjfc.ec9_1 = Status_REMOVE_getInstance();
              this.jca_1.mc9(tmp1__anonymous__uwfjfc);
            }
          }
        }

        break;
      case 2:
        break;
      default:
        ;
        break;
    }
    this.jca_1.yc8();
    this.ica_1.nc9(this.jca_1);
    return this.jca_1;
  };
  TouchBuilder.prototype.oca = function (mode, type, scaleCoords, block) {
    this.kca_1 = mode;
    this.mca(type, scaleCoords);
    try {
      block(this);
    }finally {
      this.nca();
    }
    return this.jca_1;
  };
  TouchBuilder.prototype.pca = function (id, x, y, force, kind, button) {
    var touch = this.jca_1.ic9(id);
    touch.bc9_1 = x;
    touch.cc9_1 = y;
    touch.dc9_1 = force;
    touch.fc9_1 = kind;
    touch.gc9_1 = button;
    var tmp0_subject = this.kca_1;
    var tmp0 = tmp0_subject.q2_1;
    if (tmp0 === 2) {
      var tmp = touch;
      var tmp1_subject = this.jca_1.hc8_1;
      var tmp0_0 = tmp1_subject.q2_1;
      switch (tmp0_0) {
        case 0:
          tmp.ec9_1 = Status_ADD_getInstance();
          break;
        case 1:
          tmp.ec9_1 = Status_REMOVE_getInstance();
          break;
        default:
          tmp.ec9_1 = Status_KEEP_getInstance();
          break;
      }
    } else {
      var oldTouch = this.ica_1.wc8(id);
      touch.ec9_1 = oldTouch == null ? Status_ADD_getInstance() : Status_KEEP_getInstance();
    }
  };
  TouchBuilder.prototype.qca = function (id, x, y, force, kind, button, $mask0, $handler) {
    if (!(($mask0 & 8) === 0))
      force = 1.0;
    if (!(($mask0 & 16) === 0))
      kind = Kind_FINGER_getInstance();
    if (!(($mask0 & 32) === 0))
      button = MouseButton_LEFT_getInstance();
    return this.pca(id, x, y, force, kind, button);
  };
  TouchBuilder.$metadata$ = classMeta('TouchBuilder');
  var Key_SPACE_instance;
  var Key_APOSTROPHE_instance;
  var Key_COMMA_instance;
  var Key_MINUS_instance;
  var Key_PLUS_instance;
  var Key_PERIOD_instance;
  var Key_SLASH_instance;
  var Key_N0_instance;
  var Key_N1_instance;
  var Key_N2_instance;
  var Key_N3_instance;
  var Key_N4_instance;
  var Key_N5_instance;
  var Key_N6_instance;
  var Key_N7_instance;
  var Key_N8_instance;
  var Key_N9_instance;
  var Key_N11_instance;
  var Key_N12_instance;
  var Key_N3D_MODE_instance;
  var Key_SEMICOLON_instance;
  var Key_EQUAL_instance;
  var Key_AT_instance;
  var Key_A_instance;
  var Key_B_instance;
  var Key_C_instance;
  var Key_D_instance;
  var Key_E_instance;
  var Key_F_instance;
  var Key_G_instance;
  var Key_H_instance;
  var Key_I_instance;
  var Key_J_instance;
  var Key_K_instance;
  var Key_L_instance;
  var Key_M_instance;
  var Key_N_instance;
  var Key_O_instance;
  var Key_P_instance;
  var Key_Q_instance;
  var Key_R_instance;
  var Key_S_instance;
  var Key_T_instance;
  var Key_U_instance;
  var Key_V_instance;
  var Key_W_instance;
  var Key_X_instance;
  var Key_Y_instance;
  var Key_Z_instance;
  var Key_LEFT_BRACKET_instance;
  var Key_BACKSLASH_instance;
  var Key_RIGHT_BRACKET_instance;
  var Key_GRAVE_ACCENT_instance;
  var Key_WORLD_1_instance;
  var Key_WORLD_2_instance;
  var Key_ESCAPE_instance;
  var Key_META_instance;
  var Key_ENTER_instance;
  var Key_TAB_instance;
  var Key_BACKSPACE_instance;
  var Key_INSERT_instance;
  var Key_DELETE_instance;
  var Key_RIGHT_instance;
  var Key_LEFT_instance;
  var Key_DOWN_instance;
  var Key_UP_instance;
  var Key_PAGE_UP_instance;
  var Key_PAGE_DOWN_instance;
  var Key_FUNCTION_instance;
  var Key_HELP_instance;
  var Key_MUTE_instance;
  var Key_VOLUME_DOWN_instance;
  var Key_VOLUME_UP_instance;
  var Key_VOLUME_MUTE_instance;
  var Key_HOME_instance;
  var Key_END_instance;
  var Key_CAPS_LOCK_instance;
  var Key_SCROLL_LOCK_instance;
  var Key_NUM_LOCK_instance;
  var Key_PRINT_SCREEN_instance;
  var Key_PAUSE_instance;
  var Key_F1_instance;
  var Key_F2_instance;
  var Key_F3_instance;
  var Key_F4_instance;
  var Key_F5_instance;
  var Key_F6_instance;
  var Key_F7_instance;
  var Key_F8_instance;
  var Key_F9_instance;
  var Key_F10_instance;
  var Key_F11_instance;
  var Key_F12_instance;
  var Key_F13_instance;
  var Key_F14_instance;
  var Key_F15_instance;
  var Key_F16_instance;
  var Key_F17_instance;
  var Key_F18_instance;
  var Key_F19_instance;
  var Key_F20_instance;
  var Key_F21_instance;
  var Key_F22_instance;
  var Key_F23_instance;
  var Key_F24_instance;
  var Key_F25_instance;
  var Key_KP_0_instance;
  var Key_KP_1_instance;
  var Key_KP_2_instance;
  var Key_KP_3_instance;
  var Key_KP_4_instance;
  var Key_KP_5_instance;
  var Key_KP_6_instance;
  var Key_KP_7_instance;
  var Key_KP_8_instance;
  var Key_KP_9_instance;
  var Key_KP_DECIMAL_instance;
  var Key_KP_DIVIDE_instance;
  var Key_KP_MULTIPLY_instance;
  var Key_KP_SUBTRACT_instance;
  var Key_KP_ADD_instance;
  var Key_KP_COMMA_instance;
  var Key_KP_DOT_instance;
  var Key_KP_ENTER_instance;
  var Key_KP_EQUAL_instance;
  var Key_KP_SEPARATOR_instance;
  var Key_KP_LEFT_PAREN_instance;
  var Key_KP_RIGHT_PAREN_instance;
  var Key_LEFT_SHIFT_instance;
  var Key_LEFT_CONTROL_instance;
  var Key_LEFT_ALT_instance;
  var Key_LEFT_SUPER_instance;
  var Key_RIGHT_SHIFT_instance;
  var Key_RIGHT_CONTROL_instance;
  var Key_RIGHT_ALT_instance;
  var Key_RIGHT_SUPER_instance;
  var Key_MENU_instance;
  var Key_BACK_instance;
  var Key_BACKQUOTE_instance;
  var Key_QUOTE_instance;
  var Key_KP_UP_instance;
  var Key_KP_DOWN_instance;
  var Key_KP_LEFT_instance;
  var Key_KP_RIGHT_instance;
  var Key_UNDERLINE_instance;
  var Key_SELECT_KEY_instance;
  var Key_CANCEL_instance;
  var Key_CLEAR_instance;
  var Key_OPEN_BRACKET_instance;
  var Key_CLOSE_BRACKET_instance;
  var Key_PLAY_instance;
  var Key_NONAME_instance;
  var Key_FINAL_instance;
  var Key_OEM102_instance;
  var Key_OEM1_instance;
  var Key_OEM2_instance;
  var Key_OEM3_instance;
  var Key_OEM4_instance;
  var Key_OEM5_instance;
  var Key_OEM6_instance;
  var Key_OEM7_instance;
  var Key_OEM8_instance;
  var Key_LEFT_MENU_instance;
  var Key_RIGHT_MENU_instance;
  var Key_SLEEP_instance;
  var Key_SNAPSHOT_instance;
  var Key_INFO_instance;
  var Key_XBUTTON1_instance;
  var Key_XBUTTON2_instance;
  var Key_XBUTTON3_instance;
  var Key_XBUTTON4_instance;
  var Key_XBUTTON5_instance;
  var Key_XBUTTON6_instance;
  var Key_XBUTTON7_instance;
  var Key_XBUTTON8_instance;
  var Key_XBUTTON9_instance;
  var Key_XBUTTON10_instance;
  var Key_XBUTTON11_instance;
  var Key_XBUTTON12_instance;
  var Key_XBUTTON13_instance;
  var Key_XBUTTON14_instance;
  var Key_XBUTTON15_instance;
  var Key_XBUTTON16_instance;
  var Key_XBUTTON_A_instance;
  var Key_XBUTTON_B_instance;
  var Key_XBUTTON_C_instance;
  var Key_XBUTTON_L1_instance;
  var Key_XBUTTON_L2_instance;
  var Key_XBUTTON_MODE_instance;
  var Key_XBUTTON_R1_instance;
  var Key_XBUTTON_R2_instance;
  var Key_XBUTTON_SELECT_instance;
  var Key_XBUTTON_START_instance;
  var Key_XBUTTON_THUMBL_instance;
  var Key_XBUTTON_THUMBR_instance;
  var Key_XBUTTON_X_instance;
  var Key_XBUTTON_Y_instance;
  var Key_XBUTTON_Z_instance;
  var Key_DPAD_CENTER_instance;
  var Key_DPAD_DOWN_instance;
  var Key_DPAD_DOWN_LEFT_instance;
  var Key_DPAD_DOWN_RIGHT_instance;
  var Key_DPAD_LEFT_instance;
  var Key_DPAD_RIGHT_instance;
  var Key_DPAD_UP_instance;
  var Key_DPAD_UP_LEFT_instance;
  var Key_DPAD_UP_RIGHT_instance;
  var Key_DVR_instance;
  var Key_EISU_instance;
  var Key_ENDCALL_instance;
  var Key_ENVELOPE_instance;
  var Key_EXPLORER_instance;
  var Key_FOCUS_instance;
  var Key_FORWARD_instance;
  var Key_GRAVE_instance;
  var Key_GUIDE_instance;
  var Key_HEADSETHOOK_instance;
  var Key_ABNT_C1_instance;
  var Key_ABNT_C2_instance;
  var Key_ATTN_instance;
  var Key_CRSEL_instance;
  var Key_EREOF_instance;
  var Key_EXECUTE_instance;
  var Key_EXSEL_instance;
  var Key_ICO_CLEAR_instance;
  var Key_ICO_HELP_instance;
  var Key_HENKAN_instance;
  var Key_PAIRING_instance;
  var Key_APP_SWITCH_instance;
  var Key_ASSIST_instance;
  var Key_AVR_INPUT_instance;
  var Key_AVR_POWER_instance;
  var Key_BOOKMARK_instance;
  var Key_BREAK_instance;
  var Key_CAPTIONS_instance;
  var Key_CAMERA_instance;
  var Key_CALL_instance;
  var Key_CALENDAR_instance;
  var Key_BRIGHTNESS_DOWN_instance;
  var Key_BRIGHTNESS_UP_instance;
  var Key_CHANNEL_DOWN_instance;
  var Key_CHANNEL_UP_instance;
  var Key_CALCULATOR_instance;
  var Key_CONTACTS_instance;
  var Key_NOTIFICATION_instance;
  var Key_COPY_instance;
  var Key_CUT_instance;
  var Key_PASTE_instance;
  var Key_SEARCH_instance;
  var Key_SETTINGS_instance;
  var Key_SOFT_LEFT_instance;
  var Key_SOFT_RIGHT_instance;
  var Key_SOFT_SLEEP_instance;
  var Key_STAR_instance;
  var Key_STB_INPUT_instance;
  var Key_STB_POWER_instance;
  var Key_STEM_1_instance;
  var Key_STEM_2_instance;
  var Key_STEM_3_instance;
  var Key_STEM_PRIMARY_instance;
  var Key_SWITCH_CHARSET_instance;
  var Key_SYM_instance;
  var Key_SYSRQ_instance;
  var Key_NUM_instance;
  var Key_TV_instance;
  var Key_TV_ANTENNA_CABLE_instance;
  var Key_TV_AUDIO_DESCRIPTION_instance;
  var Key_TV_AUDIO_DESCRIPTION_MIX_DOWN_instance;
  var Key_TV_AUDIO_DESCRIPTION_MIX_UP_instance;
  var Key_TV_CONTENTS_MENU_instance;
  var Key_TV_DATA_SERVICE_instance;
  var Key_TV_INPUT_instance;
  var Key_TV_INPUT_COMPONENT_1_instance;
  var Key_TV_INPUT_COMPONENT_2_instance;
  var Key_TV_INPUT_COMPOSITE_1_instance;
  var Key_TV_INPUT_COMPOSITE_2_instance;
  var Key_TV_INPUT_HDMI_1_instance;
  var Key_TV_INPUT_HDMI_2_instance;
  var Key_TV_INPUT_HDMI_3_instance;
  var Key_TV_INPUT_HDMI_4_instance;
  var Key_TV_INPUT_VGA_1_instance;
  var Key_TV_MEDIA_CONTEXT_MENU_instance;
  var Key_TV_NETWORK_instance;
  var Key_TV_NUMBER_ENTRY_instance;
  var Key_TV_POWER_instance;
  var Key_TV_RADIO_SERVICE_instance;
  var Key_TV_SATELLITE_instance;
  var Key_TV_SATELLITE_BS_instance;
  var Key_TV_SATELLITE_CS_instance;
  var Key_TV_SATELLITE_SERVICE_instance;
  var Key_TV_TELETEXT_instance;
  var Key_TV_TERRESTRIAL_ANALOG_instance;
  var Key_TV_TERRESTRIAL_DIGITAL_instance;
  var Key_TV_TIMER_PROGRAMMING_instance;
  var Key_TV_ZOOM_MODE_instance;
  var Key_VOICE_ASSIST_instance;
  var Key_WAKEUP_instance;
  var Key_WINDOW_instance;
  var Key_YEN_instance;
  var Key_ZENKAKU_HANKAKU_instance;
  var Key_ZOOM_IN_instance;
  var Key_ZOOM_OUT_instance;
  var Key_SYSTEM_NAVIGATION_DOWN_instance;
  var Key_SYSTEM_NAVIGATION_LEFT_instance;
  var Key_SYSTEM_NAVIGATION_RIGHT_instance;
  var Key_SYSTEM_NAVIGATION_UP_instance;
  var Key_PICTSYMBOLS_instance;
  var Key_POUND_instance;
  var Key_POWER_instance;
  var Key_PROG_BLUE_instance;
  var Key_PROG_GREEN_instance;
  var Key_PROG_RED_instance;
  var Key_PROG_YELLOW_instance;
  var Key_RO_instance;
  var Key_OEM_ATTN_instance;
  var Key_OEM_AUTO_instance;
  var Key_OEM_AX_instance;
  var Key_OEM_BACKTAB_instance;
  var Key_OEM_CLEAR_instance;
  var Key_OEM_COMMA_instance;
  var Key_OEM_COPY_instance;
  var Key_OEM_CUSEL_instance;
  var Key_OEM_ENLW_instance;
  var Key_OEM_FINISH_instance;
  var Key_OEM_FJ_LOYA_instance;
  var Key_OEM_FJ_MASSHOU_instance;
  var Key_OEM_FJ_ROYA_instance;
  var Key_OEM_FJ_TOUROKU_instance;
  var Key_OEM_JUMP_instance;
  var Key_OEM_MINUS_instance;
  var Key_OEM_PA1_instance;
  var Key_OEM_PA2_instance;
  var Key_OEM_PA3_instance;
  var Key_OEM_PERIOD_instance;
  var Key_OEM_PLUS_instance;
  var Key_OEM_RESET_instance;
  var Key_OEM_WSCTRL_instance;
  var Key_PA1_instance;
  var Key_PACKET_instance;
  var Key_PROCESSKEY_instance;
  var Key_ZOOM_instance;
  var Key_NONE_instance;
  var Key_ACCEPT_instance;
  var Key_APPS_instance;
  var Key_BROWSER_BACK_instance;
  var Key_BROWSER_FAVORITES_instance;
  var Key_BROWSER_FORWARD_instance;
  var Key_BROWSER_HOME_instance;
  var Key_BROWSER_REFRESH_instance;
  var Key_BROWSER_SEARCH_instance;
  var Key_BROWSER_STOP_instance;
  var Key_CAPITAL_instance;
  var Key_CONVERT_instance;
  var Key_ICO_00_instance;
  var Key_JUNJA_instance;
  var Key_KANA_instance;
  var Key_KANJI_instance;
  var Key_KATAKANA_HIRAGANA_instance;
  var Key_LANGUAGE_SWITCH_instance;
  var Key_MUHENKAN_instance;
  var Key_LAUNCH_APP1_instance;
  var Key_LAUNCH_APP2_instance;
  var Key_LAUNCH_MAIL_instance;
  var Key_LAUNCH_MEDIA_SELECT_instance;
  var Key_LEFT_BUTTON_instance;
  var Key_MIDDLE_BUTTON_instance;
  var Key_MUSIC_instance;
  var Key_MEDIA_NEXT_TRACK_instance;
  var Key_MEDIA_PLAY_PAUSE_instance;
  var Key_MEDIA_PREV_TRACK_instance;
  var Key_MEDIA_STOP_instance;
  var Key_MEDIA_PLAY_instance;
  var Key_MEDIA_PAUSE_instance;
  var Key_MEDIA_AUDIO_TRACK_instance;
  var Key_MEDIA_CLOSE_instance;
  var Key_MEDIA_EJECT_instance;
  var Key_MEDIA_FAST_FORWARD_instance;
  var Key_MEDIA_RECORD_instance;
  var Key_MEDIA_REWIND_instance;
  var Key_MEDIA_SKIP_BACKWARD_instance;
  var Key_MEDIA_SKIP_FORWARD_instance;
  var Key_MEDIA_STEP_BACKWARD_instance;
  var Key_MEDIA_STEP_FORWARD_instance;
  var Key_MEDIA_TOP_MENU_instance;
  var Key_MODECHANGE_instance;
  var Key_NEXT_instance;
  var Key_NONCONVERT_instance;
  var Key_OEM_FJ_JISHO_instance;
  var Key_PRIOR_instance;
  var Key_RIGHT_BUTTON_instance;
  var Key_LAST_CHANNEL_instance;
  var Key_MANNER_MODE_instance;
  var Key_NAVIGATE_IN_instance;
  var Key_NAVIGATE_NEXT_instance;
  var Key_NAVIGATE_OUT_instance;
  var Key_NAVIGATE_PREVIOUS_instance;
  var Key_HYPHEN_instance;
  var Key_UNDEFINED_instance;
  var Key_UNKNOWN_instance;
  function Companion_40() {
    Companion_instance_40 = this;
    this.rca_1 = Key_UNKNOWN_getInstance().q2_1 + 1 | 0;
    this.sca_1 = Key_ENTER_getInstance();
    this.tca_1 = Key_N0_getInstance();
    this.uca_1 = Key_N1_getInstance();
    this.vca_1 = Key_N2_getInstance();
    this.wca_1 = Key_N3_getInstance();
    this.xca_1 = Key_N4_getInstance();
    this.yca_1 = Key_N5_getInstance();
    this.zca_1 = Key_N6_getInstance();
    this.acb_1 = Key_N7_getInstance();
    this.bcb_1 = Key_N8_getInstance();
    this.ccb_1 = Key_N9_getInstance();
  }
  Companion_40.$metadata$ = objectMeta('Companion');
  var Companion_instance_40;
  function Companion_getInstance_55() {
    Key_initEntries();
    if (Companion_instance_40 == null)
      new Companion_40();
    return Companion_instance_40;
  }
  var Key_entriesInitialized;
  function Key_initEntries() {
    if (Key_entriesInitialized)
      return Unit_getInstance();
    Key_entriesInitialized = true;
    Key_SPACE_instance = new Key_0('SPACE', 0);
    Key_APOSTROPHE_instance = new Key_0('APOSTROPHE', 1);
    Key_COMMA_instance = new Key_0('COMMA', 2);
    Key_MINUS_instance = new Key_0('MINUS', 3);
    Key_PLUS_instance = new Key_0('PLUS', 4);
    Key_PERIOD_instance = new Key_0('PERIOD', 5);
    Key_SLASH_instance = new Key_0('SLASH', 6);
    Key_N0_instance = new Key_0('N0', 7);
    Key_N1_instance = new Key_0('N1', 8);
    Key_N2_instance = new Key_0('N2', 9);
    Key_N3_instance = new Key_0('N3', 10);
    Key_N4_instance = new Key_0('N4', 11);
    Key_N5_instance = new Key_0('N5', 12);
    Key_N6_instance = new Key_0('N6', 13);
    Key_N7_instance = new Key_0('N7', 14);
    Key_N8_instance = new Key_0('N8', 15);
    Key_N9_instance = new Key_0('N9', 16);
    Key_N11_instance = new Key_0('N11', 17);
    Key_N12_instance = new Key_0('N12', 18);
    Key_N3D_MODE_instance = new Key_0('N3D_MODE', 19);
    Key_SEMICOLON_instance = new Key_0('SEMICOLON', 20);
    Key_EQUAL_instance = new Key_0('EQUAL', 21);
    Key_AT_instance = new Key_0('AT', 22);
    Key_A_instance = new Key_0('A', 23);
    Key_B_instance = new Key_0('B', 24);
    Key_C_instance = new Key_0('C', 25);
    Key_D_instance = new Key_0('D', 26);
    Key_E_instance = new Key_0('E', 27);
    Key_F_instance = new Key_0('F', 28);
    Key_G_instance = new Key_0('G', 29);
    Key_H_instance = new Key_0('H', 30);
    Key_I_instance = new Key_0('I', 31);
    Key_J_instance = new Key_0('J', 32);
    Key_K_instance = new Key_0('K', 33);
    Key_L_instance = new Key_0('L', 34);
    Key_M_instance = new Key_0('M', 35);
    Key_N_instance = new Key_0('N', 36);
    Key_O_instance = new Key_0('O', 37);
    Key_P_instance = new Key_0('P', 38);
    Key_Q_instance = new Key_0('Q', 39);
    Key_R_instance = new Key_0('R', 40);
    Key_S_instance = new Key_0('S', 41);
    Key_T_instance = new Key_0('T', 42);
    Key_U_instance = new Key_0('U', 43);
    Key_V_instance = new Key_0('V', 44);
    Key_W_instance = new Key_0('W', 45);
    Key_X_instance = new Key_0('X', 46);
    Key_Y_instance = new Key_0('Y', 47);
    Key_Z_instance = new Key_0('Z', 48);
    Key_LEFT_BRACKET_instance = new Key_0('LEFT_BRACKET', 49);
    Key_BACKSLASH_instance = new Key_0('BACKSLASH', 50);
    Key_RIGHT_BRACKET_instance = new Key_0('RIGHT_BRACKET', 51);
    Key_GRAVE_ACCENT_instance = new Key_0('GRAVE_ACCENT', 52);
    Key_WORLD_1_instance = new Key_0('WORLD_1', 53);
    Key_WORLD_2_instance = new Key_0('WORLD_2', 54);
    Key_ESCAPE_instance = new Key_0('ESCAPE', 55);
    Key_META_instance = new Key_0('META', 56);
    Key_ENTER_instance = new Key_0('ENTER', 57);
    Key_TAB_instance = new Key_0('TAB', 58);
    Key_BACKSPACE_instance = new Key_0('BACKSPACE', 59);
    Key_INSERT_instance = new Key_0('INSERT', 60);
    Key_DELETE_instance = new Key_0('DELETE', 61);
    Key_RIGHT_instance = new Key_0('RIGHT', 62);
    Key_LEFT_instance = new Key_0('LEFT', 63);
    Key_DOWN_instance = new Key_0('DOWN', 64);
    Key_UP_instance = new Key_0('UP', 65);
    Key_PAGE_UP_instance = new Key_0('PAGE_UP', 66);
    Key_PAGE_DOWN_instance = new Key_0('PAGE_DOWN', 67);
    Key_FUNCTION_instance = new Key_0('FUNCTION', 68);
    Key_HELP_instance = new Key_0('HELP', 69);
    Key_MUTE_instance = new Key_0('MUTE', 70);
    Key_VOLUME_DOWN_instance = new Key_0('VOLUME_DOWN', 71);
    Key_VOLUME_UP_instance = new Key_0('VOLUME_UP', 72);
    Key_VOLUME_MUTE_instance = new Key_0('VOLUME_MUTE', 73);
    Key_HOME_instance = new Key_0('HOME', 74);
    Key_END_instance = new Key_0('END', 75);
    Key_CAPS_LOCK_instance = new Key_0('CAPS_LOCK', 76);
    Key_SCROLL_LOCK_instance = new Key_0('SCROLL_LOCK', 77);
    Key_NUM_LOCK_instance = new Key_0('NUM_LOCK', 78);
    Key_PRINT_SCREEN_instance = new Key_0('PRINT_SCREEN', 79);
    Key_PAUSE_instance = new Key_0('PAUSE', 80);
    Key_F1_instance = new Key_0('F1', 81);
    Key_F2_instance = new Key_0('F2', 82);
    Key_F3_instance = new Key_0('F3', 83);
    Key_F4_instance = new Key_0('F4', 84);
    Key_F5_instance = new Key_0('F5', 85);
    Key_F6_instance = new Key_0('F6', 86);
    Key_F7_instance = new Key_0('F7', 87);
    Key_F8_instance = new Key_0('F8', 88);
    Key_F9_instance = new Key_0('F9', 89);
    Key_F10_instance = new Key_0('F10', 90);
    Key_F11_instance = new Key_0('F11', 91);
    Key_F12_instance = new Key_0('F12', 92);
    Key_F13_instance = new Key_0('F13', 93);
    Key_F14_instance = new Key_0('F14', 94);
    Key_F15_instance = new Key_0('F15', 95);
    Key_F16_instance = new Key_0('F16', 96);
    Key_F17_instance = new Key_0('F17', 97);
    Key_F18_instance = new Key_0('F18', 98);
    Key_F19_instance = new Key_0('F19', 99);
    Key_F20_instance = new Key_0('F20', 100);
    Key_F21_instance = new Key_0('F21', 101);
    Key_F22_instance = new Key_0('F22', 102);
    Key_F23_instance = new Key_0('F23', 103);
    Key_F24_instance = new Key_0('F24', 104);
    Key_F25_instance = new Key_0('F25', 105);
    Key_KP_0_instance = new Key_0('KP_0', 106);
    Key_KP_1_instance = new Key_0('KP_1', 107);
    Key_KP_2_instance = new Key_0('KP_2', 108);
    Key_KP_3_instance = new Key_0('KP_3', 109);
    Key_KP_4_instance = new Key_0('KP_4', 110);
    Key_KP_5_instance = new Key_0('KP_5', 111);
    Key_KP_6_instance = new Key_0('KP_6', 112);
    Key_KP_7_instance = new Key_0('KP_7', 113);
    Key_KP_8_instance = new Key_0('KP_8', 114);
    Key_KP_9_instance = new Key_0('KP_9', 115);
    Key_KP_DECIMAL_instance = new Key_0('KP_DECIMAL', 116);
    Key_KP_DIVIDE_instance = new Key_0('KP_DIVIDE', 117);
    Key_KP_MULTIPLY_instance = new Key_0('KP_MULTIPLY', 118);
    Key_KP_SUBTRACT_instance = new Key_0('KP_SUBTRACT', 119);
    Key_KP_ADD_instance = new Key_0('KP_ADD', 120);
    Key_KP_COMMA_instance = new Key_0('KP_COMMA', 121);
    Key_KP_DOT_instance = new Key_0('KP_DOT', 122);
    Key_KP_ENTER_instance = new Key_0('KP_ENTER', 123);
    Key_KP_EQUAL_instance = new Key_0('KP_EQUAL', 124);
    Key_KP_SEPARATOR_instance = new Key_0('KP_SEPARATOR', 125);
    Key_KP_LEFT_PAREN_instance = new Key_0('KP_LEFT_PAREN', 126);
    Key_KP_RIGHT_PAREN_instance = new Key_0('KP_RIGHT_PAREN', 127);
    Key_LEFT_SHIFT_instance = new Key_0('LEFT_SHIFT', 128);
    Key_LEFT_CONTROL_instance = new Key_0('LEFT_CONTROL', 129);
    Key_LEFT_ALT_instance = new Key_0('LEFT_ALT', 130);
    Key_LEFT_SUPER_instance = new Key_0('LEFT_SUPER', 131);
    Key_RIGHT_SHIFT_instance = new Key_0('RIGHT_SHIFT', 132);
    Key_RIGHT_CONTROL_instance = new Key_0('RIGHT_CONTROL', 133);
    Key_RIGHT_ALT_instance = new Key_0('RIGHT_ALT', 134);
    Key_RIGHT_SUPER_instance = new Key_0('RIGHT_SUPER', 135);
    Key_MENU_instance = new Key_0('MENU', 136);
    Key_BACK_instance = new Key_0('BACK', 137);
    Key_BACKQUOTE_instance = new Key_0('BACKQUOTE', 138);
    Key_QUOTE_instance = new Key_0('QUOTE', 139);
    Key_KP_UP_instance = new Key_0('KP_UP', 140);
    Key_KP_DOWN_instance = new Key_0('KP_DOWN', 141);
    Key_KP_LEFT_instance = new Key_0('KP_LEFT', 142);
    Key_KP_RIGHT_instance = new Key_0('KP_RIGHT', 143);
    Key_UNDERLINE_instance = new Key_0('UNDERLINE', 144);
    Key_SELECT_KEY_instance = new Key_0('SELECT_KEY', 145);
    Key_CANCEL_instance = new Key_0('CANCEL', 146);
    Key_CLEAR_instance = new Key_0('CLEAR', 147);
    Key_OPEN_BRACKET_instance = new Key_0('OPEN_BRACKET', 148);
    Key_CLOSE_BRACKET_instance = new Key_0('CLOSE_BRACKET', 149);
    Key_PLAY_instance = new Key_0('PLAY', 150);
    Key_NONAME_instance = new Key_0('NONAME', 151);
    Key_FINAL_instance = new Key_0('FINAL', 152);
    Key_OEM102_instance = new Key_0('OEM102', 153);
    Key_OEM1_instance = new Key_0('OEM1', 154);
    Key_OEM2_instance = new Key_0('OEM2', 155);
    Key_OEM3_instance = new Key_0('OEM3', 156);
    Key_OEM4_instance = new Key_0('OEM4', 157);
    Key_OEM5_instance = new Key_0('OEM5', 158);
    Key_OEM6_instance = new Key_0('OEM6', 159);
    Key_OEM7_instance = new Key_0('OEM7', 160);
    Key_OEM8_instance = new Key_0('OEM8', 161);
    Key_LEFT_MENU_instance = new Key_0('LEFT_MENU', 162);
    Key_RIGHT_MENU_instance = new Key_0('RIGHT_MENU', 163);
    Key_SLEEP_instance = new Key_0('SLEEP', 164);
    Key_SNAPSHOT_instance = new Key_0('SNAPSHOT', 165);
    Key_INFO_instance = new Key_0('INFO', 166);
    Key_XBUTTON1_instance = new Key_0('XBUTTON1', 167);
    Key_XBUTTON2_instance = new Key_0('XBUTTON2', 168);
    Key_XBUTTON3_instance = new Key_0('XBUTTON3', 169);
    Key_XBUTTON4_instance = new Key_0('XBUTTON4', 170);
    Key_XBUTTON5_instance = new Key_0('XBUTTON5', 171);
    Key_XBUTTON6_instance = new Key_0('XBUTTON6', 172);
    Key_XBUTTON7_instance = new Key_0('XBUTTON7', 173);
    Key_XBUTTON8_instance = new Key_0('XBUTTON8', 174);
    Key_XBUTTON9_instance = new Key_0('XBUTTON9', 175);
    Key_XBUTTON10_instance = new Key_0('XBUTTON10', 176);
    Key_XBUTTON11_instance = new Key_0('XBUTTON11', 177);
    Key_XBUTTON12_instance = new Key_0('XBUTTON12', 178);
    Key_XBUTTON13_instance = new Key_0('XBUTTON13', 179);
    Key_XBUTTON14_instance = new Key_0('XBUTTON14', 180);
    Key_XBUTTON15_instance = new Key_0('XBUTTON15', 181);
    Key_XBUTTON16_instance = new Key_0('XBUTTON16', 182);
    Key_XBUTTON_A_instance = new Key_0('XBUTTON_A', 183);
    Key_XBUTTON_B_instance = new Key_0('XBUTTON_B', 184);
    Key_XBUTTON_C_instance = new Key_0('XBUTTON_C', 185);
    Key_XBUTTON_L1_instance = new Key_0('XBUTTON_L1', 186);
    Key_XBUTTON_L2_instance = new Key_0('XBUTTON_L2', 187);
    Key_XBUTTON_MODE_instance = new Key_0('XBUTTON_MODE', 188);
    Key_XBUTTON_R1_instance = new Key_0('XBUTTON_R1', 189);
    Key_XBUTTON_R2_instance = new Key_0('XBUTTON_R2', 190);
    Key_XBUTTON_SELECT_instance = new Key_0('XBUTTON_SELECT', 191);
    Key_XBUTTON_START_instance = new Key_0('XBUTTON_START', 192);
    Key_XBUTTON_THUMBL_instance = new Key_0('XBUTTON_THUMBL', 193);
    Key_XBUTTON_THUMBR_instance = new Key_0('XBUTTON_THUMBR', 194);
    Key_XBUTTON_X_instance = new Key_0('XBUTTON_X', 195);
    Key_XBUTTON_Y_instance = new Key_0('XBUTTON_Y', 196);
    Key_XBUTTON_Z_instance = new Key_0('XBUTTON_Z', 197);
    Key_DPAD_CENTER_instance = new Key_0('DPAD_CENTER', 198);
    Key_DPAD_DOWN_instance = new Key_0('DPAD_DOWN', 199);
    Key_DPAD_DOWN_LEFT_instance = new Key_0('DPAD_DOWN_LEFT', 200);
    Key_DPAD_DOWN_RIGHT_instance = new Key_0('DPAD_DOWN_RIGHT', 201);
    Key_DPAD_LEFT_instance = new Key_0('DPAD_LEFT', 202);
    Key_DPAD_RIGHT_instance = new Key_0('DPAD_RIGHT', 203);
    Key_DPAD_UP_instance = new Key_0('DPAD_UP', 204);
    Key_DPAD_UP_LEFT_instance = new Key_0('DPAD_UP_LEFT', 205);
    Key_DPAD_UP_RIGHT_instance = new Key_0('DPAD_UP_RIGHT', 206);
    Key_DVR_instance = new Key_0('DVR', 207);
    Key_EISU_instance = new Key_0('EISU', 208);
    Key_ENDCALL_instance = new Key_0('ENDCALL', 209);
    Key_ENVELOPE_instance = new Key_0('ENVELOPE', 210);
    Key_EXPLORER_instance = new Key_0('EXPLORER', 211);
    Key_FOCUS_instance = new Key_0('FOCUS', 212);
    Key_FORWARD_instance = new Key_0('FORWARD', 213);
    Key_GRAVE_instance = new Key_0('GRAVE', 214);
    Key_GUIDE_instance = new Key_0('GUIDE', 215);
    Key_HEADSETHOOK_instance = new Key_0('HEADSETHOOK', 216);
    Key_ABNT_C1_instance = new Key_0('ABNT_C1', 217);
    Key_ABNT_C2_instance = new Key_0('ABNT_C2', 218);
    Key_ATTN_instance = new Key_0('ATTN', 219);
    Key_CRSEL_instance = new Key_0('CRSEL', 220);
    Key_EREOF_instance = new Key_0('EREOF', 221);
    Key_EXECUTE_instance = new Key_0('EXECUTE', 222);
    Key_EXSEL_instance = new Key_0('EXSEL', 223);
    Key_ICO_CLEAR_instance = new Key_0('ICO_CLEAR', 224);
    Key_ICO_HELP_instance = new Key_0('ICO_HELP', 225);
    Key_HENKAN_instance = new Key_0('HENKAN', 226);
    Key_PAIRING_instance = new Key_0('PAIRING', 227);
    Key_APP_SWITCH_instance = new Key_0('APP_SWITCH', 228);
    Key_ASSIST_instance = new Key_0('ASSIST', 229);
    Key_AVR_INPUT_instance = new Key_0('AVR_INPUT', 230);
    Key_AVR_POWER_instance = new Key_0('AVR_POWER', 231);
    Key_BOOKMARK_instance = new Key_0('BOOKMARK', 232);
    Key_BREAK_instance = new Key_0('BREAK', 233);
    Key_CAPTIONS_instance = new Key_0('CAPTIONS', 234);
    Key_CAMERA_instance = new Key_0('CAMERA', 235);
    Key_CALL_instance = new Key_0('CALL', 236);
    Key_CALENDAR_instance = new Key_0('CALENDAR', 237);
    Key_BRIGHTNESS_DOWN_instance = new Key_0('BRIGHTNESS_DOWN', 238);
    Key_BRIGHTNESS_UP_instance = new Key_0('BRIGHTNESS_UP', 239);
    Key_CHANNEL_DOWN_instance = new Key_0('CHANNEL_DOWN', 240);
    Key_CHANNEL_UP_instance = new Key_0('CHANNEL_UP', 241);
    Key_CALCULATOR_instance = new Key_0('CALCULATOR', 242);
    Key_CONTACTS_instance = new Key_0('CONTACTS', 243);
    Key_NOTIFICATION_instance = new Key_0('NOTIFICATION', 244);
    Key_COPY_instance = new Key_0('COPY', 245);
    Key_CUT_instance = new Key_0('CUT', 246);
    Key_PASTE_instance = new Key_0('PASTE', 247);
    Key_SEARCH_instance = new Key_0('SEARCH', 248);
    Key_SETTINGS_instance = new Key_0('SETTINGS', 249);
    Key_SOFT_LEFT_instance = new Key_0('SOFT_LEFT', 250);
    Key_SOFT_RIGHT_instance = new Key_0('SOFT_RIGHT', 251);
    Key_SOFT_SLEEP_instance = new Key_0('SOFT_SLEEP', 252);
    Key_STAR_instance = new Key_0('STAR', 253);
    Key_STB_INPUT_instance = new Key_0('STB_INPUT', 254);
    Key_STB_POWER_instance = new Key_0('STB_POWER', 255);
    Key_STEM_1_instance = new Key_0('STEM_1', 256);
    Key_STEM_2_instance = new Key_0('STEM_2', 257);
    Key_STEM_3_instance = new Key_0('STEM_3', 258);
    Key_STEM_PRIMARY_instance = new Key_0('STEM_PRIMARY', 259);
    Key_SWITCH_CHARSET_instance = new Key_0('SWITCH_CHARSET', 260);
    Key_SYM_instance = new Key_0('SYM', 261);
    Key_SYSRQ_instance = new Key_0('SYSRQ', 262);
    Key_NUM_instance = new Key_0('NUM', 263);
    Key_TV_instance = new Key_0('TV', 264);
    Key_TV_ANTENNA_CABLE_instance = new Key_0('TV_ANTENNA_CABLE', 265);
    Key_TV_AUDIO_DESCRIPTION_instance = new Key_0('TV_AUDIO_DESCRIPTION', 266);
    Key_TV_AUDIO_DESCRIPTION_MIX_DOWN_instance = new Key_0('TV_AUDIO_DESCRIPTION_MIX_DOWN', 267);
    Key_TV_AUDIO_DESCRIPTION_MIX_UP_instance = new Key_0('TV_AUDIO_DESCRIPTION_MIX_UP', 268);
    Key_TV_CONTENTS_MENU_instance = new Key_0('TV_CONTENTS_MENU', 269);
    Key_TV_DATA_SERVICE_instance = new Key_0('TV_DATA_SERVICE', 270);
    Key_TV_INPUT_instance = new Key_0('TV_INPUT', 271);
    Key_TV_INPUT_COMPONENT_1_instance = new Key_0('TV_INPUT_COMPONENT_1', 272);
    Key_TV_INPUT_COMPONENT_2_instance = new Key_0('TV_INPUT_COMPONENT_2', 273);
    Key_TV_INPUT_COMPOSITE_1_instance = new Key_0('TV_INPUT_COMPOSITE_1', 274);
    Key_TV_INPUT_COMPOSITE_2_instance = new Key_0('TV_INPUT_COMPOSITE_2', 275);
    Key_TV_INPUT_HDMI_1_instance = new Key_0('TV_INPUT_HDMI_1', 276);
    Key_TV_INPUT_HDMI_2_instance = new Key_0('TV_INPUT_HDMI_2', 277);
    Key_TV_INPUT_HDMI_3_instance = new Key_0('TV_INPUT_HDMI_3', 278);
    Key_TV_INPUT_HDMI_4_instance = new Key_0('TV_INPUT_HDMI_4', 279);
    Key_TV_INPUT_VGA_1_instance = new Key_0('TV_INPUT_VGA_1', 280);
    Key_TV_MEDIA_CONTEXT_MENU_instance = new Key_0('TV_MEDIA_CONTEXT_MENU', 281);
    Key_TV_NETWORK_instance = new Key_0('TV_NETWORK', 282);
    Key_TV_NUMBER_ENTRY_instance = new Key_0('TV_NUMBER_ENTRY', 283);
    Key_TV_POWER_instance = new Key_0('TV_POWER', 284);
    Key_TV_RADIO_SERVICE_instance = new Key_0('TV_RADIO_SERVICE', 285);
    Key_TV_SATELLITE_instance = new Key_0('TV_SATELLITE', 286);
    Key_TV_SATELLITE_BS_instance = new Key_0('TV_SATELLITE_BS', 287);
    Key_TV_SATELLITE_CS_instance = new Key_0('TV_SATELLITE_CS', 288);
    Key_TV_SATELLITE_SERVICE_instance = new Key_0('TV_SATELLITE_SERVICE', 289);
    Key_TV_TELETEXT_instance = new Key_0('TV_TELETEXT', 290);
    Key_TV_TERRESTRIAL_ANALOG_instance = new Key_0('TV_TERRESTRIAL_ANALOG', 291);
    Key_TV_TERRESTRIAL_DIGITAL_instance = new Key_0('TV_TERRESTRIAL_DIGITAL', 292);
    Key_TV_TIMER_PROGRAMMING_instance = new Key_0('TV_TIMER_PROGRAMMING', 293);
    Key_TV_ZOOM_MODE_instance = new Key_0('TV_ZOOM_MODE', 294);
    Key_VOICE_ASSIST_instance = new Key_0('VOICE_ASSIST', 295);
    Key_WAKEUP_instance = new Key_0('WAKEUP', 296);
    Key_WINDOW_instance = new Key_0('WINDOW', 297);
    Key_YEN_instance = new Key_0('YEN', 298);
    Key_ZENKAKU_HANKAKU_instance = new Key_0('ZENKAKU_HANKAKU', 299);
    Key_ZOOM_IN_instance = new Key_0('ZOOM_IN', 300);
    Key_ZOOM_OUT_instance = new Key_0('ZOOM_OUT', 301);
    Key_SYSTEM_NAVIGATION_DOWN_instance = new Key_0('SYSTEM_NAVIGATION_DOWN', 302);
    Key_SYSTEM_NAVIGATION_LEFT_instance = new Key_0('SYSTEM_NAVIGATION_LEFT', 303);
    Key_SYSTEM_NAVIGATION_RIGHT_instance = new Key_0('SYSTEM_NAVIGATION_RIGHT', 304);
    Key_SYSTEM_NAVIGATION_UP_instance = new Key_0('SYSTEM_NAVIGATION_UP', 305);
    Key_PICTSYMBOLS_instance = new Key_0('PICTSYMBOLS', 306);
    Key_POUND_instance = new Key_0('POUND', 307);
    Key_POWER_instance = new Key_0('POWER', 308);
    Key_PROG_BLUE_instance = new Key_0('PROG_BLUE', 309);
    Key_PROG_GREEN_instance = new Key_0('PROG_GREEN', 310);
    Key_PROG_RED_instance = new Key_0('PROG_RED', 311);
    Key_PROG_YELLOW_instance = new Key_0('PROG_YELLOW', 312);
    Key_RO_instance = new Key_0('RO', 313);
    Key_OEM_ATTN_instance = new Key_0('OEM_ATTN', 314);
    Key_OEM_AUTO_instance = new Key_0('OEM_AUTO', 315);
    Key_OEM_AX_instance = new Key_0('OEM_AX', 316);
    Key_OEM_BACKTAB_instance = new Key_0('OEM_BACKTAB', 317);
    Key_OEM_CLEAR_instance = new Key_0('OEM_CLEAR', 318);
    Key_OEM_COMMA_instance = new Key_0('OEM_COMMA', 319);
    Key_OEM_COPY_instance = new Key_0('OEM_COPY', 320);
    Key_OEM_CUSEL_instance = new Key_0('OEM_CUSEL', 321);
    Key_OEM_ENLW_instance = new Key_0('OEM_ENLW', 322);
    Key_OEM_FINISH_instance = new Key_0('OEM_FINISH', 323);
    Key_OEM_FJ_LOYA_instance = new Key_0('OEM_FJ_LOYA', 324);
    Key_OEM_FJ_MASSHOU_instance = new Key_0('OEM_FJ_MASSHOU', 325);
    Key_OEM_FJ_ROYA_instance = new Key_0('OEM_FJ_ROYA', 326);
    Key_OEM_FJ_TOUROKU_instance = new Key_0('OEM_FJ_TOUROKU', 327);
    Key_OEM_JUMP_instance = new Key_0('OEM_JUMP', 328);
    Key_OEM_MINUS_instance = new Key_0('OEM_MINUS', 329);
    Key_OEM_PA1_instance = new Key_0('OEM_PA1', 330);
    Key_OEM_PA2_instance = new Key_0('OEM_PA2', 331);
    Key_OEM_PA3_instance = new Key_0('OEM_PA3', 332);
    Key_OEM_PERIOD_instance = new Key_0('OEM_PERIOD', 333);
    Key_OEM_PLUS_instance = new Key_0('OEM_PLUS', 334);
    Key_OEM_RESET_instance = new Key_0('OEM_RESET', 335);
    Key_OEM_WSCTRL_instance = new Key_0('OEM_WSCTRL', 336);
    Key_PA1_instance = new Key_0('PA1', 337);
    Key_PACKET_instance = new Key_0('PACKET', 338);
    Key_PROCESSKEY_instance = new Key_0('PROCESSKEY', 339);
    Key_ZOOM_instance = new Key_0('ZOOM', 340);
    Key_NONE_instance = new Key_0('NONE', 341);
    Key_ACCEPT_instance = new Key_0('ACCEPT', 342);
    Key_APPS_instance = new Key_0('APPS', 343);
    Key_BROWSER_BACK_instance = new Key_0('BROWSER_BACK', 344);
    Key_BROWSER_FAVORITES_instance = new Key_0('BROWSER_FAVORITES', 345);
    Key_BROWSER_FORWARD_instance = new Key_0('BROWSER_FORWARD', 346);
    Key_BROWSER_HOME_instance = new Key_0('BROWSER_HOME', 347);
    Key_BROWSER_REFRESH_instance = new Key_0('BROWSER_REFRESH', 348);
    Key_BROWSER_SEARCH_instance = new Key_0('BROWSER_SEARCH', 349);
    Key_BROWSER_STOP_instance = new Key_0('BROWSER_STOP', 350);
    Key_CAPITAL_instance = new Key_0('CAPITAL', 351);
    Key_CONVERT_instance = new Key_0('CONVERT', 352);
    Key_ICO_00_instance = new Key_0('ICO_00', 353);
    Key_JUNJA_instance = new Key_0('JUNJA', 354);
    Key_KANA_instance = new Key_0('KANA', 355);
    Key_KANJI_instance = new Key_0('KANJI', 356);
    Key_KATAKANA_HIRAGANA_instance = new Key_0('KATAKANA_HIRAGANA', 357);
    Key_LANGUAGE_SWITCH_instance = new Key_0('LANGUAGE_SWITCH', 358);
    Key_MUHENKAN_instance = new Key_0('MUHENKAN', 359);
    Key_LAUNCH_APP1_instance = new Key_0('LAUNCH_APP1', 360);
    Key_LAUNCH_APP2_instance = new Key_0('LAUNCH_APP2', 361);
    Key_LAUNCH_MAIL_instance = new Key_0('LAUNCH_MAIL', 362);
    Key_LAUNCH_MEDIA_SELECT_instance = new Key_0('LAUNCH_MEDIA_SELECT', 363);
    Key_LEFT_BUTTON_instance = new Key_0('LEFT_BUTTON', 364);
    Key_MIDDLE_BUTTON_instance = new Key_0('MIDDLE_BUTTON', 365);
    Key_MUSIC_instance = new Key_0('MUSIC', 366);
    Key_MEDIA_NEXT_TRACK_instance = new Key_0('MEDIA_NEXT_TRACK', 367);
    Key_MEDIA_PLAY_PAUSE_instance = new Key_0('MEDIA_PLAY_PAUSE', 368);
    Key_MEDIA_PREV_TRACK_instance = new Key_0('MEDIA_PREV_TRACK', 369);
    Key_MEDIA_STOP_instance = new Key_0('MEDIA_STOP', 370);
    Key_MEDIA_PLAY_instance = new Key_0('MEDIA_PLAY', 371);
    Key_MEDIA_PAUSE_instance = new Key_0('MEDIA_PAUSE', 372);
    Key_MEDIA_AUDIO_TRACK_instance = new Key_0('MEDIA_AUDIO_TRACK', 373);
    Key_MEDIA_CLOSE_instance = new Key_0('MEDIA_CLOSE', 374);
    Key_MEDIA_EJECT_instance = new Key_0('MEDIA_EJECT', 375);
    Key_MEDIA_FAST_FORWARD_instance = new Key_0('MEDIA_FAST_FORWARD', 376);
    Key_MEDIA_RECORD_instance = new Key_0('MEDIA_RECORD', 377);
    Key_MEDIA_REWIND_instance = new Key_0('MEDIA_REWIND', 378);
    Key_MEDIA_SKIP_BACKWARD_instance = new Key_0('MEDIA_SKIP_BACKWARD', 379);
    Key_MEDIA_SKIP_FORWARD_instance = new Key_0('MEDIA_SKIP_FORWARD', 380);
    Key_MEDIA_STEP_BACKWARD_instance = new Key_0('MEDIA_STEP_BACKWARD', 381);
    Key_MEDIA_STEP_FORWARD_instance = new Key_0('MEDIA_STEP_FORWARD', 382);
    Key_MEDIA_TOP_MENU_instance = new Key_0('MEDIA_TOP_MENU', 383);
    Key_MODECHANGE_instance = new Key_0('MODECHANGE', 384);
    Key_NEXT_instance = new Key_0('NEXT', 385);
    Key_NONCONVERT_instance = new Key_0('NONCONVERT', 386);
    Key_OEM_FJ_JISHO_instance = new Key_0('OEM_FJ_JISHO', 387);
    Key_PRIOR_instance = new Key_0('PRIOR', 388);
    Key_RIGHT_BUTTON_instance = new Key_0('RIGHT_BUTTON', 389);
    Key_LAST_CHANNEL_instance = new Key_0('LAST_CHANNEL', 390);
    Key_MANNER_MODE_instance = new Key_0('MANNER_MODE', 391);
    Key_NAVIGATE_IN_instance = new Key_0('NAVIGATE_IN', 392);
    Key_NAVIGATE_NEXT_instance = new Key_0('NAVIGATE_NEXT', 393);
    Key_NAVIGATE_OUT_instance = new Key_0('NAVIGATE_OUT', 394);
    Key_NAVIGATE_PREVIOUS_instance = new Key_0('NAVIGATE_PREVIOUS', 395);
    Key_HYPHEN_instance = new Key_0('HYPHEN', 396);
    Key_UNDEFINED_instance = new Key_0('UNDEFINED', 397);
    Key_UNKNOWN_instance = new Key_0('UNKNOWN', 398);
    Companion_getInstance_55();
  }
  function Key_0(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Key_0.prototype.fcb = function () {
    var tmp0_subject = this;
    var tmp0 = tmp0_subject.q2_1;
    switch (tmp0) {
      case 81:
      case 82:
      case 83:
      case 84:
      case 85:
      case 86:
      case 87:
      case 88:
      case 89:
      case 90:
      case 91:
      case 92:
      case 93:
      case 94:
      case 95:
      case 96:
      case 97:
      case 98:
      case 99:
      case 100:
      case 101:
      case 102:
      case 103:
      case 104:
      case 105:
        return true;
      default:
        return false;
    }
  };
  Key_0.$metadata$ = classMeta('Key', undefined, undefined, undefined, undefined, Enum.prototype);
  function getButton(_this__u8e3s4, $this, index) {
    var tmp;
    var tmp$ret$1;
    // Inline function 'com.soywiz.kmem.extract' call
    var tmp$ret$0;
    // Inline function 'com.soywiz.kmem.extract1' call
    tmp$ret$0 = (_this__u8e3s4 >>> index | 0) & 1;
    tmp$ret$1 = !(tmp$ret$0 === 0);
    if (tmp$ret$1) {
      tmp = 1.0;
    } else {
      tmp = 0.0;
    }
    return tmp;
  }
  function GamepadMapping$toString$lambda(this$0, $info) {
    return function (it) {
      return it.p2_1 + '=' + niceStr(this$0.gcb(it, $info), 2);
    };
  }
  function GamepadMapping() {
  }
  GamepadMapping.prototype.hcb = function (_this__u8e3s4, index) {
    return getButton(_this__u8e3s4.kc7_1, this, index);
  };
  GamepadMapping.prototype.icb = function (_this__u8e3s4, index) {
    var tmp$ret$1;
    // Inline function 'kotlin.collections.getOrElse' call
    var tmp0_getOrElse = _this__u8e3s4.lc7_1;
    var tmp;
    if (index >= 0 ? index <= get_lastIndex(tmp0_getOrElse) : false) {
      tmp = tmp0_getOrElse[index];
    } else {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korev.GamepadMapping.getRawAxe.<anonymous>' call
      tmp$ret$0 = 0.0;
      tmp = tmp$ret$0;
    }
    tmp$ret$1 = tmp;
    return tmp$ret$1;
  };
  GamepadMapping.prototype.jcb = function (button) {
    return button.q2_1;
  };
  GamepadMapping.prototype.kcb = function (button) {
    var tmp0_subject = button;
    var tmp0 = tmp0_subject.q2_1;
    return tmp0 === 17 ? 0 : tmp0 === 18 ? 1 : tmp0 === 19 ? 2 : tmp0 === 20 ? 3 : (tmp0_subject.equals(Companion_getInstance_57().ocb()) ? true : tmp0 === 13) ? 4 : (tmp0_subject.equals(Companion_getInstance_57().ncb()) ? true : tmp0 === 14) ? 5 : tmp0 === 27 ? 5 : tmp0 === 28 ? 6 : 0;
  };
  GamepadMapping.prototype.gcb = function (button, info) {
    var tmp0_subject = button;
    var tmp0 = tmp0_subject.q2_1;
    switch (tmp0) {
      case 17:
      case 18:
      case 19:
      case 20:
        return this.icb(info, this.kcb(button));
      default:
        return this.hcb(info, this.jcb(button));
    }
  };
  GamepadMapping.prototype.pcb = function (info) {
    var tmp = this.c1n() + '(';
    var tmp_0 = values_11();
    return tmp + joinToString$default_0(tmp_0, ', ', null, null, 0, null, GamepadMapping$toString$lambda(this, info), 30, null) + ')';
  };
  GamepadMapping.$metadata$ = classMeta('GamepadMapping');
  function Companion_41() {
    Companion_instance_41 = this;
    StandardGamepadMapping.call(this);
  }
  Companion_41.$metadata$ = objectMeta('Companion', undefined, undefined, undefined, undefined, StandardGamepadMapping.prototype);
  var Companion_instance_41;
  function Companion_getInstance_56() {
    if (Companion_instance_41 == null)
      new Companion_41();
    return Companion_instance_41;
  }
  function StandardGamepadMapping() {
    Companion_getInstance_56();
    GamepadMapping.call(this);
    this.qcb_1 = 'Standard';
  }
  StandardGamepadMapping.prototype.c1n = function () {
    return this.qcb_1;
  };
  StandardGamepadMapping.$metadata$ = classMeta('StandardGamepadMapping', undefined, undefined, undefined, undefined, GamepadMapping.prototype);
  var GameButton_LEFT_instance;
  var GameButton_RIGHT_instance;
  var GameButton_UP_instance;
  var GameButton_DOWN_instance;
  var GameButton_BUTTON0_instance;
  var GameButton_BUTTON1_instance;
  var GameButton_BUTTON2_instance;
  var GameButton_BUTTON3_instance;
  var GameButton_SELECT_instance;
  var GameButton_START_instance;
  var GameButton_SYSTEM_instance;
  var GameButton_L1_instance;
  var GameButton_R1_instance;
  var GameButton_L2_instance;
  var GameButton_R2_instance;
  var GameButton_L3_instance;
  var GameButton_R3_instance;
  var GameButton_LX_instance;
  var GameButton_LY_instance;
  var GameButton_RX_instance;
  var GameButton_RY_instance;
  var GameButton_BUTTON4_instance;
  var GameButton_BUTTON5_instance;
  var GameButton_BUTTON6_instance;
  var GameButton_BUTTON7_instance;
  var GameButton_BUTTON8_instance;
  var GameButton_RECORD_instance;
  var GameButton_DPADX_instance;
  var GameButton_DPADY_instance;
  function Companion_42() {
    Companion_instance_42 = this;
    this.lcb_1 = values_11();
    this.mcb_1 = 32;
  }
  Companion_42.prototype.ocb = function () {
    return GameButton_L2_getInstance();
  };
  Companion_42.prototype.ncb = function () {
    return GameButton_R2_getInstance();
  };
  Companion_42.$metadata$ = objectMeta('Companion');
  var Companion_instance_42;
  function Companion_getInstance_57() {
    GameButton_initEntries();
    if (Companion_instance_42 == null)
      new Companion_42();
    return Companion_instance_42;
  }
  function values_11() {
    return [GameButton_LEFT_getInstance(), GameButton_RIGHT_getInstance(), GameButton_UP_getInstance(), GameButton_DOWN_getInstance(), GameButton_BUTTON0_getInstance(), GameButton_BUTTON1_getInstance(), GameButton_BUTTON2_getInstance(), GameButton_BUTTON3_getInstance(), GameButton_SELECT_getInstance(), GameButton_START_getInstance(), GameButton_SYSTEM_getInstance(), GameButton_L1_getInstance(), GameButton_R1_getInstance(), GameButton_L2_getInstance(), GameButton_R2_getInstance(), GameButton_L3_getInstance(), GameButton_R3_getInstance(), GameButton_LX_getInstance(), GameButton_LY_getInstance(), GameButton_RX_getInstance(), GameButton_RY_getInstance(), GameButton_BUTTON4_getInstance(), GameButton_BUTTON5_getInstance(), GameButton_BUTTON6_getInstance(), GameButton_BUTTON7_getInstance(), GameButton_BUTTON8_getInstance(), GameButton_RECORD_getInstance(), GameButton_DPADX_getInstance(), GameButton_DPADY_getInstance()];
  }
  var GameButton_entriesInitialized;
  function GameButton_initEntries() {
    if (GameButton_entriesInitialized)
      return Unit_getInstance();
    GameButton_entriesInitialized = true;
    GameButton_LEFT_instance = new GameButton('LEFT', 0);
    GameButton_RIGHT_instance = new GameButton('RIGHT', 1);
    GameButton_UP_instance = new GameButton('UP', 2);
    GameButton_DOWN_instance = new GameButton('DOWN', 3);
    GameButton_BUTTON0_instance = new GameButton('BUTTON0', 4);
    GameButton_BUTTON1_instance = new GameButton('BUTTON1', 5);
    GameButton_BUTTON2_instance = new GameButton('BUTTON2', 6);
    GameButton_BUTTON3_instance = new GameButton('BUTTON3', 7);
    GameButton_SELECT_instance = new GameButton('SELECT', 8);
    GameButton_START_instance = new GameButton('START', 9);
    GameButton_SYSTEM_instance = new GameButton('SYSTEM', 10);
    GameButton_L1_instance = new GameButton('L1', 11);
    GameButton_R1_instance = new GameButton('R1', 12);
    GameButton_L2_instance = new GameButton('L2', 13);
    GameButton_R2_instance = new GameButton('R2', 14);
    GameButton_L3_instance = new GameButton('L3', 15);
    GameButton_R3_instance = new GameButton('R3', 16);
    GameButton_LX_instance = new GameButton('LX', 17);
    GameButton_LY_instance = new GameButton('LY', 18);
    GameButton_RX_instance = new GameButton('RX', 19);
    GameButton_RY_instance = new GameButton('RY', 20);
    GameButton_BUTTON4_instance = new GameButton('BUTTON4', 21);
    GameButton_BUTTON5_instance = new GameButton('BUTTON5', 22);
    GameButton_BUTTON6_instance = new GameButton('BUTTON6', 23);
    GameButton_BUTTON7_instance = new GameButton('BUTTON7', 24);
    GameButton_BUTTON8_instance = new GameButton('BUTTON8', 25);
    GameButton_RECORD_instance = new GameButton('RECORD', 26);
    GameButton_DPADX_instance = new GameButton('DPADX', 27);
    GameButton_DPADY_instance = new GameButton('DPADY', 28);
    Companion_getInstance_57();
  }
  function GameButton(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  GameButton.$metadata$ = classMeta('GameButton', undefined, undefined, undefined, undefined, Enum.prototype);
  var BatteryStatus_CHARGING_instance;
  var BatteryStatus_DISCHARGING_instance;
  var BatteryStatus_FULL_instance;
  var BatteryStatus_UNKNOWN_instance;
  var BatteryStatus_entriesInitialized;
  function BatteryStatus_initEntries() {
    if (BatteryStatus_entriesInitialized)
      return Unit_getInstance();
    BatteryStatus_entriesInitialized = true;
    BatteryStatus_CHARGING_instance = new BatteryStatus('CHARGING', 0);
    BatteryStatus_DISCHARGING_instance = new BatteryStatus('DISCHARGING', 1);
    BatteryStatus_FULL_instance = new BatteryStatus('FULL', 2);
    BatteryStatus_UNKNOWN_instance = new BatteryStatus('UNKNOWN', 3);
  }
  function GamepadInfo_init_$Init$(index, connected, name, mapping, rawButtonsPressure, rawButtonsPressed, rawAxes, axesLength, buttonsLength, batteryLevel, name2, playerIndex, batteryStatus, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      index = 0;
    if (!(($mask0 & 2) === 0))
      connected = false;
    if (!(($mask0 & 4) === 0))
      name = 'unknown';
    if (!(($mask0 & 8) === 0))
      mapping = Companion_getInstance_56();
    if (!(($mask0 & 16) === 0))
      rawButtonsPressure = new Float64Array(64);
    if (!(($mask0 & 32) === 0))
      rawButtonsPressed = 0;
    if (!(($mask0 & 64) === 0))
      rawAxes = new Float64Array(16);
    if (!(($mask0 & 128) === 0))
      axesLength = 0;
    if (!(($mask0 & 256) === 0))
      buttonsLength = 0;
    if (!(($mask0 & 512) === 0))
      batteryLevel = 1.0;
    if (!(($mask0 & 1024) === 0))
      name2 = Companion_getInstance_58().rcb_1;
    if (!(($mask0 & 2048) === 0))
      playerIndex = index;
    if (!(($mask0 & 4096) === 0))
      batteryStatus = BatteryStatus_UNKNOWN_getInstance();
    GamepadInfo.call($this, index, connected, name, mapping, rawButtonsPressure, rawButtonsPressed, rawAxes, axesLength, buttonsLength, batteryLevel, name2, playerIndex, batteryStatus);
    return $this;
  }
  function GamepadInfo_init_$Create$(index, connected, name, mapping, rawButtonsPressure, rawButtonsPressed, rawAxes, axesLength, buttonsLength, batteryLevel, name2, playerIndex, batteryStatus, $mask0, $marker) {
    return GamepadInfo_init_$Init$(index, connected, name, mapping, rawButtonsPressure, rawButtonsPressed, rawAxes, axesLength, buttonsLength, batteryLevel, name2, playerIndex, batteryStatus, $mask0, $marker, Object.create(GamepadInfo.prototype));
  }
  function BatteryStatus(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  BatteryStatus.$metadata$ = classMeta('BatteryStatus', undefined, undefined, undefined, undefined, Enum.prototype);
  function Companion_43() {
    Companion_instance_43 = this;
    this.rcb_1 = 'Wireless Controller';
  }
  Companion_43.$metadata$ = objectMeta('Companion');
  var Companion_instance_43;
  function Companion_getInstance_58() {
    if (Companion_instance_43 == null)
      new Companion_43();
    return Companion_instance_43;
  }
  function BatteryStatus_UNKNOWN_getInstance() {
    BatteryStatus_initEntries();
    return BatteryStatus_UNKNOWN_instance;
  }
  function GamepadInfo(index, connected, name, mapping, rawButtonsPressure, rawButtonsPressed, rawAxes, axesLength, buttonsLength, batteryLevel, name2, playerIndex, batteryStatus) {
    Companion_getInstance_58();
    this.fc7_1 = index;
    this.gc7_1 = connected;
    this.hc7_1 = name;
    this.ic7_1 = mapping;
    this.jc7_1 = rawButtonsPressure;
    this.kc7_1 = rawButtonsPressed;
    this.lc7_1 = rawAxes;
    this.mc7_1 = axesLength;
    this.nc7_1 = buttonsLength;
    this.oc7_1 = batteryLevel;
    this.pc7_1 = name2;
    this.qc7_1 = playerIndex;
    this.rc7_1 = batteryStatus;
    var tmp = this;
    var tmp_0 = 0;
    var tmp_1 = 2;
    var tmp$ret$0;
    // Inline function 'kotlin.arrayOfNulls' call
    tmp$ret$0 = fillArrayVal(Array(tmp_1), null);
    var tmp_2 = tmp$ret$0;
    while (tmp_0 < tmp_1) {
      var tmp_3 = tmp_0;
      var tmp$ret$1;
      // Inline function 'com.soywiz.korev.GamepadInfo.axesData.<anonymous>' call
      tmp$ret$1 = Companion_getInstance_9().zp();
      tmp_2[tmp_3] = tmp$ret$1;
      tmp_0 = tmp_0 + 1 | 0;
    }
    tmp.sc7_1 = tmp_2;
  }
  GamepadInfo.prototype.scb = function (_set____db54di) {
    this.fc7_1 = _set____db54di;
  };
  GamepadInfo.prototype.m4 = function () {
    return this.fc7_1;
  };
  GamepadInfo.prototype.tcb = function (_set____db54di) {
    this.gc7_1 = _set____db54di;
  };
  GamepadInfo.prototype.ucb = function () {
    return this.gc7_1;
  };
  GamepadInfo.prototype.vcb = function (_set____db54di) {
    this.hc7_1 = _set____db54di;
  };
  GamepadInfo.prototype.wcb = function (_set____db54di) {
    this.ic7_1 = _set____db54di;
  };
  GamepadInfo.prototype.xcb = function () {
    return this.jc7_1;
  };
  GamepadInfo.prototype.ycb = function (_set____db54di) {
    this.kc7_1 = _set____db54di;
  };
  GamepadInfo.prototype.zcb = function () {
    return this.kc7_1;
  };
  GamepadInfo.prototype.acc = function () {
    return this.lc7_1;
  };
  GamepadInfo.prototype.bcc = function (_set____db54di) {
    this.mc7_1 = _set____db54di;
  };
  GamepadInfo.prototype.ccc = function (_set____db54di) {
    this.nc7_1 = _set____db54di;
  };
  GamepadInfo.prototype.dcc = function () {
    return this.hc7_1 + ' - ' + this.pc7_1;
  };
  GamepadInfo.prototype.ecc = function (that) {
    this.fc7_1 = that.fc7_1;
    this.hc7_1 = that.hc7_1;
    this.pc7_1 = that.pc7_1;
    this.ic7_1 = that.ic7_1;
    this.kc7_1 = that.kc7_1;
    this.gc7_1 = that.gc7_1;
    this.mc7_1 = that.mc7_1;
    this.nc7_1 = that.nc7_1;
    this.oc7_1 = that.oc7_1;
    this.qc7_1 = that.qc7_1;
    this.rc7_1 = that.rc7_1;
    var tmp$ret$0;
    // Inline function 'kotlin.math.min' call
    var tmp0_min = this.sc7_1.length;
    var tmp1_min = that.sc7_1.length;
    tmp$ret$0 = Math.min(tmp0_min, tmp1_min);
    arraycopy_3(that.sc7_1, 0, this.sc7_1, 0, tmp$ret$0);
    var tmp = that.jc7_1;
    var tmp_0 = this.jc7_1;
    var tmp$ret$1;
    // Inline function 'kotlin.math.min' call
    var tmp2_min = this.jc7_1.length;
    var tmp3_min = that.jc7_1.length;
    tmp$ret$1 = Math.min(tmp2_min, tmp3_min);
    arraycopy_4(tmp, 0, tmp_0, 0, tmp$ret$1);
    var tmp$ret$2;
    // Inline function 'kotlin.math.min' call
    var tmp4_min = this.lc7_1.length;
    var tmp5_min = that.lc7_1.length;
    tmp$ret$2 = Math.min(tmp4_min, tmp5_min);
    arraycopy_4(that.lc7_1, 0, this.lc7_1, 0, tmp$ret$2);
  };
  GamepadInfo.prototype.toString = function () {
    return 'Gamepad[' + this.fc7_1 + '][' + this.dcc() + ']' + this.ic7_1.pcb(this);
  };
  GamepadInfo.$metadata$ = classMeta('GamepadInfo');
  function MouseButton_init_$Init$(name, ordinal, id, bits, $mask0, $marker, $this) {
    if (!(($mask0 & 8) === 0))
      bits = 1 << id;
    MouseButton.call($this, name, ordinal, id, bits);
    return $this;
  }
  function MouseButton_init_$Create$(name, ordinal, id, bits, $mask0, $marker) {
    return MouseButton_init_$Init$(name, ordinal, id, bits, $mask0, $marker, Object.create(MouseButton.prototype));
  }
  var MouseButton_LEFT_instance;
  var MouseButton_MIDDLE_instance;
  var MouseButton_RIGHT_instance;
  var MouseButton_BUTTON3_instance;
  var MouseButton_BUTTON4_instance;
  var MouseButton_BUTTON5_instance;
  var MouseButton_BUTTON6_instance;
  var MouseButton_BUTTON7_instance;
  var MouseButton_BUTTON_WHEEL_instance;
  var MouseButton_BUTTON_UNKNOWN_instance;
  var MouseButton_NONE_instance;
  function Companion_44() {
    Companion_instance_44 = this;
    this.fcc_1 = MouseButton_NONE_getInstance().q2_1 + 1 | 0;
    this.gcc_1 = values_12();
  }
  Companion_44.prototype.m = function (id) {
    var tmp$ret$1;
    // Inline function 'kotlin.collections.getOrElse' call
    var tmp0_getOrElse = this.gcc_1;
    var tmp;
    if (id >= 0 ? id <= get_lastIndex_0(tmp0_getOrElse) : false) {
      tmp = tmp0_getOrElse[id];
    } else {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korev.Companion.get.<anonymous>' call
      tmp$ret$0 = MouseButton_BUTTON_UNKNOWN_getInstance();
      tmp = tmp$ret$0;
    }
    tmp$ret$1 = tmp;
    return tmp$ret$1;
  };
  Companion_44.$metadata$ = objectMeta('Companion');
  var Companion_instance_44;
  function Companion_getInstance_59() {
    MouseButton_initEntries();
    if (Companion_instance_44 == null)
      new Companion_44();
    return Companion_instance_44;
  }
  function values_12() {
    return [MouseButton_LEFT_getInstance(), MouseButton_MIDDLE_getInstance(), MouseButton_RIGHT_getInstance(), MouseButton_BUTTON3_getInstance(), MouseButton_BUTTON4_getInstance(), MouseButton_BUTTON5_getInstance(), MouseButton_BUTTON6_getInstance(), MouseButton_BUTTON7_getInstance(), MouseButton_BUTTON_WHEEL_getInstance(), MouseButton_BUTTON_UNKNOWN_getInstance(), MouseButton_NONE_getInstance()];
  }
  var MouseButton_entriesInitialized;
  function MouseButton_initEntries() {
    if (MouseButton_entriesInitialized)
      return Unit_getInstance();
    MouseButton_entriesInitialized = true;
    MouseButton_LEFT_instance = MouseButton_init_$Create$('LEFT', 0, 0, 0, 8, null);
    MouseButton_MIDDLE_instance = MouseButton_init_$Create$('MIDDLE', 1, 1, 0, 8, null);
    MouseButton_RIGHT_instance = MouseButton_init_$Create$('RIGHT', 2, 2, 0, 8, null);
    MouseButton_BUTTON3_instance = MouseButton_init_$Create$('BUTTON3', 3, 3, 0, 8, null);
    MouseButton_BUTTON4_instance = MouseButton_init_$Create$('BUTTON4', 4, 4, 0, 8, null);
    MouseButton_BUTTON5_instance = MouseButton_init_$Create$('BUTTON5', 5, 5, 0, 8, null);
    MouseButton_BUTTON6_instance = MouseButton_init_$Create$('BUTTON6', 6, 6, 0, 8, null);
    MouseButton_BUTTON7_instance = MouseButton_init_$Create$('BUTTON7', 7, 7, 0, 8, null);
    MouseButton_BUTTON_WHEEL_instance = MouseButton_init_$Create$('BUTTON_WHEEL', 8, 8, 0, 8, null);
    MouseButton_BUTTON_UNKNOWN_instance = MouseButton_init_$Create$('BUTTON_UNKNOWN', 9, 10, 0, 8, null);
    MouseButton_NONE_instance = new MouseButton('NONE', 10, 11, 0);
    Companion_getInstance_59();
  }
  function MouseButton(name, ordinal, id, bits) {
    Enum.call(this, name, ordinal);
    this.jcc_1 = id;
    this.kcc_1 = bits;
  }
  MouseButton.prototype.c1n = function () {
    return this.jcc_1;
  };
  MouseButton.prototype.lcc = function () {
    return this.equals(MouseButton_LEFT_getInstance());
  };
  MouseButton.$metadata$ = classMeta('MouseButton', undefined, undefined, undefined, undefined, Enum.prototype);
  function Key_SPACE_getInstance() {
    Key_initEntries();
    return Key_SPACE_instance;
  }
  function Key_APOSTROPHE_getInstance() {
    Key_initEntries();
    return Key_APOSTROPHE_instance;
  }
  function Key_COMMA_getInstance() {
    Key_initEntries();
    return Key_COMMA_instance;
  }
  function Key_MINUS_getInstance() {
    Key_initEntries();
    return Key_MINUS_instance;
  }
  function Key_PLUS_getInstance() {
    Key_initEntries();
    return Key_PLUS_instance;
  }
  function Key_PERIOD_getInstance() {
    Key_initEntries();
    return Key_PERIOD_instance;
  }
  function Key_SLASH_getInstance() {
    Key_initEntries();
    return Key_SLASH_instance;
  }
  function Key_N0_getInstance() {
    Key_initEntries();
    return Key_N0_instance;
  }
  function Key_N1_getInstance() {
    Key_initEntries();
    return Key_N1_instance;
  }
  function Key_N2_getInstance() {
    Key_initEntries();
    return Key_N2_instance;
  }
  function Key_N3_getInstance() {
    Key_initEntries();
    return Key_N3_instance;
  }
  function Key_N4_getInstance() {
    Key_initEntries();
    return Key_N4_instance;
  }
  function Key_N5_getInstance() {
    Key_initEntries();
    return Key_N5_instance;
  }
  function Key_N6_getInstance() {
    Key_initEntries();
    return Key_N6_instance;
  }
  function Key_N7_getInstance() {
    Key_initEntries();
    return Key_N7_instance;
  }
  function Key_N8_getInstance() {
    Key_initEntries();
    return Key_N8_instance;
  }
  function Key_N9_getInstance() {
    Key_initEntries();
    return Key_N9_instance;
  }
  function Key_SEMICOLON_getInstance() {
    Key_initEntries();
    return Key_SEMICOLON_instance;
  }
  function Key_EQUAL_getInstance() {
    Key_initEntries();
    return Key_EQUAL_instance;
  }
  function Key_A_getInstance() {
    Key_initEntries();
    return Key_A_instance;
  }
  function Key_B_getInstance() {
    Key_initEntries();
    return Key_B_instance;
  }
  function Key_C_getInstance() {
    Key_initEntries();
    return Key_C_instance;
  }
  function Key_D_getInstance() {
    Key_initEntries();
    return Key_D_instance;
  }
  function Key_E_getInstance() {
    Key_initEntries();
    return Key_E_instance;
  }
  function Key_F_getInstance() {
    Key_initEntries();
    return Key_F_instance;
  }
  function Key_G_getInstance() {
    Key_initEntries();
    return Key_G_instance;
  }
  function Key_H_getInstance() {
    Key_initEntries();
    return Key_H_instance;
  }
  function Key_I_getInstance() {
    Key_initEntries();
    return Key_I_instance;
  }
  function Key_J_getInstance() {
    Key_initEntries();
    return Key_J_instance;
  }
  function Key_K_getInstance() {
    Key_initEntries();
    return Key_K_instance;
  }
  function Key_L_getInstance() {
    Key_initEntries();
    return Key_L_instance;
  }
  function Key_M_getInstance() {
    Key_initEntries();
    return Key_M_instance;
  }
  function Key_N_getInstance() {
    Key_initEntries();
    return Key_N_instance;
  }
  function Key_O_getInstance() {
    Key_initEntries();
    return Key_O_instance;
  }
  function Key_P_getInstance() {
    Key_initEntries();
    return Key_P_instance;
  }
  function Key_Q_getInstance() {
    Key_initEntries();
    return Key_Q_instance;
  }
  function Key_R_getInstance() {
    Key_initEntries();
    return Key_R_instance;
  }
  function Key_S_getInstance() {
    Key_initEntries();
    return Key_S_instance;
  }
  function Key_T_getInstance() {
    Key_initEntries();
    return Key_T_instance;
  }
  function Key_U_getInstance() {
    Key_initEntries();
    return Key_U_instance;
  }
  function Key_V_getInstance() {
    Key_initEntries();
    return Key_V_instance;
  }
  function Key_W_getInstance() {
    Key_initEntries();
    return Key_W_instance;
  }
  function Key_X_getInstance() {
    Key_initEntries();
    return Key_X_instance;
  }
  function Key_Y_getInstance() {
    Key_initEntries();
    return Key_Y_instance;
  }
  function Key_Z_getInstance() {
    Key_initEntries();
    return Key_Z_instance;
  }
  function Key_ESCAPE_getInstance() {
    Key_initEntries();
    return Key_ESCAPE_instance;
  }
  function Key_META_getInstance() {
    Key_initEntries();
    return Key_META_instance;
  }
  function Key_ENTER_getInstance() {
    Key_initEntries();
    return Key_ENTER_instance;
  }
  function Key_TAB_getInstance() {
    Key_initEntries();
    return Key_TAB_instance;
  }
  function Key_BACKSPACE_getInstance() {
    Key_initEntries();
    return Key_BACKSPACE_instance;
  }
  function Key_INSERT_getInstance() {
    Key_initEntries();
    return Key_INSERT_instance;
  }
  function Key_DELETE_getInstance() {
    Key_initEntries();
    return Key_DELETE_instance;
  }
  function Key_RIGHT_getInstance() {
    Key_initEntries();
    return Key_RIGHT_instance;
  }
  function Key_LEFT_getInstance() {
    Key_initEntries();
    return Key_LEFT_instance;
  }
  function Key_DOWN_getInstance() {
    Key_initEntries();
    return Key_DOWN_instance;
  }
  function Key_UP_getInstance() {
    Key_initEntries();
    return Key_UP_instance;
  }
  function Key_PAGE_UP_getInstance() {
    Key_initEntries();
    return Key_PAGE_UP_instance;
  }
  function Key_PAGE_DOWN_getInstance() {
    Key_initEntries();
    return Key_PAGE_DOWN_instance;
  }
  function Key_HOME_getInstance() {
    Key_initEntries();
    return Key_HOME_instance;
  }
  function Key_END_getInstance() {
    Key_initEntries();
    return Key_END_instance;
  }
  function Key_F1_getInstance() {
    Key_initEntries();
    return Key_F1_instance;
  }
  function Key_F2_getInstance() {
    Key_initEntries();
    return Key_F2_instance;
  }
  function Key_F3_getInstance() {
    Key_initEntries();
    return Key_F3_instance;
  }
  function Key_F4_getInstance() {
    Key_initEntries();
    return Key_F4_instance;
  }
  function Key_F5_getInstance() {
    Key_initEntries();
    return Key_F5_instance;
  }
  function Key_F6_getInstance() {
    Key_initEntries();
    return Key_F6_instance;
  }
  function Key_F7_getInstance() {
    Key_initEntries();
    return Key_F7_instance;
  }
  function Key_F8_getInstance() {
    Key_initEntries();
    return Key_F8_instance;
  }
  function Key_F9_getInstance() {
    Key_initEntries();
    return Key_F9_instance;
  }
  function Key_F10_getInstance() {
    Key_initEntries();
    return Key_F10_instance;
  }
  function Key_F11_getInstance() {
    Key_initEntries();
    return Key_F11_instance;
  }
  function Key_F12_getInstance() {
    Key_initEntries();
    return Key_F12_instance;
  }
  function Key_F13_getInstance() {
    Key_initEntries();
    return Key_F13_instance;
  }
  function Key_F14_getInstance() {
    Key_initEntries();
    return Key_F14_instance;
  }
  function Key_F15_getInstance() {
    Key_initEntries();
    return Key_F15_instance;
  }
  function Key_F16_getInstance() {
    Key_initEntries();
    return Key_F16_instance;
  }
  function Key_F17_getInstance() {
    Key_initEntries();
    return Key_F17_instance;
  }
  function Key_F18_getInstance() {
    Key_initEntries();
    return Key_F18_instance;
  }
  function Key_F19_getInstance() {
    Key_initEntries();
    return Key_F19_instance;
  }
  function Key_F20_getInstance() {
    Key_initEntries();
    return Key_F20_instance;
  }
  function Key_F21_getInstance() {
    Key_initEntries();
    return Key_F21_instance;
  }
  function Key_F22_getInstance() {
    Key_initEntries();
    return Key_F22_instance;
  }
  function Key_F23_getInstance() {
    Key_initEntries();
    return Key_F23_instance;
  }
  function Key_F24_getInstance() {
    Key_initEntries();
    return Key_F24_instance;
  }
  function Key_F25_getInstance() {
    Key_initEntries();
    return Key_F25_instance;
  }
  function Key_LEFT_SHIFT_getInstance() {
    Key_initEntries();
    return Key_LEFT_SHIFT_instance;
  }
  function Key_LEFT_CONTROL_getInstance() {
    Key_initEntries();
    return Key_LEFT_CONTROL_instance;
  }
  function Key_LEFT_ALT_getInstance() {
    Key_initEntries();
    return Key_LEFT_ALT_instance;
  }
  function Key_LEFT_SUPER_getInstance() {
    Key_initEntries();
    return Key_LEFT_SUPER_instance;
  }
  function Key_RIGHT_SHIFT_getInstance() {
    Key_initEntries();
    return Key_RIGHT_SHIFT_instance;
  }
  function Key_RIGHT_CONTROL_getInstance() {
    Key_initEntries();
    return Key_RIGHT_CONTROL_instance;
  }
  function Key_RIGHT_ALT_getInstance() {
    Key_initEntries();
    return Key_RIGHT_ALT_instance;
  }
  function Key_RIGHT_SUPER_getInstance() {
    Key_initEntries();
    return Key_RIGHT_SUPER_instance;
  }
  function Key_QUOTE_getInstance() {
    Key_initEntries();
    return Key_QUOTE_instance;
  }
  function Key_UNKNOWN_getInstance() {
    Key_initEntries();
    return Key_UNKNOWN_instance;
  }
  function GameButton_LEFT_getInstance() {
    GameButton_initEntries();
    return GameButton_LEFT_instance;
  }
  function GameButton_RIGHT_getInstance() {
    GameButton_initEntries();
    return GameButton_RIGHT_instance;
  }
  function GameButton_UP_getInstance() {
    GameButton_initEntries();
    return GameButton_UP_instance;
  }
  function GameButton_DOWN_getInstance() {
    GameButton_initEntries();
    return GameButton_DOWN_instance;
  }
  function GameButton_BUTTON0_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON0_instance;
  }
  function GameButton_BUTTON1_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON1_instance;
  }
  function GameButton_BUTTON2_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON2_instance;
  }
  function GameButton_BUTTON3_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON3_instance;
  }
  function GameButton_SELECT_getInstance() {
    GameButton_initEntries();
    return GameButton_SELECT_instance;
  }
  function GameButton_START_getInstance() {
    GameButton_initEntries();
    return GameButton_START_instance;
  }
  function GameButton_SYSTEM_getInstance() {
    GameButton_initEntries();
    return GameButton_SYSTEM_instance;
  }
  function GameButton_L1_getInstance() {
    GameButton_initEntries();
    return GameButton_L1_instance;
  }
  function GameButton_R1_getInstance() {
    GameButton_initEntries();
    return GameButton_R1_instance;
  }
  function GameButton_L2_getInstance() {
    GameButton_initEntries();
    return GameButton_L2_instance;
  }
  function GameButton_R2_getInstance() {
    GameButton_initEntries();
    return GameButton_R2_instance;
  }
  function GameButton_L3_getInstance() {
    GameButton_initEntries();
    return GameButton_L3_instance;
  }
  function GameButton_R3_getInstance() {
    GameButton_initEntries();
    return GameButton_R3_instance;
  }
  function GameButton_LX_getInstance() {
    GameButton_initEntries();
    return GameButton_LX_instance;
  }
  function GameButton_LY_getInstance() {
    GameButton_initEntries();
    return GameButton_LY_instance;
  }
  function GameButton_RX_getInstance() {
    GameButton_initEntries();
    return GameButton_RX_instance;
  }
  function GameButton_RY_getInstance() {
    GameButton_initEntries();
    return GameButton_RY_instance;
  }
  function GameButton_BUTTON4_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON4_instance;
  }
  function GameButton_BUTTON5_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON5_instance;
  }
  function GameButton_BUTTON6_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON6_instance;
  }
  function GameButton_BUTTON7_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON7_instance;
  }
  function GameButton_BUTTON8_getInstance() {
    GameButton_initEntries();
    return GameButton_BUTTON8_instance;
  }
  function GameButton_RECORD_getInstance() {
    GameButton_initEntries();
    return GameButton_RECORD_instance;
  }
  function GameButton_DPADX_getInstance() {
    GameButton_initEntries();
    return GameButton_DPADX_instance;
  }
  function GameButton_DPADY_getInstance() {
    GameButton_initEntries();
    return GameButton_DPADY_instance;
  }
  function MouseButton_LEFT_getInstance() {
    MouseButton_initEntries();
    return MouseButton_LEFT_instance;
  }
  function MouseButton_MIDDLE_getInstance() {
    MouseButton_initEntries();
    return MouseButton_MIDDLE_instance;
  }
  function MouseButton_RIGHT_getInstance() {
    MouseButton_initEntries();
    return MouseButton_RIGHT_instance;
  }
  function MouseButton_BUTTON3_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON3_instance;
  }
  function MouseButton_BUTTON4_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON4_instance;
  }
  function MouseButton_BUTTON5_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON5_instance;
  }
  function MouseButton_BUTTON6_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON6_instance;
  }
  function MouseButton_BUTTON7_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON7_instance;
  }
  function MouseButton_BUTTON_WHEEL_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON_WHEEL_instance;
  }
  function MouseButton_BUTTON_UNKNOWN_getInstance() {
    MouseButton_initEntries();
    return MouseButton_BUTTON_UNKNOWN_instance;
  }
  function MouseButton_NONE_getInstance() {
    MouseButton_initEntries();
    return MouseButton_NONE_instance;
  }
  function ISoftKeyboardConfig() {
  }
  ISoftKeyboardConfig.$metadata$ = interfaceMeta('ISoftKeyboardConfig');
  function SoftKeyboardConfig_init_$Init$(softKeyboardType, softKeyboardSmartDashes, softKeyboardSmartQuotes, softKeyboardSpellChecking, softKeyboardTextContentType, softKeyboardSmartInsertDelete, softKeyboardPassword, softKeyboardReturnKeyType, softKeyboardAutocapitalization, softKeyboardAutocorrection, softKeyboardEnablesReturnKeyAutomatically, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      softKeyboardType = SoftKeyboardType_DEFAULT_getInstance();
    if (!(($mask0 & 2) === 0))
      softKeyboardSmartDashes = null;
    if (!(($mask0 & 4) === 0))
      softKeyboardSmartQuotes = null;
    if (!(($mask0 & 8) === 0))
      softKeyboardSpellChecking = null;
    if (!(($mask0 & 16) === 0))
      softKeyboardTextContentType = null;
    if (!(($mask0 & 32) === 0))
      softKeyboardSmartInsertDelete = null;
    if (!(($mask0 & 64) === 0))
      softKeyboardPassword = false;
    if (!(($mask0 & 128) === 0))
      softKeyboardReturnKeyType = SoftKeyboardReturnKeyType_DEFAULT_getInstance();
    if (!(($mask0 & 256) === 0))
      softKeyboardAutocapitalization = null;
    if (!(($mask0 & 512) === 0))
      softKeyboardAutocorrection = null;
    if (!(($mask0 & 1024) === 0))
      softKeyboardEnablesReturnKeyAutomatically = false;
    SoftKeyboardConfig.call($this, softKeyboardType, softKeyboardSmartDashes, softKeyboardSmartQuotes, softKeyboardSpellChecking, softKeyboardTextContentType, softKeyboardSmartInsertDelete, softKeyboardPassword, softKeyboardReturnKeyType, softKeyboardAutocapitalization, softKeyboardAutocorrection, softKeyboardEnablesReturnKeyAutomatically);
    return $this;
  }
  function SoftKeyboardConfig_init_$Create$(softKeyboardType, softKeyboardSmartDashes, softKeyboardSmartQuotes, softKeyboardSpellChecking, softKeyboardTextContentType, softKeyboardSmartInsertDelete, softKeyboardPassword, softKeyboardReturnKeyType, softKeyboardAutocapitalization, softKeyboardAutocorrection, softKeyboardEnablesReturnKeyAutomatically, $mask0, $marker) {
    return SoftKeyboardConfig_init_$Init$(softKeyboardType, softKeyboardSmartDashes, softKeyboardSmartQuotes, softKeyboardSpellChecking, softKeyboardTextContentType, softKeyboardSmartInsertDelete, softKeyboardPassword, softKeyboardReturnKeyType, softKeyboardAutocapitalization, softKeyboardAutocorrection, softKeyboardEnablesReturnKeyAutomatically, $mask0, $marker, Object.create(SoftKeyboardConfig.prototype));
  }
  function SoftKeyboardConfig(softKeyboardType, softKeyboardSmartDashes, softKeyboardSmartQuotes, softKeyboardSpellChecking, softKeyboardTextContentType, softKeyboardSmartInsertDelete, softKeyboardPassword, softKeyboardReturnKeyType, softKeyboardAutocapitalization, softKeyboardAutocorrection, softKeyboardEnablesReturnKeyAutomatically) {
    this.mcc_1 = softKeyboardType;
    this.ncc_1 = softKeyboardSmartDashes;
    this.occ_1 = softKeyboardSmartQuotes;
    this.pcc_1 = softKeyboardSpellChecking;
    this.qcc_1 = softKeyboardTextContentType;
    this.rcc_1 = softKeyboardSmartInsertDelete;
    this.scc_1 = softKeyboardPassword;
    this.tcc_1 = softKeyboardReturnKeyType;
    this.ucc_1 = softKeyboardAutocapitalization;
    this.vcc_1 = softKeyboardAutocorrection;
    this.wcc_1 = softKeyboardEnablesReturnKeyAutomatically;
  }
  SoftKeyboardConfig.prototype.toString = function () {
    return 'SoftKeyboardConfig(softKeyboardType=' + this.mcc_1 + ', softKeyboardSmartDashes=' + this.ncc_1 + ', softKeyboardSmartQuotes=' + this.occ_1 + ', softKeyboardSpellChecking=' + this.pcc_1 + ', softKeyboardTextContentType=' + this.qcc_1 + ', softKeyboardSmartInsertDelete=' + this.rcc_1 + ', softKeyboardPassword=' + this.scc_1 + ', softKeyboardReturnKeyType=' + this.tcc_1 + ', softKeyboardAutocapitalization=' + this.ucc_1 + ', softKeyboardAutocorrection=' + this.vcc_1 + ', softKeyboardEnablesReturnKeyAutomatically=' + this.wcc_1 + ')';
  };
  SoftKeyboardConfig.prototype.hashCode = function () {
    var result = this.mcc_1.hashCode();
    result = imul(result, 31) + (this.ncc_1 == null ? 0 : this.ncc_1 | 0) | 0;
    result = imul(result, 31) + (this.occ_1 == null ? 0 : this.occ_1 | 0) | 0;
    result = imul(result, 31) + (this.pcc_1 == null ? 0 : this.pcc_1 | 0) | 0;
    result = imul(result, 31) + (this.qcc_1 == null ? 0 : getStringHashCode(this.qcc_1)) | 0;
    result = imul(result, 31) + (this.rcc_1 == null ? 0 : this.rcc_1 | 0) | 0;
    result = imul(result, 31) + (this.scc_1 | 0) | 0;
    result = imul(result, 31) + this.tcc_1.hashCode() | 0;
    result = imul(result, 31) + (this.ucc_1 == null ? 0 : this.ucc_1 | 0) | 0;
    result = imul(result, 31) + (this.vcc_1 == null ? 0 : this.vcc_1 | 0) | 0;
    result = imul(result, 31) + (this.wcc_1 | 0) | 0;
    return result;
  };
  SoftKeyboardConfig.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof SoftKeyboardConfig))
      return false;
    var tmp0_other_with_cast = other instanceof SoftKeyboardConfig ? other : THROW_CCE();
    if (!this.mcc_1.equals(tmp0_other_with_cast.mcc_1))
      return false;
    if (!(this.ncc_1 == tmp0_other_with_cast.ncc_1))
      return false;
    if (!(this.occ_1 == tmp0_other_with_cast.occ_1))
      return false;
    if (!(this.pcc_1 == tmp0_other_with_cast.pcc_1))
      return false;
    if (!(this.qcc_1 == tmp0_other_with_cast.qcc_1))
      return false;
    if (!(this.rcc_1 == tmp0_other_with_cast.rcc_1))
      return false;
    if (!(this.scc_1 === tmp0_other_with_cast.scc_1))
      return false;
    if (!this.tcc_1.equals(tmp0_other_with_cast.tcc_1))
      return false;
    if (!(this.ucc_1 == tmp0_other_with_cast.ucc_1))
      return false;
    if (!(this.vcc_1 == tmp0_other_with_cast.vcc_1))
      return false;
    if (!(this.wcc_1 === tmp0_other_with_cast.wcc_1))
      return false;
    return true;
  };
  SoftKeyboardConfig.$metadata$ = classMeta('SoftKeyboardConfig', [ISoftKeyboardConfig]);
  var SoftKeyboardReturnKeyType_DEFAULT_instance;
  var SoftKeyboardReturnKeyType_GO_instance;
  var SoftKeyboardReturnKeyType_JOIN_instance;
  var SoftKeyboardReturnKeyType_NEXT_instance;
  var SoftKeyboardReturnKeyType_ROUTE_instance;
  var SoftKeyboardReturnKeyType_SEARCH_instance;
  var SoftKeyboardReturnKeyType_DONE_instance;
  var SoftKeyboardReturnKeyType_EMERGENCY_CALL_instance;
  var SoftKeyboardReturnKeyType_CONTINUE_instance;
  var SoftKeyboardReturnKeyType_entriesInitialized;
  function SoftKeyboardReturnKeyType_initEntries() {
    if (SoftKeyboardReturnKeyType_entriesInitialized)
      return Unit_getInstance();
    SoftKeyboardReturnKeyType_entriesInitialized = true;
    SoftKeyboardReturnKeyType_DEFAULT_instance = new SoftKeyboardReturnKeyType('DEFAULT', 0);
    SoftKeyboardReturnKeyType_GO_instance = new SoftKeyboardReturnKeyType('GO', 1);
    SoftKeyboardReturnKeyType_JOIN_instance = new SoftKeyboardReturnKeyType('JOIN', 2);
    SoftKeyboardReturnKeyType_NEXT_instance = new SoftKeyboardReturnKeyType('NEXT', 3);
    SoftKeyboardReturnKeyType_ROUTE_instance = new SoftKeyboardReturnKeyType('ROUTE', 4);
    SoftKeyboardReturnKeyType_SEARCH_instance = new SoftKeyboardReturnKeyType('SEARCH', 5);
    SoftKeyboardReturnKeyType_DONE_instance = new SoftKeyboardReturnKeyType('DONE', 6);
    SoftKeyboardReturnKeyType_EMERGENCY_CALL_instance = new SoftKeyboardReturnKeyType('EMERGENCY_CALL', 7);
    SoftKeyboardReturnKeyType_CONTINUE_instance = new SoftKeyboardReturnKeyType('CONTINUE', 8);
  }
  function SoftKeyboardReturnKeyType(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  SoftKeyboardReturnKeyType.$metadata$ = classMeta('SoftKeyboardReturnKeyType', undefined, undefined, undefined, undefined, Enum.prototype);
  var SoftKeyboardType_DEFAULT_instance;
  var SoftKeyboardType_ASCII_CAPABLE_instance;
  var SoftKeyboardType_NUMBERS_AND_PUNCTUATION_instance;
  var SoftKeyboardType_URL_instance;
  var SoftKeyboardType_NUMBER_PAD_instance;
  var SoftKeyboardType_PHONE_PAD_instance;
  var SoftKeyboardType_NAME_PHONE_PAD_instance;
  var SoftKeyboardType_EMAIL_ADDRESS_instance;
  var SoftKeyboardType_DECIMAL_PAD_instance;
  var SoftKeyboardType_TWITTER_instance;
  var SoftKeyboardType_WEB_SEARCH_instance;
  var SoftKeyboardType_ASCII_CAPABLE_NUMBER_PAD_instance;
  var SoftKeyboardType_ALPHABET_instance;
  var SoftKeyboardType_entriesInitialized;
  function SoftKeyboardType_initEntries() {
    if (SoftKeyboardType_entriesInitialized)
      return Unit_getInstance();
    SoftKeyboardType_entriesInitialized = true;
    SoftKeyboardType_DEFAULT_instance = new SoftKeyboardType('DEFAULT', 0);
    SoftKeyboardType_ASCII_CAPABLE_instance = new SoftKeyboardType('ASCII_CAPABLE', 1);
    SoftKeyboardType_NUMBERS_AND_PUNCTUATION_instance = new SoftKeyboardType('NUMBERS_AND_PUNCTUATION', 2);
    SoftKeyboardType_URL_instance = new SoftKeyboardType('URL', 3);
    SoftKeyboardType_NUMBER_PAD_instance = new SoftKeyboardType('NUMBER_PAD', 4);
    SoftKeyboardType_PHONE_PAD_instance = new SoftKeyboardType('PHONE_PAD', 5);
    SoftKeyboardType_NAME_PHONE_PAD_instance = new SoftKeyboardType('NAME_PHONE_PAD', 6);
    SoftKeyboardType_EMAIL_ADDRESS_instance = new SoftKeyboardType('EMAIL_ADDRESS', 7);
    SoftKeyboardType_DECIMAL_PAD_instance = new SoftKeyboardType('DECIMAL_PAD', 8);
    SoftKeyboardType_TWITTER_instance = new SoftKeyboardType('TWITTER', 9);
    SoftKeyboardType_WEB_SEARCH_instance = new SoftKeyboardType('WEB_SEARCH', 10);
    SoftKeyboardType_ASCII_CAPABLE_NUMBER_PAD_instance = new SoftKeyboardType('ASCII_CAPABLE_NUMBER_PAD', 11);
    SoftKeyboardType_ALPHABET_instance = new SoftKeyboardType('ALPHABET', 12);
  }
  function SoftKeyboardType(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  SoftKeyboardType.$metadata$ = classMeta('SoftKeyboardType', undefined, undefined, undefined, undefined, Enum.prototype);
  function SoftKeyboardReturnKeyType_DEFAULT_getInstance() {
    SoftKeyboardReturnKeyType_initEntries();
    return SoftKeyboardReturnKeyType_DEFAULT_instance;
  }
  function SoftKeyboardType_DEFAULT_getInstance() {
    SoftKeyboardType_initEntries();
    return SoftKeyboardType_DEFAULT_instance;
  }
  function DialogInterfaceProvider() {
  }
  DialogInterfaceProvider.$metadata$ = interfaceMeta('DialogInterfaceProvider');
  function DialogInterface() {
  }
  DialogInterface.$metadata$ = interfaceMeta('DialogInterface', [DialogInterfaceProvider]);
  var GLOBAL_CHECK_GL;
  var Cursor_DEFAULT_instance;
  var Cursor_CROSSHAIR_instance;
  var Cursor_TEXT_instance;
  var Cursor_HAND_instance;
  var Cursor_MOVE_instance;
  var Cursor_WAIT_instance;
  var Cursor_RESIZE_EAST_instance;
  var Cursor_RESIZE_WEST_instance;
  var Cursor_RESIZE_SOUTH_instance;
  var Cursor_RESIZE_NORTH_instance;
  var Cursor_RESIZE_NORTH_EAST_instance;
  var Cursor_RESIZE_NORTH_WEST_instance;
  var Cursor_RESIZE_SOUTH_EAST_instance;
  var Cursor_RESIZE_SOUTH_WEST_instance;
  function Companion_45() {
    Companion_instance_45 = this;
    this.xcc_1 = mapOf([to(new Angle(times(get_degrees(45), 0)), Cursor_RESIZE_EAST_getInstance()), to(new Angle(times(get_degrees(45), 1)), Cursor_RESIZE_SOUTH_EAST_getInstance()), to(new Angle(times(get_degrees(45), 2)), Cursor_RESIZE_SOUTH_getInstance()), to(new Angle(times(get_degrees(45), 3)), Cursor_RESIZE_SOUTH_WEST_getInstance()), to(new Angle(times(get_degrees(45), 4)), Cursor_RESIZE_WEST_getInstance()), to(new Angle(times(get_degrees(45), 5)), Cursor_RESIZE_NORTH_WEST_getInstance()), to(new Angle(times(get_degrees(45), 6)), Cursor_RESIZE_NORTH_getInstance()), to(new Angle(times(get_degrees(45), 7)), Cursor_RESIZE_NORTH_EAST_getInstance())]);
  }
  Companion_45.$metadata$ = objectMeta('Companion');
  var Companion_instance_45;
  function Companion_getInstance_60() {
    Cursor_initEntries();
    if (Companion_instance_45 == null)
      new Companion_45();
    return Companion_instance_45;
  }
  var Cursor_entriesInitialized;
  function Cursor_initEntries() {
    if (Cursor_entriesInitialized)
      return Unit_getInstance();
    Cursor_entriesInitialized = true;
    Cursor_DEFAULT_instance = new Cursor('DEFAULT', 0);
    Cursor_CROSSHAIR_instance = new Cursor('CROSSHAIR', 1);
    Cursor_TEXT_instance = new Cursor('TEXT', 2);
    Cursor_HAND_instance = new Cursor('HAND', 3);
    Cursor_MOVE_instance = new Cursor('MOVE', 4);
    Cursor_WAIT_instance = new Cursor('WAIT', 5);
    Cursor_RESIZE_EAST_instance = new Cursor('RESIZE_EAST', 6);
    Cursor_RESIZE_WEST_instance = new Cursor('RESIZE_WEST', 7);
    Cursor_RESIZE_SOUTH_instance = new Cursor('RESIZE_SOUTH', 8);
    Cursor_RESIZE_NORTH_instance = new Cursor('RESIZE_NORTH', 9);
    Cursor_RESIZE_NORTH_EAST_instance = new Cursor('RESIZE_NORTH_EAST', 10);
    Cursor_RESIZE_NORTH_WEST_instance = new Cursor('RESIZE_NORTH_WEST', 11);
    Cursor_RESIZE_SOUTH_EAST_instance = new Cursor('RESIZE_SOUTH_EAST', 12);
    Cursor_RESIZE_SOUTH_WEST_instance = new Cursor('RESIZE_SOUTH_WEST', 13);
    Companion_getInstance_60();
  }
  function MenuItem_init_$Init$(text, enabled, children, action, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      enabled = true;
    if (!(($mask0 & 4) === 0))
      children = null;
    if (!(($mask0 & 8) === 0)) {
      action = GameWindow$MenuItem$_init_$lambda_465oqx;
    }
    MenuItem.call($this, text, enabled, children, action);
    return $this;
  }
  function MenuItem_init_$Create$(text, enabled, children, action, $mask0, $marker) {
    return MenuItem_init_$Init$(text, enabled, children, action, $mask0, $marker, Object.create(MenuItem.prototype));
  }
  function GameWindow$MenuItem$_init_$lambda_465oqx() {
    return Unit_getInstance();
  }
  var Quality_PERFORMANCE_instance;
  var Quality_QUALITY_instance;
  var Quality_AUTOMATIC_instance;
  var Quality_entriesInitialized;
  function Quality_initEntries() {
    if (Quality_entriesInitialized)
      return Unit_getInstance();
    Quality_entriesInitialized = true;
    Quality_PERFORMANCE_instance = new Quality('PERFORMANCE', 0);
    Quality_QUALITY_instance = new Quality('QUALITY', 1);
    Quality_AUTOMATIC_instance = new Quality('AUTOMATIC', 2);
  }
  function ICursor() {
  }
  ICursor.$metadata$ = interfaceMeta('ICursor');
  function Cursor(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  Cursor.$metadata$ = classMeta('Cursor', [ICursor], undefined, undefined, undefined, Enum.prototype);
  function MenuItem(text, enabled, children, action) {
    this.ycc_1 = text;
    this.zcc_1 = enabled;
    this.acd_1 = children;
    this.bcd_1 = action;
  }
  MenuItem.prototype.toString = function () {
    return 'MenuItem(text=' + this.ycc_1 + ', enabled=' + this.zcc_1 + ', children=' + this.acd_1 + ', action=' + this.bcd_1 + ')';
  };
  MenuItem.prototype.hashCode = function () {
    var result = this.ycc_1 == null ? 0 : getStringHashCode(this.ycc_1);
    result = imul(result, 31) + (this.zcc_1 | 0) | 0;
    result = imul(result, 31) + (this.acd_1 == null ? 0 : hashCode(this.acd_1)) | 0;
    result = imul(result, 31) + hashCode(this.bcd_1) | 0;
    return result;
  };
  MenuItem.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof MenuItem))
      return false;
    var tmp0_other_with_cast = other instanceof MenuItem ? other : THROW_CCE();
    if (!(this.ycc_1 == tmp0_other_with_cast.ycc_1))
      return false;
    if (!(this.zcc_1 === tmp0_other_with_cast.zcc_1))
      return false;
    if (!equals(this.acd_1, tmp0_other_with_cast.acd_1))
      return false;
    if (!equals(this.bcd_1, tmp0_other_with_cast.bcd_1))
      return false;
    return true;
  };
  MenuItem.$metadata$ = classMeta('MenuItem');
  function CoroutineKey() {
    CoroutineKey_instance = this;
    var tmp = this;
    tmp.ccd_1 = MenuItem_init_$Create$(null, false, null, null, 14, null);
  }
  CoroutineKey.$metadata$ = objectMeta('CoroutineKey', [Key]);
  var CoroutineKey_instance;
  function CoroutineKey_getInstance() {
    if (CoroutineKey_instance == null)
      new CoroutineKey();
    return CoroutineKey_instance;
  }
  function _get_fpsCached__581dty($this) {
    return $this.ycd_1.d9($this, fpsCached$factory());
  }
  function Quality(name, ordinal) {
    Enum.call(this, name, ordinal);
    this.ocf_1 = 4000000;
  }
  Quality.prototype.pcf = function (width, height, devicePixelRatio, targetPixels) {
    var tmp0_subject = this;
    var tmp0 = tmp0_subject.q2_1;
    var tmp;
    switch (tmp0) {
      case 0:
        tmp = 1.0;
        break;
      case 1:
        tmp = devicePixelRatio;
        break;
      case 2:
        var tmp$ret$1;
        $l$block: {
          // Inline function 'kotlin.collections.firstOrNull' call
          var tmp0_firstOrNull = listOf_0([devicePixelRatio, 2.0, 1.0]);
          var tmp0_iterator = tmp0_firstOrNull.j();
          while (tmp0_iterator.k()) {
            var element = tmp0_iterator.l();
            var tmp$ret$0;
            // Inline function 'com.soywiz.korgw.Quality.computeTargetScale.<anonymous>' call
            tmp$ret$0 = imul(width, height) * element <= targetPixels;
            if (tmp$ret$0) {
              tmp$ret$1 = element;
              break $l$block;
            }
          }
          tmp$ret$1 = null;
        }

        var tmp1_elvis_lhs = tmp$ret$1;
        tmp = tmp1_elvis_lhs == null ? 1.0 : tmp1_elvis_lhs;
        break;
      default:
        noWhenBranchMatchedException();
        break;
    }
    return tmp;
  };
  Quality.prototype.qcf = function (width, height, devicePixelRatio, targetPixels, $mask0, $handler) {
    if (!(($mask0 & 8) === 0))
      targetPixels = this.ocf_1;
    return this.pcf(width, height, devicePixelRatio, targetPixels);
  };
  Quality.$metadata$ = classMeta('Quality', undefined, undefined, undefined, undefined, Enum.prototype);
  function GameWindow$fpsCached$delegate$lambda(this$0) {
    return function () {
      return this$0.rcf();
    };
  }
  function GameWindow$loop$slambda($entry, this$0, resultContinuation) {
    this.acg_1 = $entry;
    this.bcg_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  GameWindow$loop$slambda.prototype.z56 = function ($cont) {
    var tmp = this.k53($cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  GameWindow$loop$slambda.prototype.to = function ($cont) {
    return this.z56($cont);
  };
  GameWindow$loop$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.acg_1(this.bcg_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  GameWindow$loop$slambda.prototype.k53 = function (completion) {
    var i = new GameWindow$loop$slambda(this.acg_1, this.bcg_1, completion);
    return i;
  };
  GameWindow$loop$slambda.$metadata$ = classMeta('GameWindow$loop$slambda', undefined, undefined, undefined, [0], CoroutineImpl.prototype);
  function GameWindow$loop$slambda_0($entry, this$0, resultContinuation) {
    var i = new GameWindow$loop$slambda($entry, this$0, resultContinuation);
    var l = function ($cont) {
      return i.z56($cont);
    };
    l.$arity = 0;
    return l;
  }
  function _no_name_provided__qut3iv(this$0) {
    this.dcg_1 = this$0;
    ObservableProperty.call(this, true);
  }
  _no_name_provided__qut3iv.prototype.ecg = function (property, oldValue, newValue) {
    var tmp0_safe_receiver = this.dcg_1.qce_1;
    if (tmp0_safe_receiver == null)
      null;
    else
      tmp0_safe_receiver(newValue);
    return Unit_getInstance();
  };
  _no_name_provided__qut3iv.prototype.a9 = function (property, oldValue, newValue) {
    var tmp = (!(oldValue == null) ? typeof oldValue === 'boolean' : false) ? oldValue : THROW_CCE();
    return this.ecg(property, tmp, (!(newValue == null) ? typeof newValue === 'boolean' : false) ? newValue : THROW_CCE());
  };
  _no_name_provided__qut3iv.$metadata$ = classMeta(undefined, undefined, undefined, undefined, undefined, ObservableProperty.prototype);
  function Cursor_DEFAULT_getInstance() {
    Cursor_initEntries();
    return Cursor_DEFAULT_instance;
  }
  function Cursor_TEXT_getInstance() {
    Cursor_initEntries();
    return Cursor_TEXT_instance;
  }
  function Cursor_HAND_getInstance() {
    Cursor_initEntries();
    return Cursor_HAND_instance;
  }
  function Cursor_RESIZE_EAST_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_EAST_instance;
  }
  function Cursor_RESIZE_WEST_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_WEST_instance;
  }
  function Cursor_RESIZE_SOUTH_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_SOUTH_instance;
  }
  function Cursor_RESIZE_NORTH_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_NORTH_instance;
  }
  function Cursor_RESIZE_NORTH_EAST_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_NORTH_EAST_instance;
  }
  function Cursor_RESIZE_NORTH_WEST_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_NORTH_WEST_instance;
  }
  function Cursor_RESIZE_SOUTH_EAST_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_SOUTH_EAST_instance;
  }
  function Cursor_RESIZE_SOUTH_WEST_getInstance() {
    Cursor_initEntries();
    return Cursor_RESIZE_SOUTH_WEST_instance;
  }
  function Quality_PERFORMANCE_getInstance() {
    Quality_initEntries();
    return Quality_PERFORMANCE_instance;
  }
  function Quality_AUTOMATIC_getInstance() {
    Quality_initEntries();
    return Quality_AUTOMATIC_instance;
  }
  function $waitCloseCOROUTINE$1(_this__u8e3s4, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.ncg_1 = _this__u8e3s4;
  }
  $waitCloseCOROUTINE$1.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 4;
            this.o7_1 = 1;
            continue $sm;
          case 1:
            if (!this.ncg_1.mce_1) {
              this.o7_1 = 3;
              continue $sm;
            }

            this.o7_1 = 2;
            suspendResult = delay(this.ncg_1, Companion_getInstance_3().o1h(100.0), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 2:
            this.o7_1 = 1;
            continue $sm;
          case 3:
            return Unit_getInstance();
          case 4:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 4) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  $waitCloseCOROUTINE$1.$metadata$ = classMeta('$waitCloseCOROUTINE$1', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
  function $loopCOROUTINE$2(_this__u8e3s4, entry, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.wcg_1 = _this__u8e3s4;
    this.xcg_1 = entry;
  }
  $loopCOROUTINE$2.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 6;
            this.o7_1 = 1;
            suspendResult = this.wcg_1.bch(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            this.ycg_1 = suspendResult;
            launchImmediately(this.ycg_1, GameWindow$loop$slambda_0(this.xcg_1, this.wcg_1, null));
            ;
            this.o7_1 = 2;
            continue $sm;
          case 2:
            if (!this.wcg_1.mce_1) {
              this.o7_1 = 5;
              continue $sm;
            }

            var tmp_0 = this;
            tmp_0.zcg_1 = this.wcg_1.cch(false, false, null, 7, null);
            this.ach_1 = TimeSpan__minus_impl_5w5v8s(this.wcg_1.dch(), this.zcg_1);
            if (TimeSpan__compareTo_impl_zidry4(this.ach_1, Companion_getInstance_3().l1h_1) > 0) {
              this.o7_1 = 3;
              suspendResult = delay(this.wcg_1, this.ach_1, this);
              if (suspendResult === get_COROUTINE_SUSPENDED()) {
                return suspendResult;
              }
              continue $sm;
            } else {
              this.o7_1 = 4;
              continue $sm;
            }

            break;
          case 3:
            this.o7_1 = 4;
            continue $sm;
          case 4:
            this.o7_1 = 2;
            continue $sm;
          case 5:
            return Unit_getInstance();
          case 6:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 6) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  $loopCOROUTINE$2.$metadata$ = classMeta('$loopCOROUTINE$2', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
  function GameWindow() {
    CoroutineKey_getInstance();
    Mixin.call(this);
    var tmp = this;
    tmp.ecd_1 = Mixin_init_$Create$(null, 1, null);
    this.fcd_1 = Cursor_DEFAULT_getInstance();
    var tmp_0 = this;
    tmp_0.gcd_1 = DummyAG_init_$Create$(0, 0, 3, null);
    this.hcd_1 = new GameWindowCoroutineDispatcher();
    this.icd_1 = new PauseEvent();
    this.jcd_1 = new ResumeEvent();
    this.kcd_1 = new StopEvent();
    this.lcd_1 = new DestroyEvent();
    this.mcd_1 = new RenderEvent();
    this.ncd_1 = new InitEvent();
    this.ocd_1 = new DisposeEvent();
    var tmp_1 = this;
    tmp_1.pcd_1 = FullScreenEvent_init_$Create$(false, 1, null);
    var tmp_2 = this;
    tmp_2.qcd_1 = ReshapeEvent_init_$Create$(0, 0, 0, 0, 15, null);
    var tmp_3 = this;
    var tmp_4 = _Char___init__impl__6a9atx(0);
    tmp_3.rcd_1 = KeyEvent_init_$Create$(null, 0, null, 0, tmp_4, false, false, false, false, null, 1023, null);
    var tmp_5 = this;
    tmp_5.scd_1 = MouseEvent_init_$Create$(null, 0, 0, 0, null, 0, 0.0, 0.0, 0.0, false, false, false, false, false, false, null, 65535, null);
    var tmp_6 = this;
    tmp_6.tcd_1 = GestureEvent_init_$Create$(null, 0, 0.0, 0.0, 15, null);
    this.ucd_1 = new TouchBuilder();
    var tmp_7 = this;
    tmp_7.vcd_1 = DropFileEvent_init_$Create$(null, null, 3, null);
    var tmp_8 = this;
    tmp_8.wcd_1 = GamePadUpdateEvent_init_$Create$(0, null, 3, null);
    var tmp_9 = this;
    tmp_9.xcd_1 = GamePadConnectionEvent_init_$Create$(null, 0, 3, null);
    var tmp_10 = this;
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.milliseconds' call
    tmp$ret$0 = Companion_getInstance_3().o1h(1000.0);
    var tmp_11 = tmp$ret$0;
    tmp_10.ycd_1 = new IntTimedCache(tmp_11, GameWindow$fpsCached$delegate$lambda(this));
    this.zcd_1 = 0;
    this.ace_1 = 0;
    this.bce_1 = true;
    this.cce_1 = null;
    this.dce_1 = false;
    this.ece_1 = false;
    this.fce_1 = Colors_getInstance().t7z_1;
    var tmp_12 = this;
    tmp_12.gce_1 = Signal_init_$Create$(null, 1, null);
    var tmp_13 = this;
    tmp_13.hce_1 = Signal_init_$Create$(null, 1, null);
    this.ice_1 = null;
    this.jce_1 = false;
    this.kce_1 = true;
    this.lce_1 = 0;
    this.mce_1 = true;
    this.nce_1 = false;
    var tmp_14 = this;
    var tmp$ret$1;
    // Inline function 'com.soywiz.klock.milliseconds' call
    tmp$ret$1 = Companion_getInstance_3().o1h(0.0);
    tmp_14.oce_1 = tmp$ret$1;
    var tmp_15 = this;
    var tmp$ret$2;
    // Inline function 'com.soywiz.klock.milliseconds' call
    tmp$ret$2 = Companion_getInstance_3().o1h(0.0);
    tmp_15.pce_1 = tmp$ret$2;
    this.qce_1 = null;
    var tmp_16 = this;
    var tmp$ret$3;
    // Inline function 'kotlin.properties.Delegates.observable' call
    var tmp0_observable = Delegates_getInstance();
    tmp$ret$3 = new _no_name_provided__qut3iv(this);
    tmp_16.rce_1 = tmp$ret$3;
    this.sce_1 = false;
    this.tce_1 = -1;
    this.uce_1 = -1;
    this.vce_1 = -1;
    this.wce_1 = -1;
    this.xce_1 = false;
    this.yce_1 = false;
    this.zce_1 = false;
    this.acf_1 = 0;
    this.bcf_1 = Companion_getInstance_3().l1h_1;
    this.ccf_1 = booleanArray(Companion_getInstance_55().rca_1);
    this.dcf_1 = 0;
    this.ecf_1 = 0.0;
    this.fcf_1 = 0.0;
    this.gcf_1 = 0.0;
    this.hcf_1 = false;
  }
  GameWindow.prototype.e4v = function (_set____db54di) {
    this.ecd_1.e4v(_set____db54di);
  };
  GameWindow.prototype.f4v = function () {
    return this.ecd_1.f4v();
  };
  GameWindow.prototype.ech = function (windowRect) {
  };
  GameWindow.prototype.fch = function (force, config) {
  };
  GameWindow.prototype.gch = function (force, config, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      force = true;
    if (!(($mask0 & 2) === 0))
      config = null;
    var tmp;
    if ($handler == null) {
      this.fch(force, config);
      tmp = Unit_getInstance();
    } else {
      tmp = $handler(force, config);
    }
    return tmp;
  };
  GameWindow.prototype.hch = function () {
  };
  GameWindow.prototype.ich = function (_set____db54di) {
    this.fcd_1 = _set____db54di;
  };
  GameWindow.prototype.jch = function () {
    return this.fcd_1;
  };
  GameWindow.prototype.k1 = function () {
    return CoroutineKey_getInstance();
  };
  GameWindow.prototype.kch = function () {
    return this.gcd_1;
  };
  GameWindow.prototype.lch = function () {
    return this.hcd_1;
  };
  GameWindow.prototype.mch = function (coroutineContext) {
    return coroutineContext.p8(this.lch());
  };
  GameWindow.prototype.bch = function ($cont) {
    var tmp$ret$0;
    // Inline function 'kotlin.js.getCoroutineContext' call
    tmp$ret$0 = $cont.p5();
    return this.mch(tmp$ret$0);
  };
  GameWindow.prototype.nch = function (block) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korev.addEventListener' call
    tmp$ret$0 = this.nc3(getKClass(RenderEvent), block);
  };
  GameWindow.prototype.dch = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.microseconds' call
    var tmp0__get_microseconds__mq1imi = 1000000.0 / this.och();
    tmp$ret$0 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi);
    return tmp$ret$0;
  };
  GameWindow.prototype.rcf = function () {
    return 60;
  };
  GameWindow.prototype.pch = function (name, time) {
  };
  GameWindow.prototype.och = function () {
    return _get_fpsCached__581dty(this);
  };
  GameWindow.prototype.qch = function (value) {
    return Unit_getInstance();
  };
  GameWindow.prototype.d72 = function () {
    return this.zcd_1;
  };
  GameWindow.prototype.e72 = function () {
    return this.ace_1;
  };
  GameWindow.prototype.rch = function (_set____db54di) {
    this.cce_1 = _set____db54di;
  };
  GameWindow.prototype.sch = function (_set____db54di) {
    this.dce_1 = _set____db54di;
  };
  GameWindow.prototype.tch = function (_set____db54di) {
    this.ece_1 = _set____db54di;
  };
  GameWindow.prototype.uch = function (_set____db54di) {
    this.fce_1 = _set____db54di;
  };
  GameWindow.prototype.vch = function (value) {
    return Unit_getInstance();
  };
  GameWindow.prototype.wch = function (value) {
    this.jce_1 = value;
    this.hce_1.k54(value);
    if (value) {
      invoke(this.gce_1);
    }
  };
  GameWindow.prototype.xch = function (width, height) {
    return Unit_getInstance();
  };
  GameWindow.prototype.ych = function (exitCode) {
    return this.zch(exitCode);
  };
  GameWindow.prototype.aci = function (exitCode, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      exitCode = 0;
    return this.ych(exitCode);
  };
  GameWindow.prototype.zch = function (exitCode) {
    if (this.nce_1)
      return Unit_getInstance();
    this.nce_1 = true;
    this.mce_1 = false;
    this.lce_1 = exitCode;
    println('GameWindow.close');
    this.lch().x2c();
    var tmp = this.lch();
    cancelChildren$default(tmp, null, 1, null);
  };
  GameWindow.prototype.jci = function (exitCode, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      exitCode = 0;
    var tmp;
    if ($handler == null) {
      this.zch(exitCode);
      tmp = Unit_getInstance();
    } else {
      tmp = $handler(exitCode);
    }
    return tmp;
  };
  GameWindow.prototype.kci = function ($cont) {
    var tmp = new $waitCloseCOROUTINE$1(this, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  GameWindow.prototype.lci = function (entry, $cont) {
    var tmp = new $loopCOROUTINE$2(this, entry, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  GameWindow.prototype.mci = function (_set____db54di) {
    return this.rce_1.h9(this, continuousRenderMode$factory(), _set____db54di);
  };
  GameWindow.prototype.nci = function () {
    return this.rce_1.g9(this, continuousRenderMode$factory_0());
  };
  GameWindow.prototype.oci = function (doUpdate, doRender, frameStartTime) {
    var startTime = PerformanceCounter_getInstance().x1h();
    if (doRender) {
      var tmp = this;
      var tmp$ret$1;
      // Inline function 'com.soywiz.klock.measureTime' call
      var start = PerformanceCounter_getInstance().u1h();
      // Inline function 'com.soywiz.korgw.GameWindow.frame.<anonymous>' call
      this.pci(doUpdate, true);
      var end = PerformanceCounter_getInstance().u1h();
      var tmp$ret$0;
      // Inline function 'com.soywiz.klock.microseconds' call
      var tmp0__get_microseconds__mq1imi = end - start;
      tmp$ret$0 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi);
      tmp$ret$1 = tmp$ret$0;
      tmp.oce_1 = tmp$ret$1;
    }
    if (doUpdate) {
      var tmp_0 = this;
      var tmp$ret$3;
      // Inline function 'com.soywiz.klock.measureTime' call
      var start_0 = PerformanceCounter_getInstance().u1h();
      // Inline function 'com.soywiz.korgw.GameWindow.frame.<anonymous>' call
      if (!doRender) {
        this.pci(true, false);
      }
      this.qci(frameStartTime);
      var end_0 = PerformanceCounter_getInstance().u1h();
      var tmp$ret$2;
      // Inline function 'com.soywiz.klock.microseconds' call
      var tmp0__get_microseconds__mq1imi_0 = end_0 - start_0;
      tmp$ret$2 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi_0);
      tmp$ret$3 = tmp$ret$2;
      tmp_0.pce_1 = tmp$ret$3;
    }
    var endTime = PerformanceCounter_getInstance().x1h();
    return TimeSpan__minus_impl_5w5v8s(endTime, startTime);
  };
  GameWindow.prototype.cch = function (doUpdate, doRender, frameStartTime, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      doUpdate = true;
    if (!(($mask0 & 2) === 0))
      doRender = true;
    if (!(($mask0 & 4) === 0))
      frameStartTime = PerformanceCounter_getInstance().x1h();
    return this.oci(doUpdate, doRender, frameStartTime);
  };
  GameWindow.prototype.pci = function (doUpdate, doRender) {
    if (doRender) {
      if (this.zce_1) {
        this.zce_1 = false;
        this.kch().vb8();
      }
      if (this.sce_1) {
        this.sce_1 = false;
        var tmp = this.kch().cb9();
        var tmp_0 = this.tce_1;
        var tmp_1 = this.uce_1;
        var tmp_2 = this.vce_1;
        var tmp_3 = this.wce_1;
        tmp.zb1(tmp_0, tmp_1, tmp_2, tmp_3, 0, 0, 48, null);
        this.rci(this.tce_1, this.uce_1, this.vce_1, this.wce_1);
      }
    }
    if (this.xce_1) {
      this.xce_1 = false;
      println('---------------- Trigger AG.initialized ag.mainRenderBuffer.setSize (' + this.d72() + ', ' + this.e72() + ') --------------');
      var tmp$ret$0;
      // Inline function 'com.soywiz.korev.dispatch' call
      var tmp0_dispatch = this.ncd_1;
      this.oc3(getKClass(InitEvent), tmp0_dispatch);
      tmp$ret$0 = Unit_getInstance();
    }
    try {
      this.sci(doUpdate, doRender);
    } catch ($p) {
      if ($p instanceof Error) {
        println('ERROR GameWindow.frameRender:');
        println($p);
        printStackTrace($p);
      } else {
        throw $p;
      }
    }
  };
  GameWindow.prototype.gba = function () {
    this.acf_1 = 0;
  };
  GameWindow.prototype.tci = function () {
    var tmp0_this = this;
    var tmp1 = tmp0_this.acf_1;
    tmp0_this.acf_1 = tmp1 + 1 | 0;
  };
  GameWindow.prototype.qci = function (startTime) {
    var tmp = this;
    var tmp$ret$1;
    // Inline function 'com.soywiz.klock.measureTime' call
    var start = PerformanceCounter_getInstance().u1h();
    // Inline function 'com.soywiz.korgw.GameWindow.frameUpdate.<anonymous>' call
    this.uci();
    var end = PerformanceCounter_getInstance().u1h();
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.microseconds' call
    var tmp0__get_microseconds__mq1imi = end - start;
    tmp$ret$0 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi);
    tmp$ret$1 = tmp$ret$0;
    tmp.bcf_1 = tmp$ret$1;
    try {
      var now = PerformanceCounter_getInstance().x1h();
      var consumed = TimeSpan__minus_impl_5w5v8s(now, startTime);
      var tmp_0 = TimeSpan__minus_impl_5w5v8s(this.dch(), consumed);
      var tmp$ret$2;
      // Inline function 'com.soywiz.klock.milliseconds' call
      tmp$ret$2 = Companion_getInstance_3().o1h(2.0);
      var remaining = TimeSpan__minus_impl_5w5v8s(tmp_0, tmp$ret$2);
      var tmp0_elvis_lhs = this.lch().hci_1;
      var tmp_1;
      var tmp_2 = tmp0_elvis_lhs;
      if ((tmp_2 == null ? null : new TimeSpan(tmp_2)) == null) {
        tmp_1 = remaining;
      } else {
        tmp_1 = tmp0_elvis_lhs;
      }
      var timeForTasks = tmp_1;
      var tmp$ret$3;
      // Inline function 'com.soywiz.klock.milliseconds' call
      tmp$ret$3 = Companion_getInstance_3().o1h(4.0);
      var finalTimeForTasks = max(timeForTasks, tmp$ret$3);
      this.lch().vci(finalTimeForTasks);
    } catch ($p) {
      if ($p instanceof Error) {
        println('ERROR GameWindow.frameRender:');
        println($p);
      } else {
        throw $p;
      }
    }
  };
  GameWindow.prototype.uci = function () {
  };
  GameWindow.prototype.sci = function (update, render) {
    var tmp$ret$1;
    // Inline function 'com.soywiz.korev.dispatch' call
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = this.mcd_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korgw.GameWindow.dispatchRenderEvent.<anonymous>' call
    tmp0_also.aca_1 = update;
    tmp0_also.bca_1 = render;
    tmp$ret$0 = tmp0_also;
    var tmp1_dispatch = tmp$ret$0;
    this.oc3(getKClass(RenderEvent), tmp1_dispatch);
    tmp$ret$1 = Unit_getInstance();
    return tmp$ret$1;
  };
  GameWindow.prototype.wci = function (type, files) {
    var tmp$ret$1;
    // Inline function 'com.soywiz.korev.dispatch' call
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = this.vcd_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korgw.GameWindow.dispatchDropfileEvent.<anonymous>' call
    tmp0_also.vc9_1 = type;
    tmp0_also.wc9_1 = files;
    tmp$ret$0 = tmp0_also;
    var tmp1_dispatch = tmp$ret$0;
    this.oc3(getKClass(DropFileEvent), tmp1_dispatch);
    tmp$ret$1 = Unit_getInstance();
    return tmp$ret$1;
  };
  GameWindow.prototype.rci = function (x, y, width, height) {
    this.xci(x, y, width, height, width, height);
  };
  GameWindow.prototype.xci = function (x, y, width, height, fullWidth, fullHeight) {
    this.kch().bb9(x, y, width, height, fullWidth, fullHeight);
    var tmp$ret$1;
    // Inline function 'com.soywiz.korev.dispatch' call
    var tmp$ret$0;
    // Inline function 'kotlin.apply' call
    var tmp0_apply = this.qcd_1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korgw.GameWindow.dispatchReshapeEventEx.<anonymous>' call
    tmp0_apply.yc5_1 = x;
    tmp0_apply.zc5_1 = y;
    tmp0_apply.ac6_1 = width;
    tmp0_apply.bc6_1 = height;
    tmp$ret$0 = tmp0_apply;
    var tmp1_dispatch = tmp$ret$0;
    this.oc3(getKClass(ReshapeEvent), tmp1_dispatch);
    tmp$ret$1 = Unit_getInstance();
  };
  GameWindow.prototype.yci = function (data, $cont) {
    return Unit_getInstance();
  };
  GameWindow.prototype.zci = function ($cont) {
    return null;
  };
  GameWindow.$metadata$ = classMeta('GameWindow', [DialogInterfaceProvider, Element, AGWindow, GameWindowConfig, Extra], undefined, undefined, undefined, Mixin.prototype);
  function GameWindowCreationConfig_init_$Init$(multithreaded, hdr, $mask0, $marker, $this) {
    if (!(($mask0 & 1) === 0))
      multithreaded = null;
    if (!(($mask0 & 2) === 0))
      hdr = null;
    GameWindowCreationConfig.call($this, multithreaded, hdr);
    return $this;
  }
  function GameWindowCreationConfig_init_$Create$(multithreaded, hdr, $mask0, $marker) {
    return GameWindowCreationConfig_init_$Init$(multithreaded, hdr, $mask0, $marker, Object.create(GameWindowCreationConfig.prototype));
  }
  function GameWindowCreationConfig(multithreaded, hdr) {
    this.acj_1 = multithreaded;
    this.bcj_1 = hdr;
  }
  GameWindowCreationConfig.prototype.toString = function () {
    return 'GameWindowCreationConfig(multithreaded=' + this.acj_1 + ', hdr=' + this.bcj_1 + ')';
  };
  GameWindowCreationConfig.prototype.hashCode = function () {
    var result = this.acj_1 == null ? 0 : this.acj_1 | 0;
    result = imul(result, 31) + (this.bcj_1 == null ? 0 : this.bcj_1 | 0) | 0;
    return result;
  };
  GameWindowCreationConfig.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof GameWindowCreationConfig))
      return false;
    var tmp0_other_with_cast = other instanceof GameWindowCreationConfig ? other : THROW_CCE();
    if (!(this.acj_1 == tmp0_other_with_cast.acj_1))
      return false;
    if (!(this.bcj_1 == tmp0_other_with_cast.bcj_1))
      return false;
    return true;
  };
  GameWindowCreationConfig.$metadata$ = classMeta('GameWindowCreationConfig');
  function configure(_this__u8e3s4, width, height, title, icon, fullscreen, bgcolor) {
    _this__u8e3s4.xch(width, height);
    if (!(title == null)) {
      _this__u8e3s4.qch(title);
    }
    _this__u8e3s4.rch(icon);
    if (!(fullscreen == null)) {
      _this__u8e3s4.sch(fullscreen);
    }
    _this__u8e3s4.uch(bgcolor);
    _this__u8e3s4.tch(true);
  }
  function TimedTask(time, continuation, callback) {
    this.ccj_1 = time;
    this.dcj_1 = continuation;
    this.ecj_1 = callback;
    this.fcj_1 = null;
  }
  TimedTask.prototype.gcj = function () {
    return this.ccj_1;
  };
  TimedTask.prototype.o2c = function () {
    return this.dcj_1;
  };
  TimedTask.prototype.v6s = function () {
    return this.ecj_1;
  };
  TimedTask.prototype.hcj = function () {
    return this.fcj_1;
  };
  TimedTask.$metadata$ = classMeta('TimedTask');
  function sam$kotlinx_coroutines_DisposableHandle$0(function_0) {
    this.icj_1 = function_0;
  }
  sam$kotlinx_coroutines_DisposableHandle$0.prototype.s1x = function () {
    return this.icj_1();
  };
  sam$kotlinx_coroutines_DisposableHandle$0.$metadata$ = classMeta('sam$kotlinx_coroutines_DisposableHandle$0', [DisposableHandle]);
  function GameWindowCoroutineDispatcher$timedTasks$lambda(a, b) {
    return TimeSpan__compareTo_impl_zidry4(a.ccj_1, b.ccj_1);
  }
  function GameWindowCoroutineDispatcher$scheduleResumeAfterDelay$lambda($task) {
    return function (it) {
      $task.fcj_1 = it;
      return Unit_getInstance();
    };
  }
  function GameWindowCoroutineDispatcher$invokeOnTimeout$lambda(this$0, $task) {
    return function () {
      var tmp$ret$0;
      // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
      var tmp0_invoke = this$0.eci_1;
      this$0.dci_1.i4q($task);
      tmp$ret$0 = Unit_getInstance();
      return Unit_getInstance();
    };
  }
  function GameWindowCoroutineDispatcher() {
    CoroutineDispatcher.call(this);
    this.cci_1 = new TGenQueue();
    var tmp = this;
    var tmp_0 = Companion_getInstance_10();
    tmp.dci_1 = tmp_0.i4u(false, GameWindowCoroutineDispatcher$timedTasks$lambda, 1, null);
    this.eci_1 = new NonRecursiveLock();
    var tmp_1 = this;
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.milliseconds' call
    tmp$ret$0 = Companion_getInstance_3().o1h(0.0);
    tmp_1.fci_1 = tmp$ret$0;
    var tmp_2 = this;
    var tmp$ret$1;
    // Inline function 'com.soywiz.klock.milliseconds' call
    tmp$ret$1 = Companion_getInstance_3().o1h(0.0);
    tmp_2.gci_1 = tmp$ret$1;
    this.hci_1 = null;
    this.ici_1 = Companion_getInstance_11().h51('Korgw.GameWindow.TooManyCallbacks');
  }
  GameWindowCoroutineDispatcher.prototype.jcj = function () {
    return this.cci_1;
  };
  GameWindowCoroutineDispatcher.prototype.kcj = function () {
    return this.dci_1;
  };
  GameWindowCoroutineDispatcher.prototype.lcj = function () {
    return this.eci_1;
  };
  GameWindowCoroutineDispatcher.prototype.mcj = function (block) {
    if (block == null)
      return Unit_getInstance();
    var tmp$ret$0;
    // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
    var tmp0_invoke = this.eci_1;
    this.cci_1.r4u(block);
    tmp$ret$0 = Unit_getInstance();
  };
  GameWindowCoroutineDispatcher.prototype.q20 = function (context, block) {
    return this.mcj(block);
  };
  GameWindowCoroutineDispatcher.prototype.ncj = function () {
    return PerformanceCounter_getInstance().x1h();
  };
  GameWindowCoroutineDispatcher.prototype.b21 = function (timeMillis, continuation) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.milliseconds' call
    var tmp0__get_milliseconds__kazo1t = timeMillis.cf();
    tmp$ret$0 = Companion_getInstance_3().o1h(tmp0__get_milliseconds__kazo1t);
    this.ocj(tmp$ret$0, continuation);
  };
  GameWindowCoroutineDispatcher.prototype.ocj = function (time, continuation) {
    var task = new TimedTask(TimeSpan__plus_impl_qdd6zo(this.ncj(), time), continuation, null);
    continuation.n1x(GameWindowCoroutineDispatcher$scheduleResumeAfterDelay$lambda(task));
    var tmp$ret$1;
    // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
    var tmp0_invoke = this.eci_1;
    var tmp$ret$0;
    // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.scheduleResumeAfterDelay.<anonymous>' call
    tmp$ret$0 = this.dci_1.h4q(task);
    tmp$ret$1 = tmp$ret$0;
  };
  GameWindowCoroutineDispatcher.prototype.c21 = function (timeMillis, block, context) {
    var tmp = this.ncj();
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.milliseconds' call
    var tmp0__get_milliseconds__kazo1t = timeMillis.cf();
    tmp$ret$0 = Companion_getInstance_3().o1h(tmp0__get_milliseconds__kazo1t);
    var task = new TimedTask(TimeSpan__plus_impl_qdd6zo(tmp, tmp$ret$0), null, block);
    var tmp$ret$2;
    // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
    var tmp1_invoke = this.eci_1;
    var tmp$ret$1;
    // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.invokeOnTimeout.<anonymous>' call
    tmp$ret$1 = this.dci_1.h4q(task);
    tmp$ret$2 = tmp$ret$1;
    var tmp_0 = GameWindowCoroutineDispatcher$invokeOnTimeout$lambda(this, task);
    return new sam$kotlinx_coroutines_DisposableHandle$0(tmp_0);
  };
  GameWindowCoroutineDispatcher.prototype.vci = function (availableTime) {
    try {
      var startTime = this.ncj();
      var processedTimedTasks = 0;
      var processedTasks = 0;
      var tmp = this;
      var tmp$ret$8;
      // Inline function 'com.soywiz.klock.measureTime' call
      var start = PerformanceCounter_getInstance().u1h();
      // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending.<anonymous>' call
      $l$loop_0: while (true) {
        var tmp$ret$2;
        // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
        var tmp0_invoke = this.eci_1;
        var tmp$ret$1;
        // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending.<anonymous>.<anonymous>' call
        var tmp_0;
        var tmp_1;
        var tmp$ret$0;
        // Inline function 'kotlin.collections.isNotEmpty' call
        var tmp0_isNotEmpty = this.dci_1;
        tmp$ret$0 = !tmp0_isNotEmpty.p();
        if (tmp$ret$0) {
          tmp_1 = TimeSpan__compareTo_impl_zidry4(startTime, this.dci_1.d2q().ccj_1) >= 0;
        } else {
          tmp_1 = false;
        }
        if (tmp_1) {
          tmp_0 = this.dci_1.o4u();
        } else {
          tmp_0 = null;
        }
        tmp$ret$1 = tmp_0;
        tmp$ret$2 = tmp$ret$1;
        var tmp0_elvis_lhs = tmp$ret$2;
        var tmp_2;
        if (tmp0_elvis_lhs == null) {
          break $l$loop_0;
        } else {
          tmp_2 = tmp0_elvis_lhs;
        }
        var item = tmp_2;
        try {
          if (!(item.fcj_1 == null)) {
            var tmp1_safe_receiver = item.dcj_1;
            if (tmp1_safe_receiver == null)
              null;
            else {
              var tmp$ret$4;
              // Inline function 'kotlin.coroutines.resumeWithException' call
              var tmp1_resumeWithException = ensureNotNull(item.fcj_1);
              var tmp$ret$3;
              // Inline function 'kotlin.Companion.failure' call
              var tmp0_failure = Companion_getInstance_12();
              tmp$ret$3 = _Result___init__impl__xyqfz8(createFailure(tmp1_resumeWithException));
              tmp1_safe_receiver.n5(tmp$ret$3);
              tmp$ret$4 = Unit_getInstance();
            }
            if (!(item.ecj_1 == null)) {
              var tmp2_safe_receiver = item.fcj_1;
              if (tmp2_safe_receiver == null)
                null;
              else {
                printStackTrace(tmp2_safe_receiver);
              }
            }
          } else {
            var tmp3_safe_receiver = item.dcj_1;
            if (tmp3_safe_receiver == null)
              null;
            else {
              var tmp$ret$6;
              // Inline function 'kotlin.coroutines.resume' call
              var tmp$ret$5;
              // Inline function 'kotlin.Companion.success' call
              var tmp0_success = Companion_getInstance_12();
              tmp$ret$5 = _Result___init__impl__xyqfz8(Unit_getInstance());
              tmp3_safe_receiver.n5(tmp$ret$5);
              tmp$ret$6 = Unit_getInstance();
            }
            var tmp4_safe_receiver = item.ecj_1;
            if (tmp4_safe_receiver == null)
              null;
            else {
              tmp4_safe_receiver.q1z();
            }
          }
        } catch ($p) {
          if ($p instanceof Error) {
            printStackTrace($p);
          } else {
            throw $p;
          }
        }
        finally {
          var tmp5 = processedTimedTasks;
          processedTimedTasks = tmp5 + 1 | 0;
        }
        var elapsedTime = TimeSpan__minus_impl_5w5v8s(this.ncj(), startTime);
        if (TimeSpan__compareTo_impl_zidry4(elapsedTime, availableTime) >= 0) {
          this.pcj(elapsedTime, availableTime, processedTimedTasks, processedTasks);
          break $l$loop_0;
        }
      }
      var end = PerformanceCounter_getInstance().u1h();
      var tmp$ret$7;
      // Inline function 'com.soywiz.klock.microseconds' call
      var tmp0__get_microseconds__mq1imi = end - start;
      tmp$ret$7 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi);
      tmp$ret$8 = tmp$ret$7;
      tmp.fci_1 = tmp$ret$8;
      var tmp_3 = this;
      var tmp$ret$15;
      // Inline function 'com.soywiz.klock.measureTime' call
      var start_0 = PerformanceCounter_getInstance().u1h();
      // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending.<anonymous>' call
      $l$loop_2: while (true) {
        var tmp$ret$11;
        // Inline function 'com.soywiz.kds.lock.NonRecursiveLock.invoke' call
        var tmp0_invoke_0 = this.eci_1;
        var tmp$ret$10;
        // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending.<anonymous>.<anonymous>' call
        var tmp_4;
        var tmp$ret$9;
        // Inline function 'kotlin.collections.isNotEmpty' call
        var tmp0_isNotEmpty_0 = this.cci_1;
        tmp$ret$9 = !tmp0_isNotEmpty_0.p();
        if (tmp$ret$9) {
          tmp_4 = this.cci_1.s4u();
        } else {
          tmp_4 = null;
        }
        tmp$ret$10 = tmp_4;
        tmp$ret$11 = tmp$ret$10;
        var tmp0_elvis_lhs_0 = tmp$ret$11;
        var tmp_5;
        if (tmp0_elvis_lhs_0 == null) {
          break $l$loop_2;
        } else {
          tmp_5 = tmp0_elvis_lhs_0;
        }
        var task = tmp_5;
        var tmp$ret$13;
        // Inline function 'com.soywiz.klock.measureTime' call
        var start_1 = PerformanceCounter_getInstance().u1h();
        // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending.<anonymous>.<anonymous>' call
        try {
          var tmp0_safe_receiver = task;
          if (tmp0_safe_receiver == null)
            null;
          else {
            tmp0_safe_receiver.q1z();
          }
        } catch ($p) {
          if ($p instanceof Error) {
            printStackTrace($p);
          } else {
            throw $p;
          }
        }
        finally {
          var tmp1 = processedTasks;
          processedTasks = tmp1 + 1 | 0;
        }
        var end_0 = PerformanceCounter_getInstance().u1h();
        var tmp$ret$12;
        // Inline function 'com.soywiz.klock.microseconds' call
        var tmp0__get_microseconds__mq1imi_0 = end_0 - start_1;
        tmp$ret$12 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi_0);
        tmp$ret$13 = tmp$ret$12;
        var time = tmp$ret$13;
        var elapsed = TimeSpan__minus_impl_5w5v8s(this.ncj(), startTime);
        if (TimeSpan__compareTo_impl_zidry4(elapsed, availableTime) >= 0) {
          this.pcj(elapsed, availableTime, processedTimedTasks, processedTasks);
          break $l$loop_2;
        }
      }
      var end_1 = PerformanceCounter_getInstance().u1h();
      var tmp$ret$14;
      // Inline function 'com.soywiz.klock.microseconds' call
      var tmp0__get_microseconds__mq1imi_1 = end_1 - start_0;
      tmp$ret$14 = Companion_getInstance_3().v1h(tmp0__get_microseconds__mq1imi_1);
      tmp$ret$15 = tmp$ret$14;
      tmp_3.gci_1 = tmp$ret$15;
    } catch ($p) {
      if ($p instanceof Error) {
        println('Error in GameWindowCoroutineDispatcher.executePending:');
        printStackTrace($p);
      } else {
        throw $p;
      }
    }
  };
  GameWindowCoroutineDispatcher.prototype.pcj = function (elapsedTime, availableTime, processedTimedTasks, processedTasks) {
    var tmp$ret$1;
    // Inline function 'com.soywiz.klogger.Logger.warn' call
    var tmp0_warn = this.ici_1;
    var tmp0_log = Level_WARN_getInstance();
    var tmp;
    if (tmp0_warn.s51(tmp0_log)) {
      var tmp$ret$0;
      // Inline function 'com.soywiz.korgw.GameWindowCoroutineDispatcher.informTooManyCallbacksToHandleInThisFrame.<anonymous>' call
      tmp$ret$0 = 'Too many callbacks to handle in this frame elapsedTime=' + new TimeSpan(roundMilliseconds(elapsedTime)) + ', availableTime=' + new TimeSpan(roundMilliseconds(availableTime)) + ' pending timedTasks=' + this.dci_1.l4u_1 + ', tasks=' + this.cci_1.i() + ', processedTimedTasks=' + processedTimedTasks + ', processedTasks=' + processedTasks;
      tmp0_warn.u51(tmp0_log, tmp$ret$0);
      tmp = Unit_getInstance();
    }
    tmp$ret$1 = tmp;
  };
  GameWindowCoroutineDispatcher.prototype.x2c = function () {
    var tmp$ret$0;
    // Inline function 'com.soywiz.klock.seconds' call
    tmp$ret$0 = Companion_getInstance_3().c1i(2.0);
    this.vci(tmp$ret$0);
    println('GameWindowCoroutineDispatcher.close');
    $l$loop: while (true) {
      var tmp$ret$1;
      // Inline function 'kotlin.collections.isNotEmpty' call
      var tmp0_isNotEmpty = this.dci_1;
      tmp$ret$1 = !tmp0_isNotEmpty.p();
      if (!tmp$ret$1) {
        break $l$loop;
      }
      var tmp0_safe_receiver = this.dci_1.o4u().dcj_1;
      if (tmp0_safe_receiver == null)
        null;
      else {
        var tmp$ret$3;
        // Inline function 'kotlin.coroutines.resume' call
        var tmp$ret$2;
        // Inline function 'kotlin.Companion.success' call
        var tmp0_success = Companion_getInstance_12();
        tmp$ret$2 = _Result___init__impl__xyqfz8(Unit_getInstance());
        tmp0_safe_receiver.n5(tmp$ret$2);
        tmp$ret$3 = Unit_getInstance();
      }
    }
    $l$loop_0: while (true) {
      var tmp$ret$4;
      // Inline function 'kotlin.collections.isNotEmpty' call
      var tmp1_isNotEmpty = this.cci_1;
      tmp$ret$4 = !tmp1_isNotEmpty.p();
      if (!tmp$ret$4) {
        break $l$loop_0;
      }
      var tmp1_safe_receiver = this.cci_1.s4u();
      if (tmp1_safe_receiver == null)
        null;
      else {
        tmp1_safe_receiver.q1z();
      }
    }
  };
  GameWindowCoroutineDispatcher.prototype.toString = function () {
    return 'GameWindowCoroutineDispatcher';
  };
  GameWindowCoroutineDispatcher.$metadata$ = classMeta('GameWindowCoroutineDispatcher', [Delay, Closeable], undefined, undefined, undefined, CoroutineDispatcher.prototype);
  function TextClipboardData_init_$Init$(text, contentType, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      contentType = null;
    TextClipboardData.call($this, text, contentType);
    return $this;
  }
  function TextClipboardData_init_$Create$(text, contentType, $mask0, $marker) {
    return TextClipboardData_init_$Init$(text, contentType, $mask0, $marker, Object.create(TextClipboardData.prototype));
  }
  function TextClipboardData(text, contentType) {
    this.qcj_1 = text;
    this.rcj_1 = contentType;
  }
  TextClipboardData.prototype.u67 = function () {
    return this.qcj_1;
  };
  TextClipboardData.prototype.toString = function () {
    return 'TextClipboardData(text=' + this.qcj_1 + ', contentType=' + this.rcj_1 + ')';
  };
  TextClipboardData.prototype.hashCode = function () {
    var result = getStringHashCode(this.qcj_1);
    result = imul(result, 31) + (this.rcj_1 == null ? 0 : getStringHashCode(this.rcj_1)) | 0;
    return result;
  };
  TextClipboardData.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof TextClipboardData))
      return false;
    var tmp0_other_with_cast = other instanceof TextClipboardData ? other : THROW_CCE();
    if (!(this.qcj_1 === tmp0_other_with_cast.qcj_1))
      return false;
    if (!(this.rcj_1 == tmp0_other_with_cast.rcj_1))
      return false;
    return true;
  };
  TextClipboardData.$metadata$ = classMeta('TextClipboardData', [ClipboardData]);
  function ClipboardData() {
  }
  ClipboardData.$metadata$ = interfaceMeta('ClipboardData');
  function GameWindowConfig() {
  }
  GameWindowConfig.$metadata$ = interfaceMeta('GameWindowConfig');
  function fpsCached$factory() {
    return getPropertyCallableRef('fpsCached', 1, KProperty1, function (receiver) {
      return _get_fpsCached__581dty(receiver);
    }, null);
  }
  function continuousRenderMode$factory() {
    return getPropertyCallableRef('continuousRenderMode', 1, KMutableProperty1, function (receiver) {
      return receiver.nci();
    }, function (receiver, value) {
      return receiver.mci(value);
    });
  }
  function continuousRenderMode$factory_0() {
    return getPropertyCallableRef('continuousRenderMode', 1, KMutableProperty1, function (receiver) {
      return receiver.nci();
    }, function (receiver, value) {
      return receiver.mci(value);
    });
  }
  function IntTimedCache(ttl, gen) {
    this.icf_1 = ttl;
    this.jcf_1 = gen;
    this.kcf_1 = Companion_getInstance_8().z1g_1;
    this.lcf_1 = 0;
  }
  IntTimedCache.prototype.x21 = function () {
    var now = Companion_getInstance_8().d1h();
    if (TimeSpan__compareTo_impl_zidry4(DateTime__minus_impl_10njw8(now, this.kcf_1), this.icf_1) > 0) {
      this.kcf_1 = now;
      this.lcf_1 = this.jcf_1();
    }
    return this.lcf_1;
  };
  IntTimedCache.prototype.d9 = function (obj, property) {
    var tmp$ret$0;
    // Inline function 'com.soywiz.korgw.internal.IntTimedCache.get' call
    var now = Companion_getInstance_8().d1h();
    if (TimeSpan__compareTo_impl_zidry4(DateTime__minus_impl_10njw8(now, this.kcf_1), this.icf_1) > 0) {
      this.kcf_1 = now;
      this.lcf_1 = this.jcf_1();
    }
    tmp$ret$0 = this.lcf_1;
    return tmp$ret$0;
  };
  IntTimedCache.$metadata$ = classMeta('IntTimedCache');
  var korgwJvmEngine;
  function UiButton_init_$Init$(app, button, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      button = app.scj_1.ucj();
    UiButton.call($this, app, button);
    return $this;
  }
  function UiButton_init_$Create$(app, button, $mask0, $marker) {
    return UiButton_init_$Init$(app, button, $mask0, $marker, Object.create(UiButton.prototype));
  }
  function UiButton(app, button) {
    UiComponent.call(this, app, button);
    this.cck_1 = button;
    this.dck_1 = icon$factory(this.cck_1);
    this.eck_1 = text$factory(this.cck_1);
  }
  UiButton.prototype.rch = function (_set____db54di) {
    var tmp0_setValue = icon$factory_0();
    return this.dck_1.set(_set____db54di);
  };
  UiButton.prototype.fck = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = icon$factory_1();
    tmp$ret$0 = this.dck_1.get();
    return tmp$ret$0;
  };
  UiButton.prototype.gck = function (_set____db54di) {
    var tmp0_setValue = text$factory_0();
    return this.eck_1.set(_set____db54di);
  };
  UiButton.prototype.u67 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = text$factory_1();
    tmp$ret$0 = this.eck_1.get();
    return tmp$ret$0;
  };
  UiButton.$metadata$ = classMeta('UiButton', undefined, undefined, undefined, undefined, UiComponent.prototype);
  function button(_this__u8e3s4, text, onClick, block) {
    var tmp$ret$3;
    // Inline function 'kotlin.also' call
    var tmp$ret$2;
    // Inline function 'kotlin.also' call
    var tmp$ret$1;
    // Inline function 'kotlin.also' call
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = UiButton_init_$Create$(_this__u8e3s4.hck_1, null, 2, null);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.button.<anonymous>' call
    tmp0_also.gck(text);
    tmp$ret$0 = tmp0_also;
    var tmp1_also = tmp$ret$0;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.button.<anonymous>' call
    tmp1_also.ock(_this__u8e3s4);
    tmp$ret$1 = tmp1_also;
    var tmp2_also = tmp$ret$1;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.button.<anonymous>' call
    if (!(onClick == null)) {
      tmp2_also.tck(button$lambda(onClick, tmp2_also));
    }
    tmp$ret$2 = tmp2_also;
    var tmp3_also = tmp$ret$2;
    // Inline function 'kotlin.contracts.contract' call
    block(tmp3_also);
    tmp$ret$3 = tmp3_also;
    return tmp$ret$3;
  }
  function button$lambda($onClick, $tmp2_also) {
    return function (it) {
      $onClick($tmp2_also, it);
      return Unit_getInstance();
    };
  }
  function icon$factory($b0) {
    return getPropertyCallableRef('icon', 0, KMutableProperty0, function () {
      return $b0.fck();
    }, function (value) {
      return $b0.rch(value);
    });
  }
  function text$factory($b0) {
    return getPropertyCallableRef('text', 0, KMutableProperty0, function () {
      return $b0.u67();
    }, function (value) {
      return $b0.gck(value);
    });
  }
  function icon$factory_0() {
    return getPropertyCallableRef('icon', 1, KMutableProperty1, function (receiver) {
      return receiver.fck();
    }, function (receiver, value) {
      return receiver.rch(value);
    });
  }
  function icon$factory_1() {
    return getPropertyCallableRef('icon', 1, KMutableProperty1, function (receiver) {
      return receiver.fck();
    }, function (receiver, value) {
      return receiver.rch(value);
    });
  }
  function text$factory_0() {
    return getPropertyCallableRef('text', 1, KMutableProperty1, function (receiver) {
      return receiver.u67();
    }, function (receiver, value) {
      return receiver.gck(value);
    });
  }
  function text$factory_1() {
    return getPropertyCallableRef('text', 1, KMutableProperty1, function (receiver) {
      return receiver.u67();
    }, function (receiver, value) {
      return receiver.gck(value);
    });
  }
  function set_uiComponent(_this__u8e3s4, _set____db54di) {
    init_properties_UiComponent_kt_ae9gzv();
    var tmp0_setValue = uiComponent$factory();
    var tmp0_setValueUntransformed = uiComponent$delegate.m4v_1(_this__u8e3s4, _set____db54di);
    var tmp0_elvis_lhs = uiComponent$delegate.k4v_1;
    setExtra(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs, tmp0_setValueUntransformed);
    return Unit_getInstance();
  }
  function get_uiComponent(_this__u8e3s4) {
    init_properties_UiComponent_kt_ae9gzv();
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.PropertyThis.getValue' call
      var tmp0_getValue = uiComponent$factory_0();
      var tmp0_elvis_lhs = uiComponent$delegate.k4v_1;
      var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
      if (res == null) {
        var r = uiComponent$delegate.l4v_1(_this__u8e3s4);
        // Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
        var tmp0_elvis_lhs_0 = uiComponent$delegate.k4v_1;
        setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
        tmp$ret$0 = r;
        break $l$block;
      }
      tmp$ret$0 = res;
    }
    return tmp$ret$0;
  }
  var uiComponent$delegate;
  function UiComponent$onClick$lambda($block) {
    return function (it) {
      if (it.oc5())
        $block(it);
      return Unit_getInstance();
    };
  }
  function UiComponent(app, component) {
    this.hck_1 = app;
    this.ick_1 = component;
    var tmp = this;
    tmp.jck_1 = Mixin_init_$Create$(null, 1, null);
    set_uiComponent(this.ick_1, this);
    this.kck_1 = null;
    this.lck_1 = enabled$factory(this.ick_1);
    this.mck_1 = cursor$factory(this.ick_1);
    this.nck_1 = focusable$factory(this.ick_1);
  }
  UiComponent.prototype.e4v = function (_set____db54di) {
    this.jck_1.e4v(_set____db54di);
  };
  UiComponent.prototype.f4v = function () {
    return this.jck_1.f4v();
  };
  UiComponent.prototype.a5k = function () {
    if (this.e5n() == null) {
      return this instanceof UiContainer ? this : null;
    }
    var tmp0_safe_receiver = this.e5n();
    return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.a5k();
  };
  UiComponent.prototype.ock = function (value) {
    var tmp0_safe_receiver = this.e5n();
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.gcl(this);
    }
    var tmp1_safe_receiver = value;
    if (tmp1_safe_receiver == null)
      null;
    else {
      tmp1_safe_receiver.hcl(this);
    }
  };
  UiComponent.prototype.e5n = function () {
    return this.kck_1;
  };
  UiComponent.prototype.tch = function (value) {
    this.ick_1.tch(value);
    var tmp0_safe_receiver = this.a5k();
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.icl();
    }
  };
  UiComponent.prototype.pck = function () {
    return this.ick_1.pck();
  };
  UiComponent.prototype.qck = function (value) {
    this.ick_1.qck(value);
  };
  UiComponent.prototype.v8b = function () {
    return this.ick_1.v8b();
  };
  UiComponent.prototype.rck = function (_set____db54di) {
    var tmp0_setValue = cursor$factory_0();
    return this.mck_1.set(_set____db54di);
  };
  UiComponent.prototype.jch = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = cursor$factory_1();
    tmp$ret$0 = this.mck_1.get();
    return tmp$ret$0;
  };
  UiComponent.prototype.sck = function (block) {
    return this.ick_1.sck(block);
  };
  UiComponent.prototype.jcl = function (block) {
    return this.ick_1.jcl(block);
  };
  UiComponent.prototype.tck = function (block) {
    return this.sck(UiComponent$onClick$lambda(block));
  };
  UiComponent.prototype.uck = function () {
    return this.ick_1.uck();
  };
  UiComponent.$metadata$ = classMeta('UiComponent', [Extra, LengthExtensions]);
  function uiComponent$delegate$lambda($this$$receiver) {
    init_properties_UiComponent_kt_ae9gzv();
    return null;
  }
  function uiComponent$factory() {
    return getPropertyCallableRef('uiComponent', 1, KMutableProperty1, function (receiver) {
      return get_uiComponent(receiver);
    }, function (receiver, value) {
      return set_uiComponent(receiver, value);
    });
  }
  function uiComponent$factory_0() {
    return getPropertyCallableRef('uiComponent', 1, KMutableProperty1, function (receiver) {
      return get_uiComponent(receiver);
    }, function (receiver, value) {
      return set_uiComponent(receiver, value);
    });
  }
  function enabled$factory($b0) {
    return getPropertyCallableRef('enabled', 0, KMutableProperty0, function () {
      return $b0.kcl();
    }, function (value) {
      return $b0.lcl(value);
    });
  }
  function cursor$factory($b0) {
    return getPropertyCallableRef('cursor', 0, KMutableProperty0, function () {
      return $b0.jch();
    }, function (value) {
      return $b0.rck(value);
    });
  }
  function focusable$factory($b0) {
    return getPropertyCallableRef('focusable', 0, KMutableProperty0, function () {
      return $b0.mcl();
    }, function (value) {
      return $b0.ncl(value);
    });
  }
  function cursor$factory_0() {
    return getPropertyCallableRef('cursor', 1, KMutableProperty1, function (receiver) {
      return receiver.jch();
    }, function (receiver, value) {
      return receiver.rck(value);
    });
  }
  function cursor$factory_1() {
    return getPropertyCallableRef('cursor', 1, KMutableProperty1, function (receiver) {
      return receiver.jch();
    }, function (receiver, value) {
      return receiver.rck(value);
    });
  }
  var properties_initialized_UiComponent_kt_we7715;
  function init_properties_UiComponent_kt_ae9gzv() {
    if (properties_initialized_UiComponent_kt_we7715) {
    } else {
      properties_initialized_UiComponent_kt_we7715 = true;
      uiComponent$delegate = PropertyThis_init_$Create$(null, uiComponent$delegate$lambda, 1, null);
    }
  }
  function UiContainer_init_$Init$(app, container, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      container = app.scj_1.ocl();
    UiContainer.call($this, app, container);
    return $this;
  }
  function UiContainer_init_$Create$(app, container, $mask0, $marker) {
    return UiContainer_init_$Init$(app, container, $mask0, $marker, Object.create(UiContainer.prototype));
  }
  function UiContainer(app, container) {
    UiComponent.call(this, app, container);
    this.ccl_1 = container;
    var tmp = this;
    var tmp$ret$0;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp$ret$0 = ArrayList_init_$Create$();
    tmp.dcl_1 = tmp$ret$0;
    this.ecl_1 = backgroundColor$factory(this.ccl_1);
    this.fcl_1 = VerticalUiLayout_getInstance();
  }
  UiContainer.prototype.pcl = function () {
    return this.dcl_1.i();
  };
  UiContainer.prototype.eb1 = function () {
    return this.fcl_1;
  };
  UiContainer.prototype.qcl = function (available) {
    var tmp0_safe_receiver = this.fcl_1;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.rcl(this, available);
    var tmp;
    var tmp_0 = tmp1_elvis_lhs;
    if ((tmp_0 == null ? null : new SizeInt(tmp_0)) == null) {
      tmp = available;
    } else {
      tmp = tmp1_elvis_lhs;
    }
    return tmp;
  };
  UiContainer.prototype.icl = function () {
    var tmp0_safe_receiver = this.fcl_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.scl(this);
    }
    this.uck();
  };
  UiContainer.prototype.uck = function () {
    UiComponent.prototype.uck.call(this);
    // Inline function 'com.soywiz.korui.UiContainer.forEachChild' call
    var inductionVariable = 0;
    var last = this.pcl();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korui.UiContainer.updateUI.<anonymous>' call
        var tmp0__anonymous__q1qw7t = this.tcl(n);
        tmp0__anonymous__q1qw7t.uck();
      }
       while (inductionVariable < last);
  };
  UiContainer.prototype.qck = function (value) {
    UiComponent.prototype.qck.call(this, value);
    this.icl();
  };
  UiContainer.prototype.v8b = function () {
    return UiComponent.prototype.v8b.call(this);
  };
  UiContainer.prototype.ucl = function (child) {
    return this.dcl_1.y(child);
  };
  UiContainer.prototype.tcl = function (index) {
    return this.dcl_1.m(index);
  };
  UiContainer.prototype.vcl = function (index) {
    this.dcl_1.z4(index);
    this.ccl_1.vcl(index);
  };
  UiContainer.prototype.gcl = function (child) {
    var index = this.ucl(child);
    if (index >= 0) {
      this.vcl(index);
    }
    child.kck_1 = null;
  };
  UiContainer.prototype.wcl = function (index, child) {
    if (!(child.e5n() == null)) {
      var tmp0_safe_receiver = child.e5n();
      if (tmp0_safe_receiver == null)
        null;
      else {
        tmp0_safe_receiver.gcl(child);
      }
    }
    this.ccl_1.xcl(index, child.ick_1);
    var rindex = index < 0 ? (this.pcl() + 1 | 0) + index | 0 : index;
    this.dcl_1.tg(coerceAtLeast(rindex, 0), child);
    child.kck_1 = this;
  };
  UiContainer.prototype.hcl = function (child) {
    return this.wcl(-1, child);
  };
  UiContainer.prototype.ycl = function (block) {
    var inductionVariable = 0;
    var last = this.pcl();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        block(this.tcl(n));
      }
       while (inductionVariable < last);
  };
  UiContainer.prototype.zcl = function (block) {
    var inductionVariable = 0;
    var last = this.pcl();
    var tmp;
    if (inductionVariable < last) {
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korui.UiContainer.forEachVisibleChild.<anonymous>' call
        var tmp0__anonymous__q1qw7t = this.tcl(n);
        if (tmp0__anonymous__q1qw7t.pck())
          block(tmp0__anonymous__q1qw7t);
      }
       while (inductionVariable < last);
      tmp = Unit_getInstance();
    }
    return tmp;
  };
  UiContainer.$metadata$ = classMeta('UiContainer', undefined, undefined, undefined, undefined, UiComponent.prototype);
  function container(_this__u8e3s4, block) {
    var tmp$ret$2;
    // Inline function 'kotlin.also' call
    var tmp$ret$1;
    // Inline function 'kotlin.also' call
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = UiContainer_init_$Create$(_this__u8e3s4.hck_1, null, 2, null);
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.container.<anonymous>' call
    tmp0_also.ock(_this__u8e3s4);
    tmp$ret$0 = tmp0_also;
    var tmp1_also = tmp$ret$0;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.container.<anonymous>' call
    tmp1_also.qck(_this__u8e3s4.v8b());
    tmp$ret$1 = tmp1_also;
    var tmp2_also = tmp$ret$1;
    // Inline function 'kotlin.contracts.contract' call
    block(tmp2_also);
    tmp$ret$2 = tmp2_also;
    return tmp$ret$2;
  }
  function backgroundColor$factory($b0) {
    return getPropertyCallableRef('backgroundColor', 0, KMutableProperty0, function () {
      var tmp = $b0.acm();
      return tmp == null ? null : new RGBA(tmp);
    }, function (value) {
      var tmp = value;
      return $b0.bcm(tmp == null ? null : tmp.n8k_1);
    });
  }
  function UiCursor() {
  }
  UiCursor.$metadata$ = interfaceMeta('UiCursor');
  var UiStandardCursor_DEFAULT_instance;
  var UiStandardCursor_CROSSHAIR_instance;
  var UiStandardCursor_TEXT_instance;
  var UiStandardCursor_HAND_instance;
  var UiStandardCursor_MOVE_instance;
  var UiStandardCursor_WAIT_instance;
  var UiStandardCursor_RESIZE_EAST_instance;
  var UiStandardCursor_RESIZE_WEST_instance;
  var UiStandardCursor_RESIZE_SOUTH_instance;
  var UiStandardCursor_RESIZE_NORTH_instance;
  var UiStandardCursor_RESIZE_NORTH_EAST_instance;
  var UiStandardCursor_RESIZE_NORTH_WEST_instance;
  var UiStandardCursor_RESIZE_SOUTH_EAST_instance;
  var UiStandardCursor_RESIZE_SOUTH_WEST_instance;
  var UiStandardCursor_entriesInitialized;
  function UiStandardCursor_initEntries() {
    if (UiStandardCursor_entriesInitialized)
      return Unit_getInstance();
    UiStandardCursor_entriesInitialized = true;
    UiStandardCursor_DEFAULT_instance = new UiStandardCursor('DEFAULT', 0);
    UiStandardCursor_CROSSHAIR_instance = new UiStandardCursor('CROSSHAIR', 1);
    UiStandardCursor_TEXT_instance = new UiStandardCursor('TEXT', 2);
    UiStandardCursor_HAND_instance = new UiStandardCursor('HAND', 3);
    UiStandardCursor_MOVE_instance = new UiStandardCursor('MOVE', 4);
    UiStandardCursor_WAIT_instance = new UiStandardCursor('WAIT', 5);
    UiStandardCursor_RESIZE_EAST_instance = new UiStandardCursor('RESIZE_EAST', 6);
    UiStandardCursor_RESIZE_WEST_instance = new UiStandardCursor('RESIZE_WEST', 7);
    UiStandardCursor_RESIZE_SOUTH_instance = new UiStandardCursor('RESIZE_SOUTH', 8);
    UiStandardCursor_RESIZE_NORTH_instance = new UiStandardCursor('RESIZE_NORTH', 9);
    UiStandardCursor_RESIZE_NORTH_EAST_instance = new UiStandardCursor('RESIZE_NORTH_EAST', 10);
    UiStandardCursor_RESIZE_NORTH_WEST_instance = new UiStandardCursor('RESIZE_NORTH_WEST', 11);
    UiStandardCursor_RESIZE_SOUTH_EAST_instance = new UiStandardCursor('RESIZE_SOUTH_EAST', 12);
    UiStandardCursor_RESIZE_SOUTH_WEST_instance = new UiStandardCursor('RESIZE_SOUTH_WEST', 13);
  }
  function UiStandardCursor(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  UiStandardCursor.$metadata$ = classMeta('UiStandardCursor', [UiCursor], undefined, undefined, undefined, Enum.prototype);
  function UiStandardCursor_RESIZE_EAST_getInstance() {
    UiStandardCursor_initEntries();
    return UiStandardCursor_RESIZE_EAST_instance;
  }
  function UiLabel_init_$Init$(app, label, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      label = app.scj_1.ccm();
    UiLabel.call($this, app, label);
    return $this;
  }
  function UiLabel_init_$Create$(app, label, $mask0, $marker) {
    return UiLabel_init_$Init$(app, label, $mask0, $marker, Object.create(UiLabel.prototype));
  }
  function UiLabel(app, label) {
    UiComponent.call(this, app, label);
    this.kcm_1 = label;
    this.lcm_1 = text$factory_2(this.kcm_1);
    this.mcm_1 = icon$factory_2(this.kcm_1);
  }
  UiLabel.prototype.gck = function (_set____db54di) {
    var tmp0_setValue = text$factory_3();
    return this.lcm_1.set(_set____db54di);
  };
  UiLabel.prototype.u67 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = text$factory_4();
    tmp$ret$0 = this.lcm_1.get();
    return tmp$ret$0;
  };
  UiLabel.$metadata$ = classMeta('UiLabel', undefined, undefined, undefined, undefined, UiComponent.prototype);
  function text$factory_2($b0) {
    return getPropertyCallableRef('text', 0, KMutableProperty0, function () {
      return $b0.u67();
    }, function (value) {
      return $b0.gck(value);
    });
  }
  function icon$factory_2($b0) {
    return getPropertyCallableRef('icon', 0, KMutableProperty0, function () {
      return $b0.fck();
    }, function (value) {
      return $b0.rch(value);
    });
  }
  function text$factory_3() {
    return getPropertyCallableRef('text', 1, KMutableProperty1, function (receiver) {
      return receiver.u67();
    }, function (receiver, value) {
      return receiver.gck(value);
    });
  }
  function text$factory_4() {
    return getPropertyCallableRef('text', 1, KMutableProperty1, function (receiver) {
      return receiver.u67();
    }, function (receiver, value) {
      return receiver.gck(value);
    });
  }
  function UiTextField_init_$Init$(app, textField, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0))
      textField = app.scj_1.ocm();
    UiTextField.call($this, app, textField);
    return $this;
  }
  function UiTextField_init_$Create$(app, textField, $mask0, $marker) {
    return UiTextField_init_$Init$(app, textField, $mask0, $marker, Object.create(UiTextField.prototype));
  }
  function UiTextField(app, textField) {
    UiComponent.call(this, app, textField);
    this.wcm_1 = textField;
    this.xcm_1 = text$factory_5(this.wcm_1);
  }
  UiTextField.prototype.gck = function (_set____db54di) {
    var tmp0_setValue = text$factory_6();
    return this.xcm_1.set(_set____db54di);
  };
  UiTextField.prototype.u67 = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = text$factory_7();
    tmp$ret$0 = this.xcm_1.get();
    return tmp$ret$0;
  };
  UiTextField.prototype.ycm = function (range) {
    return this.wcm_1.ycm(range);
  };
  UiTextField.prototype.zcm = function (range, $mask0, $handler) {
    if (!(($mask0 & 1) === 0))
      range = until(0, IntCompanionObject_getInstance().o1_1);
    return this.ycm(range);
  };
  UiTextField.prototype.acn = function () {
    return this.wcm_1.acn();
  };
  UiTextField.prototype.bcn = function (block) {
    return this.wcm_1.bcn(block);
  };
  UiTextField.$metadata$ = classMeta('UiTextField', undefined, undefined, undefined, undefined, UiComponent.prototype);
  function text$factory_5($b0) {
    return getPropertyCallableRef('text', 0, KMutableProperty0, function () {
      return $b0.u67();
    }, function (value) {
      return $b0.gck(value);
    });
  }
  function text$factory_6() {
    return getPropertyCallableRef('text', 1, KMutableProperty1, function (receiver) {
      return receiver.u67();
    }, function (receiver, value) {
      return receiver.gck(value);
    });
  }
  function text$factory_7() {
    return getPropertyCallableRef('text', 1, KMutableProperty1, function (receiver) {
      return receiver.u67();
    }, function (receiver, value) {
      return receiver.gck(value);
    });
  }
  function set_layoutChildrenPadding(_this__u8e3s4, _set____db54di) {
    init_properties_Layout_kt_lp2900();
    var tmp0_setValue = layoutChildrenPadding$factory();
    var tmp0_elvis_lhs = layoutChildrenPadding$delegate.g4v_1;
    var tmp = tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs;
    var tmp$ret$2;
    // Inline function 'com.soywiz.kds.fastCastTo' call
    var tmp$ret$1;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = _set____db54di;
    tmp$ret$1 = tmp$ret$0;
    tmp$ret$2 = tmp$ret$1;
    return setExtra(_this__u8e3s4, tmp, tmp$ret$2);
  }
  function get_layoutChildrenPadding(_this__u8e3s4) {
    init_properties_Layout_kt_lp2900();
    var tmp$ret$8;
    $l$block: {
      // Inline function 'com.soywiz.kds.Property.getValue' call
      var tmp0_getValue = layoutChildrenPadding$factory_0();
      var tmp$ret$4;
      // Inline function 'com.soywiz.kds.fastCastTo' call
      var tmp1_safe_receiver = _this__u8e3s4.f4v();
      var tmp;
      if (tmp1_safe_receiver == null) {
        tmp = null;
      } else {
        var tmp$ret$1;
        // Inline function 'com.soywiz.kds.get' call
        var tmp0_elvis_lhs = layoutChildrenPadding$delegate.g4v_1;
        var tmp0_get = tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs;
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp1_safe_receiver;
        tmp$ret$1 = tmp$ret$0.get(tmp0_get);
        tmp = tmp$ret$1;
      }
      var tmp1_fastCastTo = tmp;
      var tmp$ret$3;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$2;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$2 = tmp1_fastCastTo;
      tmp$ret$3 = tmp$ret$2;
      tmp$ret$4 = tmp$ret$3;
      var res = tmp$ret$4;
      if (res == null) {
        var r = layoutChildrenPadding$delegate.h4v_1();
        var tmp_0;
        if (!(r == null)) {
          tmp_0 = true;
        } else {
          var tmp2_elvis_lhs = layoutChildrenPadding$delegate.g4v_1;
          tmp_0 = hasExtra(_this__u8e3s4, tmp2_elvis_lhs == null ? tmp0_getValue.callableName : tmp2_elvis_lhs);
        }
        if (tmp_0) {
          // Inline function 'com.soywiz.kds.Property.setValue' call
          var tmp0_elvis_lhs_0 = layoutChildrenPadding$delegate.g4v_1;
          var tmp_1 = tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0;
          var tmp$ret$7;
          // Inline function 'com.soywiz.kds.fastCastTo' call
          var tmp$ret$6;
          // Inline function 'kotlin.js.unsafeCast' call
          var tmp$ret$5;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$5 = r;
          tmp$ret$6 = tmp$ret$5;
          tmp$ret$7 = tmp$ret$6;
          setExtra(_this__u8e3s4, tmp_1, tmp$ret$7);
        }
        tmp$ret$8 = r;
        break $l$block;
      }
      tmp$ret$8 = res;
    }
    return tmp$ret$8;
  }
  var layoutChildrenPadding$delegate;
  var DEFAULT_WIDTH;
  var DEFAULT_HEIGHT;
  function set_preferredSize(_this__u8e3s4, _set____db54di) {
    init_properties_Layout_kt_lp2900();
    var tmp0_setValue = preferredSize$factory();
    var tmp0_setValueUntransformed = preferredSize$delegate.m4v_1(_this__u8e3s4, _set____db54di);
    var tmp0_elvis_lhs = preferredSize$delegate.k4v_1;
    setExtra(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs, tmp0_setValueUntransformed);
    return Unit_getInstance();
  }
  function get_preferredSize(_this__u8e3s4) {
    init_properties_Layout_kt_lp2900();
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.PropertyThis.getValue' call
      var tmp0_getValue = preferredSize$factory_0();
      var tmp0_elvis_lhs = preferredSize$delegate.k4v_1;
      var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
      if (res == null) {
        var r = preferredSize$delegate.l4v_1(_this__u8e3s4);
        // Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
        var tmp0_elvis_lhs_0 = preferredSize$delegate.k4v_1;
        setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
        tmp$ret$0 = r;
        break $l$block;
      }
      tmp$ret$0 = res;
    }
    return tmp$ret$0;
  }
  var preferredSize$delegate;
  function set_minimumSize(_this__u8e3s4, _set____db54di) {
    init_properties_Layout_kt_lp2900();
    var tmp0_setValue = minimumSize$factory();
    var tmp0_setValueUntransformed = minimumSize$delegate.m4v_1(_this__u8e3s4, _set____db54di);
    var tmp0_elvis_lhs = minimumSize$delegate.k4v_1;
    setExtra(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs, tmp0_setValueUntransformed);
    return Unit_getInstance();
  }
  function get_minimumSize(_this__u8e3s4) {
    init_properties_Layout_kt_lp2900();
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.PropertyThis.getValue' call
      var tmp0_getValue = minimumSize$factory_0();
      var tmp0_elvis_lhs = minimumSize$delegate.k4v_1;
      var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
      if (res == null) {
        var r = minimumSize$delegate.l4v_1(_this__u8e3s4);
        // Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
        var tmp0_elvis_lhs_0 = minimumSize$delegate.k4v_1;
        setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
        tmp$ret$0 = r;
        break $l$block;
      }
      tmp$ret$0 = res;
    }
    return tmp$ret$0;
  }
  var minimumSize$delegate;
  function set_maximumSize(_this__u8e3s4, _set____db54di) {
    init_properties_Layout_kt_lp2900();
    var tmp0_setValue = maximumSize$factory();
    var tmp0_setValueUntransformed = maximumSize$delegate.m4v_1(_this__u8e3s4, _set____db54di);
    var tmp0_elvis_lhs = maximumSize$delegate.k4v_1;
    setExtra(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs, tmp0_setValueUntransformed);
    return Unit_getInstance();
  }
  function get_maximumSize(_this__u8e3s4) {
    init_properties_Layout_kt_lp2900();
    var tmp$ret$0;
    $l$block: {
      // Inline function 'com.soywiz.kds.PropertyThis.getValue' call
      var tmp0_getValue = maximumSize$factory_0();
      var tmp0_elvis_lhs = maximumSize$delegate.k4v_1;
      var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
      if (res == null) {
        var r = maximumSize$delegate.l4v_1(_this__u8e3s4);
        // Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
        var tmp0_elvis_lhs_0 = maximumSize$delegate.k4v_1;
        setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
        tmp$ret$0 = r;
        break $l$block;
      }
      tmp$ret$0 = res;
    }
    return tmp$ret$0;
  }
  var maximumSize$delegate;
  function UiLayout() {
  }
  UiLayout.$metadata$ = interfaceMeta('UiLayout');
  function VerticalUiLayout() {
    VerticalUiLayout_instance = this;
    LineUiLayout.call(this, LayoutDirection_VERTICAL_getInstance());
  }
  VerticalUiLayout.$metadata$ = objectMeta('VerticalUiLayout', undefined, undefined, undefined, undefined, LineUiLayout.prototype);
  var VerticalUiLayout_instance;
  function VerticalUiLayout_getInstance() {
    if (VerticalUiLayout_instance == null)
      new VerticalUiLayout();
    return VerticalUiLayout_instance;
  }
  function LineUiLayout(direction) {
    this.ccn_1 = direction;
    this.dcn_1 = this.ecn().icn();
  }
  LineUiLayout.prototype.ecn = function () {
    return this.ccn_1;
  };
  LineUiLayout.prototype.fcn = function () {
    return this.dcn_1;
  };
  LineUiLayout.prototype.rcl = function (container, available) {
    var sum = 0;
    var max = 0;
    var ctx = new LayoutContext(available);
    var padding = get_layoutChildrenPadding(container);
    var tmp$ret$1;
    // Inline function 'com.soywiz.korui.UiContainer.forEachVisibleChild' call
    var inductionVariable = 0;
    var last = container.pcl();
    var tmp;
    if (inductionVariable < last) {
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korui.UiContainer.forEachVisibleChild.<anonymous>' call
        var tmp0__anonymous__q1qw7t = container.tcl(n);
        if (tmp0__anonymous__q1qw7t.pck()) {
          // Inline function 'com.soywiz.korui.layout.LineUiLayout.computePreferredSize.<anonymous>' call
          var size = ctx.mcn(tmp0__anonymous__q1qw7t);
          var main = getDirection(size, this.ecn());
          var rev = getDirection(size, this.dcn_1);
          sum = sum + (main + padding | 0) | 0;
          var tmp$ret$0;
          // Inline function 'kotlin.math.max' call
          var tmp0_max = max;
          tmp$ret$0 = Math.max(tmp0_max, rev);
          max = tmp$ret$0;
        }
      }
       while (inductionVariable < last);
      tmp = Unit_getInstance();
    }
    tmp$ret$1 = tmp;
    return Companion_getInstance_13().y7d(this.ecn().ncn() ? sum : max, this.ecn().ocn() ? sum : max);
  };
  LineUiLayout.prototype.scl = function (container) {
    var bounds = container.v8b();
    var ctx = new LayoutContext(get_size(bounds));
    var padding = get_layoutChildrenPadding(container);
    var padding2 = imul(padding, 2);
    var sum = 0;
    var cur = padding;
    var tmp$ret$0;
    // Inline function 'com.soywiz.korui.UiContainer.forEachVisibleChild' call
    var inductionVariable = 0;
    var last = container.pcl();
    var tmp;
    if (inductionVariable < last) {
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korui.UiContainer.forEachVisibleChild.<anonymous>' call
        var tmp0__anonymous__q1qw7t = container.tcl(n);
        if (tmp0__anonymous__q1qw7t.pck()) {
          // Inline function 'com.soywiz.korui.layout.LineUiLayout.relayout.<anonymous>' call
          var size = ctx.mcn(tmp0__anonymous__q1qw7t);
          var value = getDirection(size, this.ecn());
          var tmp0_subject = this.ecn();
          var tmp0 = tmp0_subject.q2_1;
          var tmp_0;
          switch (tmp0) {
            case 0:
              tmp_0 = Companion_getInstance_2().g7d(0, cur, _RectangleInt___get_width__impl__gtay8w(bounds), value);
              break;
            case 1:
              tmp_0 = Companion_getInstance_2().g7d(cur, 0, value, _RectangleInt___get_height__impl__gd473j(bounds));
              break;
            default:
              noWhenBranchMatchedException();
              break;
          }
          var childBounds = tmp_0;
          tmp0__anonymous__q1qw7t.qck(childBounds);
          if (tmp0__anonymous__q1qw7t instanceof UiContainer) {
            var tmp1_safe_receiver = tmp0__anonymous__q1qw7t.fcl_1;
            if (tmp1_safe_receiver == null)
              null;
            else {
              tmp1_safe_receiver.scl(tmp0__anonymous__q1qw7t);
            }
          }
          sum = sum + value | 0;
          cur = cur + (value + padding | 0) | 0;
        }
      }
       while (inductionVariable < last);
      tmp = Unit_getInstance();
    }
    tmp$ret$0 = tmp;
  };
  LineUiLayout.$metadata$ = classMeta('LineUiLayout', [UiLayout, LengthExtensions]);
  var LayoutDirection_VERTICAL_instance;
  var LayoutDirection_HORIZONTAL_instance;
  var LayoutDirection_entriesInitialized;
  function LayoutDirection_initEntries() {
    if (LayoutDirection_entriesInitialized)
      return Unit_getInstance();
    LayoutDirection_entriesInitialized = true;
    LayoutDirection_VERTICAL_instance = new LayoutDirection('VERTICAL', 0);
    LayoutDirection_HORIZONTAL_instance = new LayoutDirection('HORIZONTAL', 1);
  }
  function LayoutDirection(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  LayoutDirection.prototype.icn = function () {
    return this.ocn() ? LayoutDirection_HORIZONTAL_getInstance() : LayoutDirection_VERTICAL_getInstance();
  };
  LayoutDirection.prototype.ocn = function () {
    return this.equals(LayoutDirection_VERTICAL_getInstance());
  };
  LayoutDirection.prototype.ncn = function () {
    return this.equals(LayoutDirection_HORIZONTAL_getInstance());
  };
  LayoutDirection.$metadata$ = classMeta('LayoutDirection', undefined, undefined, undefined, undefined, Enum.prototype);
  function LayoutContext(available) {
    this.jcn_1 = available;
    var tmp = this;
    var tmp$ret$0;
    // Inline function 'kotlin.also' call
    var tmp0_also = new Context();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.layout.LayoutContext.widthContext.<anonymous>' call
    tmp0_also.l4n(_SizeInt___get_width__impl__swntg6(this.jcn_1));
    tmp$ret$0 = tmp0_also;
    tmp.kcn_1 = tmp$ret$0;
    var tmp_0 = this;
    var tmp$ret$1;
    // Inline function 'kotlin.also' call
    var tmp0_also_0 = new Context();
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korui.layout.LayoutContext.heightContext.<anonymous>' call
    tmp0_also_0.l4n(_SizeInt___get_height__impl__d3sy61(this.jcn_1));
    tmp$ret$1 = tmp0_also_0;
    tmp_0.lcn_1 = tmp$ret$1;
  }
  LayoutContext.prototype.ucn = function () {
    return this.jcn_1;
  };
  LayoutContext.prototype.mcn = function (child) {
    return Companion_getInstance_13().y7d(computeChildSize(this.kcn_1, child, LayoutDirection_HORIZONTAL_getInstance()), computeChildSize(this.lcn_1, child, LayoutDirection_VERTICAL_getInstance()));
  };
  LayoutContext.$metadata$ = classMeta('LayoutContext');
  function getDirection(_this__u8e3s4, direction) {
    init_properties_Layout_kt_lp2900();
    return direction.equals(LayoutDirection_VERTICAL_getInstance()) ? _SizeInt___get_height__impl__d3sy61(_this__u8e3s4) : _SizeInt___get_width__impl__swntg6(_this__u8e3s4);
  }
  function computeChildSize(_this__u8e3s4, child, direction) {
    init_properties_Layout_kt_lp2900();
    var ctx = _this__u8e3s4;
    var preferredSize = get_preferredSize(child);
    var tmp;
    if (!(preferredSize == null)) {
      var tmp_0 = Companion_getInstance_61();
      var tmp_1 = _this__u8e3s4.vcn(32);
      var tmp_2 = getDirection_0(preferredSize, direction);
      var tmp_3 = getDirection_0(get_minimumSize(child), direction);
      var tmp_4 = getDirection_0(get_maximumSize(child), direction);
      tmp = tmp_0.xcn(ctx, tmp_1, tmp_2, tmp_3, tmp_4, false, 32, null);
    } else {
      if (child instanceof UiContainer) {
        tmp = getDirection(child.qcl(Companion_getInstance_13().y7d(32, 32)), direction);
      } else {
        var tmp0_subject = direction;
        var tmp0 = tmp0_subject.q2_1;
        var tmp_5;
        switch (tmp0) {
          case 1:
            tmp_5 = 128;
            break;
          case 0:
            tmp_5 = 32;
            break;
          default:
            noWhenBranchMatchedException();
            break;
        }
        tmp = tmp_5;
      }
    }
    return tmp;
  }
  function getDirection_0(_this__u8e3s4, direction) {
    init_properties_Layout_kt_lp2900();
    return direction.equals(LayoutDirection_VERTICAL_getInstance()) ? _this__u8e3s4.zcn_1 : _this__u8e3s4.ycn_1;
  }
  function set_preferredWidth(_this__u8e3s4, value) {
    init_properties_Layout_kt_lp2900();
    var tmp0_safe_receiver = get_preferredSize(_this__u8e3s4);
    set_preferredSize(_this__u8e3s4, new Size(value, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.zcn_1));
  }
  function HorizontalUiLayout() {
    HorizontalUiLayout_instance = this;
    LineUiLayout.call(this, LayoutDirection_HORIZONTAL_getInstance());
  }
  HorizontalUiLayout.$metadata$ = objectMeta('HorizontalUiLayout', undefined, undefined, undefined, undefined, LineUiLayout.prototype);
  var HorizontalUiLayout_instance;
  function HorizontalUiLayout_getInstance() {
    if (HorizontalUiLayout_instance == null)
      new HorizontalUiLayout();
    return HorizontalUiLayout_instance;
  }
  function preferredSize(_this__u8e3s4, width, height) {
    init_properties_Layout_kt_lp2900();
    set_preferredSize(_this__u8e3s4, new Size(width, height));
  }
  function UiFillLayout() {
    UiFillLayout_instance = this;
  }
  UiFillLayout.prototype.rcl = function (container, available) {
    return SizeInt__clone_impl_5edshq(available);
  };
  UiFillLayout.prototype.scl = function (container) {
    var bounds = container.v8b();
    var padding = get_layoutChildrenPadding(container);
    // Inline function 'com.soywiz.korui.UiContainer.forEachChild' call
    var inductionVariable = 0;
    var last = container.pcl();
    if (inductionVariable < last)
      do {
        var n = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.korui.layout.UiFillLayout.relayout.<anonymous>' call
        var tmp0__anonymous__q1qw7t = container.tcl(n);
        tmp0__anonymous__q1qw7t.qck(Companion_getInstance_2().i7d(padding, padding, _RectangleInt___get_width__impl__gtay8w(bounds) - padding | 0, _RectangleInt___get_height__impl__gd473j(bounds) - padding | 0));
      }
       while (inductionVariable < last);
  };
  UiFillLayout.$metadata$ = objectMeta('UiFillLayout', [UiLayout]);
  var UiFillLayout_instance;
  function UiFillLayout_getInstance() {
    if (UiFillLayout_instance == null)
      new UiFillLayout();
    return UiFillLayout_instance;
  }
  function layoutChildrenPadding$delegate$lambda() {
    init_properties_Layout_kt_lp2900();
    return 0;
  }
  function preferredSize$delegate$lambda($this$$receiver) {
    init_properties_Layout_kt_lp2900();
    return null;
  }
  function minimumSize$delegate$lambda($this$$receiver) {
    init_properties_Layout_kt_lp2900();
    return new Size(null, null);
  }
  function maximumSize$delegate$lambda($this$$receiver) {
    init_properties_Layout_kt_lp2900();
    return new Size(null, null);
  }
  function LayoutDirection_VERTICAL_getInstance() {
    LayoutDirection_initEntries();
    return LayoutDirection_VERTICAL_instance;
  }
  function LayoutDirection_HORIZONTAL_getInstance() {
    LayoutDirection_initEntries();
    return LayoutDirection_HORIZONTAL_instance;
  }
  function layoutChildrenPadding$factory() {
    return getPropertyCallableRef('layoutChildrenPadding', 1, KMutableProperty1, function (receiver) {
      return get_layoutChildrenPadding(receiver);
    }, function (receiver, value) {
      return set_layoutChildrenPadding(receiver, value);
    });
  }
  function layoutChildrenPadding$factory_0() {
    return getPropertyCallableRef('layoutChildrenPadding', 1, KMutableProperty1, function (receiver) {
      return get_layoutChildrenPadding(receiver);
    }, function (receiver, value) {
      return set_layoutChildrenPadding(receiver, value);
    });
  }
  function preferredSize$factory() {
    return getPropertyCallableRef('preferredSize', 1, KMutableProperty1, function (receiver) {
      return get_preferredSize(receiver);
    }, function (receiver, value) {
      return set_preferredSize(receiver, value);
    });
  }
  function preferredSize$factory_0() {
    return getPropertyCallableRef('preferredSize', 1, KMutableProperty1, function (receiver) {
      return get_preferredSize(receiver);
    }, function (receiver, value) {
      return set_preferredSize(receiver, value);
    });
  }
  function minimumSize$factory() {
    return getPropertyCallableRef('minimumSize', 1, KMutableProperty1, function (receiver) {
      return get_minimumSize(receiver);
    }, function (receiver, value) {
      return set_minimumSize(receiver, value);
    });
  }
  function minimumSize$factory_0() {
    return getPropertyCallableRef('minimumSize', 1, KMutableProperty1, function (receiver) {
      return get_minimumSize(receiver);
    }, function (receiver, value) {
      return set_minimumSize(receiver, value);
    });
  }
  function maximumSize$factory() {
    return getPropertyCallableRef('maximumSize', 1, KMutableProperty1, function (receiver) {
      return get_maximumSize(receiver);
    }, function (receiver, value) {
      return set_maximumSize(receiver, value);
    });
  }
  function maximumSize$factory_0() {
    return getPropertyCallableRef('maximumSize', 1, KMutableProperty1, function (receiver) {
      return get_maximumSize(receiver);
    }, function (receiver, value) {
      return set_maximumSize(receiver, value);
    });
  }
  var properties_initialized_Layout_kt_df1tzo;
  function init_properties_Layout_kt_lp2900() {
    if (properties_initialized_Layout_kt_df1tzo) {
    } else {
      properties_initialized_Layout_kt_df1tzo = true;
      layoutChildrenPadding$delegate = Property_init_$Create$(null, layoutChildrenPadding$delegate$lambda, 1, null);
      DEFAULT_WIDTH = new PT(128.0);
      DEFAULT_HEIGHT = new PT(32.0);
      preferredSize$delegate = PropertyThis_init_$Create$(null, preferredSize$delegate$lambda, 1, null);
      minimumSize$delegate = PropertyThis_init_$Create$(null, minimumSize$delegate$lambda, 1, null);
      maximumSize$delegate = PropertyThis_init_$Create$(null, maximumSize$delegate$lambda, 1, null);
    }
  }
  function LengthExtensions() {
  }
  LengthExtensions.$metadata$ = interfaceMeta('LengthExtensions');
  function Fixed() {
    Length.call(this);
  }
  Fixed.$metadata$ = classMeta('Fixed', undefined, undefined, undefined, undefined, Length.prototype);
  function Variable_0() {
    Length.call(this);
  }
  Variable_0.$metadata$ = classMeta('Variable', undefined, undefined, undefined, undefined, Length.prototype);
  function LengthContext() {
  }
  LengthContext.$metadata$ = interfaceMeta('LengthContext');
  function Context() {
    this.pcn_1 = 16.0;
    this.qcn_1 = 640.0;
    this.rcn_1 = 480.0;
    this.scn_1 = 100;
    this.tcn_1 = 96.0;
  }
  Context.prototype.l4n = function (_set____db54di) {
    this.scn_1 = _set____db54di;
  };
  Context.prototype.i = function () {
    return this.scn_1;
  };
  Context.prototype.cco = function () {
    return this.tcn_1;
  };
  Context.$metadata$ = classMeta('Context', [LengthContext, LengthExtensions]);
  function PT(v) {
    Fixed.call(this);
    this.eco_1 = v;
  }
  PT.prototype.aco = function (ctx) {
    return numberToInt(this.eco_1 * ctx.dco());
  };
  PT.prototype.toString = function () {
    return '' + this.eco_1 + 'pt';
  };
  PT.prototype.hashCode = function () {
    return getNumberHashCode(this.eco_1);
  };
  PT.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof PT))
      return false;
    var tmp0_other_with_cast = other instanceof PT ? other : THROW_CCE();
    if (!equals(this.eco_1, tmp0_other_with_cast.eco_1))
      return false;
    return true;
  };
  PT.$metadata$ = classMeta('PT', undefined, undefined, undefined, undefined, Fixed.prototype);
  function Ratio(ratio) {
    Variable_0.call(this);
    this.fco_1 = ratio;
  }
  Ratio.prototype.aco = function (ctx) {
    return numberToInt(this.fco_1 * ctx.i());
  };
  Ratio.prototype.toString = function () {
    return '' + this.fco_1 * 100 + '%';
  };
  Ratio.prototype.hashCode = function () {
    return getNumberHashCode(this.fco_1);
  };
  Ratio.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Ratio))
      return false;
    var tmp0_other_with_cast = other instanceof Ratio ? other : THROW_CCE();
    if (!equals(this.fco_1, tmp0_other_with_cast.fco_1))
      return false;
    return true;
  };
  Ratio.$metadata$ = classMeta('Ratio', undefined, undefined, undefined, undefined, Variable_0.prototype);
  function Binop_0(a, b, op, act) {
    Length.call(this);
    this.gco_1 = a;
    this.hco_1 = b;
    this.ico_1 = op;
    this.jco_1 = act;
  }
  Binop_0.prototype.aco = function (ctx) {
    return this.jco_1(this.gco_1.aco(ctx), this.hco_1.aco(ctx));
  };
  Binop_0.prototype.toString = function () {
    return '(' + this.gco_1 + ' ' + this.ico_1 + ' ' + this.hco_1 + ')';
  };
  Binop_0.prototype.hashCode = function () {
    var result = hashCode(this.gco_1);
    result = imul(result, 31) + hashCode(this.hco_1) | 0;
    result = imul(result, 31) + getStringHashCode(this.ico_1) | 0;
    result = imul(result, 31) + hashCode(this.jco_1) | 0;
    return result;
  };
  Binop_0.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Binop_0))
      return false;
    var tmp0_other_with_cast = other instanceof Binop_0 ? other : THROW_CCE();
    if (!equals(this.gco_1, tmp0_other_with_cast.gco_1))
      return false;
    if (!equals(this.hco_1, tmp0_other_with_cast.hco_1))
      return false;
    if (!(this.ico_1 === tmp0_other_with_cast.ico_1))
      return false;
    if (!equals(this.jco_1, tmp0_other_with_cast.jco_1))
      return false;
    return true;
  };
  Binop_0.$metadata$ = classMeta('Binop', undefined, undefined, undefined, undefined, Length.prototype);
  function Companion_46() {
    Companion_instance_46 = this;
    this.wcn_1 = new PT(0.0);
  }
  Companion_46.prototype.kco = function (ctx, default_0, size, min, max, ignoreBounds) {
    var tmp0_elvis_lhs = size;
    var sizeCalc = (tmp0_elvis_lhs == null ? default_0 : tmp0_elvis_lhs).aco(ctx);
    var minCalc = calcMin(min, ctx, ignoreBounds ? IntCompanionObject_getInstance().n1_1 : 0);
    var maxCalc = calcMax(max, ctx, ignoreBounds ? IntCompanionObject_getInstance().o1_1 : ctx.i());
    return clamp(sizeCalc, minCalc, maxCalc);
  };
  Companion_46.prototype.xcn = function (ctx, default_0, size, min, max, ignoreBounds, $mask0, $handler) {
    if (!(($mask0 & 8) === 0))
      min = null;
    if (!(($mask0 & 16) === 0))
      max = null;
    if (!(($mask0 & 32) === 0))
      ignoreBounds = false;
    return this.kco(ctx, default_0, size, min, max, ignoreBounds);
  };
  Companion_46.$metadata$ = objectMeta('Companion');
  var Companion_instance_46;
  function Companion_getInstance_61() {
    if (Companion_instance_46 == null)
      new Companion_46();
    return Companion_instance_46;
  }
  function Length$minus$lambda(a, b) {
    return a - b | 0;
  }
  function Length() {
    Companion_getInstance_61();
  }
  Length.prototype.bco = function (that) {
    return new Binop_0(this, that, '-', Length$minus$lambda);
  };
  Length.$metadata$ = classMeta('Length');
  function Size(width, height) {
    this.ycn_1 = width;
    this.zcn_1 = height;
  }
  Size.prototype.toString = function () {
    return 'Size(width=' + this.ycn_1 + ', height=' + this.zcn_1 + ')';
  };
  Size.prototype.hashCode = function () {
    var result = this.ycn_1 == null ? 0 : hashCode(this.ycn_1);
    result = imul(result, 31) + (this.zcn_1 == null ? 0 : hashCode(this.zcn_1)) | 0;
    return result;
  };
  Size.prototype.equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof Size))
      return false;
    var tmp0_other_with_cast = other instanceof Size ? other : THROW_CCE();
    if (!equals(this.ycn_1, tmp0_other_with_cast.ycn_1))
      return false;
    if (!equals(this.zcn_1, tmp0_other_with_cast.zcn_1))
      return false;
    return true;
  };
  Size.$metadata$ = classMeta('Size');
  function calcMax(_this__u8e3s4, ctx, default_0) {
    var tmp0_safe_receiver = _this__u8e3s4;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.aco(ctx);
    return tmp1_elvis_lhs == null ? default_0 : tmp1_elvis_lhs;
  }
  function calcMin(_this__u8e3s4, ctx, default_0) {
    var tmp0_safe_receiver = _this__u8e3s4;
    var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.aco(ctx);
    return tmp1_elvis_lhs == null ? default_0 : tmp1_elvis_lhs;
  }
  function NativeUiFactory$NativeComponent$onMouseEvent$lambda() {
    return Unit_getInstance();
  }
  function NativeUiFactory$NativeComponent$onFocus$lambda() {
    return Unit_getInstance();
  }
  function NativeUiFactory$NativeTextField$onKeyEvent$lambda() {
    return Unit_getInstance();
  }
  function alloc(_this__u8e3s4, $this) {
    if (_this__u8e3s4 === null)
      return 0;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = _this__u8e3s4;
    if (tmp$ret$0.id === undefined) {
      if ($this.uco_1.p()) {
        // Inline function 'kotlin.error' call
        throw IllegalStateException_init_$Create$('KmlGlJsCanvas.freeList is empty. (Probably allocating lots of OpenGL objects without releasing them)');
      }
      var index = $this.uco_1.z4($this.uco_1.i() - 1 | 0);
      $this.tco_1[index] = _this__u8e3s4;
      var tmp$ret$1;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$1 = _this__u8e3s4;
      tmp$ret$1.id = index;
    }
    var tmp$ret$3;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp$ret$2;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$2 = _this__u8e3s4;
    var tmp0_unsafeCast = tmp$ret$2.id;
    tmp$ret$3 = tmp0_unsafeCast;
    return tmp$ret$3;
  }
  function get_2(_this__u8e3s4, $this) {
    var tmp;
    if (!(_this__u8e3s4 === 0)) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp0_unsafeCast = $this.tco_1[_this__u8e3s4];
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = tmp0_unsafeCast;
      tmp$ret$1 = tmp$ret$0;
      tmp = tmp$ret$1;
    } else {
      tmp = null;
    }
    return tmp;
  }
  function free(_this__u8e3s4, $this) {
    var tmp;
    if (!(_this__u8e3s4 === 0)) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp0_unsafeCast = $this.tco_1[_this__u8e3s4];
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = tmp0_unsafeCast;
      tmp$ret$1 = tmp$ret$0;
      var out = tmp$ret$1;
      var tmp0_this = $this;
      // Inline function 'kotlin.collections.plusAssign' call
      var tmp1_plusAssign = tmp0_this.uco_1;
      tmp1_plusAssign.c(_this__u8e3s4);
      $this.tco_1[_this__u8e3s4] = null;
      tmp = out;
    } else {
      tmp = null;
    }
    return tmp;
  }
  function sliceIfRequired(_this__u8e3s4, $this, count) {
    var tmp;
    var tmp$ret$1;
    // Inline function 'com.soywiz.kmem.size' call
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = _this__u8e3s4;
    tmp$ret$1 = tmp$ret$0.length;
    if (tmp$ret$1 === count) {
      tmp = _this__u8e3s4;
    } else {
      tmp = new Float32Array(_this__u8e3s4.buffer, 0, count);
    }
    return tmp;
  }
  function KmlGlJsCanvas$extensions$delegate$lambda(this$0) {
    return function () {
      var tmp0_elvis_lhs = this$0.sco_1.getSupportedExtensions();
      var tmp;
      if (tmp0_elvis_lhs == null) {
        var tmp$ret$2;
        // Inline function 'kotlin.arrayOf' call
        var tmp$ret$1;
        // Inline function 'kotlin.js.unsafeCast' call
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = [];
        tmp$ret$1 = tmp$ret$0;
        tmp$ret$2 = tmp$ret$1;
        tmp = tmp$ret$2;
      } else {
        tmp = tmp0_elvis_lhs;
      }
      return toSet_0(tmp);
    };
  }
  function KmlGlJsCanvas$isFloatTextureSupported$delegate$lambda(this$0) {
    return function () {
      return (this$0.sco_1.getExtension('OES_texture_float_linear') != null ? true : this$0.sco_1.getExtension('OES_texture_float') != null) ? true : this$0.rco_1 >= 2;
    };
  }
  function KmlGlJsCanvas(canvas, glOpts) {
    KmlGlWithExtensions.call(this);
    this.pco_1 = canvas;
    this.qco_1 = glOpts;
    this.rco_1 = 1;
    var tmp = this;
    var tmp$ret$2;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp1_elvis_lhs = null;
    var tmp_0;
    if (tmp1_elvis_lhs == null) {
      var tmp0_safe_receiver = this.pco_1.getContext('webgl2', this.qco_1);
      var tmp_1;
      if (tmp0_safe_receiver == null) {
        tmp_1 = null;
      } else {
        var tmp$ret$0;
        // Inline function 'kotlin.also' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'com.soywiz.kgl.KmlGlJsCanvas.gl.<anonymous>' call
        this.rco_1 = 2;
        tmp$ret$0 = tmp0_safe_receiver;
        tmp_1 = tmp$ret$0;
      }
      tmp_0 = tmp_1;
    } else {
      tmp_0 = tmp1_elvis_lhs;
    }
    var tmp2_elvis_lhs = tmp_0;
    var tmp3_elvis_lhs = tmp2_elvis_lhs == null ? this.pco_1.getContext('webgl', this.qco_1) : tmp2_elvis_lhs;
    var tmp0_unsafeCast = tmp3_elvis_lhs == null ? this.pco_1.getContext('experimental-webgl', this.qco_1) : tmp3_elvis_lhs;
    var tmp$ret$1;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$1 = tmp0_unsafeCast;
    tmp$ret$2 = tmp$ret$1;
    var tmp4_safe_receiver = tmp$ret$2;
    var tmp_2;
    if (tmp4_safe_receiver == null) {
      tmp_2 = null;
    } else {
      var tmp$ret$3;
      // Inline function 'kotlin.also' call
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.kgl.KmlGlJsCanvas.gl.<anonymous>' call
      println('Created WebGL version=' + this.rco_1 + ', opts=' + JSON.stringify(this.qco_1));
      tmp$ret$3 = tmp4_safe_receiver;
      tmp_2 = tmp$ret$3;
    }
    var tmp5_elvis_lhs = tmp_2;
    var tmp_3;
    if (tmp5_elvis_lhs == null) {
      var tmp$ret$6;
      // Inline function 'kotlin.run' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$5;
      // Inline function 'com.soywiz.kgl.KmlGlJsCanvas.gl.<anonymous>' call
      try {
        var tmp0_safe_receiver_0 = document.body;
        if (tmp0_safe_receiver_0 == null)
          null;
        else {
          var tmp$ret$4;
          // Inline function 'kotlin.apply' call
          var tmp_4 = document.createElement('div');
          var tmp0_apply = tmp_4 instanceof HTMLElement ? tmp_4 : THROW_CCE();
          // Inline function 'kotlin.contracts.contract' call
          // Inline function 'com.soywiz.kgl.KmlGlJsCanvas.gl.<anonymous>.<anonymous>' call
          tmp0_apply.style.color = 'red';
          tmp0_apply.style.font = '30px Arial';
          tmp0_apply.innerText = "Can't get webgl context. Running in an android emulator without cross-walk?";
          tmp$ret$4 = tmp0_apply;
          tmp0_safe_receiver_0.prepend(tmp$ret$4);
        }
      } catch ($p) {
        if ($p instanceof Error) {
          printStackTrace($p);
        } else {
          throw $p;
        }
      }
      throw IllegalStateException_init_$Create$("Can't get webgl context");
      tmp$ret$6 = tmp$ret$5;
      tmp_3 = tmp$ret$6;
    } else {
      tmp_3 = tmp5_elvis_lhs;
    }
    tmp.sco_1 = tmp_3;
    var tmp_5 = this;
    var tmp$ret$7;
    // Inline function 'kotlin.arrayOfNulls' call
    var tmp0_arrayOfNulls = 8192;
    tmp$ret$7 = fillArrayVal(Array(tmp0_arrayOfNulls), null);
    tmp_5.tco_1 = tmp$ret$7;
    this.uco_1 = toMutableList(reversed_0(until(1, this.tco_1.length)));
    var tmp_6 = this;
    tmp_6.vco_1 = lazy(KmlGlJsCanvas$extensions$delegate$lambda(this));
    var tmp_7 = this;
    tmp_7.wco_1 = lazy(KmlGlJsCanvas$isFloatTextureSupported$delegate$lambda(this));
    this.xco_1 = false;
    this.yco_1 = null;
  }
  KmlGlJsCanvas.prototype.zco = function () {
    return this.qco_1;
  };
  KmlGlJsCanvas.prototype.acp = function (_set____db54di) {
    this.rco_1 = _set____db54di;
  };
  KmlGlJsCanvas.prototype.bcp = function () {
    return this.rco_1;
  };
  KmlGlJsCanvas.prototype.lan = function () {
    return true;
  };
  KmlGlJsCanvas.prototype.man = function () {
    return this.rco_1 >= 2;
  };
  KmlGlJsCanvas.prototype.van = function (texture) {
    return this.sco_1.activeTexture(texture);
  };
  KmlGlJsCanvas.prototype.wan = function (program, shader) {
    return this.sco_1.attachShader(get_2(program, this), get_2(shader, this));
  };
  KmlGlJsCanvas.prototype.xan = function (target, buffer) {
    return this.sco_1.bindBuffer(target, get_2(buffer, this));
  };
  KmlGlJsCanvas.prototype.yan = function (target, framebuffer) {
    return this.sco_1.bindFramebuffer(target, get_2(framebuffer, this));
  };
  KmlGlJsCanvas.prototype.zan = function (target, renderbuffer) {
    return this.sco_1.bindRenderbuffer(target, get_2(renderbuffer, this));
  };
  KmlGlJsCanvas.prototype.aao = function (target, texture) {
    return this.sco_1.bindTexture(target, get_2(texture, this));
  };
  KmlGlJsCanvas.prototype.bao = function (modeRGB, modeAlpha) {
    return this.sco_1.blendEquationSeparate(modeRGB, modeAlpha);
  };
  KmlGlJsCanvas.prototype.cao = function (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha) {
    return this.sco_1.blendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
  };
  KmlGlJsCanvas.prototype.dao = function (target, size, data, usage) {
    return this.sco_1.bufferData(target, new Uint8Array(get_arrayBuffer(data), 0, size), usage);
  };
  KmlGlJsCanvas.prototype.eao = function (mask) {
    return this.sco_1.clear(mask);
  };
  KmlGlJsCanvas.prototype.fao = function (red, green, blue, alpha) {
    return this.sco_1.clearColor(red, green, blue, alpha);
  };
  KmlGlJsCanvas.prototype.gao = function (d) {
    return this.sco_1.clearDepth(d);
  };
  KmlGlJsCanvas.prototype.hao = function (s) {
    return this.sco_1.clearStencil(s);
  };
  KmlGlJsCanvas.prototype.iao = function (red, green, blue, alpha) {
    return this.sco_1.colorMask(red, green, blue, alpha);
  };
  KmlGlJsCanvas.prototype.jao = function (shader) {
    return this.sco_1.compileShader(get_2(shader, this));
  };
  KmlGlJsCanvas.prototype.kao = function (target, level, internalformat, x, y, width, height, border) {
    return this.sco_1.copyTexImage2D(target, level, internalformat, x, y, width, height, border);
  };
  KmlGlJsCanvas.prototype.lao = function () {
    return alloc(this.sco_1.createProgram(), this);
  };
  KmlGlJsCanvas.prototype.mao = function (type) {
    return alloc(this.sco_1.createShader(type), this);
  };
  KmlGlJsCanvas.prototype.nao = function (mode) {
    return this.sco_1.cullFace(mode);
  };
  KmlGlJsCanvas.prototype.oao = function (n, items) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var tmp$ret$1;
        // Inline function 'com.soywiz.kmem.get' call
        var tmp0_get = items.w4w_1;
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_get;
        tmp$ret$1 = tmp$ret$0[p];
        this.sco_1.deleteBuffer(free(tmp$ret$1, this));
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.pao = function (n, items) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var tmp$ret$1;
        // Inline function 'com.soywiz.kmem.get' call
        var tmp0_get = items.w4w_1;
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_get;
        tmp$ret$1 = tmp$ret$0[p];
        this.sco_1.deleteFramebuffer(free(tmp$ret$1, this));
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.qao = function (program) {
    return this.sco_1.deleteProgram(get_2(program, this));
  };
  KmlGlJsCanvas.prototype.rao = function (n, items) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var tmp$ret$1;
        // Inline function 'com.soywiz.kmem.get' call
        var tmp0_get = items.w4w_1;
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_get;
        tmp$ret$1 = tmp$ret$0[p];
        this.sco_1.deleteRenderbuffer(free(tmp$ret$1, this));
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.sao = function (shader) {
    return this.sco_1.deleteShader(get_2(shader, this));
  };
  KmlGlJsCanvas.prototype.tao = function (n, items) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        var tmp$ret$1;
        // Inline function 'com.soywiz.kmem.get' call
        var tmp0_get = items.w4w_1;
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_get;
        tmp$ret$1 = tmp$ret$0[p];
        this.sco_1.deleteTexture(free(tmp$ret$1, this));
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.uao = function (func) {
    return this.sco_1.depthFunc(func);
  };
  KmlGlJsCanvas.prototype.vao = function (flag) {
    return this.sco_1.depthMask(flag);
  };
  KmlGlJsCanvas.prototype.wao = function (n, f) {
    return this.sco_1.depthRange(n, f);
  };
  KmlGlJsCanvas.prototype.saa = function (cap) {
    return this.sco_1.disable(cap);
  };
  KmlGlJsCanvas.prototype.xao = function (index) {
    return this.sco_1.disableVertexAttribArray(index);
  };
  KmlGlJsCanvas.prototype.yao = function (mode, first, count) {
    return this.sco_1.drawArrays(mode, first, count);
  };
  KmlGlJsCanvas.prototype.zao = function (mode, count, type, indices) {
    return this.sco_1.drawElements(mode, count, type, indices);
  };
  KmlGlJsCanvas.prototype.taa = function (cap) {
    return this.sco_1.enable(cap);
  };
  KmlGlJsCanvas.prototype.aap = function (index) {
    return this.sco_1.enableVertexAttribArray(index);
  };
  KmlGlJsCanvas.prototype.mj = function () {
    return this.sco_1.flush();
  };
  KmlGlJsCanvas.prototype.bap = function (target, attachment, renderbuffertarget, renderbuffer) {
    return this.sco_1.framebufferRenderbuffer(target, attachment, renderbuffertarget, get_2(renderbuffer, this));
  };
  KmlGlJsCanvas.prototype.cap = function (target, attachment, textarget, texture, level) {
    return this.sco_1.framebufferTexture2D(target, attachment, textarget, get_2(texture, this), level);
  };
  KmlGlJsCanvas.prototype.dap = function (mode) {
    return this.sco_1.frontFace(mode);
  };
  KmlGlJsCanvas.prototype.eap = function (n, buffers) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.kmem.set' call
        var tmp0_set = buffers.w4w_1;
        var tmp1_set = alloc(this.sco_1.createBuffer(), this);
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_set;
        tmp$ret$0[p] = tmp1_set;
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.fap = function (target) {
    return this.sco_1.generateMipmap(target);
  };
  KmlGlJsCanvas.prototype.gap = function (n, framebuffers) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.kmem.set' call
        var tmp0_set = framebuffers.w4w_1;
        var tmp1_set = alloc(this.sco_1.createFramebuffer(), this);
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_set;
        tmp$ret$0[p] = tmp1_set;
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.hap = function (n, renderbuffers) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.kmem.set' call
        var tmp0_set = renderbuffers.w4w_1;
        var tmp1_set = alloc(this.sco_1.createRenderbuffer(), this);
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_set;
        tmp$ret$0[p] = tmp1_set;
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.iap = function (n, textures) {
    var inductionVariable = 0;
    if (inductionVariable < n)
      do {
        var p = inductionVariable;
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'com.soywiz.kmem.set' call
        var tmp0_set = textures.w4w_1;
        var tmp1_set = alloc(this.sco_1.createTexture(), this);
        var tmp$ret$0;
        // Inline function 'kotlin.js.asDynamic' call
        tmp$ret$0 = tmp0_set;
        tmp$ret$0[p] = tmp1_set;
      }
       while (inductionVariable < n);
  };
  KmlGlJsCanvas.prototype.jap = function (program, name) {
    return this.sco_1.getAttribLocation(get_2(program, this), name);
  };
  KmlGlJsCanvas.prototype.kap = function (program, name) {
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    var tmp0_asDynamic = get_2(program, this);
    tmp$ret$0 = tmp0_asDynamic;
    var prg = tmp$ret$0;
    if (prg.uniforms === undefined)
      prg.uniforms = {};
    if (prg.uniforms[name] === undefined)
      prg.uniforms[name] = alloc(this.sco_1.getUniformLocation(prg, name), this);
    var tmp$ret$1;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp1_unsafeCast = prg.uniforms[name];
    tmp$ret$1 = tmp1_unsafeCast;
    return tmp$ret$1;
  };
  KmlGlJsCanvas.prototype.lap = function () {
    return this.sco_1.getError();
  };
  KmlGlJsCanvas.prototype.map = function (pname, data) {
    // Inline function 'com.soywiz.kmem.set' call
    var tmp1_set = data.w4w_1;
    var tmp$ret$1;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp0_unsafeCast = this.sco_1.getParameter(pname);
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_unsafeCast;
    tmp$ret$1 = tmp$ret$0;
    var tmp2_set = tmp$ret$1;
    var tmp$ret$2;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$2 = tmp1_set;
    tmp$ret$2[0] = tmp2_set;
  };
  KmlGlJsCanvas.prototype.nap = function (program, pname, params) {
    var tmp0_subject = pname;
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.INFO_LOG_LENGTH' call
    Companion_getInstance_14();
    tmp$ret$0 = 35716;
    if (tmp0_subject === tmp$ret$0) {
      // Inline function 'com.soywiz.kmem.set' call
      var tmp0_set = params.w4w_1;
      var tmp1_safe_receiver = this.sco_1.getProgramInfoLog(get_2(program, this));
      var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.length;
      var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver + 1 | 0;
      var tmp1_set = tmp3_elvis_lhs == null ? 1 : tmp3_elvis_lhs;
      var tmp$ret$1;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$1 = tmp0_set;
      tmp$ret$1[0] = tmp1_set;
    } else {
      var tmp3_set = params.w4w_1;
      var tmp$ret$3;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp2_unsafeCast = this.sco_1.getProgramParameter(get_2(program, this), pname);
      var tmp$ret$2;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$2 = tmp2_unsafeCast;
      tmp$ret$3 = tmp$ret$2;
      var tmp4_set = tmp$ret$3;
      var tmp$ret$4;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$4 = tmp3_set;
      tmp$ret$4[0] = tmp4_set;
    }
  };
  KmlGlJsCanvas.prototype.oap = function (shader, pname, params) {
    var tmp0_subject = pname;
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.INFO_LOG_LENGTH' call
    Companion_getInstance_14();
    tmp$ret$0 = 35716;
    if (tmp0_subject === tmp$ret$0) {
      // Inline function 'com.soywiz.kmem.set' call
      var tmp0_set = params.w4w_1;
      var tmp1_safe_receiver = this.sco_1.getShaderInfoLog(get_2(shader, this));
      var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.length;
      var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver + 1 | 0;
      var tmp1_set = tmp3_elvis_lhs == null ? 1 : tmp3_elvis_lhs;
      var tmp$ret$1;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$1 = tmp0_set;
      tmp$ret$1[0] = tmp1_set;
    } else {
      var tmp3_set = params.w4w_1;
      var tmp$ret$3;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp2_unsafeCast = this.sco_1.getShaderParameter(get_2(shader, this), pname);
      var tmp$ret$2;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$2 = tmp2_unsafeCast;
      tmp$ret$3 = tmp$ret$2;
      var tmp4_set = tmp$ret$3;
      var tmp$ret$4;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$4 = tmp3_set;
      tmp$ret$4[0] = tmp4_set;
    }
  };
  KmlGlJsCanvas.prototype.pap = function (shader, bufSize, length, infoLog) {
    var tmp0_elvis_lhs = this.sco_1.getShaderInfoLog(get_2(shader, this));
    var str = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
    // Inline function 'com.soywiz.kmem.set' call
    var tmp0_set = length.w4w_1;
    var tmp1_set = str.length;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_set;
    tmp$ret$0[0] = tmp1_set;
    putAsciiString(infoLog, str);
  };
  KmlGlJsCanvas.prototype.qap = function (name) {
    var tmp$ret$1;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp0_unsafeCast = this.sco_1.getParameter(name);
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = tmp0_unsafeCast;
    tmp$ret$1 = tmp$ret$0;
    return tmp$ret$1;
  };
  KmlGlJsCanvas.prototype.rap = function (program) {
    return this.sco_1.linkProgram(get_2(program, this));
  };
  KmlGlJsCanvas.prototype.sap = function (pname, param) {
    return this.sco_1.pixelStorei(pname, param);
  };
  KmlGlJsCanvas.prototype.tap = function (x, y, width, height, format, type, pixels) {
    return this.sco_1.readPixels(x, y, width, height, format, type, get_arrayUByte(pixels));
  };
  KmlGlJsCanvas.prototype.uap = function (target, internalformat, width, height) {
    return this.sco_1.renderbufferStorage(target, internalformat, width, height);
  };
  KmlGlJsCanvas.prototype.vap = function (x, y, width, height) {
    return this.sco_1.scissor(x, y, width, height);
  };
  KmlGlJsCanvas.prototype.wap = function (shader, string) {
    this.sco_1.shaderSource(get_2(shader, this), '#ifdef GL_ES\nprecision mediump float;\n#endif\n' + string);
  };
  KmlGlJsCanvas.prototype.xap = function (func, ref, mask) {
    return this.sco_1.stencilFunc(func, ref, mask);
  };
  KmlGlJsCanvas.prototype.yap = function (mask) {
    return this.sco_1.stencilMask(mask);
  };
  KmlGlJsCanvas.prototype.zap = function (fail, zfail, zpass) {
    return this.sco_1.stencilOp(fail, zfail, zpass);
  };
  KmlGlJsCanvas.prototype.aaq = function (target, level, internalformat, width, height, border, format, type, pixels) {
    var tmp0_subject = type;
    var tmp;
    var tmp$ret$0;
    // Inline function 'com.soywiz.kgl.KmlGl.FLOAT' call
    Companion_getInstance_14();
    tmp$ret$0 = 5126;
    if (tmp0_subject === tmp$ret$0) {
      var tmp1_safe_receiver = pixels;
      var tmp_0;
      if (tmp1_safe_receiver == null) {
        tmp_0 = null;
      } else {
        var tmp$ret$1;
        // Inline function 'com.soywiz.kmem.FBuffer.f32' call
        tmp$ret$1 = tmp1_safe_receiver.x4w_1;
        tmp_0 = tmp$ret$1;
      }
      tmp = tmp_0;
    } else {
      var tmp2_safe_receiver = pixels;
      tmp = tmp2_safe_receiver == null ? null : get_arrayUByte(tmp2_safe_receiver);
    }
    var vpixels = tmp;
    this.sco_1.texImage2D(target, level, internalformat, width, height, border, format, type, vpixels);
  };
  KmlGlJsCanvas.prototype.baq = function (target, level, internalformat, format, type, data) {
    Companion_getInstance_14();
    var tmp$ret$0;
    // Inline function 'com.soywiz.kmem.toInt' call
    var tmp0_toInt = !data.t7y_1 ? data.s7y_1 : false;
    tmp$ret$0 = tmp0_toInt ? 1 : 0;
    this.sco_1.pixelStorei(37441, tmp$ret$0);
    this.sco_1.texImage2D(target, level, internalformat, format, type, (data instanceof HtmlNativeImage ? data : THROW_CCE()).ta8_1);
    Companion_getInstance_14();
    this.sco_1.pixelStorei(37441, 0);
  };
  KmlGlJsCanvas.prototype.caq = function (target, pname, param) {
    return this.sco_1.texParameteri(target, pname, param);
  };
  KmlGlJsCanvas.prototype.daq = function (location, v0) {
    return this.sco_1.uniform1f(get_2(location, this), v0);
  };
  KmlGlJsCanvas.prototype.eaq = function (location, count, value) {
    return this.sco_1.uniform1fv(get_2(location, this), value.x4w_1);
  };
  KmlGlJsCanvas.prototype.faq = function (location, v0) {
    return this.sco_1.uniform1i(get_2(location, this), v0);
  };
  KmlGlJsCanvas.prototype.gaq = function (location, v0, v1) {
    return this.sco_1.uniform2f(get_2(location, this), v0, v1);
  };
  KmlGlJsCanvas.prototype.haq = function (location, count, value) {
    return this.sco_1.uniform2fv(get_2(location, this), value.x4w_1);
  };
  KmlGlJsCanvas.prototype.iaq = function (location, v0, v1) {
    return this.sco_1.uniform2i(get_2(location, this), v0, v1);
  };
  KmlGlJsCanvas.prototype.jaq = function (location, v0, v1, v2) {
    return this.sco_1.uniform3f(get_2(location, this), v0, v1, v2);
  };
  KmlGlJsCanvas.prototype.kaq = function (location, count, value) {
    return this.sco_1.uniform3fv(get_2(location, this), value.x4w_1);
  };
  KmlGlJsCanvas.prototype.laq = function (location, v0, v1, v2) {
    return this.sco_1.uniform3i(get_2(location, this), v0, v1, v2);
  };
  KmlGlJsCanvas.prototype.maq = function (location, v0, v1, v2, v3) {
    return this.sco_1.uniform4f(get_2(location, this), v0, v1, v2, v3);
  };
  KmlGlJsCanvas.prototype.naq = function (location, count, value) {
    return this.sco_1.uniform4fv(get_2(location, this), value.x4w_1);
  };
  KmlGlJsCanvas.prototype.oaq = function (location, v0, v1, v2, v3) {
    return this.sco_1.uniform4i(get_2(location, this), v0, v1, v2, v3);
  };
  KmlGlJsCanvas.prototype.paq = function (location, count, transpose, value) {
    return this.sco_1.uniformMatrix2fv(get_2(location, this), transpose, sliceIfRequired(value.x4w_1, this, imul(imul(count, 2), 2)));
  };
  KmlGlJsCanvas.prototype.qaq = function (location, count, transpose, value) {
    return this.sco_1.uniformMatrix3fv(get_2(location, this), transpose, sliceIfRequired(value.x4w_1, this, imul(imul(count, 3), 3)));
  };
  KmlGlJsCanvas.prototype.raq = function (location, count, transpose, value) {
    return this.sco_1.uniformMatrix4fv(get_2(location, this), transpose, sliceIfRequired(value.x4w_1, this, imul(imul(count, 4), 4)));
  };
  KmlGlJsCanvas.prototype.saq = function (program) {
    return this.sco_1.useProgram(get_2(program, this));
  };
  KmlGlJsCanvas.prototype.taq = function (index, size, type, normalized, stride, pointer) {
    return this.sco_1.vertexAttribPointer(index, size, type, normalized, stride, pointer.d2());
  };
  KmlGlJsCanvas.prototype.uaq = function (x, y, width, height) {
    return this.sco_1.viewport(x, y, width, height);
  };
  KmlGlJsCanvas.prototype.w3f = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = extensions$factory();
    tmp$ret$0 = this.vco_1.l1();
    return tmp$ret$0;
  };
  KmlGlJsCanvas.prototype.ccp = function () {
    if (!this.xco_1) {
      this.xco_1 = true;
      this.yco_1 = this.sco_1.getExtension('ANGLE_instanced_arrays');
    }
    return this.yco_1;
  };
  KmlGlJsCanvas.prototype.yaa = function (target, samples, internalformat, width, height) {
    if (this.rco_1 >= 2) {
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      var tmp0_asDynamic = this.sco_1;
      tmp$ret$0 = tmp0_asDynamic;
      tmp$ret$0.renderbufferStorageMultisample(target, samples, internalformat, width, height);
    } else {
      // Inline function 'kotlin.TODO' call
      throw NotImplementedError_init_$Create$(null, 1, null);
    }
  };
  KmlGlJsCanvas.prototype.vaa = function (mode, first, count, instancecount) {
    if (this.rco_1 >= 2) {
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      var tmp0_asDynamic = this.sco_1;
      tmp$ret$0 = tmp0_asDynamic;
      tmp$ret$0.drawArraysInstanced(mode, first, count, instancecount);
    } else {
      this.ccp().drawArraysInstancedANGLE(mode, first, count, instancecount);
    }
  };
  KmlGlJsCanvas.prototype.waa = function (mode, count, type, indices, instancecount) {
    if (this.rco_1 >= 2) {
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      var tmp0_asDynamic = this.sco_1;
      tmp$ret$0 = tmp0_asDynamic;
      tmp$ret$0.drawElementsInstanced(mode, count, type, indices, instancecount);
    } else {
      this.ccp().drawElementsInstancedANGLE(mode, count, type, indices, instancecount);
    }
  };
  KmlGlJsCanvas.prototype.xaa = function (index, divisor) {
    if (this.rco_1 >= 2) {
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      var tmp0_asDynamic = this.sco_1;
      tmp$ret$0 = tmp0_asDynamic;
      tmp$ret$0.vertexAttribDivisor(index, divisor);
    } else {
      this.ccp().vertexAttribDivisorANGLE(index, divisor);
    }
  };
  KmlGlJsCanvas.$metadata$ = classMeta('KmlGlJsCanvas', undefined, undefined, undefined, undefined, KmlGlWithExtensions.prototype);
  function extensions$factory() {
    return getPropertyCallableRef('extensions', 1, KProperty1, function (receiver) {
      return receiver.w3f();
    }, null);
  }
  function get_arrayBuffer(_this__u8e3s4) {
    var tmp = _this__u8e3s4.r4w_1;
    return tmp instanceof ArrayBuffer ? tmp : THROW_CCE();
  }
  function get_arrayUByte(_this__u8e3s4) {
    return new Uint8Array(_this__u8e3s4.r4w_1);
  }
  function AGOpenglFactory() {
    AGOpenglFactory_instance = this;
  }
  AGOpenglFactory.prototype.dcp = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp0_unsafeCast = 'ontouchstart' in window || navigator.maxTouchPoints;
    tmp$ret$0 = tmp0_unsafeCast;
    return tmp$ret$0;
  };
  AGOpenglFactory.$metadata$ = objectMeta('AGOpenglFactory');
  var AGOpenglFactory_instance;
  function AGOpenglFactory_getInstance() {
    if (AGOpenglFactory_instance == null)
      new AGOpenglFactory();
    return AGOpenglFactory_instance;
  }
  function get_korgwCanvasQuery() {
    init_properties_GlExt_kt_ahhvjs();
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = korgwCanvasQuery$factory();
    tmp$ret$0 = korgwCanvasQuery$delegate.l1();
    return tmp$ret$0;
  }
  var korgwCanvasQuery$delegate;
  function AGWebgl_init_$Init$(config, glDecorator, $mask0, $marker, $this) {
    if (!(($mask0 & 2) === 0)) {
      glDecorator = AGWebgl$_init_$lambda_3s67zs;
    }
    AGWebgl.call($this, config, glDecorator);
    return $this;
  }
  function AGWebgl_init_$Create$(config, glDecorator, $mask0, $marker) {
    return AGWebgl_init_$Init$(config, glDecorator, $mask0, $marker, Object.create(AGWebgl.prototype));
  }
  function AGWebgl$_init_$lambda_3s67zs(it) {
    return it;
  }
  function AGWebgl$canvas$delegate$lambda(this$0) {
    return function () {
      return this$0.ycq();
    };
  }
  function AGWebgl$lambda(e) {
    e.preventDefault();
    return Unit_getInstance();
  }
  function AGWebgl$lambda_0(this$0) {
    return function (e) {
      var tmp0_this = this$0;
      var tmp1 = tmp0_this.jay();
      tmp0_this.abb(tmp1 + 1 | 0);
      return Unit_getInstance();
    };
  }
  function AGWebgl(config, glDecorator) {
    AGOpengl_init_$Init$(false, 1, null, this);
    this.qcq_1 = config;
    this.rcq_1 = glDecorator;
    this.scq_1 = this;
    var tmp = this;
    tmp.tcq_1 = lazy(AGWebgl$canvas$delegate$lambda(this));
    this.ucq_1 = jsObject([to('premultipliedAlpha', false), to('alpha', false), to('stencil', true), to('antialias', this.qcq_1.gbb_1)]);
    this.vcq_1 = new KmlGlJsCanvas(this.zcq(), this.ucq_1);
    this.wcq_1 = this.rcq_1(this.vcq_1);
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    var tmp0_asDynamic = window;
    tmp$ret$0 = tmp0_asDynamic;
    tmp$ret$0.ag = this;
    this.xcq_1 = this.zcq();
    var tmp_0 = this.zcq();
    tmp_0.addEventListener('webglcontextlost', AGWebgl$lambda, false);
    var tmp_1 = this.zcq();
    tmp_1.addEventListener('webglcontextrestored', AGWebgl$lambda_0(this), false);
  }
  AGWebgl.prototype.ycq = function () {
    var tmp0_safe_receiver = get_korgwCanvasQuery();
    var tmp;
    if (tmp0_safe_receiver == null) {
      tmp = null;
    } else {
      var tmp$ret$1;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      var tmp$ret$0;
      // Inline function 'com.soywiz.korag.gl.AGWebgl.getCanvas.<anonymous>' call
      var tmp_0 = document.querySelector(tmp0_safe_receiver);
      tmp$ret$0 = tmp_0 instanceof HTMLCanvasElement ? tmp_0 : THROW_CCE();
      tmp$ret$1 = tmp$ret$0;
      tmp = tmp$ret$1;
    }
    var tmp1_elvis_lhs = tmp;
    var tmp_1;
    if (tmp1_elvis_lhs == null) {
      var tmp_2 = document.createElement('canvas');
      tmp_1 = tmp_2 instanceof HTMLCanvasElement ? tmp_2 : THROW_CCE();
    } else {
      tmp_1 = tmp1_elvis_lhs;
    }
    return tmp_1;
  };
  AGWebgl.prototype.zcq = function () {
    var tmp$ret$0;
    // Inline function 'kotlin.getValue' call
    var tmp0_getValue = canvas$factory();
    tmp$ret$0 = this.tcq_1.l1();
    return tmp$ret$0;
  };
  AGWebgl.prototype.lbk = function () {
    return this.wcq_1;
  };
  AGWebgl.prototype.acr = function () {
    return window.devicePixelRatio;
  };
  AGWebgl.prototype.xb8 = function () {
    return this.acr() <= 0.0 ? 1.0 : isNaN_0(this.acr()) ? 1.0 : isInfinite(this.acr()) ? 1.0 : this.acr();
  };
  AGWebgl.$metadata$ = classMeta('AGWebgl', [AGContainer], undefined, undefined, undefined, AGOpengl.prototype);
  function get_isCanvasCreatedAndHandled() {
    init_properties_GlExt_kt_ahhvjs();
    return get_korgwCanvasQuery() == null;
  }
  function jsObject(pairs) {
    init_properties_GlExt_kt_ahhvjs();
    var out = jsEmptyObject();
    var indexedObject = pairs;
    var inductionVariable = 0;
    var last = indexedObject.length;
    while (inductionVariable < last) {
      var tmp1_loop_parameter = indexedObject[inductionVariable];
      inductionVariable = inductionVariable + 1 | 0;
      var k = tmp1_loop_parameter.n4();
      var v = tmp1_loop_parameter.o4();
      if (!(v == null))
        out[k] = v;
    }
    return out;
  }
  function jsEmptyObject() {
    init_properties_GlExt_kt_ahhvjs();
    return {};
  }
  function korgwCanvasQuery$delegate$lambda() {
    init_properties_GlExt_kt_ahhvjs();
    var tmp$ret$1;
    // Inline function 'kotlin.js.unsafeCast' call
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    var tmp0_asDynamic = window;
    tmp$ret$0 = tmp0_asDynamic;
    var tmp1_unsafeCast = tmp$ret$0.korgwCanvasQuery;
    tmp$ret$1 = tmp1_unsafeCast;
    return tmp$ret$1;
  }
  function korgwCanvasQuery$factory() {
    return getPropertyCallableRef('korgwCanvasQuery', 0, KProperty0, function () {
      return get_korgwCanvasQuery();
    }, null);
  }
  function canvas$factory() {
    return getPropertyCallableRef('canvas', 1, KProperty1, function (receiver) {
      return receiver.zcq();
    }, null);
  }
  var properties_initialized_GlExt_kt_6pmiss;
  function init_properties_GlExt_kt_ahhvjs() {
    if (properties_initialized_GlExt_kt_6pmiss) {
    } else {
      properties_initialized_GlExt_kt_6pmiss = true;
      korgwCanvasQuery$delegate = lazy(korgwCanvasQuery$delegate$lambda);
    }
  }
  function get_knownControllers() {
    init_properties_DefaultGameWindowJs_kt_cb8wdk();
    return knownControllers;
  }
  var knownControllers;
  function Nimbus_111_1420_Safari_GamepadMapping() {
    Nimbus_111_1420_Safari_GamepadMapping_instance = this;
    GamepadMapping.call(this);
    this.bcr_1 = '111-1420-Nimbus';
  }
  Nimbus_111_1420_Safari_GamepadMapping.prototype.c1n = function () {
    return this.bcr_1;
  };
  Nimbus_111_1420_Safari_GamepadMapping.prototype.jcb = function (button) {
    var tmp0_subject = button;
    var tmp0 = tmp0_subject.q2_1;
    switch (tmp0) {
      case 8:
        return -1;
      case 9:
        return -1;
      case 10:
        return -1;
      default:
        return GamepadMapping.prototype.jcb.call(this, button);
    }
  };
  Nimbus_111_1420_Safari_GamepadMapping.$metadata$ = objectMeta('Nimbus_111_1420_Safari_GamepadMapping', undefined, undefined, undefined, undefined, GamepadMapping.prototype);
  var Nimbus_111_1420_Safari_GamepadMapping_instance;
  function Nimbus_111_1420_Safari_GamepadMapping_getInstance() {
    if (Nimbus_111_1420_Safari_GamepadMapping_instance == null)
      new Nimbus_111_1420_Safari_GamepadMapping();
    return Nimbus_111_1420_Safari_GamepadMapping_instance;
  }
  function CreateDefaultGameWindow(config) {
    init_properties_DefaultGameWindowJs_kt_cb8wdk();
    return OS_getInstance().o6u() ? new NodeJsGameWindow() : new BrowserCanvasJsGameWindow();
  }
  function NodeJsGameWindow() {
    JsGameWindow.call(this);
  }
  NodeJsGameWindow.$metadata$ = classMeta('NodeJsGameWindow', undefined, undefined, undefined, undefined, JsGameWindow.prototype);
  function onResized($this) {
    $this.jct_1 = null;
    if (get_isCanvasCreatedAndHandled()) {
      var tmp = $this.rct();
      var tmp_0 = window.innerWidth;
      var tmp_1 = window.innerHeight;
      var tmp_2 = $this.kch().xb8();
      var scale = tmp.qcf(tmp_0, tmp_1, tmp_2, 0, 8, null);
      var canvasWidth = numberToInt(window.innerWidth * scale);
      var canvasHeight = numberToInt(window.innerHeight * scale);
      $this.zcq().width = canvasWidth;
      $this.zcq().height = canvasHeight;
      $this.zcq().style.position = 'absolute';
      $this.zcq().style.left = '0';
      $this.zcq().style.right = '0';
      $this.zcq().style.width = '' + window.innerWidth + 'px';
      $this.zcq().style.height = '' + window.innerHeight + 'px';
      $this.lct_1 = scale;
    } else {
      $this.lct_1 = $this.zcq().width / $this.zcq().clientWidth;
    }
    $this.rci(0, 0, $this.zcq().width, $this.zcq().height);
  }
  function keyEvent($this, me) {
    var tmp0_subject = me.key;
    var tmp;
    switch (tmp0_subject) {
      case '0':
        tmp = Key_N0_getInstance();
        break;
      case '1':
        tmp = Key_N1_getInstance();
        break;
      case '2':
        tmp = Key_N2_getInstance();
        break;
      case '3':
        tmp = Key_N3_getInstance();
        break;
      case '4':
        tmp = Key_N4_getInstance();
        break;
      case '5':
        tmp = Key_N5_getInstance();
        break;
      case '6':
        tmp = Key_N6_getInstance();
        break;
      case '7':
        tmp = Key_N7_getInstance();
        break;
      case '8':
        tmp = Key_N8_getInstance();
        break;
      case '9':
        tmp = Key_N9_getInstance();
        break;
      case 'a':
        tmp = Key_A_getInstance();
        break;
      case 'b':
        tmp = Key_B_getInstance();
        break;
      case 'c':
        tmp = Key_C_getInstance();
        break;
      case 'd':
        tmp = Key_D_getInstance();
        break;
      case 'e':
        tmp = Key_E_getInstance();
        break;
      case 'f':
        tmp = Key_F_getInstance();
        break;
      case 'g':
        tmp = Key_G_getInstance();
        break;
      case 'h':
        tmp = Key_H_getInstance();
        break;
      case 'i':
        tmp = Key_I_getInstance();
        break;
      case 'j':
        tmp = Key_J_getInstance();
        break;
      case 'k':
        tmp = Key_K_getInstance();
        break;
      case 'l':
        tmp = Key_L_getInstance();
        break;
      case 'm':
        tmp = Key_M_getInstance();
        break;
      case 'n':
        tmp = Key_N_getInstance();
        break;
      case 'o':
        tmp = Key_O_getInstance();
        break;
      case 'p':
        tmp = Key_P_getInstance();
        break;
      case 'q':
        tmp = Key_Q_getInstance();
        break;
      case 'r':
        tmp = Key_R_getInstance();
        break;
      case 's':
        tmp = Key_S_getInstance();
        break;
      case 't':
        tmp = Key_T_getInstance();
        break;
      case 'u':
        tmp = Key_U_getInstance();
        break;
      case 'v':
        tmp = Key_V_getInstance();
        break;
      case 'w':
        tmp = Key_W_getInstance();
        break;
      case 'x':
        tmp = Key_X_getInstance();
        break;
      case 'y':
        tmp = Key_Y_getInstance();
        break;
      case 'z':
        tmp = Key_Z_getInstance();
        break;
      case 'F1':
        tmp = Key_F1_getInstance();
        break;
      case 'F2':
        tmp = Key_F2_getInstance();
        break;
      case 'F3':
        tmp = Key_F3_getInstance();
        break;
      case 'F4':
        tmp = Key_F4_getInstance();
        break;
      case 'F5':
        tmp = Key_F5_getInstance();
        break;
      case 'F6':
        tmp = Key_F6_getInstance();
        break;
      case 'F7':
        tmp = Key_F7_getInstance();
        break;
      case 'F8':
        tmp = Key_F8_getInstance();
        break;
      case 'F9':
        tmp = Key_F9_getInstance();
        break;
      case 'F10':
        tmp = Key_F10_getInstance();
        break;
      case 'F11':
        tmp = Key_F11_getInstance();
        break;
      case 'F12':
        tmp = Key_F12_getInstance();
        break;
      case 'F13':
        tmp = Key_F13_getInstance();
        break;
      case 'F14':
        tmp = Key_F14_getInstance();
        break;
      case 'F15':
        tmp = Key_F15_getInstance();
        break;
      case 'F16':
        tmp = Key_F16_getInstance();
        break;
      case 'F17':
        tmp = Key_F17_getInstance();
        break;
      case 'F18':
        tmp = Key_F18_getInstance();
        break;
      case 'F19':
        tmp = Key_F19_getInstance();
        break;
      case 'F20':
        tmp = Key_F20_getInstance();
        break;
      case 'F21':
        tmp = Key_F21_getInstance();
        break;
      case 'F22':
        tmp = Key_F22_getInstance();
        break;
      case 'F23':
        tmp = Key_F23_getInstance();
        break;
      case 'F24':
        tmp = Key_F24_getInstance();
        break;
      case 'F25':
        tmp = Key_F25_getInstance();
        break;
      case '+':
        tmp = Key_PLUS_getInstance();
        break;
      case '-':
        tmp = Key_MINUS_getInstance();
        break;
      case "'":
        tmp = Key_APOSTROPHE_getInstance();
        break;
      case '"':
        tmp = Key_QUOTE_getInstance();
        break;
      default:
        var tmp1_subject = me.code;
        var tmp_0;
        switch (tmp1_subject) {
          case 'MetaLeft':
            tmp_0 = Key_LEFT_SUPER_getInstance();
            break;
          case 'MetaRight':
            tmp_0 = Key_RIGHT_SUPER_getInstance();
            break;
          case 'ShiftLeft':
            tmp_0 = Key_LEFT_SHIFT_getInstance();
            break;
          case 'ShiftRight':
            tmp_0 = Key_RIGHT_SHIFT_getInstance();
            break;
          case 'ControlLeft':
            tmp_0 = Key_LEFT_CONTROL_getInstance();
            break;
          case 'ControlRight':
            tmp_0 = Key_RIGHT_CONTROL_getInstance();
            break;
          case 'AltLeft':
            tmp_0 = Key_LEFT_ALT_getInstance();
            break;
          case 'AltRight':
            tmp_0 = Key_RIGHT_ALT_getInstance();
            break;
          case 'Space':
            tmp_0 = Key_SPACE_getInstance();
            break;
          case 'ArrowUp':
            tmp_0 = Key_UP_getInstance();
            break;
          case 'ArrowDown':
            tmp_0 = Key_DOWN_getInstance();
            break;
          case 'ArrowLeft':
            tmp_0 = Key_LEFT_getInstance();
            break;
          case 'ArrowRight':
            tmp_0 = Key_RIGHT_getInstance();
            break;
          case 'PageUp':
            tmp_0 = Key_PAGE_UP_getInstance();
            break;
          case 'PageDown':
            tmp_0 = Key_PAGE_DOWN_getInstance();
            break;
          case 'Home':
            tmp_0 = Key_HOME_getInstance();
            break;
          case 'End':
            tmp_0 = Key_END_getInstance();
            break;
          case 'Enter':
            tmp_0 = Key_ENTER_getInstance();
            break;
          case 'Escape':
            tmp_0 = Key_ESCAPE_getInstance();
            break;
          case 'Backspace':
            tmp_0 = Key_BACKSPACE_getInstance();
            break;
          case 'Delete':
            tmp_0 = Key_DELETE_getInstance();
            break;
          case 'Insert':
            tmp_0 = Key_INSERT_getInstance();
            break;
          case 'Period':
            tmp_0 = Key_PERIOD_getInstance();
            break;
          case 'Comma':
            tmp_0 = Key_COMMA_getInstance();
            break;
          case 'Semicolon':
            tmp_0 = Key_SEMICOLON_getInstance();
            break;
          case 'Slash':
            tmp_0 = Key_SLASH_getInstance();
            break;
          case 'Tab':
            tmp_0 = Key_TAB_getInstance();
            break;
          default:
            var tmp$ret$0;
            // Inline function 'kotlin.js.asDynamic' call
            var tmp0_asDynamic = window;
            tmp$ret$0 = tmp0_asDynamic;

            if (tmp$ret$0.korgwShowUnsupportedKeys) {
              console.info('Unsupported key key=' + me.key + ', code=' + me.code);
            }

            tmp_0 = Key_UNKNOWN_getInstance();
            break;
        }

        tmp = tmp_0;
        break;
    }
    var key = tmp;
    var tmp$ret$3;
    // Inline function 'com.soywiz.korev.dispatch' call
    var tmp$ret$2;
    // Inline function 'com.soywiz.korev.invoke' call
    var tmp1_invoke = $this.rcd_1;
    var tmp$ret$1;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.keyEvent.<anonymous>' call
    var tmp_1 = tmp1_invoke;
    var tmp0_subject_0 = me.type;
    var tmp_2;
    switch (tmp0_subject_0) {
      case 'keydown':
        tmp_2 = Type_DOWN_getInstance_0();
        break;
      case 'keyup':
        tmp_2 = Type_UP_getInstance_0();
        break;
      case 'keypress':
        tmp_2 = Type_TYPE_getInstance();
        break;
      default:
        var tmp0_error = 'Unsupported event type ' + me.type;
        throw IllegalStateException_init_$Create$(toString_0(tmp0_error));
    }
    tmp_1.ec6_1 = tmp_2;
    tmp1_invoke.fc6_1 = 0;
    tmp1_invoke.hc6_1 = me.keyCode;
    tmp1_invoke.gc6_1 = key;
    tmp1_invoke.jc6_1 = me.shiftKey;
    tmp1_invoke.kc6_1 = me.ctrlKey;
    tmp1_invoke.lc6_1 = me.altKey;
    tmp1_invoke.mc6_1 = me.metaKey;
    tmp1_invoke.ic6_1 = numberToChar(me.charCode);
    tmp$ret$1 = tmp1_invoke;
    tmp$ret$2 = tmp$ret$1;
    var tmp2_dispatch = tmp$ret$2;
    $this.oc3(getKClass(KeyEvent), tmp2_dispatch);
    tmp$ret$3 = Unit_getInstance();
    if (key.equals(Key_TAB_getInstance()) ? true : key.fcb()) {
      me.preventDefault();
    }
  }
  function touchEvent($this, e, type) {
    var canvasBounds = $this.zcq().getBoundingClientRect();
    var tmp$ret$7;
    // Inline function 'com.soywiz.korev.dispatch' call
    var tmp$ret$6;
    // Inline function 'kotlin.also' call
    var tmp$ret$4;
    // Inline function 'com.soywiz.korev.TouchBuilder.frame' call
    var tmp0_frame = $this.ucd_1;
    var tmp1_frame = Mode_JS_getInstance();
    tmp0_frame.kca_1 = tmp1_frame;
    tmp0_frame.mca(type, false);
    try {
      // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.touchEvent.<anonymous>' call
      var inductionVariable = 0;
      var last = e.touches.length;
      if (inductionVariable < last)
        $l$loop: do {
          var n = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          var tmp1_elvis_lhs = e.touches.item(n);
          var tmp;
          if (tmp1_elvis_lhs == null) {
            continue $l$loop;
          } else {
            tmp = tmp1_elvis_lhs;
          }
          var touch = tmp;
          var touchId = touch.identifier;
          var tmp$ret$0;
          // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.transformEventX' call
          var tmp0_transformEventX = touch.clientX - canvasBounds.left;
          tmp$ret$0 = tmp0_transformEventX * $this.lct_1;
          var tmp_0 = tmp$ret$0;
          var tmp$ret$1;
          // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.transformEventY' call
          var tmp1_transformEventY = touch.clientY - canvasBounds.top;
          tmp$ret$1 = tmp1_transformEventY * $this.lct_1;
          var tmp_1 = tmp$ret$1;
          var tmp$ret$3;
          // Inline function 'kotlin.js.unsafeCast' call
          var tmp$ret$2;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$2 = touch;
          var tmp2_unsafeCast = tmp$ret$2.force;
          tmp$ret$3 = tmp2_unsafeCast;
          var tmp2_elvis_lhs = tmp$ret$3;
          var tmp_2 = tmp2_elvis_lhs == null ? 1.0 : tmp2_elvis_lhs;
          var tmp_3 = Kind_FINGER_getInstance();
          tmp0_frame.qca(touchId, tmp_0, tmp_1, tmp_2, tmp_3, null, 32, null);
        }
         while (inductionVariable < last);
    }finally {
      tmp0_frame.nca();
    }
    tmp$ret$4 = tmp0_frame.jca_1;
    var tmp2_also = tmp$ret$4;
    // Inline function 'kotlin.contracts.contract' call
    var tmp$ret$5;
    // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.touchEvent.<anonymous>' call
    tmp$ret$5 = Unit_getInstance();
    tmp$ret$6 = tmp2_also;
    var tmp3_dispatch = tmp$ret$6;
    $this.oc3(getKClass(TouchEvent), tmp3_dispatch);
    tmp$ret$7 = Unit_getInstance();
  }
  function mouseEvent($this, e, type, pressingType) {
    var canvasBounds = $this.zcq().getBoundingClientRect();
    var tmp$ret$0;
    // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.transformEventX' call
    var tmp0_transformEventX = e.clientX - canvasBounds.left;
    tmp$ret$0 = tmp0_transformEventX * $this.lct_1;
    var tx = numberToInt(tmp$ret$0);
    var tmp$ret$1;
    // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.transformEventY' call
    var tmp1_transformEventY = e.clientY - canvasBounds.top;
    tmp$ret$1 = tmp1_transformEventY * $this.lct_1;
    var ty = numberToInt(tmp$ret$1);
    var tmp$ret$5;
    // Inline function 'com.soywiz.korev.invoke' call
    var tmp2_invoke = $this.scd_1;
    var tmp$ret$4;
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.mouseEvent.<anonymous>' call
    tmp2_invoke.jc4_1 = !(e.buttons === 0) ? pressingType : type;
    tmp2_invoke.wc4_1 = false;
    tmp2_invoke.kc4_1 = 0;
    tmp2_invoke.lc4_1 = tx;
    tmp2_invoke.mc4_1 = ty;
    tmp2_invoke.nc4_1 = Companion_getInstance_59().m(e.button);
    tmp2_invoke.oc4_1 = e.buttons;
    tmp2_invoke.sc4_1 = e.shiftKey;
    tmp2_invoke.tc4_1 = e.ctrlKey;
    tmp2_invoke.uc4_1 = e.altKey;
    tmp2_invoke.vc4_1 = e.metaKey;
    if (type.equals(Type_SCROLL_getInstance())) {
      var tmp$ret$3;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$2;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$2 = e;
      tmp$ret$3 = tmp$ret$2;
      var we = tmp$ret$3;
      var tmp0_subject = we.deltaMode;
      var mode = tmp0_subject === WheelEvent.DOM_DELTA_PIXEL ? ScrollDeltaMode_PIXEL_getInstance() : tmp0_subject === WheelEvent.DOM_DELTA_LINE ? ScrollDeltaMode_LINE_getInstance() : tmp0_subject === WheelEvent.DOM_DELTA_PAGE ? ScrollDeltaMode_PAGE_getInstance() : ScrollDeltaMode_LINE_getInstance();
      var sensitivity = 0.05;
      tmp2_invoke.sc5(mode, we.deltaX * sensitivity, we.deltaY * sensitivity, we.deltaZ * sensitivity);
    }
    tmp$ret$4 = tmp2_invoke;
    tmp$ret$5 = tmp$ret$4;
    if (!$this.sct() ? true : type.equals(Type_SCROLL_getInstance())) {
      var tmp$ret$6;
      // Inline function 'com.soywiz.korev.dispatch' call
      var tmp3_dispatch = $this.scd_1;
      $this.oc3(getKClass(MouseEvent), tmp3_dispatch);
      tmp$ret$6 = Unit_getInstance();
    }
  }
  function mouseEvent$default($this, e, type, pressingType, $mask0, $handler) {
    if (!(($mask0 & 8) === 0))
      pressingType = type;
    return mouseEvent($this, e, type, pressingType);
  }
  function _get_jsFrame__gugpar($this) {
    var tmp = $this.pct_1;
    if (!(tmp == null))
      return tmp;
    else {
      throwUninitializedPropertyAccessException('jsFrame');
    }
  }
  function ensureSoftKeyboardInput($this) {
    if ($this.qct_1 == null) {
      var tmp = $this;
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp0_unsafeCast = document.createElement('input');
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = tmp0_unsafeCast;
      tmp$ret$1 = tmp$ret$0;
      tmp.qct_1 = tmp$ret$1;
      var tmp0_safe_receiver = $this.qct_1;
      if (tmp0_safe_receiver == null) {
      } else {
        tmp0_safe_receiver.id = 'softKeyboardInput';
      }
      var tmp1_safe_receiver = $this.qct_1;
      if (tmp1_safe_receiver == null) {
      } else {
        tmp1_safe_receiver.type = 'input';
      }
      var tmp2_safe_receiver = $this.qct_1;
      var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.style;
      if (tmp3_safe_receiver == null)
        null;
      else {
        var tmp$ret$2;
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        tmp3_safe_receiver.zIndex = '10000000';
        tmp3_safe_receiver.position = 'absolute';
        tmp3_safe_receiver.top = '0';
        tmp3_safe_receiver.left = '0';
        tmp3_safe_receiver.width = '200px';
        tmp3_safe_receiver.height = '24px';
        tmp3_safe_receiver.background = 'transparent';
        tmp$ret$2 = Unit_getInstance();
      }
    }
  }
  function BrowserCanvasJsGameWindow$close$slambda(this$0, resultContinuation) {
    this.bcu_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  BrowserCanvasJsGameWindow$close$slambda.prototype.z56 = function ($cont) {
    var tmp = this.k53($cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  BrowserCanvasJsGameWindow$close$slambda.prototype.to = function ($cont) {
    return this.z56($cont);
  };
  BrowserCanvasJsGameWindow$close$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 3;
            this.ccu_1 = this.bcu_1.oct_1;
            if (this.ccu_1 == null) {
              this.dcu_1 = null;
              this.o7_1 = 2;
              continue $sm;
            } else {
              this.o7_1 = 1;
              suspendResult = cancelAndJoin(this.ccu_1, this);
              if (suspendResult === get_COROUTINE_SUSPENDED()) {
                return suspendResult;
              }
              continue $sm;
            }

            break;
          case 1:
            var tmp_0 = this;
            tmp_0.dcu_1 = Unit_getInstance();
            this.o7_1 = 2;
            continue $sm;
          case 2:
            ;
            window.close();
            return Unit_getInstance();
          case 3:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 3) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  BrowserCanvasJsGameWindow$close$slambda.prototype.k53 = function (completion) {
    var i = new BrowserCanvasJsGameWindow$close$slambda(this.bcu_1, completion);
    return i;
  };
  BrowserCanvasJsGameWindow$close$slambda.$metadata$ = classMeta('BrowserCanvasJsGameWindow$close$slambda', undefined, undefined, undefined, [0], CoroutineImpl.prototype);
  function BrowserCanvasJsGameWindow$close$slambda_0(this$0, resultContinuation) {
    var i = new BrowserCanvasJsGameWindow$close$slambda(this$0, resultContinuation);
    var l = function ($cont) {
      return i.z56($cont);
    };
    l.$arity = 0;
    return l;
  }
  function BrowserCanvasJsGameWindow$loop$slambda($entry, this$0, resultContinuation) {
    this.mcu_1 = $entry;
    this.ncu_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  BrowserCanvasJsGameWindow$loop$slambda.prototype.z56 = function ($cont) {
    var tmp = this.k53($cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  BrowserCanvasJsGameWindow$loop$slambda.prototype.to = function ($cont) {
    return this.z56($cont);
  };
  BrowserCanvasJsGameWindow$loop$slambda.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.mcu_1(this.ncu_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  BrowserCanvasJsGameWindow$loop$slambda.prototype.k53 = function (completion) {
    var i = new BrowserCanvasJsGameWindow$loop$slambda(this.mcu_1, this.ncu_1, completion);
    return i;
  };
  BrowserCanvasJsGameWindow$loop$slambda.$metadata$ = classMeta('BrowserCanvasJsGameWindow$loop$slambda', undefined, undefined, undefined, [0], CoroutineImpl.prototype);
  function BrowserCanvasJsGameWindow$loop$slambda_0($entry, this$0, resultContinuation) {
    var i = new BrowserCanvasJsGameWindow$loop$slambda($entry, this$0, resultContinuation);
    var l = function ($cont) {
      return i.z56($cont);
    };
    l.$arity = 0;
    return l;
  }
  function BrowserCanvasJsGameWindow$lambda(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_SCROLL_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_0(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_ENTER_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_1(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_EXIT_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_2(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      mouseEvent(this$0, tmp$ret$1, Type_MOVE_getInstance(), Type_DRAG_getInstance());
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_3(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      mouseEvent(this$0, tmp$ret$1, Type_MOVE_getInstance(), Type_DRAG_getInstance());
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_4(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_EXIT_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_5(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_UP_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_6(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_DOWN_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_7(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      var tmp = tmp$ret$1;
      var tmp_0 = Type_CLICK_getInstance();
      mouseEvent$default(this$0, tmp, tmp_0, null, 8, null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_8(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      touchEvent(this$0, tmp$ret$1, Type_START_getInstance());
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_9(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      touchEvent(this$0, tmp$ret$1, Type_MOVE_getInstance_0());
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_10(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      touchEvent(this$0, tmp$ret$1, Type_END_getInstance());
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_11(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      keyEvent(this$0, tmp$ret$1);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_12(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      keyEvent(this$0, tmp$ret$1);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_13(this$0) {
    return function (it) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = it;
      tmp$ret$1 = tmp$ret$0;
      keyEvent(this$0, tmp$ret$1);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_14(this$0) {
    return function (e) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = e;
      tmp$ret$1 = tmp$ret$0;
      var e_0 = tmp$ret$1;
      var tmp$ret$3;
      // Inline function 'com.soywiz.korev.dispatch' call
      var tmp$ret$2;
      // Inline function 'kotlin.apply' call
      var tmp0_apply = this$0.xcd_1;
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.<anonymous>.<anonymous>' call
      tmp0_apply.vc7_1 = Type_CONNECTED_getInstance();
      tmp0_apply.wc7_1 = e_0.gamepad.index;
      tmp$ret$2 = tmp0_apply;
      var tmp1_dispatch = tmp$ret$2;
      this$0.oc3(getKClass(GamePadConnectionEvent), tmp1_dispatch);
      tmp$ret$3 = Unit_getInstance();
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_15(this$0) {
    return function (e) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = e;
      tmp$ret$1 = tmp$ret$0;
      var e_0 = tmp$ret$1;
      var tmp$ret$3;
      // Inline function 'com.soywiz.korev.dispatch' call
      var tmp$ret$2;
      // Inline function 'kotlin.apply' call
      var tmp0_apply = this$0.xcd_1;
      // Inline function 'kotlin.contracts.contract' call
      // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.<anonymous>.<anonymous>' call
      tmp0_apply.vc7_1 = Type_DISCONNECTED_getInstance();
      tmp0_apply.wc7_1 = e_0.gamepad.index;
      tmp$ret$2 = tmp0_apply;
      var tmp1_dispatch = tmp$ret$2;
      this$0.oc3(getKClass(GamePadConnectionEvent), tmp1_dispatch);
      tmp$ret$3 = Unit_getInstance();
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_16(this$0) {
    return function (it) {
      onResized(this$0);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_17(this$0) {
    return function (it) {
      this$0.wci(Type_START_getInstance_0(), null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_18(this$0) {
    return function (it) {
      this$0.wci(Type_END_getInstance_0(), null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_19(this$0) {
    return function (it) {
      this$0.wci(Type_END_getInstance_0(), null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_20(it) {
    it.preventDefault();
    return Unit_getInstance();
  }
  function BrowserCanvasJsGameWindow$lambda_21(this$0) {
    return function (it) {
      this$0.wci(Type_START_getInstance_0(), null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_22(this$0) {
    return function (it) {
      this$0.wci(Type_END_getInstance_0(), null);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_23(this$0) {
    return function (it) {
      it.preventDefault();
      this$0.wci(Type_END_getInstance_0(), null);
      var items = ensureNotNull(it.dataTransfer).items;
      var tmp$ret$5;
      // Inline function 'kotlin.collections.mapNotNull' call
      var tmp0_mapNotNull = until(0, items.length);
      var tmp$ret$4;
      // Inline function 'kotlin.collections.mapNotNullTo' call
      var tmp0_mapNotNullTo = ArrayList_init_$Create$();
      // Inline function 'kotlin.collections.forEach' call
      var inductionVariable = tmp0_mapNotNull.r1_1;
      var last = tmp0_mapNotNull.s1_1;
      if (inductionVariable <= last)
        do {
          var element = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
          var tmp$ret$2;
          // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.<anonymous>.<anonymous>' call
          var tmp$ret$1;
          // Inline function 'org.w3c.dom.get' call
          var tmp$ret$0;
          // Inline function 'kotlin.js.asDynamic' call
          tmp$ret$0 = items;
          tmp$ret$1 = tmp$ret$0[element];
          var tmp0_safe_receiver = tmp$ret$1;
          var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getAsFile();
          tmp$ret$2 = tmp1_safe_receiver == null ? null : toVfs(tmp1_safe_receiver);
          var tmp0_safe_receiver_0 = tmp$ret$2;
          if (tmp0_safe_receiver_0 == null)
            null;
          else {
            var tmp$ret$3;
            // Inline function 'kotlin.let' call
            // Inline function 'kotlin.contracts.contract' call
            tmp0_mapNotNullTo.c(tmp0_safe_receiver_0);
            tmp$ret$3 = Unit_getInstance();
          }
        }
         while (!(element === last));
      tmp$ret$4 = tmp0_mapNotNullTo;
      tmp$ret$5 = tmp$ret$4;
      var files = tmp$ret$5;
      this$0.wci(Type_DROP_getInstance(), files);
      return Unit_getInstance();
    };
  }
  function BrowserCanvasJsGameWindow$lambda_24(this$0) {
    return function (step) {
      window.requestAnimationFrame(_get_jsFrame__gugpar(this$0));
      this$0.cch(false, false, null, 7, null);
      return Unit_getInstance();
    };
  }
  function $loopCOROUTINE$3(_this__u8e3s4, entry, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.wcu_1 = _this__u8e3s4;
    this.xcu_1 = entry;
  }
  $loopCOROUTINE$3.prototype.v7 = function () {
    var suspendResult = this.q7_1;
    $sm: do
      try {
        var tmp = this.o7_1;
        switch (tmp) {
          case 0:
            this.p7_1 = 2;
            this.o7_1 = 1;
            suspendResult = this.wcu_1.bch(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            var ARGUMENT = suspendResult;
            var ARGUMENT_0 = launchImmediately(ARGUMENT, BrowserCanvasJsGameWindow$loop$slambda_0(this.xcu_1, this.wcu_1, null));
            this.wcu_1.oct_1 = ARGUMENT_0;
            _get_jsFrame__gugpar(this.wcu_1)(0.0);
            return Unit_getInstance();
          case 2:
            throw this.r7_1;
        }
      } catch ($p) {
        if (this.p7_1 === 2) {
          throw $p;
        } else {
          this.o7_1 = this.p7_1;
          this.r7_1 = $p;
        }
      }
     while (true);
  };
  $loopCOROUTINE$3.$metadata$ = classMeta('$loopCOROUTINE$3', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
  function BrowserCanvasJsGameWindow() {
    JsGameWindow.call(this);
    var tmp = this;
    var tmp_0 = AGConfig_init_$Create$(false, 1, null);
    tmp.hct_1 = AGWebgl_init_$Create$(tmp_0, null, 2, null);
    this.ict_1 = new DialogInterfaceJs();
    this.jct_1 = null;
    this.kct_1 = Quality_AUTOMATIC_getInstance();
    this.lct_1 = 1.0;
    this.mct_1 = Cursor_DEFAULT_getInstance();
    this.nct_1 = null;
    this.oct_1 = null;
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    var tmp0_asDynamic = window;
    tmp$ret$0 = tmp0_asDynamic;
    tmp$ret$0.canvas = this.zcq();
    var tmp$ret$1;
    // Inline function 'kotlin.js.asDynamic' call
    var tmp1_asDynamic = window;
    tmp$ret$1 = tmp1_asDynamic;
    tmp$ret$1.ag = this.kch();
    var tmp$ret$2;
    // Inline function 'kotlin.js.asDynamic' call
    var tmp2_asDynamic = window;
    tmp$ret$2 = tmp2_asDynamic;
    tmp$ret$2.gl = this.kch().lbk();
    if (get_isCanvasCreatedAndHandled()) {
      var tmp0_safe_receiver = document.body;
      if (tmp0_safe_receiver == null)
        null;
      else
        tmp0_safe_receiver.appendChild(this.zcq());
      var tmp1_safe_receiver = document.body;
      var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.style;
      if (tmp2_safe_receiver == null) {
      } else {
        tmp2_safe_receiver.margin = '0px';
      }
      var tmp3_safe_receiver = document.body;
      var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.style;
      if (tmp4_safe_receiver == null) {
      } else {
        tmp4_safe_receiver.padding = '0px';
      }
      var tmp5_safe_receiver = document.body;
      var tmp6_safe_receiver = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.style;
      if (tmp6_safe_receiver == null) {
      } else {
        tmp6_safe_receiver.overflowX = 'hidden';
      }
      var tmp7_safe_receiver = document.body;
      var tmp8_safe_receiver = tmp7_safe_receiver == null ? null : tmp7_safe_receiver.style;
      if (tmp8_safe_receiver == null) {
      } else {
        tmp8_safe_receiver.overflowY = 'hidden';
      }
    }
    var tmp_1 = this.zcq();
    tmp_1.addEventListener('wheel', BrowserCanvasJsGameWindow$lambda(this));
    var tmp_2 = this.zcq();
    tmp_2.addEventListener('mouseenter', BrowserCanvasJsGameWindow$lambda_0(this));
    var tmp_3 = this.zcq();
    tmp_3.addEventListener('mouseleave', BrowserCanvasJsGameWindow$lambda_1(this));
    var tmp_4 = this.zcq();
    tmp_4.addEventListener('mouseover', BrowserCanvasJsGameWindow$lambda_2(this));
    var tmp_5 = this.zcq();
    tmp_5.addEventListener('mousemove', BrowserCanvasJsGameWindow$lambda_3(this));
    var tmp_6 = this.zcq();
    tmp_6.addEventListener('mouseout', BrowserCanvasJsGameWindow$lambda_4(this));
    var tmp_7 = this.zcq();
    tmp_7.addEventListener('mouseup', BrowserCanvasJsGameWindow$lambda_5(this));
    var tmp_8 = this.zcq();
    tmp_8.addEventListener('mousedown', BrowserCanvasJsGameWindow$lambda_6(this));
    var tmp_9 = this.zcq();
    tmp_9.addEventListener('click', BrowserCanvasJsGameWindow$lambda_7(this));
    var tmp_10 = this.zcq();
    tmp_10.addEventListener('touchstart', BrowserCanvasJsGameWindow$lambda_8(this));
    var tmp_11 = this.zcq();
    tmp_11.addEventListener('touchmove', BrowserCanvasJsGameWindow$lambda_9(this));
    var tmp_12 = this.zcq();
    tmp_12.addEventListener('touchend', BrowserCanvasJsGameWindow$lambda_10(this));
    var tmp_13 = window;
    tmp_13.addEventListener('keypress', BrowserCanvasJsGameWindow$lambda_11(this));
    var tmp_14 = window;
    tmp_14.addEventListener('keydown', BrowserCanvasJsGameWindow$lambda_12(this));
    var tmp_15 = window;
    tmp_15.addEventListener('keyup', BrowserCanvasJsGameWindow$lambda_13(this));
    var tmp_16 = window;
    tmp_16.addEventListener('gamepadconnected', BrowserCanvasJsGameWindow$lambda_14(this));
    var tmp_17 = window;
    tmp_17.addEventListener('gamepaddisconnected', BrowserCanvasJsGameWindow$lambda_15(this));
    var tmp_18 = window;
    tmp_18.addEventListener('resize', BrowserCanvasJsGameWindow$lambda_16(this));
    var tmp_19 = this.zcq();
    tmp_19.ondragenter = BrowserCanvasJsGameWindow$lambda_17(this);
    var tmp_20 = this.zcq();
    tmp_20.ondragexit = BrowserCanvasJsGameWindow$lambda_18(this);
    var tmp_21 = this.zcq();
    tmp_21.ondragleave = BrowserCanvasJsGameWindow$lambda_19(this);
    var tmp_22 = this.zcq();
    tmp_22.ondragover = BrowserCanvasJsGameWindow$lambda_20;
    var tmp_23 = this.zcq();
    tmp_23.ondragstart = BrowserCanvasJsGameWindow$lambda_21(this);
    var tmp_24 = this.zcq();
    tmp_24.ondragend = BrowserCanvasJsGameWindow$lambda_22(this);
    var tmp_25 = this.zcq();
    tmp_25.ondrop = BrowserCanvasJsGameWindow$lambda_23(this);
    onResized(this);
    var tmp_26 = this;
    tmp_26.pct_1 = BrowserCanvasJsGameWindow$lambda_24(this);
    this.qct_1 = null;
  }
  BrowserCanvasJsGameWindow.prototype.kch = function () {
    return this.hct_1;
  };
  BrowserCanvasJsGameWindow.prototype.zcq = function () {
    return this.kch().zcq();
  };
  BrowserCanvasJsGameWindow.prototype.sct = function () {
    if (this.jct_1 == null) {
      var tmp = this;
      var tmp_0;
      try {
        document.createEvent('TouchEvent');
        tmp_0 = true;
      } catch ($p) {
        var tmp_1;
        {
          tmp_1 = false;
        }
        tmp_0 = tmp_1;
      }
      tmp.jct_1 = tmp_0;
    }
    return ensureNotNull(this.jct_1);
  };
  BrowserCanvasJsGameWindow.prototype.uci = function () {
    try {
      if (navigator.getGamepads != null) {
        var tmp$ret$0;
        // Inline function 'kotlin.js.unsafeCast' call
        var tmp0_unsafeCast = navigator.getGamepads();
        tmp$ret$0 = tmp0_unsafeCast;
        var gamepads = tmp$ret$0;
        var indexedObject = this.wcd_1.ec7_1;
        var inductionVariable = 0;
        var last = indexedObject.length;
        while (inductionVariable < last) {
          var gp = indexedObject[inductionVariable];
          inductionVariable = inductionVariable + 1 | 0;
          gp.gc7_1 = false;
        }
        this.wcd_1.dc7_1 = gamepads.length;
        var inductionVariable_0 = 0;
        var last_0 = gamepads.length;
        if (inductionVariable_0 < last_0)
          $l$loop_0: do {
            var gamepadId = inductionVariable_0;
            inductionVariable_0 = inductionVariable_0 + 1 | 0;
            var tmp$ret$2;
            // Inline function 'com.soywiz.korgw.get' call
            var tmp$ret$1;
            // Inline function 'kotlin.js.asDynamic' call
            tmp$ret$1 = gamepads;
            tmp$ret$2 = tmp$ret$1[gamepadId];
            var tmp2_elvis_lhs = tmp$ret$2;
            var tmp;
            if (tmp2_elvis_lhs == null) {
              continue $l$loop_0;
            } else {
              tmp = tmp2_elvis_lhs;
            }
            var controller = tmp;
            var tmp3_elvis_lhs = getOrNull(this.wcd_1.ec7_1, gamepadId);
            var tmp_0;
            if (tmp3_elvis_lhs == null) {
              continue $l$loop_0;
            } else {
              tmp_0 = tmp3_elvis_lhs;
            }
            var gamepad = tmp_0;
            var tmp4_elvis_lhs = get_knownControllers().q(controller.id);
            var tmp5_elvis_lhs = tmp4_elvis_lhs == null ? get_knownControllers().q(controller.mapping) : tmp4_elvis_lhs;
            var mapping = tmp5_elvis_lhs == null ? Companion_getInstance_56() : tmp5_elvis_lhs;
            var tmp$ret$7;
            // Inline function 'kotlin.apply' call
            // Inline function 'kotlin.contracts.contract' call
            // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.updateGamepads.<anonymous>' call
            gamepad.gc7_1 = controller.connected;
            gamepad.fc7_1 = controller.index;
            gamepad.hc7_1 = controller.id;
            gamepad.ic7_1 = mapping;
            gamepad.mc7_1 = controller.axes.length;
            gamepad.nc7_1 = controller.buttons.length;
            gamepad.kc7_1 = 0;
            var inductionVariable_1 = 0;
            var last_1 = controller.buttons.length;
            if (inductionVariable_1 < last_1)
              do {
                var n = inductionVariable_1;
                inductionVariable_1 = inductionVariable_1 + 1 | 0;
                var tmp$ret$4;
                // Inline function 'com.soywiz.korgw.get' call
                var tmp0_get = controller.buttons;
                var tmp$ret$3;
                // Inline function 'kotlin.js.asDynamic' call
                tmp$ret$3 = tmp0_get;
                tmp$ret$4 = tmp$ret$3[n];
                var button = tmp$ret$4;
                if (button.pressed)
                  gamepad.kc7_1 = gamepad.kc7_1 | 1 << n;
                gamepad.jc7_1[n] = button.value;
              }
               while (inductionVariable_1 < last_1);
            var inductionVariable_2 = 0;
            var last_2 = controller.axes.length;
            if (inductionVariable_2 < last_2)
              do {
                var n_0 = inductionVariable_2;
                inductionVariable_2 = inductionVariable_2 + 1 | 0;
                var tmp$ret$6;
                // Inline function 'com.soywiz.korgw.get' call
                var tmp1_get = controller.axes;
                var tmp$ret$5;
                // Inline function 'kotlin.js.asDynamic' call
                tmp$ret$5 = tmp1_get;
                tmp$ret$6 = tmp$ret$5[n_0];
                gamepad.lc7_1[n_0] = tmp$ret$6;
              }
               while (inductionVariable_2 < last_2);
            tmp$ret$7 = gamepad;
          }
           while (inductionVariable_0 < last_0);
        var tmp$ret$8;
        // Inline function 'com.soywiz.korev.dispatch' call
        var tmp1_dispatch = this.wcd_1;
        this.oc3(getKClass(GamePadUpdateEvent), tmp1_dispatch);
        tmp$ret$8 = Unit_getInstance();
      }
    } catch ($p) {
      console.error($p);
    }
  };
  BrowserCanvasJsGameWindow.prototype.vch = function (value) {
    if (!this.kct_1.equals(value)) {
      this.kct_1 = value;
      onResized(this);
    }
  };
  BrowserCanvasJsGameWindow.prototype.rct = function () {
    return this.kct_1;
  };
  BrowserCanvasJsGameWindow.prototype.ycu = function () {
    return this.lct_1;
  };
  BrowserCanvasJsGameWindow.prototype.zcu = function (x) {
    return x * this.lct_1;
  };
  BrowserCanvasJsGameWindow.prototype.acv = function (y) {
    return y * this.lct_1;
  };
  BrowserCanvasJsGameWindow.prototype.qch = function (value) {
    document.title = value;
  };
  BrowserCanvasJsGameWindow.prototype.d72 = function () {
    return this.zcq().clientWidth;
  };
  BrowserCanvasJsGameWindow.prototype.e72 = function () {
    return this.zcq().clientHeight;
  };
  BrowserCanvasJsGameWindow.prototype.ich = function (value) {
    this.mct_1 = value;
    var tmp = this.zcq().style;
    var tmp0_subject = value;
    var tmp_0;
    if (tmp0_subject instanceof Cursor) {
      var tmp1_subject = value;
      var tmp0 = tmp1_subject.q2_1;
      switch (tmp0) {
        case 0:
          tmp_0 = 'default';
          break;
        case 1:
          tmp_0 = 'crosshair';
          break;
        case 2:
          tmp_0 = 'text';
          break;
        case 3:
          tmp_0 = 'pointer';
          break;
        case 4:
          tmp_0 = 'move';
          break;
        case 5:
          tmp_0 = 'wait';
          break;
        case 6:
          tmp_0 = 'e-resize';
          break;
        case 7:
          tmp_0 = 'w-resize';
          break;
        case 8:
          tmp_0 = 's-resize';
          break;
        case 9:
          tmp_0 = 'n-resize';
          break;
        case 10:
          tmp_0 = 'ne-resize';
          break;
        case 11:
          tmp_0 = 'nw-resize';
          break;
        case 12:
          tmp_0 = 'se-resize';
          break;
        case 13:
          tmp_0 = 'sw-resize';
          break;
        default:
          tmp_0 = 'default';
          break;
      }
    } else {
      tmp_0 = 'default';
    }
    tmp.cursor = tmp_0;
  };
  BrowserCanvasJsGameWindow.prototype.jch = function () {
    return this.mct_1;
  };
  BrowserCanvasJsGameWindow.prototype.rch = function (value) {
    this.nct_1 = value;
    if (!(value == null)) {
      var tmp$ret$1;
      // Inline function 'kotlin.js.unsafeCast' call
      var tmp0_unsafeCast = document.querySelector("link[rel*='icon']");
      var tmp$ret$0;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$0 = tmp0_unsafeCast;
      tmp$ret$1 = tmp$ret$0;
      var link = tmp$ret$1;
      link.type = 'image/png';
      link.rel = 'shortcut icon';
      var tmp = toHtmlNative(value);
      link.href = tmp.ba9(null, 1, null);
      var tmp$ret$3;
      // Inline function 'org.w3c.dom.get' call
      var tmp1_get = document.getElementsByTagName('head');
      var tmp$ret$2;
      // Inline function 'kotlin.js.asDynamic' call
      tmp$ret$2 = tmp1_get;
      tmp$ret$3 = tmp$ret$2[0];
      var tmp0_safe_receiver = tmp$ret$3;
      if (tmp0_safe_receiver == null)
        null;
      else
        tmp0_safe_receiver.appendChild(link);
    } else {
      var tmp1_safe_receiver = document.querySelector("link[rel*='icon']");
      if (tmp1_safe_receiver == null)
        null;
      else {
        tmp1_safe_receiver.remove();
      }
    }
  };
  BrowserCanvasJsGameWindow.prototype.sch = function (value) {
    if (!(this.bcv() === value)) {
      var tmp$ret$3;
      // Inline function 'kotlin.runCatching' call
      var tmp;
      try {
        var tmp$ret$1;
        // Inline function 'kotlin.Companion.success' call
        var tmp0_success = Companion_getInstance_12();
        var tmp$ret$0;
        // Inline function 'com.soywiz.korgw.BrowserCanvasJsGameWindow.<set-fullscreen>.<anonymous>' call
        var tmp_0;
        if (value) {
          tmp_0 = this.zcq().requestFullscreen();
        } else {
          tmp_0 = document.exitFullscreen();
        }
        tmp$ret$0 = tmp_0;
        var tmp1_success = tmp$ret$0;
        tmp$ret$1 = _Result___init__impl__xyqfz8(tmp1_success);
        tmp = tmp$ret$1;
      } catch ($p) {
        var tmp_1;
        if ($p instanceof Error) {
          var tmp$ret$2;
          // Inline function 'kotlin.Companion.failure' call
          var tmp2_failure = Companion_getInstance_12();
          tmp$ret$2 = _Result___init__impl__xyqfz8(createFailure($p));
          tmp_1 = tmp$ret$2;
        } else {
          throw $p;
        }
        tmp = tmp_1;
      }
      tmp$ret$3 = tmp;
    }
  };
  BrowserCanvasJsGameWindow.prototype.bcv = function () {
    return !(document.fullscreenElement == null);
  };
  BrowserCanvasJsGameWindow.prototype.tch = function (value) {
    this.zcq().style.visibility = value ? 'visible' : 'hidden';
  };
  BrowserCanvasJsGameWindow.prototype.xch = function (width, height) {
  };
  BrowserCanvasJsGameWindow.prototype.zch = function (exitCode) {
    var tmp = MainScope();
    launchImmediately_0(tmp, BrowserCanvasJsGameWindow$close$slambda_0(this, null));
    this.oct_1 = null;
  };
  BrowserCanvasJsGameWindow.prototype.lci = function (entry, $cont) {
    var tmp = new $loopCOROUTINE$3(this, entry, $cont);
    tmp.q7_1 = Unit_getInstance();
    tmp.r7_1 = null;
    return tmp.v7();
  };
  BrowserCanvasJsGameWindow.prototype.ech = function (windowRect) {
    ensureSoftKeyboardInput(this);
    var tmp0_safe_receiver = this.qct_1;
    var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.style;
    if (tmp1_safe_receiver == null)
      null;
    else {
      var tmp$ret$0;
      // Inline function 'kotlin.let' call
      // Inline function 'kotlin.contracts.contract' call
      tmp1_safe_receiver.left = '' + windowRect.b74() / this.lct_1 + 'px';
      tmp1_safe_receiver.top = '' + (windowRect.y73() / this.lct_1 - 16) + 'px';
      tmp1_safe_receiver.width = '' + windowRect.x71_1 / this.lct_1 + 'px';
      tmp1_safe_receiver.font = '32px Arial';
      tmp1_safe_receiver.height = '1px';
      tmp1_safe_receiver.opacity = '0';
      tmp1_safe_receiver.background = 'transparent';
      tmp1_safe_receiver.color = 'transparent';
      println('BOUNDS.setInputRectangle:' + tmp1_safe_receiver.left + ',' + tmp1_safe_receiver.top + ',' + tmp1_safe_receiver.width + ',' + tmp1_safe_receiver.height);
      tmp$ret$0 = Unit_getInstance();
    }
  };
  BrowserCanvasJsGameWindow.prototype.fch = function (force, config) {
    var tmp0_safe_receiver = document.body;
    if (tmp0_safe_receiver == null)
      null;
    else
      tmp0_safe_receiver.appendChild(ensureNotNull(this.qct_1));
    var tmp1_safe_receiver = this.qct_1;
    if (tmp1_safe_receiver == null)
      null;
    else {
      tmp1_safe_receiver.focus();
    }
  };
  BrowserCanvasJsGameWindow.prototype.hch = function () {
    var tmp0_safe_receiver = this.qct_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.blur();
    }
    var tmp1_safe_receiver = document.body;
    if (tmp1_safe_receiver == null)
      null;
    else
      tmp1_safe_receiver.removeChild(ensureNotNull(this.qct_1));
  };
  BrowserCanvasJsGameWindow.$metadata$ = classMeta('BrowserCanvasJsGameWindow', undefined, undefined, undefined, undefined, JsGameWindow.prototype);
  function JsGameWindow() {
    GameWindow.call(this);
  }
  JsGameWindow.$metadata$ = classMeta('JsGameWindow', undefined, undefined, undefined, undefined, GameWindow.prototype);
  function get_3(_this__u8e3s4, index) {
    init_properties_DefaultGameWindowJs_kt_cb8wdk();
    var tmp$ret$0;
    // Inline function 'kotlin.js.asDynamic' call
    tmp$ret$0 = _this__u8e3s4;
    return tmp$ret$0[index];
  }
  var properties_initialized_DefaultGameWindowJs_kt_qpgyf8;
  function init_properties_DefaultGameWindowJs_kt_cb8wdk() {
    if (properties_initialized_DefaultGameWindowJs_kt_qpgyf8) {
    } else {
      properties_initialized_DefaultGameWindowJs_kt_qpgyf8 = true;
      var tmp$ret$2;
      // Inline function 'kotlin.collections.associateBy' call
      var tmp0_associateBy = listOf_0([Companion_getInstance_56(), Nimbus_111_1420_Safari_GamepadMapping_getInstance()]);
      var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(tmp0_associateBy, 10)), 16);
      var tmp$ret$1;
      // Inline function 'kotlin.collections.associateByTo' call
      var tmp0_associateByTo = LinkedHashMap_init_$Create$_0(capacity);
      var tmp0_iterator = tmp0_associateBy.j();
      while (tmp0_iterator.k()) {
        var element = tmp0_iterator.l();
        var tmp$ret$0;
        // Inline function 'com.soywiz.korgw.knownControllers.<anonymous>' call
        tmp$ret$0 = element.c1n();
        tmp0_associateByTo.a(tmp$ret$0, element);
      }
      tmp$ret$1 = tmp0_associateByTo;
      tmp$ret$2 = tmp$ret$1;
      knownControllers = tmp$ret$2;
    }
  }
  function DialogInterfaceJs() {
  }
  DialogInterfaceJs.$metadata$ = classMeta('DialogInterfaceJs', [DialogInterface]);
  //region block: post-declaration
  KmlGl.prototype.uaa = enableDisable;
  KmlGl.prototype.vaa = drawArraysInstanced;
  KmlGl.prototype.waa = drawElementsInstanced;
  KmlGl.prototype.xaa = vertexAttribDivisor;
  KmlGl.prototype.yaa = renderbufferStorageMultisample;
  KmlGl.prototype.zaa = texImage2DMultisample;
  KmlGlWithExtensions.prototype.uaa = enableDisable;
  KmlGlWithExtensions.prototype.vaa = drawArraysInstanced;
  KmlGlWithExtensions.prototype.waa = drawElementsInstanced;
  KmlGlWithExtensions.prototype.xaa = vertexAttribDivisor;
  KmlGlWithExtensions.prototype.yaa = renderbufferStorageMultisample;
  KmlGlWithExtensions.prototype.zaa = texImage2DMultisample;
  SyncBitmapSource.prototype.uav = get_depth;
  BaseRenderBufferImpl.prototype.zb1 = setSize$default;
  BaseRenderBufferImpl.prototype.ab2 = init;
  BaseRenderBufferImpl.prototype.bb2 = set;
  BaseRenderBufferImpl.prototype.cb2 = unset;
  RenderBuffer.prototype.zb1 = setSize$default;
  RenderBuffer.prototype.ab2 = init;
  RenderBuffer.prototype.cb2 = unset;
  GlRenderBuffer.prototype.zb1 = setSize$default;
  GlRenderBuffer.prototype.ab2 = init;
  GlRenderBuffer.prototype.cb2 = unset;
  Builder.prototype.l6t = get_out;
  Builder.prototype.tbg = atan;
  Builder.prototype.kb5 = texture2D;
  Builder.prototype.ubg = pow;
  Builder.prototype.vbg = sqrt;
  Builder.prototype.xbg = fract;
  Builder.prototype.gb5 = get_lit;
  Builder.prototype.abh = vec2;
  Builder.prototype.hb5 = vec4;
  Builder.prototype.jb5 = get_1;
  Builder.prototype.bbh = get_x;
  Builder.prototype.cbh = get_y;
  Builder.prototype.dbh = get_z;
  Builder.prototype.ebh = get_w;
  Builder.prototype.fbh = unaryMinus;
  Builder.prototype.gbh = not;
  Builder.prototype.hbh = minus;
  Builder.prototype.ibh = plus_2;
  Builder.prototype.ubf = times_0;
  Builder.prototype.vbf = div;
  Builder.prototype.jbh = eq;
  Builder.prototype.lbh = lt;
  Builder.prototype.mbh = le;
  ProgramBuilderDefault.prototype.l6t = get_out;
  ProgramBuilderDefault.prototype.tbg = atan;
  ProgramBuilderDefault.prototype.kb5 = texture2D;
  ProgramBuilderDefault.prototype.ubg = pow;
  ProgramBuilderDefault.prototype.vbg = sqrt;
  ProgramBuilderDefault.prototype.wbg = abs;
  ProgramBuilderDefault.prototype.xbg = fract;
  ProgramBuilderDefault.prototype.ybg = clamp_0;
  ProgramBuilderDefault.prototype.zbg = smoothstep;
  ProgramBuilderDefault.prototype.gb5 = get_lit;
  ProgramBuilderDefault.prototype.abh = vec2;
  ProgramBuilderDefault.prototype.hb5 = vec4;
  ProgramBuilderDefault.prototype.jb5 = get_1;
  ProgramBuilderDefault.prototype.bbh = get_x;
  ProgramBuilderDefault.prototype.cbh = get_y;
  ProgramBuilderDefault.prototype.dbh = get_z;
  ProgramBuilderDefault.prototype.ebh = get_w;
  ProgramBuilderDefault.prototype.fbh = unaryMinus;
  ProgramBuilderDefault.prototype.gbh = not;
  ProgramBuilderDefault.prototype.hbh = minus;
  ProgramBuilderDefault.prototype.ibh = plus_2;
  ProgramBuilderDefault.prototype.ubf = times_0;
  ProgramBuilderDefault.prototype.vbf = div;
  ProgramBuilderDefault.prototype.jbh = eq;
  ProgramBuilderDefault.prototype.kbh = ne;
  ProgramBuilderDefault.prototype.lbh = lt;
  ProgramBuilderDefault.prototype.mbh = le;
  ProgramBuilderDefault.prototype.nbh = gt;
  ProgramBuilderDefault.prototype.wbf = get_u_Tex;
  ProgramBuilderDefault.prototype.xbf = get_u_ProjMat;
  ProgramBuilderDefault.prototype.ybf = get_u_ViewMat;
  ProgramBuilderDefault.prototype.zbf = get_a_Pos;
  ProgramBuilderDefault.prototype.abg = get_a_Tex;
  ProgramBuilderDefault.prototype.cbg = get_v_Tex;
  ProgramBuilderDefault.prototype.ebg = get_t_Temp0;
  ProgramBuilderDefault.prototype.obh = get_t_Temp1;
  AGOpengl$createMainRenderBuffer$1.prototype.zb1 = setSize$default;
  LogRenderBuffer.prototype.zb1 = setSize$default;
  LogRenderBuffer.prototype.ab2 = init;
  LogRenderBuffer.prototype.cb2 = unset;
  LogBaseAG$agProcessor$1.prototype.ybd = listStart;
  GlslGenerator.prototype.kbx = precToString;
  GlslGenerator.prototype.lbx = typeToString;
  GlslGenerator.prototype.mbx = get_arrayDecl;
  GlslGenerator.prototype.jbx = get_IN;
  GlslGenerator.prototype.obx = get_OUT;
  GlslGenerator.prototype.nbx = get_UNIFORM;
  GlslBodyGenerator.prototype.lbx = typeToString;
  Program$ExpressionBuilder$Companion$INSTANCE$1.prototype.ubg = pow;
  Program$ExpressionBuilder$Companion$INSTANCE$1.prototype.gb5 = get_lit;
  Program$ExpressionBuilder$Companion$INSTANCE$1.prototype.jb5 = get_1;
  GameWindow.prototype.i8 = get;
  GameWindow.prototype.o8 = fold;
  GameWindow.prototype.n8 = minusKey;
  GameWindow.prototype.p8 = plus_1;
  GameWindowCoroutineDispatcher.prototype.p8 = plus_1;
  GameWindowCoroutineDispatcher.prototype.i8 = get_0;
  GameWindowCoroutineDispatcher.prototype.o8 = fold;
  GameWindowCoroutineDispatcher.prototype.n8 = minusKey_0;
  UiLabel.prototype.ncm = get_percent;
  Context.prototype.dco = get_pixelRatio;
  Context.prototype.vcn = get_pt;
  KmlGlJsCanvas.prototype.uaa = enableDisable;
  KmlGlJsCanvas.prototype.zaa = texImage2DMultisample;
  JsGameWindow.prototype.i8 = get;
  JsGameWindow.prototype.o8 = fold;
  JsGameWindow.prototype.n8 = minusKey;
  JsGameWindow.prototype.p8 = plus_1;
  NodeJsGameWindow.prototype.i8 = get;
  NodeJsGameWindow.prototype.o8 = fold;
  NodeJsGameWindow.prototype.n8 = minusKey;
  NodeJsGameWindow.prototype.p8 = plus_1;
  BrowserCanvasJsGameWindow.prototype.i8 = get;
  BrowserCanvasJsGameWindow.prototype.o8 = fold;
  BrowserCanvasJsGameWindow.prototype.n8 = minusKey;
  BrowserCanvasJsGameWindow.prototype.p8 = plus_1;
  //endregion
  //region block: init
  GLOBAL_CHECK_GL = false;
  korgwJvmEngine = null;
  //endregion
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = FragmentShader_0;
  _.$_$.b = Program;
  _.$_$.c = VertexShader_0;
  _.$_$.d = ColorMaskState;
  _.$_$.e = TextureUnit;
  _.$_$.f = UniformValues;
  _.$_$.g = VertexData;
  _.$_$.h = AGFeatures;
  _.$_$.i = AG;
  _.$_$.j = ProgramBuilderDefault;
  _.$_$.k = disableCullFace;
  _.$_$.l = disableScissor;
  _.$_$.m = enableCullFace;
  _.$_$.n = setBlendingState;
  _.$_$.o = setColorMaskState;
  _.$_$.p = setScissorState;
  _.$_$.q = setStencilState;
  _.$_$.r = DestroyEvent;
  _.$_$.s = DropFileEvent;
  _.$_$.t = Mixin;
  _.$_$.u = EventDispatcher;
  _.$_$.v = EventListenerFastMap;
  _.$_$.w = Event;
  _.$_$.x = GamePadConnectionEvent;
  _.$_$.y = GamePadUpdateEvent;
  _.$_$.z = GestureEvent;
  _.$_$.a1 = ISoftKeyboardConfig;
  _.$_$.b1 = KeyEvent;
  _.$_$.c1 = MouseEvent;
  _.$_$.d1 = PauseEvent;
  _.$_$.e1 = PreventDefaultException;
  _.$_$.f1 = ReshapeEvent;
  _.$_$.g1 = ResumeEvent;
  _.$_$.h1 = StopEvent;
  _.$_$.i1 = TouchEvent;
  _.$_$.j1 = preventDefault;
  _.$_$.k1 = CreateDefaultGameWindow;
  _.$_$.l1 = DialogInterfaceProvider;
  _.$_$.m1 = GameWindow;
  _.$_$.n1 = TextClipboardData;
  _.$_$.o1 = configure;
  _.$_$.p1 = get_percent;
  _.$_$.q1 = get_pt;
  _.$_$.r1 = preferredSize;
  _.$_$.s1 = set_preferredWidth;
  _.$_$.t1 = UiContainer;
  _.$_$.u1 = Precision_LOW_getInstance;
  _.$_$.v1 = Precision_MEDIUM_getInstance;
  _.$_$.w1 = ShaderType_FRAGMENT_getInstance;
  _.$_$.x1 = ShaderType_VERTEX_getInstance;
  _.$_$.y1 = VarType_Bool1_getInstance;
  _.$_$.z1 = VarType_Byte4_getInstance;
  _.$_$.a2 = VarType_Float1_getInstance;
  _.$_$.b2 = VarType_Float2_getInstance;
  _.$_$.c2 = VarType_Float3_getInstance;
  _.$_$.d2 = VarType_Float4_getInstance;
  _.$_$.e2 = VarType_Mat4_getInstance;
  _.$_$.f2 = VarType_Sampler2D_getInstance;
  _.$_$.g2 = VarType_UByte1_getInstance;
  _.$_$.h2 = BlendEquation_REVERSE_SUBTRACT_getInstance;
  _.$_$.i2 = BlendFactor_DESTINATION_ALPHA_getInstance;
  _.$_$.j2 = BlendFactor_DESTINATION_COLOR_getInstance;
  _.$_$.k2 = BlendFactor_ONE_MINUS_DESTINATION_ALPHA_getInstance;
  _.$_$.l2 = BlendFactor_ONE_MINUS_DESTINATION_COLOR_getInstance;
  _.$_$.m2 = BlendFactor_ONE_MINUS_SOURCE_ALPHA_getInstance;
  _.$_$.n2 = BlendFactor_ONE_MINUS_SOURCE_COLOR_getInstance;
  _.$_$.o2 = BlendFactor_ONE_getInstance;
  _.$_$.p2 = BlendFactor_SOURCE_ALPHA_getInstance;
  _.$_$.q2 = BlendFactor_ZERO_getInstance;
  _.$_$.r2 = CompareMode_ALWAYS_getInstance;
  _.$_$.s2 = CompareMode_EQUAL_getInstance;
  _.$_$.t2 = CompareMode_NOT_EQUAL_getInstance;
  _.$_$.u2 = CullFace_BACK_getInstance;
  _.$_$.v2 = CullFace_BOTH_getInstance;
  _.$_$.w2 = CullFace_FRONT_getInstance;
  _.$_$.x2 = DrawType_LINES_getInstance;
  _.$_$.y2 = DrawType_LINE_STRIP_getInstance;
  _.$_$.z2 = DrawType_TRIANGLES_getInstance;
  _.$_$.a3 = DrawType_TRIANGLE_FAN_getInstance;
  _.$_$.b3 = DrawType_TRIANGLE_STRIP_getInstance;
  _.$_$.c3 = StencilOp_DECREMENT_WRAP_getInstance;
  _.$_$.d3 = StencilOp_INCREMENT_WRAP_getInstance;
  _.$_$.e3 = StencilOp_INVERT_getInstance;
  _.$_$.f3 = TextureTargetKind_TEXTURE_2D_getInstance;
  _.$_$.g3 = TextureTargetKind_TEXTURE_CUBE_MAP_getInstance;
  _.$_$.h3 = Key_BACKSPACE_getInstance;
  _.$_$.i3 = Key_DOWN_getInstance;
  _.$_$.j3 = Key_EQUAL_getInstance;
  _.$_$.k3 = Key_ESCAPE_getInstance;
  _.$_$.l3 = Key_F12_getInstance;
  _.$_$.m3 = Key_F7_getInstance;
  _.$_$.n3 = Key_LEFT_ALT_getInstance;
  _.$_$.o3 = Key_LEFT_CONTROL_getInstance;
  _.$_$.p3 = Key_LEFT_SHIFT_getInstance;
  _.$_$.q3 = Key_META_getInstance;
  _.$_$.r3 = Key_MINUS_getInstance;
  _.$_$.s3 = Key_PLUS_getInstance;
  _.$_$.t3 = Key_RIGHT_ALT_getInstance;
  _.$_$.u3 = Key_RIGHT_CONTROL_getInstance;
  _.$_$.v3 = Key_RIGHT_SHIFT_getInstance;
  _.$_$.w3 = Key_TAB_getInstance;
  _.$_$.x3 = Key_UP_getInstance;
  _.$_$.y3 = Type_DOWN_getInstance_0;
  _.$_$.z3 = Type_UP_getInstance_0;
  _.$_$.a4 = MouseButton_LEFT_getInstance;
  _.$_$.b4 = ScrollDeltaMode_PIXEL_getInstance;
  _.$_$.c4 = Type_DOWN_getInstance;
  _.$_$.d4 = Type_DRAG_getInstance;
  _.$_$.e4 = Type_UP_getInstance;
  _.$_$.f4 = Kind_MOUSE_getInstance;
  _.$_$.g4 = Status_ADD_getInstance;
  _.$_$.h4 = Status_KEEP_getInstance;
  _.$_$.i4 = Status_REMOVE_getInstance;
  _.$_$.j4 = Type_END_getInstance;
  _.$_$.k4 = Type_MOVE_getInstance_0;
  _.$_$.l4 = Type_START_getInstance;
  _.$_$.m4 = Cursor_DEFAULT_getInstance;
  _.$_$.n4 = Cursor_HAND_getInstance;
  _.$_$.o4 = Cursor_TEXT_getInstance;
  _.$_$.p4 = Quality_AUTOMATIC_getInstance;
  _.$_$.q4 = Quality_PERFORMANCE_getInstance;
  _.$_$.r4 = UiStandardCursor_RESIZE_EAST_getInstance;
  _.$_$.s4 = Attribute_init_$Create$;
  _.$_$.t4 = Builder_init_$Create$_0;
  _.$_$.u4 = ProgramLayout_init_$Create$;
  _.$_$.v4 = Varying_init_$Create$;
  _.$_$.w4 = ColorMaskState_init_$Create$;
  _.$_$.x4 = UniformValues_init_$Create$;
  _.$_$.y4 = PrintAG_init_$Create$;
  _.$_$.z4 = Attribute_init_$Create$_0;
  _.$_$.a5 = Program_init_$Create$;
  _.$_$.b5 = If_init_$Create$;
  _.$_$.c5 = Uniform_init_$Create$;
  _.$_$.d5 = Varying_init_$Create$_0;
  _.$_$.e5 = Blending_init_$Create$_0;
  _.$_$.f5 = Blending_init_$Create$;
  _.$_$.g5 = ColorMaskState_init_$Create$_0;
  _.$_$.h5 = Scissor_init_$Create$;
  _.$_$.i5 = StencilState_init_$Create$;
  _.$_$.j5 = TextureUnit_init_$Create$;
  _.$_$.k5 = EventResult_init_$Create$;
  _.$_$.l5 = GamepadInfo_init_$Create$;
  _.$_$.m5 = MouseEvent_init_$Create$;
  _.$_$.n5 = ReshapeEvent_init_$Create$;
  _.$_$.o5 = SoftKeyboardConfig_init_$Create$;
  _.$_$.p5 = TouchEvent_init_$Create$;
  _.$_$.q5 = GameWindowCreationConfig_init_$Create$;
  _.$_$.r5 = TextClipboardData_init_$Create$;
  _.$_$.s5 = UiButton_init_$Create$;
  _.$_$.t5 = UiContainer_init_$Init$;
  _.$_$.u5 = UiContainer_init_$Create$;
  _.$_$.v5 = UiLabel_init_$Create$;
  _.$_$.w5 = UiTextField_init_$Create$;
  _.$_$.x5 = _VertexArrayObject___init__impl__y6yvd1;
  _.$_$.y5 = AGOpenglFactory_getInstance;
  _.$_$.z5 = Companion_getInstance_40;
  _.$_$.a6 = Companion_getInstance_19;
  _.$_$.b6 = DefaultShaders_getInstance;
  _.$_$.c6 = Companion_getInstance_55;
  _.$_$.d6 = Companion_getInstance_46;
  _.$_$.e6 = CoroutineKey_getInstance;
  _.$_$.f6 = HorizontalUiLayout_getInstance;
  _.$_$.g6 = UiFillLayout_getInstance;
  //endregion
  return _;
}));

//# sourceMappingURL=korlibs-korgw.js.map