/* Generated by the Nim Compiler v2.2.10 */
var framePtr = null;
var excHandler = 0;
var lastJSError = null;
var NTI8388629 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388625 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388621 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388623 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097904 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097155 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
var NTI2098590 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
var NTI2097907 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
var NTI2097906 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
var NTI2097903 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097905 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388626 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097169 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
var NTI2097899 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097909 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097170 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
var NTI44040321 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI44040320 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
var NTI62914644 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NNI44040321 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "message", len: 0, typ: NTI2097170, name: "message", sons: null}, 
{kind: 1, offset: "name", len: 0, typ: NTI2097170, name: "name", sons: null}]};
NTI44040321.node = NNI44040321;
var NNI2097909 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI2097909.node = NNI2097909;
var NNI2097899 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI2097899.node = NNI2097899;
NTI2097909.base = NTI2097899;
NTI44040321.base = NTI2097909;
NTI44040320.base = NTI44040321;
var NNI62914644 = {kind: 1, offset: "reason0", len: 0, typ: NTI44040320, name: "reason0", sons: null};
NTI62914644.node = NNI62914644;
NTI62914644.base = NTI2097899;
var NNI8388626 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388626.node = NNI8388626;
var NNI2097905 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI2097905.node = NNI2097905;
NTI2097906.base = NTI2097903;
NTI2097907.base = NTI2097903;
var NNI2097903 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI2097906, name: "parent", sons: null}, 
{kind: 1, offset: "name", len: 0, typ: NTI2097170, name: "name", sons: null}, 
{kind: 1, offset: "message", len: 0, typ: NTI2097169, name: "msg", sons: null}, 
{kind: 1, offset: "trace", len: 0, typ: NTI2097169, name: "trace", sons: null}, 
{kind: 1, offset: "up", len: 0, typ: NTI2097907, name: "up", sons: null}]};
NTI2097903.node = NNI2097903;
NTI2097903.base = NTI2097899;
NTI2097905.base = NTI2097903;
NTI8388626.base = NTI2097905;
var NNI2098590 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI2097170, name: "Field0", sons: null}, 
{kind: 1, offset: "Field1", len: 0, typ: NTI2097155, name: "Field1", sons: null}, 
{kind: 1, offset: "Field2", len: 0, typ: NTI2097170, name: "Field2", sons: null}]};
NTI2098590.node = NNI2098590;
var NNI2097904 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI2097904.node = NNI2097904;
NTI2097904.base = NTI2097903;
var NNI8388623 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388623.node = NNI8388623;
var NNI8388621 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388621.node = NNI8388621;
NTI8388621.base = NTI2097904;
NTI8388623.base = NTI8388621;
var NNI8388625 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388625.node = NNI8388625;
NTI8388625.base = NTI2097904;
var NNI8388629 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388629.node = NNI8388629;
NTI8388629.base = NTI2097904;

function setConstr() {
        var result = {};
    for (var i = 0; i < arguments.length; ++i) {
      var x = arguments[i];
      if (typeof(x) == "object") {
        for (var j = x[0]; j <= x[1]; ++j) {
          result[j] = true;
        }
      } else {
        result[x] = true;
      }
    }
    return result;
  

  
}
var ConstSet1 = setConstr(17, 16, 4, 18, 27, 19, 23, 22, 21);

function nimCopy(dest_p0, src_p1, ti_p2) {
  var result_2100096 = null;

    switch (ti_p2.kind) {
    case 21:
    case 22:
    case 23:
    case 5:
      if (!(isFatPointer__system_u2924(ti_p2))) {
      result_2100096 = src_p1;
      }
      else {
        result_2100096 = [src_p1[0], src_p1[1]];
      }
      
      break;
    case 19:
            if (dest_p0 === null || dest_p0 === undefined) {
        dest_p0 = {};
      }
      else {
        for (var key in dest_p0) { delete dest_p0[key]; }
      }
      for (var key in src_p1) { dest_p0[key] = src_p1[key]; }
      result_2100096 = dest_p0;
    
      break;
    case 18:
    case 17:
      if (!((ti_p2.base == null))) {
      result_2100096 = nimCopy(dest_p0, src_p1, ti_p2.base);
      }
      else {
      if ((ti_p2.kind == 17)) {
      result_2100096 = (dest_p0 === null || dest_p0 === undefined) ? {m_type: ti_p2} : dest_p0;
      }
      else {
        result_2100096 = (dest_p0 === null || dest_p0 === undefined) ? {} : dest_p0;
      }
      }
      nimCopyAux(result_2100096, src_p1, ti_p2.node);
      break;
    case 4:
    case 16:
            if(ArrayBuffer.isView(src_p1)) { 
        if(dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
          dest_p0 = new src_p1.constructor(src_p1);
        } else {
          dest_p0.set(src_p1, 0);
        }
        result_2100096 = dest_p0;
      } else {
        if (src_p1 === null) {
          result_2100096 = null;
        }
        else {
          if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
            dest_p0 = new Array(src_p1.length);
          }
          result_2100096 = dest_p0;
          for (var i = 0; i < src_p1.length; ++i) {
            result_2100096[i] = nimCopy(result_2100096[i], src_p1[i], ti_p2.base);
          }
        }
      }
    
      break;
    case 24:
    case 27:
            if (src_p1 === null) {
        result_2100096 = null;
      }
      else {
        if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
          dest_p0 = new Array(src_p1.length);
        }
        result_2100096 = dest_p0;
        for (var i = 0; i < src_p1.length; ++i) {
          result_2100096[i] = nimCopy(result_2100096[i], src_p1[i], ti_p2.base);
        }
      }
    
      break;
    case 28:
            if (src_p1 !== null) {
        result_2100096 = src_p1.slice(0);
      }
    
      break;
    default: 
      result_2100096 = src_p1;
      break;
    }

  return result_2100096;

}

