text: // The Module object: Our interface to the outside world. We import
  // and export values on it, and do the work to get that through
  // closure compiler if necessary. There are various ways Module can be used:
  // 1. Not defined. We create it here
  // 2. A function parameter, function(Module) { ..generated code.. }
  // 3. pre-run appended it, var Module = {}; ..generated code..
  // 4. External script tag defines var Module.
  // We need to do an eval in order to handle the closure compiler
  // case, where this code here is minified but Module was defined
  // elsewhere (e.g. case 4 above). We also need to check if Module
  // already exists (e.g. case 3 above).
  // Note that if you want to run closure, and also to use Module
  // after the generated code, you will need to define   var Module = {};
  // before the code. Then that object will be used in the code, and you
  // can continue to use Module afterwards as well.
  var Module;
  if (!Module) Module = (typeof Module !== 'undefined' ? Module : null) || {};
  
  // Sometimes an existing Module object exists with properties
  // meant to overwrite the default module functionality. Here
  // we collect those properties and reapply _after_ we configure
  // the current environment's defaults to avoid having to be so
  // defensive during initialization.
  var moduleOverrides = {};
  for (var key in Module) {
    if (Module.hasOwnProperty(key)) {
      moduleOverrides[key] = Module[key];
    }
  }
  
  // The environment setup code below is customized to use Module.
  // *** Environment setup code ***
  var ENVIRONMENT_IS_WEB = typeof window === 'object';
  // Three configurations we can be running in:
  // 1) We could be the application main() thread running in the main JS UI thread. (ENVIRONMENT_IS_WORKER == false and ENVIRONMENT_IS_PTHREAD == false)
  // 2) We could be the application main() thread proxied to worker. (with Emscripten -s PROXY_TO_WORKER=1) (ENVIRONMENT_IS_WORKER == true, ENVIRONMENT_IS_PTHREAD == false)
  // 3) We could be an application pthread running in a worker. (ENVIRONMENT_IS_WORKER == true and ENVIRONMENT_IS_PTHREAD == true)
  var ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
  var ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function' && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER;
  var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
  
  if (ENVIRONMENT_IS_NODE) {
    // Expose functionality in the same simple way that the shells work
    // Note that we pollute the global namespace here, otherwise we break in node
    if (!Module['print']) Module['print'] = function print(x) {
      process['stdout'].write(x + '\n');
    };
    if (!Module['printErr']) Module['printErr'] = function printErr(x) {
      process['stderr'].write(x + '\n');
    };
  
    var nodeFS = require('fs');
    var nodePath = require('path');
  
    Module['read'] = function read(filename, binary) {
      filename = nodePath['normalize'](filename);
      var ret = nodeFS['readFileSync'](filename);
      // The path is absolute if the normalized version is the same as the resolved.
      if (!ret && filename != nodePath['resolve'](filename)) {
        filename = path.join(__dirname, '..', 'src', filename);
        ret = nodeFS['readFileSync'](filename);
      }
      if (ret && !binary) ret = ret.toString();
      return ret;
    };
  
    Module['readBinary'] = function readBinary(filename) {
      var ret = Module['read'](filename, true);
      if (!ret.buffer) {
        ret = new Uint8Array(ret);
      }
      assert(ret.buffer);
      return ret;
    };
  
    Module['load'] = function load(f) {
      globalEval(read(f));
    };
  
    if (!Module['thisProgram']) {
      if (process['argv'].length > 1) {
        Module['thisProgram'] = process['argv'][1].replace(/\\/g, '/');
      } else {
        Module['thisProgram'] = 'unknown-program';
      }
    }
  
    Module['arguments'] = process['argv'].slice(2);
  
    if (typeof module !== 'undefined') {
      module['exports'] = Module;
    }
  
    process['on']('uncaughtException', function(ex) {
      // suppress ExitStatus exceptions from showing an error
      if (!(ex instanceof ExitStatus)) {
        throw ex;
      }
    });
  
    Module['inspect'] = function () { return '[Emscripten Module object]'; };
  }
  else if (ENVIRONMENT_IS_SHELL) {
    if (!Module['print']) Module['print'] = print;
    if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
  
    if (typeof read != 'undefined') {
      Module['read'] = read;
    } else {
      Module['read'] = function read() { throw 'no read() available (jsc?)' };
    }
  
    Module['readBinary'] = function readBinary(f) {
      if (typeof readbuffer === 'function') {
        return new Uint8Array(readbuffer(f));
      }
      var data = read(f, 'binary');
      assert(typeof data === 'object');
      return data;
    };
  
    if (typeof scriptArgs != 'undefined') {
      Module['arguments'] = scriptArgs;
    } else if (typeof arguments != 'undefined') {
      Module['arguments'] = arguments;
    }
  
  }
  else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
    Module['read'] = function read(url) {
      var xhr = new XMLHttpRequest();
      xhr.open('GET', url, false);
      xhr.send(null);
      return xhr.responseText;
    };
  
    if (typeof arguments != 'undefined') {
      Module['arguments'] = arguments;
    }
  
    if (typeof console !== 'undefined') {
      if (!Module['print']) Module['print'] = function print(x) {
        console.log(x);
      };
      if (!Module['printErr']) Module['printErr'] = function printErr(x) {
        console.log(x);
      };
    } else {
      // Probably a worker, and without console.log. We can do very little here...
      var TRY_USE_DUMP = false;
      if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
        dump(x);
      }) : (function(x) {
        // self.postMessage(x); // enable this if you want stdout to be sent as messages
      }));
    }
  
    if (ENVIRONMENT_IS_WORKER) {
      Module['load'] = importScripts;
    }
  
    if (typeof Module['setWindowTitle'] === 'undefined') {
      Module['setWindowTitle'] = function(title) { document.title = title };
    }
  }
  else {
    // Unreachable because SHELL is dependant on the others
    throw 'Unknown runtime environment. Where are we?';
  }
  
  function globalEval(x) {
    eval.call(null, x);
  }
  if (!Module['load'] && Module['read']) {
    Module['load'] = function load(f) {
      globalEval(Module['read'](f));
    };
  }
  if (!Module['print']) {
    Module['print'] = function(){};
  }
  if (!Module['printErr']) {
    Module['printErr'] = Module['print'];
  }
  if (!Module['arguments']) {
    Module['arguments'] = [];
  }
  if (!Module['thisProgram']) {
    Module['thisProgram'] = './this.program';
  }
  
  // *** Environment setup code ***
  
  // Closure helpers
  Module.print = Module['print'];
  Module.printErr = Module['printErr'];
  
  // Callbacks
  Module['preRun'] = [];
  Module['postRun'] = [];
  
  // Merge back in the overrides
  for (var key in moduleOverrides) {
    if (moduleOverrides.hasOwnProperty(key)) {
      Module[key] = moduleOverrides[key];
    }
  }
  
  
  
  // === Preamble library stuff ===
  
  // Documentation for the public APIs defined in this file must be updated in: 
  //    site/source/docs/api_reference/preamble.js.rst
  // A prebuilt local version of the documentation is available at: 
  //    site/build/text/docs/api_reference/preamble.js.txt
  // You can also build docs locally as HTML or other formats in site/
  // An online HTML version (which may be of a different version of Emscripten)
  //    is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
  
  //========================================
  // Runtime code shared with compiler
  //========================================
  
  var Runtime = {
    setTempRet0: function (value) {
      tempRet0 = value;
    },
    getTempRet0: function () {
      return tempRet0;
    },
    stackSave: function () {
      return STACKTOP;
    },
    stackRestore: function (stackTop) {
      STACKTOP = stackTop;
    },
    getNativeTypeSize: function (type) {
      switch (type) {
        case 'i1': case 'i8': return 1;
        case 'i16': return 2;
        case 'i32': return 4;
        case 'i64': return 8;
        case 'float': return 4;
        case 'double': return 8;
        default: {
          if (type[type.length-1] === '*') {
            return Runtime.QUANTUM_SIZE; // A pointer
          } else if (type[0] === 'i') {
            var bits = parseInt(type.substr(1));
            assert(bits % 8 === 0);
            return bits/8;
          } else {
            return 0;
          }
        }
      }
    },
    getNativeFieldSize: function (type) {
      return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);
    },
    STACK_ALIGN: 16,
    prepVararg: function (ptr, type) {
      if (type === 'double' || type === 'i64') {
        // move so the load is aligned
        if (ptr & 7) {
          assert((ptr & 7) === 4);
          ptr += 4;
        }
      } else {
        assert((ptr & 3) === 0);
      }
      return ptr;
    },
    getAlignSize: function (type, size, vararg) {
      // we align i64s and doubles on 64-bit boundaries, unlike x86
      if (!vararg && (type == 'i64' || type == 'double')) return 8;
      if (!type) return Math.min(size, 8); // align structures internally to 64 bits
      return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);
    },
    dynCall: function (sig, ptr, args) {
      if (args && args.length) {
        assert(args.length == sig.length-1);
        if (!args.splice) args = Array.prototype.slice.call(args);
        args.splice(0, 0, ptr);
        assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
        return Module['dynCall_' + sig].apply(null, args);
      } else {
        assert(sig.length == 1);
        assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
        return Module['dynCall_' + sig].call(null, ptr);
      }
    },
    functionPointers: [],
    addFunction: function (func) {
      for (var i = 0; i < Runtime.functionPointers.length; i++) {
        if (!Runtime.functionPointers[i]) {
          Runtime.functionPointers[i] = func;
          return 2*(1 + i);
        }
      }
      throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';
    },
    removeFunction: function (index) {
      Runtime.functionPointers[(index-2)/2] = null;
    },
    warnOnce: function (text) {
      if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};
      if (!Runtime.warnOnce.shown[text]) {
        Runtime.warnOnce.shown[text] = 1;
        Module.printErr(text);
      }
    },
    funcWrappers: {},
    getFuncWrapper: function (func, sig) {
      assert(sig);
      if (!Runtime.funcWrappers[sig]) {
        Runtime.funcWrappers[sig] = {};
      }
      var sigCache = Runtime.funcWrappers[sig];
      if (!sigCache[func]) {
        sigCache[func] = function dynCall_wrapper() {
          return Runtime.dynCall(sig, func, arguments);
        };
      }
      return sigCache[func];
    },
    getCompilerSetting: function (name) {
      throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';
    },
    stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+15)&-16);(assert((((STACKTOP|0) < (STACK_MAX|0))|0))|0); return ret; },
    staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + (assert(!staticSealed),size))|0;STATICTOP = (((STATICTOP)+15)&-16); return ret; },
    dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + (assert(DYNAMICTOP > 0),size))|0;DYNAMICTOP = (((DYNAMICTOP)+15)&-16); if (DYNAMICTOP >= TOTAL_MEMORY) { var success = enlargeMemory(); if (!success) { DYNAMICTOP = ret;  return 0; } }; return ret; },
    alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 16))*(quantum ? quantum : 16); return ret; },
    makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*4294967296.0)) : ((+((low>>>0)))+((+((high|0)))*4294967296.0))); return ret; },
    GLOBAL_BASE: 8,
    QUANTUM_SIZE: 4,
    __dummy__: 0
  }
  
  
  
  Module["Runtime"] = Runtime;
  
  
  
  //========================================
  // Runtime essentials
  //========================================
  
  var __THREW__ = 0; // Used in checking for thrown exceptions.
  
  var ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()
  var EXITSTATUS = 0;
  
  var undef = 0;
  // tempInt is used for 32-bit signed values or smaller. tempBigInt is used
  // for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt
  var tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;
  var tempI64, tempI64b;
  var tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;
  
  function assert(condition, text) {
    if (!condition) {
      abort('Assertion failed: ' + text);
    }
  }
  
  var globalScope = this;
  
  // Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
  function getCFunc(ident) {
    var func = Module['_' + ident]; // closure exported function
    if (!func) {
      try {
        func = eval('_' + ident); // explicit lookup
      } catch(e) {}
    }
    assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');
    return func;
  }
  
  var cwrap, ccall;
  (function(){
    var JSfuncs = {
      // Helpers for cwrap -- it can't refer to Runtime directly because it might
      // be renamed by closure, instead it calls JSfuncs['stackSave'].body to find
      // out what the minified function name is.
      'stackSave': function() {
        Runtime.stackSave()
      },
      'stackRestore': function() {
        Runtime.stackRestore()
      },
      // type conversion from js to c
      'arrayToC' : function(arr) {
        var ret = Runtime.stackAlloc(arr.length);
        writeArrayToMemory(arr, ret);
        return ret;
      },
      'stringToC' : function(str) {
        var ret = 0;
        if (str !== null && str !== undefined && str !== 0) { // null string
          // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0'
          ret = Runtime.stackAlloc((str.length << 2) + 1);
          writeStringToMemory(str, ret);
        }
        return ret;
      }
    };
    // For fast lookup of conversion functions
    var toC = {'string' : JSfuncs['stringToC'], 'array' : JSfuncs['arrayToC']};
  
    // C calling interface. 
    ccall = function ccallFunc(ident, returnType, argTypes, args, opts) {
      var func = getCFunc(ident);
      var cArgs = [];
      var stack = 0;
      assert(returnType !== 'array', 'Return type should not be "array".');
      if (args) {
        for (var i = 0; i < args.length; i++) {
          var converter = toC[argTypes[i]];
          if (converter) {
            if (stack === 0) stack = Runtime.stackSave();
            cArgs[i] = converter(args[i]);
          } else {
            cArgs[i] = args[i];
          }
        }
      }
      var ret = func.apply(null, cArgs);
      if ((!opts || !opts.async) && typeof EmterpreterAsync === 'object') {
        assert(!EmterpreterAsync.state, 'cannot start async op with normal JS calling ccall');
      }
      if (opts && opts.async) assert(!returnType, 'async ccalls cannot return values');
      if (returnType === 'string') ret = Pointer_stringify(ret);
      if (stack !== 0) {
        if (opts && opts.async) {
          EmterpreterAsync.asyncFinalizers.push(function() {
            Runtime.stackRestore(stack);
          });
          return;
        }
        Runtime.stackRestore(stack);
      }
      return ret;
    }
  
    var sourceRegex = /^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;
    function parseJSFunc(jsfunc) {
      // Match the body and the return value of a javascript function source
      var parsed = jsfunc.toString().match(sourceRegex).slice(1);
      return {arguments : parsed[0], body : parsed[1], returnValue: parsed[2]}
    }
    var JSsource = {};
    for (var fun in JSfuncs) {
      if (JSfuncs.hasOwnProperty(fun)) {
        // Elements of toCsource are arrays of three items:
        // the code, and the return value
        JSsource[fun] = parseJSFunc(JSfuncs[fun]);
      }
    }
  
    
    cwrap = function cwrap(ident, returnType, argTypes) {
      argTypes = argTypes || [];
      var cfunc = getCFunc(ident);
      // When the function takes numbers and returns a number, we can just return
      // the original function
      var numericArgs = argTypes.every(function(type){ return type === 'number'});
      var numericRet = (returnType !== 'string');
      if ( numericRet && numericArgs) {
        return cfunc;
      }
      // Creation of the arguments list (["$1","$2",...,"$nargs"])
      var argNames = argTypes.map(function(x,i){return '$'+i});
      var funcstr = "(function(" + argNames.join(',') + ") {";
      var nargs = argTypes.length;
      if (!numericArgs) {
        // Generate the code needed to convert the arguments from javascript
        // values to pointers
        funcstr += 'var stack = ' + JSsource['stackSave'].body + ';';
        for (var i = 0; i < nargs; i++) {
          var arg = argNames[i], type = argTypes[i];
          if (type === 'number') continue;
          var convertCode = JSsource[type + 'ToC']; // [code, return]
          funcstr += 'var ' + convertCode.arguments + ' = ' + arg + ';';
          funcstr += convertCode.body + ';';
          funcstr += arg + '=' + convertCode.returnValue + ';';
        }
      }
  
      // When the code is compressed, the name of cfunc is not literally 'cfunc' anymore
      var cfuncname = parseJSFunc(function(){return cfunc}).returnValue;
      // Call the function
      funcstr += 'var ret = ' + cfuncname + '(' + argNames.join(',') + ');';
      if (!numericRet) { // Return type can only by 'string' or 'number'
        // Convert the result to a string
        var strgfy = parseJSFunc(function(){return Pointer_stringify}).returnValue;
        funcstr += 'ret = ' + strgfy + '(ret);';
      }
      funcstr += "if (typeof EmterpreterAsync === 'object') { assert(!EmterpreterAsync.state, 'cannot start async op with normal JS calling cwrap') }";
      if (!numericArgs) {
        // If we had a stack, restore it
        funcstr += JSsource['stackRestore'].body.replace('()', '(stack)') + ';';
      }
      funcstr += 'return ret})';
      return eval(funcstr);
    };
  })();
  Module["ccall"] = ccall;
  Module["cwrap"] = cwrap;
  
  function setValue(ptr, value, type, noSafe) {
    type = type || 'i8';
    if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
      switch(type) {
        case 'i1': HEAP8[((ptr)>>0)]=value; break;
        case 'i8': HEAP8[((ptr)>>0)]=value; break;
        case 'i16': HEAP16[((ptr)>>1)]=value; break;
        case 'i32': HEAP32[((ptr)>>2)]=value; break;
        case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
        case 'float': HEAPF32[((ptr)>>2)]=value; break;
        case 'double': HEAPF64[((ptr)>>3)]=value; break;
        default: abort('invalid type for setValue: ' + type);
      }
  }
  Module["setValue"] = setValue;
  
  
  function getValue(ptr, type, noSafe) {
    type = type || 'i8';
    if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
      switch(type) {
        case 'i1': return HEAP8[((ptr)>>0)];
        case 'i8': return HEAP8[((ptr)>>0)];
        case 'i16': return HEAP16[((ptr)>>1)];
        case 'i32': return HEAP32[((ptr)>>2)];
        case 'i64': return HEAP32[((ptr)>>2)];
        case 'float': return HEAPF32[((ptr)>>2)];
        case 'double': return HEAPF64[((ptr)>>3)];
        default: abort('invalid type for setValue: ' + type);
      }
    return null;
  }
  Module["getValue"] = getValue;
  
  var ALLOC_NORMAL = 0; // Tries to use _malloc()
  var ALLOC_STACK = 1; // Lives for the duration of the current function call
  var ALLOC_STATIC = 2; // Cannot be freed
  var ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk
  var ALLOC_NONE = 4; // Do not allocate
  Module["ALLOC_NORMAL"] = ALLOC_NORMAL;
  Module["ALLOC_STACK"] = ALLOC_STACK;
  Module["ALLOC_STATIC"] = ALLOC_STATIC;
  Module["ALLOC_DYNAMIC"] = ALLOC_DYNAMIC;
  Module["ALLOC_NONE"] = ALLOC_NONE;
  
  // allocate(): This is for internal use. You can use it yourself as well, but the interface
  //             is a little tricky (see docs right below). The reason is that it is optimized
  //             for multiple syntaxes to save space in generated code. So you should
  //             normally not use allocate(), and instead allocate memory using _malloc(),
  //             initialize it with setValue(), and so forth.
  // @slab: An array of data, or a number. If a number, then the size of the block to allocate,
  //        in *bytes* (note that this is sometimes confusing: the next parameter does not
  //        affect this!)
  // @types: Either an array of types, one for each byte (or 0 if no type at that position),
  //         or a single type which is used for the entire block. This only matters if there
  //         is initial data - if @slab is a number, then this does not matter at all and is
  //         ignored.
  // @allocator: How to allocate memory, see ALLOC_*
  function allocate(slab, types, allocator, ptr) {
    var zeroinit, size;
    if (typeof slab === 'number') {
      zeroinit = true;
      size = slab;
    } else {
      zeroinit = false;
      size = slab.length;
    }
  
    var singleType = typeof types === 'string' ? types : null;
  
    var ret;
    if (allocator == ALLOC_NONE) {
      ret = ptr;
    } else {
      ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));
    }
  
    if (zeroinit) {
      var ptr = ret, stop;
      assert((ret & 3) == 0);
      stop = ret + (size & ~3);
      for (; ptr < stop; ptr += 4) {
        HEAP32[((ptr)>>2)]=0;
      }
      stop = ret + size;
      while (ptr < stop) {
        HEAP8[((ptr++)>>0)]=0;
      }
      return ret;
    }
  
    if (singleType === 'i8') {
      if (slab.subarray || slab.slice) {
        HEAPU8.set(slab, ret);
      } else {
        HEAPU8.set(new Uint8Array(slab), ret);
      }
      return ret;
    }
  
    var i = 0, type, typeSize, previousType;
    while (i < size) {
      var curr = slab[i];
  
      if (typeof curr === 'function') {
        curr = Runtime.getFunctionIndex(curr);
      }
  
      type = singleType || types[i];
      if (type === 0) {
        i++;
        continue;
      }
      assert(type, 'Must know what type to store in allocate!');
  
      if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later
  
      setValue(ret+i, curr, type);
  
      // no need to look up size unless type changes, so cache it
      if (previousType !== type) {
        typeSize = Runtime.getNativeTypeSize(type);
        previousType = type;
      }
      i += typeSize;
    }
  
    return ret;
  }
  Module["allocate"] = allocate;
  
  // Allocate memory during any stage of startup - static memory early on, dynamic memory later, malloc when ready
  function getMemory(size) {
    if (!staticSealed) return Runtime.staticAlloc(size);
    if ((typeof _sbrk !== 'undefined' && !_sbrk.called) || !runtimeInitialized) return Runtime.dynamicAlloc(size);
    return _malloc(size);
  }
  Module["getMemory"] = getMemory;
  
  function Pointer_stringify(ptr, /* optional */ length) {
    if (length === 0 || !ptr) return '';
    // TODO: use TextDecoder
    // Find the length, and check for UTF while doing so
    var hasUtf = 0;
    var t;
    var i = 0;
    while (1) {
      assert(ptr + i < TOTAL_MEMORY);
      t = HEAPU8[(((ptr)+(i))>>0)];
      hasUtf |= t;
      if (t == 0 && !length) break;
      i++;
      if (length && i == length) break;
    }
    if (!length) length = i;
  
    var ret = '';
  
    if (hasUtf < 128) {
      var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack
      var curr;
      while (length > 0) {
        curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
        ret = ret ? ret + curr : curr;
        ptr += MAX_CHUNK;
        length -= MAX_CHUNK;
      }
      return ret;
    }
    return Module['UTF8ToString'](ptr);
  }
  Module["Pointer_stringify"] = Pointer_stringify;
  
  // Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns
  // a copy of that string as a Javascript String object.
  
  function AsciiToString(ptr) {
    var str = '';
    while (1) {
      var ch = HEAP8[((ptr++)>>0)];
      if (!ch) return str;
      str += String.fromCharCode(ch);
    }
  }
  Module["AsciiToString"] = AsciiToString;
  
  // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  // null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP.
  
  function stringToAscii(str, outPtr) {
    return writeAsciiToMemory(str, outPtr, false);
  }
  Module["stringToAscii"] = stringToAscii;
  
  // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns
  // a copy of that string as a Javascript String object.
  
  function UTF8ArrayToString(u8Array, idx) {
    var u0, u1, u2, u3, u4, u5;
  
    var str = '';
    while (1) {
      // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
      u0 = u8Array[idx++];
      if (!u0) return str;
      if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }
      u1 = u8Array[idx++] & 63;
      if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }
      u2 = u8Array[idx++] & 63;
      if ((u0 & 0xF0) == 0xE0) {
        u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
      } else {
        u3 = u8Array[idx++] & 63;
        if ((u0 & 0xF8) == 0xF0) {
          u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;
        } else {
          u4 = u8Array[idx++] & 63;
          if ((u0 & 0xFC) == 0xF8) {
            u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;
          } else {
            u5 = u8Array[idx++] & 63;
            u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;
          }
        }
      }
      if (u0 < 0x10000) {
        str += String.fromCharCode(u0);
      } else {
        var ch = u0 - 0x10000;
        str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
      }
    }
  }
  Module["UTF8ArrayToString"] = UTF8ArrayToString;
  
  // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns
  // a copy of that string as a Javascript String object.
  
  function UTF8ToString(ptr) {
    return UTF8ArrayToString(HEAPU8,ptr);
  }
  Module["UTF8ToString"] = UTF8ToString;
  
  // Copies the given Javascript String object 'str' to the given byte array at address 'outIdx',
  // encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP.
  // Use the function lengthBytesUTF8() to compute the exact number of bytes (excluding null terminator) that this function will write.
  // Parameters:
  //   str: the Javascript string to copy.
  //   outU8Array: the array to copy to. Each index in this array is assumed to be one 8-byte element.
  //   outIdx: The starting offset in the array to begin the copying.
  //   maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null 
  //                    terminator, i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else.
  //                    maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator.
  // Returns the number of bytes written, EXCLUDING the null terminator.
  
  function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {
    if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
      return 0;
  
    var startIdx = outIdx;
    var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
    for (var i = 0; i < str.length; ++i) {
      // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
      // See http://unicode.org/faq/utf_bom.html#utf16-3
      // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
      var u = str.charCodeAt(i); // possibly a lead surrogate
      if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
      if (u <= 0x7F) {
        if (outIdx >= endIdx) break;
        outU8Array[outIdx++] = u;
      } else if (u <= 0x7FF) {
        if (outIdx + 1 >= endIdx) break;
        outU8Array[outIdx++] = 0xC0 | (u >> 6);
        outU8Array[outIdx++] = 0x80 | (u & 63);
      } else if (u <= 0xFFFF) {
        if (outIdx + 2 >= endIdx) break;
        outU8Array[outIdx++] = 0xE0 | (u >> 12);
        outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
        outU8Array[outIdx++] = 0x80 | (u & 63);
      } else if (u <= 0x1FFFFF) {
        if (outIdx + 3 >= endIdx) break;
        outU8Array[outIdx++] = 0xF0 | (u >> 18);
        outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
        outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
        outU8Array[outIdx++] = 0x80 | (u & 63);
      } else if (u <= 0x3FFFFFF) {
        if (outIdx + 4 >= endIdx) break;
        outU8Array[outIdx++] = 0xF8 | (u >> 24);
        outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63);
        outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
        outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
        outU8Array[outIdx++] = 0x80 | (u & 63);
      } else {
        if (outIdx + 5 >= endIdx) break;
        outU8Array[outIdx++] = 0xFC | (u >> 30);
        outU8Array[outIdx++] = 0x80 | ((u >> 24) & 63);
        outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63);
        outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
        outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
        outU8Array[outIdx++] = 0x80 | (u & 63);
      }
    }
    // Null-terminate the pointer to the buffer.
    outU8Array[outIdx] = 0;
    return outIdx - startIdx;
  }
  Module["stringToUTF8Array"] = stringToUTF8Array;
  
  // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  // null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP.
  // Use the function lengthBytesUTF8() to compute the exact number of bytes (excluding null terminator) that this function will write.
  // Returns the number of bytes written, EXCLUDING the null terminator.
  
  function stringToUTF8(str, outPtr, maxBytesToWrite) {
    assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
    return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);
  }
  Module["stringToUTF8"] = stringToUTF8;
  
  // Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
  
  function lengthBytesUTF8(str) {
    var len = 0;
    for (var i = 0; i < str.length; ++i) {
      // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
      // See http://unicode.org/faq/utf_bom.html#utf16-3
      var u = str.charCodeAt(i); // possibly a lead surrogate
      if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
      if (u <= 0x7F) {
        ++len;
      } else if (u <= 0x7FF) {
        len += 2;
      } else if (u <= 0xFFFF) {
        len += 3;
      } else if (u <= 0x1FFFFF) {
        len += 4;
      } else if (u <= 0x3FFFFFF) {
        len += 5;
      } else {
        len += 6;
      }
    }
    return len;
  }
  Module["lengthBytesUTF8"] = lengthBytesUTF8;
  
  // Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns
  // a copy of that string as a Javascript String object.
  
  function UTF16ToString(ptr) {
    var i = 0;
  
    var str = '';
    while (1) {
      var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];
      if (codeUnit == 0)
        return str;
      ++i;
      // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.
      str += String.fromCharCode(codeUnit);
    }
  }
  Module["UTF16ToString"] = UTF16ToString;
  
  // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  // null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP.
  // Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write.
  // Parameters:
  //   str: the Javascript string to copy.
  //   outPtr: Byte address in Emscripten HEAP where to write the string to.
  //   maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null 
  //                    terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else.
  //                    maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator.
  // Returns the number of bytes written, EXCLUDING the null terminator.
  
  function stringToUTF16(str, outPtr, maxBytesToWrite) {
    assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
    // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
    if (maxBytesToWrite === undefined) {
      maxBytesToWrite = 0x7FFFFFFF;
    }
    if (maxBytesToWrite < 2) return 0;
    maxBytesToWrite -= 2; // Null terminator.
    var startPtr = outPtr;
    var numCharsToWrite = (maxBytesToWrite < str.length*2) ? (maxBytesToWrite / 2) : str.length;
    for (var i = 0; i < numCharsToWrite; ++i) {
      // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
      var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
      HEAP16[((outPtr)>>1)]=codeUnit;
      outPtr += 2;
    }
    // Null-terminate the pointer to the HEAP.
    HEAP16[((outPtr)>>1)]=0;
    return outPtr - startPtr;
  }
  Module["stringToUTF16"] = stringToUTF16;
  
  // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
  
  function lengthBytesUTF16(str) {
    return str.length*2;
  }
  Module["lengthBytesUTF16"] = lengthBytesUTF16;
  
  function UTF32ToString(ptr) {
    var i = 0;
  
    var str = '';
    while (1) {
      var utf32 = HEAP32[(((ptr)+(i*4))>>2)];
      if (utf32 == 0)
        return str;
      ++i;
      // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.
      // See http://unicode.org/faq/utf_bom.html#utf16-3
      if (utf32 >= 0x10000) {
        var ch = utf32 - 0x10000;
        str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
      } else {
        str += String.fromCharCode(utf32);
      }
    }
  }
  Module["UTF32ToString"] = UTF32ToString;
  
  // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  // null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP.
  // Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write.
  // Parameters:
  //   str: the Javascript string to copy.
  //   outPtr: Byte address in Emscripten HEAP where to write the string to.
  //   maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null 
  //                    terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else.
  //                    maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator.
  // Returns the number of bytes written, EXCLUDING the null terminator.
  
  function stringToUTF32(str, outPtr, maxBytesToWrite) {
    assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
    // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
    if (maxBytesToWrite === undefined) {
      maxBytesToWrite = 0x7FFFFFFF;
    }
    if (maxBytesToWrite < 4) return 0;
    var startPtr = outPtr;
    var endPtr = startPtr + maxBytesToWrite - 4;
    for (var i = 0; i < str.length; ++i) {
      // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
      // See http://unicode.org/faq/utf_bom.html#utf16-3
      var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
      if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {
        var trailSurrogate = str.charCodeAt(++i);
        codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);
      }
      HEAP32[((outPtr)>>2)]=codeUnit;
      outPtr += 4;
      if (outPtr + 4 > endPtr) break;
    }
    // Null-terminate the pointer to the HEAP.
    HEAP32[((outPtr)>>2)]=0;
    return outPtr - startPtr;
  }
  Module["stringToUTF32"] = stringToUTF32;
  
  // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
  
  function lengthBytesUTF32(str) {
    var len = 0;
    for (var i = 0; i < str.length; ++i) {
      // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
      // See http://unicode.org/faq/utf_bom.html#utf16-3
      var codeUnit = str.charCodeAt(i);
      if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate.
      len += 4;
    }
  
    return len;
  }
  Module["lengthBytesUTF32"] = lengthBytesUTF32;
  
  function demangle(func) {
    var hasLibcxxabi = !!Module['___cxa_demangle'];
    if (hasLibcxxabi) {
      try {
        var buf = _malloc(func.length);
        writeStringToMemory(func.substr(1), buf);
        var status = _malloc(4);
        var ret = Module['___cxa_demangle'](buf, 0, 0, status);
        if (getValue(status, 'i32') === 0 && ret) {
          return Pointer_stringify(ret);
        }
        // otherwise, libcxxabi failed, we can try ours which may return a partial result
      } catch(e) {
        // failure when using libcxxabi, we can try ours which may return a partial result
      } finally {
        if (buf) _free(buf);
        if (status) _free(status);
        if (ret) _free(ret);
      }
    }
    var i = 3;
    // params, etc.
    var basicTypes = {
      'v': 'void',
      'b': 'bool',
      'c': 'char',
      's': 'short',
      'i': 'int',
      'l': 'long',
      'f': 'float',
      'd': 'double',
      'w': 'wchar_t',
      'a': 'signed char',
      'h': 'unsigned char',
      't': 'unsigned short',
      'j': 'unsigned int',
      'm': 'unsigned long',
      'x': 'long long',
      'y': 'unsigned long long',
      'z': '...'
    };
    var subs = [];
    var first = true;
    function dump(x) {
      //return;
      if (x) Module.print(x);
      Module.print(func);
      var pre = '';
      for (var a = 0; a < i; a++) pre += ' ';
      Module.print (pre + '^');
    }
    function parseNested() {
      i++;
      if (func[i] === 'K') i++; // ignore const
      var parts = [];
      while (func[i] !== 'E') {
        if (func[i] === 'S') { // substitution
          i++;
          var next = func.indexOf('_', i);
          var num = func.substring(i, next) || 0;
          parts.push(subs[num] || '?');
          i = next+1;
          continue;
        }
        if (func[i] === 'C') { // constructor
          parts.push(parts[parts.length-1]);
          i += 2;
          continue;
        }
        var size = parseInt(func.substr(i));
        var pre = size.toString().length;
        if (!size || !pre) { i--; break; } // counter i++ below us
        var curr = func.substr(i + pre, size);
        parts.push(curr);
        subs.push(curr);
        i += pre + size;
      }
      i++; // skip E
      return parts;
    }
    function parse(rawList, limit, allowVoid) { // main parser
      limit = limit || Infinity;
      var ret = '', list = [];
      function flushList() {
        return '(' + list.join(', ') + ')';
      }
      var name;
      if (func[i] === 'N') {
        // namespaced N-E
        name = parseNested().join('::');
        limit--;
        if (limit === 0) return rawList ? [name] : name;
      } else {
        // not namespaced
        if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'
        var size = parseInt(func.substr(i));
        if (size) {
          var pre = size.toString().length;
          name = func.substr(i + pre, size);
          i += pre + size;
        }
      }
      first = false;
      if (func[i] === 'I') {
        i++;
        var iList = parse(true);
        var iRet = parse(true, 1, true);
        ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';
      } else {
        ret = name;
      }
      paramLoop: while (i < func.length && limit-- > 0) {
        //dump('paramLoop');
        var c = func[i++];
        if (c in basicTypes) {
          list.push(basicTypes[c]);
        } else {
          switch (c) {
            case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer
            case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference
            case 'L': { // literal
              i++; // skip basic type
              var end = func.indexOf('E', i);
              var size = end - i;
              list.push(func.substr(i, size));
              i += size + 2; // size + 'EE'
              break;
            }
            case 'A': { // array
              var size = parseInt(func.substr(i));
              i += size.toString().length;
              if (func[i] !== '_') throw '?';
              i++; // skip _
              list.push(parse(true, 1, true)[0] + ' [' + size + ']');
              break;
            }
            case 'E': break paramLoop;
            default: ret += '?' + c; break paramLoop;
          }
        }
      }
      if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)
      if (rawList) {
        if (ret) {
          list.push(ret + '?');
        }
        return list;
      } else {
        return ret + flushList();
      }
    }
    var parsed = func;
    try {
      // Special-case the entry point, since its name differs from other name mangling.
      if (func == 'Object._main' || func == '_main') {
        return 'main()';
      }
      if (typeof func === 'number') func = Pointer_stringify(func);
      if (func[0] !== '_') return func;
      if (func[1] !== '_') return func; // C function
      if (func[2] !== 'Z') return func;
      switch (func[3]) {
        case 'n': return 'operator new()';
        case 'd': return 'operator delete()';
      }
      parsed = parse();
    } catch(e) {
      parsed += '?';
    }
    if (parsed.indexOf('?') >= 0 && !hasLibcxxabi) {
      Runtime.warnOnce('warning: a problem occurred in builtin C++ name demangling; build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling');
    }
    return parsed;
  }
  
  function demangleAll(text) {
    return text.replace(/__Z[\w\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });
  }
  
  function jsStackTrace() {
    var err = new Error();
    if (!err.stack) {
      // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown,
      // so try that as a special-case.
      try {
        throw new Error(0);
      } catch(e) {
        err = e;
      }
      if (!err.stack) {
        return '(no stack trace available)';
      }
    }
    return err.stack.toString();
  }
  
  function stackTrace() {
    return demangleAll(jsStackTrace());
  }
  Module["stackTrace"] = stackTrace;
  
  // Memory management
  
  var PAGE_SIZE = 4096;
  
  function alignMemoryPage(x) {
    if (x % 4096 > 0) {
      x += (4096 - (x % 4096));
    }
    return x;
  }
  
  var HEAP;
  var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
  
  var STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area
  var STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area
  var DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk
  
  
  function abortOnCannotGrowMemory() {
    abort('Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ');
  }
  
  function enlargeMemory() {
    abortOnCannotGrowMemory();
  }
  
  
  var TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;
  var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;
  
  var totalMemory = 64*1024;
  while (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {
    if (totalMemory < 16*1024*1024) {
      totalMemory *= 2;
    } else {
      totalMemory += 16*1024*1024
    }
  }
  if (totalMemory !== TOTAL_MEMORY) {
    Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be compliant with the asm.js spec (and given that TOTAL_STACK=' + TOTAL_STACK + ')');
    TOTAL_MEMORY = totalMemory;
  }
  
  // Initialize the runtime's memory
  // check for full engine support (use string 'subarray' to avoid closure compiler confusion)
  assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
         'JS engine does not provide full typed array support');
  
  var buffer;
  
  
  
  buffer = new ArrayBuffer(TOTAL_MEMORY);
  HEAP8 = new Int8Array(buffer);
  HEAP16 = new Int16Array(buffer);
  HEAP32 = new Int32Array(buffer);
  HEAPU8 = new Uint8Array(buffer);
  HEAPU16 = new Uint16Array(buffer);
  HEAPU32 = new Uint32Array(buffer);
  HEAPF32 = new Float32Array(buffer);
  HEAPF64 = new Float64Array(buffer);
  
  
  // Endianness check (note: assumes compiler arch was little-endian)
  HEAP32[0] = 255;
  assert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');
  
  Module['HEAP'] = HEAP;
  Module['buffer'] = buffer;
  Module['HEAP8'] = HEAP8;
  Module['HEAP16'] = HEAP16;
  Module['HEAP32'] = HEAP32;
  Module['HEAPU8'] = HEAPU8;
  Module['HEAPU16'] = HEAPU16;
  Module['HEAPU32'] = HEAPU32;
  Module['HEAPF32'] = HEAPF32;
  Module['HEAPF64'] = HEAPF64;
  
  function callRuntimeCallbacks(callbacks) {
    while(callbacks.length > 0) {
      var callback = callbacks.shift();
      if (typeof callback == 'function') {
        callback();
        continue;
      }
      var func = callback.func;
      if (typeof func === 'number') {
        if (callback.arg === undefined) {
          Runtime.dynCall('v', func);
        } else {
          Runtime.dynCall('vi', func, [callback.arg]);
        }
      } else {
        func(callback.arg === undefined ? null : callback.arg);
      }
    }
  }
  
  var __ATPRERUN__  = []; // functions called before the runtime is initialized
  var __ATINIT__    = []; // functions called during startup
  var __ATMAIN__    = []; // functions called when main() is to be run
  var __ATEXIT__    = []; // functions called during shutdown
  var __ATPOSTRUN__ = []; // functions called after the runtime has exited
  
  var runtimeInitialized = false;
  var runtimeExited = false;
  
  
  function preRun() {
    // compatibility - merge in anything from Module['preRun'] at this time
    if (Module['preRun']) {
      if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
      while (Module['preRun'].length) {
        addOnPreRun(Module['preRun'].shift());
      }
    }
    callRuntimeCallbacks(__ATPRERUN__);
  }
  
  function ensureInitRuntime() {
    if (runtimeInitialized) return;
    runtimeInitialized = true;
    callRuntimeCallbacks(__ATINIT__);
  }
  
  function preMain() {
    callRuntimeCallbacks(__ATMAIN__);
  }
  
  function exitRuntime() {
    callRuntimeCallbacks(__ATEXIT__);
    runtimeExited = true;
  }
  
  function postRun() {
    // compatibility - merge in anything from Module['postRun'] at this time
    if (Module['postRun']) {
      if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
      while (Module['postRun'].length) {
        addOnPostRun(Module['postRun'].shift());
      }
    }
    callRuntimeCallbacks(__ATPOSTRUN__);
  }
  
  function addOnPreRun(cb) {
    __ATPRERUN__.unshift(cb);
  }
  Module["addOnPreRun"] = addOnPreRun;
  
  function addOnInit(cb) {
    __ATINIT__.unshift(cb);
  }
  Module["addOnInit"] = addOnInit;
  
  function addOnPreMain(cb) {
    __ATMAIN__.unshift(cb);
  }
  Module["addOnPreMain"] = addOnPreMain;
  
  function addOnExit(cb) {
    __ATEXIT__.unshift(cb);
  }
  Module["addOnExit"] = addOnExit;
  
  function addOnPostRun(cb) {
    __ATPOSTRUN__.unshift(cb);
  }
  Module["addOnPostRun"] = addOnPostRun;
  
  // Tools
  
  
  function intArrayFromString(stringy, dontAddNull, length /* optional */) {
    var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
    var u8array = new Array(len);
    var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
    if (dontAddNull) u8array.length = numBytesWritten;
    return u8array;
  }
  Module["intArrayFromString"] = intArrayFromString;
  
  function intArrayToString(array) {
    var ret = [];
    for (var i = 0; i < array.length; i++) {
      var chr = array[i];
      if (chr > 0xFF) {
        assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ')  at offset ' + i + ' not in 0x00-0xFF.');
        chr &= 0xFF;
      }
      ret.push(String.fromCharCode(chr));
    }
    return ret.join('');
  }
  Module["intArrayToString"] = intArrayToString;
  
  function writeStringToMemory(string, buffer, dontAddNull) {
    var array = intArrayFromString(string, dontAddNull);
    var i = 0;
    while (i < array.length) {
      var chr = array[i];
      HEAP8[(((buffer)+(i))>>0)]=chr;
      i = i + 1;
    }
  }
  Module["writeStringToMemory"] = writeStringToMemory;
  
  function writeArrayToMemory(array, buffer) {
    for (var i = 0; i < array.length; i++) {
      HEAP8[((buffer++)>>0)]=array[i];
    }
  }
  Module["writeArrayToMemory"] = writeArrayToMemory;
  
  function writeAsciiToMemory(str, buffer, dontAddNull) {
    for (var i = 0; i < str.length; ++i) {
      assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff);
      HEAP8[((buffer++)>>0)]=str.charCodeAt(i);
    }
    // Null-terminate the pointer to the HEAP.
    if (!dontAddNull) HEAP8[((buffer)>>0)]=0;
  }
  Module["writeAsciiToMemory"] = writeAsciiToMemory;
  
  function unSign(value, bits, ignore) {
    if (value >= 0) {
      return value;
    }
    return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts
                      : Math.pow(2, bits)         + value;
  }
  function reSign(value, bits, ignore) {
    if (value <= 0) {
      return value;
    }
    var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32
                          : Math.pow(2, bits-1);
    if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that
                                                         // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors
                                                         // TODO: In i64 mode 1, resign the two parts separately and safely
      value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts
    }
    return value;
  }
  
  
  // check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )
  if (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {
    var ah  = a >>> 16;
    var al = a & 0xffff;
    var bh  = b >>> 16;
    var bl = b & 0xffff;
    return (al*bl + ((ah*bl + al*bh) << 16))|0;
  };
  Math.imul = Math['imul'];
  
  
  if (!Math['clz32']) Math['clz32'] = function(x) {
    x = x >>> 0;
    for (var i = 0; i < 32; i++) {
      if (x & (1 << (31 - i))) return i;
    }
    return 32;
  };
  Math.clz32 = Math['clz32']
  
  var Math_abs = Math.abs;
  var Math_cos = Math.cos;
  var Math_sin = Math.sin;
  var Math_tan = Math.tan;
  var Math_acos = Math.acos;
  var Math_asin = Math.asin;
  var Math_atan = Math.atan;
  var Math_atan2 = Math.atan2;
  var Math_exp = Math.exp;
  var Math_log = Math.log;
  var Math_sqrt = Math.sqrt;
  var Math_ceil = Math.ceil;
  var Math_floor = Math.floor;
  var Math_pow = Math.pow;
  var Math_imul = Math.imul;
  var Math_fround = Math.fround;
  var Math_min = Math.min;
  var Math_clz32 = Math.clz32;
  
  // A counter of dependencies for calling run(). If we need to
  // do asynchronous work before running, increment this and
  // decrement it. Incrementing must happen in a place like
  // PRE_RUN_ADDITIONS (used by emcc to add file preloading).
  // Note that you can add dependencies in preRun, even though
  // it happens right before run - run will be postponed until
  // the dependencies are met.
  var runDependencies = 0;
  var runDependencyWatcher = null;
  var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
  var runDependencyTracking = {};
  
  function getUniqueRunDependency(id) {
    var orig = id;
    while (1) {
      if (!runDependencyTracking[id]) return id;
      id = orig + Math.random();
    }
    return id;
  }
  
  function addRunDependency(id) {
    runDependencies++;
    if (Module['monitorRunDependencies']) {
      Module['monitorRunDependencies'](runDependencies);
    }
    if (id) {
      assert(!runDependencyTracking[id]);
      runDependencyTracking[id] = 1;
      if (runDependencyWatcher === null && typeof setInterval !== 'undefined') {
        // Check for missing dependencies every few seconds
        runDependencyWatcher = setInterval(function() {
          if (ABORT) {
            clearInterval(runDependencyWatcher);
            runDependencyWatcher = null;
            return;
          }
          var shown = false;
          for (var dep in runDependencyTracking) {
            if (!shown) {
              shown = true;
              Module.printErr('still waiting on run dependencies:');
            }
            Module.printErr('dependency: ' + dep);
          }
          if (shown) {
            Module.printErr('(end of list)');
          }
        }, 10000);
      }
    } else {
      Module.printErr('warning: run dependency added without ID');
    }
  }
  Module["addRunDependency"] = addRunDependency;
  
  function removeRunDependency(id) {
    runDependencies--;
    if (Module['monitorRunDependencies']) {
      Module['monitorRunDependencies'](runDependencies);
    }
    if (id) {
      assert(runDependencyTracking[id]);
      delete runDependencyTracking[id];
    } else {
      Module.printErr('warning: run dependency removed without ID');
    }
    if (runDependencies == 0) {
      if (runDependencyWatcher !== null) {
        clearInterval(runDependencyWatcher);
        runDependencyWatcher = null;
      }
      if (dependenciesFulfilled) {
        var callback = dependenciesFulfilled;
        dependenciesFulfilled = null;
        callback(); // can add another dependenciesFulfilled
      }
    }
  }
  Module["removeRunDependency"] = removeRunDependency;
  
  Module["preloadedImages"] = {}; // maps url to image data
  Module["preloadedAudios"] = {}; // maps url to audio data
  
  
  
  var memoryInitializer = null;
  
  
  
  // === Body ===
  
  var ASM_CONSTS = [function($0, $1, $2) { { window.fo_canvas = document.createElement('canvas'); document.body.style.margin = '0px'; window.fo_canvas.style.cursor = 'none'; window.fo_canvas.width = $0; window.fo_canvas.height = $1; window.fo_buf_address = $2; window.fo_buf_size = 4 * $0 * $1; document.body.appendChild(window.fo_canvas); window.fo_context = window.fo_canvas.getContext('2d'); window.fo_canvas_data = window.fo_context.getImageData(0, 0, $0, $1); setInterval(function() { window.fo_canvas_data.data.set( Module.HEAPU8.subarray( window.fo_buf_address, window.fo_buf_address + window.fo_buf_size ) ); window.fo_context.putImageData(window.fo_canvas_data, 0, 0); }, 17); } },
   function($0) { { return window.fo_mouse_x; } },
   function($0) { { return window.fo_mouse_y; } },
   function($0) { { return window.fo_button_status; } },
   function() { window.fo_button_status = 0; window.fo_mouse_x = 0; window.fo_mouse_y = 0; window.fo_canvas.onmousemove = function(e) { window.fo_mouse_x = e.clientX; window.fo_mouse_y = e.clientY; Module.ccall('fake_os_doMouseCallback'); }; window.fo_canvas.onmousedown = function(e) { window.fo_button_status = 1; Module.ccall('fake_os_doMouseCallback'); }; window.fo_canvas.onmouseup = function(e) { window.fo_button_status = 0; Module.ccall('fake_os_doMouseCallback'); }; }];
  
  function _emscripten_asm_const_0(code) {
   return ASM_CONSTS[code]();
  }
  
  function _emscripten_asm_const_1(code, a0) {
   return ASM_CONSTS[code](a0);
  }
  
  function _emscripten_asm_const_3(code, a0, a1, a2) {
   return ASM_CONSTS[code](a0, a1, a2);
  }
  
  
  
  STATIC_BASE = 8;
  
  STATICTOP = STATIC_BASE + 4128;
    /* global initializers */  __ATINIT__.push();
    
  
  /* memory initializer */ allocate([0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,32,61,32,100,111,99,117,109,101,110,116,46,99,114,101,97,116,101,69,108,101,109,101,110,116,40,39,99,97,110,118,97,115,39,41,59,32,100,111,99,117,109,101,110,116,46,98,111,100,121,46,115,116,121,108,101,46,109,97,114,103,105,110,32,61,32,39,48,112,120,39,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,115,116,121,108,101,46,99,117,114,115,111,114,32,61,32,39,110,111,110,101,39,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,119,105,100,116,104,32,61,32,36,48,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,104,101,105,103,104,116,32,61,32,36,49,59,32,119,105,110,100,111,119,46,102,111,95,98,117,102,95,97,100,100,114,101,115,115,32,61,32,36,50,59,32,119,105,110,100,111,119,46,102,111,95,98,117,102,95,115,105,122,101,32,61,32,52,32,42,32,36,48,32,42,32,36,49,59,32,100,111,99,117,109,101,110,116,46,98,111,100,121,46,97,112,112,101,110,100,67,104,105,108,100,40,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,41,59,32,119,105,110,100,111,119,46,102,111,95,99,111,110,116,101,120,116,32,61,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,103,101,116,67,111,110,116,101,120,116,40,39,50,100,39,41,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,95,100,97,116,97,32,61,32,119,105,110,100,111,119,46,102,111,95,99,111,110,116,101,120,116,46,103,101,116,73,109,97,103,101,68,97,116,97,40,48,44,32,48,44,32,36,48,44,32,36,49,41,59,32,115,101,116,73,110,116,101,114,118,97,108,40,102,117,110,99,116,105,111,110,40,41,32,123,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,95,100,97,116,97,46,100,97,116,97,46,115,101,116,40,32,77,111,100,117,108,101,46,72,69,65,80,85,56,46,115,117,98,97,114,114,97,121,40,32,119,105,110,100,111,119,46,102,111,95,98,117,102,95,97,100,100,114,101,115,115,44,32,119,105,110,100,111,119,46,102,111,95,98,117,102,95,97,100,100,114,101,115,115,32,43,32,119,105,110,100,111,119,46,102,111,95,98,117,102,95,115,105,122,101,32,41,32,41,59,32,119,105,110,100,111,119,46,102,111,95,99,111,110,116,101,120,116,46,112,117,116,73,109,97,103,101,68,97,116,97,40,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,95,100,97,116,97,44,32,48,44,32,48,41,59,32,125,44,32,49,55,41,59,32,125,0,123,32,114,101,116,117,114,110,32,119,105,110,100,111,119,46,102,111,95,109,111,117,115,101,95,120,59,32,125,0,123,32,114,101,116,117,114,110,32,119,105,110,100,111,119,46,102,111,95,109,111,117,115,101,95,121,59,32,125,0,123,32,114,101,116,117,114,110,32,119,105,110,100,111,119,46,102,111,95,98,117,116,116,111,110,95,115,116,97,116,117,115,59,32,125,0,119,105,110,100,111,119,46,102,111,95,98,117,116,116,111,110,95,115,116,97,116,117,115,32,61,32,48,59,32,119,105,110,100,111,119,46,102,111,95,109,111,117,115,101,95,120,32,61,32,48,59,32,119,105,110,100,111,119,46,102,111,95,109,111,117,115,101,95,121,32,61,32,48,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,111,110,109,111,117,115,101,109,111,118,101,32,61,32,102,117,110,99,116,105,111,110,40,101,41,32,123,32,119,105,110,100,111,119,46,102,111,95,109,111,117,115,101,95,120,32,61,32,101,46,99,108,105,101,110,116,88,59,32,119,105,110,100,111,119,46,102,111,95,109,111,117,115,101,95,121,32,61,32,101,46,99,108,105,101,110,116,89,59,32,77,111,100,117,108,101,46,99,99,97,108,108,40,39,102,97,107,101,95,111,115,95,100,111,77,111,117,115,101,67,97,108,108,98,97,99,107,39,41,59,32,125,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,111,110,109,111,117,115,101,100,111,119,110,32,61,32,102,117,110,99,116,105,111,110,40,101,41,32,123,32,119,105,110,100,111,119,46,102,111,95,98,117,116,116,111,110,95,115,116,97,116,117,115,32,61,32,49,59,32,77,111,100,117,108,101,46,99,99,97,108,108,40,39,102,97,107,101,95,111,115,95,100,111,77,111,117,115,101,67,97,108,108,98,97,99,107,39,41,59,32,125,59,32,119,105,110,100,111,119,46,102,111,95,99,97,110,118,97,115,46,111,110,109,111,117,115,101,117,112,32,61,32,102,117,110,99,116,105,111,110,40,101,41,32,123,32,119,105,110,100,111,119,46,102,111,95,98,117,116,116,111,110,95,115,116,97,116,117,115,32,61,32,48,59,32,77,111,100,117,108,101,46,99,99,97,108,108,40,39,102,97,107,101,95,111,115,95,100,111,77,111,117,115,101,67,97,108,108,98,97,99,107,39,41,59,32,125,59,0,48,0,49,0,50,0,51,0,52,0,53,0,54,0,55,0,56,0,57,0,67,97,108,99,117,108,97,116,111,114,0,43,0,45,0,42,0,67,0,61,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,36,0,0,0,0,16,8,32,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,36,0,8,0,0,16,16,16,84,0,0,0,0,4,56,8,60,126,4,62,60,126,24,60,0,0,0,0,0,24,0,24,112,60,120,126,126,60,66,124,126,68,64,65,66,60,124,60,124,60,127,66,66,65,66,68,126,28,64,56,16,0,48,0,64,0,2,0,0,0,64,0,0,32,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,36,18,28,64,24,16,16,16,56,0,0,0,0,4,76,24,66,2,12,32,66,2,36,66,16,0,0,0,0,36,56,36,72,66,68,64,64,66,66,16,4,68,64,99,98,66,66,66,66,66,8,66,66,65,66,68,2,16,64,8,40,0,16,0,64,0,2,0,12,0,64,0,0,32,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,72,18,42,162,32,16,32,8,40,16,0,0,0,8,76,40,66,4,20,64,64,4,36,66,16,16,2,0,64,66,68,66,68,64,66,64,64,64,66,16,4,72,64,99,98,66,66,66,66,64,8,66,66,65,36,68,2,16,32,8,68,0,0,0,64,0,2,0,18,0,64,16,4,32,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,127,40,164,16,0,32,8,40,16,0,0,0,8,76,8,2,24,36,64,64,8,24,66,0,0,12,126,48,2,130,66,68,64,66,64,64,64,66,16,4,80,64,85,82,66,66,66,66,32,8,66,66,65,36,68,4,16,32,8,0,0,0,56,64,0,2,0,16,30,64,0,0,32,16,84,44,60,92,60,44,28,62,36,34,68,66,36,62,16,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,36,24,72,32,0,32,8,0,124,0,126,0,16,84,8,2,4,68,124,92,8,36,62,0,0,48,0,12,4,146,66,120,64,66,124,124,64,66,16,4,96,64,85,82,66,124,66,124,24,8,66,66,73,24,40,8,16,16,8,0,0,0,4,92,60,58,60,16,34,64,0,4,34,16,42,18,66,34,68,18,34,16,36,34,68,34,36,2,32,8,4,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,36,12,16,82,0,32,8,0,16,0,0,0,16,84,8,4,2,68,2,98,16,66,2,0,0,64,0,2,8,170,126,68,64,66,64,64,78,126,16,4,80,64,73,74,66,64,66,80,4,8,66,66,73,24,16,16,16,16,8,0,0,0,60,98,66,70,66,60,34,92,16,4,44,16,42,18,66,34,68,16,32,16,36,34,84,36,36,4,16,8,8,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,254,10,34,74,0,32,8,0,16,0,0,0,32,84,8,8,2,126,2,66,16,66,2,16,16,48,126,12,16,170,66,66,64,66,64,64,66,66,16,68,72,64,73,74,66,64,66,76,2,8,66,36,73,36,16,32,16,8,8,0,0,0,68,66,64,66,126,16,30,98,16,4,48,16,42,18,66,50,60,16,28,16,36,34,84,24,28,8,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,10,69,68,0,32,8,0,0,0,0,0,32,100,8,16,2,4,66,66,16,66,2,16,16,12,0,48,16,148,66,66,64,66,64,64,66,66,16,68,68,64,65,70,66,64,74,66,66,8,66,36,73,36,16,64,16,8,8,0,0,0,68,66,64,66,64,16,2,66,16,4,40,16,42,18,66,44,4,16,2,16,36,34,84,36,4,16,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,42,5,58,0,16,16,0,0,32,0,0,64,100,8,32,68,4,66,66,16,66,4,0,32,2,0,64,0,64,66,66,66,68,64,64,66,66,16,68,66,64,65,70,66,64,68,66,66,8,66,36,73,66,16,64,16,4,8,0,0,0,68,98,66,70,66,16,34,66,16,36,36,16,42,18,66,32,4,16,34,16,36,20,84,68,4,32,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,28,2,0,0,16,16,0,0,32,0,0,64,56,8,126,56,4,60,60,16,60,56,0,0,0,0,0,0,56,66,124,60,120,126,64,60,66,124,56,66,126,65,66,60,64,58,66,60,8,60,24,54,66,16,126,28,4,56,0,127,0,58,92,60,58,60,16,28,66,8,24,34,8,42,18,60,32,2,16,28,14,26,8,42,66,56,62,8,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,8,0,0,0,8,32,0,0,64,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,96,0,0,87,105,110,100,111,119,105,110,103,32,83,121,115,116,101,109,115,32,98,121,32,69,120,97,109,112,108,101,0,78,101,119,32,67,97,108,99,117,108,97,116,111,114,0], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE);
  
  
  
  
  
  /* no memory initializer */
  var tempDoublePtr = Runtime.alignMemory(allocate(12, "i8", ALLOC_STATIC), 8);
  
  assert(tempDoublePtr % 8 == 0);
  
  function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much
  
    HEAP8[tempDoublePtr] = HEAP8[ptr];
  
    HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
  
    HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
  
    HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
  
  }
  
  function copyTempDouble(ptr) {
  
    HEAP8[tempDoublePtr] = HEAP8[ptr];
  
    HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
  
    HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
  
    HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
  
    HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];
  
    HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];
  
    HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];
  
    HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];
  
  }
  
  // {{PRE_LIBRARY}}
  
  
    function _sbrk(bytes) {
        // Implement a Linux-like 'memory area' for our 'process'.
        // Changes the size of the memory area by |bytes|; returns the
        // address of the previous top ('break') of the memory area
        // We control the "dynamic" memory - DYNAMIC_BASE to DYNAMICTOP
        var self = _sbrk;
        if (!self.called) {
          DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned
          self.called = true;
          assert(Runtime.dynamicAlloc);
          self.alloc = Runtime.dynamicAlloc;
          Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };
        }
        var ret = DYNAMICTOP;
        if (bytes != 0) {
          var success = self.alloc(bytes);
          if (!success) return -1 >>> 0; // sbrk failure code
        }
        return ret;  // Previous break location.
      }
  
    
    function ___setErrNo(value) {
        if (Module['___errno_location']) HEAP32[((Module['___errno_location']())>>2)]=value;
        else Module.printErr('failed to set errno from JS');
        return value;
      }
    
    var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(name) {
        // long sysconf(int name);
        // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
        switch(name) {
          case 30: return PAGE_SIZE;
          case 85: return totalMemory / PAGE_SIZE;
          case 132:
          case 133:
          case 12:
          case 137:
          case 138:
          case 15:
          case 235:
          case 16:
          case 17:
          case 18:
          case 19:
          case 20:
          case 149:
          case 13:
          case 10:
          case 236:
          case 153:
          case 9:
          case 21:
          case 22:
          case 159:
          case 154:
          case 14:
          case 77:
          case 78:
          case 139:
          case 80:
          case 81:
          case 82:
          case 68:
          case 67:
          case 164:
          case 11:
          case 29:
          case 47:
          case 48:
          case 95:
          case 52:
          case 51:
          case 46:
            return 200809;
          case 79:
            return 0;
          case 27:
          case 246:
          case 127:
          case 128:
          case 23:
          case 24:
          case 160:
          case 161:
          case 181:
          case 182:
          case 242:
          case 183:
          case 184:
          case 243:
          case 244:
          case 245:
          case 165:
          case 178:
          case 179:
          case 49:
          case 50:
          case 168:
          case 169:
          case 175:
          case 170:
          case 171:
          case 172:
          case 97:
          case 76:
          case 32:
          case 173:
          case 35:
            return -1;
          case 176:
          case 177:
          case 7:
          case 155:
          case 8:
          case 157:
          case 125:
          case 126:
          case 92:
          case 93:
          case 129:
          case 130:
          case 131:
          case 94:
          case 91:
            return 1;
          case 74:
          case 60:
          case 69:
          case 70:
          case 4:
            return 1024;
          case 31:
          case 42:
          case 72:
            return 32;
          case 87:
          case 26:
          case 33:
            return 2147483647;
          case 34:
          case 1:
            return 47839;
          case 38:
          case 36:
            return 99;
          case 43:
          case 37:
            return 2048;
          case 0: return 2097152;
          case 3: return 65536;
          case 28: return 32768;
          case 44: return 32767;
          case 75: return 16384;
          case 39: return 1000;
          case 89: return 700;
          case 71: return 256;
          case 40: return 255;
          case 2: return 100;
          case 180: return 64;
          case 25: return 20;
          case 5: return 16;
          case 6: return 6;
          case 73: return 4;
          case 84: {
            if (typeof navigator === 'object') return navigator['hardwareConcurrency'] || 1;
            return 1;
          }
        }
        ___setErrNo(ERRNO_CODES.EINVAL);
        return -1;
      }
  
     
    Module["_memset"] = _memset;
  
    var _emscripten_asm_const=true;
  
    var _emscripten_asm_const_int=true;
  
    function _abort() {
        Module['abort']();
      }
  
    
    
    
    var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can   access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};
    
    var TTY={ttys:[],init:function () {
          // https://github.com/kripken/emscripten/pull/1555
          // if (ENVIRONMENT_IS_NODE) {
          //   // currently, FS.init does not distinguish if process.stdin is a file or TTY
          //   // device, it always assumes it's a TTY device. because of this, we're forcing
          //   // process.stdin to UTF8 encoding to at least make stdin reading compatible
          //   // with text files until FS.init can be refactored.
          //   process['stdin']['setEncoding']('utf8');
          // }
        },shutdown:function () {
          // https://github.com/kripken/emscripten/pull/1555
          // if (ENVIRONMENT_IS_NODE) {
          //   // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
          //   // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation
          //   // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
          //   // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
          //   // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
          //   process['stdin']['pause']();
          // }
        },register:function (dev, ops) {
          TTY.ttys[dev] = { input: [], output: [], ops: ops };
          FS.registerDevice(dev, TTY.stream_ops);
        },stream_ops:{open:function (stream) {
            var tty = TTY.ttys[stream.node.rdev];
            if (!tty) {
              throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
            }
            stream.tty = tty;
            stream.seekable = false;
          },close:function (stream) {
            // flush any pending line data
            stream.tty.ops.flush(stream.tty);
          },flush:function (stream) {
            stream.tty.ops.flush(stream.tty);
          },read:function (stream, buffer, offset, length, pos /* ignored */) {
            if (!stream.tty || !stream.tty.ops.get_char) {
              throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
            }
            var bytesRead = 0;
            for (var i = 0; i < length; i++) {
              var result;
              try {
                result = stream.tty.ops.get_char(stream.tty);
              } catch (e) {
                throw new FS.ErrnoError(ERRNO_CODES.EIO);
              }
              if (result === undefined && bytesRead === 0) {
                throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
              }
              if (result === null || result === undefined) break;
              bytesRead++;
              buffer[offset+i] = result;
            }
            if (bytesRead) {
              stream.node.timestamp = Date.now();
            }
            return bytesRead;
          },write:function (stream, buffer, offset, length, pos) {
            if (!stream.tty || !stream.tty.ops.put_char) {
              throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
            }
            for (var i = 0; i < length; i++) {
              try {
                stream.tty.ops.put_char(stream.tty, buffer[offset+i]);
              } catch (e) {
                throw new FS.ErrnoError(ERRNO_CODES.EIO);
              }
            }
            if (length) {
              stream.node.timestamp = Date.now();
            }
            return i;
          }},default_tty_ops:{get_char:function (tty) {
            if (!tty.input.length) {
              var result = null;
              if (ENVIRONMENT_IS_NODE) {
                // we will read data by chunks of BUFSIZE
                var BUFSIZE = 256;
                var buf = new Buffer(BUFSIZE);
                var bytesRead = 0;
    
                var fd = process.stdin.fd;
                // Linux and Mac cannot use process.stdin.fd (which isn't set up as sync)
                var usingDevice = false;
                try {
                  fd = fs.openSync('/dev/stdin', 'r');
                  usingDevice = true;
                } catch (e) {}
    
                bytesRead = fs.readSync(fd, buf, 0, BUFSIZE, null);
    
                if (usingDevice) { fs.closeSync(fd); }
                if (bytesRead > 0) {
                  result = buf.slice(0, bytesRead).toString('utf-8');
                } else {
                  result = null;
                }
    
              } else if (typeof window != 'undefined' &&
                typeof window.prompt == 'function') {
                // Browser.
                result = window.prompt('Input: ');  // returns null on cancel
                if (result !== null) {
                  result += '\n';
                }
              } else if (typeof readline == 'function') {
                // Command line.
                result = readline();
                if (result !== null) {
                  result += '\n';
                }
              }
              if (!result) {
                return null;
              }
              tty.input = intArrayFromString(result, true);
            }
            return tty.input.shift();
          },put_char:function (tty, val) {
            if (val === null || val === 10) {
              Module['print'](UTF8ArrayToString(tty.output, 0));
              tty.output = [];
            } else {
              if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle.
            }
          },flush:function (tty) {
            if (tty.output && tty.output.length > 0) {
              Module['print'](UTF8ArrayToString(tty.output, 0));
              tty.output = [];
            }
          }},default_tty1_ops:{put_char:function (tty, val) {
            if (val === null || val === 10) {
              Module['printErr'](UTF8ArrayToString(tty.output, 0));
              tty.output = [];
            } else {
              if (val != 0) tty.output.push(val);
            }
          },flush:function (tty) {
            if (tty.output && tty.output.length > 0) {
              Module['printErr'](UTF8ArrayToString(tty.output, 0));
              tty.output = [];
            }
          }}};
    
    var MEMFS={ops_table:null,mount:function (mount) {
          return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);
        },createNode:function (parent, name, mode, dev) {
          if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
            // no supported
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          if (!MEMFS.ops_table) {
            MEMFS.ops_table = {
              dir: {
                node: {
                  getattr: MEMFS.node_ops.getattr,
                  setattr: MEMFS.node_ops.setattr,
                  lookup: MEMFS.node_ops.lookup,
                  mknod: MEMFS.node_ops.mknod,
                  rename: MEMFS.node_ops.rename,
                  unlink: MEMFS.node_ops.unlink,
                  rmdir: MEMFS.node_ops.rmdir,
                  readdir: MEMFS.node_ops.readdir,
                  symlink: MEMFS.node_ops.symlink
                },
                stream: {
                  llseek: MEMFS.stream_ops.llseek
                }
              },
              file: {
                node: {
                  getattr: MEMFS.node_ops.getattr,
                  setattr: MEMFS.node_ops.setattr
                },
                stream: {
                  llseek: MEMFS.stream_ops.llseek,
                  read: MEMFS.stream_ops.read,
                  write: MEMFS.stream_ops.write,
                  allocate: MEMFS.stream_ops.allocate,
                  mmap: MEMFS.stream_ops.mmap,
                  msync: MEMFS.stream_ops.msync
                }
              },
              link: {
                node: {
                  getattr: MEMFS.node_ops.getattr,
                  setattr: MEMFS.node_ops.setattr,
                  readlink: MEMFS.node_ops.readlink
                },
                stream: {}
              },
              chrdev: {
                node: {
                  getattr: MEMFS.node_ops.getattr,
                  setattr: MEMFS.node_ops.setattr
                },
                stream: FS.chrdev_stream_ops
              }
            };
          }
          var node = FS.createNode(parent, name, mode, dev);
          if (FS.isDir(node.mode)) {
            node.node_ops = MEMFS.ops_table.dir.node;
            node.stream_ops = MEMFS.ops_table.dir.stream;
            node.contents = {};
          } else if (FS.isFile(node.mode)) {
            node.node_ops = MEMFS.ops_table.file.node;
            node.stream_ops = MEMFS.ops_table.file.stream;
            node.usedBytes = 0; // The actual number of bytes used in the typed array, as opposed to contents.buffer.byteLength which gives the whole capacity.
            // When the byte data of the file is populated, this will point to either a typed array, or a normal JS array. Typed arrays are preferred
            // for performance, and used by default. However, typed arrays are not resizable like normal JS arrays are, so there is a small disk size
            // penalty involved for appending file writes that continuously grow a file similar to std::vector capacity vs used -scheme.
            node.contents = null; 
          } else if (FS.isLink(node.mode)) {
            node.node_ops = MEMFS.ops_table.link.node;
            node.stream_ops = MEMFS.ops_table.link.stream;
          } else if (FS.isChrdev(node.mode)) {
            node.node_ops = MEMFS.ops_table.chrdev.node;
            node.stream_ops = MEMFS.ops_table.chrdev.stream;
          }
          node.timestamp = Date.now();
          // add the new node to the parent
          if (parent) {
            parent.contents[name] = node;
          }
          return node;
        },getFileDataAsRegularArray:function (node) {
          if (node.contents && node.contents.subarray) {
            var arr = [];
            for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]);
            return arr; // Returns a copy of the original data.
          }
          return node.contents; // No-op, the file contents are already in a JS array. Return as-is.
        },getFileDataAsTypedArray:function (node) {
          if (!node.contents) return new Uint8Array;
          if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes.
          return new Uint8Array(node.contents);
        },expandFileStorage:function (node, newCapacity) {
          // If we are asked to expand the size of a file that already exists, revert to using a standard JS array to store the file
          // instead of a typed array. This makes resizing the array more flexible because we can just .push() elements at the back to
          // increase the size.
          if (node.contents && node.contents.subarray && newCapacity > node.contents.length) {
            node.contents = MEMFS.getFileDataAsRegularArray(node);
            node.usedBytes = node.contents.length; // We might be writing to a lazy-loaded file which had overridden this property, so force-reset it.
          }
    
          if (!node.contents || node.contents.subarray) { // Keep using a typed array if creating a new storage, or if old one was a typed array as well.
            var prevCapacity = node.contents ? node.contents.buffer.byteLength : 0;
            if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough.
            // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity.
            // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to
            // avoid overshooting the allocation cap by a very large margin.
            var CAPACITY_DOUBLING_MAX = 1024 * 1024;
            newCapacity = Math.max(newCapacity, (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) | 0);
            if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding.
            var oldContents = node.contents;
            node.contents = new Uint8Array(newCapacity); // Allocate new storage.
            if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0); // Copy old data over to the new storage.
            return;
          }
          // Not using a typed array to back the file storage. Use a standard JS array instead.
          if (!node.contents && newCapacity > 0) node.contents = [];
          while (node.contents.length < newCapacity) node.contents.push(0);
        },resizeFileStorage:function (node, newSize) {
          if (node.usedBytes == newSize) return;
          if (newSize == 0) {
            node.contents = null; // Fully decommit when requesting a resize to zero.
            node.usedBytes = 0;
            return;
          }
          if (!node.contents || node.contents.subarray) { // Resize a typed array if that is being used as the backing store.
            var oldContents = node.contents;
            node.contents = new Uint8Array(new ArrayBuffer(newSize)); // Allocate new storage.
            if (oldContents) {
              node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); // Copy old data over to the new storage.
            }
            node.usedBytes = newSize;
            return;
          }
          // Backing with a JS array.
          if (!node.contents) node.contents = [];
          if (node.contents.length > newSize) node.contents.length = newSize;
          else while (node.contents.length < newSize) node.contents.push(0);
          node.usedBytes = newSize;
        },node_ops:{getattr:function (node) {
            var attr = {};
            // device numbers reuse inode numbers.
            attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
            attr.ino = node.id;
            attr.mode = node.mode;
            attr.nlink = 1;
            attr.uid = 0;
            attr.gid = 0;
            attr.rdev = node.rdev;
            if (FS.isDir(node.mode)) {
              attr.size = 4096;
            } else if (FS.isFile(node.mode)) {
              attr.size = node.usedBytes;
            } else if (FS.isLink(node.mode)) {
              attr.size = node.link.length;
            } else {
              attr.size = 0;
            }
            attr.atime = new Date(node.timestamp);
            attr.mtime = new Date(node.timestamp);
            attr.ctime = new Date(node.timestamp);
            // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),
            //       but this is not required by the standard.
            attr.blksize = 4096;
            attr.blocks = Math.ceil(attr.size / attr.blksize);
            return attr;
          },setattr:function (node, attr) {
            if (attr.mode !== undefined) {
              node.mode = attr.mode;
            }
            if (attr.timestamp !== undefined) {
              node.timestamp = attr.timestamp;
            }
            if (attr.size !== undefined) {
              MEMFS.resizeFileStorage(node, attr.size);
            }
          },lookup:function (parent, name) {
            throw FS.genericErrors[ERRNO_CODES.ENOENT];
          },mknod:function (parent, name, mode, dev) {
            return MEMFS.createNode(parent, name, mode, dev);
          },rename:function (old_node, new_dir, new_name) {
            // if we're overwriting a directory at new_name, make sure it's empty.
            if (FS.isDir(old_node.mode)) {
              var new_node;
              try {
                new_node = FS.lookupNode(new_dir, new_name);
              } catch (e) {
              }
              if (new_node) {
                for (var i in new_node.contents) {
                  throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
                }
              }
            }
            // do the internal rewiring
            delete old_node.parent.contents[old_node.name];
            old_node.name = new_name;
            new_dir.contents[new_name] = old_node;
            old_node.parent = new_dir;
          },unlink:function (parent, name) {
            delete parent.contents[name];
          },rmdir:function (parent, name) {
            var node = FS.lookupNode(parent, name);
            for (var i in node.contents) {
              throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
            }
            delete parent.contents[name];
          },readdir:function (node) {
            var entries = ['.', '..']
            for (var key in node.contents) {
              if (!node.contents.hasOwnProperty(key)) {
                continue;
              }
              entries.push(key);
            }
            return entries;
          },symlink:function (parent, newname, oldpath) {
            var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);
            node.link = oldpath;
            return node;
          },readlink:function (node) {
            if (!FS.isLink(node.mode)) {
              throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
            }
            return node.link;
          }},stream_ops:{read:function (stream, buffer, offset, length, position) {
            var contents = stream.node.contents;
            if (position >= stream.node.usedBytes) return 0;
            var size = Math.min(stream.node.usedBytes - position, length);
            assert(size >= 0);
            if (size > 8 && contents.subarray) { // non-trivial, and typed array
              buffer.set(contents.subarray(position, position + size), offset);
            } else {
              for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
            }
            return size;
          },write:function (stream, buffer, offset, length, position, canOwn) {
            if (!length) return 0;
            var node = stream.node;
            node.timestamp = Date.now();
    
            if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array?
              if (canOwn) { // Can we just reuse the buffer we are given?
                assert(position === 0, 'canOwn must imply no weird position inside the file');
                node.contents = buffer.subarray(offset, offset + length);
                node.usedBytes = length;
                return length;
              } else if (node.usedBytes === 0 && position === 0) { // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
                node.contents = new Uint8Array(buffer.subarray(offset, offset + length));
                node.usedBytes = length;
                return length;
              } else if (position + length <= node.usedBytes) { // Writing to an already allocated and used subrange of the file?
                node.contents.set(buffer.subarray(offset, offset + length), position);
                return length;
              }
            }
    
            // Appending to an existing file and we need to reallocate, or source data did not come as a typed array.
            MEMFS.expandFileStorage(node, position+length);
            if (node.contents.subarray && buffer.subarray) node.contents.set(buffer.subarray(offset, offset + length), position); // Use typed array write if available.
            else {
              for (var i = 0; i < length; i++) {
               node.contents[position + i] = buffer[offset + i]; // Or fall back to manual write if not.
              }
            }
            node.usedBytes = Math.max(node.usedBytes, position+length);
            return length;
          },llseek:function (stream, offset, whence) {
            var position = offset;
            if (whence === 1) {  // SEEK_CUR.
              position += stream.position;
            } else if (whence === 2) {  // SEEK_END.
              if (FS.isFile(stream.node.mode)) {
                position += stream.node.usedBytes;
              }
            }
            if (position < 0) {
              throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
            }
            return position;
          },allocate:function (stream, offset, length) {
            MEMFS.expandFileStorage(stream.node, offset + length);
            stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
          },mmap:function (stream, buffer, offset, length, position, prot, flags) {
            if (!FS.isFile(stream.node.mode)) {
              throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
            }
            var ptr;
            var allocated;
            var contents = stream.node.contents;
            // Only make a new copy when MAP_PRIVATE is specified.
            if ( !(flags & 2) &&
                  (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {
              // We can't emulate MAP_SHARED when the file is not backed by the buffer
              // we're mapping to (e.g. the HEAP buffer).
              allocated = false;
              ptr = contents.byteOffset;
            } else {
              // Try to avoid unnecessary slices.
              if (position > 0 || position + length < stream.node.usedBytes) {
                if (contents.subarray) {
                  contents = contents.subarray(position, position + length);
                } else {
                  contents = Array.prototype.slice.call(contents, position, position + length);
                }
              }
              allocated = true;
              ptr = _malloc(length);
              if (!ptr) {
                throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
              }
              buffer.set(contents, ptr);
            }
            return { ptr: ptr, allocated: allocated };
          },msync:function (stream, buffer, offset, length, mmapFlags) {
            if (!FS.isFile(stream.node.mode)) {
              throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
            }
            if (mmapFlags & 2) {
              // MAP_PRIVATE calls need not to be synced back to underlying fs
              return 0;
            }
    
            var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false);
            // should we check if bytesWritten and length are the same?
            return 0;
          }}};
    
    var IDBFS={dbs:{},indexedDB:function () {
          if (typeof indexedDB !== 'undefined') return indexedDB;
          var ret = null;
          if (typeof window === 'object') ret = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
          assert(ret, 'IDBFS used, but indexedDB not supported');
          return ret;
        },DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function (mount) {
          // reuse all of the core MEMFS functionality
          return MEMFS.mount.apply(null, arguments);
        },syncfs:function (mount, populate, callback) {
          IDBFS.getLocalSet(mount, function(err, local) {
            if (err) return callback(err);
    
            IDBFS.getRemoteSet(mount, function(err, remote) {
              if (err) return callback(err);
    
              var src = populate ? remote : local;
              var dst = populate ? local : remote;
    
              IDBFS.reconcile(src, dst, callback);
            });
          });
        },getDB:function (name, callback) {
          // check the cache first
          var db = IDBFS.dbs[name];
          if (db) {
            return callback(null, db);
          }
    
          var req;
          try {
            req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
          } catch (e) {
            return callback(e);
          }
          req.onupgradeneeded = function(e) {
            var db = e.target.result;
            var transaction = e.target.transaction;
    
            var fileStore;
    
            if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {
              fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);
            } else {
              fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);
            }
    
            if (!fileStore.indexNames.contains('timestamp')) {
              fileStore.createIndex('timestamp', 'timestamp', { unique: false });
            }
          };
          req.onsuccess = function() {
            db = req.result;
    
            // add to the cache
            IDBFS.dbs[name] = db;
            callback(null, db);
          };
          req.onerror = function(e) {
            callback(this.error);
            e.preventDefault();
          };
        },getLocalSet:function (mount, callback) {
          var entries = {};
    
          function isRealDir(p) {
            return p !== '.' && p !== '..';
          };
          function toAbsolute(root) {
            return function(p) {
              return PATH.join2(root, p);
            }
          };
    
          var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
    
          while (check.length) {
            var path = check.pop();
            var stat;
    
            try {
              stat = FS.stat(path);
            } catch (e) {
              return callback(e);
            }
    
            if (FS.isDir(stat.mode)) {
              check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
            }
    
            entries[path] = { timestamp: stat.mtime };
          }
    
          return callback(null, { type: 'local', entries: entries });
        },getRemoteSet:function (mount, callback) {
          var entries = {};
    
          IDBFS.getDB(mount.mountpoint, function(err, db) {
            if (err) return callback(err);
    
            var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');
            transaction.onerror = function(e) {
              callback(this.error);
              e.preventDefault();
            };
    
            var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
            var index = store.index('timestamp');
    
            index.openKeyCursor().onsuccess = function(event) {
              var cursor = event.target.result;
    
              if (!cursor) {
                return callback(null, { type: 'remote', db: db, entries: entries });
              }
    
              entries[cursor.primaryKey] = { timestamp: cursor.key };
    
              cursor.continue();
            };
          });
        },loadLocalEntry:function (path, callback) {
          var stat, node;
    
          try {
            var lookup = FS.lookupPath(path);
            node = lookup.node;
            stat = FS.stat(path);
          } catch (e) {
            return callback(e);
          }
    
          if (FS.isDir(stat.mode)) {
            return callback(null, { timestamp: stat.mtime, mode: stat.mode });
          } else if (FS.isFile(stat.mode)) {
            // Performance consideration: storing a normal JavaScript array to a IndexedDB is much slower than storing a typed array.
            // Therefore always convert the file contents to a typed array first before writing the data to IndexedDB.
            node.contents = MEMFS.getFileDataAsTypedArray(node);
            return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });
          } else {
            return callback(new Error('node type not supported'));
          }
        },storeLocalEntry:function (path, entry, callback) {
          try {
            if (FS.isDir(entry.mode)) {
              FS.mkdir(path, entry.mode);
            } else if (FS.isFile(entry.mode)) {
              FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });
            } else {
              return callback(new Error('node type not supported'));
            }
    
            FS.chmod(path, entry.mode);
            FS.utime(path, entry.timestamp, entry.timestamp);
          } catch (e) {
            return callback(e);
          }
    
          callback(null);
        },removeLocalEntry:function (path, callback) {
          try {
            var lookup = FS.lookupPath(path);
            var stat = FS.stat(path);
    
            if (FS.isDir(stat.mode)) {
              FS.rmdir(path);
            } else if (FS.isFile(stat.mode)) {
              FS.unlink(path);
            }
          } catch (e) {
            return callback(e);
          }
    
          callback(null);
        },loadRemoteEntry:function (store, path, callback) {
          var req = store.get(path);
          req.onsuccess = function(event) { callback(null, event.target.result); };
          req.onerror = function(e) {
            callback(this.error);
            e.preventDefault();
          };
        },storeRemoteEntry:function (store, path, entry, callback) {
          var req = store.put(entry, path);
          req.onsuccess = function() { callback(null); };
          req.onerror = function(e) {
            callback(this.error);
            e.preventDefault();
          };
        },removeRemoteEntry:function (store, path, callback) {
          var req = store.delete(path);
          req.onsuccess = function() { callback(null); };
          req.onerror = function(e) {
            callback(this.error);
            e.preventDefault();
          };
        },reconcile:function (src, dst, callback) {
          var total = 0;
    
          var create = [];
          Object.keys(src.entries).forEach(function (key) {
            var e = src.entries[key];
            var e2 = dst.entries[key];
            if (!e2 || e.timestamp > e2.timestamp) {
              create.push(key);
              total++;
            }
          });
    
          var remove = [];
          Object.keys(dst.entries).forEach(function (key) {
            var e = dst.entries[key];
            var e2 = src.entries[key];
            if (!e2) {
              remove.push(key);
              total++;
            }
          });
    
          if (!total) {
            return callback(null);
          }
    
          var errored = false;
          var completed = 0;
          var db = src.type === 'remote' ? src.db : dst.db;
          var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');
          var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
    
          function done(err) {
            if (err) {
              if (!done.errored) {
                done.errored = true;
                return callback(err);
              }
              return;
            }
            if (++completed >= total) {
              return callback(null);
            }
          };
    
          transaction.onerror = function(e) {
            done(this.error);
            e.preventDefault();
          };
    
          // sort paths in ascending order so directory entries are created
          // before the files inside them
          create.sort().forEach(function (path) {
            if (dst.type === 'local') {
              IDBFS.loadRemoteEntry(store, path, function (err, entry) {
                if (err) return done(err);
                IDBFS.storeLocalEntry(path, entry, done);
              });
            } else {
              IDBFS.loadLocalEntry(path, function (err, entry) {
                if (err) return done(err);
                IDBFS.storeRemoteEntry(store, path, entry, done);
              });
            }
          });
    
          // sort paths in descending order so files are deleted before their
          // parent directories
          remove.sort().reverse().forEach(function(path) {
            if (dst.type === 'local') {
              IDBFS.removeLocalEntry(path, done);
            } else {
              IDBFS.removeRemoteEntry(store, path, done);
            }
          });
        }};
    
    var NODEFS={isWindows:false,staticInit:function () {
          NODEFS.isWindows = !!process.platform.match(/^win/);
        },mount:function (mount) {
          assert(ENVIRONMENT_IS_NODE);
          return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);
        },createNode:function (parent, name, mode, dev) {
          if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          var node = FS.createNode(parent, name, mode);
          node.node_ops = NODEFS.node_ops;
          node.stream_ops = NODEFS.stream_ops;
          return node;
        },getMode:function (path) {
          var stat;
          try {
            stat = fs.lstatSync(path);
            if (NODEFS.isWindows) {
              // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so
              // propagate write bits to execute bits.
              stat.mode = stat.mode | ((stat.mode & 146) >> 1);
            }
          } catch (e) {
            if (!e.code) throw e;
            throw new FS.ErrnoError(ERRNO_CODES[e.code]);
          }
          return stat.mode;
        },realPath:function (node) {
          var parts = [];
          while (node.parent !== node) {
            parts.push(node.name);
            node = node.parent;
          }
          parts.push(node.mount.opts.root);
          parts.reverse();
          return PATH.join.apply(null, parts);
        },flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function (flags) {
          flags &= ~0100000 /*O_LARGEFILE*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
          if (flags in NODEFS.flagsToPermissionStringMap) {
            return NODEFS.flagsToPermissionStringMap[flags];
          } else {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
        },node_ops:{getattr:function (node) {
            var path = NODEFS.realPath(node);
            var stat;
            try {
              stat = fs.lstatSync(path);
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
            // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.
            // See http://support.microsoft.com/kb/140365
            if (NODEFS.isWindows && !stat.blksize) {
              stat.blksize = 4096;
            }
            if (NODEFS.isWindows && !stat.blocks) {
              stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;
            }
            return {
              dev: stat.dev,
              ino: stat.ino,
              mode: stat.mode,
              nlink: stat.nlink,
              uid: stat.uid,
              gid: stat.gid,
              rdev: stat.rdev,
              size: stat.size,
              atime: stat.atime,
              mtime: stat.mtime,
              ctime: stat.ctime,
              blksize: stat.blksize,
              blocks: stat.blocks
            };
          },setattr:function (node, attr) {
            var path = NODEFS.realPath(node);
            try {
              if (attr.mode !== undefined) {
                fs.chmodSync(path, attr.mode);
                // update the common node structure mode as well
                node.mode = attr.mode;
              }
              if (attr.timestamp !== undefined) {
                var date = new Date(attr.timestamp);
                fs.utimesSync(path, date, date);
              }
              if (attr.size !== undefined) {
                fs.truncateSync(path, attr.size);
              }
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },lookup:function (parent, name) {
            var path = PATH.join2(NODEFS.realPath(parent), name);
            var mode = NODEFS.getMode(path);
            return NODEFS.createNode(parent, name, mode);
          },mknod:function (parent, name, mode, dev) {
            var node = NODEFS.createNode(parent, name, mode, dev);
            // create the backing node for this in the fs root as well
            var path = NODEFS.realPath(node);
            try {
              if (FS.isDir(node.mode)) {
                fs.mkdirSync(path, node.mode);
              } else {
                fs.writeFileSync(path, '', { mode: node.mode });
              }
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
            return node;
          },rename:function (oldNode, newDir, newName) {
            var oldPath = NODEFS.realPath(oldNode);
            var newPath = PATH.join2(NODEFS.realPath(newDir), newName);
            try {
              fs.renameSync(oldPath, newPath);
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },unlink:function (parent, name) {
            var path = PATH.join2(NODEFS.realPath(parent), name);
            try {
              fs.unlinkSync(path);
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },rmdir:function (parent, name) {
            var path = PATH.join2(NODEFS.realPath(parent), name);
            try {
              fs.rmdirSync(path);
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },readdir:function (node) {
            var path = NODEFS.realPath(node);
            try {
              return fs.readdirSync(path);
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },symlink:function (parent, newName, oldPath) {
            var newPath = PATH.join2(NODEFS.realPath(parent), newName);
            try {
              fs.symlinkSync(oldPath, newPath);
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },readlink:function (node) {
            var path = NODEFS.realPath(node);
            try {
              path = fs.readlinkSync(path);
              path = NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root), path);
              return path;
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          }},stream_ops:{open:function (stream) {
            var path = NODEFS.realPath(stream.node);
            try {
              if (FS.isFile(stream.node.mode)) {
                stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));
              }
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },close:function (stream) {
            try {
              if (FS.isFile(stream.node.mode) && stream.nfd) {
                fs.closeSync(stream.nfd);
              }
            } catch (e) {
              if (!e.code) throw e;
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
          },read:function (stream, buffer, offset, length, position) {
            if (length === 0) return 0; // node errors on 0 length reads
            // FIXME this is terrible.
            var nbuffer = new Buffer(length);
            var res;
            try {
              res = fs.readSync(stream.nfd, nbuffer, 0, length, position);
            } catch (e) {
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
            if (res > 0) {
              for (var i = 0; i < res; i++) {
                buffer[offset + i] = nbuffer[i];
              }
            }
            return res;
          },write:function (stream, buffer, offset, length, position) {
            // FIXME this is terrible.
            var nbuffer = new Buffer(buffer.subarray(offset, offset + length));
            var res;
            try {
              res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);
            } catch (e) {
              throw new FS.ErrnoError(ERRNO_CODES[e.code]);
            }
            return res;
          },llseek:function (stream, offset, whence) {
            var position = offset;
            if (whence === 1) {  // SEEK_CUR.
              position += stream.position;
            } else if (whence === 2) {  // SEEK_END.
              if (FS.isFile(stream.node.mode)) {
                try {
                  var stat = fs.fstatSync(stream.nfd);
                  position += stat.size;
                } catch (e) {
                  throw new FS.ErrnoError(ERRNO_CODES[e.code]);
                }
              }
            }
    
            if (position < 0) {
              throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
            }
    
            return position;
          }}};
    
    var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function (mount) {
          assert(ENVIRONMENT_IS_WORKER);
          if (!WORKERFS.reader) WORKERFS.reader = new FileReaderSync();
          var root = WORKERFS.createNode(null, '/', WORKERFS.DIR_MODE, 0);
          var createdParents = {};
          function ensureParent(path) {
            // return the parent node, creating subdirs as necessary
            var parts = path.split('/');
            var parent = root;
            for (var i = 0; i < parts.length-1; i++) {
              var curr = parts.slice(0, i+1).join('/');
              if (!createdParents[curr]) {
                createdParents[curr] = WORKERFS.createNode(parent, curr, WORKERFS.DIR_MODE, 0);
              }
              parent = createdParents[curr];
            }
            return parent;
          }
          function base(path) {
            var parts = path.split('/');
            return parts[parts.length-1];
          }
          // We also accept FileList here, by using Array.prototype
          Array.prototype.forEach.call(mount.opts["files"] || [], function(file) {
            WORKERFS.createNode(ensureParent(file.name), base(file.name), WORKERFS.FILE_MODE, 0, file, file.lastModifiedDate);
          });
          (mount.opts["blobs"] || []).forEach(function(obj) {
            WORKERFS.createNode(ensureParent(obj["name"]), base(obj["name"]), WORKERFS.FILE_MODE, 0, obj["data"]);
          });
          (mount.opts["packages"] || []).forEach(function(pack) {
            pack['metadata'].files.forEach(function(file) {
              var name = file.filename.substr(1); // remove initial slash
              WORKERFS.createNode(ensureParent(name), base(name), WORKERFS.FILE_MODE, 0, pack['blob'].slice(file.start, file.end));
            });
          });
          return root;
        },createNode:function (parent, name, mode, dev, contents, mtime) {
          var node = FS.createNode(parent, name, mode);
          node.mode = mode;
          node.node_ops = WORKERFS.node_ops;
          node.stream_ops = WORKERFS.stream_ops;
          node.timestamp = (mtime || new Date).getTime();
          assert(WORKERFS.FILE_MODE !== WORKERFS.DIR_MODE);
          if (mode === WORKERFS.FILE_MODE) {
            node.size = contents.size;
            node.contents = contents;
          } else {
            node.size = 4096;
            node.contents = {};
          }
          if (parent) {
            parent.contents[name] = node;
          }
          return node;
        },node_ops:{getattr:function (node) {
            return {
              dev: 1,
              ino: undefined,
              mode: node.mode,
              nlink: 1,
              uid: 0,
              gid: 0,
              rdev: undefined,
              size: node.size,
              atime: new Date(node.timestamp),
              mtime: new Date(node.timestamp),
              ctime: new Date(node.timestamp),
              blksize: 4096,
              blocks: Math.ceil(node.size / 4096),
            };
          },setattr:function (node, attr) {
            if (attr.mode !== undefined) {
              node.mode = attr.mode;
            }
            if (attr.timestamp !== undefined) {
              node.timestamp = attr.timestamp;
            }
          },lookup:function (parent, name) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          },mknod:function (parent, name, mode, dev) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          },rename:function (oldNode, newDir, newName) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          },unlink:function (parent, name) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          },rmdir:function (parent, name) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          },readdir:function (node) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          },symlink:function (parent, newName, oldPath) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          },readlink:function (node) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }},stream_ops:{read:function (stream, buffer, offset, length, position) {
            if (position >= stream.node.size) return 0;
            var chunk = stream.node.contents.slice(position, position + length);
            var ab = WORKERFS.reader.readAsArrayBuffer(chunk);
            buffer.set(new Uint8Array(ab), offset);
            return chunk.size;
          },write:function (stream, buffer, offset, length, position) {
            throw new FS.ErrnoError(ERRNO_CODES.EIO);
          },llseek:function (stream, offset, whence) {
            var position = offset;
            if (whence === 1) {  // SEEK_CUR.
              position += stream.position;
            } else if (whence === 2) {  // SEEK_END.
              if (FS.isFile(stream.node.mode)) {
                position += stream.node.size;
              }
            }
            if (position < 0) {
              throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
            }
            return position;
          }}};
    
    var _stdin=allocate(1, "i32*", ALLOC_STATIC);
    
    var _stdout=allocate(1, "i32*", ALLOC_STATIC);
    
    var _stderr=allocate(1, "i32*", ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,handleFSError:function (e) {
          if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();
          return ___setErrNo(e.errno);
        },lookupPath:function (path, opts) {
          path = PATH.resolve(FS.cwd(), path);
          opts = opts || {};
    
          if (!path) return { path: '', node: null };
    
          var defaults = {
            follow_mount: true,
            recurse_count: 0
          };
          for (var key in defaults) {
            if (opts[key] === undefined) {
              opts[key] = defaults[key];
            }
          }
    
          if (opts.recurse_count > 8) {  // max recursive lookup of 8
            throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
          }
    
          // split the path
          var parts = PATH.normalizeArray(path.split('/').filter(function(p) {
            return !!p;
          }), false);
    
          // start at the root
          var current = FS.root;
          var current_path = '/';
    
          for (var i = 0; i < parts.length; i++) {
            var islast = (i === parts.length-1);
            if (islast && opts.parent) {
              // stop resolving
              break;
            }
    
            current = FS.lookupNode(current, parts[i]);
            current_path = PATH.join2(current_path, parts[i]);
    
            // jump to the mount's root node if this is a mountpoint
            if (FS.isMountpoint(current)) {
              if (!islast || (islast && opts.follow_mount)) {
                current = current.mounted.root;
              }
            }
    
            // by default, lookupPath will not follow a symlink if it is the final path component.
            // setting opts.follow = true will override this behavior.
            if (!islast || opts.follow) {
              var count = 0;
              while (FS.isLink(current.mode)) {
                var link = FS.readlink(current_path);
                current_path = PATH.resolve(PATH.dirname(current_path), link);
    
                var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
                current = lookup.node;
    
                if (count++ > 40) {  // limit max consecutive symlinks to 40 (SYMLOOP_MAX).
                  throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
                }
              }
            }
          }
    
          return { path: current_path, node: current };
        },getPath:function (node) {
          var path;
          while (true) {
            if (FS.isRoot(node)) {
              var mount = node.mount.mountpoint;
              if (!path) return mount;
              return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;
            }
            path = path ? node.name + '/' + path : node.name;
            node = node.parent;
          }
        },hashName:function (parentid, name) {
          var hash = 0;
    
    
          for (var i = 0; i < name.length; i++) {
            hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
          }
          return ((parentid + hash) >>> 0) % FS.nameTable.length;
        },hashAddNode:function (node) {
          var hash = FS.hashName(node.parent.id, node.name);
          node.name_next = FS.nameTable[hash];
          FS.nameTable[hash] = node;
        },hashRemoveNode:function (node) {
          var hash = FS.hashName(node.parent.id, node.name);
          if (FS.nameTable[hash] === node) {
            FS.nameTable[hash] = node.name_next;
          } else {
            var current = FS.nameTable[hash];
            while (current) {
              if (current.name_next === node) {
                current.name_next = node.name_next;
                break;
              }
              current = current.name_next;
            }
          }
        },lookupNode:function (parent, name) {
          var err = FS.mayLookup(parent);
          if (err) {
            throw new FS.ErrnoError(err, parent);
          }
          var hash = FS.hashName(parent.id, name);
          for (var node = FS.nameTable[hash]; node; node = node.name_next) {
            var nodeName = node.name;
            if (node.parent.id === parent.id && nodeName === name) {
              return node;
            }
          }
          // if we failed to find it in the cache, call into the VFS
          return FS.lookup(parent, name);
        },createNode:function (parent, name, mode, rdev) {
          if (!FS.FSNode) {
            FS.FSNode = function(parent, name, mode, rdev) {
              if (!parent) {
                parent = this;  // root node sets parent to itself
              }
              this.parent = parent;
              this.mount = parent.mount;
              this.mounted = null;
              this.id = FS.nextInode++;
              this.name = name;
              this.mode = mode;
              this.node_ops = {};
              this.stream_ops = {};
              this.rdev = rdev;
            };
    
            FS.FSNode.prototype = {};
    
            // compatibility
            var readMode = 292 | 73;
            var writeMode = 146;
    
            // NOTE we must use Object.defineProperties instead of individual calls to
            // Object.defineProperty in order to make closure compiler happy
            Object.defineProperties(FS.FSNode.prototype, {
              read: {
                get: function() { return (this.mode & readMode) === readMode; },
                set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }
              },
              write: {
                get: function() { return (this.mode & writeMode) === writeMode; },
                set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }
              },
              isFolder: {
                get: function() { return FS.isDir(this.mode); }
              },
              isDevice: {
                get: function() { return FS.isChrdev(this.mode); }
              }
            });
          }
    
          var node = new FS.FSNode(parent, name, mode, rdev);
    
          FS.hashAddNode(node);
    
          return node;
        },destroyNode:function (node) {
          FS.hashRemoveNode(node);
        },isRoot:function (node) {
          return node === node.parent;
        },isMountpoint:function (node) {
          return !!node.mounted;
        },isFile:function (mode) {
          return (mode & 61440) === 32768;
        },isDir:function (mode) {
          return (mode & 61440) === 16384;
        },isLink:function (mode) {
          return (mode & 61440) === 40960;
        },isChrdev:function (mode) {
          return (mode & 61440) === 8192;
        },isBlkdev:function (mode) {
          return (mode & 61440) === 24576;
        },isFIFO:function (mode) {
          return (mode & 61440) === 4096;
        },isSocket:function (mode) {
          return (mode & 49152) === 49152;
        },flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function (str) {
          var flags = FS.flagModes[str];
          if (typeof flags === 'undefined') {
            throw new Error('Unknown file open mode: ' + str);
          }
          return flags;
        },flagsToPermissionString:function (flag) {
          var perms = ['r', 'w', 'rw'][flag & 3];
          if ((flag & 512)) {
            perms += 'w';
          }
          return perms;
        },nodePermissions:function (node, perms) {
          if (FS.ignorePermissions) {
            return 0;
          }
          // return 0 if any user, group or owner bits are set.
          if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {
            return ERRNO_CODES.EACCES;
          } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {
            return ERRNO_CODES.EACCES;
          } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {
            return ERRNO_CODES.EACCES;
          }
          return 0;
        },mayLookup:function (dir) {
          var err = FS.nodePermissions(dir, 'x');
          if (err) return err;
          if (!dir.node_ops.lookup) return ERRNO_CODES.EACCES;
          return 0;
        },mayCreate:function (dir, name) {
          try {
            var node = FS.lookupNode(dir, name);
            return ERRNO_CODES.EEXIST;
          } catch (e) {
          }
          return FS.nodePermissions(dir, 'wx');
        },mayDelete:function (dir, name, isdir) {
          var node;
          try {
            node = FS.lookupNode(dir, name);
          } catch (e) {
            return e.errno;
          }
          var err = FS.nodePermissions(dir, 'wx');
          if (err) {
            return err;
          }
          if (isdir) {
            if (!FS.isDir(node.mode)) {
              return ERRNO_CODES.ENOTDIR;
            }
            if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
              return ERRNO_CODES.EBUSY;
            }
          } else {
            if (FS.isDir(node.mode)) {
              return ERRNO_CODES.EISDIR;
            }
          }
          return 0;
        },mayOpen:function (node, flags) {
          if (!node) {
            return ERRNO_CODES.ENOENT;
          }
          if (FS.isLink(node.mode)) {
            return ERRNO_CODES.ELOOP;
          } else if (FS.isDir(node.mode)) {
            if ((flags & 2097155) !== 0 ||  // opening for write
                (flags & 512)) {
              return ERRNO_CODES.EISDIR;
            }
          }
          return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
        },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {
          fd_start = fd_start || 0;
          fd_end = fd_end || FS.MAX_OPEN_FDS;
          for (var fd = fd_start; fd <= fd_end; fd++) {
            if (!FS.streams[fd]) {
              return fd;
            }
          }
          throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
        },getStream:function (fd) {
          return FS.streams[fd];
        },createStream:function (stream, fd_start, fd_end) {
          if (!FS.FSStream) {
            FS.FSStream = function(){};
            FS.FSStream.prototype = {};
            // compatibility
            Object.defineProperties(FS.FSStream.prototype, {
              object: {
                get: function() { return this.node; },
                set: function(val) { this.node = val; }
              },
              isRead: {
                get: function() { return (this.flags & 2097155) !== 1; }
              },
              isWrite: {
                get: function() { return (this.flags & 2097155) !== 0; }
              },
              isAppend: {
                get: function() { return (this.flags & 1024); }
              }
            });
          }
          // clone it, so we can return an instance of FSStream
          var newStream = new FS.FSStream();
          for (var p in stream) {
            newStream[p] = stream[p];
          }
          stream = newStream;
          var fd = FS.nextfd(fd_start, fd_end);
          stream.fd = fd;
          FS.streams[fd] = stream;
          return stream;
        },closeStream:function (fd) {
          FS.streams[fd] = null;
        },chrdev_stream_ops:{open:function (stream) {
            var device = FS.getDevice(stream.node.rdev);
            // override node's stream ops with the device's
            stream.stream_ops = device.stream_ops;
            // forward the open call
            if (stream.stream_ops.open) {
              stream.stream_ops.open(stream);
            }
          },llseek:function () {
            throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
          }},major:function (dev) {
          return ((dev) >> 8);
        },minor:function (dev) {
          return ((dev) & 0xff);
        },makedev:function (ma, mi) {
          return ((ma) << 8 | (mi));
        },registerDevice:function (dev, ops) {
          FS.devices[dev] = { stream_ops: ops };
        },getDevice:function (dev) {
          return FS.devices[dev];
        },getMounts:function (mount) {
          var mounts = [];
          var check = [mount];
    
          while (check.length) {
            var m = check.pop();
    
            mounts.push(m);
    
            check.push.apply(check, m.mounts);
          }
    
          return mounts;
        },syncfs:function (populate, callback) {
          if (typeof(populate) === 'function') {
            callback = populate;
            populate = false;
          }
    
          var mounts = FS.getMounts(FS.root.mount);
          var completed = 0;
    
          function done(err) {
            if (err) {
              if (!done.errored) {
                done.errored = true;
                return callback(err);
              }
              return;
            }
            if (++completed >= mounts.length) {
              callback(null);
            }
          };
    
          // sync all mounts
          mounts.forEach(function (mount) {
            if (!mount.type.syncfs) {
              return done(null);
            }
            mount.type.syncfs(mount, populate, done);
          });
        },mount:function (type, opts, mountpoint) {
          var root = mountpoint === '/';
          var pseudo = !mountpoint;
          var node;
    
          if (root && FS.root) {
            throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
          } else if (!root && !pseudo) {
            var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
    
            mountpoint = lookup.path;  // use the absolute path
            node = lookup.node;
    
            if (FS.isMountpoint(node)) {
              throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
            }
    
            if (!FS.isDir(node.mode)) {
              throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
            }
          }
    
          var mount = {
            type: type,
            opts: opts,
            mountpoint: mountpoint,
            mounts: []
          };
    
          // create a root node for the fs
          var mountRoot = type.mount(mount);
          mountRoot.mount = mount;
          mount.root = mountRoot;
    
          if (root) {
            FS.root = mountRoot;
          } else if (node) {
            // set as a mountpoint
            node.mounted = mount;
    
            // add the new mount to the current mount's children
            if (node.mount) {
              node.mount.mounts.push(mount);
            }
          }
    
          return mountRoot;
        },unmount:function (mountpoint) {
          var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
    
          if (!FS.isMountpoint(lookup.node)) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
    
          // destroy the nodes for this mount, and all its child mounts
          var node = lookup.node;
          var mount = node.mounted;
          var mounts = FS.getMounts(mount);
    
          Object.keys(FS.nameTable).forEach(function (hash) {
            var current = FS.nameTable[hash];
    
            while (current) {
              var next = current.name_next;
    
              if (mounts.indexOf(current.mount) !== -1) {
                FS.destroyNode(current);
              }
    
              current = next;
            }
          });
    
          // no longer a mountpoint
          node.mounted = null;
    
          // remove this mount from the child mounts
          var idx = node.mount.mounts.indexOf(mount);
          assert(idx !== -1);
          node.mount.mounts.splice(idx, 1);
        },lookup:function (parent, name) {
          return parent.node_ops.lookup(parent, name);
        },mknod:function (path, mode, dev) {
          var lookup = FS.lookupPath(path, { parent: true });
          var parent = lookup.node;
          var name = PATH.basename(path);
          if (!name || name === '.' || name === '..') {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          var err = FS.mayCreate(parent, name);
          if (err) {
            throw new FS.ErrnoError(err);
          }
          if (!parent.node_ops.mknod) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          return parent.node_ops.mknod(parent, name, mode, dev);
        },create:function (path, mode) {
          mode = mode !== undefined ? mode : 438 /* 0666 */;
          mode &= 4095;
          mode |= 32768;
          return FS.mknod(path, mode, 0);
        },mkdir:function (path, mode) {
          mode = mode !== undefined ? mode : 511 /* 0777 */;
          mode &= 511 | 512;
          mode |= 16384;
          return FS.mknod(path, mode, 0);
        },mkdev:function (path, mode, dev) {
          if (typeof(dev) === 'undefined') {
            dev = mode;
            mode = 438 /* 0666 */;
          }
          mode |= 8192;
          return FS.mknod(path, mode, dev);
        },symlink:function (oldpath, newpath) {
          if (!PATH.resolve(oldpath)) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          }
          var lookup = FS.lookupPath(newpath, { parent: true });
          var parent = lookup.node;
          if (!parent) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          }
          var newname = PATH.basename(newpath);
          var err = FS.mayCreate(parent, newname);
          if (err) {
            throw new FS.ErrnoError(err);
          }
          if (!parent.node_ops.symlink) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          return parent.node_ops.symlink(parent, newname, oldpath);
        },rename:function (old_path, new_path) {
          var old_dirname = PATH.dirname(old_path);
          var new_dirname = PATH.dirname(new_path);
          var old_name = PATH.basename(old_path);
          var new_name = PATH.basename(new_path);
          // parents must exist
          var lookup, old_dir, new_dir;
          try {
            lookup = FS.lookupPath(old_path, { parent: true });
            old_dir = lookup.node;
            lookup = FS.lookupPath(new_path, { parent: true });
            new_dir = lookup.node;
          } catch (e) {
            throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
          }
          if (!old_dir || !new_dir) throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          // need to be part of the same mount
          if (old_dir.mount !== new_dir.mount) {
            throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
          }
          // source must exist
          var old_node = FS.lookupNode(old_dir, old_name);
          // old path should not be an ancestor of the new path
          var relative = PATH.relative(old_path, new_dirname);
          if (relative.charAt(0) !== '.') {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          // new path should not be an ancestor of the old path
          relative = PATH.relative(new_path, old_dirname);
          if (relative.charAt(0) !== '.') {
            throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
          }
          // see if the new path already exists
          var new_node;
          try {
            new_node = FS.lookupNode(new_dir, new_name);
          } catch (e) {
            // not fatal
          }
          // early out if nothing needs to change
          if (old_node === new_node) {
            return;
          }
          // we'll need to delete the old entry
          var isdir = FS.isDir(old_node.mode);
          var err = FS.mayDelete(old_dir, old_name, isdir);
          if (err) {
            throw new FS.ErrnoError(err);
          }
          // need delete permissions if we'll be overwriting.
          // need create permissions if new doesn't already exist.
          err = new_node ?
            FS.mayDelete(new_dir, new_name, isdir) :
            FS.mayCreate(new_dir, new_name);
          if (err) {
            throw new FS.ErrnoError(err);
          }
          if (!old_dir.node_ops.rename) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
            throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
          }
          // if we are going to change the parent, check write permissions
          if (new_dir !== old_dir) {
            err = FS.nodePermissions(old_dir, 'w');
            if (err) {
              throw new FS.ErrnoError(err);
            }
          }
          try {
            if (FS.trackingDelegate['willMovePath']) {
              FS.trackingDelegate['willMovePath'](old_path, new_path);
            }
          } catch(e) {
            console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
          }
          // remove the node from the lookup hash
          FS.hashRemoveNode(old_node);
          // do the underlying fs rename
          try {
            old_dir.node_ops.rename(old_node, new_dir, new_name);
          } catch (e) {
            throw e;
          } finally {
            // add the node back to the hash (in case node_ops.rename
            // changed its name)
            FS.hashAddNode(old_node);
          }
          try {
            if (FS.trackingDelegate['onMovePath']) FS.trackingDelegate['onMovePath'](old_path, new_path);
          } catch(e) {
            console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
          }
        },rmdir:function (path) {
          var lookup = FS.lookupPath(path, { parent: true });
          var parent = lookup.node;
          var name = PATH.basename(path);
          var node = FS.lookupNode(parent, name);
          var err = FS.mayDelete(parent, name, true);
          if (err) {
            throw new FS.ErrnoError(err);
          }
          if (!parent.node_ops.rmdir) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          if (FS.isMountpoint(node)) {
            throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
          }
          try {
            if (FS.trackingDelegate['willDeletePath']) {
              FS.trackingDelegate['willDeletePath'](path);
            }
          } catch(e) {
            console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message);
          }
          parent.node_ops.rmdir(parent, name);
          FS.destroyNode(node);
          try {
            if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
          } catch(e) {
            console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
          }
        },readdir:function (path) {
          var lookup = FS.lookupPath(path, { follow: true });
          var node = lookup.node;
          if (!node.node_ops.readdir) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
          }
          return node.node_ops.readdir(node);
        },unlink:function (path) {
          var lookup = FS.lookupPath(path, { parent: true });
          var parent = lookup.node;
          var name = PATH.basename(path);
          var node = FS.lookupNode(parent, name);
          var err = FS.mayDelete(parent, name, false);
          if (err) {
            // POSIX says unlink should set EPERM, not EISDIR
            if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;
            throw new FS.ErrnoError(err);
          }
          if (!parent.node_ops.unlink) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          if (FS.isMountpoint(node)) {
            throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
          }
          try {
            if (FS.trackingDelegate['willDeletePath']) {
              FS.trackingDelegate['willDeletePath'](path);
            }
          } catch(e) {
            console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message);
          }
          parent.node_ops.unlink(parent, name);
          FS.destroyNode(node);
          try {
            if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
          } catch(e) {
            console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
          }
        },readlink:function (path) {
          var lookup = FS.lookupPath(path);
          var link = lookup.node;
          if (!link) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          }
          if (!link.node_ops.readlink) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          return PATH.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
        },stat:function (path, dontFollow) {
          var lookup = FS.lookupPath(path, { follow: !dontFollow });
          var node = lookup.node;
          if (!node) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          }
          if (!node.node_ops.getattr) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          return node.node_ops.getattr(node);
        },lstat:function (path) {
          return FS.stat(path, true);
        },chmod:function (path, mode, dontFollow) {
          var node;
          if (typeof path === 'string') {
            var lookup = FS.lookupPath(path, { follow: !dontFollow });
            node = lookup.node;
          } else {
            node = path;
          }
          if (!node.node_ops.setattr) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          node.node_ops.setattr(node, {
            mode: (mode & 4095) | (node.mode & ~4095),
            timestamp: Date.now()
          });
        },lchmod:function (path, mode) {
          FS.chmod(path, mode, true);
        },fchmod:function (fd, mode) {
          var stream = FS.getStream(fd);
          if (!stream) {
            throw new FS.ErrnoError(ERRNO_CODES.EBADF);
          }
          FS.chmod(stream.node, mode);
        },chown:function (path, uid, gid, dontFollow) {
          var node;
          if (typeof path === 'string') {
            var lookup = FS.lookupPath(path, { follow: !dontFollow });
            node = lookup.node;
          } else {
            node = path;
          }
          if (!node.node_ops.setattr) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          node.node_ops.setattr(node, {
            timestamp: Date.now()
            // we ignore the uid / gid for now
          });
        },lchown:function (path, uid, gid) {
          FS.chown(path, uid, gid, true);
        },fchown:function (fd, uid, gid) {
          var stream = FS.getStream(fd);
          if (!stream) {
            throw new FS.ErrnoError(ERRNO_CODES.EBADF);
          }
          FS.chown(stream.node, uid, gid);
        },truncate:function (path, len) {
          if (len < 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          var node;
          if (typeof path === 'string') {
            var lookup = FS.lookupPath(path, { follow: true });
            node = lookup.node;
          } else {
            node = path;
          }
          if (!node.node_ops.setattr) {
            throw new FS.ErrnoError(ERRNO_CODES.EPERM);
          }
          if (FS.isDir(node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
          }
          if (!FS.isFile(node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          var err = FS.nodePermissions(node, 'w');
          if (err) {
            throw new FS.ErrnoError(err);
          }
          node.node_ops.setattr(node, {
            size: len,
            timestamp: Date.now()
          });
        },ftruncate:function (fd, len) {
          var stream = FS.getStream(fd);
          if (!stream) {
            throw new FS.ErrnoError(ERRNO_CODES.EBADF);
          }
          if ((stream.flags & 2097155) === 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          FS.truncate(stream.node, len);
        },utime:function (path, atime, mtime) {
          var lookup = FS.lookupPath(path, { follow: true });
          var node = lookup.node;
          node.node_ops.setattr(node, {
            timestamp: Math.max(atime, mtime)
          });
        },open:function (path, flags, mode, fd_start, fd_end) {
          if (path === "") {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          }
          flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
          mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;
          if ((flags & 64)) {
            mode = (mode & 4095) | 32768;
          } else {
            mode = 0;
          }
          var node;
          if (typeof path === 'object') {
            node = path;
          } else {
            path = PATH.normalize(path);
            try {
              var lookup = FS.lookupPath(path, {
                follow: !(flags & 131072)
              });
              node = lookup.node;
            } catch (e) {
              // ignore
            }
          }
          // perhaps we need to create the node
          var created = false;
          if ((flags & 64)) {
            if (node) {
              // if O_CREAT and O_EXCL are set, error out if the node already exists
              if ((flags & 128)) {
                throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
              }
            } else {
              // node doesn't exist, try to create it
              node = FS.mknod(path, mode, 0);
              created = true;
            }
          }
          if (!node) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
          }
          // can't truncate a device
          if (FS.isChrdev(node.mode)) {
            flags &= ~512;
          }
          // if asked only for a directory, then this must be one
          if ((flags & 65536) && !FS.isDir(node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
          }
          // check permissions, if this is not a file we just created now (it is ok to
          // create and write to a file with read-only permissions; it is read-only
          // for later use)
          if (!created) {
            var err = FS.mayOpen(node, flags);
            if (err) {
              throw new FS.ErrnoError(err);
            }
          }
          // do truncation if necessary
          if ((flags & 512)) {
            FS.truncate(node, 0);
          }
          // we've already handled these, don't pass down to the underlying vfs
          flags &= ~(128 | 512);
    
          // register the stream with the filesystem
          var stream = FS.createStream({
            node: node,
            path: FS.getPath(node),  // we want the absolute path to the node
            flags: flags,
            seekable: true,
            position: 0,
            stream_ops: node.stream_ops,
            // used by the file family libc calls (fopen, fwrite, ferror, etc.)
            ungotten: [],
            error: false
          }, fd_start, fd_end);
          // call the new stream's open function
          if (stream.stream_ops.open) {
            stream.stream_ops.open(stream);
          }
          if (Module['logReadFiles'] && !(flags & 1)) {
            if (!FS.readFiles) FS.readFiles = {};
            if (!(path in FS.readFiles)) {
              FS.readFiles[path] = 1;
              Module['printErr']('read file: ' + path);
            }
          }
          try {
            if (FS.trackingDelegate['onOpenFile']) {
              var trackingFlags = 0;
              if ((flags & 2097155) !== 1) {
                trackingFlags |= FS.tracking.openFlags.READ;
              }
              if ((flags & 2097155) !== 0) {
                trackingFlags |= FS.tracking.openFlags.WRITE;
              }
              FS.trackingDelegate['onOpenFile'](path, trackingFlags);
            }
          } catch(e) {
            console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: " + e.message);
          }
          return stream;
        },close:function (stream) {
          if (stream.getdents) stream.getdents = null; // free readdir state
          try {
            if (stream.stream_ops.close) {
              stream.stream_ops.close(stream);
            }
          } catch (e) {
            throw e;
          } finally {
            FS.closeStream(stream.fd);
          }
        },llseek:function (stream, offset, whence) {
          if (!stream.seekable || !stream.stream_ops.llseek) {
            throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
          }
          stream.position = stream.stream_ops.llseek(stream, offset, whence);
          stream.ungotten = [];
          return stream.position;
        },read:function (stream, buffer, offset, length, position) {
          if (length < 0 || position < 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          if ((stream.flags & 2097155) === 1) {
            throw new FS.ErrnoError(ERRNO_CODES.EBADF);
          }
          if (FS.isDir(stream.node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
          }
          if (!stream.stream_ops.read) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          var seeking = true;
          if (typeof position === 'undefined') {
            position = stream.position;
            seeking = false;
          } else if (!stream.seekable) {
            throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
          }
          var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
          if (!seeking) stream.position += bytesRead;
          return bytesRead;
        },write:function (stream, buffer, offset, length, position, canOwn) {
          if (length < 0 || position < 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          if ((stream.flags & 2097155) === 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EBADF);
          }
          if (FS.isDir(stream.node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
          }
          if (!stream.stream_ops.write) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          if (stream.flags & 1024) {
            // seek to the end before writing in append mode
            FS.llseek(stream, 0, 2);
          }
          var seeking = true;
          if (typeof position === 'undefined') {
            position = stream.position;
            seeking = false;
          } else if (!stream.seekable) {
            throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
          }
          var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
          if (!seeking) stream.position += bytesWritten;
          try {
            if (stream.path && FS.trackingDelegate['onWriteToFile']) FS.trackingDelegate['onWriteToFile'](stream.path);
          } catch(e) {
            console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: " + e.message);
          }
          return bytesWritten;
        },allocate:function (stream, offset, length) {
          if (offset < 0 || length <= 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
          }
          if ((stream.flags & 2097155) === 0) {
            throw new FS.ErrnoError(ERRNO_CODES.EBADF);
          }
          if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
          }
          if (!stream.stream_ops.allocate) {
            throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
          }
          stream.stream_ops.allocate(stream, offset, length);
        },mmap:function (stream, buffer, offset, length, position, prot, flags) {
          // TODO if PROT is PROT_WRITE, make sure we have write access
          if ((stream.flags & 2097155) === 1) {
            throw new FS.ErrnoError(ERRNO_CODES.EACCES);
          }
          if (!stream.stream_ops.mmap) {
            throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
          }
          return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);
        },msync:function (stream, buffer, offset, length, mmapFlags) {
          if (!stream || !stream.stream_ops.msync) {
            return 0;
          }
          return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags);
        },munmap:function (stream) {
          return 0;
        },ioctl:function (stream, cmd, arg) {
          if (!stream.stream_ops.ioctl) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);
          }
          return stream.stream_ops.ioctl(stream, cmd, arg);
        },readFile:function (path, opts) {
          opts = opts || {};
          opts.flags = opts.flags || 'r';
          opts.encoding = opts.encoding || 'binary';
          if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
            throw new Error('Invalid encoding type "' + opts.encoding + '"');
          }
          var ret;
          var stream = FS.open(path, opts.flags);
          var stat = FS.stat(path);
          var length = stat.size;
          var buf = new Uint8Array(length);
          FS.read(stream, buf, 0, length, 0);
          if (opts.encoding === 'utf8') {
            ret = UTF8ArrayToString(buf, 0);
          } else if (opts.encoding === 'binary') {
            ret = buf;
          }
          FS.close(stream);
          return ret;
        },writeFile:function (path, data, opts) {
          opts = opts || {};
          opts.flags = opts.flags || 'w';
          opts.encoding = opts.encoding || 'utf8';
          if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
            throw new Error('Invalid encoding type "' + opts.encoding + '"');
          }
          var stream = FS.open(path, opts.flags, opts.mode);
          if (opts.encoding === 'utf8') {
            var buf = new Uint8Array(lengthBytesUTF8(data)+1);
            var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
            FS.write(stream, buf, 0, actualNumBytes, 0, opts.canOwn);
          } else if (opts.encoding === 'binary') {
            FS.write(stream, data, 0, data.length, 0, opts.canOwn);
          }
          FS.close(stream);
        },cwd:function () {
          return FS.currentPath;
        },chdir:function (path) {
          var lookup = FS.lookupPath(path, { follow: true });
          if (!FS.isDir(lookup.node.mode)) {
            throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
          }
          var err = FS.nodePermissions(lookup.node, 'x');
          if (err) {
            throw new FS.ErrnoError(err);
          }
          FS.currentPath = lookup.path;
        },createDefaultDirectories:function () {
          FS.mkdir('/tmp');
          FS.mkdir('/home');
          FS.mkdir('/home/web_user');
        },createDefaultDevices:function () {
          // create /dev
          FS.mkdir('/dev');
          // setup /dev/null
          FS.registerDevice(FS.makedev(1, 3), {
            read: function() { return 0; },
            write: function(stream, buffer, offset, length, pos) { return length; }
          });
          FS.mkdev('/dev/null', FS.makedev(1, 3));
          // setup /dev/tty and /dev/tty1
          // stderr needs to print output using Module['printErr']
          // so we register a second tty just for it.
          TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
          TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
          FS.mkdev('/dev/tty', FS.makedev(5, 0));
          FS.mkdev('/dev/tty1', FS.makedev(6, 0));
          // setup /dev/[u]random
          var random_device;
          if (typeof crypto !== 'undefined') {
            // for modern web browsers
            var randomBuffer = new Uint8Array(1);
            random_device = function() { crypto.getRandomValues(randomBuffer); return randomBuffer[0]; };
          } else if (ENVIRONMENT_IS_NODE) {
            // for nodejs
            random_device = function() { return require('crypto').randomBytes(1)[0]; };
          } else {
            // default for ES5 platforms
            random_device = function() { return (Math.random()*256)|0; };
          }
          FS.createDevice('/dev', 'random', random_device);
          FS.createDevice('/dev', 'urandom', random_device);
          // we're not going to emulate the actual shm device,
          // just create the tmp dirs that reside in it commonly
          FS.mkdir('/dev/shm');
          FS.mkdir('/dev/shm/tmp');
        },createSpecialDirectories:function () {
          // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the name of the stream for fd 6 (see test_unistd_ttyname)
          FS.mkdir('/proc');
          FS.mkdir('/proc/self');
          FS.mkdir('/proc/self/fd');
          FS.mount({
            mount: function() {
              var node = FS.createNode('/proc/self', 'fd', 16384 | 0777, 73);
              node.node_ops = {
                lookup: function(parent, name) {
                  var fd = +name;
                  var stream = FS.getStream(fd);
                  if (!stream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
                  var ret = {
                    parent: null,
                    mount: { mountpoint: 'fake' },
                    node_ops: { readlink: function() { return stream.path } }
                  };
                  ret.parent = ret; // make it look like a simple root node
                  return ret;
                }
              };
              return node;
            }
          }, {}, '/proc/self/fd');
        },createStandardStreams:function () {
          // TODO deprecate the old functionality of a single
          // input / output callback and that utilizes FS.createDevice
          // and instead require a unique set of stream ops
    
          // by default, we symlink the standard streams to the
          // default tty devices. however, if the standard streams
          // have been overwritten we create a unique device for
          // them instead.
          if (Module['stdin']) {
            FS.createDevice('/dev', 'stdin', Module['stdin']);
          } else {
            FS.symlink('/dev/tty', '/dev/stdin');
          }
          if (Module['stdout']) {
            FS.createDevice('/dev', 'stdout', null, Module['stdout']);
          } else {
            FS.symlink('/dev/tty', '/dev/stdout');
          }
          if (Module['stderr']) {
            FS.createDevice('/dev', 'stderr', null, Module['stderr']);
          } else {
            FS.symlink('/dev/tty1', '/dev/stderr');
          }
    
          // open default streams for the stdin, stdout and stderr devices
          var stdin = FS.open('/dev/stdin', 'r');
          assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');
    
          var stdout = FS.open('/dev/stdout', 'w');
          assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');
    
          var stderr = FS.open('/dev/stderr', 'w');
          assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');
        },ensureErrnoError:function () {
          if (FS.ErrnoError) return;
          FS.ErrnoError = function ErrnoError(errno, node) {
            //Module.printErr(stackTrace()); // useful for debugging
            this.node = node;
            this.setErrno = function(errno) {
              this.errno = errno;
              for (var key in ERRNO_CODES) {
                if (ERRNO_CODES[key] === errno) {
                  this.code = key;
                  break;
                }
              }
            };
            this.setErrno(errno);
            this.message = ERRNO_MESSAGES[errno];
            if (this.stack) this.stack = demangleAll(this.stack);
          };
          FS.ErrnoError.prototype = new Error();
          FS.ErrnoError.prototype.constructor = FS.ErrnoError;
          // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
          [ERRNO_CODES.ENOENT].forEach(function(code) {
            FS.genericErrors[code] = new FS.ErrnoError(code);
            FS.genericErrors[code].stack = '<generic error, no stack>';
          });
        },staticInit:function () {
          FS.ensureErrnoError();
    
          FS.nameTable = new Array(4096);
    
          FS.mount(MEMFS, {}, '/');
    
          FS.createDefaultDirectories();
          FS.createDefaultDevices();
          FS.createSpecialDirectories();
    
          FS.filesystems = {
            'MEMFS': MEMFS,
            'IDBFS': IDBFS,
            'NODEFS': NODEFS,
            'WORKERFS': WORKERFS,
          };
        },init:function (input, output, error) {
          assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');
          FS.init.initialized = true;
    
          FS.ensureErrnoError();
    
          // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
          Module['stdin'] = input || Module['stdin'];
          Module['stdout'] = output || Module['stdout'];
          Module['stderr'] = error || Module['stderr'];
    
          FS.createStandardStreams();
        },quit:function () {
          FS.init.initialized = false;
          // force-flush all streams, so we get musl std streams printed out
          var fflush = Module['_fflush'];
          if (fflush) fflush(0);
          // close all of our streams
          for (var i = 0; i < FS.streams.length; i++) {
            var stream = FS.streams[i];
            if (!stream) {
              continue;
            }
            FS.close(stream);
          }
        },getMode:function (canRead, canWrite) {
          var mode = 0;
          if (canRead) mode |= 292 | 73;
          if (canWrite) mode |= 146;
          return mode;
        },joinPath:function (parts, forceRelative) {
          var path = PATH.join.apply(null, parts);
          if (forceRelative && path[0] == '/') path = path.substr(1);
          return path;
        },absolutePath:function (relative, base) {
          return PATH.resolve(base, relative);
        },standardizePath:function (path) {
          return PATH.normalize(path);
        },findObject:function (path, dontResolveLastLink) {
          var ret = FS.analyzePath(path, dontResolveLastLink);
          if (ret.exists) {
            return ret.object;
          } else {
            ___setErrNo(ret.error);
            return null;
          }
        },analyzePath:function (path, dontResolveLastLink) {
          // operate from within the context of the symlink's target
          try {
            var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
            path = lookup.path;
          } catch (e) {
          }
          var ret = {
            isRoot: false, exists: false, error: 0, name: null, path: null, object: null,
            parentExists: false, parentPath: null, parentObject: null
          };
          try {
            var lookup = FS.lookupPath(path, { parent: true });
            ret.parentExists = true;
            ret.parentPath = lookup.path;
            ret.parentObject = lookup.node;
            ret.name = PATH.basename(path);
            lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
            ret.exists = true;
            ret.path = lookup.path;
            ret.object = lookup.node;
            ret.name = lookup.node.name;
            ret.isRoot = lookup.path === '/';
          } catch (e) {
            ret.error = e.errno;
          };
          return ret;
        },createFolder:function (parent, name, canRead, canWrite) {
          var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
          var mode = FS.getMode(canRead, canWrite);
          return FS.mkdir(path, mode);
        },createPath:function (parent, path, canRead, canWrite) {
          parent = typeof parent === 'string' ? parent : FS.getPath(parent);
          var parts = path.split('/').reverse();
          while (parts.length) {
            var part = parts.pop();
            if (!part) continue;
            var current = PATH.join2(parent, part);
            try {
              FS.mkdir(current);
            } catch (e) {
              // ignore EEXIST
            }
            parent = current;
          }
          return current;
        },createFile:function (parent, name, properties, canRead, canWrite) {
          var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
          var mode = FS.getMode(canRead, canWrite);
          return FS.create(path, mode);
        },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {
          var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
          var mode = FS.getMode(canRead, canWrite);
          var node = FS.create(path, mode);
          if (data) {
            if (typeof data === 'string') {
              var arr = new Array(data.length);
              for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
              data = arr;
            }
            // make sure we can write to the file
            FS.chmod(node, mode | 146);
            var stream = FS.open(node, 'w');
            FS.write(stream, data, 0, data.length, 0, canOwn);
            FS.close(stream);
            FS.chmod(node, mode);
          }
          return node;
        },createDevice:function (parent, name, input, output) {
          var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
          var mode = FS.getMode(!!input, !!output);
          if (!FS.createDevice.major) FS.createDevice.major = 64;
          var dev = FS.makedev(FS.createDevice.major++, 0);
          // Create a fake device that a set of stream ops to emulate
          // the old behavior.
          FS.registerDevice(dev, {
            open: function(stream) {
              stream.seekable = false;
            },
            close: function(stream) {
              // flush any pending line data
              if (output && output.buffer && output.buffer.length) {
                output(10);
              }
            },
            read: function(stream, buffer, offset, length, pos /* ignored */) {
              var bytesRead = 0;
              for (var i = 0; i < length; i++) {
                var result;
                try {
                  result = input();
                } catch (e) {
                  throw new FS.ErrnoError(ERRNO_CODES.EIO);
                }
                if (result === undefined && bytesRead === 0) {
                  throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
                }
                if (result === null || result === undefined) break;
                bytesRead++;
                buffer[offset+i] = result;
              }
              if (bytesRead) {
                stream.node.timestamp = Date.now();
              }
              return bytesRead;
            },
            write: function(stream, buffer, offset, length, pos) {
              for (var i = 0; i < length; i++) {
                try {
                  output(buffer[offset+i]);
                } catch (e) {
                  throw new FS.ErrnoError(ERRNO_CODES.EIO);
                }
              }
              if (length) {
                stream.node.timestamp = Date.now();
              }
              return i;
            }
          });
          return FS.mkdev(path, mode, dev);
        },createLink:function (parent, name, target, canRead, canWrite) {
          var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
          return FS.symlink(target, path);
        },forceLoadFile:function (obj) {
          if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
          var success = true;
          if (typeof XMLHttpRequest !== 'undefined') {
            throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
          } else if (Module['read']) {
            // Command-line.
            try {
              // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
              //          read() will try to parse UTF8.
              obj.contents = intArrayFromString(Module['read'](obj.url), true);
              obj.usedBytes = obj.contents.length;
            } catch (e) {
              success = false;
            }
          } else {
            throw new Error('Cannot load without read() or XMLHttpRequest.');
          }
          if (!success) ___setErrNo(ERRNO_CODES.EIO);
          return success;
        },createLazyFile:function (parent, name, url, canRead, canWrite) {
          // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
          function LazyUint8Array() {
            this.lengthKnown = false;
            this.chunks = []; // Loaded chunks. Index is the chunk number
          }
          LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {
            if (idx > this.length-1 || idx < 0) {
              return undefined;
            }
            var chunkOffset = idx % this.chunkSize;
            var chunkNum = (idx / this.chunkSize)|0;
            return this.getter(chunkNum)[chunkOffset];
          }
          LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {
            this.getter = getter;
          }
          LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {
            // Find length
            var xhr = new XMLHttpRequest();
            xhr.open('HEAD', url, false);
            xhr.send(null);
            if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
            var datalength = Number(xhr.getResponseHeader("Content-length"));
            var header;
            var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
            var chunkSize = 1024*1024; // Chunk size in bytes
    
            if (!hasByteServing) chunkSize = datalength;
    
            // Function to get a range from the remote URL.
            var doXHR = (function(from, to) {
              if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
              if (to > datalength-1) throw new Error("only " + datalength + " bytes available! programmer error!");
    
              // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
              var xhr = new XMLHttpRequest();
              xhr.open('GET', url, false);
              if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
    
              // Some hints to the browser that we want binary data.
              if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';
              if (xhr.overrideMimeType) {
                xhr.overrideMimeType('text/plain; charset=x-user-defined');
              }
    
              xhr.send(null);
              if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
              if (xhr.response !== undefined) {
                return new Uint8Array(xhr.response || []);
              } else {
                return intArrayFromString(xhr.responseText || '', true);
              }
            });
            var lazyArray = this;
            lazyArray.setDataGetter(function(chunkNum) {
              var start = chunkNum * chunkSize;
              var end = (chunkNum+1) * chunkSize - 1; // including this byte
              end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block
              if (typeof(lazyArray.chunks[chunkNum]) === "undefined") {
                lazyArray.chunks[chunkNum] = doXHR(start, end);
              }
              if (typeof(lazyArray.chunks[chunkNum]) === "undefined") throw new Error("doXHR failed!");
              return lazyArray.chunks[chunkNum];
            });
    
            this._length = datalength;
            this._chunkSize = chunkSize;
            this.lengthKnown = true;
          }
          if (typeof XMLHttpRequest !== 'undefined') {
            if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';
            var lazyArray = new LazyUint8Array();
            Object.defineProperty(lazyArray, "length", {
                get: function() {
                    if(!this.lengthKnown) {
                        this.cacheLength();
                    }
                    return this._length;
                }
            });
            Object.defineProperty(lazyArray, "chunkSize", {
                get: function() {
                    if(!this.lengthKnown) {
                        this.cacheLength();
                    }
                    return this._chunkSize;
                }
            });
    
            var properties = { isDevice: false, contents: lazyArray };
          } else {
            var properties = { isDevice: false, url: url };
          }
    
          var node = FS.createFile(parent, name, properties, canRead, canWrite);
          // This is a total hack, but I want to get this lazy file code out of the
          // core of MEMFS. If we want to keep this lazy file concept I feel it should
          // be its own thin LAZYFS proxying calls to MEMFS.
          if (properties.contents) {
            node.contents = properties.contents;
          } else if (properties.url) {
            node.contents = null;
            node.url = properties.url;
          }
          // Add a function that defers querying the file size until it is asked the first time.
          Object.defineProperty(node, "usedBytes", {
              get: function() { return this.contents.length; }
          });
          // override each stream op with one that tries to force load the lazy file first
          var stream_ops = {};
          var keys = Object.keys(node.stream_ops);
          keys.forEach(function(key) {
            var fn = node.stream_ops[key];
            stream_ops[key] = function forceLoadLazyFile() {
              if (!FS.forceLoadFile(node)) {
                throw new FS.ErrnoError(ERRNO_CODES.EIO);
              }
              return fn.apply(null, arguments);
            };
          });
          // use a custom read function
          stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {
            if (!FS.forceLoadFile(node)) {
              throw new FS.ErrnoError(ERRNO_CODES.EIO);
            }
            var contents = stream.node.contents;
            if (position >= contents.length)
              return 0;
            var size = Math.min(contents.length - position, length);
            assert(size >= 0);
            if (contents.slice) { // normal array
              for (var i = 0; i < size; i++) {
                buffer[offset + i] = contents[position + i];
              }
            } else {
              for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR
                buffer[offset + i] = contents.get(position + i);
              }
            }
            return size;
          };
          node.stream_ops = stream_ops;
          return node;
        },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) {
          Browser.init();
          // TODO we should allow people to just pass in a complete filename instead
          // of parent and name being that we just join them anyways
          var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
          var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname
          function processData(byteArray) {
            function finish(byteArray) {
              if (preFinish) preFinish();
              if (!dontCreateFile) {
                FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
              }
              if (onload) onload();
              removeRunDependency(dep);
            }
            var handled = false;
            Module['preloadPlugins'].forEach(function(plugin) {
              if (handled) return;
              if (plugin['canHandle'](fullname)) {
                plugin['handle'](byteArray, fullname, finish, function() {
                  if (onerror) onerror();
                  removeRunDependency(dep);
                });
                handled = true;
              }
            });
            if (!handled) finish(byteArray);
          }
          addRunDependency(dep);
          if (typeof url == 'string') {
            Browser.asyncLoad(url, function(byteArray) {
              processData(byteArray);
            }, onerror);
          } else {
            processData(url);
          }
        },indexedDB:function () {
          return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
        },DB_NAME:function () {
          return 'EM_FS_' + window.location.pathname;
        },DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function (paths, onload, onerror) {
          onload = onload || function(){};
          onerror = onerror || function(){};
          var indexedDB = FS.indexedDB();
          try {
            var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
          } catch (e) {
            return onerror(e);
          }
          openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {
            console.log('creating db');
            var db = openRequest.result;
            db.createObjectStore(FS.DB_STORE_NAME);
          };
          openRequest.onsuccess = function openRequest_onsuccess() {
            var db = openRequest.result;
            var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
            var files = transaction.objectStore(FS.DB_STORE_NAME);
            var ok = 0, fail = 0, total = paths.length;
            function finish() {
              if (fail == 0) onload(); else onerror();
            }
            paths.forEach(function(path) {
              var putRequest = files.put(FS.analyzePath(path).object.contents, path);
              putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };
              putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };
            });
            transaction.onerror = onerror;
          };
          openRequest.onerror = onerror;
        },loadFilesFromDB:function (paths, onload, onerror) {
          onload = onload || function(){};
          onerror = onerror || function(){};
          var indexedDB = FS.indexedDB();
          try {
            var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
          } catch (e) {
            return onerror(e);
          }
          openRequest.onupgradeneeded = onerror; // no database to load from
          openRequest.onsuccess = function openRequest_onsuccess() {
            var db = openRequest.result;
            try {
              var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
            } catch(e) {
              onerror(e);
              return;
            }
            var files = transaction.objectStore(FS.DB_STORE_NAME);
            var ok = 0, fail = 0, total = paths.length;
            function finish() {
              if (fail == 0) onload(); else onerror();
            }
            paths.forEach(function(path) {
              var getRequest = files.get(path);
              getRequest.onsuccess = function getRequest_onsuccess() {
                if (FS.analyzePath(path).exists) {
                  FS.unlink(path);
                }
                FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
                ok++;
                if (ok + fail == total) finish();
              };
              getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };
            });
            transaction.onerror = onerror;
          };
          openRequest.onerror = onerror;
        }};var PATH={splitPath:function (filename) {
          var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
          return splitPathRe.exec(filename).slice(1);
        },normalizeArray:function (parts, allowAboveRoot) {
          // if the path tries to go above the root, `up` ends up > 0
          var up = 0;
          for (var i = parts.length - 1; i >= 0; i--) {
            var last = parts[i];
            if (last === '.') {
              parts.splice(i, 1);
            } else if (last === '..') {
              parts.splice(i, 1);
              up++;
            } else if (up) {
              parts.splice(i, 1);
              up--;
            }
          }
          // if the path is allowed to go above the root, restore leading ..s
          if (allowAboveRoot) {
            for (; up--; up) {
              parts.unshift('..');
            }
          }
          return parts;
        },normalize:function (path) {
          var isAbsolute = path.charAt(0) === '/',
              trailingSlash = path.substr(-1) === '/';
          // Normalize the path
          path = PATH.normalizeArray(path.split('/').filter(function(p) {
            return !!p;
          }), !isAbsolute).join('/');
          if (!path && !isAbsolute) {
            path = '.';
          }
          if (path && trailingSlash) {
            path += '/';
          }
          return (isAbsolute ? '/' : '') + path;
        },dirname:function (path) {
          var result = PATH.splitPath(path),
              root = result[0],
              dir = result[1];
          if (!root && !dir) {
            // No dirname whatsoever
            return '.';
          }
          if (dir) {
            // It has a dirname, strip trailing slash
            dir = dir.substr(0, dir.length - 1);
          }
          return root + dir;
        },basename:function (path) {
          // EMSCRIPTEN return '/'' for '/', not an empty string
          if (path === '/') return '/';
          var lastSlash = path.lastIndexOf('/');
          if (lastSlash === -1) return path;
          return path.substr(lastSlash+1);
        },extname:function (path) {
          return PATH.splitPath(path)[3];
        },join:function () {
          var paths = Array.prototype.slice.call(arguments, 0);
          return PATH.normalize(paths.join('/'));
        },join2:function (l, r) {
          return PATH.normalize(l + '/' + r);
        },resolve:function () {
          var resolvedPath = '',
            resolvedAbsolute = false;
          for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
            var path = (i >= 0) ? arguments[i] : FS.cwd();
            // Skip empty and invalid entries
            if (typeof path !== 'string') {
              throw new TypeError('Arguments to path.resolve must be strings');
            } else if (!path) {
              return ''; // an invalid portion invalidates the whole thing
            }
            resolvedPath = path + '/' + resolvedPath;
            resolvedAbsolute = path.charAt(0) === '/';
          }
          // At this point the path should be resolved to a full absolute path, but
          // handle relative paths to be safe (might happen when process.cwd() fails)
          resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {
            return !!p;
          }), !resolvedAbsolute).join('/');
          return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
        },relative:function (from, to) {
          from = PATH.resolve(from).substr(1);
          to = PATH.resolve(to).substr(1);
          function trim(arr) {
            var start = 0;
            for (; start < arr.length; start++) {
              if (arr[start] !== '') break;
            }
            var end = arr.length - 1;
            for (; end >= 0; end--) {
              if (arr[end] !== '') break;
            }
            if (start > end) return [];
            return arr.slice(start, end - start + 1);
          }
          var fromParts = trim(from.split('/'));
          var toParts = trim(to.split('/'));
          var length = Math.min(fromParts.length, toParts.length);
          var samePartsLength = length;
          for (var i = 0; i < length; i++) {
            if (fromParts[i] !== toParts[i]) {
              samePartsLength = i;
              break;
            }
          }
          var outputParts = [];
          for (var i = samePartsLength; i < fromParts.length; i++) {
            outputParts.push('..');
          }
          outputParts = outputParts.concat(toParts.slice(samePartsLength));
          return outputParts.join('/');
        }};
    
    
    function _emscripten_set_main_loop_timing(mode, value) {
        Browser.mainLoop.timingMode = mode;
        Browser.mainLoop.timingValue = value;
    
        if (!Browser.mainLoop.func) {
          console.error('emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.');
          return 1; // Return non-zero on failure, can't set timing mode when there is no main loop.
        }
    
        if (mode == 0 /*EM_TIMING_SETTIMEOUT*/) {
          Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setTimeout() {
            setTimeout(Browser.mainLoop.runner, value); // doing this each time means that on exception, we stop
          };
          Browser.mainLoop.method = 'timeout';
        } else if (mode == 1 /*EM_TIMING_RAF*/) {
          Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_rAF() {
            Browser.requestAnimationFrame(Browser.mainLoop.runner);
          };
          Browser.mainLoop.method = 'rAF';
        } else if (mode == 2 /*EM_TIMING_SETIMMEDIATE*/) {
          if (!window['setImmediate']) {
            // Emulate setImmediate. (note: not a complete polyfill, we don't emulate clearImmediate() to keep code size to minimum, since not needed)
            var setImmediates = [];
            var emscriptenMainLoopMessageId = '__emcc';
            function Browser_setImmediate_messageHandler(event) {
              if (event.source === window && event.data === emscriptenMainLoopMessageId) {
                event.stopPropagation();
                setImmediates.shift()();
              }
            }
            window.addEventListener("message", Browser_setImmediate_messageHandler, true);
            window['setImmediate'] = function Browser_emulated_setImmediate(func) {
              setImmediates.push(func);
              window.postMessage(emscriptenMainLoopMessageId, "*");
            }
          }
          Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setImmediate() {
            window['setImmediate'](Browser.mainLoop.runner);
          };
          Browser.mainLoop.method = 'immediate';
        }
        return 0;
      }function _emscripten_set_main_loop(func, fps, simulateInfiniteLoop, arg, noSetTiming) {
        Module['noExitRuntime'] = true;
    
        assert(!Browser.mainLoop.func, 'emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.');
    
        Browser.mainLoop.func = func;
        Browser.mainLoop.arg = arg;
    
        var thisMainLoopId = Browser.mainLoop.currentlyRunningMainloop;
    
        Browser.mainLoop.runner = function Browser_mainLoop_runner() {
          if (ABORT) return;
          if (Browser.mainLoop.queue.length > 0) {
            var start = Date.now();
            var blocker = Browser.mainLoop.queue.shift();
            blocker.func(blocker.arg);
            if (Browser.mainLoop.remainingBlockers) {
              var remaining = Browser.mainLoop.remainingBlockers;
              var next = remaining%1 == 0 ? remaining-1 : Math.floor(remaining);
              if (blocker.counted) {
                Browser.mainLoop.remainingBlockers = next;
              } else {
                // not counted, but move the progress along a tiny bit
                next = next + 0.5; // do not steal all the next one's progress
                Browser.mainLoop.remainingBlockers = (8*remaining + next)/9;
              }
            }
            console.log('main loop blocker "' + blocker.name + '" took ' + (Date.now() - start) + ' ms'); //, left: ' + Browser.mainLoop.remainingBlockers);
            Browser.mainLoop.updateStatus();
            setTimeout(Browser.mainLoop.runner, 0);
            return;
          }
    
          // catch pauses from non-main loop sources
          if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
    
          // Implement very basic swap interval control
          Browser.mainLoop.currentFrameNumber = Browser.mainLoop.currentFrameNumber + 1 | 0;
          if (Browser.mainLoop.timingMode == 1/*EM_TIMING_RAF*/ && Browser.mainLoop.timingValue > 1 && Browser.mainLoop.currentFrameNumber % Browser.mainLoop.timingValue != 0) {
            // Not the scheduled time to render this frame - skip.
            Browser.mainLoop.scheduler();
            return;
          }
    
          // Signal GL rendering layer that processing of a new frame is about to start. This helps it optimize
          // VBO double-buffering and reduce GPU stalls.
    
          if (Browser.mainLoop.method === 'timeout' && Module.ctx) {
            Module.printErr('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!');
            Browser.mainLoop.method = ''; // just warn once per call to set main loop
          }
    
          Browser.mainLoop.runIter(function() {
            if (typeof arg !== 'undefined') {
              Runtime.dynCall('vi', func, [arg]);
            } else {
              Runtime.dynCall('v', func);
            }
          });
    
          // catch pauses from the main loop itself
          if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
    
          // Queue new audio data. This is important to be right after the main loop invocation, so that we will immediately be able
          // to queue the newest produced audio samples.
          // TODO: Consider adding pre- and post- rAF callbacks so that GL.newRenderingFrameStarted() and SDL.audio.queueNewAudioData()
          //       do not need to be hardcoded into this function, but can be more generic.
          if (typeof SDL === 'object' && SDL.audio && SDL.audio.queueNewAudioData) SDL.audio.queueNewAudioData();
    
          Browser.mainLoop.scheduler();
        }
    
        if (!noSetTiming) {
          if (fps && fps > 0) _emscripten_set_main_loop_timing(0/*EM_TIMING_SETTIMEOUT*/, 1000.0 / fps);
          else _emscripten_set_main_loop_timing(1/*EM_TIMING_RAF*/, 1); // Do rAF by rendering each frame (no decimating)
    
          Browser.mainLoop.scheduler();
        }
    
        if (simulateInfiniteLoop) {
          throw 'SimulateInfiniteLoop';
        }
      }var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function () {
            Browser.mainLoop.scheduler = null;
            Browser.mainLoop.currentlyRunningMainloop++; // Incrementing this signals the previous main loop that it's now become old, and it must return.
          },resume:function () {
            Browser.mainLoop.currentlyRunningMainloop++;
            var timingMode = Browser.mainLoop.timingMode;
            var timingValue = Browser.mainLoop.timingValue;
            var func = Browser.mainLoop.func;
            Browser.mainLoop.func = null;
            _emscripten_set_main_loop(func, 0, false, Browser.mainLoop.arg, true /* do not set timing and call scheduler, we will do it on the next lines */);
            _emscripten_set_main_loop_timing(timingMode, timingValue);
            Browser.mainLoop.scheduler();
          },updateStatus:function () {
            if (Module['setStatus']) {
              var message = Module['statusMessage'] || 'Please wait...';
              var remaining = Browser.mainLoop.remainingBlockers;
              var expected = Browser.mainLoop.expectedBlockers;
              if (remaining) {
                if (remaining < expected) {
                  Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');
                } else {
                  Module['setStatus'](message);
                }
              } else {
                Module['setStatus']('');
              }
            }
          },runIter:function (func) {
            if (ABORT) return;
            if (Module['preMainLoop']) {
              var preRet = Module['preMainLoop']();
              if (preRet === false) {
                return; // |return false| skips a frame
              }
            }
            try {
              func();
            } catch (e) {
              if (e instanceof ExitStatus) {
                return;
              } else {
                if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
                throw e;
              }
            }
            if (Module['postMainLoop']) Module['postMainLoop']();
          }},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {
          if (!Module["preloadPlugins"]) Module["preloadPlugins"] = []; // needs to exist even in workers
    
          if (Browser.initted) return;
          Browser.initted = true;
    
          try {
            new Blob();
            Browser.hasBlobConstructor = true;
          } catch(e) {
            Browser.hasBlobConstructor = false;
            console.log("warning: no blob constructor, cannot create blobs with mimetypes");
          }
          Browser.BlobBuilder = typeof MozBlobBuilder != "undefined" ? MozBlobBuilder : (typeof WebKitBlobBuilder != "undefined" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log("warning: no BlobBuilder") : null));
          Browser.URLObject = typeof window != "undefined" ? (window.URL ? window.URL : window.webkitURL) : undefined;
          if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {
            console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");
            Module.noImageDecoding = true;
          }
    
          // Support for plugins that can process preloaded files. You can add more of these to
          // your app by creating and appending to Module.preloadPlugins.
          //
          // Each plugin is asked if it can handle a file based on the file's name. If it can,
          // it is given the file's raw data. When it is done, it calls a callback with the file's
          // (possibly modified) data. For example, a plugin might decompress a file, or it
          // might create some side data structure for use later (like an Image element, etc.).
    
          var imagePlugin = {};
          imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {
            return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/i.test(name);
          };
          imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {
            var b = null;
            if (Browser.hasBlobConstructor) {
              try {
                b = new Blob([byteArray], { type: Browser.getMimetype(name) });
                if (b.size !== byteArray.length) { // Safari bug #118630
                  // Safari's Blob can only take an ArrayBuffer
                  b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });
                }
              } catch(e) {
                Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');
              }
            }
            if (!b) {
              var bb = new Browser.BlobBuilder();
              bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range
              b = bb.getBlob();
            }
            var url = Browser.URLObject.createObjectURL(b);
            assert(typeof url == 'string', 'createObjectURL must return a url as a string');
            var img = new Image();
            img.onload = function img_onload() {
              assert(img.complete, 'Image ' + name + ' could not be decoded');
              var canvas = document.createElement('canvas');
              canvas.width = img.width;
              canvas.height = img.height;
              var ctx = canvas.getContext('2d');
              ctx.drawImage(img, 0, 0);
              Module["preloadedImages"][name] = canvas;
              Browser.URLObject.revokeObjectURL(url);
              if (onload) onload(byteArray);
            };
            img.onerror = function img_onerror(event) {
              console.log('Image ' + url + ' could not be decoded');
              if (onerror) onerror();
            };
            img.src = url;
          };
          Module['preloadPlugins'].push(imagePlugin);
    
          var audioPlugin = {};
          audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {
            return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
          };
          audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {
            var done = false;
            function finish(audio) {
              if (done) return;
              done = true;
              Module["preloadedAudios"][name] = audio;
              if (onload) onload(byteArray);
            }
            function fail() {
              if (done) return;
              done = true;
              Module["preloadedAudios"][name] = new Audio(); // empty shim
              if (onerror) onerror();
            }
            if (Browser.hasBlobConstructor) {
              try {
                var b = new Blob([byteArray], { type: Browser.getMimetype(name) });
              } catch(e) {
                return fail();
              }
              var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!
              assert(typeof url == 'string', 'createObjectURL must return a url as a string');
              var audio = new Audio();
              audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926
              audio.onerror = function audio_onerror(event) {
                if (done) return;
                console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');
                function encode64(data) {
                  var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
                  var PAD = '=';
                  var ret = '';
                  var leftchar = 0;
                  var leftbits = 0;
                  for (var i = 0; i < data.length; i++) {
                    leftchar = (leftchar << 8) | data[i];
                    leftbits += 8;
                    while (leftbits >= 6) {
                      var curr = (leftchar >> (leftbits-6)) & 0x3f;
                      leftbits -= 6;
                      ret += BASE[curr];
                    }
                  }
                  if (leftbits == 2) {
                    ret += BASE[(leftchar&3) << 4];
                    ret += PAD + PAD;
                  } else if (leftbits == 4) {
                    ret += BASE[(leftchar&0xf) << 2];
                    ret += PAD;
                  }
                  return ret;
                }
                audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);
                finish(audio); // we don't wait for confirmation this worked - but it's worth trying
              };
              audio.src = url;
              // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror
              Browser.safeSetTimeout(function() {
                finish(audio); // try to use it even though it is not necessarily ready to play
              }, 10000);
            } else {
              return fail();
            }
          };
          Module['preloadPlugins'].push(audioPlugin);
    
          // Canvas event setup
    
          var canvas = Module['canvas'];
          function pointerLockChange() {
            Browser.pointerLock = document['pointerLockElement'] === canvas ||
                                  document['mozPointerLockElement'] === canvas ||
                                  document['webkitPointerLockElement'] === canvas ||
                                  document['msPointerLockElement'] === canvas;
          }
          if (canvas) {
            // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module
            // Module['forcedAspectRatio'] = 4 / 3;
            
            canvas.requestPointerLock = canvas['requestPointerLock'] ||
                                        canvas['mozRequestPointerLock'] ||
                                        canvas['webkitRequestPointerLock'] ||
                                        canvas['msRequestPointerLock'] ||
                                        function(){};
            canvas.exitPointerLock = document['exitPointerLock'] ||
                                     document['mozExitPointerLock'] ||
                                     document['webkitExitPointerLock'] ||
                                     document['msExitPointerLock'] ||
                                     function(){}; // no-op if function does not exist
            canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
    
    
            document.addEventListener('pointerlockchange', pointerLockChange, false);
            document.addEventListener('mozpointerlockchange', pointerLockChange, false);
            document.addEventListener('webkitpointerlockchange', pointerLockChange, false);
            document.addEventListener('mspointerlockchange', pointerLockChange, false);
    
            if (Module['elementPointerLock']) {
              canvas.addEventListener("click", function(ev) {
                if (!Browser.pointerLock && canvas.requestPointerLock) {
                  canvas.requestPointerLock();
                  ev.preventDefault();
                }
              }, false);
            }
          }
        },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {
          if (useWebGL && Module.ctx && canvas == Module.canvas) return Module.ctx; // no need to recreate GL context if it's already been created for this canvas.
    
          var ctx;
          var contextHandle;
          if (useWebGL) {
            // For GLES2/desktop GL compatibility, adjust a few defaults to be different to WebGL defaults, so that they align better with the desktop defaults.
            var contextAttributes = {
              antialias: false,
              alpha: false
            };
    
            if (webGLContextAttributes) {
              for (var attribute in webGLContextAttributes) {
                contextAttributes[attribute] = webGLContextAttributes[attribute];
              }
            }
    
            contextHandle = GL.createContext(canvas, contextAttributes);
            if (contextHandle) {
              ctx = GL.getContext(contextHandle).GLctx;
            }
            // Set the background of the WebGL canvas to black
            canvas.style.backgroundColor = "black";
          } else {
            ctx = canvas.getContext('2d');
          }
    
          if (!ctx) return null;
    
          if (setInModule) {
            if (!useWebGL) assert(typeof GLctx === 'undefined', 'cannot set in module if GLctx is used, but we are a non-GL context that would replace it');
    
            Module.ctx = ctx;
            if (useWebGL) GL.makeContextCurrent(contextHandle);
            Module.useWebGL = useWebGL;
            Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });
            Browser.init();
          }
          return ctx;
        },destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas, vrDevice) {
          Browser.lockPointer = lockPointer;
          Browser.resizeCanvas = resizeCanvas;
          Browser.vrDevice = vrDevice;
          if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;
          if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;
          if (typeof Browser.vrDevice === 'undefined') Browser.vrDevice = null;
    
          var canvas = Module['canvas'];
          function fullScreenChange() {
            Browser.isFullScreen = false;
            var canvasContainer = canvas.parentNode;
            if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
                 document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
                 document['fullScreenElement'] || document['fullscreenElement'] ||
                 document['msFullScreenElement'] || document['msFullscreenElement'] ||
                 document['webkitCurrentFullScreenElement']) === canvasContainer) {
              canvas.cancelFullScreen = document['cancelFullScreen'] ||
                                        document['mozCancelFullScreen'] ||
                                        document['webkitCancelFullScreen'] ||
                                        document['msExitFullscreen'] ||
                                        document['exitFullscreen'] ||
                                        function() {};
              canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);
              if (Browser.lockPointer) canvas.requestPointerLock();
              Browser.isFullScreen = true;
              if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();
            } else {
              
              // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen
              canvasContainer.parentNode.insertBefore(canvas, canvasContainer);
              canvasContainer.parentNode.removeChild(canvasContainer);
              
              if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();
            }
            if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);
            Browser.updateCanvasDimensions(canvas);
          }
    
          if (!Browser.fullScreenHandlersInstalled) {
            Browser.fullScreenHandlersInstalled = true;
            document.addEventListener('fullscreenchange', fullScreenChange, false);
            document.addEventListener('mozfullscreenchange', fullScreenChange, false);
            document.addEventListener('webkitfullscreenchange', fullScreenChange, false);
            document.addEventListener('MSFullscreenChange', fullScreenChange, false);
          }
    
          // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root
          var canvasContainer = document.createElement("div");
          canvas.parentNode.insertBefore(canvasContainer, canvas);
          canvasContainer.appendChild(canvas);
    
          // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)
          canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||
                                              canvasContainer['mozRequestFullScreen'] ||
                                              canvasContainer['msRequestFullscreen'] ||
                                             (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
    
          if (vrDevice) {
            canvasContainer.requestFullScreen({ vrDisplay: vrDevice });
          } else {
            canvasContainer.requestFullScreen();
          }
        },nextRAF:0,fakeRequestAnimationFrame:function (func) {
          // try to keep 60fps between calls to here
          var now = Date.now();
          if (Browser.nextRAF === 0) {
            Browser.nextRAF = now + 1000/60;
          } else {
            while (now + 2 >= Browser.nextRAF) { // fudge a little, to avoid timer jitter causing us to do lots of delay:0
              Browser.nextRAF += 1000/60;
            }
          }
          var delay = Math.max(Browser.nextRAF - now, 0);
          setTimeout(func, delay);
        },requestAnimationFrame:function requestAnimationFrame(func) {
          if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)
            Browser.fakeRequestAnimationFrame(func);
          } else {
            if (!window.requestAnimationFrame) {
              window.requestAnimationFrame = window['requestAnimationFrame'] ||
                                             window['mozRequestAnimationFrame'] ||
                                             window['webkitRequestAnimationFrame'] ||
                                             window['msRequestAnimationFrame'] ||
                                             window['oRequestAnimationFrame'] ||
                                             Browser.fakeRequestAnimationFrame;
            }
            window.requestAnimationFrame(func);
          }
        },safeCallback:function (func) {
          return function() {
            if (!ABORT) return func.apply(null, arguments);
          };
        },allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function () {
          Browser.allowAsyncCallbacks = false;
        },resumeAsyncCallbacks:function () { // marks future callbacks as ok to execute, and synchronously runs any remaining ones right now
          Browser.allowAsyncCallbacks = true;
          if (Browser.queuedAsyncCallbacks.length > 0) {
            var callbacks = Browser.queuedAsyncCallbacks;
            Browser.queuedAsyncCallbacks = [];
            callbacks.forEach(function(func) {
              func();
            });
          }
        },safeRequestAnimationFrame:function (func) {
          return Browser.requestAnimationFrame(function() {
            if (ABORT) return;
            if (Browser.allowAsyncCallbacks) {
              func();
            } else {
              Browser.queuedAsyncCallbacks.push(func);
            }
          });
        },safeSetTimeout:function (func, timeout) {
          Module['noExitRuntime'] = true;
          return setTimeout(function() {
            if (ABORT) return;
            if (Browser.allowAsyncCallbacks) {
              func();
            } else {
              Browser.queuedAsyncCallbacks.push(func);
            }
          }, timeout);
        },safeSetInterval:function (func, timeout) {
          Module['noExitRuntime'] = true;
          return setInterval(function() {
            if (ABORT) return;
            if (Browser.allowAsyncCallbacks) {
              func();
            } // drop it on the floor otherwise, next interval will kick in
          }, timeout);
        },getMimetype:function (name) {
          return {
            'jpg': 'image/jpeg',
            'jpeg': 'image/jpeg',
            'png': 'image/png',
            'bmp': 'image/bmp',
            'ogg': 'audio/ogg',
            'wav': 'audio/wav',
            'mp3': 'audio/mpeg'
          }[name.substr(name.lastIndexOf('.')+1)];
        },getUserMedia:function (func) {
          if(!window.getUserMedia) {
            window.getUserMedia = navigator['getUserMedia'] ||
                                  navigator['mozGetUserMedia'];
          }
          window.getUserMedia(func);
        },getMovementX:function (event) {
          return event['movementX'] ||
                 event['mozMovementX'] ||
                 event['webkitMovementX'] ||
                 0;
        },getMovementY:function (event) {
          return event['movementY'] ||
                 event['mozMovementY'] ||
                 event['webkitMovementY'] ||
                 0;
        },getMouseWheelDelta:function (event) {
          var delta = 0;
          switch (event.type) {
            case 'DOMMouseScroll': 
              delta = event.detail;
              break;
            case 'mousewheel': 
              delta = event.wheelDelta;
              break;
            case 'wheel': 
              delta = event['deltaY'];
              break;
            default:
              throw 'unrecognized mouse wheel event: ' + event.type;
          }
          return delta;
        },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup
          if (Browser.pointerLock) {
            // When the pointer is locked, calculate the coordinates
            // based on the movement of the mouse.
            // Workaround for Firefox bug 764498
            if (event.type != 'mousemove' &&
                ('mozMovementX' in event)) {
              Browser.mouseMovementX = Browser.mouseMovementY = 0;
            } else {
              Browser.mouseMovementX = Browser.getMovementX(event);
              Browser.mouseMovementY = Browser.getMovementY(event);
            }
            
            // check if SDL is available
            if (typeof SDL != "undefined") {
            	Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
            	Browser.mouseY = SDL.mouseY + Browser.mouseMovementY;
            } else {
            	// just add the mouse delta to the current absolut mouse position
            	// FIXME: ideally this should be clamped against the canvas size and zero
            	Browser.mouseX += Browser.mouseMovementX;
            	Browser.mouseY += Browser.mouseMovementY;
            }        
          } else {
            // Otherwise, calculate the movement based on the changes
            // in the coordinates.
            var rect = Module["canvas"].getBoundingClientRect();
            var cw = Module["canvas"].width;
            var ch = Module["canvas"].height;
    
            // Neither .scrollX or .pageXOffset are defined in a spec, but
            // we prefer .scrollX because it is currently in a spec draft.
            // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)
            var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);
            var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);
            // If this assert lands, it's likely because the browser doesn't support scrollX or pageXOffset
            // and we have no viable fallback.
            assert((typeof scrollX !== 'undefined') && (typeof scrollY !== 'undefined'), 'Unable to retrieve scroll position, mouse positions likely broken.');
    
            if (event.type === 'touchstart' || event.type === 'touchend' || event.type === 'touchmove') {
              var touch = event.touch;
              if (touch === undefined) {
                return; // the "touch" property is only defined in SDL
    
              }
              var adjustedX = touch.pageX - (scrollX + rect.left);
              var adjustedY = touch.pageY - (scrollY + rect.top);
    
              adjustedX = adjustedX * (cw / rect.width);
              adjustedY = adjustedY * (ch / rect.height);
    
              var coords = { x: adjustedX, y: adjustedY };
              
              if (event.type === 'touchstart') {
                Browser.lastTouches[touch.identifier] = coords;
                Browser.touches[touch.identifier] = coords;
              } else if (event.type === 'touchend' || event.type === 'touchmove') {
                var last = Browser.touches[touch.identifier];
                if (!last) last = coords;
                Browser.lastTouches[touch.identifier] = last;
                Browser.touches[touch.identifier] = coords;
              } 
              return;
            }
    
            var x = event.pageX - (scrollX + rect.left);
            var y = event.pageY - (scrollY + rect.top);
    
            // the canvas might be CSS-scaled compared to its backbuffer;
            // SDL-using content will want mouse coordinates in terms
            // of backbuffer units.
            x = x * (cw / rect.width);
            y = y * (ch / rect.height);
    
            Browser.mouseMovementX = x - Browser.mouseX;
            Browser.mouseMovementY = y - Browser.mouseY;
            Browser.mouseX = x;
            Browser.mouseY = y;
          }
        },xhrLoad:function (url, onload, onerror) {
          var xhr = new XMLHttpRequest();
          xhr.open('GET', url, true);
          xhr.responseType = 'arraybuffer';
          xhr.onload = function xhr_onload() {
            if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
              onload(xhr.response);
            } else {
              onerror();
            }
          };
          xhr.onerror = onerror;
          xhr.send(null);
        },asyncLoad:function (url, onload, onerror, noRunDep) {
          Browser.xhrLoad(url, function(arrayBuffer) {
            assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).');
            onload(new Uint8Array(arrayBuffer));
            if (!noRunDep) removeRunDependency('al ' + url);
          }, function(event) {
            if (onerror) {
              onerror();
            } else {
              throw 'Loading data file "' + url + '" failed.';
            }
          });
          if (!noRunDep) addRunDependency('al ' + url);
        },resizeListeners:[],updateResizeListeners:function () {
          var canvas = Module['canvas'];
          Browser.resizeListeners.forEach(function(listener) {
            listener(canvas.width, canvas.height);
          });
        },setCanvasSize:function (width, height, noUpdates) {
          var canvas = Module['canvas'];
          Browser.updateCanvasDimensions(canvas, width, height);
          if (!noUpdates) Browser.updateResizeListeners();
        },windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {
          // check if SDL is available   
          if (typeof SDL != "undefined") {
          	var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
          	flags = flags | 0x00800000; // set SDL_FULLSCREEN flag
          	HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
          }
          Browser.updateResizeListeners();
        },setWindowedCanvasSize:function () {
          // check if SDL is available       
          if (typeof SDL != "undefined") {
          	var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
          	flags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag
          	HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
          }
          Browser.updateResizeListeners();
        },updateCanvasDimensions:function (canvas, wNative, hNative) {
          if (wNative && hNative) {
            canvas.widthNative = wNative;
            canvas.heightNative = hNative;
          } else {
            wNative = canvas.widthNative;
            hNative = canvas.heightNative;
          }
          var w = wNative;
          var h = hNative;
          if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
            if (w/h < Module['forcedAspectRatio']) {
              w = Math.round(h * Module['forcedAspectRatio']);
            } else {
              h = Math.round(w / Module['forcedAspectRatio']);
            }
          }
          if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
               document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
               document['fullScreenElement'] || document['fullscreenElement'] ||
               document['msFullScreenElement'] || document['msFullscreenElement'] ||
               document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {
             var factor = Math.min(screen.width / w, screen.height / h);
             w = Math.round(w * factor);
             h = Math.round(h * factor);
          }
          if (Browser.resizeCanvas) {
            if (canvas.width  != w) canvas.width  = w;
            if (canvas.height != h) canvas.height = h;
            if (typeof canvas.style != 'undefined') {
              canvas.style.removeProperty( "width");
              canvas.style.removeProperty("height");
            }
          } else {
            if (canvas.width  != wNative) canvas.width  = wNative;
            if (canvas.height != hNative) canvas.height = hNative;
            if (typeof canvas.style != 'undefined') {
              if (w != wNative || h != hNative) {
                canvas.style.setProperty( "width", w + "px", "important");
                canvas.style.setProperty("height", h + "px", "important");
              } else {
                canvas.style.removeProperty( "width");
                canvas.style.removeProperty("height");
              }
            }
          }
        },wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function () {
          var handle = Browser.nextWgetRequestHandle;
          Browser.nextWgetRequestHandle++;
          return handle;
        }};
  
    function _time(ptr) {
        var ret = (Date.now()/1000)|0;
        if (ptr) {
          HEAP32[((ptr)>>2)]=ret;
        }
        return ret;
      }
  
    function _pthread_self() {
        //FIXME: assumes only a single thread
        return 0;
      }
  
    
    function _emscripten_memcpy_big(dest, src, num) {
        HEAPU8.set(HEAPU8.subarray(src, src+num), dest);
        return dest;
      } 
    Module["_memcpy"] = _memcpy;
  Module["requestFullScreen"] = function Module_requestFullScreen(lockPointer, resizeCanvas, vrDevice) { Browser.requestFullScreen(lockPointer, resizeCanvas, vrDevice) };
    Module["requestAnimationFrame"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };
    Module["setCanvasSize"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };
    Module["pauseMainLoop"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };
    Module["resumeMainLoop"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };
    Module["getUserMedia"] = function Module_getUserMedia() { Browser.getUserMedia() }
    Module["createContext"] = function Module_createContext(canvas, useWebGL, setInModule, webGLContextAttributes) { return Browser.createContext(canvas, useWebGL, setInModule, webGLContextAttributes) }
  FS.staticInit();__ATINIT__.unshift(function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() });__ATMAIN__.push(function() { FS.ignorePermissions = false });__ATEXIT__.push(function() { FS.quit() });Module["FS_createFolder"] = FS.createFolder;Module["FS_createPath"] = FS.createPath;Module["FS_createDataFile"] = FS.createDataFile;Module["FS_createPreloadedFile"] = FS.createPreloadedFile;Module["FS_createLazyFile"] = FS.createLazyFile;Module["FS_createLink"] = FS.createLink;Module["FS_createDevice"] = FS.createDevice;Module["FS_unlink"] = FS.unlink;
  __ATINIT__.unshift(function() { TTY.init() });__ATEXIT__.push(function() { TTY.shutdown() });
  if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); var NODEJS_PATH = require("path"); NODEFS.staticInit(); }
  STACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);
  
  staticSealed = true; // seal the static portion of memory
  
  STACK_MAX = STACK_BASE + TOTAL_STACK;
  
  DYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);
  
  assert(DYNAMIC_BASE < TOTAL_MEMORY, "TOTAL_MEMORY not big enough for stack");
  
  
  
  function nullFunc_vi(x) { Module["printErr"]("Invalid function pointer called with signature 'vi'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");  Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  
  function nullFunc_viii(x) { Module["printErr"]("Invalid function pointer called with signature 'viii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");  Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  
  function invoke_vi(index,a1) {
    try {
      Module["dynCall_vi"](index,a1);
    } catch(e) {
      if (typeof e !== 'number' && e !== 'longjmp') throw e;
      asm["setThrew"](1, 0);
    }
  }
  
  function invoke_viii(index,a1,a2,a3) {
    try {
      Module["dynCall_viii"](index,a1,a2,a3);
    } catch(e) {
      if (typeof e !== 'number' && e !== 'longjmp') throw e;
      asm["setThrew"](1, 0);
    }
  }
  
  Module.asmGlobalArg = { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array": Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array": Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array, "NaN": NaN, "Infinity": Infinity };
  
  Module.asmLibraryArg = { "abort": abort, "assert": assert, "nullFunc_vi": nullFunc_vi, "nullFunc_viii": nullFunc_viii, "invoke_vi": invoke_vi, "invoke_viii": invoke_viii, "_emscripten_asm_const_3": _emscripten_asm_const_3, "_pthread_self": _pthread_self, "_emscripten_set_main_loop": _emscripten_set_main_loop, "_abort": _abort, "___setErrNo": ___setErrNo, "_sbrk": _sbrk, "_time": _time, "_emscripten_set_main_loop_timing": _emscripten_set_main_loop_timing, "_emscripten_memcpy_big": _emscripten_memcpy_big, "_sysconf": _sysconf, "_emscripten_asm_const_1": _emscripten_asm_const_1, "_emscripten_asm_const_0": _emscripten_asm_const_0, "STACKTOP": STACKTOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoublePtr, "ABORT": ABORT };
  // EMSCRIPTEN_START_ASM
  var asm = (function(global, env, buffer) {
    'almost asm';
    
    
    var HEAP8 = new global.Int8Array(buffer);
    var HEAP16 = new global.Int16Array(buffer);
    var HEAP32 = new global.Int32Array(buffer);
    var HEAPU8 = new global.Uint8Array(buffer);
    var HEAPU16 = new global.Uint16Array(buffer);
    var HEAPU32 = new global.Uint32Array(buffer);
    var HEAPF32 = new global.Float32Array(buffer);
    var HEAPF64 = new global.Float64Array(buffer);
  
  
    var STACKTOP=env.STACKTOP|0;
    var STACK_MAX=env.STACK_MAX|0;
    var tempDoublePtr=env.tempDoublePtr|0;
    var ABORT=env.ABORT|0;
  
    var __THREW__ = 0;
    var threwValue = 0;
    var setjmpId = 0;
    var undef = 0;
    var nan = global.NaN, inf = global.Infinity;
    var tempInt = 0, tempBigInt = 0, tempBigIntP = 0, tempBigIntS = 0, tempBigIntR = 0.0, tempBigIntI = 0, tempBigIntD = 0, tempValue = 0, tempDouble = 0.0;
  
    var tempRet0 = 0;
    var tempRet1 = 0;
    var tempRet2 = 0;
    var tempRet3 = 0;
    var tempRet4 = 0;
    var tempRet5 = 0;
    var tempRet6 = 0;
    var tempRet7 = 0;
    var tempRet8 = 0;
    var tempRet9 = 0;
    var Math_floor=global.Math.floor;
    var Math_abs=global.Math.abs;
    var Math_sqrt=global.Math.sqrt;
    var Math_pow=global.Math.pow;
    var Math_cos=global.Math.cos;
    var Math_sin=global.Math.sin;
    var Math_tan=global.Math.tan;
    var Math_acos=global.Math.acos;
    var Math_asin=global.Math.asin;
    var Math_atan=global.Math.atan;
    var Math_atan2=global.Math.atan2;
    var Math_exp=global.Math.exp;
    var Math_log=global.Math.log;
    var Math_ceil=global.Math.ceil;
    var Math_imul=global.Math.imul;
    var Math_min=global.Math.min;
    var Math_clz32=global.Math.clz32;
    var abort=env.abort;
    var assert=env.assert;
    var nullFunc_vi=env.nullFunc_vi;
    var nullFunc_viii=env.nullFunc_viii;
    var invoke_vi=env.invoke_vi;
    var invoke_viii=env.invoke_viii;
    var _emscripten_asm_const_3=env._emscripten_asm_const_3;
    var _pthread_self=env._pthread_self;
    var _emscripten_set_main_loop=env._emscripten_set_main_loop;
    var _abort=env._abort;
    var ___setErrNo=env.___setErrNo;
    var _sbrk=env._sbrk;
    var _time=env._time;
    var _emscripten_set_main_loop_timing=env._emscripten_set_main_loop_timing;
    var _emscripten_memcpy_big=env._emscripten_memcpy_big;
    var _sysconf=env._sysconf;
    var _emscripten_asm_const_1=env._emscripten_asm_const_1;
    var _emscripten_asm_const_0=env._emscripten_asm_const_0;
    var tempFloat = 0.0;
  
  // EMSCRIPTEN_START_FUNCS
  function stackAlloc(size) {
    size = size|0;
    var ret = 0;
    ret = STACKTOP;
    STACKTOP = (STACKTOP + size)|0;
    STACKTOP = (STACKTOP + 15)&-16;
  if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
  
    return ret|0;
  }
  function stackSave() {
    return STACKTOP|0;
  }
  function stackRestore(top) {
    top = top|0;
    STACKTOP = top;
  }
  function establishStackSpace(stackBase, stackMax) {
    stackBase = stackBase|0;
    stackMax = stackMax|0;
    STACKTOP = stackBase;
    STACK_MAX = stackMax;
  }
  
  function setThrew(threw, value) {
    threw = threw|0;
    value = value|0;
    if ((__THREW__|0) == 0) {
      __THREW__ = threw;
      threwValue = value;
    }
  }
  function copyTempFloat(ptr) {
    ptr = ptr|0;
    HEAP8[tempDoublePtr>>0] = HEAP8[ptr>>0];
    HEAP8[tempDoublePtr+1>>0] = HEAP8[ptr+1>>0];
    HEAP8[tempDoublePtr+2>>0] = HEAP8[ptr+2>>0];
    HEAP8[tempDoublePtr+3>>0] = HEAP8[ptr+3>>0];
  }
  function copyTempDouble(ptr) {
    ptr = ptr|0;
    HEAP8[tempDoublePtr>>0] = HEAP8[ptr>>0];
    HEAP8[tempDoublePtr+1>>0] = HEAP8[ptr+1>>0];
    HEAP8[tempDoublePtr+2>>0] = HEAP8[ptr+2>>0];
    HEAP8[tempDoublePtr+3>>0] = HEAP8[ptr+3>>0];
    HEAP8[tempDoublePtr+4>>0] = HEAP8[ptr+4>>0];
    HEAP8[tempDoublePtr+5>>0] = HEAP8[ptr+5>>0];
    HEAP8[tempDoublePtr+6>>0] = HEAP8[ptr+6>>0];
    HEAP8[tempDoublePtr+7>>0] = HEAP8[ptr+7>>0];
  }
  
  function setTempRet0(value) {
    value = value|0;
    tempRet0 = value;
  }
  function getTempRet0() {
    return tempRet0|0;
  }
  
  function _fake_os_getActiveVesaBuffer($width,$height) {
   $width = $width|0;
   $height = $height|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $i = 0, $return_buffer = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $width;
   $2 = $height;
   $return_buffer = 0;
   $3 = $1;
   HEAP16[$3>>1] = 0;
   $4 = $2;
   HEAP16[$4>>1] = 0;
   $5 = (_malloc(3145728)|0);
   $return_buffer = $5;
   $6 = ($5|0)!=(0|0);
   if (!($6)) {
    $7 = $return_buffer;
    $0 = $7;
    $27 = $0;
    STACKTOP = sp;return ($27|0);
   }
   $8 = $1;
   HEAP16[$8>>1] = 1024;
   $9 = $2;
   HEAP16[$9>>1] = 768;
   $i = 0;
   while(1) {
    $10 = $i;
    $11 = $1;
    $12 = HEAP16[$11>>1]|0;
    $13 = $12&65535;
    $14 = $2;
    $15 = HEAP16[$14>>1]|0;
    $16 = $15&65535;
    $17 = Math_imul($13, $16)|0;
    $18 = ($10|0)<($17|0);
    if (!($18)) {
     break;
    }
    $19 = $i;
    $20 = $return_buffer;
    $21 = (($20) + ($19<<2)|0);
    HEAP32[$21>>2] = -16777216;
    $22 = $i;
    $23 = (($22) + 1)|0;
    $i = $23;
   }
   $24 = $return_buffer;
   $25 = _emscripten_asm_const_3(0, 1024, 768, ($24|0))|0;
   $26 = $return_buffer;
   $0 = $26;
   $27 = $0;
   STACKTOP = sp;return ($27|0);
  }
  function _fake_os_doMouseCallback() {
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $buttons = 0, $mouse_x = 0, $mouse_y = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = HEAP32[8>>2]|0;
   $1 = ($0|0)!=(0|0);
   if (!($1)) {
    STACKTOP = sp;return;
   }
   $2 = _emscripten_asm_const_1(1, 0)|0;
   $3 = $2&65535;
   $mouse_x = $3;
   $4 = _emscripten_asm_const_1(2, 0)|0;
   $5 = $4&65535;
   $mouse_y = $5;
   $6 = _emscripten_asm_const_1(3, 0)|0;
   $7 = $6&255;
   $buttons = $7;
   $8 = HEAP32[8>>2]|0;
   $9 = $mouse_x;
   $10 = $mouse_y;
   $11 = $buttons;
   FUNCTION_TABLE_viii[$8 & 15]($9,$10,$11);
   STACKTOP = sp;return;
  }
  function _fake_os_installMouseCallback($new_handler) {
   $new_handler = $new_handler|0;
   var $0 = 0, $1 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $new_handler;
   _fake_os_doMouseCallback();
   _emscripten_asm_const_0(4);
   $1 = $0;
   HEAP32[8>>2] = $1;
   STACKTOP = sp;return;
  }
  function _ListNode_new($payload) {
   $payload = $payload|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $list_node = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $payload;
   $2 = (_malloc(12)|0);
   $list_node = $2;
   $3 = ($2|0)!=(0|0);
   $4 = $list_node;
   if ($3) {
    $5 = ((($4)) + 4|0);
    HEAP32[$5>>2] = 0;
    $6 = $list_node;
    $7 = ((($6)) + 8|0);
    HEAP32[$7>>2] = 0;
    $8 = $1;
    $9 = $list_node;
    HEAP32[$9>>2] = $8;
    $10 = $list_node;
    $0 = $10;
    $11 = $0;
    STACKTOP = sp;return ($11|0);
   } else {
    $0 = $4;
    $11 = $0;
    STACKTOP = sp;return ($11|0);
   }
   return (0)|0;
  }
  function _Calculator_button_handler($button,$x,$y) {
   $button = $button|0;
   $x = $x|0;
   $y = $y|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0;
   var $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0;
   var $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0;
   var $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0;
   var $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0;
   var $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0;
   var $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0;
   var $242 = 0, $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0;
   var $260 = 0, $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0;
   var $279 = 0, $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0;
   var $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0;
   var $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0;
   var $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0;
   var $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $calculator = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $button;
   $1 = $x;
   $2 = $y;
   $3 = $0;
   $4 = HEAP32[$3>>2]|0;
   $calculator = $4;
   $5 = $0;
   $6 = $calculator;
   $7 = ((($6)) + 92|0);
   $8 = HEAP32[$7>>2]|0;
   $9 = ($5|0)==($8|0);
   do {
    if ($9) {
     $10 = $calculator;
     $11 = ((($10)) + 52|0);
     $12 = HEAP32[$11>>2]|0;
     $13 = ((($12)) + 48|0);
     $14 = HEAP32[$13>>2]|0;
     $15 = HEAP8[$14>>0]|0;
     $16 = $15 << 24 >> 24;
     $17 = ($16|0)==(48);
     if ($17) {
      $18 = $calculator;
      $19 = ((($18)) + 52|0);
      $20 = HEAP32[$19>>2]|0;
      $21 = ((($20)) + 48|0);
      $22 = HEAP32[$21>>2]|0;
      $23 = ((($22)) + 1|0);
      $24 = HEAP8[$23>>0]|0;
      $25 = $24 << 24 >> 24;
      $26 = ($25|0)==(0);
      if ($26) {
       break;
      }
     }
     $27 = $calculator;
     $28 = ((($27)) + 52|0);
     $29 = HEAP32[$28>>2]|0;
     _Window_append_title($29,2509);
    }
   } while(0);
   $30 = $0;
   $31 = $calculator;
   $32 = ((($31)) + 56|0);
   $33 = HEAP32[$32>>2]|0;
   $34 = ($30|0)==($33|0);
   do {
    if ($34) {
     $35 = $calculator;
     $36 = ((($35)) + 52|0);
     $37 = HEAP32[$36>>2]|0;
     $38 = ((($37)) + 48|0);
     $39 = HEAP32[$38>>2]|0;
     $40 = HEAP8[$39>>0]|0;
     $41 = $40 << 24 >> 24;
     $42 = ($41|0)==(48);
     if ($42) {
      $43 = $calculator;
      $44 = ((($43)) + 52|0);
      $45 = HEAP32[$44>>2]|0;
      $46 = ((($45)) + 48|0);
      $47 = HEAP32[$46>>2]|0;
      $48 = ((($47)) + 1|0);
      $49 = HEAP8[$48>>0]|0;
      $50 = $49 << 24 >> 24;
      $51 = ($50|0)==(0);
      if ($51) {
       $55 = $calculator;
       $56 = ((($55)) + 52|0);
       $57 = HEAP32[$56>>2]|0;
       _Window_set_title($57,2511);
       break;
      }
     }
     $52 = $calculator;
     $53 = ((($52)) + 52|0);
     $54 = HEAP32[$53>>2]|0;
     _Window_append_title($54,2511);
    }
   } while(0);
   $58 = $0;
   $59 = $calculator;
   $60 = ((($59)) + 60|0);
   $61 = HEAP32[$60>>2]|0;
   $62 = ($58|0)==($61|0);
   do {
    if ($62) {
     $63 = $calculator;
     $64 = ((($63)) + 52|0);
     $65 = HEAP32[$64>>2]|0;
     $66 = ((($65)) + 48|0);
     $67 = HEAP32[$66>>2]|0;
     $68 = HEAP8[$67>>0]|0;
     $69 = $68 << 24 >> 24;
     $70 = ($69|0)==(48);
     if ($70) {
      $71 = $calculator;
      $72 = ((($71)) + 52|0);
      $73 = HEAP32[$72>>2]|0;
      $74 = ((($73)) + 48|0);
      $75 = HEAP32[$74>>2]|0;
      $76 = ((($75)) + 1|0);
      $77 = HEAP8[$76>>0]|0;
      $78 = $77 << 24 >> 24;
      $79 = ($78|0)==(0);
      if ($79) {
       $83 = $calculator;
       $84 = ((($83)) + 52|0);
       $85 = HEAP32[$84>>2]|0;
       _Window_set_title($85,2513);
       break;
      }
     }
     $80 = $calculator;
     $81 = ((($80)) + 52|0);
     $82 = HEAP32[$81>>2]|0;
     _Window_append_title($82,2513);
    }
   } while(0);
   $86 = $0;
   $87 = $calculator;
   $88 = ((($87)) + 64|0);
   $89 = HEAP32[$88>>2]|0;
   $90 = ($86|0)==($89|0);
   do {
    if ($90) {
     $91 = $calculator;
     $92 = ((($91)) + 52|0);
     $93 = HEAP32[$92>>2]|0;
     $94 = ((($93)) + 48|0);
     $95 = HEAP32[$94>>2]|0;
     $96 = HEAP8[$95>>0]|0;
     $97 = $96 << 24 >> 24;
     $98 = ($97|0)==(48);
     if ($98) {
      $99 = $calculator;
      $100 = ((($99)) + 52|0);
      $101 = HEAP32[$100>>2]|0;
      $102 = ((($101)) + 48|0);
      $103 = HEAP32[$102>>2]|0;
      $104 = ((($103)) + 1|0);
      $105 = HEAP8[$104>>0]|0;
      $106 = $105 << 24 >> 24;
      $107 = ($106|0)==(0);
      if ($107) {
       $111 = $calculator;
       $112 = ((($111)) + 52|0);
       $113 = HEAP32[$112>>2]|0;
       _Window_set_title($113,2515);
       break;
      }
     }
     $108 = $calculator;
     $109 = ((($108)) + 52|0);
     $110 = HEAP32[$109>>2]|0;
     _Window_append_title($110,2515);
    }
   } while(0);
   $114 = $0;
   $115 = $calculator;
   $116 = ((($115)) + 68|0);
   $117 = HEAP32[$116>>2]|0;
   $118 = ($114|0)==($117|0);
   do {
    if ($118) {
     $119 = $calculator;
     $120 = ((($119)) + 52|0);
     $121 = HEAP32[$120>>2]|0;
     $122 = ((($121)) + 48|0);
     $123 = HEAP32[$122>>2]|0;
     $124 = HEAP8[$123>>0]|0;
     $125 = $124 << 24 >> 24;
     $126 = ($125|0)==(48);
     if ($126) {
      $127 = $calculator;
      $128 = ((($127)) + 52|0);
      $129 = HEAP32[$128>>2]|0;
      $130 = ((($129)) + 48|0);
      $131 = HEAP32[$130>>2]|0;
      $132 = ((($131)) + 1|0);
      $133 = HEAP8[$132>>0]|0;
      $134 = $133 << 24 >> 24;
      $135 = ($134|0)==(0);
      if ($135) {
       $139 = $calculator;
       $140 = ((($139)) + 52|0);
       $141 = HEAP32[$140>>2]|0;
       _Window_set_title($141,2517);
       break;
      }
     }
     $136 = $calculator;
     $137 = ((($136)) + 52|0);
     $138 = HEAP32[$137>>2]|0;
     _Window_append_title($138,2517);
    }
   } while(0);
   $142 = $0;
   $143 = $calculator;
   $144 = ((($143)) + 72|0);
   $145 = HEAP32[$144>>2]|0;
   $146 = ($142|0)==($145|0);
   do {
    if ($146) {
     $147 = $calculator;
     $148 = ((($147)) + 52|0);
     $149 = HEAP32[$148>>2]|0;
     $150 = ((($149)) + 48|0);
     $151 = HEAP32[$150>>2]|0;
     $152 = HEAP8[$151>>0]|0;
     $153 = $152 << 24 >> 24;
     $154 = ($153|0)==(48);
     if ($154) {
      $155 = $calculator;
      $156 = ((($155)) + 52|0);
      $157 = HEAP32[$156>>2]|0;
      $158 = ((($157)) + 48|0);
      $159 = HEAP32[$158>>2]|0;
      $160 = ((($159)) + 1|0);
      $161 = HEAP8[$160>>0]|0;
      $162 = $161 << 24 >> 24;
      $163 = ($162|0)==(0);
      if ($163) {
       $167 = $calculator;
       $168 = ((($167)) + 52|0);
       $169 = HEAP32[$168>>2]|0;
       _Window_set_title($169,2519);
       break;
      }
     }
     $164 = $calculator;
     $165 = ((($164)) + 52|0);
     $166 = HEAP32[$165>>2]|0;
     _Window_append_title($166,2519);
    }
   } while(0);
   $170 = $0;
   $171 = $calculator;
   $172 = ((($171)) + 76|0);
   $173 = HEAP32[$172>>2]|0;
   $174 = ($170|0)==($173|0);
   do {
    if ($174) {
     $175 = $calculator;
     $176 = ((($175)) + 52|0);
     $177 = HEAP32[$176>>2]|0;
     $178 = ((($177)) + 48|0);
     $179 = HEAP32[$178>>2]|0;
     $180 = HEAP8[$179>>0]|0;
     $181 = $180 << 24 >> 24;
     $182 = ($181|0)==(48);
     if ($182) {
      $183 = $calculator;
      $184 = ((($183)) + 52|0);
      $185 = HEAP32[$184>>2]|0;
      $186 = ((($185)) + 48|0);
      $187 = HEAP32[$186>>2]|0;
      $188 = ((($187)) + 1|0);
      $189 = HEAP8[$188>>0]|0;
      $190 = $189 << 24 >> 24;
      $191 = ($190|0)==(0);
      if ($191) {
       $195 = $calculator;
       $196 = ((($195)) + 52|0);
       $197 = HEAP32[$196>>2]|0;
       _Window_set_title($197,2521);
       break;
      }
     }
     $192 = $calculator;
     $193 = ((($192)) + 52|0);
     $194 = HEAP32[$193>>2]|0;
     _Window_append_title($194,2521);
    }
   } while(0);
   $198 = $0;
   $199 = $calculator;
   $200 = ((($199)) + 80|0);
   $201 = HEAP32[$200>>2]|0;
   $202 = ($198|0)==($201|0);
   do {
    if ($202) {
     $203 = $calculator;
     $204 = ((($203)) + 52|0);
     $205 = HEAP32[$204>>2]|0;
     $206 = ((($205)) + 48|0);
     $207 = HEAP32[$206>>2]|0;
     $208 = HEAP8[$207>>0]|0;
     $209 = $208 << 24 >> 24;
     $210 = ($209|0)==(48);
     if ($210) {
      $211 = $calculator;
      $212 = ((($211)) + 52|0);
      $213 = HEAP32[$212>>2]|0;
      $214 = ((($213)) + 48|0);
      $215 = HEAP32[$214>>2]|0;
      $216 = ((($215)) + 1|0);
      $217 = HEAP8[$216>>0]|0;
      $218 = $217 << 24 >> 24;
      $219 = ($218|0)==(0);
      if ($219) {
       $223 = $calculator;
       $224 = ((($223)) + 52|0);
       $225 = HEAP32[$224>>2]|0;
       _Window_set_title($225,2523);
       break;
      }
     }
     $220 = $calculator;
     $221 = ((($220)) + 52|0);
     $222 = HEAP32[$221>>2]|0;
     _Window_append_title($222,2523);
    }
   } while(0);
   $226 = $0;
   $227 = $calculator;
   $228 = ((($227)) + 84|0);
   $229 = HEAP32[$228>>2]|0;
   $230 = ($226|0)==($229|0);
   do {
    if ($230) {
     $231 = $calculator;
     $232 = ((($231)) + 52|0);
     $233 = HEAP32[$232>>2]|0;
     $234 = ((($233)) + 48|0);
     $235 = HEAP32[$234>>2]|0;
     $236 = HEAP8[$235>>0]|0;
     $237 = $236 << 24 >> 24;
     $238 = ($237|0)==(48);
     if ($238) {
      $239 = $calculator;
      $240 = ((($239)) + 52|0);
      $241 = HEAP32[$240>>2]|0;
      $242 = ((($241)) + 48|0);
      $243 = HEAP32[$242>>2]|0;
      $244 = ((($243)) + 1|0);
      $245 = HEAP8[$244>>0]|0;
      $246 = $245 << 24 >> 24;
      $247 = ($246|0)==(0);
      if ($247) {
       $251 = $calculator;
       $252 = ((($251)) + 52|0);
       $253 = HEAP32[$252>>2]|0;
       _Window_set_title($253,2525);
       break;
      }
     }
     $248 = $calculator;
     $249 = ((($248)) + 52|0);
     $250 = HEAP32[$249>>2]|0;
     _Window_append_title($250,2525);
    }
   } while(0);
   $254 = $0;
   $255 = $calculator;
   $256 = ((($255)) + 88|0);
   $257 = HEAP32[$256>>2]|0;
   $258 = ($254|0)==($257|0);
   do {
    if ($258) {
     $259 = $calculator;
     $260 = ((($259)) + 52|0);
     $261 = HEAP32[$260>>2]|0;
     $262 = ((($261)) + 48|0);
     $263 = HEAP32[$262>>2]|0;
     $264 = HEAP8[$263>>0]|0;
     $265 = $264 << 24 >> 24;
     $266 = ($265|0)==(48);
     if ($266) {
      $267 = $calculator;
      $268 = ((($267)) + 52|0);
      $269 = HEAP32[$268>>2]|0;
      $270 = ((($269)) + 48|0);
      $271 = HEAP32[$270>>2]|0;
      $272 = ((($271)) + 1|0);
      $273 = HEAP8[$272>>0]|0;
      $274 = $273 << 24 >> 24;
      $275 = ($274|0)==(0);
      if ($275) {
       $279 = $calculator;
       $280 = ((($279)) + 52|0);
       $281 = HEAP32[$280>>2]|0;
       _Window_set_title($281,2527);
       break;
      }
     }
     $276 = $calculator;
     $277 = ((($276)) + 52|0);
     $278 = HEAP32[$277>>2]|0;
     _Window_append_title($278,2527);
    }
   } while(0);
   $282 = $0;
   $283 = $calculator;
   $284 = ((($283)) + 116|0);
   $285 = HEAP32[$284>>2]|0;
   $286 = ($282|0)==($285|0);
   if (!($286)) {
    STACKTOP = sp;return;
   }
   $287 = $calculator;
   $288 = ((($287)) + 52|0);
   $289 = HEAP32[$288>>2]|0;
   _Window_set_title($289,2509);
   STACKTOP = sp;return;
  }
  function _Calculator_new() {
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0;
   var $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0;
   var $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0;
   var $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0;
   var $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0;
   var $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0;
   var $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0;
   var $242 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0;
   var $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0;
   var $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0;
   var $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0;
   var $97 = 0, $98 = 0, $99 = 0, $calculator = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = (_malloc(120)|0);
   $calculator = $1;
   $2 = ($1|0)!=(0|0);
   $3 = $calculator;
   if (!($2)) {
    $0 = $3;
    $242 = $0;
    STACKTOP = sp;return ($242|0);
   }
   $4 = (_Window_init($3,0,0,151,204,0,0)|0);
   $5 = ($4|0)!=(0);
   $6 = $calculator;
   if ($5) {
    _Window_set_title($6,2529);
    $7 = (_Button_new(8,61,30,30)|0);
    $8 = $calculator;
    $9 = ((($8)) + 80|0);
    HEAP32[$9>>2] = $7;
    $10 = $calculator;
    $11 = ((($10)) + 80|0);
    $12 = HEAP32[$11>>2]|0;
    _Window_set_title($12,2523);
    $13 = $calculator;
    $14 = $calculator;
    $15 = ((($14)) + 80|0);
    $16 = HEAP32[$15>>2]|0;
    _Window_insert_child($13,$16);
    $17 = (_Button_new(43,61,30,30)|0);
    $18 = $calculator;
    $19 = ((($18)) + 84|0);
    HEAP32[$19>>2] = $17;
    $20 = $calculator;
    $21 = ((($20)) + 84|0);
    $22 = HEAP32[$21>>2]|0;
    _Window_set_title($22,2525);
    $23 = $calculator;
    $24 = $calculator;
    $25 = ((($24)) + 84|0);
    $26 = HEAP32[$25>>2]|0;
    _Window_insert_child($23,$26);
    $27 = (_Button_new(78,61,30,30)|0);
    $28 = $calculator;
    $29 = ((($28)) + 88|0);
    HEAP32[$29>>2] = $27;
    $30 = $calculator;
    $31 = ((($30)) + 88|0);
    $32 = HEAP32[$31>>2]|0;
    _Window_set_title($32,2527);
    $33 = $calculator;
    $34 = $calculator;
    $35 = ((($34)) + 88|0);
    $36 = HEAP32[$35>>2]|0;
    _Window_insert_child($33,$36);
    $37 = (_Button_new(113,61,30,30)|0);
    $38 = $calculator;
    $39 = ((($38)) + 96|0);
    HEAP32[$39>>2] = $37;
    $40 = $calculator;
    $41 = ((($40)) + 96|0);
    $42 = HEAP32[$41>>2]|0;
    _Window_set_title($42,2540);
    $43 = $calculator;
    $44 = $calculator;
    $45 = ((($44)) + 96|0);
    $46 = HEAP32[$45>>2]|0;
    _Window_insert_child($43,$46);
    $47 = (_Button_new(8,96,30,30)|0);
    $48 = $calculator;
    $49 = ((($48)) + 68|0);
    HEAP32[$49>>2] = $47;
    $50 = $calculator;
    $51 = ((($50)) + 68|0);
    $52 = HEAP32[$51>>2]|0;
    _Window_set_title($52,2517);
    $53 = $calculator;
    $54 = $calculator;
    $55 = ((($54)) + 68|0);
    $56 = HEAP32[$55>>2]|0;
    _Window_insert_child($53,$56);
    $57 = (_Button_new(43,96,30,30)|0);
    $58 = $calculator;
    $59 = ((($58)) + 72|0);
    HEAP32[$59>>2] = $57;
    $60 = $calculator;
    $61 = ((($60)) + 72|0);
    $62 = HEAP32[$61>>2]|0;
    _Window_set_title($62,2519);
    $63 = $calculator;
    $64 = $calculator;
    $65 = ((($64)) + 72|0);
    $66 = HEAP32[$65>>2]|0;
    _Window_insert_child($63,$66);
    $67 = (_Button_new(78,96,30,30)|0);
    $68 = $calculator;
    $69 = ((($68)) + 76|0);
    HEAP32[$69>>2] = $67;
    $70 = $calculator;
    $71 = ((($70)) + 76|0);
    $72 = HEAP32[$71>>2]|0;
    _Window_set_title($72,2521);
    $73 = $calculator;
    $74 = $calculator;
    $75 = ((($74)) + 76|0);
    $76 = HEAP32[$75>>2]|0;
    _Window_insert_child($73,$76);
    $77 = (_Button_new(113,96,30,30)|0);
    $78 = $calculator;
    $79 = ((($78)) + 100|0);
    HEAP32[$79>>2] = $77;
    $80 = $calculator;
    $81 = ((($80)) + 100|0);
    $82 = HEAP32[$81>>2]|0;
    _Window_set_title($82,2542);
    $83 = $calculator;
    $84 = $calculator;
    $85 = ((($84)) + 100|0);
    $86 = HEAP32[$85>>2]|0;
    _Window_insert_child($83,$86);
    $87 = (_Button_new(8,131,30,30)|0);
    $88 = $calculator;
    $89 = ((($88)) + 56|0);
    HEAP32[$89>>2] = $87;
    $90 = $calculator;
    $91 = ((($90)) + 56|0);
    $92 = HEAP32[$91>>2]|0;
    _Window_set_title($92,2511);
    $93 = $calculator;
    $94 = $calculator;
    $95 = ((($94)) + 56|0);
    $96 = HEAP32[$95>>2]|0;
    _Window_insert_child($93,$96);
    $97 = (_Button_new(43,131,30,30)|0);
    $98 = $calculator;
    $99 = ((($98)) + 60|0);
    HEAP32[$99>>2] = $97;
    $100 = $calculator;
    $101 = ((($100)) + 60|0);
    $102 = HEAP32[$101>>2]|0;
    _Window_set_title($102,2513);
    $103 = $calculator;
    $104 = $calculator;
    $105 = ((($104)) + 60|0);
    $106 = HEAP32[$105>>2]|0;
    _Window_insert_child($103,$106);
    $107 = (_Button_new(78,131,30,30)|0);
    $108 = $calculator;
    $109 = ((($108)) + 64|0);
    HEAP32[$109>>2] = $107;
    $110 = $calculator;
    $111 = ((($110)) + 64|0);
    $112 = HEAP32[$111>>2]|0;
    _Window_set_title($112,2515);
    $113 = $calculator;
    $114 = $calculator;
    $115 = ((($114)) + 64|0);
    $116 = HEAP32[$115>>2]|0;
    _Window_insert_child($113,$116);
    $117 = (_Button_new(113,131,30,30)|0);
    $118 = $calculator;
    $119 = ((($118)) + 108|0);
    HEAP32[$119>>2] = $117;
    $120 = $calculator;
    $121 = ((($120)) + 108|0);
    $122 = HEAP32[$121>>2]|0;
    _Window_set_title($122,2544);
    $123 = $calculator;
    $124 = $calculator;
    $125 = ((($124)) + 108|0);
    $126 = HEAP32[$125>>2]|0;
    _Window_insert_child($123,$126);
    $127 = (_Button_new(8,166,30,30)|0);
    $128 = $calculator;
    $129 = ((($128)) + 116|0);
    HEAP32[$129>>2] = $127;
    $130 = $calculator;
    $131 = ((($130)) + 116|0);
    $132 = HEAP32[$131>>2]|0;
    _Window_set_title($132,2546);
    $133 = $calculator;
    $134 = $calculator;
    $135 = ((($134)) + 116|0);
    $136 = HEAP32[$135>>2]|0;
    _Window_insert_child($133,$136);
    $137 = (_Button_new(43,166,30,30)|0);
    $138 = $calculator;
    $139 = ((($138)) + 92|0);
    HEAP32[$139>>2] = $137;
    $140 = $calculator;
    $141 = ((($140)) + 92|0);
    $142 = HEAP32[$141>>2]|0;
    _Window_set_title($142,2509);
    $143 = $calculator;
    $144 = $calculator;
    $145 = ((($144)) + 92|0);
    $146 = HEAP32[$145>>2]|0;
    _Window_insert_child($143,$146);
    $147 = (_Button_new(78,166,30,30)|0);
    $148 = $calculator;
    $149 = ((($148)) + 112|0);
    HEAP32[$149>>2] = $147;
    $150 = $calculator;
    $151 = ((($150)) + 112|0);
    $152 = HEAP32[$151>>2]|0;
    _Window_set_title($152,2548);
    $153 = $calculator;
    $154 = $calculator;
    $155 = ((($154)) + 112|0);
    $156 = HEAP32[$155>>2]|0;
    _Window_insert_child($153,$156);
    $157 = (_Button_new(113,166,30,30)|0);
    $158 = $calculator;
    $159 = ((($158)) + 104|0);
    HEAP32[$159>>2] = $157;
    $160 = $calculator;
    $161 = ((($160)) + 104|0);
    $162 = HEAP32[$161>>2]|0;
    _Window_set_title($162,2550);
    $163 = $calculator;
    $164 = $calculator;
    $165 = ((($164)) + 104|0);
    $166 = HEAP32[$165>>2]|0;
    _Window_insert_child($163,$166);
    $167 = $calculator;
    $168 = ((($167)) + 116|0);
    $169 = HEAP32[$168>>2]|0;
    $170 = ((($169)) + 56|0);
    HEAP32[$170>>2] = 1;
    $171 = $calculator;
    $172 = ((($171)) + 112|0);
    $173 = HEAP32[$172>>2]|0;
    $174 = ((($173)) + 56|0);
    HEAP32[$174>>2] = 1;
    $175 = $calculator;
    $176 = ((($175)) + 104|0);
    $177 = HEAP32[$176>>2]|0;
    $178 = ((($177)) + 56|0);
    HEAP32[$178>>2] = 1;
    $179 = $calculator;
    $180 = ((($179)) + 108|0);
    $181 = HEAP32[$180>>2]|0;
    $182 = ((($181)) + 56|0);
    HEAP32[$182>>2] = 1;
    $183 = $calculator;
    $184 = ((($183)) + 100|0);
    $185 = HEAP32[$184>>2]|0;
    $186 = ((($185)) + 56|0);
    HEAP32[$186>>2] = 1;
    $187 = $calculator;
    $188 = ((($187)) + 96|0);
    $189 = HEAP32[$188>>2]|0;
    $190 = ((($189)) + 56|0);
    HEAP32[$190>>2] = 1;
    $191 = $calculator;
    $192 = ((($191)) + 92|0);
    $193 = HEAP32[$192>>2]|0;
    $194 = ((($193)) + 56|0);
    HEAP32[$194>>2] = 1;
    $195 = $calculator;
    $196 = ((($195)) + 88|0);
    $197 = HEAP32[$196>>2]|0;
    $198 = ((($197)) + 56|0);
    HEAP32[$198>>2] = 1;
    $199 = $calculator;
    $200 = ((($199)) + 84|0);
    $201 = HEAP32[$200>>2]|0;
    $202 = ((($201)) + 56|0);
    HEAP32[$202>>2] = 1;
    $203 = $calculator;
    $204 = ((($203)) + 80|0);
    $205 = HEAP32[$204>>2]|0;
    $206 = ((($205)) + 56|0);
    HEAP32[$206>>2] = 1;
    $207 = $calculator;
    $208 = ((($207)) + 76|0);
    $209 = HEAP32[$208>>2]|0;
    $210 = ((($209)) + 56|0);
    HEAP32[$210>>2] = 1;
    $211 = $calculator;
    $212 = ((($211)) + 72|0);
    $213 = HEAP32[$212>>2]|0;
    $214 = ((($213)) + 56|0);
    HEAP32[$214>>2] = 1;
    $215 = $calculator;
    $216 = ((($215)) + 68|0);
    $217 = HEAP32[$216>>2]|0;
    $218 = ((($217)) + 56|0);
    HEAP32[$218>>2] = 1;
    $219 = $calculator;
    $220 = ((($219)) + 64|0);
    $221 = HEAP32[$220>>2]|0;
    $222 = ((($221)) + 56|0);
    HEAP32[$222>>2] = 1;
    $223 = $calculator;
    $224 = ((($223)) + 60|0);
    $225 = HEAP32[$224>>2]|0;
    $226 = ((($225)) + 56|0);
    HEAP32[$226>>2] = 1;
    $227 = $calculator;
    $228 = ((($227)) + 56|0);
    $229 = HEAP32[$228>>2]|0;
    $230 = ((($229)) + 56|0);
    HEAP32[$230>>2] = 1;
    $231 = (_TextBox_new(8,36,135,20)|0);
    $232 = $calculator;
    $233 = ((($232)) + 52|0);
    HEAP32[$233>>2] = $231;
    $234 = $calculator;
    $235 = ((($234)) + 52|0);
    $236 = HEAP32[$235>>2]|0;
    _Window_set_title($236,2509);
    $237 = $calculator;
    $238 = $calculator;
    $239 = ((($238)) + 52|0);
    $240 = HEAP32[$239>>2]|0;
    _Window_insert_child($237,$240);
    $241 = $calculator;
    $0 = $241;
    $242 = $0;
    STACKTOP = sp;return ($242|0);
   } else {
    _free($6);
    $0 = 0;
    $242 = $0;
    STACKTOP = sp;return ($242|0);
   }
   return (0)|0;
  }
  function _TextBox_new($x,$y,$width,$height) {
   $x = $x|0;
   $y = $y|0;
   $width = $width|0;
   $height = $height|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0;
   var $8 = 0, $9 = 0, $text_box = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $x;
   $2 = $y;
   $3 = $width;
   $4 = $height;
   $5 = (_malloc(52)|0);
   $text_box = $5;
   $6 = ($5|0)!=(0|0);
   $7 = $text_box;
   if (!($6)) {
    $0 = $7;
    $21 = $0;
    STACKTOP = sp;return ($21|0);
   }
   $8 = $1;
   $9 = $8&65535;
   $10 = $2;
   $11 = $10&65535;
   $12 = $3;
   $13 = $12&65535;
   $14 = $4;
   $15 = $14&65535;
   $16 = (_Window_init($7,$9,$11,$13,$15,1,0)|0);
   $17 = ($16|0)!=(0);
   $18 = $text_box;
   if ($17) {
    $19 = ((($18)) + 40|0);
    HEAP32[$19>>2] = 2;
    $20 = $text_box;
    $0 = $20;
    $21 = $0;
    STACKTOP = sp;return ($21|0);
   } else {
    _free($18);
    $0 = 0;
    $21 = $0;
    STACKTOP = sp;return ($21|0);
   }
   return (0)|0;
  }
  function _TextBox_paint($text_box_window) {
   $text_box_window = $text_box_window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $title_len = 0, label = 0;
   var sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $text_box_window;
   $1 = $0;
   $2 = ((($1)) + 16|0);
   $3 = HEAP32[$2>>2]|0;
   $4 = $0;
   $5 = ((($4)) + 8|0);
   $6 = HEAP16[$5>>1]|0;
   $7 = $6&65535;
   $8 = (($7) - 2)|0;
   $9 = $0;
   $10 = ((($9)) + 10|0);
   $11 = HEAP16[$10>>1]|0;
   $12 = $11&65535;
   $13 = (($12) - 2)|0;
   _Context_fill_rect($3,1,1,$8,$13,-1);
   $14 = $0;
   $15 = ((($14)) + 16|0);
   $16 = HEAP32[$15>>2]|0;
   $17 = $0;
   $18 = ((($17)) + 8|0);
   $19 = HEAP16[$18>>1]|0;
   $20 = $19&65535;
   $21 = $0;
   $22 = ((($21)) + 10|0);
   $23 = HEAP16[$22>>1]|0;
   $24 = $23&65535;
   _Context_draw_rect($16,0,0,$20,$24,-16777216);
   $title_len = 0;
   while(1) {
    $25 = $title_len;
    $26 = $0;
    $27 = ((($26)) + 48|0);
    $28 = HEAP32[$27>>2]|0;
    $29 = (($28) + ($25)|0);
    $30 = HEAP8[$29>>0]|0;
    $31 = ($30<<24>>24)!=(0);
    $32 = $title_len;
    if (!($31)) {
     break;
    }
    $33 = (($32) + 1)|0;
    $title_len = $33;
   }
   $34 = $32<<3;
   $title_len = $34;
   $35 = $0;
   $36 = ((($35)) + 48|0);
   $37 = HEAP32[$36>>2]|0;
   $38 = ($37|0)!=(0|0);
   if (!($38)) {
    STACKTOP = sp;return;
   }
   $39 = $0;
   $40 = ((($39)) + 16|0);
   $41 = HEAP32[$40>>2]|0;
   $42 = $0;
   $43 = ((($42)) + 48|0);
   $44 = HEAP32[$43>>2]|0;
   $45 = $0;
   $46 = ((($45)) + 8|0);
   $47 = HEAP16[$46>>1]|0;
   $48 = $47&65535;
   $49 = $title_len;
   $50 = (($48) - ($49))|0;
   $51 = (($50) - 6)|0;
   $52 = $0;
   $53 = ((($52)) + 10|0);
   $54 = HEAP16[$53>>1]|0;
   $55 = $54&65535;
   $56 = (($55|0) / 2)&-1;
   $57 = (($56) - 6)|0;
   _Context_draw_text($41,$44,$51,$57,-16777216);
   STACKTOP = sp;return;
  }
  function _Button_new($x,$y,$w,$h) {
   $x = $x|0;
   $y = $y|0;
   $w = $w|0;
   $h = $h|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $button = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $x;
   $2 = $y;
   $3 = $w;
   $4 = $h;
   $5 = (_malloc(60)|0);
   $button = $5;
   $6 = ($5|0)!=(0|0);
   $7 = $button;
   if (!($6)) {
    $0 = $7;
    $27 = $0;
    STACKTOP = sp;return ($27|0);
   }
   $8 = $1;
   $9 = $8&65535;
   $10 = $2;
   $11 = $10&65535;
   $12 = $3;
   $13 = $12&65535;
   $14 = $4;
   $15 = $14&65535;
   $16 = (_Window_init($7,$9,$11,$13,$15,1,0)|0);
   $17 = ($16|0)!=(0);
   $18 = $button;
   if ($17) {
    $19 = ((($18)) + 40|0);
    HEAP32[$19>>2] = 3;
    $20 = $button;
    $21 = ((($20)) + 44|0);
    HEAP32[$21>>2] = 4;
    $22 = $button;
    $23 = ((($22)) + 56|0);
    HEAP32[$23>>2] = 0;
    $24 = $button;
    $25 = ((($24)) + 52|0);
    HEAP8[$25>>0] = 0;
    $26 = $button;
    $0 = $26;
    $27 = $0;
    STACKTOP = sp;return ($27|0);
   } else {
    _free($18);
    $0 = 0;
    $27 = $0;
    STACKTOP = sp;return ($27|0);
   }
   return (0)|0;
  }
  function _Button_paint($button_window) {
   $button_window = $button_window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $border_color = 0, $button = 0, $title_len = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $button_window;
   $1 = $0;
   $button = $1;
   $2 = $button;
   $3 = ((($2)) + 52|0);
   $4 = HEAP8[$3>>0]|0;
   $5 = ($4<<24>>24)!=(0);
   if ($5) {
    $border_color = -3108752;
   } else {
    $border_color = -5526613;
   }
   $6 = $0;
   $7 = ((($6)) + 16|0);
   $8 = HEAP32[$7>>2]|0;
   $9 = $0;
   $10 = ((($9)) + 8|0);
   $11 = HEAP16[$10>>1]|0;
   $12 = $11&65535;
   $13 = (($12) - 1)|0;
   $14 = $0;
   $15 = ((($14)) + 10|0);
   $16 = HEAP16[$15>>1]|0;
   $17 = $16&65535;
   $18 = (($17) - 1)|0;
   _Context_fill_rect($8,1,1,$13,$18,-4473925);
   $19 = $0;
   $20 = ((($19)) + 16|0);
   $21 = HEAP32[$20>>2]|0;
   $22 = $0;
   $23 = ((($22)) + 8|0);
   $24 = HEAP16[$23>>1]|0;
   $25 = $24&65535;
   $26 = $0;
   $27 = ((($26)) + 10|0);
   $28 = HEAP16[$27>>1]|0;
   $29 = $28&65535;
   _Context_draw_rect($21,0,0,$25,$29,-16777216);
   $30 = $0;
   $31 = ((($30)) + 16|0);
   $32 = HEAP32[$31>>2]|0;
   $33 = $0;
   $34 = ((($33)) + 8|0);
   $35 = HEAP16[$34>>1]|0;
   $36 = $35&65535;
   $37 = (($36) - 6)|0;
   $38 = $0;
   $39 = ((($38)) + 10|0);
   $40 = HEAP16[$39>>1]|0;
   $41 = $40&65535;
   $42 = (($41) - 6)|0;
   $43 = $border_color;
   _Context_draw_rect($32,3,3,$37,$42,$43);
   $44 = $0;
   $45 = ((($44)) + 16|0);
   $46 = HEAP32[$45>>2]|0;
   $47 = $0;
   $48 = ((($47)) + 8|0);
   $49 = HEAP16[$48>>1]|0;
   $50 = $49&65535;
   $51 = (($50) - 8)|0;
   $52 = $0;
   $53 = ((($52)) + 10|0);
   $54 = HEAP16[$53>>1]|0;
   $55 = $54&65535;
   $56 = (($55) - 8)|0;
   $57 = $border_color;
   _Context_draw_rect($46,4,4,$51,$56,$57);
   $title_len = 0;
   while(1) {
    $58 = $title_len;
    $59 = $0;
    $60 = ((($59)) + 48|0);
    $61 = HEAP32[$60>>2]|0;
    $62 = (($61) + ($58)|0);
    $63 = HEAP8[$62>>0]|0;
    $64 = ($63<<24>>24)!=(0);
    $65 = $title_len;
    if (!($64)) {
     break;
    }
    $66 = (($65) + 1)|0;
    $title_len = $66;
   }
   $67 = $65<<3;
   $title_len = $67;
   $68 = $0;
   $69 = ((($68)) + 48|0);
   $70 = HEAP32[$69>>2]|0;
   $71 = ($70|0)!=(0|0);
   if (!($71)) {
    STACKTOP = sp;return;
   }
   $72 = $0;
   $73 = ((($72)) + 16|0);
   $74 = HEAP32[$73>>2]|0;
   $75 = $0;
   $76 = ((($75)) + 48|0);
   $77 = HEAP32[$76>>2]|0;
   $78 = $0;
   $79 = ((($78)) + 8|0);
   $80 = HEAP16[$79>>1]|0;
   $81 = $80&65535;
   $82 = (($81|0) / 2)&-1;
   $83 = $title_len;
   $84 = (($83|0) / 2)&-1;
   $85 = (($82) - ($84))|0;
   $86 = $0;
   $87 = ((($86)) + 10|0);
   $88 = HEAP16[$87>>1]|0;
   $89 = $88&65535;
   $90 = (($89|0) / 2)&-1;
   $91 = (($90) - 6)|0;
   _Context_draw_text($74,$77,$85,$91,-16777216);
   STACKTOP = sp;return;
  }
  function _Button_mousedown_handler($button_window,$x,$y) {
   $button_window = $button_window|0;
   $x = $x|0;
   $y = $y|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $button = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $button_window;
   $1 = $x;
   $2 = $y;
   $3 = $0;
   $button = $3;
   $4 = $button;
   $5 = ((($4)) + 52|0);
   $6 = HEAP8[$5>>0]|0;
   $7 = ($6<<24>>24)!=(0);
   $8 = $7 ^ 1;
   $9 = $8&1;
   $10 = $9&255;
   $11 = $button;
   $12 = ((($11)) + 52|0);
   HEAP8[$12>>0] = $10;
   $13 = $button;
   $14 = $button;
   $15 = ((($14)) + 10|0);
   $16 = HEAP16[$15>>1]|0;
   $17 = $16&65535;
   $18 = (($17) - 1)|0;
   $19 = $button;
   $20 = ((($19)) + 8|0);
   $21 = HEAP16[$20>>1]|0;
   $22 = $21&65535;
   $23 = (($22) - 1)|0;
   _Window_invalidate($13,0,0,$18,$23);
   $24 = $button;
   $25 = ((($24)) + 56|0);
   $26 = HEAP32[$25>>2]|0;
   $27 = ($26|0)!=(0|0);
   if (!($27)) {
    STACKTOP = sp;return;
   }
   $28 = $button;
   $29 = ((($28)) + 56|0);
   $30 = HEAP32[$29>>2]|0;
   $31 = $button;
   $32 = $1;
   $33 = $2;
   FUNCTION_TABLE_viii[$30 & 15]($31,$32,$33);
   STACKTOP = sp;return;
  }
  function _List_new() {
   var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $list = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = (_malloc(8)|0);
   $list = $1;
   $2 = ($1|0)!=(0|0);
   $3 = $list;
   if ($2) {
    HEAP32[$3>>2] = 0;
    $4 = $list;
    $5 = ((($4)) + 4|0);
    HEAP32[$5>>2] = 0;
    $6 = $list;
    $0 = $6;
    $7 = $0;
    STACKTOP = sp;return ($7|0);
   } else {
    $0 = $3;
    $7 = $0;
    STACKTOP = sp;return ($7|0);
   }
   return (0)|0;
  }
  function _List_add($list,$payload) {
   $list = $list|0;
   $payload = $payload|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $current_node = 0, $new_node = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $list;
   $2 = $payload;
   $3 = $2;
   $4 = (_ListNode_new($3)|0);
   $new_node = $4;
   $5 = ($4|0)!=(0|0);
   if (!($5)) {
    $0 = 0;
    $32 = $0;
    STACKTOP = sp;return ($32|0);
   }
   $6 = $1;
   $7 = ((($6)) + 4|0);
   $8 = HEAP32[$7>>2]|0;
   $9 = ($8|0)!=(0|0);
   if ($9) {
    $13 = $1;
    $14 = ((($13)) + 4|0);
    $15 = HEAP32[$14>>2]|0;
    $current_node = $15;
    while(1) {
     $16 = $current_node;
     $17 = ((($16)) + 8|0);
     $18 = HEAP32[$17>>2]|0;
     $19 = ($18|0)!=(0|0);
     if (!($19)) {
      break;
     }
     $20 = $current_node;
     $21 = ((($20)) + 8|0);
     $22 = HEAP32[$21>>2]|0;
     $current_node = $22;
    }
    $23 = $new_node;
    $24 = $current_node;
    $25 = ((($24)) + 8|0);
    HEAP32[$25>>2] = $23;
    $26 = $current_node;
    $27 = $new_node;
    $28 = ((($27)) + 4|0);
    HEAP32[$28>>2] = $26;
   } else {
    $10 = $new_node;
    $11 = $1;
    $12 = ((($11)) + 4|0);
    HEAP32[$12>>2] = $10;
   }
   $29 = $1;
   $30 = HEAP32[$29>>2]|0;
   $31 = (($30) + 1)|0;
   HEAP32[$29>>2] = $31;
   $0 = 1;
   $32 = $0;
   STACKTOP = sp;return ($32|0);
  }
  function _List_get_at($list,$index) {
   $list = $list|0;
   $index = $index|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $current_index = 0, $current_node = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $list;
   $2 = $index;
   $3 = $1;
   $4 = HEAP32[$3>>2]|0;
   $5 = ($4|0)==(0);
   if (!($5)) {
    $6 = $2;
    $7 = $1;
    $8 = HEAP32[$7>>2]|0;
    $9 = ($6>>>0)>=($8>>>0);
    if (!($9)) {
     $10 = $1;
     $11 = ((($10)) + 4|0);
     $12 = HEAP32[$11>>2]|0;
     $current_node = $12;
     $current_index = 0;
     while(1) {
      $13 = $current_index;
      $14 = $2;
      $15 = ($13>>>0)<($14>>>0);
      $16 = $current_node;
      $17 = ($16|0)!=(0|0);
      $18 = $15 ? $17 : 0;
      $19 = $current_node;
      if (!($18)) {
       break;
      }
      $20 = ((($19)) + 8|0);
      $21 = HEAP32[$20>>2]|0;
      $current_node = $21;
      $22 = $current_index;
      $23 = (($22) + 1)|0;
      $current_index = $23;
     }
     $24 = ($19|0)!=(0|0);
     if ($24) {
      $25 = $current_node;
      $26 = HEAP32[$25>>2]|0;
      $27 = $26;
     } else {
      $27 = 0;
     }
     $0 = $27;
     $28 = $0;
     STACKTOP = sp;return ($28|0);
    }
   }
   $0 = 0;
   $28 = $0;
   STACKTOP = sp;return ($28|0);
  }
  function _List_remove_at($list,$index) {
   $list = $list|0;
   $index = $index|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $7 = 0;
   var $8 = 0, $9 = 0, $current_index = 0, $current_node = 0, $payload = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $list;
   $2 = $index;
   $3 = $1;
   $4 = HEAP32[$3>>2]|0;
   $5 = ($4|0)==(0);
   if (!($5)) {
    $6 = $2;
    $7 = $1;
    $8 = HEAP32[$7>>2]|0;
    $9 = ($6>>>0)>=($8>>>0);
    if (!($9)) {
     $10 = $1;
     $11 = ((($10)) + 4|0);
     $12 = HEAP32[$11>>2]|0;
     $current_node = $12;
     $current_index = 0;
     while(1) {
      $13 = $current_index;
      $14 = $2;
      $15 = ($13>>>0)<($14>>>0);
      $16 = $current_node;
      $17 = ($16|0)!=(0|0);
      $18 = $15 ? $17 : 0;
      $19 = $current_node;
      if (!($18)) {
       break;
      }
      $20 = ((($19)) + 8|0);
      $21 = HEAP32[$20>>2]|0;
      $current_node = $21;
      $22 = $current_index;
      $23 = (($22) + 1)|0;
      $current_index = $23;
     }
     $24 = ($19|0)!=(0|0);
     if (!($24)) {
      $0 = 0;
      $61 = $0;
      STACKTOP = sp;return ($61|0);
     }
     $25 = $current_node;
     $26 = HEAP32[$25>>2]|0;
     $payload = $26;
     $27 = $current_node;
     $28 = ((($27)) + 4|0);
     $29 = HEAP32[$28>>2]|0;
     $30 = ($29|0)!=(0|0);
     if ($30) {
      $31 = $current_node;
      $32 = ((($31)) + 8|0);
      $33 = HEAP32[$32>>2]|0;
      $34 = $current_node;
      $35 = ((($34)) + 4|0);
      $36 = HEAP32[$35>>2]|0;
      $37 = ((($36)) + 8|0);
      HEAP32[$37>>2] = $33;
     }
     $38 = $current_node;
     $39 = ((($38)) + 8|0);
     $40 = HEAP32[$39>>2]|0;
     $41 = ($40|0)!=(0|0);
     if ($41) {
      $42 = $current_node;
      $43 = ((($42)) + 4|0);
      $44 = HEAP32[$43>>2]|0;
      $45 = $current_node;
      $46 = ((($45)) + 8|0);
      $47 = HEAP32[$46>>2]|0;
      $48 = ((($47)) + 4|0);
      HEAP32[$48>>2] = $44;
     }
     $49 = $2;
     $50 = ($49|0)==(0);
     if ($50) {
      $51 = $current_node;
      $52 = ((($51)) + 8|0);
      $53 = HEAP32[$52>>2]|0;
      $54 = $1;
      $55 = ((($54)) + 4|0);
      HEAP32[$55>>2] = $53;
     }
     $56 = $current_node;
     _free($56);
     $57 = $1;
     $58 = HEAP32[$57>>2]|0;
     $59 = (($58) + -1)|0;
     HEAP32[$57>>2] = $59;
     $60 = $payload;
     $0 = $60;
     $61 = $0;
     STACKTOP = sp;return ($61|0);
    }
   }
   $0 = 0;
   $61 = $0;
   STACKTOP = sp;return ($61|0);
  }
  function _Context_new($width,$height,$buffer) {
   $width = $width|0;
   $height = $height|0;
   $buffer = $buffer|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0;
   var $6 = 0, $7 = 0, $8 = 0, $9 = 0, $context = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $width;
   $2 = $height;
   $3 = $buffer;
   $4 = (_malloc(24)|0);
   $context = $4;
   $5 = ($4|0)!=(0|0);
   if (!($5)) {
    $6 = $context;
    $0 = $6;
    $23 = $0;
    STACKTOP = sp;return ($23|0);
   }
   $7 = (_List_new()|0);
   $8 = $context;
   $9 = ((($8)) + 16|0);
   HEAP32[$9>>2] = $7;
   $10 = ($7|0)!=(0|0);
   if ($10) {
    $12 = $1;
    $13 = $context;
    $14 = ((($13)) + 4|0);
    HEAP16[$14>>1] = $12;
    $15 = $2;
    $16 = $context;
    $17 = ((($16)) + 6|0);
    HEAP16[$17>>1] = $15;
    $18 = $3;
    $19 = $context;
    HEAP32[$19>>2] = $18;
    $20 = $context;
    $21 = ((($20)) + 20|0);
    HEAP8[$21>>0] = 0;
    $22 = $context;
    $0 = $22;
    $23 = $0;
    STACKTOP = sp;return ($23|0);
   } else {
    $11 = $context;
    _free($11);
    $0 = 0;
    $23 = $0;
    STACKTOP = sp;return ($23|0);
   }
   return (0)|0;
  }
  function _Context_clipped_rect($context,$x,$y,$width,$height,$clip_area,$color) {
   $context = $context|0;
   $x = $x|0;
   $y = $y|0;
   $width = $width|0;
   $height = $height|0;
   $clip_area = $clip_area|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $cur_x = 0, $max_x = 0, $max_y = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $x;
   $2 = $y;
   $3 = $width;
   $4 = $height;
   $5 = $clip_area;
   $6 = $color;
   $7 = $1;
   $8 = $3;
   $9 = (($7) + ($8))|0;
   $max_x = $9;
   $10 = $2;
   $11 = $4;
   $12 = (($10) + ($11))|0;
   $max_y = $12;
   $13 = $0;
   $14 = ((($13)) + 8|0);
   $15 = HEAP32[$14>>2]|0;
   $16 = $1;
   $17 = (($16) + ($15))|0;
   $1 = $17;
   $18 = $0;
   $19 = ((($18)) + 12|0);
   $20 = HEAP32[$19>>2]|0;
   $21 = $2;
   $22 = (($21) + ($20))|0;
   $2 = $22;
   $23 = $0;
   $24 = ((($23)) + 8|0);
   $25 = HEAP32[$24>>2]|0;
   $26 = $max_x;
   $27 = (($26) + ($25))|0;
   $max_x = $27;
   $28 = $0;
   $29 = ((($28)) + 12|0);
   $30 = HEAP32[$29>>2]|0;
   $31 = $max_y;
   $32 = (($31) + ($30))|0;
   $max_y = $32;
   $33 = $1;
   $34 = $5;
   $35 = ((($34)) + 4|0);
   $36 = HEAP32[$35>>2]|0;
   $37 = ($33|0)<($36|0);
   if ($37) {
    $38 = $5;
    $39 = ((($38)) + 4|0);
    $40 = HEAP32[$39>>2]|0;
    $1 = $40;
   }
   $41 = $2;
   $42 = $5;
   $43 = HEAP32[$42>>2]|0;
   $44 = ($41|0)<($43|0);
   if ($44) {
    $45 = $5;
    $46 = HEAP32[$45>>2]|0;
    $2 = $46;
   }
   $47 = $max_x;
   $48 = $5;
   $49 = ((($48)) + 12|0);
   $50 = HEAP32[$49>>2]|0;
   $51 = (($50) + 1)|0;
   $52 = ($47|0)>($51|0);
   if ($52) {
    $53 = $5;
    $54 = ((($53)) + 12|0);
    $55 = HEAP32[$54>>2]|0;
    $56 = (($55) + 1)|0;
    $max_x = $56;
   }
   $57 = $max_y;
   $58 = $5;
   $59 = ((($58)) + 8|0);
   $60 = HEAP32[$59>>2]|0;
   $61 = (($60) + 1)|0;
   $62 = ($57|0)>($61|0);
   if ($62) {
    $63 = $5;
    $64 = ((($63)) + 8|0);
    $65 = HEAP32[$64>>2]|0;
    $66 = (($65) + 1)|0;
    $max_y = $66;
   }
   while(1) {
    $67 = $2;
    $68 = $max_y;
    $69 = ($67|0)<($68|0);
    if (!($69)) {
     break;
    }
    $70 = $1;
    $cur_x = $70;
    while(1) {
     $71 = $cur_x;
     $72 = $max_x;
     $73 = ($71|0)<($72|0);
     if (!($73)) {
      break;
     }
     $74 = $6;
     $75 = $2;
     $76 = $0;
     $77 = ((($76)) + 4|0);
     $78 = HEAP16[$77>>1]|0;
     $79 = $78&65535;
     $80 = Math_imul($75, $79)|0;
     $81 = $cur_x;
     $82 = (($80) + ($81))|0;
     $83 = $0;
     $84 = HEAP32[$83>>2]|0;
     $85 = (($84) + ($82<<2)|0);
     HEAP32[$85>>2] = $74;
     $86 = $cur_x;
     $87 = (($86) + 1)|0;
     $cur_x = $87;
    }
    $88 = $2;
    $89 = (($88) + 1)|0;
    $2 = $89;
   }
   STACKTOP = sp;return;
  }
  function _Context_fill_rect($context,$x,$y,$width,$height,$color) {
   $context = $context|0;
   $x = $x|0;
   $y = $y|0;
   $width = $width|0;
   $height = $height|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $clip_area = 0, $i = 0, $max_x = 0, $max_y = 0, $screen_area = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $screen_area = sp;
   $0 = $context;
   $1 = $x;
   $2 = $y;
   $3 = $width;
   $4 = $height;
   $5 = $color;
   $6 = $1;
   $7 = $3;
   $8 = (($6) + ($7))|0;
   $max_x = $8;
   $9 = $2;
   $10 = $4;
   $11 = (($9) + ($10))|0;
   $max_y = $11;
   $12 = $max_x;
   $13 = $0;
   $14 = ((($13)) + 4|0);
   $15 = HEAP16[$14>>1]|0;
   $16 = $15&65535;
   $17 = ($12|0)>($16|0);
   if ($17) {
    $18 = $0;
    $19 = ((($18)) + 4|0);
    $20 = HEAP16[$19>>1]|0;
    $21 = $20&65535;
    $max_x = $21;
   }
   $22 = $max_y;
   $23 = $0;
   $24 = ((($23)) + 6|0);
   $25 = HEAP16[$24>>1]|0;
   $26 = $25&65535;
   $27 = ($22|0)>($26|0);
   if ($27) {
    $28 = $0;
    $29 = ((($28)) + 6|0);
    $30 = HEAP16[$29>>1]|0;
    $31 = $30&65535;
    $max_y = $31;
   }
   $32 = $1;
   $33 = ($32|0)<(0);
   if ($33) {
    $1 = 0;
   }
   $34 = $2;
   $35 = ($34|0)<(0);
   if ($35) {
    $2 = 0;
   }
   $36 = $max_x;
   $37 = $1;
   $38 = (($36) - ($37))|0;
   $3 = $38;
   $39 = $max_y;
   $40 = $2;
   $41 = (($39) - ($40))|0;
   $4 = $41;
   $42 = $0;
   $43 = ((($42)) + 16|0);
   $44 = HEAP32[$43>>2]|0;
   $45 = HEAP32[$44>>2]|0;
   $46 = ($45|0)!=(0);
   if ($46) {
    $i = 0;
    while(1) {
     $47 = $i;
     $48 = $0;
     $49 = ((($48)) + 16|0);
     $50 = HEAP32[$49>>2]|0;
     $51 = HEAP32[$50>>2]|0;
     $52 = ($47>>>0)<($51>>>0);
     if (!($52)) {
      break;
     }
     $53 = $0;
     $54 = ((($53)) + 16|0);
     $55 = HEAP32[$54>>2]|0;
     $56 = $i;
     $57 = (_List_get_at($55,$56)|0);
     $clip_area = $57;
     $58 = $0;
     $59 = $1;
     $60 = $2;
     $61 = $3;
     $62 = $4;
     $63 = $clip_area;
     $64 = $5;
     _Context_clipped_rect($58,$59,$60,$61,$62,$63,$64);
     $65 = $i;
     $66 = (($65) + 1)|0;
     $i = $66;
    }
    STACKTOP = sp;return;
   } else {
    $67 = $0;
    $68 = ((($67)) + 20|0);
    $69 = HEAP8[$68>>0]|0;
    $70 = ($69<<24>>24)!=(0);
    if ($70) {
     STACKTOP = sp;return;
    }
    HEAP32[$screen_area>>2] = 0;
    $71 = ((($screen_area)) + 4|0);
    HEAP32[$71>>2] = 0;
    $72 = $0;
    $73 = ((($72)) + 6|0);
    $74 = HEAP16[$73>>1]|0;
    $75 = $74&65535;
    $76 = (($75) - 1)|0;
    $77 = ((($screen_area)) + 8|0);
    HEAP32[$77>>2] = $76;
    $78 = $0;
    $79 = ((($78)) + 4|0);
    $80 = HEAP16[$79>>1]|0;
    $81 = $80&65535;
    $82 = (($81) - 1)|0;
    $83 = ((($screen_area)) + 12|0);
    HEAP32[$83>>2] = $82;
    $84 = $0;
    $85 = $1;
    $86 = $2;
    $87 = $3;
    $88 = $4;
    $89 = $5;
    _Context_clipped_rect($84,$85,$86,$87,$88,$screen_area,$89);
    STACKTOP = sp;return;
   }
  }
  function _Context_horizontal_line($context,$x,$y,$length,$color) {
   $context = $context|0;
   $x = $x|0;
   $y = $y|0;
   $length = $length|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $x;
   $2 = $y;
   $3 = $length;
   $4 = $color;
   $5 = $0;
   $6 = $1;
   $7 = $2;
   $8 = $3;
   $9 = $4;
   _Context_fill_rect($5,$6,$7,$8,1,$9);
   STACKTOP = sp;return;
  }
  function _Context_vertical_line($context,$x,$y,$length,$color) {
   $context = $context|0;
   $x = $x|0;
   $y = $y|0;
   $length = $length|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $x;
   $2 = $y;
   $3 = $length;
   $4 = $color;
   $5 = $0;
   $6 = $1;
   $7 = $2;
   $8 = $3;
   $9 = $4;
   _Context_fill_rect($5,$6,$7,1,$8,$9);
   STACKTOP = sp;return;
  }
  function _Context_draw_rect($context,$x,$y,$width,$height,$color) {
   $context = $context|0;
   $x = $x|0;
   $y = $y|0;
   $width = $width|0;
   $height = $height|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $x;
   $2 = $y;
   $3 = $width;
   $4 = $height;
   $5 = $color;
   $6 = $0;
   $7 = $1;
   $8 = $2;
   $9 = $3;
   $10 = $5;
   _Context_horizontal_line($6,$7,$8,$9,$10);
   $11 = $0;
   $12 = $1;
   $13 = $2;
   $14 = (($13) + 1)|0;
   $15 = $4;
   $16 = (($15) - 2)|0;
   $17 = $5;
   _Context_vertical_line($11,$12,$14,$16,$17);
   $18 = $0;
   $19 = $1;
   $20 = $2;
   $21 = $4;
   $22 = (($20) + ($21))|0;
   $23 = (($22) - 1)|0;
   $24 = $3;
   $25 = $5;
   _Context_horizontal_line($18,$19,$23,$24,$25);
   $26 = $0;
   $27 = $1;
   $28 = $3;
   $29 = (($27) + ($28))|0;
   $30 = (($29) - 1)|0;
   $31 = $2;
   $32 = (($31) + 1)|0;
   $33 = $4;
   $34 = (($33) - 2)|0;
   $35 = $5;
   _Context_vertical_line($26,$30,$32,$34,$35);
   STACKTOP = sp;return;
  }
  function _Context_intersect_clip_rect($context,$rect) {
   $context = $context|0;
   $rect = $rect|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $current_rect = 0;
   var $i = 0, $intersect_rect = 0, $output_rects = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $rect;
   $2 = $0;
   $3 = ((($2)) + 20|0);
   HEAP8[$3>>0] = 1;
   $4 = (_List_new()|0);
   $output_rects = $4;
   $5 = ($4|0)!=(0|0);
   if (!($5)) {
    STACKTOP = sp;return;
   }
   $i = 0;
   while(1) {
    $6 = $i;
    $7 = $0;
    $8 = ((($7)) + 16|0);
    $9 = HEAP32[$8>>2]|0;
    $10 = HEAP32[$9>>2]|0;
    $11 = ($6>>>0)<($10>>>0);
    if (!($11)) {
     break;
    }
    $12 = $0;
    $13 = ((($12)) + 16|0);
    $14 = HEAP32[$13>>2]|0;
    $15 = $i;
    $16 = (_List_get_at($14,$15)|0);
    $current_rect = $16;
    $17 = $current_rect;
    $18 = $1;
    $19 = (_Rect_intersect($17,$18)|0);
    $intersect_rect = $19;
    $20 = $intersect_rect;
    $21 = ($20|0)!=(0|0);
    if ($21) {
     $22 = $output_rects;
     $23 = $intersect_rect;
     (_List_add($22,$23)|0);
    }
    $24 = $i;
    $25 = (($24) + 1)|0;
    $i = $25;
   }
   while(1) {
    $26 = $0;
    $27 = ((($26)) + 16|0);
    $28 = HEAP32[$27>>2]|0;
    $29 = HEAP32[$28>>2]|0;
    $30 = ($29|0)!=(0);
    $31 = $0;
    $32 = ((($31)) + 16|0);
    $33 = HEAP32[$32>>2]|0;
    if (!($30)) {
     break;
    }
    $34 = (_List_remove_at($33,0)|0);
    _free($34);
   }
   _free($33);
   $35 = $output_rects;
   $36 = $0;
   $37 = ((($36)) + 16|0);
   HEAP32[$37>>2] = $35;
   $38 = $1;
   _free($38);
   STACKTOP = sp;return;
  }
  function _Context_subtract_clip_rect($context,$subtracted_rect) {
   $context = $context|0;
   $subtracted_rect = $subtracted_rect|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
   var $cur_rect = 0, $i = 0, $split_rects = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $subtracted_rect;
   $2 = $0;
   $3 = ((($2)) + 20|0);
   HEAP8[$3>>0] = 1;
   $i = 0;
   while(1) {
    $4 = $i;
    $5 = $0;
    $6 = ((($5)) + 16|0);
    $7 = HEAP32[$6>>2]|0;
    $8 = HEAP32[$7>>2]|0;
    $9 = ($4>>>0)<($8>>>0);
    if (!($9)) {
     break;
    }
    $10 = $0;
    $11 = ((($10)) + 16|0);
    $12 = HEAP32[$11>>2]|0;
    $13 = $i;
    $14 = (_List_get_at($12,$13)|0);
    $cur_rect = $14;
    $15 = $cur_rect;
    $16 = ((($15)) + 4|0);
    $17 = HEAP32[$16>>2]|0;
    $18 = $1;
    $19 = ((($18)) + 12|0);
    $20 = HEAP32[$19>>2]|0;
    $21 = ($17|0)<=($20|0);
    if ($21) {
     $22 = $cur_rect;
     $23 = ((($22)) + 12|0);
     $24 = HEAP32[$23>>2]|0;
     $25 = $1;
     $26 = ((($25)) + 4|0);
     $27 = HEAP32[$26>>2]|0;
     $28 = ($24|0)>=($27|0);
     if ($28) {
      $29 = $cur_rect;
      $30 = HEAP32[$29>>2]|0;
      $31 = $1;
      $32 = ((($31)) + 8|0);
      $33 = HEAP32[$32>>2]|0;
      $34 = ($30|0)<=($33|0);
      if ($34) {
       $35 = $cur_rect;
       $36 = ((($35)) + 8|0);
       $37 = HEAP32[$36>>2]|0;
       $38 = $1;
       $39 = HEAP32[$38>>2]|0;
       $40 = ($37|0)>=($39|0);
       if ($40) {
        $43 = $0;
        $44 = ((($43)) + 16|0);
        $45 = HEAP32[$44>>2]|0;
        $46 = $i;
        (_List_remove_at($45,$46)|0);
        $47 = $cur_rect;
        $48 = $1;
        $49 = (_Rect_split($47,$48)|0);
        $split_rects = $49;
        $50 = $cur_rect;
        _free($50);
        while(1) {
         $51 = $split_rects;
         $52 = HEAP32[$51>>2]|0;
         $53 = ($52|0)!=(0);
         $54 = $split_rects;
         if (!($53)) {
          break;
         }
         $55 = (_List_remove_at($54,0)|0);
         $cur_rect = $55;
         $56 = $0;
         $57 = ((($56)) + 16|0);
         $58 = HEAP32[$57>>2]|0;
         $59 = $cur_rect;
         (_List_add($58,$59)|0);
        }
        _free($54);
        $i = 0;
        continue;
       }
      }
     }
    }
    $41 = $i;
    $42 = (($41) + 1)|0;
    $i = $42;
   }
   STACKTOP = sp;return;
  }
  function _Context_add_clip_rect($context,$added_rect) {
   $context = $context|0;
   $added_rect = $added_rect|0;
   var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $added_rect;
   $2 = $0;
   $3 = $1;
   _Context_subtract_clip_rect($2,$3);
   $4 = $0;
   $5 = ((($4)) + 16|0);
   $6 = HEAP32[$5>>2]|0;
   $7 = $1;
   (_List_add($6,$7)|0);
   STACKTOP = sp;return;
  }
  function _Context_clear_clip_rects($context) {
   $context = $context|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $cur_rect = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $0;
   $2 = ((($1)) + 20|0);
   HEAP8[$2>>0] = 0;
   while(1) {
    $3 = $0;
    $4 = ((($3)) + 16|0);
    $5 = HEAP32[$4>>2]|0;
    $6 = HEAP32[$5>>2]|0;
    $7 = ($6|0)!=(0);
    if (!($7)) {
     break;
    }
    $8 = $0;
    $9 = ((($8)) + 16|0);
    $10 = HEAP32[$9>>2]|0;
    $11 = (_List_remove_at($10,0)|0);
    $cur_rect = $11;
    $12 = $cur_rect;
    _free($12);
   }
   STACKTOP = sp;return;
  }
  function _Context_draw_char_clipped($context,$character,$x,$y,$color,$bound_rect) {
   $context = $context|0;
   $character = $character|0;
   $x = $x|0;
   $y = $y|0;
   $color = $color|0;
   $bound_rect = $bound_rect|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $14 = 0, $15 = 0, $16 = 0;
   var $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0;
   var $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0;
   var $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0;
   var $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0;
   var $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $count_x = 0, $count_y = 0, $font_x = 0, $font_y = 0, $off_x = 0, $off_y = 0, $shift_line = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $character;
   $2 = $x;
   $3 = $y;
   $4 = $color;
   $5 = $bound_rect;
   $off_x = 0;
   $off_y = 0;
   $count_x = 8;
   $count_y = 12;
   $6 = $0;
   $7 = ((($6)) + 8|0);
   $8 = HEAP32[$7>>2]|0;
   $9 = $2;
   $10 = (($9) + ($8))|0;
   $2 = $10;
   $11 = $0;
   $12 = ((($11)) + 12|0);
   $13 = HEAP32[$12>>2]|0;
   $14 = $3;
   $15 = (($14) + ($13))|0;
   $3 = $15;
   $16 = $1;
   $17 = $16 << 24 >> 24;
   $18 = $17 & 127;
   $19 = $18&255;
   $1 = $19;
   $20 = $2;
   $21 = $5;
   $22 = ((($21)) + 12|0);
   $23 = HEAP32[$22>>2]|0;
   $24 = ($20|0)>($23|0);
   if ($24) {
    STACKTOP = sp;return;
   }
   $25 = $2;
   $26 = (($25) + 8)|0;
   $27 = $5;
   $28 = ((($27)) + 4|0);
   $29 = HEAP32[$28>>2]|0;
   $30 = ($26|0)<=($29|0);
   if ($30) {
    STACKTOP = sp;return;
   }
   $31 = $3;
   $32 = $5;
   $33 = ((($32)) + 8|0);
   $34 = HEAP32[$33>>2]|0;
   $35 = ($31|0)>($34|0);
   if ($35) {
    STACKTOP = sp;return;
   }
   $36 = $3;
   $37 = (($36) + 12)|0;
   $38 = $5;
   $39 = HEAP32[$38>>2]|0;
   $40 = ($37|0)<=($39|0);
   if ($40) {
    STACKTOP = sp;return;
   }
   $41 = $2;
   $42 = $5;
   $43 = ((($42)) + 4|0);
   $44 = HEAP32[$43>>2]|0;
   $45 = ($41|0)<($44|0);
   if ($45) {
    $46 = $5;
    $47 = ((($46)) + 4|0);
    $48 = HEAP32[$47>>2]|0;
    $49 = $2;
    $50 = (($48) - ($49))|0;
    $off_x = $50;
   }
   $51 = $2;
   $52 = (($51) + 8)|0;
   $53 = $5;
   $54 = ((($53)) + 12|0);
   $55 = HEAP32[$54>>2]|0;
   $56 = ($52|0)>($55|0);
   if ($56) {
    $57 = $5;
    $58 = ((($57)) + 12|0);
    $59 = HEAP32[$58>>2]|0;
    $60 = $2;
    $61 = (($59) - ($60))|0;
    $62 = (($61) + 1)|0;
    $count_x = $62;
   }
   $63 = $3;
   $64 = $5;
   $65 = HEAP32[$64>>2]|0;
   $66 = ($63|0)<($65|0);
   if ($66) {
    $67 = $5;
    $68 = HEAP32[$67>>2]|0;
    $69 = $3;
    $70 = (($68) - ($69))|0;
    $off_y = $70;
   }
   $71 = $3;
   $72 = (($71) + 12)|0;
   $73 = $5;
   $74 = ((($73)) + 8|0);
   $75 = HEAP32[$74>>2]|0;
   $76 = ($72|0)>($75|0);
   if ($76) {
    $77 = $5;
    $78 = ((($77)) + 8|0);
    $79 = HEAP32[$78>>2]|0;
    $80 = $3;
    $81 = (($79) - ($80))|0;
    $82 = (($81) + 1)|0;
    $count_y = $82;
   }
   $83 = $off_y;
   $font_y = $83;
   while(1) {
    $84 = $font_y;
    $85 = $count_y;
    $86 = ($84|0)<($85|0);
    if (!($86)) {
     break;
    }
    $87 = $font_y;
    $88 = $87<<7;
    $89 = $1;
    $90 = $89 << 24 >> 24;
    $91 = (($88) + ($90))|0;
    $92 = (2552 + ($91)|0);
    $93 = HEAP8[$92>>0]|0;
    $shift_line = $93;
    $94 = $off_x;
    $95 = $shift_line;
    $96 = $95&255;
    $97 = $96 << $94;
    $98 = $97&255;
    $shift_line = $98;
    $99 = $off_x;
    $font_x = $99;
    while(1) {
     $100 = $font_x;
     $101 = $count_x;
     $102 = ($100|0)<($101|0);
     if (!($102)) {
      break;
     }
     $103 = $shift_line;
     $104 = $103&255;
     $105 = $104 & 128;
     $106 = ($105|0)!=(0);
     if ($106) {
      $107 = $4;
      $108 = $font_y;
      $109 = $3;
      $110 = (($108) + ($109))|0;
      $111 = $0;
      $112 = ((($111)) + 4|0);
      $113 = HEAP16[$112>>1]|0;
      $114 = $113&65535;
      $115 = Math_imul($110, $114)|0;
      $116 = $font_x;
      $117 = $2;
      $118 = (($116) + ($117))|0;
      $119 = (($115) + ($118))|0;
      $120 = $0;
      $121 = HEAP32[$120>>2]|0;
      $122 = (($121) + ($119<<2)|0);
      HEAP32[$122>>2] = $107;
     }
     $123 = $shift_line;
     $124 = $123&255;
     $125 = $124 << 1;
     $126 = $125&255;
     $shift_line = $126;
     $127 = $font_x;
     $128 = (($127) + 1)|0;
     $font_x = $128;
    }
    $129 = $font_y;
    $130 = (($129) + 1)|0;
    $font_y = $130;
   }
   STACKTOP = sp;return;
  }
  function _Context_draw_char($context,$character,$x,$y,$color) {
   $context = $context|0;
   $character = $character|0;
   $x = $x|0;
   $y = $y|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $clip_area = 0, $i = 0, $screen_area = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $screen_area = sp;
   $0 = $context;
   $1 = $character;
   $2 = $x;
   $3 = $y;
   $4 = $color;
   $5 = $0;
   $6 = ((($5)) + 16|0);
   $7 = HEAP32[$6>>2]|0;
   $8 = HEAP32[$7>>2]|0;
   $9 = ($8|0)!=(0);
   if ($9) {
    $i = 0;
    while(1) {
     $10 = $i;
     $11 = $0;
     $12 = ((($11)) + 16|0);
     $13 = HEAP32[$12>>2]|0;
     $14 = HEAP32[$13>>2]|0;
     $15 = ($10>>>0)<($14>>>0);
     if (!($15)) {
      break;
     }
     $16 = $0;
     $17 = ((($16)) + 16|0);
     $18 = HEAP32[$17>>2]|0;
     $19 = $i;
     $20 = (_List_get_at($18,$19)|0);
     $clip_area = $20;
     $21 = $0;
     $22 = $1;
     $23 = $2;
     $24 = $3;
     $25 = $4;
     $26 = $clip_area;
     _Context_draw_char_clipped($21,$22,$23,$24,$25,$26);
     $27 = $i;
     $28 = (($27) + 1)|0;
     $i = $28;
    }
    STACKTOP = sp;return;
   } else {
    $29 = $0;
    $30 = ((($29)) + 20|0);
    $31 = HEAP8[$30>>0]|0;
    $32 = ($31<<24>>24)!=(0);
    if ($32) {
     STACKTOP = sp;return;
    }
    HEAP32[$screen_area>>2] = 0;
    $33 = ((($screen_area)) + 4|0);
    HEAP32[$33>>2] = 0;
    $34 = $0;
    $35 = ((($34)) + 6|0);
    $36 = HEAP16[$35>>1]|0;
    $37 = $36&65535;
    $38 = (($37) - 1)|0;
    $39 = ((($screen_area)) + 8|0);
    HEAP32[$39>>2] = $38;
    $40 = $0;
    $41 = ((($40)) + 4|0);
    $42 = HEAP16[$41>>1]|0;
    $43 = $42&65535;
    $44 = (($43) - 1)|0;
    $45 = ((($screen_area)) + 12|0);
    HEAP32[$45>>2] = $44;
    $46 = $0;
    $47 = $1;
    $48 = $2;
    $49 = $3;
    $50 = $4;
    $51 = $clip_area;
    _Context_draw_char_clipped($46,$47,$48,$49,$50,$51);
    STACKTOP = sp;return;
   }
  }
  function _Context_draw_text($context,$string,$x,$y,$color) {
   $context = $context|0;
   $string = $string|0;
   $x = $x|0;
   $y = $y|0;
   $color = $color|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $context;
   $1 = $string;
   $2 = $x;
   $3 = $y;
   $4 = $color;
   while(1) {
    $5 = $1;
    $6 = HEAP8[$5>>0]|0;
    $7 = ($6<<24>>24)!=(0);
    if (!($7)) {
     break;
    }
    $8 = $0;
    $9 = $1;
    $10 = ((($9)) + 1|0);
    $1 = $10;
    $11 = HEAP8[$9>>0]|0;
    $12 = $2;
    $13 = $3;
    $14 = $4;
    _Context_draw_char($8,$11,$12,$13,$14);
    $15 = $2;
    $16 = (($15) + 8)|0;
    $2 = $16;
   }
   STACKTOP = sp;return;
  }
  function _Window_init($window,$x,$y,$width,$height,$flags,$context) {
   $window = $window|0;
   $x = $x|0;
   $y = $y|0;
   $width = $width|0;
   $height = $height|0;
   $flags = $flags|0;
   $context = $context|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $window;
   $2 = $x;
   $3 = $y;
   $4 = $width;
   $5 = $height;
   $6 = $flags;
   $7 = $context;
   $8 = (_List_new()|0);
   $9 = $1;
   $10 = ((($9)) + 28|0);
   HEAP32[$10>>2] = $8;
   $11 = ($8|0)!=(0|0);
   if ($11) {
    $12 = $2;
    $13 = $1;
    $14 = ((($13)) + 4|0);
    HEAP16[$14>>1] = $12;
    $15 = $3;
    $16 = $1;
    $17 = ((($16)) + 6|0);
    HEAP16[$17>>1] = $15;
    $18 = $4;
    $19 = $1;
    $20 = ((($19)) + 8|0);
    HEAP16[$20>>1] = $18;
    $21 = $5;
    $22 = $1;
    $23 = ((($22)) + 10|0);
    HEAP16[$23>>1] = $21;
    $24 = $7;
    $25 = $1;
    $26 = ((($25)) + 16|0);
    HEAP32[$26>>2] = $24;
    $27 = $6;
    $28 = $1;
    $29 = ((($28)) + 12|0);
    HEAP16[$29>>1] = $27;
    $30 = $1;
    HEAP32[$30>>2] = 0;
    $31 = $1;
    $32 = ((($31)) + 20|0);
    HEAP32[$32>>2] = 0;
    $33 = $1;
    $34 = ((($33)) + 32|0);
    HEAP16[$34>>1] = 0;
    $35 = $1;
    $36 = ((($35)) + 34|0);
    HEAP16[$36>>1] = 0;
    $37 = $1;
    $38 = ((($37)) + 36|0);
    HEAP8[$38>>0] = 0;
    $39 = $1;
    $40 = ((($39)) + 40|0);
    HEAP32[$40>>2] = 5;
    $41 = $1;
    $42 = ((($41)) + 44|0);
    HEAP32[$42>>2] = 6;
    $43 = $1;
    $44 = ((($43)) + 24|0);
    HEAP32[$44>>2] = 0;
    $45 = $1;
    $46 = ((($45)) + 48|0);
    HEAP32[$46>>2] = 0;
    $0 = 1;
    $47 = $0;
    STACKTOP = sp;return ($47|0);
   } else {
    $0 = 0;
    $47 = $0;
    STACKTOP = sp;return ($47|0);
   }
   return (0)|0;
  }
  function _Window_paint_handler($window) {
   $window = $window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $0;
   $2 = ((($1)) + 16|0);
   $3 = HEAP32[$2>>2]|0;
   $4 = $0;
   $5 = ((($4)) + 8|0);
   $6 = HEAP16[$5>>1]|0;
   $7 = $6&65535;
   $8 = $0;
   $9 = ((($8)) + 10|0);
   $10 = HEAP16[$9>>1]|0;
   $11 = $10&65535;
   _Context_fill_rect($3,0,0,$7,$11,-4473925);
   STACKTOP = sp;return;
  }
  function _Window_mousedown_handler($window,$x,$y) {
   $window = $window|0;
   $x = $x|0;
   $y = $y|0;
   var $0 = 0, $1 = 0, $2 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $x;
   $2 = $y;
   STACKTOP = sp;return;
  }
  function _Window_screen_x($window) {
   $window = $window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $window;
   $2 = $1;
   $3 = HEAP32[$2>>2]|0;
   $4 = ($3|0)!=(0|0);
   $5 = $1;
   $6 = ((($5)) + 4|0);
   $7 = HEAP16[$6>>1]|0;
   $8 = $7 << 16 >> 16;
   if ($4) {
    $9 = $1;
    $10 = HEAP32[$9>>2]|0;
    $11 = (_Window_screen_x($10)|0);
    $12 = (($8) + ($11))|0;
    $0 = $12;
    $13 = $0;
    STACKTOP = sp;return ($13|0);
   } else {
    $0 = $8;
    $13 = $0;
    STACKTOP = sp;return ($13|0);
   }
   return (0)|0;
  }
  function _Window_screen_y($window) {
   $window = $window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $window;
   $2 = $1;
   $3 = HEAP32[$2>>2]|0;
   $4 = ($3|0)!=(0|0);
   $5 = $1;
   $6 = ((($5)) + 6|0);
   $7 = HEAP16[$6>>1]|0;
   $8 = $7 << 16 >> 16;
   if ($4) {
    $9 = $1;
    $10 = HEAP32[$9>>2]|0;
    $11 = (_Window_screen_y($10)|0);
    $12 = (($8) + ($11))|0;
    $0 = $12;
    $13 = $0;
    STACKTOP = sp;return ($13|0);
   } else {
    $0 = $8;
    $13 = $0;
    STACKTOP = sp;return ($13|0);
   }
   return (0)|0;
  }
  function _Window_draw_border($window) {
   $window = $window|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0;
   var $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0;
   var $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0;
   var $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0;
   var $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0;
   var $96 = 0, $97 = 0, $98 = 0, $99 = 0, $screen_x = 0, $screen_y = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $0;
   $2 = (_Window_screen_x($1)|0);
   $screen_x = $2;
   $3 = $0;
   $4 = (_Window_screen_y($3)|0);
   $screen_y = $4;
   $5 = $0;
   $6 = ((($5)) + 16|0);
   $7 = HEAP32[$6>>2]|0;
   $8 = $screen_x;
   $9 = $screen_y;
   $10 = $0;
   $11 = ((($10)) + 8|0);
   $12 = HEAP16[$11>>1]|0;
   $13 = $12&65535;
   $14 = $0;
   $15 = ((($14)) + 10|0);
   $16 = HEAP16[$15>>1]|0;
   $17 = $16&65535;
   _Context_draw_rect($7,$8,$9,$13,$17,-16777216);
   $18 = $0;
   $19 = ((($18)) + 16|0);
   $20 = HEAP32[$19>>2]|0;
   $21 = $screen_x;
   $22 = (($21) + 1)|0;
   $23 = $screen_y;
   $24 = (($23) + 1)|0;
   $25 = $0;
   $26 = ((($25)) + 8|0);
   $27 = HEAP16[$26>>1]|0;
   $28 = $27&65535;
   $29 = (($28) - 2)|0;
   $30 = $0;
   $31 = ((($30)) + 10|0);
   $32 = HEAP16[$31>>1]|0;
   $33 = $32&65535;
   $34 = (($33) - 2)|0;
   _Context_draw_rect($20,$22,$24,$29,$34,-16777216);
   $35 = $0;
   $36 = ((($35)) + 16|0);
   $37 = HEAP32[$36>>2]|0;
   $38 = $screen_x;
   $39 = (($38) + 2)|0;
   $40 = $screen_y;
   $41 = (($40) + 2)|0;
   $42 = $0;
   $43 = ((($42)) + 8|0);
   $44 = HEAP16[$43>>1]|0;
   $45 = $44&65535;
   $46 = (($45) - 4)|0;
   $47 = $0;
   $48 = ((($47)) + 10|0);
   $49 = HEAP16[$48>>1]|0;
   $50 = $49&65535;
   $51 = (($50) - 4)|0;
   _Context_draw_rect($37,$39,$41,$46,$51,-16777216);
   $52 = $0;
   $53 = ((($52)) + 16|0);
   $54 = HEAP32[$53>>2]|0;
   $55 = $screen_x;
   $56 = (($55) + 3)|0;
   $57 = $screen_y;
   $58 = (($57) + 28)|0;
   $59 = $0;
   $60 = ((($59)) + 8|0);
   $61 = HEAP16[$60>>1]|0;
   $62 = $61&65535;
   $63 = (($62) - 6)|0;
   _Context_horizontal_line($54,$56,$58,$63,-16777216);
   $64 = $0;
   $65 = ((($64)) + 16|0);
   $66 = HEAP32[$65>>2]|0;
   $67 = $screen_x;
   $68 = (($67) + 3)|0;
   $69 = $screen_y;
   $70 = (($69) + 29)|0;
   $71 = $0;
   $72 = ((($71)) + 8|0);
   $73 = HEAP16[$72>>1]|0;
   $74 = $73&65535;
   $75 = (($74) - 6)|0;
   _Context_horizontal_line($66,$68,$70,$75,-16777216);
   $76 = $0;
   $77 = ((($76)) + 16|0);
   $78 = HEAP32[$77>>2]|0;
   $79 = $screen_x;
   $80 = (($79) + 3)|0;
   $81 = $screen_y;
   $82 = (($81) + 30)|0;
   $83 = $0;
   $84 = ((($83)) + 8|0);
   $85 = HEAP16[$84>>1]|0;
   $86 = $85&65535;
   $87 = (($86) - 6)|0;
   _Context_horizontal_line($78,$80,$82,$87,-16777216);
   $88 = $0;
   $89 = ((($88)) + 16|0);
   $90 = HEAP32[$89>>2]|0;
   $91 = $screen_x;
   $92 = (($91) + 3)|0;
   $93 = $screen_y;
   $94 = (($93) + 3)|0;
   $95 = $0;
   $96 = ((($95)) + 8|0);
   $97 = HEAP16[$96>>1]|0;
   $98 = $97&65535;
   $99 = (($98) - 6)|0;
   $100 = $0;
   $101 = HEAP32[$100>>2]|0;
   $102 = ((($101)) + 24|0);
   $103 = HEAP32[$102>>2]|0;
   $104 = $0;
   $105 = ($103|0)==($104|0);
   $106 = $105 ? -3108752 : -7307136;
   _Context_fill_rect($90,$92,$94,$99,25,$106);
   $107 = $0;
   $108 = ((($107)) + 16|0);
   $109 = HEAP32[$108>>2]|0;
   $110 = $0;
   $111 = ((($110)) + 48|0);
   $112 = HEAP32[$111>>2]|0;
   $113 = $screen_x;
   $114 = (($113) + 10)|0;
   $115 = $screen_y;
   $116 = (($115) + 10)|0;
   $117 = $0;
   $118 = HEAP32[$117>>2]|0;
   $119 = ((($118)) + 24|0);
   $120 = HEAP32[$119>>2]|0;
   $121 = $0;
   $122 = ($120|0)==($121|0);
   $123 = $122 ? -7968 : -4473925;
   _Context_draw_text($109,$112,$114,$116,$123);
   STACKTOP = sp;return;
  }
  function _Window_apply_bound_clipping($window,$in_recursion,$dirty_regions) {
   $window = $window|0;
   $in_recursion = $in_recursion|0;
   $dirty_regions = $dirty_regions|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0;
   var $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0;
   var $clip_windows = 0, $clipping_window = 0, $clone_dirty_rect = 0, $current_dirty_rect = 0, $i = 0, $or$cond = 0, $screen_x = 0, $screen_y = 0, $temp_rect = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $in_recursion;
   $2 = $dirty_regions;
   $3 = $0;
   $4 = ((($3)) + 16|0);
   $5 = HEAP32[$4>>2]|0;
   $6 = ($5|0)!=(0|0);
   if (!($6)) {
    STACKTOP = sp;return;
   }
   $7 = $0;
   $8 = (_Window_screen_x($7)|0);
   $screen_x = $8;
   $9 = $0;
   $10 = (_Window_screen_y($9)|0);
   $screen_y = $10;
   $11 = $0;
   $12 = ((($11)) + 12|0);
   $13 = HEAP16[$12>>1]|0;
   $14 = $13&65535;
   $15 = $14 & 1;
   $16 = ($15|0)==(0);
   $17 = $1;
   $18 = ($17|0)!=(0);
   $or$cond = $16 & $18;
   if ($or$cond) {
    $19 = $screen_x;
    $20 = (($19) + 3)|0;
    $screen_x = $20;
    $21 = $screen_y;
    $22 = (($21) + 31)|0;
    $screen_y = $22;
    $23 = $screen_y;
    $24 = $screen_x;
    $25 = $screen_y;
    $26 = $0;
    $27 = ((($26)) + 10|0);
    $28 = HEAP16[$27>>1]|0;
    $29 = $28&65535;
    $30 = (($25) + ($29))|0;
    $31 = (($30) - 31)|0;
    $32 = (($31) - 3)|0;
    $33 = (($32) - 1)|0;
    $34 = $screen_x;
    $35 = $0;
    $36 = ((($35)) + 8|0);
    $37 = HEAP16[$36>>1]|0;
    $38 = $37&65535;
    $39 = (($34) + ($38))|0;
    $40 = (($39) - 6)|0;
    $41 = (($40) - 1)|0;
    $42 = (_Rect_new($23,$24,$33,$41)|0);
    $temp_rect = $42;
   } else {
    $43 = $screen_y;
    $44 = $screen_x;
    $45 = $screen_y;
    $46 = $0;
    $47 = ((($46)) + 10|0);
    $48 = HEAP16[$47>>1]|0;
    $49 = $48&65535;
    $50 = (($45) + ($49))|0;
    $51 = (($50) - 1)|0;
    $52 = $screen_x;
    $53 = $0;
    $54 = ((($53)) + 8|0);
    $55 = HEAP16[$54>>1]|0;
    $56 = $55&65535;
    $57 = (($52) + ($56))|0;
    $58 = (($57) - 1)|0;
    $59 = (_Rect_new($43,$44,$51,$58)|0);
    $temp_rect = $59;
   }
   $60 = $0;
   $61 = HEAP32[$60>>2]|0;
   $62 = ($61|0)!=(0|0);
   if ($62) {
    $98 = $0;
    $99 = HEAP32[$98>>2]|0;
    $100 = $2;
    _Window_apply_bound_clipping($99,1,$100);
    $101 = $0;
    $102 = ((($101)) + 16|0);
    $103 = HEAP32[$102>>2]|0;
    $104 = $temp_rect;
    _Context_intersect_clip_rect($103,$104);
    $105 = $0;
    $106 = HEAP32[$105>>2]|0;
    $107 = $0;
    $108 = (_Window_get_windows_above($106,$107)|0);
    $clip_windows = $108;
    while(1) {
     $109 = $clip_windows;
     $110 = HEAP32[$109>>2]|0;
     $111 = ($110|0)!=(0);
     $112 = $clip_windows;
     if (!($111)) {
      break;
     }
     $113 = (_List_remove_at($112,0)|0);
     $clipping_window = $113;
     $114 = $clipping_window;
     $115 = (_Window_screen_x($114)|0);
     $screen_x = $115;
     $116 = $clipping_window;
     $117 = (_Window_screen_y($116)|0);
     $screen_y = $117;
     $118 = $screen_y;
     $119 = $screen_x;
     $120 = $screen_y;
     $121 = $clipping_window;
     $122 = ((($121)) + 10|0);
     $123 = HEAP16[$122>>1]|0;
     $124 = $123&65535;
     $125 = (($120) + ($124))|0;
     $126 = (($125) - 1)|0;
     $127 = $screen_x;
     $128 = $clipping_window;
     $129 = ((($128)) + 8|0);
     $130 = HEAP16[$129>>1]|0;
     $131 = $130&65535;
     $132 = (($127) + ($131))|0;
     $133 = (($132) - 1)|0;
     $134 = (_Rect_new($118,$119,$126,$133)|0);
     $temp_rect = $134;
     $135 = $0;
     $136 = ((($135)) + 16|0);
     $137 = HEAP32[$136>>2]|0;
     $138 = $temp_rect;
     _Context_subtract_clip_rect($137,$138);
     $139 = $temp_rect;
     _free($139);
    }
    _free($112);
    STACKTOP = sp;return;
   }
   $63 = $2;
   $64 = ($63|0)!=(0|0);
   if (!($64)) {
    $94 = $0;
    $95 = ((($94)) + 16|0);
    $96 = HEAP32[$95>>2]|0;
    $97 = $temp_rect;
    _Context_add_clip_rect($96,$97);
    STACKTOP = sp;return;
   }
   $i = 0;
   while(1) {
    $65 = $i;
    $66 = $2;
    $67 = HEAP32[$66>>2]|0;
    $68 = ($65>>>0)<($67>>>0);
    if (!($68)) {
     break;
    }
    $69 = $2;
    $70 = $i;
    $71 = (_List_get_at($69,$70)|0);
    $current_dirty_rect = $71;
    $72 = $current_dirty_rect;
    $73 = HEAP32[$72>>2]|0;
    $74 = $current_dirty_rect;
    $75 = ((($74)) + 4|0);
    $76 = HEAP32[$75>>2]|0;
    $77 = $current_dirty_rect;
    $78 = ((($77)) + 8|0);
    $79 = HEAP32[$78>>2]|0;
    $80 = $current_dirty_rect;
    $81 = ((($80)) + 12|0);
    $82 = HEAP32[$81>>2]|0;
    $83 = (_Rect_new($73,$76,$79,$82)|0);
    $clone_dirty_rect = $83;
    $84 = $0;
    $85 = ((($84)) + 16|0);
    $86 = HEAP32[$85>>2]|0;
    $87 = $clone_dirty_rect;
    _Context_add_clip_rect($86,$87);
    $88 = $i;
    $89 = (($88) + 1)|0;
    $i = $89;
   }
   $90 = $0;
   $91 = ((($90)) + 16|0);
   $92 = HEAP32[$91>>2]|0;
   $93 = $temp_rect;
   _Context_intersect_clip_rect($92,$93);
   STACKTOP = sp;return;
  }
  function _Window_get_windows_above($parent,$child) {
   $parent = $parent|0;
   $child = $child|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0;
   var $current_window = 0, $i = 0, $return_list = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $parent;
   $2 = $child;
   $3 = (_List_new()|0);
   $return_list = $3;
   $4 = ($3|0)!=(0|0);
   if (!($4)) {
    $5 = $return_list;
    $0 = $5;
    $99 = $0;
    STACKTOP = sp;return ($99|0);
   }
   $i = 0;
   while(1) {
    $6 = $i;
    $7 = $1;
    $8 = ((($7)) + 28|0);
    $9 = HEAP32[$8>>2]|0;
    $10 = HEAP32[$9>>2]|0;
    $11 = ($6>>>0)<($10>>>0);
    if (!($11)) {
     break;
    }
    $12 = $2;
    $13 = $1;
    $14 = ((($13)) + 28|0);
    $15 = HEAP32[$14>>2]|0;
    $16 = $i;
    $17 = (_List_get_at($15,$16)|0);
    $18 = ($12|0)==($17|0);
    if ($18) {
     break;
    }
    $19 = $i;
    $20 = (($19) + 1)|0;
    $i = $20;
   }
   $21 = $i;
   $22 = (($21) + 1)|0;
   $i = $22;
   while(1) {
    $23 = $i;
    $24 = $1;
    $25 = ((($24)) + 28|0);
    $26 = HEAP32[$25>>2]|0;
    $27 = HEAP32[$26>>2]|0;
    $28 = ($23>>>0)<($27>>>0);
    if (!($28)) {
     break;
    }
    $29 = $1;
    $30 = ((($29)) + 28|0);
    $31 = HEAP32[$30>>2]|0;
    $32 = $i;
    $33 = (_List_get_at($31,$32)|0);
    $current_window = $33;
    $34 = $current_window;
    $35 = ((($34)) + 4|0);
    $36 = HEAP16[$35>>1]|0;
    $37 = $36 << 16 >> 16;
    $38 = $2;
    $39 = ((($38)) + 4|0);
    $40 = HEAP16[$39>>1]|0;
    $41 = $40 << 16 >> 16;
    $42 = $2;
    $43 = ((($42)) + 8|0);
    $44 = HEAP16[$43>>1]|0;
    $45 = $44&65535;
    $46 = (($41) + ($45))|0;
    $47 = (($46) - 1)|0;
    $48 = ($37|0)<=($47|0);
    if ($48) {
     $49 = $current_window;
     $50 = ((($49)) + 4|0);
     $51 = HEAP16[$50>>1]|0;
     $52 = $51 << 16 >> 16;
     $53 = $current_window;
     $54 = ((($53)) + 8|0);
     $55 = HEAP16[$54>>1]|0;
     $56 = $55&65535;
     $57 = (($52) + ($56))|0;
     $58 = (($57) - 1)|0;
     $59 = $2;
     $60 = ((($59)) + 4|0);
     $61 = HEAP16[$60>>1]|0;
     $62 = $61 << 16 >> 16;
     $63 = ($58|0)>=($62|0);
     if ($63) {
      $64 = $current_window;
      $65 = ((($64)) + 6|0);
      $66 = HEAP16[$65>>1]|0;
      $67 = $66 << 16 >> 16;
      $68 = $2;
      $69 = ((($68)) + 6|0);
      $70 = HEAP16[$69>>1]|0;
      $71 = $70 << 16 >> 16;
      $72 = $2;
      $73 = ((($72)) + 10|0);
      $74 = HEAP16[$73>>1]|0;
      $75 = $74&65535;
      $76 = (($71) + ($75))|0;
      $77 = (($76) - 1)|0;
      $78 = ($67|0)<=($77|0);
      if ($78) {
       $79 = $current_window;
       $80 = ((($79)) + 6|0);
       $81 = HEAP16[$80>>1]|0;
       $82 = $81 << 16 >> 16;
       $83 = $current_window;
       $84 = ((($83)) + 10|0);
       $85 = HEAP16[$84>>1]|0;
       $86 = $85&65535;
       $87 = (($82) + ($86))|0;
       $88 = (($87) - 1)|0;
       $89 = $2;
       $90 = ((($89)) + 6|0);
       $91 = HEAP16[$90>>1]|0;
       $92 = $91 << 16 >> 16;
       $93 = ($88|0)>=($92|0);
       if ($93) {
        $94 = $return_list;
        $95 = $current_window;
        (_List_add($94,$95)|0);
       }
      }
     }
    }
    $96 = $i;
    $97 = (($96) + 1)|0;
    $i = $97;
   }
   $98 = $return_list;
   $0 = $98;
   $99 = $0;
   STACKTOP = sp;return ($99|0);
  }
  function _Window_update_title($window) {
   $window = $window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $0;
   $2 = ((($1)) + 16|0);
   $3 = HEAP32[$2>>2]|0;
   $4 = ($3|0)!=(0|0);
   if (!($4)) {
    STACKTOP = sp;return;
   }
   $5 = $0;
   $6 = ((($5)) + 12|0);
   $7 = HEAP16[$6>>1]|0;
   $8 = $7&65535;
   $9 = $8 & 1;
   $10 = ($9|0)!=(0);
   if ($10) {
    STACKTOP = sp;return;
   }
   $11 = $0;
   _Window_apply_bound_clipping($11,0,0);
   $12 = $0;
   _Window_draw_border($12);
   $13 = $0;
   $14 = ((($13)) + 16|0);
   $15 = HEAP32[$14>>2]|0;
   _Context_clear_clip_rects($15);
   STACKTOP = sp;return;
  }
  function _Window_invalidate($window,$top,$left,$bottom,$right) {
   $window = $window|0;
   $top = $top|0;
   $left = $left|0;
   $bottom = $bottom|0;
   $right = $right|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
   var $dirty_rect = 0, $dirty_regions = 0, $origin_x = 0, $origin_y = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $top;
   $2 = $left;
   $3 = $bottom;
   $4 = $right;
   $5 = $0;
   $6 = (_Window_screen_x($5)|0);
   $origin_x = $6;
   $7 = $0;
   $8 = (_Window_screen_y($7)|0);
   $origin_y = $8;
   $9 = $origin_y;
   $10 = $1;
   $11 = (($10) + ($9))|0;
   $1 = $11;
   $12 = $origin_y;
   $13 = $3;
   $14 = (($13) + ($12))|0;
   $3 = $14;
   $15 = $origin_x;
   $16 = $2;
   $17 = (($16) + ($15))|0;
   $2 = $17;
   $18 = $origin_x;
   $19 = $4;
   $20 = (($19) + ($18))|0;
   $4 = $20;
   $21 = (_List_new()|0);
   $dirty_regions = $21;
   $22 = ($21|0)!=(0|0);
   if (!($22)) {
    STACKTOP = sp;return;
   }
   $23 = $1;
   $24 = $2;
   $25 = $3;
   $26 = $4;
   $27 = (_Rect_new($23,$24,$25,$26)|0);
   $dirty_rect = $27;
   $28 = ($27|0)!=(0|0);
   $29 = $dirty_regions;
   if (!($28)) {
    _free($29);
    STACKTOP = sp;return;
   }
   $30 = $dirty_rect;
   $31 = (_List_add($29,$30)|0);
   $32 = ($31|0)!=(0);
   if ($32) {
    $35 = $0;
    $36 = $dirty_regions;
    _Window_paint($35,$36,0);
    $37 = $dirty_regions;
    (_List_remove_at($37,0)|0);
    $38 = $dirty_regions;
    _free($38);
    $39 = $dirty_rect;
    _free($39);
    STACKTOP = sp;return;
   } else {
    $33 = $dirty_regions;
    _free($33);
    $34 = $dirty_rect;
    _free($34);
    STACKTOP = sp;return;
   }
  }
  function _Window_paint($window,$dirty_regions,$paint_children) {
   $window = $window|0;
   $dirty_regions = $dirty_regions|0;
   $paint_children = $paint_children|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0;
   var $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0;
   var $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0;
   var $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
   var $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0;
   var $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0;
   var $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0;
   var $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $child_screen_x = 0;
   var $child_screen_y = 0, $current_child = 0, $i = 0, $j = 0, $screen_x = 0, $screen_y = 0, $temp_rect = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $dirty_regions;
   $2 = $paint_children;
   $3 = $0;
   $4 = ((($3)) + 16|0);
   $5 = HEAP32[$4>>2]|0;
   $6 = ($5|0)!=(0|0);
   if (!($6)) {
    STACKTOP = sp;return;
   }
   $7 = $0;
   $8 = $1;
   _Window_apply_bound_clipping($7,0,$8);
   $9 = $0;
   $10 = (_Window_screen_x($9)|0);
   $screen_x = $10;
   $11 = $0;
   $12 = (_Window_screen_y($11)|0);
   $screen_y = $12;
   $13 = $0;
   $14 = ((($13)) + 12|0);
   $15 = HEAP16[$14>>1]|0;
   $16 = $15&65535;
   $17 = $16 & 1;
   $18 = ($17|0)!=(0);
   if (!($18)) {
    $19 = $0;
    _Window_draw_border($19);
    $20 = $screen_x;
    $21 = (($20) + 3)|0;
    $screen_x = $21;
    $22 = $screen_y;
    $23 = (($22) + 31)|0;
    $screen_y = $23;
    $24 = $screen_y;
    $25 = $screen_x;
    $26 = $screen_y;
    $27 = $0;
    $28 = ((($27)) + 10|0);
    $29 = HEAP16[$28>>1]|0;
    $30 = $29&65535;
    $31 = (($26) + ($30))|0;
    $32 = (($31) - 31)|0;
    $33 = (($32) - 3)|0;
    $34 = (($33) - 1)|0;
    $35 = $screen_x;
    $36 = $0;
    $37 = ((($36)) + 8|0);
    $38 = HEAP16[$37>>1]|0;
    $39 = $38&65535;
    $40 = (($35) + ($39))|0;
    $41 = (($40) - 6)|0;
    $42 = (($41) - 1)|0;
    $43 = (_Rect_new($24,$25,$34,$42)|0);
    $temp_rect = $43;
    $44 = $0;
    $45 = ((($44)) + 16|0);
    $46 = HEAP32[$45>>2]|0;
    $47 = $temp_rect;
    _Context_intersect_clip_rect($46,$47);
   }
   $i = 0;
   while(1) {
    $48 = $i;
    $49 = $0;
    $50 = ((($49)) + 28|0);
    $51 = HEAP32[$50>>2]|0;
    $52 = HEAP32[$51>>2]|0;
    $53 = ($48>>>0)<($52>>>0);
    if (!($53)) {
     break;
    }
    $54 = $0;
    $55 = ((($54)) + 28|0);
    $56 = HEAP32[$55>>2]|0;
    $57 = $i;
    $58 = (_List_get_at($56,$57)|0);
    $current_child = $58;
    $59 = $current_child;
    $60 = (_Window_screen_x($59)|0);
    $child_screen_x = $60;
    $61 = $current_child;
    $62 = (_Window_screen_y($61)|0);
    $child_screen_y = $62;
    $63 = $child_screen_y;
    $64 = $child_screen_x;
    $65 = $child_screen_y;
    $66 = $current_child;
    $67 = ((($66)) + 10|0);
    $68 = HEAP16[$67>>1]|0;
    $69 = $68&65535;
    $70 = (($65) + ($69))|0;
    $71 = (($70) - 1)|0;
    $72 = $child_screen_x;
    $73 = $current_child;
    $74 = ((($73)) + 8|0);
    $75 = HEAP16[$74>>1]|0;
    $76 = $75&65535;
    $77 = (($72) + ($76))|0;
    $78 = (($77) - 1)|0;
    $79 = (_Rect_new($63,$64,$71,$78)|0);
    $temp_rect = $79;
    $80 = $0;
    $81 = ((($80)) + 16|0);
    $82 = HEAP32[$81>>2]|0;
    $83 = $temp_rect;
    _Context_subtract_clip_rect($82,$83);
    $84 = $temp_rect;
    _free($84);
    $85 = $i;
    $86 = (($85) + 1)|0;
    $i = $86;
   }
   $87 = $screen_x;
   $88 = $0;
   $89 = ((($88)) + 16|0);
   $90 = HEAP32[$89>>2]|0;
   $91 = ((($90)) + 8|0);
   HEAP32[$91>>2] = $87;
   $92 = $screen_y;
   $93 = $0;
   $94 = ((($93)) + 16|0);
   $95 = HEAP32[$94>>2]|0;
   $96 = ((($95)) + 12|0);
   HEAP32[$96>>2] = $92;
   $97 = $0;
   $98 = ((($97)) + 40|0);
   $99 = HEAP32[$98>>2]|0;
   $100 = $0;
   FUNCTION_TABLE_vi[$99 & 7]($100);
   $101 = $0;
   $102 = ((($101)) + 16|0);
   $103 = HEAP32[$102>>2]|0;
   _Context_clear_clip_rects($103);
   $104 = $0;
   $105 = ((($104)) + 16|0);
   $106 = HEAP32[$105>>2]|0;
   $107 = ((($106)) + 8|0);
   HEAP32[$107>>2] = 0;
   $108 = $0;
   $109 = ((($108)) + 16|0);
   $110 = HEAP32[$109>>2]|0;
   $111 = ((($110)) + 12|0);
   HEAP32[$111>>2] = 0;
   $112 = $2;
   $113 = ($112<<24>>24)!=(0);
   if (!($113)) {
    STACKTOP = sp;return;
   }
   $i = 0;
   while(1) {
    $114 = $i;
    $115 = $0;
    $116 = ((($115)) + 28|0);
    $117 = HEAP32[$116>>2]|0;
    $118 = HEAP32[$117>>2]|0;
    $119 = ($114>>>0)<($118>>>0);
    if (!($119)) {
     break;
    }
    $120 = $0;
    $121 = ((($120)) + 28|0);
    $122 = HEAP32[$121>>2]|0;
    $123 = $i;
    $124 = (_List_get_at($122,$123)|0);
    $current_child = $124;
    $125 = $1;
    $126 = ($125|0)!=(0|0);
    if ($126) {
     $j = 0;
     while(1) {
      $127 = $j;
      $128 = $1;
      $129 = HEAP32[$128>>2]|0;
      $130 = ($127>>>0)<($129>>>0);
      if (!($130)) {
       break;
      }
      $131 = $1;
      $132 = $j;
      $133 = (_List_get_at($131,$132)|0);
      $temp_rect = $133;
      $134 = $current_child;
      $135 = (_Window_screen_x($134)|0);
      $screen_x = $135;
      $136 = $current_child;
      $137 = (_Window_screen_y($136)|0);
      $screen_y = $137;
      $138 = $temp_rect;
      $139 = ((($138)) + 4|0);
      $140 = HEAP32[$139>>2]|0;
      $141 = $screen_x;
      $142 = $current_child;
      $143 = ((($142)) + 8|0);
      $144 = HEAP16[$143>>1]|0;
      $145 = $144&65535;
      $146 = (($141) + ($145))|0;
      $147 = (($146) - 1)|0;
      $148 = ($140|0)<=($147|0);
      if ($148) {
       $149 = $temp_rect;
       $150 = ((($149)) + 12|0);
       $151 = HEAP32[$150>>2]|0;
       $152 = $screen_x;
       $153 = ($151|0)>=($152|0);
       if ($153) {
        $154 = $temp_rect;
        $155 = HEAP32[$154>>2]|0;
        $156 = $screen_y;
        $157 = $current_child;
        $158 = ((($157)) + 10|0);
        $159 = HEAP16[$158>>1]|0;
        $160 = $159&65535;
        $161 = (($156) + ($160))|0;
        $162 = (($161) - 1)|0;
        $163 = ($155|0)<=($162|0);
        if ($163) {
         $164 = $temp_rect;
         $165 = ((($164)) + 8|0);
         $166 = HEAP32[$165>>2]|0;
         $167 = $screen_y;
         $168 = ($166|0)>=($167|0);
         if ($168) {
          break;
         }
        }
       }
      }
      $169 = $j;
      $170 = (($169) + 1)|0;
      $j = $170;
     }
     $171 = $j;
     $172 = $1;
     $173 = HEAP32[$172>>2]|0;
     $174 = ($171|0)==($173|0);
     if (!($174)) {
      label = 19;
     }
    } else {
     label = 19;
    }
    if ((label|0) == 19) {
     label = 0;
     $175 = $current_child;
     $176 = $1;
     _Window_paint($175,$176,1);
    }
    $177 = $i;
    $178 = (($177) + 1)|0;
    $i = $178;
   }
   STACKTOP = sp;return;
  }
  function _Window_get_windows_below($parent,$child) {
   $parent = $parent|0;
   $child = $child|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $current_window = 0, $i = 0, $return_list = 0;
   var label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $parent;
   $2 = $child;
   $3 = (_List_new()|0);
   $return_list = $3;
   $4 = ($3|0)!=(0|0);
   if (!($4)) {
    $5 = $return_list;
    $0 = $5;
    $96 = $0;
    STACKTOP = sp;return ($96|0);
   }
   $6 = $1;
   $7 = ((($6)) + 28|0);
   $8 = HEAP32[$7>>2]|0;
   $9 = HEAP32[$8>>2]|0;
   $10 = (($9) - 1)|0;
   $i = $10;
   while(1) {
    $11 = $i;
    $12 = ($11|0)>(-1);
    if (!($12)) {
     break;
    }
    $13 = $2;
    $14 = $1;
    $15 = ((($14)) + 28|0);
    $16 = HEAP32[$15>>2]|0;
    $17 = $i;
    $18 = (_List_get_at($16,$17)|0);
    $19 = ($13|0)==($18|0);
    if ($19) {
     break;
    }
    $20 = $i;
    $21 = (($20) + -1)|0;
    $i = $21;
   }
   $22 = $i;
   $23 = (($22) + -1)|0;
   $i = $23;
   while(1) {
    $24 = $i;
    $25 = ($24|0)>(-1);
    if (!($25)) {
     break;
    }
    $26 = $1;
    $27 = ((($26)) + 28|0);
    $28 = HEAP32[$27>>2]|0;
    $29 = $i;
    $30 = (_List_get_at($28,$29)|0);
    $current_window = $30;
    $31 = $current_window;
    $32 = ((($31)) + 4|0);
    $33 = HEAP16[$32>>1]|0;
    $34 = $33 << 16 >> 16;
    $35 = $2;
    $36 = ((($35)) + 4|0);
    $37 = HEAP16[$36>>1]|0;
    $38 = $37 << 16 >> 16;
    $39 = $2;
    $40 = ((($39)) + 8|0);
    $41 = HEAP16[$40>>1]|0;
    $42 = $41&65535;
    $43 = (($38) + ($42))|0;
    $44 = (($43) - 1)|0;
    $45 = ($34|0)<=($44|0);
    if ($45) {
     $46 = $current_window;
     $47 = ((($46)) + 4|0);
     $48 = HEAP16[$47>>1]|0;
     $49 = $48 << 16 >> 16;
     $50 = $current_window;
     $51 = ((($50)) + 8|0);
     $52 = HEAP16[$51>>1]|0;
     $53 = $52&65535;
     $54 = (($49) + ($53))|0;
     $55 = (($54) - 1)|0;
     $56 = $2;
     $57 = ((($56)) + 4|0);
     $58 = HEAP16[$57>>1]|0;
     $59 = $58 << 16 >> 16;
     $60 = ($55|0)>=($59|0);
     if ($60) {
      $61 = $current_window;
      $62 = ((($61)) + 6|0);
      $63 = HEAP16[$62>>1]|0;
      $64 = $63 << 16 >> 16;
      $65 = $2;
      $66 = ((($65)) + 6|0);
      $67 = HEAP16[$66>>1]|0;
      $68 = $67 << 16 >> 16;
      $69 = $2;
      $70 = ((($69)) + 10|0);
      $71 = HEAP16[$70>>1]|0;
      $72 = $71&65535;
      $73 = (($68) + ($72))|0;
      $74 = (($73) - 1)|0;
      $75 = ($64|0)<=($74|0);
      if ($75) {
       $76 = $current_window;
       $77 = ((($76)) + 6|0);
       $78 = HEAP16[$77>>1]|0;
       $79 = $78 << 16 >> 16;
       $80 = $current_window;
       $81 = ((($80)) + 10|0);
       $82 = HEAP16[$81>>1]|0;
       $83 = $82&65535;
       $84 = (($79) + ($83))|0;
       $85 = (($84) - 1)|0;
       $86 = $2;
       $87 = ((($86)) + 6|0);
       $88 = HEAP16[$87>>1]|0;
       $89 = $88 << 16 >> 16;
       $90 = ($85|0)>=($89|0);
       if ($90) {
        $91 = $return_list;
        $92 = $current_window;
        (_List_add($91,$92)|0);
       }
      }
     }
    }
    $93 = $i;
    $94 = (($93) + -1)|0;
    $i = $94;
   }
   $95 = $return_list;
   $0 = $95;
   $96 = $0;
   STACKTOP = sp;return ($96|0);
  }
  function _Window_raise($window,$do_draw) {
   $window = $window|0;
   $do_draw = $do_draw|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $i = 0, $last_active = 0, $parent = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $do_draw;
   $2 = $0;
   $3 = HEAP32[$2>>2]|0;
   $4 = ($3|0)!=(0|0);
   if (!($4)) {
    STACKTOP = sp;return;
   }
   $5 = $0;
   $6 = HEAP32[$5>>2]|0;
   $parent = $6;
   $7 = $parent;
   $8 = ((($7)) + 24|0);
   $9 = HEAP32[$8>>2]|0;
   $10 = $0;
   $11 = ($9|0)==($10|0);
   if ($11) {
    STACKTOP = sp;return;
   }
   $12 = $parent;
   $13 = ((($12)) + 24|0);
   $14 = HEAP32[$13>>2]|0;
   $last_active = $14;
   $i = 0;
   while(1) {
    $15 = $i;
    $16 = $parent;
    $17 = ((($16)) + 28|0);
    $18 = HEAP32[$17>>2]|0;
    $19 = HEAP32[$18>>2]|0;
    $20 = ($15>>>0)<($19>>>0);
    if (!($20)) {
     break;
    }
    $21 = $parent;
    $22 = ((($21)) + 28|0);
    $23 = HEAP32[$22>>2]|0;
    $24 = $i;
    $25 = (_List_get_at($23,$24)|0);
    $26 = $0;
    $27 = ($25|0)==($26|0);
    if ($27) {
     break;
    }
    $28 = $i;
    $29 = (($28) + 1)|0;
    $i = $29;
   }
   $30 = $parent;
   $31 = ((($30)) + 28|0);
   $32 = HEAP32[$31>>2]|0;
   $33 = $i;
   (_List_remove_at($32,$33)|0);
   $34 = $parent;
   $35 = ((($34)) + 28|0);
   $36 = HEAP32[$35>>2]|0;
   $37 = $0;
   (_List_add($36,$37)|0);
   $38 = $0;
   $39 = $parent;
   $40 = ((($39)) + 24|0);
   HEAP32[$40>>2] = $38;
   $41 = $1;
   $42 = ($41<<24>>24)!=(0);
   if (!($42)) {
    STACKTOP = sp;return;
   }
   $43 = $0;
   _Window_paint($43,0,1);
   $44 = $last_active;
   _Window_update_title($44);
   STACKTOP = sp;return;
  }
  function _Window_move($window,$new_x,$new_y) {
   $window = $window|0;
   $new_x = $new_x|0;
   $new_y = $new_y|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $dirty_list = 0, $dirty_windows = 0, $new_window_rect = 0, $old_x = 0, $old_y = 0, $replacement_list = 0;
   var label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $new_window_rect = sp + 16|0;
   $0 = $window;
   $1 = $new_x;
   $2 = $new_y;
   $3 = $0;
   $4 = ((($3)) + 4|0);
   $5 = HEAP16[$4>>1]|0;
   $6 = $5 << 16 >> 16;
   $old_x = $6;
   $7 = $0;
   $8 = ((($7)) + 6|0);
   $9 = HEAP16[$8>>1]|0;
   $10 = $9 << 16 >> 16;
   $old_y = $10;
   $11 = $0;
   _Window_raise($11,0);
   $12 = $0;
   _Window_apply_bound_clipping($12,0,0);
   $13 = $1;
   $14 = $13&65535;
   $15 = $0;
   $16 = ((($15)) + 4|0);
   HEAP16[$16>>1] = $14;
   $17 = $2;
   $18 = $17&65535;
   $19 = $0;
   $20 = ((($19)) + 6|0);
   HEAP16[$20>>1] = $18;
   $21 = $0;
   $22 = (_Window_screen_y($21)|0);
   HEAP32[$new_window_rect>>2] = $22;
   $23 = $0;
   $24 = (_Window_screen_x($23)|0);
   $25 = ((($new_window_rect)) + 4|0);
   HEAP32[$25>>2] = $24;
   $26 = HEAP32[$new_window_rect>>2]|0;
   $27 = $0;
   $28 = ((($27)) + 10|0);
   $29 = HEAP16[$28>>1]|0;
   $30 = $29&65535;
   $31 = (($26) + ($30))|0;
   $32 = (($31) - 1)|0;
   $33 = ((($new_window_rect)) + 8|0);
   HEAP32[$33>>2] = $32;
   $34 = ((($new_window_rect)) + 4|0);
   $35 = HEAP32[$34>>2]|0;
   $36 = $0;
   $37 = ((($36)) + 8|0);
   $38 = HEAP16[$37>>1]|0;
   $39 = $38&65535;
   $40 = (($35) + ($39))|0;
   $41 = (($40) - 1)|0;
   $42 = ((($new_window_rect)) + 12|0);
   HEAP32[$42>>2] = $41;
   $43 = $old_x;
   $44 = $43&65535;
   $45 = $0;
   $46 = ((($45)) + 4|0);
   HEAP16[$46>>1] = $44;
   $47 = $old_y;
   $48 = $47&65535;
   $49 = $0;
   $50 = ((($49)) + 6|0);
   HEAP16[$50>>1] = $48;
   $51 = $0;
   $52 = ((($51)) + 16|0);
   $53 = HEAP32[$52>>2]|0;
   _Context_subtract_clip_rect($53,$new_window_rect);
   $54 = (_List_new()|0);
   $replacement_list = $54;
   $55 = ($54|0)!=(0|0);
   $56 = $0;
   $57 = ((($56)) + 16|0);
   $58 = HEAP32[$57>>2]|0;
   if (!($55)) {
    _Context_clear_clip_rects($58);
    STACKTOP = sp;return;
   }
   $59 = ((($58)) + 16|0);
   $60 = HEAP32[$59>>2]|0;
   $dirty_list = $60;
   $61 = $replacement_list;
   $62 = $0;
   $63 = ((($62)) + 16|0);
   $64 = HEAP32[$63>>2]|0;
   $65 = ((($64)) + 16|0);
   HEAP32[$65>>2] = $61;
   $66 = $0;
   $67 = HEAP32[$66>>2]|0;
   $68 = $0;
   $69 = (_Window_get_windows_below($67,$68)|0);
   $dirty_windows = $69;
   $70 = $1;
   $71 = $70&65535;
   $72 = $0;
   $73 = ((($72)) + 4|0);
   HEAP16[$73>>1] = $71;
   $74 = $2;
   $75 = $74&65535;
   $76 = $0;
   $77 = ((($76)) + 6|0);
   HEAP16[$77>>1] = $75;
   while(1) {
    $78 = $dirty_windows;
    $79 = HEAP32[$78>>2]|0;
    $80 = ($79|0)!=(0);
    if (!($80)) {
     break;
    }
    $81 = $dirty_windows;
    $82 = (_List_remove_at($81,0)|0);
    $83 = $dirty_list;
    _Window_paint($82,$83,1);
   }
   $84 = $0;
   $85 = HEAP32[$84>>2]|0;
   $86 = $dirty_list;
   _Window_paint($85,$86,0);
   while(1) {
    $87 = $dirty_list;
    $88 = HEAP32[$87>>2]|0;
    $89 = ($88|0)!=(0);
    $90 = $dirty_list;
    if (!($89)) {
     break;
    }
    $91 = (_List_remove_at($90,0)|0);
    _free($91);
   }
   _free($90);
   $92 = $dirty_windows;
   _free($92);
   $93 = $0;
   _Window_paint($93,0,1);
   STACKTOP = sp;return;
  }
  function _Window_process_mouse($window,$mouse_x,$mouse_y,$mouse_buttons) {
   $window = $window|0;
   $mouse_x = $mouse_x|0;
   $mouse_y = $mouse_y|0;
   $mouse_buttons = $mouse_buttons|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0;
   var $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0;
   var $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0;
   var $170 = 0, $171 = 0, $172 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0;
   var $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0;
   var $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0;
   var $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0;
   var $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $child = 0, $i = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $mouse_x;
   $2 = $mouse_y;
   $3 = $mouse_buttons;
   $4 = $0;
   $5 = ((($4)) + 28|0);
   $6 = HEAP32[$5>>2]|0;
   $7 = HEAP32[$6>>2]|0;
   $8 = (($7) - 1)|0;
   $i = $8;
   while(1) {
    $9 = $i;
    $10 = ($9|0)>=(0);
    if (!($10)) {
     break;
    }
    $11 = $0;
    $12 = ((($11)) + 28|0);
    $13 = HEAP32[$12>>2]|0;
    $14 = $i;
    $15 = (_List_get_at($13,$14)|0);
    $child = $15;
    $16 = $1;
    $17 = $16&65535;
    $18 = $child;
    $19 = ((($18)) + 4|0);
    $20 = HEAP16[$19>>1]|0;
    $21 = $20 << 16 >> 16;
    $22 = ($17|0)>=($21|0);
    if ($22) {
     $23 = $1;
     $24 = $23&65535;
     $25 = $child;
     $26 = ((($25)) + 4|0);
     $27 = HEAP16[$26>>1]|0;
     $28 = $27 << 16 >> 16;
     $29 = $child;
     $30 = ((($29)) + 8|0);
     $31 = HEAP16[$30>>1]|0;
     $32 = $31&65535;
     $33 = (($28) + ($32))|0;
     $34 = ($24|0)<($33|0);
     if ($34) {
      $35 = $2;
      $36 = $35&65535;
      $37 = $child;
      $38 = ((($37)) + 6|0);
      $39 = HEAP16[$38>>1]|0;
      $40 = $39 << 16 >> 16;
      $41 = ($36|0)>=($40|0);
      if ($41) {
       $42 = $2;
       $43 = $42&65535;
       $44 = $child;
       $45 = ((($44)) + 6|0);
       $46 = HEAP16[$45>>1]|0;
       $47 = $46 << 16 >> 16;
       $48 = $child;
       $49 = ((($48)) + 10|0);
       $50 = HEAP16[$49>>1]|0;
       $51 = $50&65535;
       $52 = (($47) + ($51))|0;
       $53 = ($43|0)<($52|0);
       if ($53) {
        label = 7;
        break;
       }
      }
     }
    }
    $124 = $i;
    $125 = (($124) + -1)|0;
    $i = $125;
   }
   do {
    if ((label|0) == 7) {
     $54 = $3;
     $55 = $54&255;
     $56 = ($55|0)!=(0);
     if ($56) {
      $57 = $0;
      $58 = ((($57)) + 36|0);
      $59 = HEAP8[$58>>0]|0;
      $60 = ($59<<24>>24)!=(0);
      if (!($60)) {
       $61 = $child;
       _Window_raise($61,1);
       $62 = $child;
       $63 = ((($62)) + 12|0);
       $64 = HEAP16[$63>>1]|0;
       $65 = $64&65535;
       $66 = $65 & 1;
       $67 = ($66|0)!=(0);
       if (!($67)) {
        $68 = $2;
        $69 = $68&65535;
        $70 = $child;
        $71 = ((($70)) + 6|0);
        $72 = HEAP16[$71>>1]|0;
        $73 = $72 << 16 >> 16;
        $74 = ($69|0)>=($73|0);
        if ($74) {
         $75 = $2;
         $76 = $75&65535;
         $77 = $child;
         $78 = ((($77)) + 6|0);
         $79 = HEAP16[$78>>1]|0;
         $80 = $79 << 16 >> 16;
         $81 = (($80) + 31)|0;
         $82 = ($76|0)<($81|0);
         if ($82) {
          $83 = $1;
          $84 = $83&65535;
          $85 = $child;
          $86 = ((($85)) + 4|0);
          $87 = HEAP16[$86>>1]|0;
          $88 = $87 << 16 >> 16;
          $89 = (($84) - ($88))|0;
          $90 = $89&65535;
          $91 = $0;
          $92 = ((($91)) + 32|0);
          HEAP16[$92>>1] = $90;
          $93 = $2;
          $94 = $93&65535;
          $95 = $child;
          $96 = ((($95)) + 6|0);
          $97 = HEAP16[$96>>1]|0;
          $98 = $97 << 16 >> 16;
          $99 = (($94) - ($98))|0;
          $100 = $99&65535;
          $101 = $0;
          $102 = ((($101)) + 34|0);
          HEAP16[$102>>1] = $100;
          $103 = $child;
          $104 = $0;
          $105 = ((($104)) + 20|0);
          HEAP32[$105>>2] = $103;
          break;
         }
        }
       }
      }
     }
     $106 = $child;
     $107 = $1;
     $108 = $107&65535;
     $109 = $child;
     $110 = ((($109)) + 4|0);
     $111 = HEAP16[$110>>1]|0;
     $112 = $111 << 16 >> 16;
     $113 = (($108) - ($112))|0;
     $114 = $113&65535;
     $115 = $2;
     $116 = $115&65535;
     $117 = $child;
     $118 = ((($117)) + 6|0);
     $119 = HEAP16[$118>>1]|0;
     $120 = $119 << 16 >> 16;
     $121 = (($116) - ($120))|0;
     $122 = $121&65535;
     $123 = $3;
     _Window_process_mouse($106,$114,$122,$123);
    }
   } while(0);
   $126 = $3;
   $127 = ($126<<24>>24)!=(0);
   if (!($127)) {
    $128 = $0;
    $129 = ((($128)) + 20|0);
    HEAP32[$129>>2] = 0;
   }
   $130 = $0;
   $131 = ((($130)) + 20|0);
   $132 = HEAP32[$131>>2]|0;
   $133 = ($132|0)!=(0|0);
   if ($133) {
    $134 = $0;
    $135 = ((($134)) + 20|0);
    $136 = HEAP32[$135>>2]|0;
    $137 = $1;
    $138 = $137&65535;
    $139 = $0;
    $140 = ((($139)) + 32|0);
    $141 = HEAP16[$140>>1]|0;
    $142 = $141&65535;
    $143 = (($138) - ($142))|0;
    $144 = $2;
    $145 = $144&65535;
    $146 = $0;
    $147 = ((($146)) + 34|0);
    $148 = HEAP16[$147>>1]|0;
    $149 = $148&65535;
    $150 = (($145) - ($149))|0;
    _Window_move($136,$143,$150);
   }
   $151 = $0;
   $152 = ((($151)) + 44|0);
   $153 = HEAP32[$152>>2]|0;
   $154 = ($153|0)!=(0|0);
   if (!($154)) {
    $170 = $3;
    $171 = $0;
    $172 = ((($171)) + 36|0);
    HEAP8[$172>>0] = $170;
    STACKTOP = sp;return;
   }
   $155 = $3;
   $156 = $155&255;
   $157 = ($156|0)!=(0);
   if (!($157)) {
    $170 = $3;
    $171 = $0;
    $172 = ((($171)) + 36|0);
    HEAP8[$172>>0] = $170;
    STACKTOP = sp;return;
   }
   $158 = $0;
   $159 = ((($158)) + 36|0);
   $160 = HEAP8[$159>>0]|0;
   $161 = ($160<<24>>24)!=(0);
   if ($161) {
    $170 = $3;
    $171 = $0;
    $172 = ((($171)) + 36|0);
    HEAP8[$172>>0] = $170;
    STACKTOP = sp;return;
   }
   $162 = $0;
   $163 = ((($162)) + 44|0);
   $164 = HEAP32[$163>>2]|0;
   $165 = $0;
   $166 = $1;
   $167 = $166&65535;
   $168 = $2;
   $169 = $168&65535;
   FUNCTION_TABLE_viii[$164 & 15]($165,$167,$169);
   $170 = $3;
   $171 = $0;
   $172 = ((($171)) + 36|0);
   HEAP8[$172>>0] = $170;
   STACKTOP = sp;return;
  }
  function _Window_update_context($window,$context) {
   $window = $window|0;
   $context = $context|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $i = 0;
   var label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $context;
   $2 = $1;
   $3 = $0;
   $4 = ((($3)) + 16|0);
   HEAP32[$4>>2] = $2;
   $i = 0;
   while(1) {
    $5 = $i;
    $6 = $0;
    $7 = ((($6)) + 28|0);
    $8 = HEAP32[$7>>2]|0;
    $9 = HEAP32[$8>>2]|0;
    $10 = ($5>>>0)<($9>>>0);
    if (!($10)) {
     break;
    }
    $11 = $0;
    $12 = ((($11)) + 28|0);
    $13 = HEAP32[$12>>2]|0;
    $14 = $i;
    $15 = (_List_get_at($13,$14)|0);
    $16 = $1;
    _Window_update_context($15,$16);
    $17 = $i;
    $18 = (($17) + 1)|0;
    $i = $18;
   }
   STACKTOP = sp;return;
  }
  function _Window_insert_child($window,$child) {
   $window = $window|0;
   $child = $child|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $child;
   $2 = $0;
   $3 = $1;
   HEAP32[$3>>2] = $2;
   $4 = $0;
   $5 = ((($4)) + 28|0);
   $6 = HEAP32[$5>>2]|0;
   $7 = $1;
   (_List_add($6,$7)|0);
   $8 = $1;
   $9 = $1;
   $10 = HEAP32[$9>>2]|0;
   $11 = ((($10)) + 24|0);
   HEAP32[$11>>2] = $8;
   $12 = $1;
   $13 = $0;
   $14 = ((($13)) + 16|0);
   $15 = HEAP32[$14>>2]|0;
   _Window_update_context($12,$15);
   STACKTOP = sp;return;
  }
  function _Window_set_title($window,$new_title) {
   $window = $window|0;
   $new_title = $new_title|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $7 = 0, $8 = 0;
   var $9 = 0, $i = 0, $len = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $new_title;
   $2 = $0;
   $3 = ((($2)) + 48|0);
   $4 = HEAP32[$3>>2]|0;
   $5 = ($4|0)!=(0|0);
   if ($5) {
    $len = 0;
    while(1) {
     $6 = $len;
     $7 = $0;
     $8 = ((($7)) + 48|0);
     $9 = HEAP32[$8>>2]|0;
     $10 = (($9) + ($6)|0);
     $11 = HEAP8[$10>>0]|0;
     $12 = ($11<<24>>24)!=(0);
     if (!($12)) {
      break;
     }
     $13 = $len;
     $14 = (($13) + 1)|0;
     $len = $14;
    }
    $15 = $0;
    $16 = ((($15)) + 48|0);
    $17 = HEAP32[$16>>2]|0;
    _free($17);
   }
   $len = 0;
   while(1) {
    $18 = $len;
    $19 = $1;
    $20 = (($19) + ($18)|0);
    $21 = HEAP8[$20>>0]|0;
    $22 = ($21<<24>>24)!=(0);
    $23 = $len;
    $24 = (($23) + 1)|0;
    if (!($22)) {
     break;
    }
    $len = $24;
   }
   $25 = $24;
   $26 = (_malloc($25)|0);
   $27 = $0;
   $28 = ((($27)) + 48|0);
   HEAP32[$28>>2] = $26;
   $29 = ($26|0)!=(0|0);
   if (!($29)) {
    STACKTOP = sp;return;
   }
   $i = 0;
   while(1) {
    $30 = $i;
    $31 = $len;
    $32 = ($30|0)<=($31|0);
    if (!($32)) {
     break;
    }
    $33 = $i;
    $34 = $1;
    $35 = (($34) + ($33)|0);
    $36 = HEAP8[$35>>0]|0;
    $37 = $i;
    $38 = $0;
    $39 = ((($38)) + 48|0);
    $40 = HEAP32[$39>>2]|0;
    $41 = (($40) + ($37)|0);
    HEAP8[$41>>0] = $36;
    $42 = $i;
    $43 = (($42) + 1)|0;
    $i = $43;
   }
   $44 = $0;
   $45 = ((($44)) + 12|0);
   $46 = HEAP16[$45>>1]|0;
   $47 = $46&65535;
   $48 = $47 & 1;
   $49 = ($48|0)!=(0);
   $50 = $0;
   if ($49) {
    $51 = $0;
    $52 = ((($51)) + 10|0);
    $53 = HEAP16[$52>>1]|0;
    $54 = $53&65535;
    $55 = (($54) - 1)|0;
    $56 = $0;
    $57 = ((($56)) + 8|0);
    $58 = HEAP16[$57>>1]|0;
    $59 = $58&65535;
    $60 = (($59) - 1)|0;
    _Window_invalidate($50,0,0,$55,$60);
    STACKTOP = sp;return;
   } else {
    _Window_update_title($50);
    STACKTOP = sp;return;
   }
  }
  function _Window_append_title($window,$additional_chars) {
   $window = $window|0;
   $additional_chars = $additional_chars|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
   var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
   var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
   var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $additional_length = 0, $i = 0, $new_string = 0, $original_length = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $window;
   $1 = $additional_chars;
   $2 = $0;
   $3 = ((($2)) + 48|0);
   $4 = HEAP32[$3>>2]|0;
   $5 = ($4|0)!=(0|0);
   if (!($5)) {
    $6 = $0;
    $7 = $1;
    _Window_set_title($6,$7);
    STACKTOP = sp;return;
   }
   $original_length = 0;
   while(1) {
    $8 = $original_length;
    $9 = $0;
    $10 = ((($9)) + 48|0);
    $11 = HEAP32[$10>>2]|0;
    $12 = (($11) + ($8)|0);
    $13 = HEAP8[$12>>0]|0;
    $14 = ($13<<24>>24)!=(0);
    if (!($14)) {
     break;
    }
    $15 = $original_length;
    $16 = (($15) + 1)|0;
    $original_length = $16;
   }
   $additional_length = 0;
   while(1) {
    $17 = $additional_length;
    $18 = $1;
    $19 = (($18) + ($17)|0);
    $20 = HEAP8[$19>>0]|0;
    $21 = ($20<<24>>24)!=(0);
    if (!($21)) {
     break;
    }
    $22 = $additional_length;
    $23 = (($22) + 1)|0;
    $additional_length = $23;
   }
   $24 = $original_length;
   $25 = $additional_length;
   $26 = (($24) + ($25))|0;
   $27 = (($26) + 1)|0;
   $28 = $27;
   $29 = (_malloc($28)|0);
   $new_string = $29;
   $30 = ($29|0)!=(0|0);
   if (!($30)) {
    STACKTOP = sp;return;
   }
   $i = 0;
   while(1) {
    $31 = $i;
    $32 = $0;
    $33 = ((($32)) + 48|0);
    $34 = HEAP32[$33>>2]|0;
    $35 = (($34) + ($31)|0);
    $36 = HEAP8[$35>>0]|0;
    $37 = ($36<<24>>24)!=(0);
    if (!($37)) {
     break;
    }
    $38 = $i;
    $39 = $0;
    $40 = ((($39)) + 48|0);
    $41 = HEAP32[$40>>2]|0;
    $42 = (($41) + ($38)|0);
    $43 = HEAP8[$42>>0]|0;
    $44 = $i;
    $45 = $new_string;
    $46 = (($45) + ($44)|0);
    HEAP8[$46>>0] = $43;
    $47 = $i;
    $48 = (($47) + 1)|0;
    $i = $48;
   }
   $i = 0;
   while(1) {
    $49 = $i;
    $50 = $1;
    $51 = (($50) + ($49)|0);
    $52 = HEAP8[$51>>0]|0;
    $53 = ($52<<24>>24)!=(0);
    if (!($53)) {
     break;
    }
    $54 = $i;
    $55 = $1;
    $56 = (($55) + ($54)|0);
    $57 = HEAP8[$56>>0]|0;
    $58 = $original_length;
    $59 = $i;
    $60 = (($58) + ($59))|0;
    $61 = $new_string;
    $62 = (($61) + ($60)|0);
    HEAP8[$62>>0] = $57;
    $63 = $i;
    $64 = (($63) + 1)|0;
    $i = $64;
   }
   $65 = $original_length;
   $66 = $i;
   $67 = (($65) + ($66))|0;
   $68 = $new_string;
   $69 = (($68) + ($67)|0);
   HEAP8[$69>>0] = 0;
   $70 = $0;
   $71 = ((($70)) + 48|0);
   $72 = HEAP32[$71>>2]|0;
   _free($72);
   $73 = $new_string;
   $74 = $0;
   $75 = ((($74)) + 48|0);
   HEAP32[$75>>2] = $73;
   $76 = $0;
   $77 = ((($76)) + 12|0);
   $78 = HEAP16[$77>>1]|0;
   $79 = $78&65535;
   $80 = $79 & 1;
   $81 = ($80|0)!=(0);
   $82 = $0;
   if ($81) {
    $83 = $0;
    $84 = ((($83)) + 10|0);
    $85 = HEAP16[$84>>1]|0;
    $86 = $85&65535;
    $87 = (($86) - 1)|0;
    $88 = $0;
    $89 = ((($88)) + 8|0);
    $90 = HEAP16[$89>>1]|0;
    $91 = $90&65535;
    $92 = (($91) - 1)|0;
    _Window_invalidate($82,0,0,$87,$92);
    STACKTOP = sp;return;
   } else {
    _Window_update_title($82);
    STACKTOP = sp;return;
   }
  }
  function _Desktop_new($context) {
   $context = $context|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
   var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
   var $desktop = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $context;
   $2 = (_malloc(56)|0);
   $desktop = $2;
   $3 = ($2|0)!=(0|0);
   $4 = $desktop;
   if (!($3)) {
    $0 = $4;
    $39 = $0;
    STACKTOP = sp;return ($39|0);
   }
   $5 = $1;
   $6 = ((($5)) + 4|0);
   $7 = HEAP16[$6>>1]|0;
   $8 = $1;
   $9 = ((($8)) + 6|0);
   $10 = HEAP16[$9>>1]|0;
   $11 = $1;
   $12 = (_Window_init($4,0,0,$7,$10,1,$11)|0);
   $13 = ($12|0)!=(0);
   $14 = $desktop;
   if ($13) {
    $15 = ((($14)) + 40|0);
    HEAP32[$15>>2] = 7;
    $16 = $desktop;
    $17 = ((($16)) + 36|0);
    HEAP8[$17>>0] = 0;
    $18 = $desktop;
    $19 = ((($18)) + 16|0);
    $20 = HEAP32[$19>>2]|0;
    $21 = ((($20)) + 4|0);
    $22 = HEAP16[$21>>1]|0;
    $23 = $22&65535;
    $24 = (($23|0) / 2)&-1;
    $25 = $24&65535;
    $26 = $desktop;
    $27 = ((($26)) + 52|0);
    HEAP16[$27>>1] = $25;
    $28 = $desktop;
    $29 = ((($28)) + 16|0);
    $30 = HEAP32[$29>>2]|0;
    $31 = ((($30)) + 6|0);
    $32 = HEAP16[$31>>1]|0;
    $33 = $32&65535;
    $34 = (($33|0) / 2)&-1;
    $35 = $34&65535;
    $36 = $desktop;
    $37 = ((($36)) + 54|0);
    HEAP16[$37>>1] = $35;
    $38 = $desktop;
    $0 = $38;
    $39 = $0;
    STACKTOP = sp;return ($39|0);
   } else {
    _free($14);
    $0 = 0;
    $39 = $0;
    STACKTOP = sp;return ($39|0);
   }
   return (0)|0;
  }
  function _Desktop_paint_handler($desktop_window) {
   $desktop_window = $desktop_window|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0;
   var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $desktop_window;
   $1 = $0;
   $2 = ((($1)) + 16|0);
   $3 = HEAP32[$2>>2]|0;
   $4 = $0;
   $5 = ((($4)) + 16|0);
   $6 = HEAP32[$5>>2]|0;
   $7 = ((($6)) + 4|0);
   $8 = HEAP16[$7>>1]|0;
   $9 = $8&65535;
   $10 = $0;
   $11 = ((($10)) + 16|0);
   $12 = HEAP32[$11>>2]|0;
   $13 = ((($12)) + 6|0);
   $14 = HEAP16[$13>>1]|0;
   $15 = $14&65535;
   _Context_fill_rect($3,0,0,$9,$15,-26317);
   $16 = $0;
   $17 = ((($16)) + 16|0);
   $18 = HEAP32[$17>>2]|0;
   $19 = $0;
   $20 = ((($19)) + 10|0);
   $21 = HEAP16[$20>>1]|0;
   $22 = $21&65535;
   $23 = (($22) - 12)|0;
   _Context_draw_text($18,4088,0,$23,-1);
   STACKTOP = sp;return;
  }
  function _Desktop_process_mouse($desktop,$mouse_x,$mouse_y,$mouse_buttons) {
   $desktop = $desktop|0;
   $mouse_x = $mouse_x|0;
   $mouse_y = $mouse_y|0;
   $mouse_buttons = $mouse_buttons|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0;
   var $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0;
   var $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0;
   var $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0;
   var $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0;
   var $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $dirty_list = 0, $mouse_rect = 0, $x = 0, $y = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $desktop;
   $1 = $mouse_x;
   $2 = $mouse_y;
   $3 = $mouse_buttons;
   $4 = $0;
   $5 = $1;
   $6 = $2;
   $7 = $3;
   _Window_process_mouse($4,$5,$6,$7);
   $8 = (_List_new()|0);
   $dirty_list = $8;
   $9 = ($8|0)!=(0|0);
   if (!($9)) {
    STACKTOP = sp;return;
   }
   $10 = $0;
   $11 = ((($10)) + 54|0);
   $12 = HEAP16[$11>>1]|0;
   $13 = $12&65535;
   $14 = $0;
   $15 = ((($14)) + 52|0);
   $16 = HEAP16[$15>>1]|0;
   $17 = $16&65535;
   $18 = $0;
   $19 = ((($18)) + 54|0);
   $20 = HEAP16[$19>>1]|0;
   $21 = $20&65535;
   $22 = (($21) + 18)|0;
   $23 = (($22) - 1)|0;
   $24 = $0;
   $25 = ((($24)) + 52|0);
   $26 = HEAP16[$25>>1]|0;
   $27 = $26&65535;
   $28 = (($27) + 11)|0;
   $29 = (($28) - 1)|0;
   $30 = (_Rect_new($13,$17,$23,$29)|0);
   $mouse_rect = $30;
   $31 = ($30|0)!=(0|0);
   $32 = $dirty_list;
   if (!($31)) {
    _free($32);
    STACKTOP = sp;return;
   }
   $33 = $mouse_rect;
   (_List_add($32,$33)|0);
   $34 = $0;
   $35 = $dirty_list;
   _Window_paint($34,$35,1);
   $36 = $dirty_list;
   (_List_remove_at($36,0)|0);
   $37 = $dirty_list;
   _free($37);
   $38 = $mouse_rect;
   _free($38);
   $39 = $1;
   $40 = $0;
   $41 = ((($40)) + 52|0);
   HEAP16[$41>>1] = $39;
   $42 = $2;
   $43 = $0;
   $44 = ((($43)) + 54|0);
   HEAP16[$44>>1] = $42;
   $y = 0;
   while(1) {
    $45 = $y;
    $46 = ($45|0)<(18);
    if (!($46)) {
     label = 14;
     break;
    }
    $47 = $y;
    $48 = $2;
    $49 = $48&65535;
    $50 = (($47) + ($49))|0;
    $51 = $0;
    $52 = ((($51)) + 16|0);
    $53 = HEAP32[$52>>2]|0;
    $54 = ((($53)) + 6|0);
    $55 = HEAP16[$54>>1]|0;
    $56 = $55&65535;
    $57 = ($50|0)>=($56|0);
    if ($57) {
     label = 14;
     break;
    }
    $x = 0;
    while(1) {
     $58 = $x;
     $59 = ($58|0)<(11);
     if (!($59)) {
      break;
     }
     $60 = $x;
     $61 = $1;
     $62 = $61&65535;
     $63 = (($60) + ($62))|0;
     $64 = $0;
     $65 = ((($64)) + 16|0);
     $66 = HEAP32[$65>>2]|0;
     $67 = ((($66)) + 4|0);
     $68 = HEAP16[$67>>1]|0;
     $69 = $68&65535;
     $70 = ($63|0)>=($69|0);
     if ($70) {
      break;
     }
     $71 = $y;
     $72 = ($71*11)|0;
     $73 = $x;
     $74 = (($72) + ($73))|0;
     $75 = (12 + ($74<<2)|0);
     $76 = HEAP32[$75>>2]|0;
     $77 = $76 & -16777216;
     $78 = ($77|0)!=(0);
     if ($78) {
      $79 = $y;
      $80 = ($79*11)|0;
      $81 = $x;
      $82 = (($80) + ($81))|0;
      $83 = (12 + ($82<<2)|0);
      $84 = HEAP32[$83>>2]|0;
      $85 = $y;
      $86 = $2;
      $87 = $86&65535;
      $88 = (($85) + ($87))|0;
      $89 = $0;
      $90 = ((($89)) + 16|0);
      $91 = HEAP32[$90>>2]|0;
      $92 = ((($91)) + 4|0);
      $93 = HEAP16[$92>>1]|0;
      $94 = $93&65535;
      $95 = Math_imul($88, $94)|0;
      $96 = $x;
      $97 = $1;
      $98 = $97&65535;
      $99 = (($96) + ($98))|0;
      $100 = (($95) + ($99))|0;
      $101 = $0;
      $102 = ((($101)) + 16|0);
      $103 = HEAP32[$102>>2]|0;
      $104 = HEAP32[$103>>2]|0;
      $105 = (($104) + ($100<<2)|0);
      HEAP32[$105>>2] = $84;
     }
     $106 = $x;
     $107 = (($106) + 1)|0;
     $x = $107;
    }
    $108 = $y;
    $109 = (($108) + 1)|0;
    $y = $109;
   }
   if ((label|0) == 14) {
    STACKTOP = sp;return;
   }
  }
  function _main_mouse_callback($mouse_x,$mouse_y,$buttons) {
   $mouse_x = $mouse_x|0;
   $mouse_y = $mouse_y|0;
   $buttons = $buttons|0;
   var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $mouse_x;
   $1 = $mouse_y;
   $2 = $buttons;
   $3 = HEAP32[804>>2]|0;
   $4 = $0;
   $5 = $1;
   $6 = $2;
   _Desktop_process_mouse($3,$4,$5,$6);
   STACKTOP = sp;return;
  }
  function _spawn_calculator($button,$x,$y) {
   $button = $button|0;
   $x = $x|0;
   $y = $y|0;
   var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $temp_calc = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = $button;
   $1 = $x;
   $2 = $y;
   $3 = (_Calculator_new()|0);
   $temp_calc = $3;
   $4 = HEAP32[804>>2]|0;
   $5 = $temp_calc;
   _Window_insert_child($4,$5);
   $6 = $temp_calc;
   _Window_move($6,0,0);
   STACKTOP = sp;return;
  }
  function _main($argc,$argv) {
   $argc = $argc|0;
   $argv = $argv|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $context = 0;
   var $launch_button = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $0 = 0;
   $1 = $argc;
   $2 = $argv;
   $3 = (_Context_new(0,0,0)|0);
   $context = $3;
   $4 = $context;
   $5 = ((($4)) + 4|0);
   $6 = $context;
   $7 = ((($6)) + 6|0);
   $8 = (_fake_os_getActiveVesaBuffer($5,$7)|0);
   $9 = $context;
   HEAP32[$9>>2] = $8;
   $10 = $context;
   $11 = (_Desktop_new($10)|0);
   HEAP32[804>>2] = $11;
   $12 = (_Button_new(10,10,150,30)|0);
   $launch_button = $12;
   $13 = $launch_button;
   _Window_set_title($13,4117);
   $14 = $launch_button;
   $15 = ((($14)) + 56|0);
   HEAP32[$15>>2] = 8;
   $16 = HEAP32[804>>2]|0;
   $17 = $launch_button;
   _Window_insert_child($16,$17);
   $18 = HEAP32[804>>2]|0;
   _Window_paint($18,0,1);
   _fake_os_installMouseCallback(9);
   STACKTOP = sp;return 0;
  }
  function _Rect_new($top,$left,$bottom,$right) {
   $top = $top|0;
   $left = $left|0;
   $bottom = $bottom|0;
   $right = $right|0;
   var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
   var $9 = 0, $rect = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $top;
   $2 = $left;
   $3 = $bottom;
   $4 = $right;
   $5 = (_malloc(16)|0);
   $rect = $5;
   $6 = ($5|0)!=(0|0);
   if ($6) {
    $8 = $1;
    $9 = $rect;
    HEAP32[$9>>2] = $8;
    $10 = $2;
    $11 = $rect;
    $12 = ((($11)) + 4|0);
    HEAP32[$12>>2] = $10;
    $13 = $3;
    $14 = $rect;
    $15 = ((($14)) + 8|0);
    HEAP32[$15>>2] = $13;
    $16 = $4;
    $17 = $rect;
    $18 = ((($17)) + 12|0);
    HEAP32[$18>>2] = $16;
    $19 = $rect;
    $0 = $19;
    $20 = $0;
    STACKTOP = sp;return ($20|0);
   } else {
    $7 = $rect;
    $0 = $7;
    $20 = $0;
    STACKTOP = sp;return ($20|0);
   }
   return (0)|0;
  }
  function _Rect_split($subject_rect,$cutting_rect) {
   $subject_rect = $subject_rect|0;
   $cutting_rect = $cutting_rect|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
   var $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0;
   var $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0;
   var $152 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0;
   var $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0;
   var $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0;
   var $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0;
   var $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $output_rects = 0, $subject_copy = 0, $temp_rect = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $subject_copy = sp + 8|0;
   $1 = $subject_rect;
   $2 = $cutting_rect;
   $3 = (_List_new()|0);
   $output_rects = $3;
   $4 = ($3|0)!=(0|0);
   if (!($4)) {
    $5 = $output_rects;
    $0 = $5;
    $152 = $0;
    STACKTOP = sp;return ($152|0);
   }
   $6 = $1;
   $7 = HEAP32[$6>>2]|0;
   HEAP32[$subject_copy>>2] = $7;
   $8 = $1;
   $9 = ((($8)) + 4|0);
   $10 = HEAP32[$9>>2]|0;
   $11 = ((($subject_copy)) + 4|0);
   HEAP32[$11>>2] = $10;
   $12 = $1;
   $13 = ((($12)) + 8|0);
   $14 = HEAP32[$13>>2]|0;
   $15 = ((($subject_copy)) + 8|0);
   HEAP32[$15>>2] = $14;
   $16 = $1;
   $17 = ((($16)) + 12|0);
   $18 = HEAP32[$17>>2]|0;
   $19 = ((($subject_copy)) + 12|0);
   HEAP32[$19>>2] = $18;
   $20 = $2;
   $21 = ((($20)) + 4|0);
   $22 = HEAP32[$21>>2]|0;
   $23 = ((($subject_copy)) + 4|0);
   $24 = HEAP32[$23>>2]|0;
   $25 = ($22|0)>($24|0);
   do {
    if ($25) {
     $26 = $2;
     $27 = ((($26)) + 4|0);
     $28 = HEAP32[$27>>2]|0;
     $29 = ((($subject_copy)) + 12|0);
     $30 = HEAP32[$29>>2]|0;
     $31 = ($28|0)<=($30|0);
     if ($31) {
      $32 = HEAP32[$subject_copy>>2]|0;
      $33 = ((($subject_copy)) + 4|0);
      $34 = HEAP32[$33>>2]|0;
      $35 = ((($subject_copy)) + 8|0);
      $36 = HEAP32[$35>>2]|0;
      $37 = $2;
      $38 = ((($37)) + 4|0);
      $39 = HEAP32[$38>>2]|0;
      $40 = (($39) - 1)|0;
      $41 = (_Rect_new($32,$34,$36,$40)|0);
      $temp_rect = $41;
      $42 = ($41|0)!=(0|0);
      $43 = $output_rects;
      if ($42) {
       $44 = $temp_rect;
       (_List_add($43,$44)|0);
       $45 = $2;
       $46 = ((($45)) + 4|0);
       $47 = HEAP32[$46>>2]|0;
       $48 = ((($subject_copy)) + 4|0);
       HEAP32[$48>>2] = $47;
       break;
      }
      _free($43);
      $0 = 0;
      $152 = $0;
      STACKTOP = sp;return ($152|0);
     }
    }
   } while(0);
   $49 = $2;
   $50 = HEAP32[$49>>2]|0;
   $51 = HEAP32[$subject_copy>>2]|0;
   $52 = ($50|0)>($51|0);
   do {
    if ($52) {
     $53 = $2;
     $54 = HEAP32[$53>>2]|0;
     $55 = ((($subject_copy)) + 8|0);
     $56 = HEAP32[$55>>2]|0;
     $57 = ($54|0)<=($56|0);
     if ($57) {
      $58 = HEAP32[$subject_copy>>2]|0;
      $59 = ((($subject_copy)) + 4|0);
      $60 = HEAP32[$59>>2]|0;
      $61 = $2;
      $62 = HEAP32[$61>>2]|0;
      $63 = (($62) - 1)|0;
      $64 = ((($subject_copy)) + 12|0);
      $65 = HEAP32[$64>>2]|0;
      $66 = (_Rect_new($58,$60,$63,$65)|0);
      $temp_rect = $66;
      $67 = ($66|0)!=(0|0);
      if ($67) {
       $75 = $output_rects;
       $76 = $temp_rect;
       (_List_add($75,$76)|0);
       $77 = $2;
       $78 = HEAP32[$77>>2]|0;
       HEAP32[$subject_copy>>2] = $78;
       break;
      }
      while(1) {
       $68 = $output_rects;
       $69 = HEAP32[$68>>2]|0;
       $70 = ($69|0)!=(0);
       if (!($70)) {
        break;
       }
       $71 = $temp_rect;
       _free($71);
       $72 = $output_rects;
       $73 = (_List_remove_at($72,0)|0);
       $temp_rect = $73;
      }
      $74 = $output_rects;
      _free($74);
      $0 = 0;
      $152 = $0;
      STACKTOP = sp;return ($152|0);
     }
    }
   } while(0);
   $79 = $2;
   $80 = ((($79)) + 12|0);
   $81 = HEAP32[$80>>2]|0;
   $82 = ((($subject_copy)) + 4|0);
   $83 = HEAP32[$82>>2]|0;
   $84 = ($81|0)>=($83|0);
   do {
    if ($84) {
     $85 = $2;
     $86 = ((($85)) + 12|0);
     $87 = HEAP32[$86>>2]|0;
     $88 = ((($subject_copy)) + 12|0);
     $89 = HEAP32[$88>>2]|0;
     $90 = ($87|0)<($89|0);
     if ($90) {
      $91 = HEAP32[$subject_copy>>2]|0;
      $92 = $2;
      $93 = ((($92)) + 12|0);
      $94 = HEAP32[$93>>2]|0;
      $95 = (($94) + 1)|0;
      $96 = ((($subject_copy)) + 8|0);
      $97 = HEAP32[$96>>2]|0;
      $98 = ((($subject_copy)) + 12|0);
      $99 = HEAP32[$98>>2]|0;
      $100 = (_Rect_new($91,$95,$97,$99)|0);
      $temp_rect = $100;
      $101 = ($100|0)!=(0|0);
      if ($101) {
       $109 = $output_rects;
       $110 = $temp_rect;
       (_List_add($109,$110)|0);
       $111 = $2;
       $112 = ((($111)) + 12|0);
       $113 = HEAP32[$112>>2]|0;
       $114 = ((($subject_copy)) + 12|0);
       HEAP32[$114>>2] = $113;
       break;
      }
      while(1) {
       $102 = $output_rects;
       $103 = HEAP32[$102>>2]|0;
       $104 = ($103|0)!=(0);
       if (!($104)) {
        break;
       }
       $105 = $temp_rect;
       _free($105);
       $106 = $output_rects;
       $107 = (_List_remove_at($106,0)|0);
       $temp_rect = $107;
      }
      $108 = $output_rects;
      _free($108);
      $0 = 0;
      $152 = $0;
      STACKTOP = sp;return ($152|0);
     }
    }
   } while(0);
   $115 = $2;
   $116 = ((($115)) + 8|0);
   $117 = HEAP32[$116>>2]|0;
   $118 = HEAP32[$subject_copy>>2]|0;
   $119 = ($117|0)>=($118|0);
   do {
    if ($119) {
     $120 = $2;
     $121 = ((($120)) + 8|0);
     $122 = HEAP32[$121>>2]|0;
     $123 = ((($subject_copy)) + 8|0);
     $124 = HEAP32[$123>>2]|0;
     $125 = ($122|0)<($124|0);
     if ($125) {
      $126 = $2;
      $127 = ((($126)) + 8|0);
      $128 = HEAP32[$127>>2]|0;
      $129 = (($128) + 1)|0;
      $130 = ((($subject_copy)) + 4|0);
      $131 = HEAP32[$130>>2]|0;
      $132 = ((($subject_copy)) + 8|0);
      $133 = HEAP32[$132>>2]|0;
      $134 = ((($subject_copy)) + 12|0);
      $135 = HEAP32[$134>>2]|0;
      $136 = (_Rect_new($129,$131,$133,$135)|0);
      $temp_rect = $136;
      $137 = ($136|0)!=(0|0);
      if ($137) {
       $145 = $output_rects;
       $146 = $temp_rect;
       (_List_add($145,$146)|0);
       $147 = $2;
       $148 = ((($147)) + 8|0);
       $149 = HEAP32[$148>>2]|0;
       $150 = ((($subject_copy)) + 8|0);
       HEAP32[$150>>2] = $149;
       break;
      }
      while(1) {
       $138 = $output_rects;
       $139 = HEAP32[$138>>2]|0;
       $140 = ($139|0)!=(0);
       if (!($140)) {
        break;
       }
       $141 = $temp_rect;
       _free($141);
       $142 = $output_rects;
       $143 = (_List_remove_at($142,0)|0);
       $temp_rect = $143;
      }
      $144 = $output_rects;
      _free($144);
      $0 = 0;
      $152 = $0;
      STACKTOP = sp;return ($152|0);
     }
    }
   } while(0);
   $151 = $output_rects;
   $0 = $151;
   $152 = $0;
   STACKTOP = sp;return ($152|0);
  }
  function _Rect_intersect($rect_a,$rect_b) {
   $rect_a = $rect_a|0;
   $rect_b = $rect_b|0;
   var $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $12 = 0, $13 = 0;
   var $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0;
   var $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0;
   var $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0;
   var $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0;
   var $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $result_rect = 0, label = 0, sp = 0;
   sp = STACKTOP;
   STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
   $1 = $rect_a;
   $2 = $rect_b;
   $3 = $1;
   $4 = ((($3)) + 4|0);
   $5 = HEAP32[$4>>2]|0;
   $6 = $2;
   $7 = ((($6)) + 12|0);
   $8 = HEAP32[$7>>2]|0;
   $9 = ($5|0)<=($8|0);
   if ($9) {
    $10 = $1;
    $11 = ((($10)) + 12|0);
    $12 = HEAP32[$11>>2]|0;
    $13 = $2;
    $14 = ((($13)) + 4|0);
    $15 = HEAP32[$14>>2]|0;
    $16 = ($12|0)>=($15|0);
    if ($16) {
     $17 = $1;
     $18 = HEAP32[$17>>2]|0;
     $19 = $2;
     $20 = ((($19)) + 8|0);
     $21 = HEAP32[$20>>2]|0;
     $22 = ($18|0)<=($21|0);
     if ($22) {
      $23 = $1;
      $24 = ((($23)) + 8|0);
      $25 = HEAP32[$24>>2]|0;
      $26 = $2;
      $27 = HEAP32[$26>>2]|0;
      $28 = ($25|0)>=($27|0);
      if ($28) {
       $29 = $1;
       $30 = HEAP32[$29>>2]|0;
       $31 = $1;
       $32 = ((($31)) + 4|0);
       $33 = HEAP32[$32>>2]|0;
       $34 = $1;
       $35 = ((($34)) + 8|0);
       $36 = HEAP32[$35>>2]|0;
       $37 = $1;
       $38 = ((($37)) + 12|0);
       $39 = HEAP32[$38>>2]|0;
       $40 = (_Rect_new($30,$33,$36,$39)|0);
       $result_rect = $40;
       $41 = ($40|0)!=(0|0);
       if (!($41)) {
        $0 = 0;
        $113 = $0;
        STACKTOP = sp;return ($113|0);
       }
       $42 = $2;
       $43 = ((($42)) + 4|0);
       $44 = HEAP32[$43>>2]|0;
       $45 = $result_rect;
       $46 = ((($45)) + 4|0);
       $47 = HEAP32[$46>>2]|0;
       $48 = ($44|0)>($47|0);
       if ($48) {
        $49 = $2;
        $50 = ((($49)) + 4|0);
        $51 = HEAP32[$50>>2]|0;
        $52 = $result_rect;
        $53 = ((($52)) + 12|0);
        $54 = HEAP32[$53>>2]|0;
        $55 = ($51|0)<=($54|0);
        if ($55) {
         $56 = $2;
         $57 = ((($56)) + 4|0);
         $58 = HEAP32[$57>>2]|0;
         $59 = $result_rect;
         $60 = ((($59)) + 4|0);
         HEAP32[$60>>2] = $58;
        }
       }
       $61 = $2;
       $62 = HEAP32[$61>>2]|0;
       $63 = $result_rect;
       $64 = HEAP32[$63>>2]|0;
       $65 = ($62|0)>($64|0);
       if ($65) {
        $66 = $2;
        $67 = HEAP32[$66>>2]|0;
        $68 = $result_rect;
        $69 = ((($68)) + 8|0);
        $70 = HEAP32[$69>>2]|0;
        $71 = ($67|0)<=($70|0);
        if ($71) {
         $72 = $2;
         $73 = HEAP32[$72>>2]|0;
         $74 = $result_rect;
         HEAP32[$74>>2] = $73;
        }
       }
       $75 = $2;
       $76 = ((($75)) + 12|0);
       $77 = HEAP32[$76>>2]|0;
       $78 = $result_rect;
       $79 = ((($78)) + 4|0);
       $80 = HEAP32[$79>>2]|0;
       $81 = ($77|0)>=($80|0);
       if ($81) {
        $82 = $2;
        $83 = ((($82)) + 12|0);
        $84 = HEAP32[$83>>2]|0;
        $85 = $result_rect;
        $86 = ((($85)) + 12|0);
        $87 = HEAP32[$86>>2]|0;
        $88 = ($84|0)<($87|0);
        if ($88) {
         $89 = $2;
         $90 = ((($89)) + 12|0);
         $91 = HEAP32[$90>>2]|0;
         $92 = $result_rect;
         $93 = ((($92)) + 12|0);
         HEAP32[$93>>2] = $91;
        }
       }
       $94 = $2;
       $95 = ((($94)) + 8|0);
       $96 = HEAP32[$95>>2]|0;
       $97 = $result_rect;
       $98 = HEAP32[$97>>2]|0;
       $99 = ($96|0)>=($98|0);
       if ($99) {
        $100 = $2;
        $101 = ((($100)) + 8|0);
        $102 = HEAP32[$101>>2]|0;
        $103 = $result_rect;
        $104 = ((($103)) + 8|0);
        $105 = HEAP32[$104>>2]|0;
        $106 = ($102|0)<($105|0);
        if ($106) {
         $107 = $2;
         $108 = ((($107)) + 8|0);
         $109 = HEAP32[$108>>2]|0;
         $110 = $result_rect;
         $111 = ((($110)) + 8|0);
         HEAP32[$111>>2] = $109;
        }
       }
       $112 = $result_rect;
       $0 = $112;
       $113 = $0;
       STACKTOP = sp;return ($113|0);
      }
     }
    }
   }
   $0 = 0;
   $113 = $0;
   STACKTOP = sp;return ($113|0);
  }
  function ___errno_location() {
   var $$0 = 0, $0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
   sp = STACKTOP;
   $0 = (0|0)==(0|0);
   if ($0) {
    $$0 = 808;
   } else {
    $1 = (_pthread_self()|0);
    $2 = ((($1)) + 60|0);
    $3 = HEAP32[$2>>2]|0;
    $$0 = $3;
   }
   return ($$0|0);
  }
  function _malloc($bytes) {
   $bytes = $bytes|0;
   var $$3$i = 0, $$lcssa = 0, $$lcssa211 = 0, $$lcssa215 = 0, $$lcssa216 = 0, $$lcssa217 = 0, $$lcssa219 = 0, $$lcssa222 = 0, $$lcssa224 = 0, $$lcssa226 = 0, $$lcssa228 = 0, $$lcssa230 = 0, $$lcssa232 = 0, $$pre = 0, $$pre$i = 0, $$pre$i$i = 0, $$pre$i22$i = 0, $$pre$i25 = 0, $$pre$phi$i$iZ2D = 0, $$pre$phi$i23$iZ2D = 0;
   var $$pre$phi$i26Z2D = 0, $$pre$phi$iZ2D = 0, $$pre$phi58$i$iZ2D = 0, $$pre$phiZ2D = 0, $$pre105 = 0, $$pre106 = 0, $$pre14$i$i = 0, $$pre43$i = 0, $$pre56$i$i = 0, $$pre57$i$i = 0, $$pre8$i = 0, $$rsize$0$i = 0, $$rsize$3$i = 0, $$sum = 0, $$sum$i$i = 0, $$sum$i$i$i = 0, $$sum$i13$i = 0, $$sum$i14$i = 0, $$sum$i17$i = 0, $$sum$i19$i = 0;
   var $$sum$i2334 = 0, $$sum$i32 = 0, $$sum$i35 = 0, $$sum1 = 0, $$sum1$i = 0, $$sum1$i$i = 0, $$sum1$i15$i = 0, $$sum1$i20$i = 0, $$sum1$i24 = 0, $$sum10 = 0, $$sum10$i = 0, $$sum10$i$i = 0, $$sum11$i = 0, $$sum11$i$i = 0, $$sum1112 = 0, $$sum112$i = 0, $$sum113$i = 0, $$sum114$i = 0, $$sum115$i = 0, $$sum116$i = 0;
   var $$sum117$i = 0, $$sum118$i = 0, $$sum119$i = 0, $$sum12$i = 0, $$sum12$i$i = 0, $$sum120$i = 0, $$sum121$i = 0, $$sum122$i = 0, $$sum123$i = 0, $$sum124$i = 0, $$sum125$i = 0, $$sum13$i = 0, $$sum13$i$i = 0, $$sum14$i$i = 0, $$sum15$i = 0, $$sum15$i$i = 0, $$sum16$i = 0, $$sum16$i$i = 0, $$sum17$i = 0, $$sum17$i$i = 0;
   var $$sum18$i = 0, $$sum1819$i$i = 0, $$sum2 = 0, $$sum2$i = 0, $$sum2$i$i = 0, $$sum2$i$i$i = 0, $$sum2$i16$i = 0, $$sum2$i18$i = 0, $$sum2$i21$i = 0, $$sum20$i$i = 0, $$sum21$i$i = 0, $$sum22$i$i = 0, $$sum23$i$i = 0, $$sum24$i$i = 0, $$sum25$i$i = 0, $$sum27$i$i = 0, $$sum28$i$i = 0, $$sum29$i$i = 0, $$sum3$i = 0, $$sum3$i27 = 0;
   var $$sum30$i$i = 0, $$sum3132$i$i = 0, $$sum34$i$i = 0, $$sum3536$i$i = 0, $$sum3738$i$i = 0, $$sum39$i$i = 0, $$sum4 = 0, $$sum4$i = 0, $$sum4$i$i = 0, $$sum4$i28 = 0, $$sum40$i$i = 0, $$sum41$i$i = 0, $$sum42$i$i = 0, $$sum5$i = 0, $$sum5$i$i = 0, $$sum56 = 0, $$sum6$i = 0, $$sum67$i$i = 0, $$sum7$i = 0, $$sum8$i = 0;
   var $$sum9 = 0, $$sum9$i = 0, $$sum9$i$i = 0, $$tsize$1$i = 0, $$v$0$i = 0, $0 = 0, $1 = 0, $10 = 0, $100 = 0, $1000 = 0, $1001 = 0, $1002 = 0, $1003 = 0, $1004 = 0, $1005 = 0, $1006 = 0, $1007 = 0, $1008 = 0, $1009 = 0, $101 = 0;
   var $1010 = 0, $1011 = 0, $1012 = 0, $1013 = 0, $1014 = 0, $1015 = 0, $1016 = 0, $1017 = 0, $1018 = 0, $1019 = 0, $102 = 0, $1020 = 0, $1021 = 0, $1022 = 0, $1023 = 0, $1024 = 0, $1025 = 0, $1026 = 0, $1027 = 0, $1028 = 0;
   var $1029 = 0, $103 = 0, $1030 = 0, $1031 = 0, $1032 = 0, $1033 = 0, $1034 = 0, $1035 = 0, $1036 = 0, $1037 = 0, $1038 = 0, $1039 = 0, $104 = 0, $1040 = 0, $1041 = 0, $1042 = 0, $1043 = 0, $1044 = 0, $1045 = 0, $1046 = 0;
   var $1047 = 0, $1048 = 0, $1049 = 0, $105 = 0, $1050 = 0, $1051 = 0, $1052 = 0, $1053 = 0, $1054 = 0, $1055 = 0, $1056 = 0, $1057 = 0, $1058 = 0, $1059 = 0, $106 = 0, $1060 = 0, $1061 = 0, $1062 = 0, $1063 = 0, $1064 = 0;
   var $1065 = 0, $1066 = 0, $1067 = 0, $1068 = 0, $1069 = 0, $107 = 0, $1070 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0;
   var $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0;
   var $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0;
   var $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0;
   var $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $19 = 0, $190 = 0, $191 = 0;
   var $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0;
   var $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0, $225 = 0, $226 = 0, $227 = 0;
   var $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0, $242 = 0, $243 = 0, $244 = 0, $245 = 0;
   var $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0, $261 = 0, $262 = 0, $263 = 0;
   var $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $281 = 0;
   var $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0, $298 = 0, $299 = 0, $3 = 0;
   var $30 = 0, $300 = 0, $301 = 0, $302 = 0, $303 = 0, $304 = 0, $305 = 0, $306 = 0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0, $312 = 0, $313 = 0, $314 = 0, $315 = 0, $316 = 0, $317 = 0;
   var $318 = 0, $319 = 0, $32 = 0, $320 = 0, $321 = 0, $322 = 0, $323 = 0, $324 = 0, $325 = 0, $326 = 0, $327 = 0, $328 = 0, $329 = 0, $33 = 0, $330 = 0, $331 = 0, $332 = 0, $333 = 0, $334 = 0, $335 = 0;
   var $336 = 0, $337 = 0, $338 = 0, $339 = 0, $34 = 0, $340 = 0, $341 = 0, $342 = 0, $343 = 0, $344 = 0, $345 = 0, $346 = 0, $347 = 0, $348 = 0, $349 = 0, $35 = 0, $350 = 0, $351 = 0, $352 = 0, $353 = 0;
   var $354 = 0, $355 = 0, $356 = 0, $357 = 0, $358 = 0, $359 = 0, $36 = 0, $360 = 0, $361 = 0, $362 = 0, $363 = 0, $364 = 0, $365 = 0, $366 = 0, $367 = 0, $368 = 0, $369 = 0, $37 = 0, $370 = 0, $371 = 0;
   var $372 = 0, $373 = 0, $374 = 0, $375 = 0, $376 = 0, $377 = 0, $378 = 0, $379 = 0, $38 = 0, $380 = 0, $381 = 0, $382 = 0, $383 = 0, $384 = 0, $385 = 0, $386 = 0, $387 = 0, $388 = 0, $389 = 0, $39 = 0;
   var $390 = 0, $391 = 0, $392 = 0, $393 = 0, $394 = 0, $395 = 0, $396 = 0, $397 = 0, $398 = 0, $399 = 0, $4 = 0, $40 = 0, $400 = 0, $401 = 0, $402 = 0, $403 = 0, $404 = 0, $405 = 0, $406 = 0, $407 = 0;
   var $408 = 0, $409 = 0, $41 = 0, $410 = 0, $411 = 0, $412 = 0, $413 = 0, $414 = 0, $415 = 0, $416 = 0, $417 = 0, $418 = 0, $419 = 0, $42 = 0, $420 = 0, $421 = 0, $422 = 0, $423 = 0, $424 = 0, $425 = 0;
   var $426 = 0, $427 = 0, $428 = 0, $429 = 0, $43 = 0, $430 = 0, $431 = 0, $432 = 0, $433 = 0, $434 = 0, $435 = 0, $436 = 0, $437 = 0, $438 = 0, $439 = 0, $44 = 0, $440 = 0, $441 = 0, $442 = 0, $443 = 0;
   var $444 = 0, $445 = 0, $446 = 0, $447 = 0, $448 = 0, $449 = 0, $45 = 0, $450 = 0, $451 = 0, $452 = 0, $453 = 0, $454 = 0, $455 = 0, $456 = 0, $457 = 0, $458 = 0, $459 = 0, $46 = 0, $460 = 0, $461 = 0;
   var $462 = 0, $463 = 0, $464 = 0, $465 = 0, $466 = 0, $467 = 0, $468 = 0, $469 = 0, $47 = 0, $470 = 0, $471 = 0, $472 = 0, $473 = 0, $474 = 0, $475 = 0, $476 = 0, $477 = 0, $478 = 0, $479 = 0, $48 = 0;
   var $480 = 0, $481 = 0, $482 = 0, $483 = 0, $484 = 0, $485 = 0, $486 = 0, $487 = 0, $488 = 0, $489 = 0, $49 = 0, $490 = 0, $491 = 0, $492 = 0, $493 = 0, $494 = 0, $495 = 0, $496 = 0, $497 = 0, $498 = 0;
   var $499 = 0, $5 = 0, $50 = 0, $500 = 0, $501 = 0, $502 = 0, $503 = 0, $504 = 0, $505 = 0, $506 = 0, $507 = 0, $508 = 0, $509 = 0, $51 = 0, $510 = 0, $511 = 0, $512 = 0, $513 = 0, $514 = 0, $515 = 0;
   var $516 = 0, $517 = 0, $518 = 0, $519 = 0, $52 = 0, $520 = 0, $521 = 0, $522 = 0, $523 = 0, $524 = 0, $525 = 0, $526 = 0, $527 = 0, $528 = 0, $529 = 0, $53 = 0, $530 = 0, $531 = 0, $532 = 0, $533 = 0;
   var $534 = 0, $535 = 0, $536 = 0, $537 = 0, $538 = 0, $539 = 0, $54 = 0, $540 = 0, $541 = 0, $542 = 0, $543 = 0, $544 = 0, $545 = 0, $546 = 0, $547 = 0, $548 = 0, $549 = 0, $55 = 0, $550 = 0, $551 = 0;
   var $552 = 0, $553 = 0, $554 = 0, $555 = 0, $556 = 0, $557 = 0, $558 = 0, $559 = 0, $56 = 0, $560 = 0, $561 = 0, $562 = 0, $563 = 0, $564 = 0, $565 = 0, $566 = 0, $567 = 0, $568 = 0, $569 = 0, $57 = 0;
   var $570 = 0, $571 = 0, $572 = 0, $573 = 0, $574 = 0, $575 = 0, $576 = 0, $577 = 0, $578 = 0, $579 = 0, $58 = 0, $580 = 0, $581 = 0, $582 = 0, $583 = 0, $584 = 0, $585 = 0, $586 = 0, $587 = 0, $588 = 0;
   var $589 = 0, $59 = 0, $590 = 0, $591 = 0, $592 = 0, $593 = 0, $594 = 0, $595 = 0, $596 = 0, $597 = 0, $598 = 0, $599 = 0, $6 = 0, $60 = 0, $600 = 0, $601 = 0, $602 = 0, $603 = 0, $604 = 0, $605 = 0;
   var $606 = 0, $607 = 0, $608 = 0, $609 = 0, $61 = 0, $610 = 0, $611 = 0, $612 = 0, $613 = 0, $614 = 0, $615 = 0, $616 = 0, $617 = 0, $618 = 0, $619 = 0, $62 = 0, $620 = 0, $621 = 0, $622 = 0, $623 = 0;
   var $624 = 0, $625 = 0, $626 = 0, $627 = 0, $628 = 0, $629 = 0, $63 = 0, $630 = 0, $631 = 0, $632 = 0, $633 = 0, $634 = 0, $635 = 0, $636 = 0, $637 = 0, $638 = 0, $639 = 0, $64 = 0, $640 = 0, $641 = 0;
   var $642 = 0, $643 = 0, $644 = 0, $645 = 0, $646 = 0, $647 = 0, $648 = 0, $649 = 0, $65 = 0, $650 = 0, $651 = 0, $652 = 0, $653 = 0, $654 = 0, $655 = 0, $656 = 0, $657 = 0, $658 = 0, $659 = 0, $66 = 0;
   var $660 = 0, $661 = 0, $662 = 0, $663 = 0, $664 = 0, $665 = 0, $666 = 0, $667 = 0, $668 = 0, $669 = 0, $67 = 0, $670 = 0, $671 = 0, $672 = 0, $673 = 0, $674 = 0, $675 = 0, $676 = 0, $677 = 0, $678 = 0;
   var $679 = 0, $68 = 0, $680 = 0, $681 = 0, $682 = 0, $683 = 0, $684 = 0, $685 = 0, $686 = 0, $687 = 0, $688 = 0, $689 = 0, $69 = 0, $690 = 0, $691 = 0, $692 = 0, $693 = 0, $694 = 0, $695 = 0, $696 = 0;
   var $697 = 0, $698 = 0, $699 = 0, $7 = 0, $70 = 0, $700 = 0, $701 = 0, $702 = 0, $703 = 0, $704 = 0, $705 = 0, $706 = 0, $707 = 0, $708 = 0, $709 = 0, $71 = 0, $710 = 0, $711 = 0, $712 = 0, $713 = 0;
   var $714 = 0, $715 = 0, $716 = 0, $717 = 0, $718 = 0, $719 = 0, $72 = 0, $720 = 0, $721 = 0, $722 = 0, $723 = 0, $724 = 0, $725 = 0, $726 = 0, $727 = 0, $728 = 0, $729 = 0, $73 = 0, $730 = 0, $731 = 0;
   var $732 = 0, $733 = 0, $734 = 0, $735 = 0, $736 = 0, $737 = 0, $738 = 0, $739 = 0, $74 = 0, $740 = 0, $741 = 0, $742 = 0, $743 = 0, $744 = 0, $745 = 0, $746 = 0, $747 = 0, $748 = 0, $749 = 0, $75 = 0;
   var $750 = 0, $751 = 0, $752 = 0, $753 = 0, $754 = 0, $755 = 0, $756 = 0, $757 = 0, $758 = 0, $759 = 0, $76 = 0, $760 = 0, $761 = 0, $762 = 0, $763 = 0, $764 = 0, $765 = 0, $766 = 0, $767 = 0, $768 = 0;
   var $769 = 0, $77 = 0, $770 = 0, $771 = 0, $772 = 0, $773 = 0, $774 = 0, $775 = 0, $776 = 0, $777 = 0, $778 = 0, $779 = 0, $78 = 0, $780 = 0, $781 = 0, $782 = 0, $783 = 0, $784 = 0, $785 = 0, $786 = 0;
   var $787 = 0, $788 = 0, $789 = 0, $79 = 0, $790 = 0, $791 = 0, $792 = 0, $793 = 0, $794 = 0, $795 = 0, $796 = 0, $797 = 0, $798 = 0, $799 = 0, $8 = 0, $80 = 0, $800 = 0, $801 = 0, $802 = 0, $803 = 0;
   var $804 = 0, $805 = 0, $806 = 0, $807 = 0, $808 = 0, $809 = 0, $81 = 0, $810 = 0, $811 = 0, $812 = 0, $813 = 0, $814 = 0, $815 = 0, $816 = 0, $817 = 0, $818 = 0, $819 = 0, $82 = 0, $820 = 0, $821 = 0;
   var $822 = 0, $823 = 0, $824 = 0, $825 = 0, $826 = 0, $827 = 0, $828 = 0, $829 = 0, $83 = 0, $830 = 0, $831 = 0, $832 = 0, $833 = 0, $834 = 0, $835 = 0, $836 = 0, $837 = 0, $838 = 0, $839 = 0, $84 = 0;
   var $840 = 0, $841 = 0, $842 = 0, $843 = 0, $844 = 0, $845 = 0, $846 = 0, $847 = 0, $848 = 0, $849 = 0, $85 = 0, $850 = 0, $851 = 0, $852 = 0, $853 = 0, $854 = 0, $855 = 0, $856 = 0, $857 = 0, $858 = 0;
   var $859 = 0, $86 = 0, $860 = 0, $861 = 0, $862 = 0, $863 = 0, $864 = 0, $865 = 0, $866 = 0, $867 = 0, $868 = 0, $869 = 0, $87 = 0, $870 = 0, $871 = 0, $872 = 0, $873 = 0, $874 = 0, $875 = 0, $876 = 0;
   var $877 = 0, $878 = 0, $879 = 0, $88 = 0, $880 = 0, $881 = 0, $882 = 0, $883 = 0, $884 = 0, $885 = 0, $886 = 0, $887 = 0, $888 = 0, $889 = 0, $89 = 0, $890 = 0, $891 = 0, $892 = 0, $893 = 0, $894 = 0;
   var $895 = 0, $896 = 0, $897 = 0, $898 = 0, $899 = 0, $9 = 0, $90 = 0, $900 = 0, $901 = 0, $902 = 0, $903 = 0, $904 = 0, $905 = 0, $906 = 0, $907 = 0, $908 = 0, $909 = 0, $91 = 0, $910 = 0, $911 = 0;
   var $912 = 0, $913 = 0, $914 = 0, $915 = 0, $916 = 0, $917 = 0, $918 = 0, $919 = 0, $92 = 0, $920 = 0, $921 = 0, $922 = 0, $923 = 0, $924 = 0, $925 = 0, $926 = 0, $927 = 0, $928 = 0, $929 = 0, $93 = 0;
   var $930 = 0, $931 = 0, $932 = 0, $933 = 0, $934 = 0, $935 = 0, $936 = 0, $937 = 0, $938 = 0, $939 = 0, $94 = 0, $940 = 0, $941 = 0, $942 = 0, $943 = 0, $944 = 0, $945 = 0, $946 = 0, $947 = 0, $948 = 0;
   var $949 = 0, $95 = 0, $950 = 0, $951 = 0, $952 = 0, $953 = 0, $954 = 0, $955 = 0, $956 = 0, $957 = 0, $958 = 0, $959 = 0, $96 = 0, $960 = 0, $961 = 0, $962 = 0, $963 = 0, $964 = 0, $965 = 0, $966 = 0;
   var $967 = 0, $968 = 0, $969 = 0, $97 = 0, $970 = 0, $971 = 0, $972 = 0, $973 = 0, $974 = 0, $975 = 0, $976 = 0, $977 = 0, $978 = 0, $979 = 0, $98 = 0, $980 = 0, $981 = 0, $982 = 0, $983 = 0, $984 = 0;
   var $985 = 0, $986 = 0, $987 = 0, $988 = 0, $989 = 0, $99 = 0, $990 = 0, $991 = 0, $992 = 0, $993 = 0, $994 = 0, $995 = 0, $996 = 0, $997 = 0, $998 = 0, $999 = 0, $F$0$i$i = 0, $F1$0$i = 0, $F4$0 = 0, $F4$0$i$i = 0;
   var $F5$0$i = 0, $I1$0$i$i = 0, $I7$0$i = 0, $I7$0$i$i = 0, $K12$029$i = 0, $K2$07$i$i = 0, $K8$051$i$i = 0, $R$0$i = 0, $R$0$i$i = 0, $R$0$i$i$lcssa = 0, $R$0$i$lcssa = 0, $R$0$i18 = 0, $R$0$i18$lcssa = 0, $R$1$i = 0, $R$1$i$i = 0, $R$1$i20 = 0, $RP$0$i = 0, $RP$0$i$i = 0, $RP$0$i$i$lcssa = 0, $RP$0$i$lcssa = 0;
   var $RP$0$i17 = 0, $RP$0$i17$lcssa = 0, $T$0$lcssa$i = 0, $T$0$lcssa$i$i = 0, $T$0$lcssa$i25$i = 0, $T$028$i = 0, $T$028$i$lcssa = 0, $T$050$i$i = 0, $T$050$i$i$lcssa = 0, $T$06$i$i = 0, $T$06$i$i$lcssa = 0, $br$0$ph$i = 0, $cond$i = 0, $cond$i$i = 0, $cond$i21 = 0, $exitcond$i$i = 0, $i$02$i$i = 0, $idx$0$i = 0, $mem$0 = 0, $nb$0 = 0;
   var $not$$i = 0, $not$$i$i = 0, $not$$i26$i = 0, $oldfirst$0$i$i = 0, $or$cond$i = 0, $or$cond$i30 = 0, $or$cond1$i = 0, $or$cond19$i = 0, $or$cond2$i = 0, $or$cond3$i = 0, $or$cond5$i = 0, $or$cond57$i = 0, $or$cond6$i = 0, $or$cond8$i = 0, $or$cond9$i = 0, $qsize$0$i$i = 0, $rsize$0$i = 0, $rsize$0$i$lcssa = 0, $rsize$0$i15 = 0, $rsize$1$i = 0;
   var $rsize$2$i = 0, $rsize$3$lcssa$i = 0, $rsize$331$i = 0, $rst$0$i = 0, $rst$1$i = 0, $sizebits$0$i = 0, $sp$0$i$i = 0, $sp$0$i$i$i = 0, $sp$084$i = 0, $sp$084$i$lcssa = 0, $sp$183$i = 0, $sp$183$i$lcssa = 0, $ssize$0$$i = 0, $ssize$0$i = 0, $ssize$1$ph$i = 0, $ssize$2$i = 0, $t$0$i = 0, $t$0$i14 = 0, $t$1$i = 0, $t$2$ph$i = 0;
   var $t$2$v$3$i = 0, $t$230$i = 0, $tbase$255$i = 0, $tsize$0$ph$i = 0, $tsize$0323944$i = 0, $tsize$1$i = 0, $tsize$254$i = 0, $v$0$i = 0, $v$0$i$lcssa = 0, $v$0$i16 = 0, $v$1$i = 0, $v$2$i = 0, $v$3$lcssa$i = 0, $v$3$ph$i = 0, $v$332$i = 0, label = 0, sp = 0;
   sp = STACKTOP;
   $0 = ($bytes>>>0)<(245);
   do {
    if ($0) {
     $1 = ($bytes>>>0)<(11);
     $2 = (($bytes) + 11)|0;
     $3 = $2 & -8;
     $4 = $1 ? 16 : $3;
     $5 = $4 >>> 3;
     $6 = HEAP32[812>>2]|0;
     $7 = $6 >>> $5;
     $8 = $7 & 3;
     $9 = ($8|0)==(0);
     if (!($9)) {
      $10 = $7 & 1;
      $11 = $10 ^ 1;
      $12 = (($11) + ($5))|0;
      $13 = $12 << 1;
      $14 = (852 + ($13<<2)|0);
      $$sum10 = (($13) + 2)|0;
      $15 = (852 + ($$sum10<<2)|0);
      $16 = HEAP32[$15>>2]|0;
      $17 = ((($16)) + 8|0);
      $18 = HEAP32[$17>>2]|0;
      $19 = ($14|0)==($18|0);
      do {
       if ($19) {
        $20 = 1 << $12;
        $21 = $20 ^ -1;
        $22 = $6 & $21;
        HEAP32[812>>2] = $22;
       } else {
        $23 = HEAP32[(828)>>2]|0;
        $24 = ($18>>>0)<($23>>>0);
        if ($24) {
         _abort();
         // unreachable;
        }
        $25 = ((($18)) + 12|0);
        $26 = HEAP32[$25>>2]|0;
        $27 = ($26|0)==($16|0);
        if ($27) {
         HEAP32[$25>>2] = $14;
         HEAP32[$15>>2] = $18;
         break;
        } else {
         _abort();
         // unreachable;
        }
       }
      } while(0);
      $28 = $12 << 3;
      $29 = $28 | 3;
      $30 = ((($16)) + 4|0);
      HEAP32[$30>>2] = $29;
      $$sum1112 = $28 | 4;
      $31 = (($16) + ($$sum1112)|0);
      $32 = HEAP32[$31>>2]|0;
      $33 = $32 | 1;
      HEAP32[$31>>2] = $33;
      $mem$0 = $17;
      return ($mem$0|0);
     }
     $34 = HEAP32[(820)>>2]|0;
     $35 = ($4>>>0)>($34>>>0);
     if ($35) {
      $36 = ($7|0)==(0);
      if (!($36)) {
       $37 = $7 << $5;
       $38 = 2 << $5;
       $39 = (0 - ($38))|0;
       $40 = $38 | $39;
       $41 = $37 & $40;
       $42 = (0 - ($41))|0;
       $43 = $41 & $42;
       $44 = (($43) + -1)|0;
       $45 = $44 >>> 12;
       $46 = $45 & 16;
       $47 = $44 >>> $46;
       $48 = $47 >>> 5;
       $49 = $48 & 8;
       $50 = $49 | $46;
       $51 = $47 >>> $49;
       $52 = $51 >>> 2;
       $53 = $52 & 4;
       $54 = $50 | $53;
       $55 = $51 >>> $53;
       $56 = $55 >>> 1;
       $57 = $56 & 2;
       $58 = $54 | $57;
       $59 = $55 >>> $57;
       $60 = $59 >>> 1;
       $61 = $60 & 1;
       $62 = $58 | $61;
       $63 = $59 >>> $61;
       $64 = (($62) + ($63))|0;
       $65 = $64 << 1;
       $66 = (852 + ($65<<2)|0);
       $$sum4 = (($65) + 2)|0;
       $67 = (852 + ($$sum4<<2)|0);
       $68 = HEAP32[$67>>2]|0;
       $69 = ((($68)) + 8|0);
       $70 = HEAP32[$69>>2]|0;
       $71 = ($66|0)==($70|0);
       do {
        if ($71) {
         $72 = 1 << $64;
         $73 = $72 ^ -1;
         $74 = $6 & $73;
         HEAP32[812>>2] = $74;
         $88 = $34;
        } else {
         $75 = HEAP32[(828)>>2]|0;
         $76 = ($70>>>0)<($75>>>0);
         if ($76) {
          _abort();
          // unreachable;
         }
         $77 = ((($70)) + 12|0);
         $78 = HEAP32[$77>>2]|0;
         $79 = ($78|0)==($68|0);
         if ($79) {
          HEAP32[$77>>2] = $66;
          HEAP32[$67>>2] = $70;
          $$pre = HEAP32[(820)>>2]|0;
          $88 = $$pre;
          break;
         } else {
          _abort();
          // unreachable;
         }
        }
       } while(0);
       $80 = $64 << 3;
       $81 = (($80) - ($4))|0;
       $82 = $4 | 3;
       $83 = ((($68)) + 4|0);
       HEAP32[$83>>2] = $82;
       $84 = (($68) + ($4)|0);
       $85 = $81 | 1;
       $$sum56 = $4 | 4;
       $86 = (($68) + ($$sum56)|0);
       HEAP32[$86>>2] = $85;
       $87 = (($68) + ($80)|0);
       HEAP32[$87>>2] = $81;
       $89 = ($88|0)==(0);
       if (!($89)) {
        $90 = HEAP32[(832)>>2]|0;
        $91 = $88 >>> 3;
        $92 = $91 << 1;
        $93 = (852 + ($92<<2)|0);
        $94 = HEAP32[812>>2]|0;
        $95 = 1 << $91;
        $96 = $94 & $95;
        $97 = ($96|0)==(0);
        if ($97) {
         $98 = $94 | $95;
         HEAP32[812>>2] = $98;
         $$pre105 = (($92) + 2)|0;
         $$pre106 = (852 + ($$pre105<<2)|0);
         $$pre$phiZ2D = $$pre106;$F4$0 = $93;
        } else {
         $$sum9 = (($92) + 2)|0;
         $99 = (852 + ($$sum9<<2)|0);
         $100 = HEAP32[$99>>2]|0;
         $101 = HEAP32[(828)>>2]|0;
         $102 = ($100>>>0)<($101>>>0);
         if ($102) {
          _abort();
          // unreachable;
         } else {
          $$pre$phiZ2D = $99;$F4$0 = $100;
         }
        }
        HEAP32[$$pre$phiZ2D>>2] = $90;
        $103 = ((($F4$0)) + 12|0);
        HEAP32[$103>>2] = $90;
        $104 = ((($90)) + 8|0);
        HEAP32[$104>>2] = $F4$0;
        $105 = ((($90)) + 12|0);
        HEAP32[$105>>2] = $93;
       }
       HEAP32[(820)>>2] = $81;
       HEAP32[(832)>>2] = $84;
       $mem$0 = $69;
       return ($mem$0|0);
      }
      $106 = HEAP32[(816)>>2]|0;
      $107 = ($106|0)==(0);
      if ($107) {
       $nb$0 = $4;
      } else {
       $108 = (0 - ($106))|0;
       $109 = $106 & $108;
       $110 = (($109) + -1)|0;
       $111 = $110 >>> 12;
       $112 = $111 & 16;
       $113 = $110 >>> $112;
       $114 = $113 >>> 5;
       $115 = $114 & 8;
       $116 = $115 | $112;
       $117 = $113 >>> $115;
       $118 = $117 >>> 2;
       $119 = $118 & 4;
       $120 = $116 | $119;
       $121 = $117 >>> $119;
       $122 = $121 >>> 1;
       $123 = $122 & 2;
       $124 = $120 | $123;
       $125 = $121 >>> $123;
       $126 = $125 >>> 1;
       $127 = $126 & 1;
       $128 = $124 | $127;
       $129 = $125 >>> $127;
       $130 = (($128) + ($129))|0;
       $131 = (1116 + ($130<<2)|0);
       $132 = HEAP32[$131>>2]|0;
       $133 = ((($132)) + 4|0);
       $134 = HEAP32[$133>>2]|0;
       $135 = $134 & -8;
       $136 = (($135) - ($4))|0;
       $rsize$0$i = $136;$t$0$i = $132;$v$0$i = $132;
       while(1) {
        $137 = ((($t$0$i)) + 16|0);
        $138 = HEAP32[$137>>2]|0;
        $139 = ($138|0)==(0|0);
        if ($139) {
         $140 = ((($t$0$i)) + 20|0);
         $141 = HEAP32[$140>>2]|0;
         $142 = ($141|0)==(0|0);
         if ($142) {
          $rsize$0$i$lcssa = $rsize$0$i;$v$0$i$lcssa = $v$0$i;
          break;
         } else {
          $144 = $141;
         }
        } else {
         $144 = $138;
        }
        $143 = ((($144)) + 4|0);
        $145 = HEAP32[$143>>2]|0;
        $146 = $145 & -8;
        $147 = (($146) - ($4))|0;
        $148 = ($147>>>0)<($rsize$0$i>>>0);
        $$rsize$0$i = $148 ? $147 : $rsize$0$i;
        $$v$0$i = $148 ? $144 : $v$0$i;
        $rsize$0$i = $$rsize$0$i;$t$0$i = $144;$v$0$i = $$v$0$i;
       }
       $149 = HEAP32[(828)>>2]|0;
       $150 = ($v$0$i$lcssa>>>0)<($149>>>0);
       if ($150) {
        _abort();
        // unreachable;
       }
       $151 = (($v$0$i$lcssa) + ($4)|0);
       $152 = ($v$0$i$lcssa>>>0)<($151>>>0);
       if (!($152)) {
        _abort();
        // unreachable;
       }
       $153 = ((($v$0$i$lcssa)) + 24|0);
       $154 = HEAP32[$153>>2]|0;
       $155 = ((($v$0$i$lcssa)) + 12|0);
       $156 = HEAP32[$155>>2]|0;
       $157 = ($156|0)==($v$0$i$lcssa|0);
       do {
        if ($157) {
         $167 = ((($v$0$i$lcssa)) + 20|0);
         $168 = HEAP32[$167>>2]|0;
         $169 = ($168|0)==(0|0);
         if ($169) {
          $170 = ((($v$0$i$lcssa)) + 16|0);
          $171 = HEAP32[$170>>2]|0;
          $172 = ($171|0)==(0|0);
          if ($172) {
           $R$1$i = 0;
           break;
          } else {
           $R$0$i = $171;$RP$0$i = $170;
          }
         } else {
          $R$0$i = $168;$RP$0$i = $167;
         }
         while(1) {
          $173 = ((($R$0$i)) + 20|0);
          $174 = HEAP32[$173>>2]|0;
          $175 = ($174|0)==(0|0);
          if (!($175)) {
           $R$0$i = $174;$RP$0$i = $173;
           continue;
          }
          $176 = ((($R$0$i)) + 16|0);
          $177 = HEAP32[$176>>2]|0;
          $178 = ($177|0)==(0|0);
          if ($178) {
           $R$0$i$lcssa = $R$0$i;$RP$0$i$lcssa = $RP$0$i;
           break;
          } else {
           $R$0$i = $177;$RP$0$i = $176;
          }
         }
         $179 = ($RP$0$i$lcssa>>>0)<($149>>>0);
         if ($179) {
          _abort();
          // unreachable;
         } else {
          HEAP32[$RP$0$i$lcssa>>2] = 0;
          $R$1$i = $R$0$i$lcssa;
          break;
         }
        } else {
         $158 = ((($v$0$i$lcssa)) + 8|0);
         $159 = HEAP32[$158>>2]|0;
         $160 = ($159>>>0)<($149>>>0);
         if ($160) {
          _abort();
          // unreachable;
         }
         $161 = ((($159)) + 12|0);
         $162 = HEAP32[$161>>2]|0;
         $163 = ($162|0)==($v$0$i$lcssa|0);
         if (!($163)) {
          _abort();
          // unreachable;
         }
         $164 = ((($156)) + 8|0);
         $165 = HEAP32[$164>>2]|0;
         $166 = ($165|0)==($v$0$i$lcssa|0);
         if ($166) {
          HEAP32[$161>>2] = $156;
          HEAP32[$164>>2] = $159;
          $R$1$i = $156;
          break;
         } else {
          _abort();
          // unreachable;
         }
        }
       } while(0);
       $180 = ($154|0)==(0|0);
       do {
        if (!($180)) {
         $181 = ((($v$0$i$lcssa)) + 28|0);
         $182 = HEAP32[$181>>2]|0;
         $183 = (1116 + ($182<<2)|0);
         $184 = HEAP32[$183>>2]|0;
         $185 = ($v$0$i$lcssa|0)==($184|0);
         if ($185) {
          HEAP32[$183>>2] = $R$1$i;
          $cond$i = ($R$1$i|0)==(0|0);
          if ($cond$i) {
           $186 = 1 << $182;
           $187 = $186 ^ -1;
           $188 = HEAP32[(816)>>2]|0;
           $189 = $188 & $187;
           HEAP32[(816)>>2] = $189;
           break;
          }
         } else {
          $190 = HEAP32[(828)>>2]|0;
          $191 = ($154>>>0)<($190>>>0);
          if ($191) {
           _abort();
           // unreachable;
          }
          $192 = ((($154)) + 16|0);
          $193 = HEAP32[$192>>2]|0;
          $194 = ($193|0)==($v$0$i$lcssa|0);
          if ($194) {
           HEAP32[$192>>2] = $R$1$i;
          } else {
           $195 = ((($154)) + 20|0);
           HEAP32[$195>>2] = $R$1$i;
          }
          $196 = ($R$1$i|0)==(0|0);
          if ($196) {
           break;
          }
         }
         $197 = HEAP32[(828)>>2]|0;
         $198 = ($R$1$i>>>0)<($197>>>0);
         if ($198) {
          _abort();
          // unreachable;
         }
         $199 = ((($R$1$i)) + 24|0);
         HEAP32[$199>>2] = $154;
         $200 = ((($v$0$i$lcssa)) + 16|0);
         $201 = HEAP32[$200>>2]|0;
         $202 = ($201|0)==(0|0);
         do {
          if (!($202)) {
           $203 = ($201>>>0)<($197>>>0);
           if ($203) {
            _abort();
            // unreachable;
           } else {
            $204 = ((($R$1$i)) + 16|0);
            HEAP32[$204>>2] = $201;
            $205 = ((($201)) + 24|0);
            HEAP32[$205>>2] = $R$1$i;
            break;
           }
          }
         } while(0);
         $206 = ((($v$0$i$lcssa)) + 20|0);
         $207 = HEAP32[$206>>2]|0;
         $208 = ($207|0)==(0|0);
         if (!($208)) {
          $209 = HEAP32[(828)>>2]|0;
          $210 = ($207>>>0)<($209>>>0);
          if ($210) {
           _abort();
           // unreachable;
          } else {
           $211 = ((($R$1$i)) + 20|0);
           HEAP32[$211>>2] = $207;
           $212 = ((($207)) + 24|0);
           HEAP32[$212>>2] = $R$1$i;
           break;
          }
         }
        }
       } while(0);
       $213 = ($rsize$0$i$lcssa>>>0)<(16);
       if ($213) {
        $214 = (($rsize$0$i$lcssa) + ($4))|0;
        $215 = $214 | 3;
        $216 = ((($v$0$i$lcssa)) + 4|0);
        HEAP32[$216>>2] = $215;
        $$sum4$i = (($214) + 4)|0;
        $217 = (($v$0$i$lcssa) + ($$sum4$i)|0);
        $218 = HEAP32[$217>>2]|0;
        $219 = $218 | 1;
        HEAP32[$217>>2] = $219;
       } else {
        $220 = $4 | 3;
        $221 = ((($v$0$i$lcssa)) + 4|0);
        HEAP32[$221>>2] = $220;
        $222 = $rsize$0$i$lcssa | 1;
        $$sum$i35 = $4 | 4;
        $223 = (($v$0$i$lcssa) + ($$sum$i35)|0);
        HEAP32[$223>>2] = $222;
        $$sum1$i = (($rsize$0$i$lcssa) + ($4))|0;
        $224 = (($v$0$i$lcssa) + ($$sum1$i)|0);
        HEAP32[$224>>2] = $rsize$0$i$lcssa;
        $225 = HEAP32[(820)>>2]|0;
        $226 = ($225|0)==(0);
        if (!($226)) {
         $227 = HEAP32[(832)>>2]|0;
         $228 = $225 >>> 3;
         $229 = $228 << 1;
         $230 = (852 + ($229<<2)|0);
         $231 = HEAP32[812>>2]|0;
         $232 = 1 << $228;
         $233 = $231 & $232;
         $234 = ($233|0)==(0);
         if ($234) {
          $235 = $231 | $232;
          HEAP32[812>>2] = $235;
          $$pre$i = (($229) + 2)|0;
          $$pre8$i = (852 + ($$pre$i<<2)|0);
          $$pre$phi$iZ2D = $$pre8$i;$F1$0$i = $230;
         } else {
          $$sum3$i = (($229) + 2)|0;
          $236 = (852 + ($$sum3$i<<2)|0);
          $237 = HEAP32[$236>>2]|0;
          $238 = HEAP32[(828)>>2]|0;
          $239 = ($237>>>0)<($238>>>0);
          if ($239) {
           _abort();
           // unreachable;
          } else {
           $$pre$phi$iZ2D = $236;$F1$0$i = $237;
          }
         }
         HEAP32[$$pre$phi$iZ2D>>2] = $227;
         $240 = ((($F1$0$i)) + 12|0);
         HEAP32[$240>>2] = $227;
         $241 = ((($227)) + 8|0);
         HEAP32[$241>>2] = $F1$0$i;
         $242 = ((($227)) + 12|0);
         HEAP32[$242>>2] = $230;
        }
        HEAP32[(820)>>2] = $rsize$0$i$lcssa;
        HEAP32[(832)>>2] = $151;
       }
       $243 = ((($v$0$i$lcssa)) + 8|0);
       $mem$0 = $243;
       return ($mem$0|0);
      }
     } else {
      $nb$0 = $4;
     }
    } else {
     $244 = ($bytes>>>0)>(4294967231);
     if ($244) {
      $nb$0 = -1;
     } else {
      $245 = (($bytes) + 11)|0;
      $246 = $245 & -8;
      $247 = HEAP32[(816)>>2]|0;
      $248 = ($247|0)==(0);
      if ($248) {
       $nb$0 = $246;
      } else {
       $249 = (0 - ($246))|0;
       $250 = $245 >>> 8;
       $251 = ($250|0)==(0);
       if ($251) {
        $idx$0$i = 0;
       } else {
        $252 = ($246>>>0)>(16777215);
        if ($252) {
         $idx$0$i = 31;
        } else {
         $253 = (($250) + 1048320)|0;
         $254 = $253 >>> 16;
         $255 = $254 & 8;
         $256 = $250 << $255;
         $257 = (($256) + 520192)|0;
         $258 = $257 >>> 16;
         $259 = $258 & 4;
         $260 = $259 | $255;
         $261 = $256 << $259;
         $262 = (($261) + 245760)|0;
         $263 = $262 >>> 16;
         $264 = $263 & 2;
         $265 = $260 | $264;
         $266 = (14 - ($265))|0;
         $267 = $261 << $264;
         $268 = $267 >>> 15;
         $269 = (($266) + ($268))|0;
         $270 = $269 << 1;
         $271 = (($269) + 7)|0;
         $272 = $246 >>> $271;
         $273 = $272 & 1;
         $274 = $273 | $270;
         $idx$0$i = $274;
        }
       }
       $275 = (1116 + ($idx$0$i<<2)|0);
       $276 = HEAP32[$275>>2]|0;
       $277 = ($276|0)==(0|0);
       L123: do {
        if ($277) {
         $rsize$2$i = $249;$t$1$i = 0;$v$2$i = 0;
         label = 86;
        } else {
         $278 = ($idx$0$i|0)==(31);
         $279 = $idx$0$i >>> 1;
         $280 = (25 - ($279))|0;
         $281 = $278 ? 0 : $280;
         $282 = $246 << $281;
         $rsize$0$i15 = $249;$rst$0$i = 0;$sizebits$0$i = $282;$t$0$i14 = $276;$v$0$i16 = 0;
         while(1) {
          $283 = ((($t$0$i14)) + 4|0);
          $284 = HEAP32[$283>>2]|0;
          $285 = $284 & -8;
          $286 = (($285) - ($246))|0;
          $287 = ($286>>>0)<($rsize$0$i15>>>0);
          if ($287) {
           $288 = ($285|0)==($246|0);
           if ($288) {
            $rsize$331$i = $286;$t$230$i = $t$0$i14;$v$332$i = $t$0$i14;
            label = 90;
            break L123;
           } else {
            $rsize$1$i = $286;$v$1$i = $t$0$i14;
           }
          } else {
           $rsize$1$i = $rsize$0$i15;$v$1$i = $v$0$i16;
          }
          $289 = ((($t$0$i14)) + 20|0);
          $290 = HEAP32[$289>>2]|0;
          $291 = $sizebits$0$i >>> 31;
          $292 = (((($t$0$i14)) + 16|0) + ($291<<2)|0);
          $293 = HEAP32[$292>>2]|0;
          $294 = ($290|0)==(0|0);
          $295 = ($290|0)==($293|0);
          $or$cond19$i = $294 | $295;
          $rst$1$i = $or$cond19$i ? $rst$0$i : $290;
          $296 = ($293|0)==(0|0);
          $297 = $sizebits$0$i << 1;
          if ($296) {
           $rsize$2$i = $rsize$1$i;$t$1$i = $rst$1$i;$v$2$i = $v$1$i;
           label = 86;
           break;
          } else {
           $rsize$0$i15 = $rsize$1$i;$rst$0$i = $rst$1$i;$sizebits$0$i = $297;$t$0$i14 = $293;$v$0$i16 = $v$1$i;
          }
         }
        }
       } while(0);
       if ((label|0) == 86) {
        $298 = ($t$1$i|0)==(0|0);
        $299 = ($v$2$i|0)==(0|0);
        $or$cond$i = $298 & $299;
        if ($or$cond$i) {
         $300 = 2 << $idx$0$i;
         $301 = (0 - ($300))|0;
         $302 = $300 | $301;
         $303 = $247 & $302;
         $304 = ($303|0)==(0);
         if ($304) {
          $nb$0 = $246;
          break;
         }
         $305 = (0 - ($303))|0;
         $306 = $303 & $305;
         $307 = (($306) + -1)|0;
         $308 = $307 >>> 12;
         $309 = $308 & 16;
         $310 = $307 >>> $309;
         $311 = $310 >>> 5;
         $312 = $311 & 8;
         $313 = $312 | $309;
         $314 = $310 >>> $312;
         $315 = $314 >>> 2;
         $316 = $315 & 4;
         $317 = $313 | $316;
         $318 = $314 >>> $316;
         $319 = $318 >>> 1;
         $320 = $319 & 2;
         $321 = $317 | $320;
         $322 = $318 >>> $320;
         $323 = $322 >>> 1;
         $324 = $323 & 1;
         $325 = $321 | $324;
         $326 = $322 >>> $324;
         $327 = (($325) + ($326))|0;
         $328 = (1116 + ($327<<2)|0);
         $329 = HEAP32[$328>>2]|0;
         $t$2$ph$i = $329;$v$3$ph$i = 0;
        } else {
         $t$2$ph$i = $t$1$i;$v$3$ph$i = $v$2$i;
        }
        $330 = ($t$2$ph$i|0)==(0|0);
        if ($330) {
         $rsize$3$lcssa$i = $rsize$2$i;$v$3$lcssa$i = $v$3$ph$i;
        } else {
         $rsize$331$i = $rsize$2$i;$t$230$i = $t$2$ph$i;$v$332$i = $v$3$ph$i;
         label = 90;
        }
       }
       if ((label|0) == 90) {
        while(1) {
         label = 0;
         $331 = ((($t$230$i)) + 4|0);
         $332 = HEAP32[$331>>2]|0;
         $333 = $332 & -8;
         $334 = (($333) - ($246))|0;
         $335 = ($334>>>0)<($rsize$331$i>>>0);
         $$rsize$3$i = $335 ? $334 : $rsize$331$i;
         $t$2$v$3$i = $335 ? $t$230$i : $v$332$i;
         $336 = ((($t$230$i)) + 16|0);
         $337 = HEAP32[$336>>2]|0;
         $338 = ($337|0)==(0|0);
         if (!($338)) {
          $rsize$331$i = $$rsize$3$i;$t$230$i = $337;$v$332$i = $t$2$v$3$i;
          label = 90;
          continue;
         }
         $339 = ((($t$230$i)) + 20|0);
         $340 = HEAP32[$339>>2]|0;
         $341 = ($340|0)==(0|0);
         if ($341) {
          $rsize$3$lcssa$i = $$rsize$3$i;$v$3$lcssa$i = $t$2$v$3$i;
          break;
         } else {
          $rsize$331$i = $$rsize$3$i;$t$230$i = $340;$v$332$i = $t$2$v$3$i;
          label = 90;
         }
        }
       }
       $342 = ($v$3$lcssa$i|0)==(0|0);
       if ($342) {
        $nb$0 = $246;
       } else {
        $343 = HEAP32[(820)>>2]|0;
        $344 = (($343) - ($246))|0;
        $345 = ($rsize$3$lcssa$i>>>0)<($344>>>0);
        if ($345) {
         $346 = HEAP32[(828)>>2]|0;
         $347 = ($v$3$lcssa$i>>>0)<($346>>>0);
         if ($347) {
          _abort();
          // unreachable;
         }
         $348 = (($v$3$lcssa$i) + ($246)|0);
         $349 = ($v$3$lcssa$i>>>0)<($348>>>0);
         if (!($349)) {
          _abort();
          // unreachable;
         }
         $350 = ((($v$3$lcssa$i)) + 24|0);
         $351 = HEAP32[$350>>2]|0;
         $352 = ((($v$3$lcssa$i)) + 12|0);
         $353 = HEAP32[$352>>2]|0;
         $354 = ($353|0)==($v$3$lcssa$i|0);
         do {
          if ($354) {
           $364 = ((($v$3$lcssa$i)) + 20|0);
           $365 = HEAP32[$364>>2]|0;
           $366 = ($365|0)==(0|0);
           if ($366) {
            $367 = ((($v$3$lcssa$i)) + 16|0);
            $368 = HEAP32[$367>>2]|0;
            $369 = ($368|0)==(0|0);
            if ($369) {
             $R$1$i20 = 0;
             break;
            } else {
             $R$0$i18 = $368;$RP$0$i17 = $367;
            }
           } else {
            $R$0$i18 = $365;$RP$0$i17 = $364;
           }
           while(1) {
            $370 = ((($R$0$i18)) + 20|0);
            $371 = HEAP32[$370>>2]|0;
            $372 = ($371|0)==(0|0);
            if (!($372)) {
             $R$0$i18 = $371;$RP$0$i17 = $370;
             continue;
            }
            $373 = ((($R$0$i18)) + 16|0);
            $374 = HEAP32[$373>>2]|0;
            $375 = ($374|0)==(0|0);
            if ($375) {
             $R$0$i18$lcssa = $R$0$i18;$RP$0$i17$lcssa = $RP$0$i17;
             break;
            } else {
             $R$0$i18 = $374;$RP$0$i17 = $373;
            }
           }
           $376 = ($RP$0$i17$lcssa>>>0)<($346>>>0);
           if ($376) {
            _abort();
            // unreachable;
           } else {
            HEAP32[$RP$0$i17$lcssa>>2] = 0;
            $R$1$i20 = $R$0$i18$lcssa;
            break;
           }
          } else {
           $355 = ((($v$3$lcssa$i)) + 8|0);
           $356 = HEAP32[$355>>2]|0;
           $357 = ($356>>>0)<($346>>>0);
           if ($357) {
            _abort();
            // unreachable;
           }
           $358 = ((($356)) + 12|0);
           $359 = HEAP32[$358>>2]|0;
           $360 = ($359|0)==($v$3$lcssa$i|0);
           if (!($360)) {
            _abort();
            // unreachable;
           }
           $361 = ((($353)) + 8|0);
           $362 = HEAP32[$361>>2]|0;
           $363 = ($362|0)==($v$3$lcssa$i|0);
           if ($363) {
            HEAP32[$358>>2] = $353;
            HEAP32[$361>>2] = $356;
            $R$1$i20 = $353;
            break;
           } else {
            _abort();
            // unreachable;
           }
          }
         } while(0);
         $377 = ($351|0)==(0|0);
         do {
          if (!($377)) {
           $378 = ((($v$3$lcssa$i)) + 28|0);
           $379 = HEAP32[$378>>2]|0;
           $380 = (1116 + ($379<<2)|0);
           $381 = HEAP32[$380>>2]|0;
           $382 = ($v$3$lcssa$i|0)==($381|0);
           if ($382) {
            HEAP32[$380>>2] = $R$1$i20;
            $cond$i21 = ($R$1$i20|0)==(0|0);
            if ($cond$i21) {
             $383 = 1 << $379;
             $384 = $383 ^ -1;
             $385 = HEAP32[(816)>>2]|0;
             $386 = $385 & $384;
             HEAP32[(816)>>2] = $386;
             break;
            }
           } else {
            $387 = HEAP32[(828)>>2]|0;
            $388 = ($351>>>0)<($387>>>0);
            if ($388) {
             _abort();
             // unreachable;
            }
            $389 = ((($351)) + 16|0);
            $390 = HEAP32[$389>>2]|0;
            $391 = ($390|0)==($v$3$lcssa$i|0);
            if ($391) {
             HEAP32[$389>>2] = $R$1$i20;
            } else {
             $392 = ((($351)) + 20|0);
             HEAP32[$392>>2] = $R$1$i20;
            }
            $393 = ($R$1$i20|0)==(0|0);
            if ($393) {
             break;
            }
           }
           $394 = HEAP32[(828)>>2]|0;
           $395 = ($R$1$i20>>>0)<($394>>>0);
           if ($395) {
            _abort();
            // unreachable;
           }
           $396 = ((($R$1$i20)) + 24|0);
           HEAP32[$396>>2] = $351;
           $397 = ((($v$3$lcssa$i)) + 16|0);
           $398 = HEAP32[$397>>2]|0;
           $399 = ($398|0)==(0|0);
           do {
            if (!($399)) {
             $400 = ($398>>>0)<($394>>>0);
             if ($400) {
              _abort();
              // unreachable;
             } else {
              $401 = ((($R$1$i20)) + 16|0);
              HEAP32[$401>>2] = $398;
              $402 = ((($398)) + 24|0);
              HEAP32[$402>>2] = $R$1$i20;
              break;
             }
            }
           } while(0);
           $403 = ((($v$3$lcssa$i)) + 20|0);
           $404 = HEAP32[$403>>2]|0;
           $405 = ($404|0)==(0|0);
           if (!($405)) {
            $406 = HEAP32[(828)>>2]|0;
            $407 = ($404>>>0)<($406>>>0);
            if ($407) {
             _abort();
             // unreachable;
            } else {
             $408 = ((($R$1$i20)) + 20|0);
             HEAP32[$408>>2] = $404;
             $409 = ((($404)) + 24|0);
             HEAP32[$409>>2] = $R$1$i20;
             break;
            }
           }
          }
         } while(0);
         $410 = ($rsize$3$lcssa$i>>>0)<(16);
         L199: do {
          if ($410) {
           $411 = (($rsize$3$lcssa$i) + ($246))|0;
           $412 = $411 | 3;
           $413 = ((($v$3$lcssa$i)) + 4|0);
           HEAP32[$413>>2] = $412;
           $$sum18$i = (($411) + 4)|0;
           $414 = (($v$3$lcssa$i) + ($$sum18$i)|0);
           $415 = HEAP32[$414>>2]|0;
           $416 = $415 | 1;
           HEAP32[$414>>2] = $416;
          } else {
           $417 = $246 | 3;
           $418 = ((($v$3$lcssa$i)) + 4|0);
           HEAP32[$418>>2] = $417;
           $419 = $rsize$3$lcssa$i | 1;
           $$sum$i2334 = $246 | 4;
           $420 = (($v$3$lcssa$i) + ($$sum$i2334)|0);
           HEAP32[$420>>2] = $419;
           $$sum1$i24 = (($rsize$3$lcssa$i) + ($246))|0;
           $421 = (($v$3$lcssa$i) + ($$sum1$i24)|0);
           HEAP32[$421>>2] = $rsize$3$lcssa$i;
           $422 = $rsize$3$lcssa$i >>> 3;
           $423 = ($rsize$3$lcssa$i>>>0)<(256);
           if ($423) {
            $424 = $422 << 1;
            $425 = (852 + ($424<<2)|0);
            $426 = HEAP32[812>>2]|0;
            $427 = 1 << $422;
            $428 = $426 & $427;
            $429 = ($428|0)==(0);
            if ($429) {
             $430 = $426 | $427;
             HEAP32[812>>2] = $430;
             $$pre$i25 = (($424) + 2)|0;
             $$pre43$i = (852 + ($$pre$i25<<2)|0);
             $$pre$phi$i26Z2D = $$pre43$i;$F5$0$i = $425;
            } else {
             $$sum17$i = (($424) + 2)|0;
             $431 = (852 + ($$sum17$i<<2)|0);
             $432 = HEAP32[$431>>2]|0;
             $433 = HEAP32[(828)>>2]|0;
             $434 = ($432>>>0)<($433>>>0);
             if ($434) {
              _abort();
              // unreachable;
             } else {
              $$pre$phi$i26Z2D = $431;$F5$0$i = $432;
             }
            }
            HEAP32[$$pre$phi$i26Z2D>>2] = $348;
            $435 = ((($F5$0$i)) + 12|0);
            HEAP32[$435>>2] = $348;
            $$sum15$i = (($246) + 8)|0;
            $436 = (($v$3$lcssa$i) + ($$sum15$i)|0);
            HEAP32[$436>>2] = $F5$0$i;
            $$sum16$i = (($246) + 12)|0;
            $437 = (($v$3$lcssa$i) + ($$sum16$i)|0);
            HEAP32[$437>>2] = $425;
            break;
           }
           $438 = $rsize$3$lcssa$i >>> 8;
           $439 = ($438|0)==(0);
           if ($439) {
            $I7$0$i = 0;
           } else {
            $440 = ($rsize$3$lcssa$i>>>0)>(16777215);
            if ($440) {
             $I7$0$i = 31;
            } else {
             $441 = (($438) + 1048320)|0;
             $442 = $441 >>> 16;
             $443 = $442 & 8;
             $444 = $438 << $443;
             $445 = (($444) + 520192)|0;
             $446 = $445 >>> 16;
             $447 = $446 & 4;
             $448 = $447 | $443;
             $449 = $444 << $447;
             $450 = (($449) + 245760)|0;
             $451 = $450 >>> 16;
             $452 = $451 & 2;
             $453 = $448 | $452;
             $454 = (14 - ($453))|0;
             $455 = $449 << $452;
             $456 = $455 >>> 15;
             $457 = (($454) + ($456))|0;
             $458 = $457 << 1;
             $459 = (($457) + 7)|0;
             $460 = $rsize$3$lcssa$i >>> $459;
             $461 = $460 & 1;
             $462 = $461 | $458;
             $I7$0$i = $462;
            }
           }
           $463 = (1116 + ($I7$0$i<<2)|0);
           $$sum2$i = (($246) + 28)|0;
           $464 = (($v$3$lcssa$i) + ($$sum2$i)|0);
           HEAP32[$464>>2] = $I7$0$i;
           $$sum3$i27 = (($246) + 16)|0;
           $465 = (($v$3$lcssa$i) + ($$sum3$i27)|0);
           $$sum4$i28 = (($246) + 20)|0;
           $466 = (($v$3$lcssa$i) + ($$sum4$i28)|0);
           HEAP32[$466>>2] = 0;
           HEAP32[$465>>2] = 0;
           $467 = HEAP32[(816)>>2]|0;
           $468 = 1 << $I7$0$i;
           $469 = $467 & $468;
           $470 = ($469|0)==(0);
           if ($470) {
            $471 = $467 | $468;
            HEAP32[(816)>>2] = $471;
            HEAP32[$463>>2] = $348;
            $$sum5$i = (($246) + 24)|0;
            $472 = (($v$3$lcssa$i) + ($$sum5$i)|0);
            HEAP32[$472>>2] = $463;
            $$sum6$i = (($246) + 12)|0;
            $473 = (($v$3$lcssa$i) + ($$sum6$i)|0);
            HEAP32[$473>>2] = $348;
            $$sum7$i = (($246) + 8)|0;
            $474 = (($v$3$lcssa$i) + ($$sum7$i)|0);
            HEAP32[$474>>2] = $348;
            break;
           }
           $475 = HEAP32[$463>>2]|0;
           $476 = ((($475)) + 4|0);
           $477 = HEAP32[$476>>2]|0;
           $478 = $477 & -8;
           $479 = ($478|0)==($rsize$3$lcssa$i|0);
           L217: do {
            if ($479) {
             $T$0$lcssa$i = $475;
            } else {
             $480 = ($I7$0$i|0)==(31);
             $481 = $I7$0$i >>> 1;
             $482 = (25 - ($481))|0;
             $483 = $480 ? 0 : $482;
             $484 = $rsize$3$lcssa$i << $483;
             $K12$029$i = $484;$T$028$i = $475;
             while(1) {
              $491 = $K12$029$i >>> 31;
              $492 = (((($T$028$i)) + 16|0) + ($491<<2)|0);
              $487 = HEAP32[$492>>2]|0;
              $493 = ($487|0)==(0|0);
              if ($493) {
               $$lcssa232 = $492;$T$028$i$lcssa = $T$028$i;
               break;
              }
              $485 = $K12$029$i << 1;
              $486 = ((($487)) + 4|0);
              $488 = HEAP32[$486>>2]|0;
              $489 = $488 & -8;
              $490 = ($489|0)==($rsize$3$lcssa$i|0);
              if ($490) {
               $T$0$lcssa$i = $487;
               break L217;
              } else {
               $K12$029$i = $485;$T$028$i = $487;
              }
             }
             $494 = HEAP32[(828)>>2]|0;
             $495 = ($$lcssa232>>>0)<($494>>>0);
             if ($495) {
              _abort();
              // unreachable;
             } else {
              HEAP32[$$lcssa232>>2] = $348;
              $$sum11$i = (($246) + 24)|0;
              $496 = (($v$3$lcssa$i) + ($$sum11$i)|0);
              HEAP32[$496>>2] = $T$028$i$lcssa;
              $$sum12$i = (($246) + 12)|0;
              $497 = (($v$3$lcssa$i) + ($$sum12$i)|0);
              HEAP32[$497>>2] = $348;
              $$sum13$i = (($246) + 8)|0;
              $498 = (($v$3$lcssa$i) + ($$sum13$i)|0);
              HEAP32[$498>>2] = $348;
              break L199;
             }
            }
           } while(0);
           $499 = ((($T$0$lcssa$i)) + 8|0);
           $500 = HEAP32[$499>>2]|0;
           $501 = HEAP32[(828)>>2]|0;
           $502 = ($500>>>0)>=($501>>>0);
           $not$$i = ($T$0$lcssa$i>>>0)>=($501>>>0);
           $503 = $502 & $not$$i;
           if ($503) {
            $504 = ((($500)) + 12|0);
            HEAP32[$504>>2] = $348;
            HEAP32[$499>>2] = $348;
            $$sum8$i = (($246) + 8)|0;
            $505 = (($v$3$lcssa$i) + ($$sum8$i)|0);
            HEAP32[$505>>2] = $500;
            $$sum9$i = (($246) + 12)|0;
            $506 = (($v$3$lcssa$i) + ($$sum9$i)|0);
            HEAP32[$506>>2] = $T$0$lcssa$i;
            $$sum10$i = (($246) + 24)|0;
            $507 = (($v$3$lcssa$i) + ($$sum10$i)|0);
            HEAP32[$507>>2] = 0;
            break;
           } else {
            _abort();
            // unreachable;
           }
          }
         } while(0);
         $508 = ((($v$3$lcssa$i)) + 8|0);
         $mem$0 = $508;
         return ($mem$0|0);
        } else {
         $nb$0 = $246;
        }
       }
      }
     }
    }
   } while(0);
   $509 = HEAP32[(820)>>2]|0;
   $510 = ($509>>>0)<($nb$0>>>0);
   if (!($510)) {
    $511 = (($509) - ($nb$0))|0;
    $512 = HEAP32[(832)>>2]|0;
    $513 = ($511>>>0)>(15);
    if ($513) {
     $514 = (($512) + ($nb$0)|0);
     HEAP32[(832)>>2] = $514;
     HEAP32[(820)>>2] = $511;
     $515 = $511 | 1;
     $$sum2 = (($nb$0) + 4)|0;
     $516 = (($512) + ($$sum2)|0);
     HEAP32[$516>>2] = $515;
     $517 = (($512) + ($509)|0);
     HEAP32[$517>>2] = $511;
     $518 = $nb$0 | 3;
     $519 = ((($512)) + 4|0);
     HEAP32[$519>>2] = $518;
    } else {
     HEAP32[(820)>>2] = 0;
     HEAP32[(832)>>2] = 0;
     $520 = $509 | 3;
     $521 = ((($512)) + 4|0);
     HEAP32[$521>>2] = $520;
     $$sum1 = (($509) + 4)|0;
     $522 = (($512) + ($$sum1)|0);
     $523 = HEAP32[$522>>2]|0;
     $524 = $523 | 1;
     HEAP32[$522>>2] = $524;
    }
    $525 = ((($512)) + 8|0);
    $mem$0 = $525;
    return ($mem$0|0);
   }
   $526 = HEAP32[(824)>>2]|0;
   $527 = ($526>>>0)>($nb$0>>>0);
   if ($527) {
    $528 = (($526) - ($nb$0))|0;
    HEAP32[(824)>>2] = $528;
    $529 = HEAP32[(836)>>2]|0;
    $530 = (($529) + ($nb$0)|0);
    HEAP32[(836)>>2] = $530;
    $531 = $528 | 1;
    $$sum = (($nb$0) + 4)|0;
    $532 = (($529) + ($$sum)|0);
    HEAP32[$532>>2] = $531;
    $533 = $nb$0 | 3;
    $534 = ((($529)) + 4|0);
    HEAP32[$534>>2] = $533;
    $535 = ((($529)) + 8|0);
    $mem$0 = $535;
    return ($mem$0|0);
   }
   $536 = HEAP32[1284>>2]|0;
   $537 = ($536|0)==(0);
   do {
    if ($537) {
     $538 = (_sysconf(30)|0);
     $539 = (($538) + -1)|0;
     $540 = $539 & $538;
     $541 = ($540|0)==(0);
     if ($541) {
      HEAP32[(1292)>>2] = $538;
      HEAP32[(1288)>>2] = $538;
      HEAP32[(1296)>>2] = -1;
      HEAP32[(1300)>>2] = -1;
      HEAP32[(1304)>>2] = 0;
      HEAP32[(1256)>>2] = 0;
      $542 = (_time((0|0))|0);
      $543 = $542 & -16;
      $544 = $543 ^ 1431655768;
      HEAP32[1284>>2] = $544;
      break;
     } else {
      _abort();
      // unreachable;
     }
    }
   } while(0);
   $545 = (($nb$0) + 48)|0;
   $546 = HEAP32[(1292)>>2]|0;
   $547 = (($nb$0) + 47)|0;
   $548 = (($546) + ($547))|0;
   $549 = (0 - ($546))|0;
   $550 = $548 & $549;
   $551 = ($550>>>0)>($nb$0>>>0);
   if (!($551)) {
    $mem$0 = 0;
    return ($mem$0|0);
   }
   $552 = HEAP32[(1252)>>2]|0;
   $553 = ($552|0)==(0);
   if (!($553)) {
    $554 = HEAP32[(1244)>>2]|0;
    $555 = (($554) + ($550))|0;
    $556 = ($555>>>0)<=($554>>>0);
    $557 = ($555>>>0)>($552>>>0);
    $or$cond1$i = $556 | $557;
    if ($or$cond1$i) {
     $mem$0 = 0;
     return ($mem$0|0);
    }
   }
   $558 = HEAP32[(1256)>>2]|0;
   $559 = $558 & 4;
   $560 = ($559|0)==(0);
   L258: do {
    if ($560) {
     $561 = HEAP32[(836)>>2]|0;
     $562 = ($561|0)==(0|0);
     L260: do {
      if ($562) {
       label = 174;
      } else {
       $sp$0$i$i = (1260);
       while(1) {
        $563 = HEAP32[$sp$0$i$i>>2]|0;
        $564 = ($563>>>0)>($561>>>0);
        if (!($564)) {
         $565 = ((($sp$0$i$i)) + 4|0);
         $566 = HEAP32[$565>>2]|0;
         $567 = (($563) + ($566)|0);
         $568 = ($567>>>0)>($561>>>0);
         if ($568) {
          $$lcssa228 = $sp$0$i$i;$$lcssa230 = $565;
          break;
         }
        }
        $569 = ((($sp$0$i$i)) + 8|0);
        $570 = HEAP32[$569>>2]|0;
        $571 = ($570|0)==(0|0);
        if ($571) {
         label = 174;
         break L260;
        } else {
         $sp$0$i$i = $570;
        }
       }
       $594 = HEAP32[(824)>>2]|0;
       $595 = (($548) - ($594))|0;
       $596 = $595 & $549;
       $597 = ($596>>>0)<(2147483647);
       if ($597) {
        $598 = (_sbrk(($596|0))|0);
        $599 = HEAP32[$$lcssa228>>2]|0;
        $600 = HEAP32[$$lcssa230>>2]|0;
        $601 = (($599) + ($600)|0);
        $602 = ($598|0)==($601|0);
        $$3$i = $602 ? $596 : 0;
        if ($602) {
         $603 = ($598|0)==((-1)|0);
         if ($603) {
          $tsize$0323944$i = $$3$i;
         } else {
          $tbase$255$i = $598;$tsize$254$i = $$3$i;
          label = 194;
          break L258;
         }
        } else {
         $br$0$ph$i = $598;$ssize$1$ph$i = $596;$tsize$0$ph$i = $$3$i;
         label = 184;
        }
       } else {
        $tsize$0323944$i = 0;
       }
      }
     } while(0);
     do {
      if ((label|0) == 174) {
       $572 = (_sbrk(0)|0);
       $573 = ($572|0)==((-1)|0);
       if ($573) {
        $tsize$0323944$i = 0;
       } else {
        $574 = $572;
        $575 = HEAP32[(1288)>>2]|0;
        $576 = (($575) + -1)|0;
        $577 = $576 & $574;
        $578 = ($577|0)==(0);
        if ($578) {
         $ssize$0$i = $550;
        } else {
         $579 = (($576) + ($574))|0;
         $580 = (0 - ($575))|0;
         $581 = $579 & $580;
         $582 = (($550) - ($574))|0;
         $583 = (($582) + ($581))|0;
         $ssize$0$i = $583;
        }
        $584 = HEAP32[(1244)>>2]|0;
        $585 = (($584) + ($ssize$0$i))|0;
        $586 = ($ssize$0$i>>>0)>($nb$0>>>0);
        $587 = ($ssize$0$i>>>0)<(2147483647);
        $or$cond$i30 = $586 & $587;
        if ($or$cond$i30) {
         $588 = HEAP32[(1252)>>2]|0;
         $589 = ($588|0)==(0);
         if (!($589)) {
          $590 = ($585>>>0)<=($584>>>0);
          $591 = ($585>>>0)>($588>>>0);
          $or$cond2$i = $590 | $591;
          if ($or$cond2$i) {
           $tsize$0323944$i = 0;
           break;
          }
         }
         $592 = (_sbrk(($ssize$0$i|0))|0);
         $593 = ($592|0)==($572|0);
         $ssize$0$$i = $593 ? $ssize$0$i : 0;
         if ($593) {
          $tbase$255$i = $572;$tsize$254$i = $ssize$0$$i;
          label = 194;
          break L258;
         } else {
          $br$0$ph$i = $592;$ssize$1$ph$i = $ssize$0$i;$tsize$0$ph$i = $ssize$0$$i;
          label = 184;
         }
        } else {
         $tsize$0323944$i = 0;
        }
       }
      }
     } while(0);
     L280: do {
      if ((label|0) == 184) {
       $604 = (0 - ($ssize$1$ph$i))|0;
       $605 = ($br$0$ph$i|0)!=((-1)|0);
       $606 = ($ssize$1$ph$i>>>0)<(2147483647);
       $or$cond5$i = $606 & $605;
       $607 = ($545>>>0)>($ssize$1$ph$i>>>0);
       $or$cond6$i = $607 & $or$cond5$i;
       do {
        if ($or$cond6$i) {
         $608 = HEAP32[(1292)>>2]|0;
         $609 = (($547) - ($ssize$1$ph$i))|0;
         $610 = (($609) + ($608))|0;
         $611 = (0 - ($608))|0;
         $612 = $610 & $611;
         $613 = ($612>>>0)<(2147483647);
         if ($613) {
          $614 = (_sbrk(($612|0))|0);
          $615 = ($614|0)==((-1)|0);
          if ($615) {
           (_sbrk(($604|0))|0);
           $tsize$0323944$i = $tsize$0$ph$i;
           break L280;
          } else {
           $616 = (($612) + ($ssize$1$ph$i))|0;
           $ssize$2$i = $616;
           break;
          }
         } else {
          $ssize$2$i = $ssize$1$ph$i;
         }
        } else {
         $ssize$2$i = $ssize$1$ph$i;
        }
       } while(0);
       $617 = ($br$0$ph$i|0)==((-1)|0);
       if ($617) {
        $tsize$0323944$i = $tsize$0$ph$i;
       } else {
        $tbase$255$i = $br$0$ph$i;$tsize$254$i = $ssize$2$i;
        label = 194;
        break L258;
       }
      }
     } while(0);
     $618 = HEAP32[(1256)>>2]|0;
     $619 = $618 | 4;
     HEAP32[(1256)>>2] = $619;
     $tsize$1$i = $tsize$0323944$i;
     label = 191;
    } else {
     $tsize$1$i = 0;
     label = 191;
    }
   } while(0);
   if ((label|0) == 191) {
    $620 = ($550>>>0)<(2147483647);
    if ($620) {
     $621 = (_sbrk(($550|0))|0);
     $622 = (_sbrk(0)|0);
     $623 = ($621|0)!=((-1)|0);
     $624 = ($622|0)!=((-1)|0);
     $or$cond3$i = $623 & $624;
     $625 = ($621>>>0)<($622>>>0);
     $or$cond8$i = $625 & $or$cond3$i;
     if ($or$cond8$i) {
      $626 = $622;
      $627 = $621;
      $628 = (($626) - ($627))|0;
      $629 = (($nb$0) + 40)|0;
      $630 = ($628>>>0)>($629>>>0);
      $$tsize$1$i = $630 ? $628 : $tsize$1$i;
      if ($630) {
       $tbase$255$i = $621;$tsize$254$i = $$tsize$1$i;
       label = 194;
      }
     }
    }
   }
   if ((label|0) == 194) {
    $631 = HEAP32[(1244)>>2]|0;
    $632 = (($631) + ($tsize$254$i))|0;
    HEAP32[(1244)>>2] = $632;
    $633 = HEAP32[(1248)>>2]|0;
    $634 = ($632>>>0)>($633>>>0);
    if ($634) {
     HEAP32[(1248)>>2] = $632;
    }
    $635 = HEAP32[(836)>>2]|0;
    $636 = ($635|0)==(0|0);
    L299: do {
     if ($636) {
      $637 = HEAP32[(828)>>2]|0;
      $638 = ($637|0)==(0|0);
      $639 = ($tbase$255$i>>>0)<($637>>>0);
      $or$cond9$i = $638 | $639;
      if ($or$cond9$i) {
       HEAP32[(828)>>2] = $tbase$255$i;
      }
      HEAP32[(1260)>>2] = $tbase$255$i;
      HEAP32[(1264)>>2] = $tsize$254$i;
      HEAP32[(1272)>>2] = 0;
      $640 = HEAP32[1284>>2]|0;
      HEAP32[(848)>>2] = $640;
      HEAP32[(844)>>2] = -1;
      $i$02$i$i = 0;
      while(1) {
       $641 = $i$02$i$i << 1;
       $642 = (852 + ($641<<2)|0);
       $$sum$i$i = (($641) + 3)|0;
       $643 = (852 + ($$sum$i$i<<2)|0);
       HEAP32[$643>>2] = $642;
       $$sum1$i$i = (($641) + 2)|0;
       $644 = (852 + ($$sum1$i$i<<2)|0);
       HEAP32[$644>>2] = $642;
       $645 = (($i$02$i$i) + 1)|0;
       $exitcond$i$i = ($645|0)==(32);
       if ($exitcond$i$i) {
        break;
       } else {
        $i$02$i$i = $645;
       }
      }
      $646 = (($tsize$254$i) + -40)|0;
      $647 = ((($tbase$255$i)) + 8|0);
      $648 = $647;
      $649 = $648 & 7;
      $650 = ($649|0)==(0);
      $651 = (0 - ($648))|0;
      $652 = $651 & 7;
      $653 = $650 ? 0 : $652;
      $654 = (($tbase$255$i) + ($653)|0);
      $655 = (($646) - ($653))|0;
      HEAP32[(836)>>2] = $654;
      HEAP32[(824)>>2] = $655;
      $656 = $655 | 1;
      $$sum$i13$i = (($653) + 4)|0;
      $657 = (($tbase$255$i) + ($$sum$i13$i)|0);
      HEAP32[$657>>2] = $656;
      $$sum2$i$i = (($tsize$254$i) + -36)|0;
      $658 = (($tbase$255$i) + ($$sum2$i$i)|0);
      HEAP32[$658>>2] = 40;
      $659 = HEAP32[(1300)>>2]|0;
      HEAP32[(840)>>2] = $659;
     } else {
      $sp$084$i = (1260);
      while(1) {
       $660 = HEAP32[$sp$084$i>>2]|0;
       $661 = ((($sp$084$i)) + 4|0);
       $662 = HEAP32[$661>>2]|0;
       $663 = (($660) + ($662)|0);
       $664 = ($tbase$255$i|0)==($663|0);
       if ($664) {
        $$lcssa222 = $660;$$lcssa224 = $661;$$lcssa226 = $662;$sp$084$i$lcssa = $sp$084$i;
        label = 204;
        break;
       }
       $665 = ((($sp$084$i)) + 8|0);
       $666 = HEAP32[$665>>2]|0;
       $667 = ($666|0)==(0|0);
       if ($667) {
        break;
       } else {
        $sp$084$i = $666;
       }
      }
      if ((label|0) == 204) {
       $668 = ((($sp$084$i$lcssa)) + 12|0);
       $669 = HEAP32[$668>>2]|0;
       $670 = $669 & 8;
       $671 = ($670|0)==(0);
       if ($671) {
        $672 = ($635>>>0)>=($$lcssa222>>>0);
        $673 = ($635>>>0)<($tbase$255$i>>>0);
        $or$cond57$i = $673 & $672;
        if ($or$cond57$i) {
         $674 = (($$lcssa226) + ($tsize$254$i))|0;
         HEAP32[$$lcssa224>>2] = $674;
         $675 = HEAP32[(824)>>2]|0;
         $676 = (($675) + ($tsize$254$i))|0;
         $677 = ((($635)) + 8|0);
         $678 = $677;
         $679 = $678 & 7;
         $680 = ($679|0)==(0);
         $681 = (0 - ($678))|0;
         $682 = $681 & 7;
         $683 = $680 ? 0 : $682;
         $684 = (($635) + ($683)|0);
         $685 = (($676) - ($683))|0;
         HEAP32[(836)>>2] = $684;
         HEAP32[(824)>>2] = $685;
         $686 = $685 | 1;
         $$sum$i17$i = (($683) + 4)|0;
         $687 = (($635) + ($$sum$i17$i)|0);
         HEAP32[$687>>2] = $686;
         $$sum2$i18$i = (($676) + 4)|0;
         $688 = (($635) + ($$sum2$i18$i)|0);
         HEAP32[$688>>2] = 40;
         $689 = HEAP32[(1300)>>2]|0;
         HEAP32[(840)>>2] = $689;
         break;
        }
       }
      }
      $690 = HEAP32[(828)>>2]|0;
      $691 = ($tbase$255$i>>>0)<($690>>>0);
      if ($691) {
       HEAP32[(828)>>2] = $tbase$255$i;
       $755 = $tbase$255$i;
      } else {
       $755 = $690;
      }
      $692 = (($tbase$255$i) + ($tsize$254$i)|0);
      $sp$183$i = (1260);
      while(1) {
       $693 = HEAP32[$sp$183$i>>2]|0;
       $694 = ($693|0)==($692|0);
       if ($694) {
        $$lcssa219 = $sp$183$i;$sp$183$i$lcssa = $sp$183$i;
        label = 212;
        break;
       }
       $695 = ((($sp$183$i)) + 8|0);
       $696 = HEAP32[$695>>2]|0;
       $697 = ($696|0)==(0|0);
       if ($697) {
        $sp$0$i$i$i = (1260);
        break;
       } else {
        $sp$183$i = $696;
       }
      }
      if ((label|0) == 212) {
       $698 = ((($sp$183$i$lcssa)) + 12|0);
       $699 = HEAP32[$698>>2]|0;
       $700 = $699 & 8;
       $701 = ($700|0)==(0);
       if ($701) {
        HEAP32[$$lcssa219>>2] = $tbase$255$i;
        $702 = ((($sp$183$i$lcssa)) + 4|0);
        $703 = HEAP32[$702>>2]|0;
        $704 = (($703) + ($tsize$254$i))|0;
        HEAP32[$702>>2] = $704;
        $705 = ((($tbase$255$i)) + 8|0);
        $706 = $705;
        $707 = $706 & 7;
        $708 = ($707|0)==(0);
        $709 = (0 - ($706))|0;
        $710 = $709 & 7;
        $711 = $708 ? 0 : $710;
        $712 = (($tbase$255$i) + ($711)|0);
        $$sum112$i = (($tsize$254$i) + 8)|0;
        $713 = (($tbase$255$i) + ($$sum112$i)|0);
        $714 = $713;
        $715 = $714 & 7;
        $716 = ($715|0)==(0);
        $717 = (0 - ($714))|0;
        $718 = $717 & 7;
        $719 = $716 ? 0 : $718;
        $$sum113$i = (($719) + ($tsize$254$i))|0;
        $720 = (($tbase$255$i) + ($$sum113$i)|0);
        $721 = $720;
        $722 = $712;
        $723 = (($721) - ($722))|0;
        $$sum$i19$i = (($711) + ($nb$0))|0;
        $724 = (($tbase$255$i) + ($$sum$i19$i)|0);
        $725 = (($723) - ($nb$0))|0;
        $726 = $nb$0 | 3;
        $$sum1$i20$i = (($711) + 4)|0;
        $727 = (($tbase$255$i) + ($$sum1$i20$i)|0);
        HEAP32[$727>>2] = $726;
        $728 = ($720|0)==($635|0);
        L324: do {
         if ($728) {
          $729 = HEAP32[(824)>>2]|0;
          $730 = (($729) + ($725))|0;
          HEAP32[(824)>>2] = $730;
          HEAP32[(836)>>2] = $724;
          $731 = $730 | 1;
          $$sum42$i$i = (($$sum$i19$i) + 4)|0;
          $732 = (($tbase$255$i) + ($$sum42$i$i)|0);
          HEAP32[$732>>2] = $731;
         } else {
          $733 = HEAP32[(832)>>2]|0;
          $734 = ($720|0)==($733|0);
          if ($734) {
           $735 = HEAP32[(820)>>2]|0;
           $736 = (($735) + ($725))|0;
           HEAP32[(820)>>2] = $736;
           HEAP32[(832)>>2] = $724;
           $737 = $736 | 1;
           $$sum40$i$i = (($$sum$i19$i) + 4)|0;
           $738 = (($tbase$255$i) + ($$sum40$i$i)|0);
           HEAP32[$738>>2] = $737;
           $$sum41$i$i = (($736) + ($$sum$i19$i))|0;
           $739 = (($tbase$255$i) + ($$sum41$i$i)|0);
           HEAP32[$739>>2] = $736;
           break;
          }
          $$sum2$i21$i = (($tsize$254$i) + 4)|0;
          $$sum114$i = (($$sum2$i21$i) + ($719))|0;
          $740 = (($tbase$255$i) + ($$sum114$i)|0);
          $741 = HEAP32[$740>>2]|0;
          $742 = $741 & 3;
          $743 = ($742|0)==(1);
          if ($743) {
           $744 = $741 & -8;
           $745 = $741 >>> 3;
           $746 = ($741>>>0)<(256);
           L332: do {
            if ($746) {
             $$sum3738$i$i = $719 | 8;
             $$sum124$i = (($$sum3738$i$i) + ($tsize$254$i))|0;
             $747 = (($tbase$255$i) + ($$sum124$i)|0);
             $748 = HEAP32[$747>>2]|0;
             $$sum39$i$i = (($tsize$254$i) + 12)|0;
             $$sum125$i = (($$sum39$i$i) + ($719))|0;
             $749 = (($tbase$255$i) + ($$sum125$i)|0);
             $750 = HEAP32[$749>>2]|0;
             $751 = $745 << 1;
             $752 = (852 + ($751<<2)|0);
             $753 = ($748|0)==($752|0);
             do {
              if (!($753)) {
               $754 = ($748>>>0)<($755>>>0);
               if ($754) {
                _abort();
                // unreachable;
               }
               $756 = ((($748)) + 12|0);
               $757 = HEAP32[$756>>2]|0;
               $758 = ($757|0)==($720|0);
               if ($758) {
                break;
               }
               _abort();
               // unreachable;
              }
             } while(0);
             $759 = ($750|0)==($748|0);
             if ($759) {
              $760 = 1 << $745;
              $761 = $760 ^ -1;
              $762 = HEAP32[812>>2]|0;
              $763 = $762 & $761;
              HEAP32[812>>2] = $763;
              break;
             }
             $764 = ($750|0)==($752|0);
             do {
              if ($764) {
               $$pre57$i$i = ((($750)) + 8|0);
               $$pre$phi58$i$iZ2D = $$pre57$i$i;
              } else {
               $765 = ($750>>>0)<($755>>>0);
               if ($765) {
                _abort();
                // unreachable;
               }
               $766 = ((($750)) + 8|0);
               $767 = HEAP32[$766>>2]|0;
               $768 = ($767|0)==($720|0);
               if ($768) {
                $$pre$phi58$i$iZ2D = $766;
                break;
               }
               _abort();
               // unreachable;
              }
             } while(0);
             $769 = ((($748)) + 12|0);
             HEAP32[$769>>2] = $750;
             HEAP32[$$pre$phi58$i$iZ2D>>2] = $748;
            } else {
             $$sum34$i$i = $719 | 24;
             $$sum115$i = (($$sum34$i$i) + ($tsize$254$i))|0;
             $770 = (($tbase$255$i) + ($$sum115$i)|0);
             $771 = HEAP32[$770>>2]|0;
             $$sum5$i$i = (($tsize$254$i) + 12)|0;
             $$sum116$i = (($$sum5$i$i) + ($719))|0;
             $772 = (($tbase$255$i) + ($$sum116$i)|0);
             $773 = HEAP32[$772>>2]|0;
             $774 = ($773|0)==($720|0);
             do {
              if ($774) {
               $$sum67$i$i = $719 | 16;
               $$sum122$i = (($$sum2$i21$i) + ($$sum67$i$i))|0;
               $784 = (($tbase$255$i) + ($$sum122$i)|0);
               $785 = HEAP32[$784>>2]|0;
               $786 = ($785|0)==(0|0);
               if ($786) {
                $$sum123$i = (($$sum67$i$i) + ($tsize$254$i))|0;
                $787 = (($tbase$255$i) + ($$sum123$i)|0);
                $788 = HEAP32[$787>>2]|0;
                $789 = ($788|0)==(0|0);
                if ($789) {
                 $R$1$i$i = 0;
                 break;
                } else {
                 $R$0$i$i = $788;$RP$0$i$i = $787;
                }
               } else {
                $R$0$i$i = $785;$RP$0$i$i = $784;
               }
               while(1) {
                $790 = ((($R$0$i$i)) + 20|0);
                $791 = HEAP32[$790>>2]|0;
                $792 = ($791|0)==(0|0);
                if (!($792)) {
                 $R$0$i$i = $791;$RP$0$i$i = $790;
                 continue;
                }
                $793 = ((($R$0$i$i)) + 16|0);
                $794 = HEAP32[$793>>2]|0;
                $795 = ($794|0)==(0|0);
                if ($795) {
                 $R$0$i$i$lcssa = $R$0$i$i;$RP$0$i$i$lcssa = $RP$0$i$i;
                 break;
                } else {
                 $R$0$i$i = $794;$RP$0$i$i = $793;
                }
               }
               $796 = ($RP$0$i$i$lcssa>>>0)<($755>>>0);
               if ($796) {
                _abort();
                // unreachable;
               } else {
                HEAP32[$RP$0$i$i$lcssa>>2] = 0;
                $R$1$i$i = $R$0$i$i$lcssa;
                break;
               }
              } else {
               $$sum3536$i$i = $719 | 8;
               $$sum117$i = (($$sum3536$i$i) + ($tsize$254$i))|0;
               $775 = (($tbase$255$i) + ($$sum117$i)|0);
               $776 = HEAP32[$775>>2]|0;
               $777 = ($776>>>0)<($755>>>0);
               if ($777) {
                _abort();
                // unreachable;
               }
               $778 = ((($776)) + 12|0);
               $779 = HEAP32[$778>>2]|0;
               $780 = ($779|0)==($720|0);
               if (!($780)) {
                _abort();
                // unreachable;
               }
               $781 = ((($773)) + 8|0);
               $782 = HEAP32[$781>>2]|0;
               $783 = ($782|0)==($720|0);
               if ($783) {
                HEAP32[$778>>2] = $773;
                HEAP32[$781>>2] = $776;
                $R$1$i$i = $773;
                break;
               } else {
                _abort();
                // unreachable;
               }
              }
             } while(0);
             $797 = ($771|0)==(0|0);
             if ($797) {
              break;
             }
             $$sum30$i$i = (($tsize$254$i) + 28)|0;
             $$sum118$i = (($$sum30$i$i) + ($719))|0;
             $798 = (($tbase$255$i) + ($$sum118$i)|0);
             $799 = HEAP32[$798>>2]|0;
             $800 = (1116 + ($799<<2)|0);
             $801 = HEAP32[$800>>2]|0;
             $802 = ($720|0)==($801|0);
             do {
              if ($802) {
               HEAP32[$800>>2] = $R$1$i$i;
               $cond$i$i = ($R$1$i$i|0)==(0|0);
               if (!($cond$i$i)) {
                break;
               }
               $803 = 1 << $799;
               $804 = $803 ^ -1;
               $805 = HEAP32[(816)>>2]|0;
               $806 = $805 & $804;
               HEAP32[(816)>>2] = $806;
               break L332;
              } else {
               $807 = HEAP32[(828)>>2]|0;
               $808 = ($771>>>0)<($807>>>0);
               if ($808) {
                _abort();
                // unreachable;
               }
               $809 = ((($771)) + 16|0);
               $810 = HEAP32[$809>>2]|0;
               $811 = ($810|0)==($720|0);
               if ($811) {
                HEAP32[$809>>2] = $R$1$i$i;
               } else {
                $812 = ((($771)) + 20|0);
                HEAP32[$812>>2] = $R$1$i$i;
               }
               $813 = ($R$1$i$i|0)==(0|0);
               if ($813) {
                break L332;
               }
              }
             } while(0);
             $814 = HEAP32[(828)>>2]|0;
             $815 = ($R$1$i$i>>>0)<($814>>>0);
             if ($815) {
              _abort();
              // unreachable;
             }
             $816 = ((($R$1$i$i)) + 24|0);
             HEAP32[$816>>2] = $771;
             $$sum3132$i$i = $719 | 16;
             $$sum119$i = (($$sum3132$i$i) + ($tsize$254$i))|0;
             $817 = (($tbase$255$i) + ($$sum119$i)|0);
             $818 = HEAP32[$817>>2]|0;
             $819 = ($818|0)==(0|0);
             do {
              if (!($819)) {
               $820 = ($818>>>0)<($814>>>0);
               if ($820) {
                _abort();
                // unreachable;
               } else {
                $821 = ((($R$1$i$i)) + 16|0);
                HEAP32[$821>>2] = $818;
                $822 = ((($818)) + 24|0);
                HEAP32[$822>>2] = $R$1$i$i;
                break;
               }
              }
             } while(0);
             $$sum120$i = (($$sum2$i21$i) + ($$sum3132$i$i))|0;
             $823 = (($tbase$255$i) + ($$sum120$i)|0);
             $824 = HEAP32[$823>>2]|0;
             $825 = ($824|0)==(0|0);
             if ($825) {
              break;
             }
             $826 = HEAP32[(828)>>2]|0;
             $827 = ($824>>>0)<($826>>>0);
             if ($827) {
              _abort();
              // unreachable;
             } else {
              $828 = ((($R$1$i$i)) + 20|0);
              HEAP32[$828>>2] = $824;
              $829 = ((($824)) + 24|0);
              HEAP32[$829>>2] = $R$1$i$i;
              break;
             }
            }
           } while(0);
           $$sum9$i$i = $744 | $719;
           $$sum121$i = (($$sum9$i$i) + ($tsize$254$i))|0;
           $830 = (($tbase$255$i) + ($$sum121$i)|0);
           $831 = (($744) + ($725))|0;
           $oldfirst$0$i$i = $830;$qsize$0$i$i = $831;
          } else {
           $oldfirst$0$i$i = $720;$qsize$0$i$i = $725;
          }
          $832 = ((($oldfirst$0$i$i)) + 4|0);
          $833 = HEAP32[$832>>2]|0;
          $834 = $833 & -2;
          HEAP32[$832>>2] = $834;
          $835 = $qsize$0$i$i | 1;
          $$sum10$i$i = (($$sum$i19$i) + 4)|0;
          $836 = (($tbase$255$i) + ($$sum10$i$i)|0);
          HEAP32[$836>>2] = $835;
          $$sum11$i$i = (($qsize$0$i$i) + ($$sum$i19$i))|0;
          $837 = (($tbase$255$i) + ($$sum11$i$i)|0);
          HEAP32[$837>>2] = $qsize$0$i$i;
          $838 = $qsize$0$i$i >>> 3;
          $839 = ($qsize$0$i$i>>>0)<(256);
          if ($839) {
           $840 = $838 << 1;
           $841 = (852 + ($840<<2)|0);
           $842 = HEAP32[812>>2]|0;
           $843 = 1 << $838;
           $844 = $842 & $843;
           $845 = ($844|0)==(0);
           do {
            if ($845) {
             $846 = $842 | $843;
             HEAP32[812>>2] = $846;
             $$pre$i22$i = (($840) + 2)|0;
             $$pre56$i$i = (852 + ($$pre$i22$i<<2)|0);
             $$pre$phi$i23$iZ2D = $$pre56$i$i;$F4$0$i$i = $841;
            } else {
             $$sum29$i$i = (($840) + 2)|0;
             $847 = (852 + ($$sum29$i$i<<2)|0);
             $848 = HEAP32[$847>>2]|0;
             $849 = HEAP32[(828)>>2]|0;
             $850 = ($848>>>0)<($849>>>0);
             if (!($850)) {
              $$pre$phi$i23$iZ2D = $847;$F4$0$i$i = $848;
              break;
             }
             _abort();
             // unreachable;
            }
           } while(0);
           HEAP32[$$pre$phi$i23$iZ2D>>2] = $724;
           $851 = ((($F4$0$i$i)) + 12|0);
           HEAP32[$851>>2] = $724;
           $$sum27$i$i = (($$sum$i19$i) + 8)|0;
           $852 = (($tbase$255$i) + ($$sum27$i$i)|0);
           HEAP32[$852>>2] = $F4$0$i$i;
           $$sum28$i$i = (($$sum$i19$i) + 12)|0;
           $853 = (($tbase$255$i) + ($$sum28$i$i)|0);
           HEAP32[$853>>2] = $841;
           break;
          }
          $854 = $qsize$0$i$i >>> 8;
          $855 = ($854|0)==(0);
          do {
           if ($855) {
            $I7$0$i$i = 0;
           } else {
            $856 = ($qsize$0$i$i>>>0)>(16777215);
            if ($856) {
             $I7$0$i$i = 31;
             break;
            }
            $857 = (($854) + 1048320)|0;
            $858 = $857 >>> 16;
            $859 = $858 & 8;
            $860 = $854 << $859;
            $861 = (($860) + 520192)|0;
            $862 = $861 >>> 16;
            $863 = $862 & 4;
            $864 = $863 | $859;
            $865 = $860 << $863;
            $866 = (($865) + 245760)|0;
            $867 = $866 >>> 16;
            $868 = $867 & 2;
            $869 = $864 | $868;
            $870 = (14 - ($869))|0;
            $871 = $865 << $868;
            $872 = $871 >>> 15;
            $873 = (($870) + ($872))|0;
            $874 = $873 << 1;
            $875 = (($873) + 7)|0;
            $876 = $qsize$0$i$i >>> $875;
            $877 = $876 & 1;
            $878 = $877 | $874;
            $I7$0$i$i = $878;
           }
          } while(0);
          $879 = (1116 + ($I7$0$i$i<<2)|0);
          $$sum12$i$i = (($$sum$i19$i) + 28)|0;
          $880 = (($tbase$255$i) + ($$sum12$i$i)|0);
          HEAP32[$880>>2] = $I7$0$i$i;
          $$sum13$i$i = (($$sum$i19$i) + 16)|0;
          $881 = (($tbase$255$i) + ($$sum13$i$i)|0);
          $$sum14$i$i = (($$sum$i19$i) + 20)|0;
          $882 = (($tbase$255$i) + ($$sum14$i$i)|0);
          HEAP32[$882>>2] = 0;
          HEAP32[$881>>2] = 0;
          $883 = HEAP32[(816)>>2]|0;
          $884 = 1 << $I7$0$i$i;
          $885 = $883 & $884;
          $886 = ($885|0)==(0);
          if ($886) {
           $887 = $883 | $884;
           HEAP32[(816)>>2] = $887;
           HEAP32[$879>>2] = $724;
           $$sum15$i$i = (($$sum$i19$i) + 24)|0;
           $888 = (($tbase$255$i) + ($$sum15$i$i)|0);
           HEAP32[$888>>2] = $879;
           $$sum16$i$i = (($$sum$i19$i) + 12)|0;
           $889 = (($tbase$255$i) + ($$sum16$i$i)|0);
           HEAP32[$889>>2] = $724;
           $$sum17$i$i = (($$sum$i19$i) + 8)|0;
           $890 = (($tbase$255$i) + ($$sum17$i$i)|0);
           HEAP32[$890>>2] = $724;
           break;
          }
          $891 = HEAP32[$879>>2]|0;
          $892 = ((($891)) + 4|0);
          $893 = HEAP32[$892>>2]|0;
          $894 = $893 & -8;
          $895 = ($894|0)==($qsize$0$i$i|0);
          L418: do {
           if ($895) {
            $T$0$lcssa$i25$i = $891;
           } else {
            $896 = ($I7$0$i$i|0)==(31);
            $897 = $I7$0$i$i >>> 1;
            $898 = (25 - ($897))|0;
            $899 = $896 ? 0 : $898;
            $900 = $qsize$0$i$i << $899;
            $K8$051$i$i = $900;$T$050$i$i = $891;
            while(1) {
             $907 = $K8$051$i$i >>> 31;
             $908 = (((($T$050$i$i)) + 16|0) + ($907<<2)|0);
             $903 = HEAP32[$908>>2]|0;
             $909 = ($903|0)==(0|0);
             if ($909) {
              $$lcssa = $908;$T$050$i$i$lcssa = $T$050$i$i;
              break;
             }
             $901 = $K8$051$i$i << 1;
             $902 = ((($903)) + 4|0);
             $904 = HEAP32[$902>>2]|0;
             $905 = $904 & -8;
             $906 = ($905|0)==($qsize$0$i$i|0);
             if ($906) {
              $T$0$lcssa$i25$i = $903;
              break L418;
             } else {
              $K8$051$i$i = $901;$T$050$i$i = $903;
             }
            }
            $910 = HEAP32[(828)>>2]|0;
            $911 = ($$lcssa>>>0)<($910>>>0);
            if ($911) {
             _abort();
             // unreachable;
            } else {
             HEAP32[$$lcssa>>2] = $724;
             $$sum23$i$i = (($$sum$i19$i) + 24)|0;
             $912 = (($tbase$255$i) + ($$sum23$i$i)|0);
             HEAP32[$912>>2] = $T$050$i$i$lcssa;
             $$sum24$i$i = (($$sum$i19$i) + 12)|0;
             $913 = (($tbase$255$i) + ($$sum24$i$i)|0);
             HEAP32[$913>>2] = $724;
             $$sum25$i$i = (($$sum$i19$i) + 8)|0;
             $914 = (($tbase$255$i) + ($$sum25$i$i)|0);
             HEAP32[$914>>2] = $724;
             break L324;
            }
           }
          } while(0);
          $915 = ((($T$0$lcssa$i25$i)) + 8|0);
          $916 = HEAP32[$915>>2]|0;
          $917 = HEAP32[(828)>>2]|0;
          $918 = ($916>>>0)>=($917>>>0);
          $not$$i26$i = ($T$0$lcssa$i25$i>>>0)>=($917>>>0);
          $919 = $918 & $not$$i26$i;
          if ($919) {
           $920 = ((($916)) + 12|0);
           HEAP32[$920>>2] = $724;
           HEAP32[$915>>2] = $724;
           $$sum20$i$i = (($$sum$i19$i) + 8)|0;
           $921 = (($tbase$255$i) + ($$sum20$i$i)|0);
           HEAP32[$921>>2] = $916;
           $$sum21$i$i = (($$sum$i19$i) + 12)|0;
           $922 = (($tbase$255$i) + ($$sum21$i$i)|0);
           HEAP32[$922>>2] = $T$0$lcssa$i25$i;
           $$sum22$i$i = (($$sum$i19$i) + 24)|0;
           $923 = (($tbase$255$i) + ($$sum22$i$i)|0);
           HEAP32[$923>>2] = 0;
           break;
          } else {
           _abort();
           // unreachable;
          }
         }
        } while(0);
        $$sum1819$i$i = $711 | 8;
        $924 = (($tbase$255$i) + ($$sum1819$i$i)|0);
        $mem$0 = $924;
        return ($mem$0|0);
       } else {
        $sp$0$i$i$i = (1260);
       }
      }
      while(1) {
       $925 = HEAP32[$sp$0$i$i$i>>2]|0;
       $926 = ($925>>>0)>($635>>>0);
       if (!($926)) {
        $927 = ((($sp$0$i$i$i)) + 4|0);
        $928 = HEAP32[$927>>2]|0;
        $929 = (($925) + ($928)|0);
        $930 = ($929>>>0)>($635>>>0);
        if ($930) {
         $$lcssa215 = $925;$$lcssa216 = $928;$$lcssa217 = $929;
         break;
        }
       }
       $931 = ((($sp$0$i$i$i)) + 8|0);
       $932 = HEAP32[$931>>2]|0;
       $sp$0$i$i$i = $932;
      }
      $$sum$i14$i = (($$lcssa216) + -47)|0;
      $$sum1$i15$i = (($$lcssa216) + -39)|0;
      $933 = (($$lcssa215) + ($$sum1$i15$i)|0);
      $934 = $933;
      $935 = $934 & 7;
      $936 = ($935|0)==(0);
      $937 = (0 - ($934))|0;
      $938 = $937 & 7;
      $939 = $936 ? 0 : $938;
      $$sum2$i16$i = (($$sum$i14$i) + ($939))|0;
      $940 = (($$lcssa215) + ($$sum2$i16$i)|0);
      $941 = ((($635)) + 16|0);
      $942 = ($940>>>0)<($941>>>0);
      $943 = $942 ? $635 : $940;
      $944 = ((($943)) + 8|0);
      $945 = (($tsize$254$i) + -40)|0;
      $946 = ((($tbase$255$i)) + 8|0);
      $947 = $946;
      $948 = $947 & 7;
      $949 = ($948|0)==(0);
      $950 = (0 - ($947))|0;
      $951 = $950 & 7;
      $952 = $949 ? 0 : $951;
      $953 = (($tbase$255$i) + ($952)|0);
      $954 = (($945) - ($952))|0;
      HEAP32[(836)>>2] = $953;
      HEAP32[(824)>>2] = $954;
      $955 = $954 | 1;
      $$sum$i$i$i = (($952) + 4)|0;
      $956 = (($tbase$255$i) + ($$sum$i$i$i)|0);
      HEAP32[$956>>2] = $955;
      $$sum2$i$i$i = (($tsize$254$i) + -36)|0;
      $957 = (($tbase$255$i) + ($$sum2$i$i$i)|0);
      HEAP32[$957>>2] = 40;
      $958 = HEAP32[(1300)>>2]|0;
      HEAP32[(840)>>2] = $958;
      $959 = ((($943)) + 4|0);
      HEAP32[$959>>2] = 27;
      ;HEAP32[$944>>2]=HEAP32[(1260)>>2]|0;HEAP32[$944+4>>2]=HEAP32[(1260)+4>>2]|0;HEAP32[$944+8>>2]=HEAP32[(1260)+8>>2]|0;HEAP32[$944+12>>2]=HEAP32[(1260)+12>>2]|0;
      HEAP32[(1260)>>2] = $tbase$255$i;
      HEAP32[(1264)>>2] = $tsize$254$i;
      HEAP32[(1272)>>2] = 0;
      HEAP32[(1268)>>2] = $944;
      $960 = ((($943)) + 28|0);
      HEAP32[$960>>2] = 7;
      $961 = ((($943)) + 32|0);
      $962 = ($961>>>0)<($$lcssa217>>>0);
      if ($962) {
       $964 = $960;
       while(1) {
        $963 = ((($964)) + 4|0);
        HEAP32[$963>>2] = 7;
        $965 = ((($964)) + 8|0);
        $966 = ($965>>>0)<($$lcssa217>>>0);
        if ($966) {
         $964 = $963;
        } else {
         break;
        }
       }
      }
      $967 = ($943|0)==($635|0);
      if (!($967)) {
       $968 = $943;
       $969 = $635;
       $970 = (($968) - ($969))|0;
       $971 = HEAP32[$959>>2]|0;
       $972 = $971 & -2;
       HEAP32[$959>>2] = $972;
       $973 = $970 | 1;
       $974 = ((($635)) + 4|0);
       HEAP32[$974>>2] = $973;
       HEAP32[$943>>2] = $970;
       $975 = $970 >>> 3;
       $976 = ($970>>>0)<(256);
       if ($976) {
        $977 = $975 << 1;
        $978 = (852 + ($977<<2)|0);
        $979 = HEAP32[812>>2]|0;
        $980 = 1 << $975;
        $981 = $979 & $980;
        $982 = ($981|0)==(0);
        if ($982) {
         $983 = $979 | $980;
         HEAP32[812>>2] = $983;
         $$pre$i$i = (($977) + 2)|0;
         $$pre14$i$i = (852 + ($$pre$i$i<<2)|0);
         $$pre$phi$i$iZ2D = $$pre14$i$i;$F$0$i$i = $978;
        } else {
         $$sum4$i$i = (($977) + 2)|0;
         $984 = (852 + ($$sum4$i$i<<2)|0);
         $985 = HEAP32[$984>>2]|0;
         $986 = HEAP32[(828)>>2]|0;
         $987 = ($985>>>0)<($986>>>0);
         if ($987) {
          _abort();
          // unreachable;
         } else {
          $$pre$phi$i$iZ2D = $984;$F$0$i$i = $985;
         }
        }
        HEAP32[$$pre$phi$i$iZ2D>>2] = $635;
        $988 = ((($F$0$i$i)) + 12|0);
        HEAP32[$988>>2] = $635;
        $989 = ((($635)) + 8|0);
        HEAP32[$989>>2] = $F$0$i$i;
        $990 = ((($635)) + 12|0);
        HEAP32[$990>>2] = $978;
        break;
       }
       $991 = $970 >>> 8;
       $992 = ($991|0)==(0);
       if ($992) {
        $I1$0$i$i = 0;
       } else {
        $993 = ($970>>>0)>(16777215);
        if ($993) {
         $I1$0$i$i = 31;
        } else {
         $994 = (($991) + 1048320)|0;
         $995 = $994 >>> 16;
         $996 = $995 & 8;
         $997 = $991 << $996;
         $998 = (($997) + 520192)|0;
         $999 = $998 >>> 16;
         $1000 = $999 & 4;
         $1001 = $1000 | $996;
         $1002 = $997 << $1000;
         $1003 = (($1002) + 245760)|0;
         $1004 = $1003 >>> 16;
         $1005 = $1004 & 2;
         $1006 = $1001 | $1005;
         $1007 = (14 - ($1006))|0;
         $1008 = $1002 << $1005;
         $1009 = $1008 >>> 15;
         $1010 = (($1007) + ($1009))|0;
         $1011 = $1010 << 1;
         $1012 = (($1010) + 7)|0;
         $1013 = $970 >>> $1012;
         $1014 = $1013 & 1;
         $1015 = $1014 | $1011;
         $I1$0$i$i = $1015;
        }
       }
       $1016 = (1116 + ($I1$0$i$i<<2)|0);
       $1017 = ((($635)) + 28|0);
       HEAP32[$1017>>2] = $I1$0$i$i;
       $1018 = ((($635)) + 20|0);
       HEAP32[$1018>>2] = 0;
       HEAP32[$941>>2] = 0;
       $1019 = HEAP32[(816)>>2]|0;
       $1020 = 1 << $I1$0$i$i;
       $1021 = $1019 & $1020;
       $1022 = ($1021|0)==(0);
       if ($1022) {
        $1023 = $1019 | $1020;
        HEAP32[(816)>>2] = $1023;
        HEAP32[$1016>>2] = $635;
        $1024 = ((($635)) + 24|0);
        HEAP32[$1024>>2] = $1016;
        $1025 = ((($635)) + 12|0);
        HEAP32[$1025>>2] = $635;
        $1026 = ((($635)) + 8|0);
        HEAP32[$1026>>2] = $635;
        break;
       }
       $1027 = HEAP32[$1016>>2]|0;
       $1028 = ((($1027)) + 4|0);
       $1029 = HEAP32[$1028>>2]|0;
       $1030 = $1029 & -8;
       $1031 = ($1030|0)==($970|0);
       L459: do {
        if ($1031) {
         $T$0$lcssa$i$i = $1027;
        } else {
         $1032 = ($I1$0$i$i|0)==(31);
         $1033 = $I1$0$i$i >>> 1;
         $1034 = (25 - ($1033))|0;
         $1035 = $1032 ? 0 : $1034;
         $1036 = $970 << $1035;
         $K2$07$i$i = $1036;$T$06$i$i = $1027;
         while(1) {
          $1043 = $K2$07$i$i >>> 31;
          $1044 = (((($T$06$i$i)) + 16|0) + ($1043<<2)|0);
          $1039 = HEAP32[$1044>>2]|0;
          $1045 = ($1039|0)==(0|0);
          if ($1045) {
           $$lcssa211 = $1044;$T$06$i$i$lcssa = $T$06$i$i;
           break;
          }
          $1037 = $K2$07$i$i << 1;
          $1038 = ((($1039)) + 4|0);
          $1040 = HEAP32[$1038>>2]|0;
          $1041 = $1040 & -8;
          $1042 = ($1041|0)==($970|0);
          if ($1042) {
           $T$0$lcssa$i$i = $1039;
           break L459;
          } else {
           $K2$07$i$i = $1037;$T$06$i$i = $1039;
          }
         }
         $1046 = HEAP32[(828)>>2]|0;
         $1047 = ($$lcssa211>>>0)<($1046>>>0);
         if ($1047) {
          _abort();
          // unreachable;
         } else {
          HEAP32[$$lcssa211>>2] = $635;
          $1048 = ((($635)) + 24|0);
          HEAP32[$1048>>2] = $T$06$i$i$lcssa;
          $1049 = ((($635)) + 12|0);
          HEAP32[$1049>>2] = $635;
          $1050 = ((($635)) + 8|0);
          HEAP32[$1050>>2] = $635;
          break L299;
         }
        }
       } while(0);
       $1051 = ((($T$0$lcssa$i$i)) + 8|0);
       $1052 = HEAP32[$1051>>2]|0;
       $1053 = HEAP32[(828)>>2]|0;
       $1054 = ($1052>>>0)>=($1053>>>0);
       $not$$i$i = ($T$0$lcssa$i$i>>>0)>=($1053>>>0);
       $1055 = $1054 & $not$$i$i;
       if ($1055) {
        $1056 = ((($1052)) + 12|0);
        HEAP32[$1056>>2] = $635;
        HEAP32[$1051>>2] = $635;
        $1057 = ((($635)) + 8|0);
        HEAP32[$1057>>2] = $1052;
        $1058 = ((($635)) + 12|0);
        HEAP32[$1058>>2] = $T$0$lcssa$i$i;
        $1059 = ((($635)) + 24|0);
        HEAP32[$1059>>2] = 0;
        break;
       } else {
        _abort();
        // unreachable;
       }
      }
     }
    } while(0);
    $1060 = HEAP32[(824)>>2]|0;
    $1061 = ($1060>>>0)>($nb$0>>>0);
    if ($1061) {
     $1062 = (($1060) - ($nb$0))|0;
     HEAP32[(824)>>2] = $1062;
     $1063 = HEAP32[(836)>>2]|0;
     $1064 = (($1063) + ($nb$0)|0);
     HEAP32[(836)>>2] = $1064;
     $1065 = $1062 | 1;
     $$sum$i32 = (($nb$0) + 4)|0;
     $1066 = (($1063) + ($$sum$i32)|0);
     HEAP32[$1066>>2] = $1065;
     $1067 = $nb$0 | 3;
     $1068 = ((($1063)) + 4|0);
     HEAP32[$1068>>2] = $1067;
     $1069 = ((($1063)) + 8|0);
     $mem$0 = $1069;
     return ($mem$0|0);
    }
   }
   $1070 = (___errno_location()|0);
   HEAP32[$1070>>2] = 12;
   $mem$0 = 0;
   return ($mem$0|0);
  }
  function _free($mem) {
   $mem = $mem|0;
   var $$lcssa = 0, $$pre = 0, $$pre$phi59Z2D = 0, $$pre$phi61Z2D = 0, $$pre$phiZ2D = 0, $$pre57 = 0, $$pre58 = 0, $$pre60 = 0, $$sum = 0, $$sum11 = 0, $$sum12 = 0, $$sum13 = 0, $$sum14 = 0, $$sum1718 = 0, $$sum19 = 0, $$sum2 = 0, $$sum20 = 0, $$sum22 = 0, $$sum23 = 0, $$sum24 = 0;
   var $$sum25 = 0, $$sum26 = 0, $$sum27 = 0, $$sum28 = 0, $$sum29 = 0, $$sum3 = 0, $$sum30 = 0, $$sum31 = 0, $$sum5 = 0, $$sum67 = 0, $$sum8 = 0, $$sum9 = 0, $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0;
   var $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0;
   var $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0;
   var $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0;
   var $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0;
   var $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0;
   var $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0;
   var $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0;
   var $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0, $242 = 0, $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0;
   var $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0, $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0;
   var $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0;
   var $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0, $298 = 0, $299 = 0, $3 = 0, $30 = 0, $300 = 0, $301 = 0, $302 = 0;
   var $303 = 0, $304 = 0, $305 = 0, $306 = 0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0, $312 = 0, $313 = 0, $314 = 0, $315 = 0, $316 = 0, $317 = 0, $318 = 0, $319 = 0, $32 = 0, $320 = 0;
   var $321 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0;
   var $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0;
   var $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0;
   var $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $F16$0 = 0, $I18$0 = 0, $K19$052 = 0, $R$0 = 0, $R$0$lcssa = 0, $R$1 = 0;
   var $R7$0 = 0, $R7$0$lcssa = 0, $R7$1 = 0, $RP$0 = 0, $RP$0$lcssa = 0, $RP9$0 = 0, $RP9$0$lcssa = 0, $T$0$lcssa = 0, $T$051 = 0, $T$051$lcssa = 0, $cond = 0, $cond47 = 0, $not$ = 0, $p$0 = 0, $psize$0 = 0, $psize$1 = 0, $sp$0$i = 0, $sp$0$in$i = 0, label = 0, sp = 0;
   sp = STACKTOP;
   $0 = ($mem|0)==(0|0);
   if ($0) {
    return;
   }
   $1 = ((($mem)) + -8|0);
   $2 = HEAP32[(828)>>2]|0;
   $3 = ($1>>>0)<($2>>>0);
   if ($3) {
    _abort();
    // unreachable;
   }
   $4 = ((($mem)) + -4|0);
   $5 = HEAP32[$4>>2]|0;
   $6 = $5 & 3;
   $7 = ($6|0)==(1);
   if ($7) {
    _abort();
    // unreachable;
   }
   $8 = $5 & -8;
   $$sum = (($8) + -8)|0;
   $9 = (($mem) + ($$sum)|0);
   $10 = $5 & 1;
   $11 = ($10|0)==(0);
   do {
    if ($11) {
     $12 = HEAP32[$1>>2]|0;
     $13 = ($6|0)==(0);
     if ($13) {
      return;
     }
     $$sum2 = (-8 - ($12))|0;
     $14 = (($mem) + ($$sum2)|0);
     $15 = (($12) + ($8))|0;
     $16 = ($14>>>0)<($2>>>0);
     if ($16) {
      _abort();
      // unreachable;
     }
     $17 = HEAP32[(832)>>2]|0;
     $18 = ($14|0)==($17|0);
     if ($18) {
      $$sum3 = (($8) + -4)|0;
      $103 = (($mem) + ($$sum3)|0);
      $104 = HEAP32[$103>>2]|0;
      $105 = $104 & 3;
      $106 = ($105|0)==(3);
      if (!($106)) {
       $p$0 = $14;$psize$0 = $15;
       break;
      }
      HEAP32[(820)>>2] = $15;
      $107 = $104 & -2;
      HEAP32[$103>>2] = $107;
      $108 = $15 | 1;
      $$sum20 = (($$sum2) + 4)|0;
      $109 = (($mem) + ($$sum20)|0);
      HEAP32[$109>>2] = $108;
      HEAP32[$9>>2] = $15;
      return;
     }
     $19 = $12 >>> 3;
     $20 = ($12>>>0)<(256);
     if ($20) {
      $$sum30 = (($$sum2) + 8)|0;
      $21 = (($mem) + ($$sum30)|0);
      $22 = HEAP32[$21>>2]|0;
      $$sum31 = (($$sum2) + 12)|0;
      $23 = (($mem) + ($$sum31)|0);
      $24 = HEAP32[$23>>2]|0;
      $25 = $19 << 1;
      $26 = (852 + ($25<<2)|0);
      $27 = ($22|0)==($26|0);
      if (!($27)) {
       $28 = ($22>>>0)<($2>>>0);
       if ($28) {
        _abort();
        // unreachable;
       }
       $29 = ((($22)) + 12|0);
       $30 = HEAP32[$29>>2]|0;
       $31 = ($30|0)==($14|0);
       if (!($31)) {
        _abort();
        // unreachable;
       }
      }
      $32 = ($24|0)==($22|0);
      if ($32) {
       $33 = 1 << $19;
       $34 = $33 ^ -1;
       $35 = HEAP32[812>>2]|0;
       $36 = $35 & $34;
       HEAP32[812>>2] = $36;
       $p$0 = $14;$psize$0 = $15;
       break;
      }
      $37 = ($24|0)==($26|0);
      if ($37) {
       $$pre60 = ((($24)) + 8|0);
       $$pre$phi61Z2D = $$pre60;
      } else {
       $38 = ($24>>>0)<($2>>>0);
       if ($38) {
        _abort();
        // unreachable;
       }
       $39 = ((($24)) + 8|0);
       $40 = HEAP32[$39>>2]|0;
       $41 = ($40|0)==($14|0);
       if ($41) {
        $$pre$phi61Z2D = $39;
       } else {
        _abort();
        // unreachable;
       }
      }
      $42 = ((($22)) + 12|0);
      HEAP32[$42>>2] = $24;
      HEAP32[$$pre$phi61Z2D>>2] = $22;
      $p$0 = $14;$psize$0 = $15;
      break;
     }
     $$sum22 = (($$sum2) + 24)|0;
     $43 = (($mem) + ($$sum22)|0);
     $44 = HEAP32[$43>>2]|0;
     $$sum23 = (($$sum2) + 12)|0;
     $45 = (($mem) + ($$sum23)|0);
     $46 = HEAP32[$45>>2]|0;
     $47 = ($46|0)==($14|0);
     do {
      if ($47) {
       $$sum25 = (($$sum2) + 20)|0;
       $57 = (($mem) + ($$sum25)|0);
       $58 = HEAP32[$57>>2]|0;
       $59 = ($58|0)==(0|0);
       if ($59) {
        $$sum24 = (($$sum2) + 16)|0;
        $60 = (($mem) + ($$sum24)|0);
        $61 = HEAP32[$60>>2]|0;
        $62 = ($61|0)==(0|0);
        if ($62) {
         $R$1 = 0;
         break;
        } else {
         $R$0 = $61;$RP$0 = $60;
        }
       } else {
        $R$0 = $58;$RP$0 = $57;
       }
       while(1) {
        $63 = ((($R$0)) + 20|0);
        $64 = HEAP32[$63>>2]|0;
        $65 = ($64|0)==(0|0);
        if (!($65)) {
         $R$0 = $64;$RP$0 = $63;
         continue;
        }
        $66 = ((($R$0)) + 16|0);
        $67 = HEAP32[$66>>2]|0;
        $68 = ($67|0)==(0|0);
        if ($68) {
         $R$0$lcssa = $R$0;$RP$0$lcssa = $RP$0;
         break;
        } else {
         $R$0 = $67;$RP$0 = $66;
        }
       }
       $69 = ($RP$0$lcssa>>>0)<($2>>>0);
       if ($69) {
        _abort();
        // unreachable;
       } else {
        HEAP32[$RP$0$lcssa>>2] = 0;
        $R$1 = $R$0$lcssa;
        break;
       }
      } else {
       $$sum29 = (($$sum2) + 8)|0;
       $48 = (($mem) + ($$sum29)|0);
       $49 = HEAP32[$48>>2]|0;
       $50 = ($49>>>0)<($2>>>0);
       if ($50) {
        _abort();
        // unreachable;
       }
       $51 = ((($49)) + 12|0);
       $52 = HEAP32[$51>>2]|0;
       $53 = ($52|0)==($14|0);
       if (!($53)) {
        _abort();
        // unreachable;
       }
       $54 = ((($46)) + 8|0);
       $55 = HEAP32[$54>>2]|0;
       $56 = ($55|0)==($14|0);
       if ($56) {
        HEAP32[$51>>2] = $46;
        HEAP32[$54>>2] = $49;
        $R$1 = $46;
        break;
       } else {
        _abort();
        // unreachable;
       }
      }
     } while(0);
     $70 = ($44|0)==(0|0);
     if ($70) {
      $p$0 = $14;$psize$0 = $15;
     } else {
      $$sum26 = (($$sum2) + 28)|0;
      $71 = (($mem) + ($$sum26)|0);
      $72 = HEAP32[$71>>2]|0;
      $73 = (1116 + ($72<<2)|0);
      $74 = HEAP32[$73>>2]|0;
      $75 = ($14|0)==($74|0);
      if ($75) {
       HEAP32[$73>>2] = $R$1;
       $cond = ($R$1|0)==(0|0);
       if ($cond) {
        $76 = 1 << $72;
        $77 = $76 ^ -1;
        $78 = HEAP32[(816)>>2]|0;
        $79 = $78 & $77;
        HEAP32[(816)>>2] = $79;
        $p$0 = $14;$psize$0 = $15;
        break;
       }
      } else {
       $80 = HEAP32[(828)>>2]|0;
       $81 = ($44>>>0)<($80>>>0);
       if ($81) {
        _abort();
        // unreachable;
       }
       $82 = ((($44)) + 16|0);
       $83 = HEAP32[$82>>2]|0;
       $84 = ($83|0)==($14|0);
       if ($84) {
        HEAP32[$82>>2] = $R$1;
       } else {
        $85 = ((($44)) + 20|0);
        HEAP32[$85>>2] = $R$1;
       }
       $86 = ($R$1|0)==(0|0);
       if ($86) {
        $p$0 = $14;$psize$0 = $15;
        break;
       }
      }
      $87 = HEAP32[(828)>>2]|0;
      $88 = ($R$1>>>0)<($87>>>0);
      if ($88) {
       _abort();
       // unreachable;
      }
      $89 = ((($R$1)) + 24|0);
      HEAP32[$89>>2] = $44;
      $$sum27 = (($$sum2) + 16)|0;
      $90 = (($mem) + ($$sum27)|0);
      $91 = HEAP32[$90>>2]|0;
      $92 = ($91|0)==(0|0);
      do {
       if (!($92)) {
        $93 = ($91>>>0)<($87>>>0);
        if ($93) {
         _abort();
         // unreachable;
        } else {
         $94 = ((($R$1)) + 16|0);
         HEAP32[$94>>2] = $91;
         $95 = ((($91)) + 24|0);
         HEAP32[$95>>2] = $R$1;
         break;
        }
       }
      } while(0);
      $$sum28 = (($$sum2) + 20)|0;
      $96 = (($mem) + ($$sum28)|0);
      $97 = HEAP32[$96>>2]|0;
      $98 = ($97|0)==(0|0);
      if ($98) {
       $p$0 = $14;$psize$0 = $15;
      } else {
       $99 = HEAP32[(828)>>2]|0;
       $100 = ($97>>>0)<($99>>>0);
       if ($100) {
        _abort();
        // unreachable;
       } else {
        $101 = ((($R$1)) + 20|0);
        HEAP32[$101>>2] = $97;
        $102 = ((($97)) + 24|0);
        HEAP32[$102>>2] = $R$1;
        $p$0 = $14;$psize$0 = $15;
        break;
       }
      }
     }
    } else {
     $p$0 = $1;$psize$0 = $8;
    }
   } while(0);
   $110 = ($p$0>>>0)<($9>>>0);
   if (!($110)) {
    _abort();
    // unreachable;
   }
   $$sum19 = (($8) + -4)|0;
   $111 = (($mem) + ($$sum19)|0);
   $112 = HEAP32[$111>>2]|0;
   $113 = $112 & 1;
   $114 = ($113|0)==(0);
   if ($114) {
    _abort();
    // unreachable;
   }
   $115 = $112 & 2;
   $116 = ($115|0)==(0);
   if ($116) {
    $117 = HEAP32[(836)>>2]|0;
    $118 = ($9|0)==($117|0);
    if ($118) {
     $119 = HEAP32[(824)>>2]|0;
     $120 = (($119) + ($psize$0))|0;
     HEAP32[(824)>>2] = $120;
     HEAP32[(836)>>2] = $p$0;
     $121 = $120 | 1;
     $122 = ((($p$0)) + 4|0);
     HEAP32[$122>>2] = $121;
     $123 = HEAP32[(832)>>2]|0;
     $124 = ($p$0|0)==($123|0);
     if (!($124)) {
      return;
     }
     HEAP32[(832)>>2] = 0;
     HEAP32[(820)>>2] = 0;
     return;
    }
    $125 = HEAP32[(832)>>2]|0;
    $126 = ($9|0)==($125|0);
    if ($126) {
     $127 = HEAP32[(820)>>2]|0;
     $128 = (($127) + ($psize$0))|0;
     HEAP32[(820)>>2] = $128;
     HEAP32[(832)>>2] = $p$0;
     $129 = $128 | 1;
     $130 = ((($p$0)) + 4|0);
     HEAP32[$130>>2] = $129;
     $131 = (($p$0) + ($128)|0);
     HEAP32[$131>>2] = $128;
     return;
    }
    $132 = $112 & -8;
    $133 = (($132) + ($psize$0))|0;
    $134 = $112 >>> 3;
    $135 = ($112>>>0)<(256);
    do {
     if ($135) {
      $136 = (($mem) + ($8)|0);
      $137 = HEAP32[$136>>2]|0;
      $$sum1718 = $8 | 4;
      $138 = (($mem) + ($$sum1718)|0);
      $139 = HEAP32[$138>>2]|0;
      $140 = $134 << 1;
      $141 = (852 + ($140<<2)|0);
      $142 = ($137|0)==($141|0);
      if (!($142)) {
       $143 = HEAP32[(828)>>2]|0;
       $144 = ($137>>>0)<($143>>>0);
       if ($144) {
        _abort();
        // unreachable;
       }
       $145 = ((($137)) + 12|0);
       $146 = HEAP32[$145>>2]|0;
       $147 = ($146|0)==($9|0);
       if (!($147)) {
        _abort();
        // unreachable;
       }
      }
      $148 = ($139|0)==($137|0);
      if ($148) {
       $149 = 1 << $134;
       $150 = $149 ^ -1;
       $151 = HEAP32[812>>2]|0;
       $152 = $151 & $150;
       HEAP32[812>>2] = $152;
       break;
      }
      $153 = ($139|0)==($141|0);
      if ($153) {
       $$pre58 = ((($139)) + 8|0);
       $$pre$phi59Z2D = $$pre58;
      } else {
       $154 = HEAP32[(828)>>2]|0;
       $155 = ($139>>>0)<($154>>>0);
       if ($155) {
        _abort();
        // unreachable;
       }
       $156 = ((($139)) + 8|0);
       $157 = HEAP32[$156>>2]|0;
       $158 = ($157|0)==($9|0);
       if ($158) {
        $$pre$phi59Z2D = $156;
       } else {
        _abort();
        // unreachable;
       }
      }
      $159 = ((($137)) + 12|0);
      HEAP32[$159>>2] = $139;
      HEAP32[$$pre$phi59Z2D>>2] = $137;
     } else {
      $$sum5 = (($8) + 16)|0;
      $160 = (($mem) + ($$sum5)|0);
      $161 = HEAP32[$160>>2]|0;
      $$sum67 = $8 | 4;
      $162 = (($mem) + ($$sum67)|0);
      $163 = HEAP32[$162>>2]|0;
      $164 = ($163|0)==($9|0);
      do {
       if ($164) {
        $$sum9 = (($8) + 12)|0;
        $175 = (($mem) + ($$sum9)|0);
        $176 = HEAP32[$175>>2]|0;
        $177 = ($176|0)==(0|0);
        if ($177) {
         $$sum8 = (($8) + 8)|0;
         $178 = (($mem) + ($$sum8)|0);
         $179 = HEAP32[$178>>2]|0;
         $180 = ($179|0)==(0|0);
         if ($180) {
          $R7$1 = 0;
          break;
         } else {
          $R7$0 = $179;$RP9$0 = $178;
         }
        } else {
         $R7$0 = $176;$RP9$0 = $175;
        }
        while(1) {
         $181 = ((($R7$0)) + 20|0);
         $182 = HEAP32[$181>>2]|0;
         $183 = ($182|0)==(0|0);
         if (!($183)) {
          $R7$0 = $182;$RP9$0 = $181;
          continue;
         }
         $184 = ((($R7$0)) + 16|0);
         $185 = HEAP32[$184>>2]|0;
         $186 = ($185|0)==(0|0);
         if ($186) {
          $R7$0$lcssa = $R7$0;$RP9$0$lcssa = $RP9$0;
          break;
         } else {
          $R7$0 = $185;$RP9$0 = $184;
         }
        }
        $187 = HEAP32[(828)>>2]|0;
        $188 = ($RP9$0$lcssa>>>0)<($187>>>0);
        if ($188) {
         _abort();
         // unreachable;
        } else {
         HEAP32[$RP9$0$lcssa>>2] = 0;
         $R7$1 = $R7$0$lcssa;
         break;
        }
       } else {
        $165 = (($mem) + ($8)|0);
        $166 = HEAP32[$165>>2]|0;
        $167 = HEAP32[(828)>>2]|0;
        $168 = ($166>>>0)<($167>>>0);
        if ($168) {
         _abort();
         // unreachable;
        }
        $169 = ((($166)) + 12|0);
        $170 = HEAP32[$169>>2]|0;
        $171 = ($170|0)==($9|0);
        if (!($171)) {
         _abort();
         // unreachable;
        }
        $172 = ((($163)) + 8|0);
        $173 = HEAP32[$172>>2]|0;
        $174 = ($173|0)==($9|0);
        if ($174) {
         HEAP32[$169>>2] = $163;
         HEAP32[$172>>2] = $166;
         $R7$1 = $163;
         break;
        } else {
         _abort();
         // unreachable;
        }
       }
      } while(0);
      $189 = ($161|0)==(0|0);
      if (!($189)) {
       $$sum12 = (($8) + 20)|0;
       $190 = (($mem) + ($$sum12)|0);
       $191 = HEAP32[$190>>2]|0;
       $192 = (1116 + ($191<<2)|0);
       $193 = HEAP32[$192>>2]|0;
       $194 = ($9|0)==($193|0);
       if ($194) {
        HEAP32[$192>>2] = $R7$1;
        $cond47 = ($R7$1|0)==(0|0);
        if ($cond47) {
         $195 = 1 << $191;
         $196 = $195 ^ -1;
         $197 = HEAP32[(816)>>2]|0;
         $198 = $197 & $196;
         HEAP32[(816)>>2] = $198;
         break;
        }
       } else {
        $199 = HEAP32[(828)>>2]|0;
        $200 = ($161>>>0)<($199>>>0);
        if ($200) {
         _abort();
         // unreachable;
        }
        $201 = ((($161)) + 16|0);
        $202 = HEAP32[$201>>2]|0;
        $203 = ($202|0)==($9|0);
        if ($203) {
         HEAP32[$201>>2] = $R7$1;
        } else {
         $204 = ((($161)) + 20|0);
         HEAP32[$204>>2] = $R7$1;
        }
        $205 = ($R7$1|0)==(0|0);
        if ($205) {
         break;
        }
       }
       $206 = HEAP32[(828)>>2]|0;
       $207 = ($R7$1>>>0)<($206>>>0);
       if ($207) {
        _abort();
        // unreachable;
       }
       $208 = ((($R7$1)) + 24|0);
       HEAP32[$208>>2] = $161;
       $$sum13 = (($8) + 8)|0;
       $209 = (($mem) + ($$sum13)|0);
       $210 = HEAP32[$209>>2]|0;
       $211 = ($210|0)==(0|0);
       do {
        if (!($211)) {
         $212 = ($210>>>0)<($206>>>0);
         if ($212) {
          _abort();
          // unreachable;
         } else {
          $213 = ((($R7$1)) + 16|0);
          HEAP32[$213>>2] = $210;
          $214 = ((($210)) + 24|0);
          HEAP32[$214>>2] = $R7$1;
          break;
         }
        }
       } while(0);
       $$sum14 = (($8) + 12)|0;
       $215 = (($mem) + ($$sum14)|0);
       $216 = HEAP32[$215>>2]|0;
       $217 = ($216|0)==(0|0);
       if (!($217)) {
        $218 = HEAP32[(828)>>2]|0;
        $219 = ($216>>>0)<($218>>>0);
        if ($219) {
         _abort();
         // unreachable;
        } else {
         $220 = ((($R7$1)) + 20|0);
         HEAP32[$220>>2] = $216;
         $221 = ((($216)) + 24|0);
         HEAP32[$221>>2] = $R7$1;
         break;
        }
       }
      }
     }
    } while(0);
    $222 = $133 | 1;
    $223 = ((($p$0)) + 4|0);
    HEAP32[$223>>2] = $222;
    $224 = (($p$0) + ($133)|0);
    HEAP32[$224>>2] = $133;
    $225 = HEAP32[(832)>>2]|0;
    $226 = ($p$0|0)==($225|0);
    if ($226) {
     HEAP32[(820)>>2] = $133;
     return;
    } else {
     $psize$1 = $133;
    }
   } else {
    $227 = $112 & -2;
    HEAP32[$111>>2] = $227;
    $228 = $psize$0 | 1;
    $229 = ((($p$0)) + 4|0);
    HEAP32[$229>>2] = $228;
    $230 = (($p$0) + ($psize$0)|0);
    HEAP32[$230>>2] = $psize$0;
    $psize$1 = $psize$0;
   }
   $231 = $psize$1 >>> 3;
   $232 = ($psize$1>>>0)<(256);
   if ($232) {
    $233 = $231 << 1;
    $234 = (852 + ($233<<2)|0);
    $235 = HEAP32[812>>2]|0;
    $236 = 1 << $231;
    $237 = $235 & $236;
    $238 = ($237|0)==(0);
    if ($238) {
     $239 = $235 | $236;
     HEAP32[812>>2] = $239;
     $$pre = (($233) + 2)|0;
     $$pre57 = (852 + ($$pre<<2)|0);
     $$pre$phiZ2D = $$pre57;$F16$0 = $234;
    } else {
     $$sum11 = (($233) + 2)|0;
     $240 = (852 + ($$sum11<<2)|0);
     $241 = HEAP32[$240>>2]|0;
     $242 = HEAP32[(828)>>2]|0;
     $243 = ($241>>>0)<($242>>>0);
     if ($243) {
      _abort();
      // unreachable;
     } else {
      $$pre$phiZ2D = $240;$F16$0 = $241;
     }
    }
    HEAP32[$$pre$phiZ2D>>2] = $p$0;
    $244 = ((($F16$0)) + 12|0);
    HEAP32[$244>>2] = $p$0;
    $245 = ((($p$0)) + 8|0);
    HEAP32[$245>>2] = $F16$0;
    $246 = ((($p$0)) + 12|0);
    HEAP32[$246>>2] = $234;
    return;
   }
   $247 = $psize$1 >>> 8;
   $248 = ($247|0)==(0);
   if ($248) {
    $I18$0 = 0;
   } else {
    $249 = ($psize$1>>>0)>(16777215);
    if ($249) {
     $I18$0 = 31;
    } else {
     $250 = (($247) + 1048320)|0;
     $251 = $250 >>> 16;
     $252 = $251 & 8;
     $253 = $247 << $252;
     $254 = (($253) + 520192)|0;
     $255 = $254 >>> 16;
     $256 = $255 & 4;
     $257 = $256 | $252;
     $258 = $253 << $256;
     $259 = (($258) + 245760)|0;
     $260 = $259 >>> 16;
     $261 = $260 & 2;
     $262 = $257 | $261;
     $263 = (14 - ($262))|0;
     $264 = $258 << $261;
     $265 = $264 >>> 15;
     $266 = (($263) + ($265))|0;
     $267 = $266 << 1;
     $268 = (($266) + 7)|0;
     $269 = $psize$1 >>> $268;
     $270 = $269 & 1;
     $271 = $270 | $267;
     $I18$0 = $271;
    }
   }
   $272 = (1116 + ($I18$0<<2)|0);
   $273 = ((($p$0)) + 28|0);
   HEAP32[$273>>2] = $I18$0;
   $274 = ((($p$0)) + 16|0);
   $275 = ((($p$0)) + 20|0);
   HEAP32[$275>>2] = 0;
   HEAP32[$274>>2] = 0;
   $276 = HEAP32[(816)>>2]|0;
   $277 = 1 << $I18$0;
   $278 = $276 & $277;
   $279 = ($278|0)==(0);
   L199: do {
    if ($279) {
     $280 = $276 | $277;
     HEAP32[(816)>>2] = $280;
     HEAP32[$272>>2] = $p$0;
     $281 = ((($p$0)) + 24|0);
     HEAP32[$281>>2] = $272;
     $282 = ((($p$0)) + 12|0);
     HEAP32[$282>>2] = $p$0;
     $283 = ((($p$0)) + 8|0);
     HEAP32[$283>>2] = $p$0;
    } else {
     $284 = HEAP32[$272>>2]|0;
     $285 = ((($284)) + 4|0);
     $286 = HEAP32[$285>>2]|0;
     $287 = $286 & -8;
     $288 = ($287|0)==($psize$1|0);
     L202: do {
      if ($288) {
       $T$0$lcssa = $284;
      } else {
       $289 = ($I18$0|0)==(31);
       $290 = $I18$0 >>> 1;
       $291 = (25 - ($290))|0;
       $292 = $289 ? 0 : $291;
       $293 = $psize$1 << $292;
       $K19$052 = $293;$T$051 = $284;
       while(1) {
        $300 = $K19$052 >>> 31;
        $301 = (((($T$051)) + 16|0) + ($300<<2)|0);
        $296 = HEAP32[$301>>2]|0;
        $302 = ($296|0)==(0|0);
        if ($302) {
         $$lcssa = $301;$T$051$lcssa = $T$051;
         break;
        }
        $294 = $K19$052 << 1;
        $295 = ((($296)) + 4|0);
        $297 = HEAP32[$295>>2]|0;
        $298 = $297 & -8;
        $299 = ($298|0)==($psize$1|0);
        if ($299) {
         $T$0$lcssa = $296;
         break L202;
        } else {
         $K19$052 = $294;$T$051 = $296;
        }
       }
       $303 = HEAP32[(828)>>2]|0;
       $304 = ($$lcssa>>>0)<($303>>>0);
       if ($304) {
        _abort();
        // unreachable;
       } else {
        HEAP32[$$lcssa>>2] = $p$0;
        $305 = ((($p$0)) + 24|0);
        HEAP32[$305>>2] = $T$051$lcssa;
        $306 = ((($p$0)) + 12|0);
        HEAP32[$306>>2] = $p$0;
        $307 = ((($p$0)) + 8|0);
        HEAP32[$307>>2] = $p$0;
        break L199;
       }
      }
     } while(0);
     $308 = ((($T$0$lcssa)) + 8|0);
     $309 = HEAP32[$308>>2]|0;
     $310 = HEAP32[(828)>>2]|0;
     $311 = ($309>>>0)>=($310>>>0);
     $not$ = ($T$0$lcssa>>>0)>=($310>>>0);
     $312 = $311 & $not$;
     if ($312) {
      $313 = ((($309)) + 12|0);
      HEAP32[$313>>2] = $p$0;
      HEAP32[$308>>2] = $p$0;
      $314 = ((($p$0)) + 8|0);
      HEAP32[$314>>2] = $309;
      $315 = ((($p$0)) + 12|0);
      HEAP32[$315>>2] = $T$0$lcssa;
      $316 = ((($p$0)) + 24|0);
      HEAP32[$316>>2] = 0;
      break;
     } else {
      _abort();
      // unreachable;
     }
    }
   } while(0);
   $317 = HEAP32[(844)>>2]|0;
   $318 = (($317) + -1)|0;
   HEAP32[(844)>>2] = $318;
   $319 = ($318|0)==(0);
   if ($319) {
    $sp$0$in$i = (1268);
   } else {
    return;
   }
   while(1) {
    $sp$0$i = HEAP32[$sp$0$in$i>>2]|0;
    $320 = ($sp$0$i|0)==(0|0);
    $321 = ((($sp$0$i)) + 8|0);
    if ($320) {
     break;
    } else {
     $sp$0$in$i = $321;
    }
   }
   HEAP32[(844)>>2] = -1;
   return;
  }
  function runPostSets() {
  }
  function _memset(ptr, value, num) {
      ptr = ptr|0; value = value|0; num = num|0;
      var stop = 0, value4 = 0, stop4 = 0, unaligned = 0;
      stop = (ptr + num)|0;
      if ((num|0) >= 20) {
        // This is unaligned, but quite large, so work hard to get to aligned settings
        value = value & 0xff;
        unaligned = ptr & 3;
        value4 = value | (value << 8) | (value << 16) | (value << 24);
        stop4 = stop & ~3;
        if (unaligned) {
          unaligned = (ptr + 4 - unaligned)|0;
          while ((ptr|0) < (unaligned|0)) { // no need to check for stop, since we have large num
            HEAP8[((ptr)>>0)]=value;
            ptr = (ptr+1)|0;
          }
        }
        while ((ptr|0) < (stop4|0)) {
          HEAP32[((ptr)>>2)]=value4;
          ptr = (ptr+4)|0;
        }
      }
      while ((ptr|0) < (stop|0)) {
        HEAP8[((ptr)>>0)]=value;
        ptr = (ptr+1)|0;
      }
      return (ptr-num)|0;
  }
  function _memcpy(dest, src, num) {
      dest = dest|0; src = src|0; num = num|0;
      var ret = 0;
      if ((num|0) >= 4096) return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
      ret = dest|0;
      if ((dest&3) == (src&3)) {
        while (dest & 3) {
          if ((num|0) == 0) return ret|0;
          HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
          dest = (dest+1)|0;
          src = (src+1)|0;
          num = (num-1)|0;
        }
        while ((num|0) >= 4) {
          HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
          dest = (dest+4)|0;
          src = (src+4)|0;
          num = (num-4)|0;
        }
      }
      while ((num|0) > 0) {
        HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
        dest = (dest+1)|0;
        src = (src+1)|0;
        num = (num-1)|0;
      }
      return ret|0;
  }
  
    
  function dynCall_vi(index,a1) {
    index = index|0;
    a1=a1|0;
    FUNCTION_TABLE_vi[index&7](a1|0);
  }
  
  
  function dynCall_viii(index,a1,a2,a3) {
    index = index|0;
    a1=a1|0; a2=a2|0; a3=a3|0;
    FUNCTION_TABLE_viii[index&15](a1|0,a2|0,a3|0);
  }
  
  function b0(p0) {
   p0 = p0|0; nullFunc_vi(0);
  }
  function b1(p0,p1,p2) {
   p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_viii(1);
  }
  
  // EMSCRIPTEN_END_FUNCS
  var FUNCTION_TABLE_vi = [b0,b0,_TextBox_paint,_Button_paint,b0,_Window_paint_handler,b0,_Desktop_paint_handler];
  var FUNCTION_TABLE_viii = [b1,_Calculator_button_handler,b1,b1,_Button_mousedown_handler,b1,_Window_mousedown_handler,b1,_spawn_calculator,_main_mouse_callback,b1,b1,b1,b1,b1,b1];
  
    return { _free: _free, _fake_os_doMouseCallback: _fake_os_doMouseCallback, _memset: _memset, _malloc: _malloc, _memcpy: _memcpy, ___errno_location: ___errno_location, _main: _main, runPostSets: runPostSets, stackAlloc: stackAlloc, stackSave: stackSave, stackRestore: stackRestore, establishStackSpace: establishStackSpace, setThrew: setThrew, setTempRet0: setTempRet0, getTempRet0: getTempRet0, dynCall_vi: dynCall_vi, dynCall_viii: dynCall_viii };
  })
  // EMSCRIPTEN_END_ASM
  (Module.asmGlobalArg, Module.asmLibraryArg, buffer);
  var real__free = asm["_free"]; asm["_free"] = function() {
  assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  return real__free.apply(null, arguments);
  };
  
  var real__fake_os_doMouseCallback = asm["_fake_os_doMouseCallback"]; asm["_fake_os_doMouseCallback"] = function() {
  assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  return real__fake_os_doMouseCallback.apply(null, arguments);
  };
  
  var real__malloc = asm["_malloc"]; asm["_malloc"] = function() {
  assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  return real__malloc.apply(null, arguments);
  };
  
  var real____errno_location = asm["___errno_location"]; asm["___errno_location"] = function() {
  assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  return real____errno_location.apply(null, arguments);
  };
  
  var real__main = asm["_main"]; asm["_main"] = function() {
  assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  return real__main.apply(null, arguments);
  };
  var _free = Module["_free"] = asm["_free"];
  var _fake_os_doMouseCallback = Module["_fake_os_doMouseCallback"] = asm["_fake_os_doMouseCallback"];
  var _memset = Module["_memset"] = asm["_memset"];
  var runPostSets = Module["runPostSets"] = asm["runPostSets"];
  var _malloc = Module["_malloc"] = asm["_malloc"];
  var _memcpy = Module["_memcpy"] = asm["_memcpy"];
  var ___errno_location = Module["___errno_location"] = asm["___errno_location"];
  var _main = Module["_main"] = asm["_main"];
  var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
  var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
  ;
  
  Runtime.stackAlloc = asm['stackAlloc'];
  Runtime.stackSave = asm['stackSave'];
  Runtime.stackRestore = asm['stackRestore'];
  Runtime.establishStackSpace = asm['establishStackSpace'];
  
  Runtime.setTempRet0 = asm['setTempRet0'];
  Runtime.getTempRet0 = asm['getTempRet0'];
  
  
  
  // === Auto-generated postamble setup entry stuff ===
  
  
  function ExitStatus(status) {
    this.name = "ExitStatus";
    this.message = "Program terminated with exit(" + status + ")";
    this.status = status;
  };
  ExitStatus.prototype = new Error();
  ExitStatus.prototype.constructor = ExitStatus;
  
  var initialStackTop;
  var preloadStartTime = null;
  var calledMain = false;
  
  dependenciesFulfilled = function runCaller() {
    // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
    if (!Module['calledRun']) run();
    if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
  }
  
  Module['callMain'] = Module.callMain = function callMain(args) {
    assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
    assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
  
    args = args || [];
  
    ensureInitRuntime();
  
    var argc = args.length+1;
    function pad() {
      for (var i = 0; i < 4-1; i++) {
        argv.push(0);
      }
    }
    var argv = [allocate(intArrayFromString(Module['thisProgram']), 'i8', ALLOC_NORMAL) ];
    pad();
    for (var i = 0; i < argc-1; i = i + 1) {
      argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));
      pad();
    }
    argv.push(0);
    argv = allocate(argv, 'i32', ALLOC_NORMAL);
  
  
    try {
  
      var ret = Module['_main'](argc, argv, 0);
  
  
      // if we're not running an evented main loop, it's time to exit
      exit(ret, /* implicit = */ true);
    }
    catch(e) {
      if (e instanceof ExitStatus) {
        // exit() throws this once it's done to make sure execution
        // has been stopped completely
        return;
      } else if (e == 'SimulateInfiniteLoop') {
        // running an evented main loop, don't immediately exit
        Module['noExitRuntime'] = true;
        return;
      } else {
        if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
        throw e;
      }
    } finally {
      calledMain = true;
    }
  }
  
  
  
  
  function run(args) {
    args = args || Module['arguments'];
  
    if (preloadStartTime === null) preloadStartTime = Date.now();
  
    if (runDependencies > 0) {
      Module.printErr('run() called, but dependencies remain, so not running');
      return;
    }
  
    preRun();
  
    if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
    if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame
  
    function doRun() {
      if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening
      Module['calledRun'] = true;
  
      if (ABORT) return; 
  
      ensureInitRuntime();
  
      preMain();
  
      if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {
        Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');
      }
  
      if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
  
      if (Module['_main'] && shouldRunNow) Module['callMain'](args);
  
      postRun();
    }
  
    if (Module['setStatus']) {
      Module['setStatus']('Running...');
      setTimeout(function() {
        setTimeout(function() {
          Module['setStatus']('');
        }, 1);
        doRun();
      }, 1);
    } else {
      doRun();
    }
  }
  Module['run'] = Module.run = run;
  
  function exit(status, implicit) {
    if (implicit && Module['noExitRuntime']) {
      Module.printErr('exit(' + status + ') implicitly called by end of main(), but noExitRuntime, so not exiting the runtime (you can use emscripten_force_exit, if you want to force a true shutdown)');
      return;
    }
  
    if (Module['noExitRuntime']) {
      Module.printErr('exit(' + status + ') called, but noExitRuntime, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)');
    } else {
  
      ABORT = true;
      EXITSTATUS = status;
      STACKTOP = initialStackTop;
  
      exitRuntime();
  
      if (Module['onExit']) Module['onExit'](status);
    }
  
    if (ENVIRONMENT_IS_NODE) {
      // Work around a node.js bug where stdout buffer is not flushed at process exit:
      // Instead of process.exit() directly, wait for stdout flush event.
      // See https://github.com/joyent/node/issues/1669 and https://github.com/kripken/emscripten/issues/2582
      // Workaround is based on https://github.com/RReverser/acorn/commit/50ab143cecc9ed71a2d66f78b4aec3bb2e9844f6
      process['stdout']['once']('drain', function () {
        process['exit'](status);
      });
      console.log(' '); // Make sure to print something to force the drain event to occur, in case the stdout buffer was empty.
      // Work around another node bug where sometimes 'drain' is never fired - make another effort
      // to emit the exit status, after a significant delay (if node hasn't fired drain by then, give up)
      setTimeout(function() {
        process['exit'](status);
      }, 500);
    } else
    if (ENVIRONMENT_IS_SHELL && typeof quit === 'function') {
      quit(status);
    }
    // if we reach here, we must throw an exception to halt the current execution
    throw new ExitStatus(status);
  }
  Module['exit'] = Module.exit = exit;
  
  var abortDecorators = [];
  
  function abort(what) {
    if (what !== undefined) {
      Module.print(what);
      Module.printErr(what);
      what = JSON.stringify(what)
    } else {
      what = '';
    }
  
    ABORT = true;
    EXITSTATUS = 1;
  
    var extra = '';
  
    var output = 'abort(' + what + ') at ' + stackTrace() + extra;
    if (abortDecorators) {
      abortDecorators.forEach(function(decorator) {
        output = decorator(output, what);
      });
    }
    throw output;
  }
  Module['abort'] = Module.abort = abort;
  
  // {{PRE_RUN_ADDITIONS}}
  
  if (Module['preInit']) {
    if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
    while (Module['preInit'].length > 0) {
      Module['preInit'].pop()();
    }
  }
  
  // shouldRunNow refers to calling main(), not run().
  var shouldRunNow = true;
  if (Module['noInitialRun']) {
    shouldRunNow = false;
  }
  
  Module["noExitRuntime"] = true;
  
  run();
  
  // {{POST_RUN_ADDITIONS}}
  
  
  
  
  
  
  // {{MODULE_ADDITIONS}}
  
  
  
  