function mnewString(len_p0) {
        var result = new Array(len_p0);
    for (var i = 0; i < len_p0; i++) {result[i] = 0;}
    return result;
  

  
}

function nimAddStrStr(x_p0, y_p1) {
      var L = y_p1.length;
  for (var i = 0; i < L; ++i) {
    x_p0.push(y_p1[i]);
  }
  

  
}

function arrayConstr(len_p0, value_p1, typ_p2) {
        var result = new Array(len_p0);
    for (var i = 0; i < len_p0; ++i) result[i] = nimCopy(null, value_p1, typ_p2);
    return result;
  

  
}

function cstrToNimstr(c_p0) {
      var ln = c_p0.length;
  var result = new Array(ln);
  var r = 0;
  for (var i = 0; i < ln; ++i) {
    var ch = c_p0.charCodeAt(i);

    if (ch < 128) {
      result[r] = ch;
    }
    else {
      if (ch < 2048) {
        result[r] = (ch >> 6) | 192;
      }
      else {
        if (ch < 55296 || ch >= 57344) {
          result[r] = (ch >> 12) | 224;
        }
        else {
            ++i;
            ch = 65536 + (((ch & 1023) << 10) | (c_p0.charCodeAt(i) & 1023));
            result[r] = (ch >> 18) | 240;
            ++r;
            result[r] = ((ch >> 12) & 63) | 128;
        }
        ++r;
        result[r] = ((ch >> 6) & 63) | 128;
      }
      ++r;
      result[r] = (ch & 63) | 128;
    }
    ++r;
  }
  return result;
  

  
}

function isObj(obj_p0, subclass_p1) {
  var result_2100209 = false;

  BeforeRet: {
    var x_2100210 = obj_p0;
    if ((x_2100210 == subclass_p1)) {
    result_2100209 = true;
    break BeforeRet;
    }
    
    Label1: {
        Label2: while (true) {
        if (!!((x_2100210 == subclass_p1))) break Label2;
          if ((x_2100210 == null)) {
          result_2100209 = false;
          break BeforeRet;
          }
          
          x_2100210 = x_2100210.base;
        }
    };
    result_2100209 = true;
    break BeforeRet;
  };

  return result_2100209;

}

function toJSStr(s_p0) {
  var result_2099673 = null;

    var res_2099739 = newSeq__system_u2562((s_p0).length);
    var i_2099740 = 0;
    var j_2099741 = 0;
    Label1: {
        Label2: while (true) {
        if (!(i_2099740 < (s_p0).length)) break Label2;
          var c_2099742 = s_p0[i_2099740];
          if ((c_2099742 < 128)) {
          res_2099739[j_2099741] = String.fromCharCode(c_2099742);
          i_2099740 += 1;
          }
          else {
            var helper_2099768 = newSeq__system_u2562(0);
            Label3: {
                Label4: while (true) {
                if (!true) break Label4;
                  var code_2099769 = c_2099742.toString(16);
                  if ((((code_2099769) == null ? 0 : (code_2099769).length) == 1)) {
                  helper_2099768.push("%0");;
                  }
                  else {
                  helper_2099768.push("%");;
                  }
                  
                  helper_2099768.push(code_2099769);;
                  i_2099740 += 1;
                  if ((((s_p0).length <= i_2099740) || (s_p0[i_2099740] < 128))) {
                  break Label3;
                  }
                  
                  c_2099742 = s_p0[i_2099740];
                }
            };
++excHandler;
            try {
            res_2099739[j_2099741] = decodeURIComponent(helper_2099768.join(""));
--excHandler;
} catch (EXCEPTION) {
 var prevJSError = lastJSError;
 lastJSError = EXCEPTION;
 --excHandler;
            raiseDefect();
            res_2099739[j_2099741] = helper_2099768.join("");
            lastJSError = prevJSError;
            } finally {
            }
          }
          
          j_2099741 += 1;
        }
    };
    if (res_2099739.length < j_2099741) { for (var i = res_2099739.length ; i < j_2099741 ; ++i) res_2099739.push(null); }
               else { res_2099739.length = j_2099741; };
    result_2099673 = res_2099739.join("");

  return result_2099673;

}

function raiseException(e_p0, ename_p1) {
    e_p0.name = ename_p1;
    if ((excHandler == 0)) {
    unhandledException(e_p0);
    }
    
    e_p0.trace = nimCopy(null, rawWriteStackTrace__system_u2214(), NTI2097169);
    throw e_p0;

  
}

function mulInt(a_p0, b_p1) {
        var result = a_p0 * b_p1;
    checkOverflowInt(result);
    return result;
  

  
}

function makeNimstrLit(c_p0) {
      var result = [];
  for (var i = 0; i < c_p0.length; ++i) {
    result[i] = c_p0.charCodeAt(i);
  }
  return result;
  

  
}

function subInt(a_p0, b_p1) {
        var result = a_p0 - b_p1;
    checkOverflowInt(result);
    return result;
  

  
}

function chckIndx(i_p0, a_p1, b_p2) {
  var result_2100131 = 0;

  BeforeRet: {
    if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
    result_2100131 = i_p0;
    break BeforeRet;
    }
    else {
    raiseIndexError(i_p0, a_p1, b_p2);
    }
    
  };

  return result_2100131;

}

function addInt(a_p0, b_p1) {
        var result = a_p0 + b_p1;
    checkOverflowInt(result);
    return result;
  

  
}
var F = {procname: "module macros", prev: framePtr, filename: "/build/nim/src/nim/lib/core/macros.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module macros", prev: framePtr, filename: "/build/nim/src/nim/lib/core/macros.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module jsbigints", prev: framePtr, filename: "/build/nim/src/nim/lib/std/jsbigints.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module jsbigints", prev: framePtr, filename: "/build/nim/src/nim/lib/std/jsbigints.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module jsutils", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/jsutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module jsutils", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/jsutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module hashes", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/hashes.nim", line: 0};
framePtr = F;
F.line = 219;
F.filename = "hashes.nim";
var objectID_48234674 = [0];
framePtr = F.prev;
var F = {procname: "module hashes", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/hashes.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module bitops_utils", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/bitops_utils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module bitops_utils", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/bitops_utils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module countbits_impl", prev: framePtr, filename: "/build/nim/src/nim/lib/system/countbits_impl.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module countbits_impl", prev: framePtr, filename: "/build/nim/src/nim/lib/system/countbits_impl.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module bitops", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/bitops.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module bitops", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/bitops.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module fenv", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/fenv.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module fenv", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/fenv.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module math", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/math.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module math", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/math.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module algorithm", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/algorithm.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module algorithm", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/algorithm.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module outparams", prev: framePtr, filename: "/build/nim/src/nim/lib/std/outparams.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module outparams", prev: framePtr, filename: "/build/nim/src/nim/lib/std/outparams.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module tables", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/collections/tables.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module tables", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/collections/tables.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module jsffi", prev: framePtr, filename: "/build/nim/src/nim/lib/js/jsffi.nim", line: 0};
framePtr = F;
F.line = 45;
F.filename = "jsffi.nim";
F.line = 46;
framePtr = F.prev;
var F = {procname: "module jsffi", prev: framePtr, filename: "/build/nim/src/nim/lib/js/jsffi.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module asyncjs", prev: framePtr, filename: "/build/nim/src/nim/lib/js/asyncjs.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module asyncjs", prev: framePtr, filename: "/build/nim/src/nim/lib/js/asyncjs.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module underscored_calls", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/underscored_calls.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module underscored_calls", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/underscored_calls.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module sugar", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/sugar.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module sugar", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/sugar.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module asyncjs_examples_1", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_1.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module asyncjs_examples_1", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_1.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module parseutils", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/parseutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module parseutils", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/parseutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module typetraits", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/typetraits.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module typetraits", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/typetraits.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module enumutils", prev: framePtr, filename: "/build/nim/src/nim/lib/std/enumutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module enumutils", prev: framePtr, filename: "/build/nim/src/nim/lib/std/enumutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module strbasics", prev: framePtr, filename: "/build/nim/src/nim/lib/std/strbasics.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module strbasics", prev: framePtr, filename: "/build/nim/src/nim/lib/std/strbasics.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module unicode", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/unicode.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module unicode", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/unicode.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module strimpl", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/strimpl.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module strimpl", prev: framePtr, filename: "/build/nim/src/nim/lib/std/private/strimpl.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module strutils", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module strutils", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
framePtr = F;
framePtr = F.prev;

function catch__asyncjs95examples952_u55(future_p0, onReject_p1) {
  var result_62914619 = null;

  var F = {procname: "catch.catch", prev: framePtr, filename: "/build/nim/src/nim/lib/js/asyncjs.nim", line: 0};
  framePtr = F;
    F.line = 269;
    F.filename = "asyncjs.nim";
    result_62914619 = future_p0.catch(onReject_p1);
  framePtr = F.prev;

  return result_62914619;

}

function isFatPointer__system_u2924(ti_p0) {
  var result_2100078 = false;

  BeforeRet: {
    result_2100078 = !((ConstSet1[ti_p0.base.kind] != undefined));
    break BeforeRet;
  };

  return result_2100078;

}

function nimCopyAux(dest_p0, src_p1, n_p2) {
    switch (n_p2.kind) {
    case 0:
      break;
    case 1:
            dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
    
      break;
    case 2:
          for (var i = 0; i < n_p2.sons.length; i++) {
      nimCopyAux(dest_p0, src_p1, n_p2.sons[i]);
    }
    
      break;
    case 3:
            dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
      for (var i = 0; i < n_p2.sons.length; ++i) {
        nimCopyAux(dest_p0, src_p1, n_p2.sons[i][1]);
      }
    
      break;
    }

  
}

function addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, start_p2, n_p3) {
    var Temporary1;

    var old_20971728 = (result_p0[result_p0_Idx]).length;
    if (result_p0[result_p0_Idx].length < (Temporary1 = (old_20971728 + n_p3), Temporary1)) { for (var i = result_p0[result_p0_Idx].length; i < Temporary1; ++i) result_p0[result_p0_Idx].push(0); }
         else {result_p0[result_p0_Idx].length = Temporary1; };
    Label2: {
      var iHEX60gensym4_20971742 = 0;
      var i_62914715 = 0;
      Label3: {
          Label4: while (true) {
          if (!(i_62914715 < n_p3)) break Label4;
            iHEX60gensym4_20971742 = i_62914715;
            result_p0[result_p0_Idx][(old_20971728 + iHEX60gensym4_20971742)] = x_p1.charCodeAt((start_p2 + iHEX60gensym4_20971742));
            i_62914715 += 1;
          }
      };
    };

  
}

function addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, x_p1) {
    addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, 0, ((x_p1) == null ? 0 : (x_p1).length));

  
}

function addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, x_p1) {
    addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, ((x_p1) + ""));

  
}

function addInt__stdZprivateZdigitsutils_u241(result_p0, result_p0_Idx, x_p1) {
    addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, BigInt(x_p1));

  
}

function HEX24__systemZdollars_u14(xHEX60gensym0_p0) {
  var result_24117264 = [[]];

  var F = {procname: "dollars.$", prev: framePtr, filename: "/build/nim/src/nim/lib/system/dollars.nim", line: 0};
  framePtr = F;
    F.line = 20;
    F.filename = "dollars.nim";
    result_24117264[0] = nimCopy(null, [], NTI2097169);
    F.line = 21;
    addInt__stdZprivateZdigitsutils_u241(result_24117264, 0, xHEX60gensym0_p0);
  framePtr = F.prev;

  return result_24117264[0];

}

function add__system_u1972(x_p0, x_p0_Idx, y_p1) {
          if (x_p0[x_p0_Idx] === null) { x_p0[x_p0_Idx] = []; }
      var off = x_p0[x_p0_Idx].length;
      x_p0[x_p0_Idx].length += y_p1.length;
      for (var i = 0; i < y_p1.length; ++i) {
        x_p0[x_p0_Idx][off+i] = y_p1.charCodeAt(i);
      }
    

  
}

function auxWriteStackTrace__system_u2116(f_p0) {
  var result_2099270 = [[]];

    var it_2099278 = f_p0;
    var i_2099279 = 0;
    var total_2099280 = 0;
    var tempFrames_2099281 = arrayConstr(64, {Field0: null, Field1: 0, Field2: null}, NTI2098590);
    Label1: {
        Label2: while (true) {
        if (!(!((it_2099278 == null)) && (i_2099279 <= 63))) break Label2;
          tempFrames_2099281[i_2099279].Field0 = it_2099278.procname;
          tempFrames_2099281[i_2099279].Field1 = it_2099278.line;
          tempFrames_2099281[i_2099279].Field2 = it_2099278.filename;
          i_2099279 += 1;
          total_2099280 += 1;
          it_2099278 = it_2099278.prev;
        }
    };
    Label3: {
        Label4: while (true) {
        if (!!((it_2099278 == null))) break Label4;
          total_2099280 += 1;
          it_2099278 = it_2099278.prev;
        }
    };
    result_2099270[0] = nimCopy(null, [], NTI2097169);
    if (!((total_2099280 == i_2099279))) {
    nimAddStrStr(result_2099270[0], [40]);;
    nimAddStrStr(result_2099270[0], HEX24__systemZdollars_u14((total_2099280 - i_2099279)));;
    nimAddStrStr(result_2099270[0], [32,99,97,108,108,115,32,111,109,105,116,116,101,100,41,32,46,46,46,10]);;
    }
    
    Label5: {
      var j_2099314 = 0;
      var colontmp__62914720 = 0;
      colontmp__62914720 = (i_2099279 - 1);
      var res_62914722 = colontmp__62914720;
      Label6: {
          Label7: while (true) {
          if (!(0 <= res_62914722)) break Label7;
            j_2099314 = res_62914722;
            nimAddStrStr(result_2099270[0], cstrToNimstr(tempFrames_2099281[j_2099314].Field2));;
            if ((0 < tempFrames_2099281[j_2099314].Field1)) {
            nimAddStrStr(result_2099270[0], [40]);;
            addInt__stdZprivateZdigitsutils_u241(result_2099270, 0, tempFrames_2099281[j_2099314].Field1);
            if (false) {
            nimAddStrStr(result_2099270[0], [44,32]);;
            addInt__stdZprivateZdigitsutils_u241(result_2099270, 0, 0);
            }
            
            nimAddStrStr(result_2099270[0], [41]);;
            }
            
            nimAddStrStr(result_2099270[0], [32,97,116,32]);;
            add__system_u1972(result_2099270, 0, tempFrames_2099281[j_2099314].Field0);
            nimAddStrStr(result_2099270[0], [10]);;
            res_62914722 -= 1;
          }
      };
    };

  return result_2099270[0];

}

function rawWriteStackTrace__system_u2214() {
  var result_2099367 = [];

    if (!((framePtr == null))) {
    result_2099367 = nimCopy(null, ([84,114,97,99,101,98,97,99,107,32,40,109,111,115,116,32,114,101,99,101,110,116,32,99,97,108,108,32,108,97,115,116,41,10]).concat(auxWriteStackTrace__system_u2116(framePtr)), NTI2097169);
    }
    else {
      result_2099367 = nimCopy(null, [78,111,32,115,116,97,99,107,32,116,114,97,99,101,98,97,99,107,32,97,118,97,105,108,97,98,108,101,10], NTI2097169);
    }
    

  return result_2099367;

}

function newSeq__system_u2562(len_p0) {
  var result_2099718 = [];

  var F = {procname: "newSeq.newSeq", prev: framePtr, filename: "/build/nim/src/nim/lib/system.nim", line: 0};
  framePtr = F;
    F.line = 651;
    F.filename = "system.nim";
    result_2099718 = new Array(len_p0); for (var i = 0 ; i < len_p0 ; ++i) { result_2099718[i] = null; }  framePtr = F.prev;

  return result_2099718;

}

function isNimException__system_u2047() {
    return lastJSError && lastJSError.m_type;

  
}

function getCurrentException() {
  var result_2099202 = null;

    if (isNimException__system_u2047()) {
    result_2099202 = lastJSError;
    }
    

  return result_2099202;

}

function raiseDefect() {
    if (isNimException__system_u2047()) {
    var e_2099418 = getCurrentException();
    if (isObj(e_2099418.m_type, NTI2097904)) {
    if ((excHandler == 0)) {
    unhandledException(e_2099418);
    }
    
    e_2099418.trace = nimCopy(null, rawWriteStackTrace__system_u2214(), NTI2097169);
    throw e_2099418;
    }
    
    }
    

  
}

function unhandledException(e_p0) {
    var buf_2099412 = [[]];
    if (!(((e_p0.message).length == 0))) {
    nimAddStrStr(buf_2099412[0], [69,114,114,111,114,58,32,117,110,104,97,110,100,108,101,100,32,101,120,99,101,112,116,105,111,110,58,32]);;
    nimAddStrStr(buf_2099412[0], e_p0.message);;
    }
    else {
    nimAddStrStr(buf_2099412[0], [69,114,114,111,114,58,32,117,110,104,97,110,100,108,101,100,32,101,120,99,101,112,116,105,111,110]);;
    }
    
    nimAddStrStr(buf_2099412[0], [32,91]);;
    add__system_u1972(buf_2099412, 0, e_p0.name);
    nimAddStrStr(buf_2099412[0], [93,10]);;
    nimAddStrStr(buf_2099412[0], rawWriteStackTrace__system_u2214());;
    var cbuf_2099413 = toJSStr(buf_2099412[0]);
    framePtr = null;
      if (typeof(Error) !== "undefined") {
    throw new Error(cbuf_2099413);
  }
  else {
    throw cbuf_2099413;
  }
  

  
}

function raiseOverflow() {
    raiseException({message: [111,118,101,114,45,32,111,114,32,117,110,100,101,114,102,108,111,119], parent: null, m_type: NTI8388623, name: null, trace: [], up: null}, "OverflowDefect");

  
}

function checkOverflowInt(a_p0) {
        if (a_p0 > 2147483647 || a_p0 < -2147483648) raiseOverflow();
  

  
}
async function fn__asyncjs95examples952_u8(n_p0) {
  var result_62914571 = null;

  var F = {procname: "asyncjs_examples_2.fn", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim", line: 0};
  framePtr = F;
    if ((7 <= n_p0)) {
    F.line = 251;
    F.filename = "asyncjs.nim";
    raiseException({message: ([102,111,111,98,97,114,58,32]).concat(HEX24__systemZdollars_u14(n_p0)), parent: null, m_type: NTI8388626, name: null, trace: [], up: null}, "ValueError");
    }
    else {
      F.line = 251;
      result_62914571 = mulInt(n_p0, 2);
    }
    
  framePtr = F.prev;

  return result_62914571;

}

function HEX3Aanonymous__asyncjs95examples952_u36(r_p0) {
  var F = {procname: "main.:anonymous", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim", line: 0};
  framePtr = F;
    F.line = 251;
    F.filename = "asyncjs.nim";
    this.reason0 = r_p0;
  framePtr = F.prev;

  
}

function sysFatal__stdZassertions_u46(message_p1) {
  var F = {procname: "sysFatal.sysFatal", prev: framePtr, filename: "/build/nim/src/nim/lib/system/fatal.nim", line: 0};
  framePtr = F;
    F.line = 62;
    F.filename = "fatal.nim";
    raiseException({message: nimCopy(null, message_p1, NTI2097169), m_type: NTI8388625, parent: null, name: null, trace: [], up: null}, "AssertionDefect");
  framePtr = F.prev;

  
}

function raiseAssert__stdZassertions_u44(msg_p0) {
  var F = {procname: "assertions.raiseAssert", prev: framePtr, filename: "/build/nim/src/nim/lib/std/assertions.nim", line: 0};
  framePtr = F;
    F.line = 40;
    F.filename = "assertions.nim";
    sysFatal__stdZassertions_u46(msg_p0);
  framePtr = F.prev;

  
}

function failedAssertImpl__stdZassertions_u86(msg_p0) {
  var F = {procname: "assertions.failedAssertImpl", prev: framePtr, filename: "/build/nim/src/nim/lib/std/assertions.nim", line: 0};
  framePtr = F;
    F.line = 45;
    F.filename = "assertions.nim";
    raiseAssert__stdZassertions_u44(msg_p0);
  framePtr = F.prev;

  
}

function HEX3Aanonymous__asyncjs95examples952_u74(r_p0) {
  var F = {procname: "main.:anonymous", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim", line: 0};
  framePtr = F;
    F.line = 251;
    F.filename = "asyncjs.nim";
    this.reason0 = r_p0;
  framePtr = F.prev;

  
}

function raiseIndexError(i_p0, a_p1, b_p2) {
    var Temporary1;

    if ((b_p2 < a_p1)) {
    Temporary1 = [105,110,100,101,120,32,111,117,116,32,111,102,32,98,111,117,110,100,115,44,32,116,104,101,32,99,111,110,116,97,105,110,101,114,32,105,115,32,101,109,112,116,121];
    }
    else {
    Temporary1 = ([105,110,100,101,120,32]).concat(HEX24__systemZdollars_u14(i_p0),[32,110,111,116,32,105,110,32],HEX24__systemZdollars_u14(a_p1),[32,46,46,32],HEX24__systemZdollars_u14(b_p2));
    }
    
    raiseException({message: nimCopy(null, Temporary1, NTI2097169), parent: null, m_type: NTI8388629, name: null, trace: [], up: null}, "IndexDefect");

  
}

function nsuFindChar(s_p0, sub_p1, start_p2, last_p3) {
    var Temporary1;

  var result_63964839 = 0;

  var F = {procname: "strutils.find", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
  framePtr = F;
  BeforeRet: {
    F.line = 1972;
    F.filename = "strutils.nim";
    result_63964839 = (-1);
    F.line = 1973;
    if ((last_p3 < 0)) {
    Temporary1 = (s_p0).length - 1;
    }
    else {
    Temporary1 = last_p3;
    }
    
    var last_63964840 = Temporary1;
    Label2: {
      F.line = 1976;
      var iHEX60gensym174_63964854 = 0;
      F.line = 96;
      F.filename = "iterators_1.nim";
      var res_62914731 = start_p2;
      Label3: {
        F.line = 97;
          Label4: while (true) {
          if (!(res_62914731 <= last_63964840)) break Label4;
            F.line = 1990;
            F.filename = "strutils.nim";
            iHEX60gensym174_63964854 = res_62914731;
            if ((s_p0[chckIndx(iHEX60gensym174_63964854, 0, (s_p0).length - 1)] == sub_p1)) {
            F.line = 1978;
            result_63964839 = iHEX60gensym174_63964854;
            break BeforeRet;
            }
            
            F.line = 102;
            F.filename = "iterators_1.nim";
            res_62914731 = addInt(res_62914731, 1);
          }
      };
    };
  };
  framePtr = F.prev;

  return result_63964839;

}

function nsuFindStrA(a_p0, s_p1, sub_p2, start_p3, last_p4) {
    var Temporary1;

  var result_63964818 = 0;

  var F = {procname: "strutils.find", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
  framePtr = F;
  BeforeRet: {
    F.line = 1932;
    F.filename = "strutils.nim";
    if ((last_p4 < 0)) {
    Temporary1 = (s_p1).length - 1;
    }
    else {
    Temporary1 = last_p4;
    }
    
    var last_63964819 = Temporary1;
    F.line = 1933;
    var subLast_63964820 = subInt((sub_p2).length, 1);
    if ((subLast_63964820 == (-1))) {
    F.line = 1938;
    result_63964818 = start_p3;
    break BeforeRet;
    }
    
    F.line = 1942;
    result_63964818 = (-1);
    F.line = 1943;
    var skip_63964821 = start_p3;
    Label2: {
      F.line = 1945;
        Label3: while (true) {
        if (!(subLast_63964820 <= subInt(last_63964819, skip_63964821))) break Label3;
          F.line = 1946;
          var i_63964822 = subLast_63964820;
          Label4: {
            F.line = 1947;
              Label5: while (true) {
              if (!(s_p1[chckIndx(addInt(skip_63964821, i_63964822), 0, (s_p1).length - 1)] == sub_p2[chckIndx(i_63964822, 0, (sub_p2).length - 1)])) break Label5;
                if ((i_63964822 == 0)) {
                F.line = 1949;
                result_63964818 = skip_63964821;
                break BeforeRet;
                }
                
                F.line = 1950;
                i_63964822 = subInt(i_63964822, 1);
              }
          };
          F.line = 1951;
          skip_63964821 = addInt(skip_63964821, a_p0[chckIndx(s_p1[chckIndx(addInt(skip_63964821, subLast_63964820), 0, (s_p1).length - 1)], 0, (a_p0).length - 1)]);
        }
    };
  };
  framePtr = F.prev;

  return result_63964818;

}

function fill__pureZstrutils_u1622(a_p0, value_p1) {
  var F = {procname: "fill.fill", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/algorithm.nim", line: 0};
  framePtr = F;
    F.line = 72;
    F.filename = "algorithm.nim";
    var xHEX60gensym170_63964767 = 0;
    Label1: {
      F.line = 98;
        Label2: while (true) {
        if (!(xHEX60gensym170_63964767 <= (a_p0).length - 1)) break Label2;
          F.line = 98;
          a_p0[chckIndx(xHEX60gensym170_63964767, 0, (a_p0).length - 1)] = value_p1;
          F.line = 75;
          xHEX60gensym170_63964767 = addInt(xHEX60gensym170_63964767, 1);
        }
    };
  framePtr = F.prev;

  
}

function nsuInitSkipTable(a_p0, sub_p1) {
  var F = {procname: "strutils.initSkipTable", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
  framePtr = F;
    F.line = 1905;
    F.filename = "strutils.nim";
    var m_63964757 = (sub_p1).length;
    F.line = 1906;
    fill__pureZstrutils_u1622(a_p0, m_63964757);
    Label1: {
      F.line = 1908;
      var i_63964777 = 0;
      F.line = 126;
      F.filename = "iterators_1.nim";
      var colontmp__62914736 = 0;
      F.line = 1908;
      F.filename = "strutils.nim";
      colontmp__62914736 = subInt(m_63964757, 1);
      F.line = 128;
      F.filename = "iterators_1.nim";
      var i_62914737 = 0;
      Label2: {
        F.line = 129;
          Label3: while (true) {
          if (!(i_62914737 < colontmp__62914736)) break Label3;
            F.line = 1908;
            F.filename = "strutils.nim";
            i_63964777 = i_62914737;
            F.line = 1909;
            a_p0[chckIndx(sub_p1[chckIndx(i_63964777, 0, (sub_p1).length - 1)], 0, (a_p0).length - 1)] = subInt(subInt(m_63964757, 1), i_63964777);
            F.line = 131;
            F.filename = "iterators_1.nim";
            i_62914737 = addInt(i_62914737, 1);
          }
      };
    };
  framePtr = F.prev;

  
}

function nsuInitNewSkipTable(sub_p0) {
  var result_63964811 = [new Int32Array(256)];

  var F = {procname: "strutils.initSkipTable", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
  framePtr = F;
    F.line = 1918;
    F.filename = "strutils.nim";
    nsuInitSkipTable(result_63964811[0], sub_p0);
  framePtr = F.prev;

  return result_63964811[0];

}

function nsuFindStr(s_p0, sub_p1, start_p2, last_p3) {
  var result_63964876 = 0;

  var F = {procname: "strutils.find", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
  framePtr = F;
  BeforeRet: {
    if ((subInt((s_p0).length, start_p2) < (sub_p1).length)) {
    F.line = 2032;
    F.filename = "strutils.nim";
    result_63964876 = (-1);
    break BeforeRet;
    }
    
    if (((sub_p1).length == 1)) {
    F.line = 2033;
    result_63964876 = nsuFindChar(s_p0, sub_p1[chckIndx(0, 0, (sub_p1).length - 1)], start_p2, last_p3);
    break BeforeRet;
    }
    
    F.line = 2036;
    result_63964876 = nsuFindStrA(nsuInitNewSkipTable(sub_p1), s_p0, sub_p1, start_p2, last_p3);
  };
  framePtr = F.prev;

  return result_63964876;

}

function contains__pureZstrutils_u1878(s_p0, sub_p1) {
  var result_63965017 = false;

  var F = {procname: "strutils.contains", prev: framePtr, filename: "/build/nim/src/nim/lib/pure/strutils.nim", line: 0};
  framePtr = F;
  BeforeRet: {
    F.line = 2190;
    F.filename = "strutils.nim";
    result_63965017 = (0 <= nsuFindStr(s_p0, sub_p1, 0, (-1)));
    break BeforeRet;
  };
  framePtr = F.prev;

  return result_63965017;

}
async function main__asyncjs95examples952_u26() {
    var Temporary1;
    var Temporary2;

  var result_62914588 = null;

  var F = {procname: "asyncjs_examples_2.main", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim", line: 0};
  framePtr = F;
  BeforeRet: {
    F.line = 251;
    F.filename = "asyncjs.nim";
    var HEX3Aenv_62914663 = null;
    F.line = 251;
    HEX3Aenv_62914663 = {m_type: NTI62914644, reason0: null};
    HEX3Aenv_62914663.reason0 = null;
    F.line = 251;
    Temporary1 = HEX3Aanonymous__asyncjs95examples952_u36.bind(HEX3Aenv_62914663); Temporary1.ClP_0 = HEX3Aanonymous__asyncjs95examples952_u36; Temporary1.ClE_0 = HEX3Aenv_62914663;
    (await catch__asyncjs95examples952_u55(fn__asyncjs95examples952_u8(6), Temporary1));
    if (!((HEX3Aenv_62914663.reason0 == null))) {
    F.line = 251;
    failedAssertImpl__stdZassertions_u86(makeNimstrLit("/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim(19, 5) `reason == nil` "));
    }
    
    F.line = 251;
    Temporary2 = HEX3Aanonymous__asyncjs95examples952_u74.bind(HEX3Aenv_62914663); Temporary2.ClP_0 = HEX3Aanonymous__asyncjs95examples952_u74; Temporary2.ClE_0 = HEX3Aenv_62914663;
    (await catch__asyncjs95examples952_u55(fn__asyncjs95examples952_u8(7), Temporary2));
    if (!(!((HEX3Aenv_62914663.reason0 == null)))) {
    F.line = 251;
    failedAssertImpl__stdZassertions_u86(makeNimstrLit("/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim(21, 5) `reason != nil` "));
    }
    
    if (!(contains__pureZstrutils_u1878(cstrToNimstr(HEX3Aenv_62914663.reason0.message), [102,111,111,98,97,114,58,32,55]))) {
    F.line = 251;
    failedAssertImpl__stdZassertions_u86(makeNimstrLit("/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim(22, 5) `\"foobar: 7\" in $reason.message` "));
    }
    
    F.line = 251;
    result_62914588 = undefined;
    break BeforeRet;
  };
  framePtr = F.prev;

  return result_62914588;

}
var F = {procname: "module asyncjs_examples_2", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim", line: 0};
framePtr = F;
F.line = 251;
F.filename = "asyncjs.nim";
(main__asyncjs95examples952_u26());
framePtr = F.prev;
var F = {procname: "module asyncjs_examples_2", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_examples_2.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module asyncjs_group0_examples", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_group0_examples.nim", line: 0};
framePtr = F;
framePtr = F.prev;
var F = {procname: "module asyncjs_group0_examples", prev: framePtr, filename: "/build/nim/src/nim/doc/html/nimcache/runnableExamples/asyncjs_group0_examples.nim", line: 0};
framePtr = F;
framePtr = F.prev;
