text: /* Generated by the Nim Compiler v0.16.1 */
  /*   (c) 2017 Andreas Rumpf */
  
  var framePtr = null;
  var excHandler = 0;
  var lastJSError = null;
  if (typeof Int8Array === 'undefined') Int8Array = Array;
  if (typeof Int16Array === 'undefined') Int16Array = Array;
  if (typeof Int32Array === 'undefined') Int32Array = Array;
  if (typeof Uint8Array === 'undefined') Uint8Array = Array;
  if (typeof Uint16Array === 'undefined') Uint16Array = Array;
  if (typeof Uint32Array === 'undefined') Uint32Array = Array;
  if (typeof Float32Array === 'undefined') Float32Array = Array;
  if (typeof Float64Array === 'undefined') Float64Array = Array;
  var NTI3456 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3448 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3450 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3404 = {size: 0,kind: 20,base: null,node: null,finalizer: null};
  var NTI28072 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI28070 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI63041 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI65002 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI62198 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  var NTI62116 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  var NTI47672 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI3454 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI114 = {size: 0,kind: 40,base: null,node: null,finalizer: null};
  var NTI62025 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI62256 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  var NTI62253 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI62250 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI62050 = {size: 0,kind: 16,base: null,node: null,finalizer: null};
  var NTI62046 = {size: 0,kind: 16,base: null,node: null,finalizer: null};
  var NTI124 = {size: 0,kind: 36,base: null,node: null,finalizer: null};
  var NTI62042 = {size: 0,kind: 16,base: null,node: null,finalizer: null};
  var NTI62006 = {size: 0, kind: 14, base: null, node: null, finalizer: null};
  var NTI28052 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI28050 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI62033 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI54004 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
  var NTI62232 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  var NTI62229 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI62226 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI62220 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  var NTI3458 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3426 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3428 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI64009 = {size: 0, kind: 14, base: null, node: null, finalizer: null};
  var NTI27076 = {size: 0, kind: 14, base: null, node: null, finalizer: null};
  var NTI64003 = {size: 0, kind: 14, base: null, node: null, finalizer: null};
  var NTI28064 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI28062 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI25383 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25379 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25375 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25371 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25367 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25363 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25359 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25355 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25351 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25347 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25343 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25339 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25335 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25331 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25327 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25323 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25319 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25315 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25311 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25307 = {size: 0,kind: 25,base: null,node: null,finalizer: null};
  var NTI25204 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI25260 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI25258 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI25218 = {size: 0, kind: 14, base: null, node: null, finalizer: null};
  var NTI25431 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI25429 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI25220 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI25427 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI25222 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI25248 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI25246 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI25478 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI25228 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI25511 = {size: 0,kind: 24,base: null,node: null,finalizer: null};
  var NTI25252 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI25250 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI130 = {size: 0,kind: 1,base: null,node: null,finalizer: null};
  var NTI25216 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI25214 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI25230 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI28004 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI28002 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI28088 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI28086 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI64017 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3446 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI118 = {size: 0,kind: 42,base: null,node: null,finalizer: null};
  var NTI66018 = {size: 0,kind: 16,base: null,node: null,finalizer: null};
  var NTI128 = {size: 0,kind: 36,base: null,node: null,finalizer: null};
  var NTI66003 = {size: 0,kind: 16,base: null,node: null,finalizer: null};
  var NTI3440 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI104 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
  var NTI13009 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  var NTI3408 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI138 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
  var NTI140 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
  var NTI3487 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
  var NTI3424 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3438 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NTI3442 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  var NNI3442 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3442.node = NNI3442;
  var NNI3438 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3438.node = NNI3438;
  NTI3487.base = NTI3424;
  var NNI3424 = {kind: 2, len: 4, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI3487, name: "parent", sons: null}, 
  {kind: 1, offset: "name", len: 0, typ: NTI140, name: "name", sons: null}, 
  {kind: 1, offset: "message", len: 0, typ: NTI138, name: "msg", sons: null}, 
  {kind: 1, offset: "trace", len: 0, typ: NTI138, name: "trace", sons: null}]};
  NTI3424.node = NNI3424;
  var NNI3408 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3408.node = NNI3408;
  NTI3424.base = NTI3408;
  NTI3438.base = NTI3424;
  NTI3442.base = NTI3438;
  var NNI13009 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI140, name: "Field0", sons: null}, 
  {kind: 1, offset: "Field1", len: 0, typ: NTI104, name: "Field1", sons: null}]};
  NTI13009.node = NNI13009;
  var NNI3440 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3440.node = NNI3440;
  NTI3440.base = NTI3438;
  NTI66003.base = NTI128;
  NTI66018.base = NTI118;
  var NNI3446 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3446.node = NNI3446;
  NTI3446.base = NTI3424;
  var NNI28004 = {kind: 2, len: 4, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "width", len: 0, typ: NTI104, name: "width", sons: null}, 
  {kind: 1, offset: "height", len: 0, typ: NTI104, name: "height", sons: null}, 
  {kind: 1, offset: "clientWidth", len: 0, typ: NTI104, name: "clientWidth", sons: null}, 
  {kind: 1, offset: "clientHeight", len: 0, typ: NTI104, name: "clientHeight", sons: null}]};
  NTI28004.node = NNI28004;
  var NNI25216 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI25216.node = NNI25216;
  NTI25216.base = NTI3408;
  NTI25214.base = NTI25216;
  NTI25228.base = NTI25230;
  NTI25511.base = NTI25228;
  var NNI25252 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "action", len: 0, typ: NTI140, name: "action", sons: null}, 
  {kind: 1, offset: "encoding", len: 0, typ: NTI140, name: "encoding", sons: null}, 
  {kind: 1, offset: "method", len: 0, typ: NTI140, name: "method", sons: null}, 
  {kind: 1, offset: "target", len: 0, typ: NTI140, name: "target", sons: null}, 
  {kind: 1, offset: "elements", len: 0, typ: NTI25511, name: "elements", sons: null}]};
  NTI25252.node = NNI25252;
  NTI25252.base = NTI25230;
  NTI25250.base = NTI25252;
  var NNI25248 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "defaultSelected", len: 0, typ: NTI130, name: "defaultSelected", sons: null}, 
  {kind: 1, offset: "selected", len: 0, typ: NTI130, name: "selected", sons: null}, 
  {kind: 1, offset: "selectedIndex", len: 0, typ: NTI104, name: "selectedIndex", sons: null}, 
  {kind: 1, offset: "text", len: 0, typ: NTI140, name: "text", sons: null}, 
  {kind: 1, offset: "value", len: 0, typ: NTI140, name: "value", sons: null}]};
  NTI25248.node = NNI25248;
  NTI25248.base = NTI25230;
  NTI25246.base = NTI25248;
  NTI25478.base = NTI25246;
  var NNI25230 = {kind: 2, len: 9, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "classList", len: 0, typ: NTI25214, name: "classList", sons: null}, 
  {kind: 1, offset: "checked", len: 0, typ: NTI130, name: "checked", sons: null}, 
  {kind: 1, offset: "defaultChecked", len: 0, typ: NTI130, name: "defaultChecked", sons: null}, 
  {kind: 1, offset: "defaultValue", len: 0, typ: NTI140, name: "defaultValue", sons: null}, 
  {kind: 1, offset: "disabled", len: 0, typ: NTI130, name: "disabled", sons: null}, 
  {kind: 1, offset: "form", len: 0, typ: NTI25250, name: "form", sons: null}, 
  {kind: 1, offset: "name", len: 0, typ: NTI140, name: "name", sons: null}, 
  {kind: 1, offset: "readOnly", len: 0, typ: NTI130, name: "readOnly", sons: null}, 
  {kind: 1, offset: "options", len: 0, typ: NTI25478, name: "options", sons: null}]};
  NTI25230.node = NNI25230;
  NTI25220.base = NTI25222;
  NTI25427.base = NTI25220;
  NTI25429.base = NTI25220;
  NTI25431.base = NTI25220;
  var NNI25218 = {kind: 2, offset: 0, typ: null, name: null, len: 12, sons: {"1": {kind: 1, offset: 1, typ: NTI25218, name: "ElementNode", len: 0, sons: null}, 
  "2": {kind: 1, offset: 2, typ: NTI25218, name: "AttributeNode", len: 0, sons: null}, 
  "3": {kind: 1, offset: 3, typ: NTI25218, name: "TextNode", len: 0, sons: null}, 
  "4": {kind: 1, offset: 4, typ: NTI25218, name: "CDATANode", len: 0, sons: null}, 
  "5": {kind: 1, offset: 5, typ: NTI25218, name: "EntityRefNode", len: 0, sons: null}, 
  "6": {kind: 1, offset: 6, typ: NTI25218, name: "EntityNode", len: 0, sons: null}, 
  "7": {kind: 1, offset: 7, typ: NTI25218, name: "ProcessingInstructionNode", len: 0, sons: null}, 
  "8": {kind: 1, offset: 8, typ: NTI25218, name: "CommentNode", len: 0, sons: null}, 
  "9": {kind: 1, offset: 9, typ: NTI25218, name: "DocumentNode", len: 0, sons: null}, 
  "10": {kind: 1, offset: 10, typ: NTI25218, name: "DocumentTypeNode", len: 0, sons: null}, 
  "11": {kind: 1, offset: 11, typ: NTI25218, name: "DocumentFragmentNode", len: 0, sons: null}, 
  "12": {kind: 1, offset: 12, typ: NTI25218, name: "NotationNode", len: 0, sons: null}}};
  NTI25218.node = NNI25218;
  var NNI25260 = {kind: 2, len: 89, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "background", len: 0, typ: NTI140, name: "background", sons: null}, 
  {kind: 1, offset: "backgroundAttachment", len: 0, typ: NTI140, name: "backgroundAttachment", sons: null}, 
  {kind: 1, offset: "backgroundColor", len: 0, typ: NTI140, name: "backgroundColor", sons: null}, 
  {kind: 1, offset: "backgroundImage", len: 0, typ: NTI140, name: "backgroundImage", sons: null}, 
  {kind: 1, offset: "backgroundPosition", len: 0, typ: NTI140, name: "backgroundPosition", sons: null}, 
  {kind: 1, offset: "backgroundRepeat", len: 0, typ: NTI140, name: "backgroundRepeat", sons: null}, 
  {kind: 1, offset: "border", len: 0, typ: NTI140, name: "border", sons: null}, 
  {kind: 1, offset: "borderBottom", len: 0, typ: NTI140, name: "borderBottom", sons: null}, 
  {kind: 1, offset: "borderBottomColor", len: 0, typ: NTI140, name: "borderBottomColor", sons: null}, 
  {kind: 1, offset: "borderBottomStyle", len: 0, typ: NTI140, name: "borderBottomStyle", sons: null}, 
  {kind: 1, offset: "borderBottomWidth", len: 0, typ: NTI140, name: "borderBottomWidth", sons: null}, 
  {kind: 1, offset: "borderColor", len: 0, typ: NTI140, name: "borderColor", sons: null}, 
  {kind: 1, offset: "borderLeft", len: 0, typ: NTI140, name: "borderLeft", sons: null}, 
  {kind: 1, offset: "borderLeftColor", len: 0, typ: NTI140, name: "borderLeftColor", sons: null}, 
  {kind: 1, offset: "borderLeftStyle", len: 0, typ: NTI140, name: "borderLeftStyle", sons: null}, 
  {kind: 1, offset: "borderLeftWidth", len: 0, typ: NTI140, name: "borderLeftWidth", sons: null}, 
  {kind: 1, offset: "borderRight", len: 0, typ: NTI140, name: "borderRight", sons: null}, 
  {kind: 1, offset: "borderRightColor", len: 0, typ: NTI140, name: "borderRightColor", sons: null}, 
  {kind: 1, offset: "borderRightStyle", len: 0, typ: NTI140, name: "borderRightStyle", sons: null}, 
  {kind: 1, offset: "borderRightWidth", len: 0, typ: NTI140, name: "borderRightWidth", sons: null}, 
  {kind: 1, offset: "borderStyle", len: 0, typ: NTI140, name: "borderStyle", sons: null}, 
  {kind: 1, offset: "borderTop", len: 0, typ: NTI140, name: "borderTop", sons: null}, 
  {kind: 1, offset: "borderTopColor", len: 0, typ: NTI140, name: "borderTopColor", sons: null}, 
  {kind: 1, offset: "borderTopStyle", len: 0, typ: NTI140, name: "borderTopStyle", sons: null}, 
  {kind: 1, offset: "borderTopWidth", len: 0, typ: NTI140, name: "borderTopWidth", sons: null}, 
  {kind: 1, offset: "borderWidth", len: 0, typ: NTI140, name: "borderWidth", sons: null}, 
  {kind: 1, offset: "bottom", len: 0, typ: NTI140, name: "bottom", sons: null}, 
  {kind: 1, offset: "captionSide", len: 0, typ: NTI140, name: "captionSide", sons: null}, 
  {kind: 1, offset: "clear", len: 0, typ: NTI140, name: "clear", sons: null}, 
  {kind: 1, offset: "clip", len: 0, typ: NTI140, name: "clip", sons: null}, 
  {kind: 1, offset: "color", len: 0, typ: NTI140, name: "color", sons: null}, 
  {kind: 1, offset: "cursor", len: 0, typ: NTI140, name: "cursor", sons: null}, 
  {kind: 1, offset: "direction", len: 0, typ: NTI140, name: "direction", sons: null}, 
  {kind: 1, offset: "display", len: 0, typ: NTI140, name: "display", sons: null}, 
  {kind: 1, offset: "emptyCells", len: 0, typ: NTI140, name: "emptyCells", sons: null}, 
  {kind: 1, offset: "cssFloat", len: 0, typ: NTI140, name: "cssFloat", sons: null}, 
  {kind: 1, offset: "font", len: 0, typ: NTI140, name: "font", sons: null}, 
  {kind: 1, offset: "fontFamily", len: 0, typ: NTI140, name: "fontFamily", sons: null}, 
  {kind: 1, offset: "fontSize", len: 0, typ: NTI140, name: "fontSize", sons: null}, 
  {kind: 1, offset: "fontStretch", len: 0, typ: NTI140, name: "fontStretch", sons: null}, 
  {kind: 1, offset: "fontStyle", len: 0, typ: NTI140, name: "fontStyle", sons: null}, 
  {kind: 1, offset: "fontVariant", len: 0, typ: NTI140, name: "fontVariant", sons: null}, 
  {kind: 1, offset: "fontWeight", len: 0, typ: NTI140, name: "fontWeight", sons: null}, 
  {kind: 1, offset: "height", len: 0, typ: NTI140, name: "height", sons: null}, 
  {kind: 1, offset: "left", len: 0, typ: NTI140, name: "left", sons: null}, 
  {kind: 1, offset: "letterSpacing", len: 0, typ: NTI140, name: "letterSpacing", sons: null}, 
  {kind: 1, offset: "lineHeight", len: 0, typ: NTI140, name: "lineHeight", sons: null}, 
  {kind: 1, offset: "listStyle", len: 0, typ: NTI140, name: "listStyle", sons: null}, 
  {kind: 1, offset: "listStyleImage", len: 0, typ: NTI140, name: "listStyleImage", sons: null}, 
  {kind: 1, offset: "listStylePosition", len: 0, typ: NTI140, name: "listStylePosition", sons: null}, 
  {kind: 1, offset: "listStyleType", len: 0, typ: NTI140, name: "listStyleType", sons: null}, 
  {kind: 1, offset: "margin", len: 0, typ: NTI140, name: "margin", sons: null}, 
  {kind: 1, offset: "marginBottom", len: 0, typ: NTI140, name: "marginBottom", sons: null}, 
  {kind: 1, offset: "marginLeft", len: 0, typ: NTI140, name: "marginLeft", sons: null}, 
  {kind: 1, offset: "marginRight", len: 0, typ: NTI140, name: "marginRight", sons: null}, 
  {kind: 1, offset: "marginTop", len: 0, typ: NTI140, name: "marginTop", sons: null}, 
  {kind: 1, offset: "maxHeight", len: 0, typ: NTI140, name: "maxHeight", sons: null}, 
  {kind: 1, offset: "maxWidth", len: 0, typ: NTI140, name: "maxWidth", sons: null}, 
  {kind: 1, offset: "minHeight", len: 0, typ: NTI140, name: "minHeight", sons: null}, 
  {kind: 1, offset: "minWidth", len: 0, typ: NTI140, name: "minWidth", sons: null}, 
  {kind: 1, offset: "overflow", len: 0, typ: NTI140, name: "overflow", sons: null}, 
  {kind: 1, offset: "padding", len: 0, typ: NTI140, name: "padding", sons: null}, 
  {kind: 1, offset: "paddingBottom", len: 0, typ: NTI140, name: "paddingBottom", sons: null}, 
  {kind: 1, offset: "paddingLeft", len: 0, typ: NTI140, name: "paddingLeft", sons: null}, 
  {kind: 1, offset: "paddingRight", len: 0, typ: NTI140, name: "paddingRight", sons: null}, 
  {kind: 1, offset: "paddingTop", len: 0, typ: NTI140, name: "paddingTop", sons: null}, 
  {kind: 1, offset: "pageBreakAfter", len: 0, typ: NTI140, name: "pageBreakAfter", sons: null}, 
  {kind: 1, offset: "pageBreakBefore", len: 0, typ: NTI140, name: "pageBreakBefore", sons: null}, 
  {kind: 1, offset: "position", len: 0, typ: NTI140, name: "position", sons: null}, 
  {kind: 1, offset: "right", len: 0, typ: NTI140, name: "right", sons: null}, 
  {kind: 1, offset: "scrollbar3dLightColor", len: 0, typ: NTI140, name: "scrollbar3dLightColor", sons: null}, 
  {kind: 1, offset: "scrollbarArrowColor", len: 0, typ: NTI140, name: "scrollbarArrowColor", sons: null}, 
  {kind: 1, offset: "scrollbarBaseColor", len: 0, typ: NTI140, name: "scrollbarBaseColor", sons: null}, 
  {kind: 1, offset: "scrollbarDarkshadowColor", len: 0, typ: NTI140, name: "scrollbarDarkshadowColor", sons: null}, 
  {kind: 1, offset: "scrollbarFaceColor", len: 0, typ: NTI140, name: "scrollbarFaceColor", sons: null}, 
  {kind: 1, offset: "scrollbarHighlightColor", len: 0, typ: NTI140, name: "scrollbarHighlightColor", sons: null}, 
  {kind: 1, offset: "scrollbarShadowColor", len: 0, typ: NTI140, name: "scrollbarShadowColor", sons: null}, 
  {kind: 1, offset: "scrollbarTrackColor", len: 0, typ: NTI140, name: "scrollbarTrackColor", sons: null}, 
  {kind: 1, offset: "tableLayout", len: 0, typ: NTI140, name: "tableLayout", sons: null}, 
  {kind: 1, offset: "textAlign", len: 0, typ: NTI140, name: "textAlign", sons: null}, 
  {kind: 1, offset: "textDecoration", len: 0, typ: NTI140, name: "textDecoration", sons: null}, 
  {kind: 1, offset: "textIndent", len: 0, typ: NTI140, name: "textIndent", sons: null}, 
  {kind: 1, offset: "textTransform", len: 0, typ: NTI140, name: "textTransform", sons: null}, 
  {kind: 1, offset: "top", len: 0, typ: NTI140, name: "top", sons: null}, 
  {kind: 1, offset: "verticalAlign", len: 0, typ: NTI140, name: "verticalAlign", sons: null}, 
  {kind: 1, offset: "visibility", len: 0, typ: NTI140, name: "visibility", sons: null}, 
  {kind: 1, offset: "width", len: 0, typ: NTI140, name: "width", sons: null}, 
  {kind: 1, offset: "wordSpacing", len: 0, typ: NTI140, name: "wordSpacing", sons: null}, 
  {kind: 1, offset: "zIndex", len: 0, typ: NTI104, name: "zIndex", sons: null}]};
  NTI25260.node = NNI25260;
  NTI25260.base = NTI3408;
  NTI25258.base = NTI25260;
  var NNI25222 = {kind: 2, len: 14, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "attributes", len: 0, typ: NTI25427, name: "attributes", sons: null}, 
  {kind: 1, offset: "childNodes", len: 0, typ: NTI25429, name: "childNodes", sons: null}, 
  {kind: 1, offset: "children", len: 0, typ: NTI25431, name: "children", sons: null}, 
  {kind: 1, offset: "data", len: 0, typ: NTI140, name: "data", sons: null}, 
  {kind: 1, offset: "firstChild", len: 0, typ: NTI25220, name: "firstChild", sons: null}, 
  {kind: 1, offset: "lastChild", len: 0, typ: NTI25220, name: "lastChild", sons: null}, 
  {kind: 1, offset: "nextSibling", len: 0, typ: NTI25220, name: "nextSibling", sons: null}, 
  {kind: 1, offset: "nodeName", len: 0, typ: NTI140, name: "nodeName", sons: null}, 
  {kind: 1, offset: "nodeType", len: 0, typ: NTI25218, name: "nodeType", sons: null}, 
  {kind: 1, offset: "nodeValue", len: 0, typ: NTI140, name: "nodeValue", sons: null}, 
  {kind: 1, offset: "parentNode", len: 0, typ: NTI25220, name: "parentNode", sons: null}, 
  {kind: 1, offset: "previousSibling", len: 0, typ: NTI25220, name: "previousSibling", sons: null}, 
  {kind: 1, offset: "innerHTML", len: 0, typ: NTI140, name: "innerHTML", sons: null}, 
  {kind: 1, offset: "style", len: 0, typ: NTI25258, name: "style", sons: null}]};
  NTI25222.node = NNI25222;
  var NNI25204 = {kind: 2, len: 20, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "onabort", len: 0, typ: NTI25307, name: "onabort", sons: null}, 
  {kind: 1, offset: "onblur", len: 0, typ: NTI25311, name: "onblur", sons: null}, 
  {kind: 1, offset: "onchange", len: 0, typ: NTI25315, name: "onchange", sons: null}, 
  {kind: 1, offset: "onclick", len: 0, typ: NTI25319, name: "onclick", sons: null}, 
  {kind: 1, offset: "ondblclick", len: 0, typ: NTI25323, name: "ondblclick", sons: null}, 
  {kind: 1, offset: "onerror", len: 0, typ: NTI25327, name: "onerror", sons: null}, 
  {kind: 1, offset: "onfocus", len: 0, typ: NTI25331, name: "onfocus", sons: null}, 
  {kind: 1, offset: "onkeydown", len: 0, typ: NTI25335, name: "onkeydown", sons: null}, 
  {kind: 1, offset: "onkeypress", len: 0, typ: NTI25339, name: "onkeypress", sons: null}, 
  {kind: 1, offset: "onkeyup", len: 0, typ: NTI25343, name: "onkeyup", sons: null}, 
  {kind: 1, offset: "onload", len: 0, typ: NTI25347, name: "onload", sons: null}, 
  {kind: 1, offset: "onmousedown", len: 0, typ: NTI25351, name: "onmousedown", sons: null}, 
  {kind: 1, offset: "onmousemove", len: 0, typ: NTI25355, name: "onmousemove", sons: null}, 
  {kind: 1, offset: "onmouseout", len: 0, typ: NTI25359, name: "onmouseout", sons: null}, 
  {kind: 1, offset: "onmouseover", len: 0, typ: NTI25363, name: "onmouseover", sons: null}, 
  {kind: 1, offset: "onmouseup", len: 0, typ: NTI25367, name: "onmouseup", sons: null}, 
  {kind: 1, offset: "onreset", len: 0, typ: NTI25371, name: "onreset", sons: null}, 
  {kind: 1, offset: "onselect", len: 0, typ: NTI25375, name: "onselect", sons: null}, 
  {kind: 1, offset: "onsubmit", len: 0, typ: NTI25379, name: "onsubmit", sons: null}, 
  {kind: 1, offset: "onunload", len: 0, typ: NTI25383, name: "onunload", sons: null}]};
  NTI25204.node = NNI25204;
  NTI25204.base = NTI3408;
  NTI25222.base = NTI25204;
  NTI25230.base = NTI25222;
  NTI28004.base = NTI25230;
  NTI28002.base = NTI28004;
  var NNI28088 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "canvas", len: 0, typ: NTI28002, name: "canvas", sons: null}, 
  {kind: 1, offset: "drawingBufferWidth", len: 0, typ: NTI104, name: "drawingBufferWidth", sons: null}, 
  {kind: 1, offset: "drawingBufferHeight", len: 0, typ: NTI104, name: "drawingBufferHeight", sons: null}]};
  NTI28088.node = NNI28088;
  NTI28086.base = NTI28088;
  var NNI28064 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI28064.node = NNI28064;
  NTI28064.base = NTI3408;
  NTI28062.base = NTI28064;
  var NNI64003 = {kind: 2, offset: 0, typ: null, name: null, len: 2, sons: {"34962": {kind: 1, offset: 34962, typ: NTI64003, name: "Vertex", len: 0, sons: null}, 
  "34963": {kind: 1, offset: 34963, typ: NTI64003, name: "Index", len: 0, sons: null}}};
  NTI64003.node = NNI64003;
  var NNI27076 = {kind: 2, offset: 0, typ: null, name: null, len: 7, sons: {"5120": {kind: 1, offset: 5120, typ: NTI27076, name: "dtBYTE", len: 0, sons: null}, 
  "5121": {kind: 1, offset: 5121, typ: NTI27076, name: "dtUNSIGNED_BYTE", len: 0, sons: null}, 
  "5122": {kind: 1, offset: 5122, typ: NTI27076, name: "dtSHORT", len: 0, sons: null}, 
  "5123": {kind: 1, offset: 5123, typ: NTI27076, name: "dtUNSIGNED_SHORT", len: 0, sons: null}, 
  "5124": {kind: 1, offset: 5124, typ: NTI27076, name: "dtINT", len: 0, sons: null}, 
  "5125": {kind: 1, offset: 5125, typ: NTI27076, name: "dtUNSIGNED_INT", len: 0, sons: null}, 
  "5126": {kind: 1, offset: 5126, typ: NTI27076, name: "dtFLOAT", len: 0, sons: null}}};
  NTI27076.node = NNI27076;
  var NNI64009 = {kind: 2, offset: 0, typ: null, name: null, len: 3, sons: {"35040": {kind: 1, offset: 35040, typ: NTI64009, name: "Stream", len: 0, sons: null}, 
  "35044": {kind: 1, offset: 35044, typ: NTI64009, name: "Static", len: 0, sons: null}, 
  "35048": {kind: 1, offset: 35048, typ: NTI64009, name: "Dynamic", len: 0, sons: null}}};
  NTI64009.node = NNI64009;
  var NNI64017 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "gl", len: 0, typ: NTI28086, name: "gl", sons: null}, 
  {kind: 1, offset: "glbuffer", len: 0, typ: NTI28062, name: "glbuffer", sons: null}, 
  {kind: 1, offset: "kind", len: 0, typ: NTI64003, name: "kind", sons: null}, 
  {kind: 1, offset: "datatype", len: 0, typ: NTI27076, name: "datatype", sons: null}, 
  {kind: 1, offset: "drawmode", len: 0, typ: NTI64009, name: "drawmode", sons: null}]};
  NTI64017.node = NNI64017;
  var NNI3428 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3428.node = NNI3428;
  var NNI3426 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3426.node = NNI3426;
  NTI3426.base = NTI3424;
  NTI3428.base = NTI3426;
  var NNI3458 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3458.node = NNI3458;
  NTI3458.base = NTI3424;
  var NNI28052 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI28052.node = NNI28052;
  NTI28052.base = NTI3408;
  NTI28050.base = NTI28052;
  var NNI62006 = {kind: 2, offset: 0, typ: null, name: null, len: 8, sons: {"0": {kind: 1, offset: 0, typ: NTI62006, name: "UNKNOWN", len: 0, sons: null}, 
  "1": {kind: 1, offset: 1, typ: NTI62006, name: "float", len: 0, sons: null}, 
  "2": {kind: 1, offset: 2, typ: NTI62006, name: "vec2", len: 0, sons: null}, 
  "3": {kind: 1, offset: 3, typ: NTI62006, name: "vec3", len: 0, sons: null}, 
  "4": {kind: 1, offset: 4, typ: NTI62006, name: "vec4", len: 0, sons: null}, 
  "9": {kind: 1, offset: 9, typ: NTI62006, name: "mat3", len: 0, sons: null}, 
  "16": {kind: 1, offset: 16, typ: NTI62006, name: "mat4", len: 0, sons: null}, 
  "44": {kind: 1, offset: 44, typ: NTI62006, name: "mat2", len: 0, sons: null}}};
  NTI62006.node = NNI62006;
  NTI62042.base = NTI124;
  NTI62046.base = NTI124;
  NTI62050.base = NTI124;
  var NNI62033 = {kind: 2, len: 6, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "location", len: 0, typ: NTI28050, name: "location", sons: null}, 
  {kind: 1, offset: "name", len: 0, typ: NTI138, name: "name", sons: null}, 
  {kind: 1, offset: "size", len: 0, typ: NTI104, name: "size", sons: null}, 
  {kind: 1, offset: "datatype", len: 0, typ: NTI27076, name: "datatype", sons: null}, 
  {kind: 1, offset: "normalize", len: 0, typ: NTI130, name: "normalize", sons: null}, 
  {kind: 3, offset: "kind", len: 45, typ: NTI62006, name: "kind", sons: [[SetConstr(44), {kind: 1, offset: "mat2", len: 0, typ: NTI62042, name: "mat2", sons: null}], 
  [SetConstr(9), {kind: 1, offset: "mat3", len: 0, typ: NTI62046, name: "mat3", sons: null}], 
  [SetConstr(16), {kind: 1, offset: "mat4", len: 0, typ: NTI62050, name: "mat4", sons: null}], 
  [SetConstr(45), {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}]]}]};
  NTI62033.node = NNI62033;
  var NNI62232 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI54004, name: "Field0", sons: null}, 
  {kind: 1, offset: "Field1", len: 0, typ: NTI138, name: "Field1", sons: null}, 
  {kind: 1, offset: "Field2", len: 0, typ: NTI62033, name: "Field2", sons: null}]};
  NTI62232.node = NNI62232;
  NTI62229.base = NTI62232;
  var NNI62226 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "data", len: 0, typ: NTI62229, name: "data", sons: null}, 
  {kind: 1, offset: "counter", len: 0, typ: NTI104, name: "counter", sons: null}]};
  NTI62226.node = NNI62226;
  var NNI62025 = {kind: 2, len: 6, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "name", len: 0, typ: NTI138, name: "name", sons: null}, 
  {kind: 1, offset: "location", len: 0, typ: NTI114, name: "location", sons: null}, 
  {kind: 1, offset: "kind", len: 0, typ: NTI62006, name: "kind", sons: null}, 
  {kind: 1, offset: "size", len: 0, typ: NTI104, name: "size", sons: null}, 
  {kind: 1, offset: "datatype", len: 0, typ: NTI27076, name: "datatype", sons: null}, 
  {kind: 1, offset: "normalize", len: 0, typ: NTI130, name: "normalize", sons: null}]};
  NTI62025.node = NNI62025;
  var NNI62256 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI54004, name: "Field0", sons: null}, 
  {kind: 1, offset: "Field1", len: 0, typ: NTI138, name: "Field1", sons: null}, 
  {kind: 1, offset: "Field2", len: 0, typ: NTI62025, name: "Field2", sons: null}]};
  NTI62256.node = NNI62256;
  NTI62253.base = NTI62256;
  var NNI62250 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "data", len: 0, typ: NTI62253, name: "data", sons: null}, 
  {kind: 1, offset: "counter", len: 0, typ: NTI104, name: "counter", sons: null}]};
  NTI62250.node = NNI62250;
  var NNI62220 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI62226, name: "Field0", sons: null}, 
  {kind: 1, offset: "Field1", len: 0, typ: NTI62250, name: "Field1", sons: null}]};
  NTI62220.node = NNI62220;
  var NNI3454 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3454.node = NNI3454;
  NTI3454.base = NTI3424;
  NTI47672.base = NTI138;
  var NNI62116 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI104, name: "Field0", sons: null}, 
  {kind: 1, offset: "Field1", len: 0, typ: NTI27076, name: "Field1", sons: null}, 
  {kind: 1, offset: "Field2", len: 0, typ: NTI130, name: "Field2", sons: null}]};
  NTI62116.node = NNI62116;
  var NNI62198 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI104, name: "Field0", sons: null}, 
  {kind: 1, offset: "Field1", len: 0, typ: NTI27076, name: "Field1", sons: null}, 
  {kind: 1, offset: "Field2", len: 0, typ: NTI130, name: "Field2", sons: null}]};
  NTI62198.node = NNI62198;
  var NNI28072 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI28072.node = NNI28072;
  NTI28072.base = NTI3408;
  NTI28070.base = NTI28072;
  var NNI63041 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "glprogram", len: 0, typ: NTI28070, name: "glprogram", sons: null}, 
  {kind: 1, offset: "uniforms", len: 0, typ: NTI62226, name: "uniforms", sons: null}, 
  {kind: 1, offset: "attributes", len: 0, typ: NTI62250, name: "attributes", sons: null}]};
  NTI63041.node = NNI63041;
  NTI3404.base = NTI104;
  var NNI65002 = {kind: 2, len: 8, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "gl", len: 0, typ: NTI28086, name: "gl", sons: null}, 
  {kind: 1, offset: "vb", len: 0, typ: NTI64017, name: "vb", sons: null}, 
  {kind: 1, offset: "ib", len: 0, typ: NTI64017, name: "ib", sons: null}, 
  {kind: 1, offset: "cb", len: 0, typ: NTI64017, name: "cb", sons: null}, 
  {kind: 1, offset: "shader", len: 0, typ: NTI63041, name: "shader", sons: null}, 
  {kind: 1, offset: "il", len: 0, typ: NTI3404, name: "il", sons: null}, 
  {kind: 1, offset: "vl", len: 0, typ: NTI3404, name: "vl", sons: null}, 
  {kind: 1, offset: "cl", len: 0, typ: NTI3404, name: "cl", sons: null}]};
  NTI65002.node = NNI65002;
  var NNI3450 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3450.node = NNI3450;
  var NNI3448 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3448.node = NNI3448;
  NTI3448.base = NTI3424;
  NTI3450.base = NTI3448;
  var NNI3456 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  NTI3456.node = NNI3456;
  NTI3456.base = NTI3424;
  function makeNimstrLit(c_14003) {
  
      var ln = c_14003.length;
      var result = new Array(ln + 1);
      var i = 0;
      for (; i < ln; ++i) {
        result[i] = c_14003.charCodeAt(i);
      }
      result[i] = 0; // terminating zero
      return result;
      }
  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;
      }
  function nimCopy(dest_19217, src_19218, ti_19219) {
  
  var result_19629 = null;
  switch (ti_19219.kind) {
  case 21: case 22: case 23: case 5: if (!(isFatPointer_19201(ti_19219))) {
  result_19629 = src_19218;
  }
  else {
  result_19629 = [src_19218[0], src_19218[1]];}
  
  
  break;
  case 19:       if (dest_19217 === null || dest_19217 === undefined) {
          dest_19217 = {};
        }
        else {
          for (var key in dest_19217) { delete dest_19217[key]; }
        }
        for (var key in src_19218) { dest_19217[key] = src_19218[key]; }
        result_19629 = dest_19217;
      
  break;
  case 18: case 17: if (!((ti_19219.base == null))) {
  result_19629 = nimCopy(dest_19217, src_19218, ti_19219.base);
  }
  else {
  if ((ti_19219.kind == 17)) {
  result_19629 = (dest_19217 === null || dest_19217 === undefined) ? {m_type: ti_19219} : dest_19217;}
  else {
  result_19629 = (dest_19217 === null || dest_19217 === undefined) ? {} : dest_19217;}
  }
  nimCopyAux(result_19629, src_19218, ti_19219.node);
  
  break;
  case 24: case 4: case 27: case 16:       if (src_19218 === null) {
          result_19629 = null;
        }
        else {
          if (dest_19217 === null || dest_19217 === undefined) {
            dest_19217 = new Array(src_19218.length);
          }
          else {
            dest_19217.length = src_19218.length;
          }
          result_19629 = dest_19217;
          for (var i = 0; i < src_19218.length; ++i) {
            result_19629[i] = nimCopy(result_19629[i], src_19218[i], ti_19219.base);
          }
        }
      
  break;
  case 28:       if (src_19218 !== null) {
          result_19629 = src_19218.slice(0);
        }
      
  break;
  default: 
  result_19629 = src_19218;
  break;
  }
  return result_19629;
  }
  function eqStrings(a_16603, b_16604) {
  
      if (a_16603 == b_16604) return true;
      if ((!a_16603) || (!b_16604)) return false;
      var alen = a_16603.length;
      if (alen != b_16604.length) return false;
      for (var i = 0; i < alen; ++i)
        if (a_16603[i] != b_16604[i]) return false;
      return true;
    }
  function arrayConstr(len_19664, value_19665, typ_19666) {
  
        var result = new Array(len_19664);
        for (var i = 0; i < len_19664; ++i) result[i] = nimCopy(null, value_19665, typ_19666);
        return result;
      }
  function cstrToNimstr(c_14203) {
  
    var ln = c_14203.length;
    var result = new Array(ln);
    var r = 0;
    for (var i = 0; i < ln; ++i) {
      var ch = c_14203.charCodeAt(i);
  
      if (ch < 128) {
        result[r] = ch;
      }
      else if((ch > 127) && (ch < 2048)) {
        result[r] = (ch >> 6) | 192;
        ++r;
        result[r] = (ch & 63) | 128;
      }
      else {
        result[r] = (ch >> 12) | 224;
        ++r;
        result[r] = ((ch >> 6) & 63) | 128;
        ++r;
        result[r] = (ch & 63) | 128;
      }
      ++r;
    }
    result[r] = 0; // terminating zero
    return result;
    }
  function toJSStr(s_14403) {
  
      var len = s_14403.length-1;
      var asciiPart = new Array(len);
      var fcc = String.fromCharCode;
      var nonAsciiPart = null;
      var nonAsciiOffset = 0;
      for (var i = 0; i < len; ++i) {
        if (nonAsciiPart !== null) {
          var offset = (i - nonAsciiOffset) * 2;
          var code = s_14403[i].toString(16);
          if (code.length == 1) {
            code = "0"+code;
          }
          nonAsciiPart[offset] = "%";
          nonAsciiPart[offset + 1] = code;
        }
        else if (s_14403[i] < 128)
          asciiPart[i] = fcc(s_14403[i]);
        else {
          asciiPart.length = i;
          nonAsciiOffset = i;
          nonAsciiPart = new Array((len - i) * 2);
          --i;
        }
      }
      asciiPart = asciiPart.join("");
      return (nonAsciiPart === null) ?
          asciiPart : asciiPart + decodeURIComponent(nonAsciiPart.join(""));
    }
  function raiseException(e_13406, ename_13407) {
  
  e_13406.name = ename_13407;
  if ((excHandler == 0)) {
  unhandledException(e_13406);
  }
  
  e_13406.trace = nimCopy(null, rawWriteStackTrace_13228(), NTI138);
  throw e_13406;}
  function nimMax(a_18844, b_18845) {
  
  var Tmp1;
  var result_18846 = 0;
  BeforeRet: do {
  if ((b_18845 <= a_18844)) {
  Tmp1 = a_18844;
  }
  else {
  Tmp1 = b_18845;
  }
  
  result_18846 = Tmp1;
  break BeforeRet;
  } while (false); 
  return result_18846;
  }
  function mulInt(a_17203, b_17204) {
  
        var result = a_17203 * b_17204;
        if (result > 2147483647 || result < -2147483648) raiseOverflow();
        return result;
      }
  function rawEcho() {
  
  var node_16636 = null;
  node_16636 = document.getElementsByTagName('body')[0];if ((node_16636 === null)) {
  var e_16650 = null;
  e_16650 = {m_type: NTI3428, parent: null, name: null, message: null, trace: null};
  e_16650.message = nimCopy(null, makeNimstrLit("<body> element does not exist yet!"), NTI138);
  e_16650.parent = null;
  raiseException(e_16650, "IOError");
  }
  
      for (var i = 0; i < arguments.length; ++i) {
        var x = toJSStr(arguments[i]);
        node_16636.appendChild(document.createTextNode(x));
      }
      node_16636.appendChild(document.createElement("br"));
      }
  function chckRange(i_19809, a_19810, b_19811) {
  
  var Tmp1;
  var result_19812 = 0;
  BeforeRet: do {
  if (!(a_19810 <= i_19809)) Tmp1 = false; else {Tmp1 = (i_19809 <= b_19811); }if (Tmp1) {
  result_19812 = i_19809;
  break BeforeRet;
  }
  else {
  raiseRangeError();
  }
  
  } while (false); 
  return result_19812;
  }
  function chckIndx(i_19803, a_19804, b_19805) {
  
  var Tmp1;
  var result_19806 = 0;
  BeforeRet: do {
  if (!(a_19804 <= i_19803)) Tmp1 = false; else {Tmp1 = (i_19803 <= b_19805); }if (Tmp1) {
  result_19806 = i_19803;
  break BeforeRet;
  }
  else {
  raiseIndexError();
  }
  
  } while (false); 
  return result_19806;
  }
  function addInt(a_16803, b_16804) {
  
        var result = a_16803 + b_16804;
        if (result > 2147483647 || result < -2147483648) raiseOverflow();
        return result;
      }
  function subInt(a_17003, b_17004) {
  
        var result = a_17003 - b_17004;
        if (result > 2147483647 || result < -2147483648) raiseOverflow();
        return result;
      }
  var nimvm_5887 = false;
  var nim_program_result = 0;
  var globalRaiseHook_11005 = [null];
  var localRaiseHook_11010 = [null];
  var outOfMemHook_11013 = [null];
  function isFatPointer_19201(ti_19203) {
  
  var result_19204 = false;
  BeforeRet: do {
  result_19204 = !((SetConstr(17, 16, 4, 18, 27, 19, 23, 22, 21)[ti_19203.base.kind] != undefined));
  break BeforeRet;
  } while (false); 
  return result_19204;
  }
  function nimCopyAux(dest_19222, src_19223, n_19225) {
  
  switch (n_19225.kind) {
  case 0: 
  break;
  case 1:       dest_19222[n_19225.offset] = nimCopy(dest_19222[n_19225.offset], src_19223[n_19225.offset], n_19225.typ);
      
  break;
  case 2: L1: do {
  var i_19615 = 0;
  var colontmp__19617 = 0;
  colontmp__19617 = (n_19225.len - 1);
  var res_19620 = 0;
  L2: do {
  L3: while (true) {
  if (!(res_19620 <= colontmp__19617)) break L3;
  i_19615 = res_19620;
  nimCopyAux(dest_19222, src_19223, n_19225.sons[i_19615]);
  res_19620 += 1;
  }
  } while(false);
  } while(false);
  
  break;
  case 3:       dest_19222[n_19225.offset] = nimCopy(dest_19222[n_19225.offset], src_19223[n_19225.offset], n_19225.typ);
        for (var i = 0; i < n_19225.sons.length; ++i) {
          nimCopyAux(dest_19222, src_19223, n_19225.sons[i][1]);
        }
      
  break;
  }
  }
  function add_11029(x_11032, x_11032_Idx, y_11033) {
  
          var len = x_11032[0].length-1;
          for (var i = 0; i < y_11033.length; ++i) {
            x_11032[0][len] = y_11033.charCodeAt(i);
            ++len;
          }
          x_11032[0][len] = 0
        }
  function auxWriteStackTrace_13004(f_13006) {
  
  var Tmp3;
  var result_13007 = [null];
  var it_13015 = f_13006;
  var i_13016 = 0;
  var total_13017 = 0;
  var tempFrames_13021 = arrayConstr(64, {Field0: null, Field1: 0}, NTI13009);
  L1: do {
  L2: while (true) {
  if (!!((it_13015 == null))) Tmp3 = false; else {Tmp3 = (i_13016 <= 63); }if (!Tmp3) break L2;
  tempFrames_13021[i_13016].Field0 = it_13015.procname;
  tempFrames_13021[i_13016].Field1 = it_13015.line;
  i_13016 += 1;
  total_13017 += 1;
  it_13015 = it_13015.prev;
  }
  } while(false);
  L4: do {
  L5: while (true) {
  if (!!((it_13015 == null))) break L5;
  total_13017 += 1;
  it_13015 = it_13015.prev;
  }
  } while(false);
  result_13007[0] = nimCopy(null, makeNimstrLit(""), NTI138);
  if (!((total_13017 == i_13016))) {
  if (result_13007[0] != null) { result_13007[0] = (result_13007[0].slice(0, -1)).concat(makeNimstrLit("(")); } else { result_13007[0] = makeNimstrLit("(");};
  if (result_13007[0] != null) { result_13007[0] = (result_13007[0].slice(0, -1)).concat(cstrToNimstr(((total_13017 - i_13016))+"")); } else { result_13007[0] = cstrToNimstr(((total_13017 - i_13016))+"");};
  if (result_13007[0] != null) { result_13007[0] = (result_13007[0].slice(0, -1)).concat(makeNimstrLit(" calls omitted) ...\x0A")); } else { result_13007[0] = makeNimstrLit(" calls omitted) ...\x0A");};
  }
  
  L6: do {
  var j_13215 = 0;
  var colontmp__13221 = 0;
  colontmp__13221 = (i_13016 - 1);
  var res_13224 = colontmp__13221;
  L7: do {
  L8: while (true) {
  if (!(0 <= res_13224)) break L8;
  j_13215 = res_13224;
  add_11029(result_13007, 0, tempFrames_13021[j_13215].Field0);
  if ((0 < tempFrames_13021[j_13215].Field1)) {
  if (result_13007[0] != null) { result_13007[0] = (result_13007[0].slice(0, -1)).concat(makeNimstrLit(", line: ")); } else { result_13007[0] = makeNimstrLit(", line: ");};
  if (result_13007[0] != null) { result_13007[0] = (result_13007[0].slice(0, -1)).concat(cstrToNimstr((tempFrames_13021[j_13215].Field1)+"")); } else { result_13007[0] = cstrToNimstr((tempFrames_13021[j_13215].Field1)+"");};
  }
  
  if (result_13007[0] != null) { result_13007[0] = (result_13007[0].slice(0, -1)).concat(makeNimstrLit("\x0A")); } else { result_13007[0] = makeNimstrLit("\x0A");};
  res_13224 -= 1;
  }
  } while(false);
  } while(false);
  return result_13007[0];
  }
  function rawWriteStackTrace_13228() {
  
  var result_13230 = null;
  if (!((framePtr == null))) {
  result_13230 = nimCopy(null, (makeNimstrLit("Traceback (most recent call last)\x0A").slice(0,-1)).concat(auxWriteStackTrace_13004(framePtr)), NTI138);
  }
  else {
  result_13230 = nimCopy(null, makeNimstrLit("No stack traceback available\x0A"), NTI138);
  }
  
  return result_13230;
  }
  function unhandledException(e_13253) {
  
  var Tmp1;
  var buf_13254 = /**/[makeNimstrLit("")];
  if (!!(eqStrings(e_13253.message, null))) Tmp1 = false; else {Tmp1 = !((e_13253.message[0] == 0)); }if (Tmp1) {
  if (buf_13254[0] != null) { buf_13254[0] = (buf_13254[0].slice(0, -1)).concat(makeNimstrLit("Error: unhandled exception: ")); } else { buf_13254[0] = makeNimstrLit("Error: unhandled exception: ");};
  if (buf_13254[0] != null) { buf_13254[0] = (buf_13254[0].slice(0, -1)).concat(e_13253.message); } else { buf_13254[0] = e_13253.message;};
  }
  else {
  if (buf_13254[0] != null) { buf_13254[0] = (buf_13254[0].slice(0, -1)).concat(makeNimstrLit("Error: unhandled exception")); } else { buf_13254[0] = makeNimstrLit("Error: unhandled exception");};
  }
  
  if (buf_13254[0] != null) { buf_13254[0] = (buf_13254[0].slice(0, -1)).concat(makeNimstrLit(" [")); } else { buf_13254[0] = makeNimstrLit(" [");};
  add_11029(buf_13254, 0, e_13253.name);
  if (buf_13254[0] != null) { buf_13254[0] = (buf_13254[0].slice(0, -1)).concat(makeNimstrLit("]\x0A")); } else { buf_13254[0] = makeNimstrLit("]\x0A");};
  if (buf_13254[0] != null) { buf_13254[0] = (buf_13254[0].slice(0, -1)).concat(rawWriteStackTrace_13228()); } else { buf_13254[0] = rawWriteStackTrace_13228();};
  var cbuf_13401 = toJSStr(buf_13254[0]);
  framePtr = null;
    if (typeof(Error) !== "undefined") {
      throw new Error(cbuf_13401);
    }
    else {
      throw cbuf_13401;
    }
    }
  function raiseOverflow() {
  
  var e_13840 = null;
  e_13840 = {m_type: NTI3442, parent: null, name: null, message: null, trace: null};
  e_13840.message = nimCopy(null, makeNimstrLit("over- or underflow"), NTI138);
  e_13840.parent = null;
  raiseException(e_13840, "OverflowError");
  }
  function raiseDivByZero() {
  
  var e_13858 = null;
  e_13858 = {m_type: NTI3440, parent: null, name: null, message: null, trace: null};
  e_13858.message = nimCopy(null, makeNimstrLit("division by zero"), NTI138);
  e_13858.parent = null;
  raiseException(e_13858, "DivByZeroError");
  }
  var objectID_54232 = /**/[0];
  var fragCode_66001 = makeNimstrLit("    precision mediump float;\x0A    uniform vec4 color;\x0A    void main(void) {\x0A      gl_FragColor = color;\x0A    }\x0A  ");
  var vertcode_66002 = makeNimstrLit("    attribute vec3 coordinates;\x0A    uniform mat4 rot;\x0A    void main(void) {\x0A      gl_Position = rot*vec4(coordinates, 1.0);\x0A    }\x0A  ");
  var positions_66017 = nimCopy(null, [5.0000000000000000e-001, 5.0000000000000000e-001, 5.0000000000000000e-001, -5.0000000000000000e-001, 5.0000000000000000e-001, 5.0000000000000000e-001, -5.0000000000000000e-001, -5.0000000000000000e-001, 5.0000000000000000e-001, 5.0000000000000000e-001, -5.0000000000000000e-001, 5.0000000000000000e-001, 5.0000000000000000e-001, -5.0000000000000000e-001, -5.0000000000000000e-001, 5.0000000000000000e-001, 5.0000000000000000e-001, -5.0000000000000000e-001, -5.0000000000000000e-001, 5.0000000000000000e-001, -5.0000000000000000e-001, -5.0000000000000000e-001, -5.0000000000000000e-001, -5.0000000000000000e-001], NTI66003);
  var indices_66020 = nimCopy(null, [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 6, 1, 1, 6, 7, 1, 7, 2, 7, 4, 3, 7, 3, 2, 4, 7, 6, 4, 6, 5], NTI66018);
  function sysFatal_21821(message_21827) {
  
  var F={procname:"sysFatal.sysFatal",prev:framePtr,filename:"lib\\system.nim",line:0};
  framePtr = F;
  F.line = 2634;
  var e_21829 = null;
  e_21829 = {m_type: NTI3446, parent: null, name: null, message: null, trace: null};
  F.line = 2636;
  e_21829.message = nimCopy(null, message_21827, NTI138);
  F.line = 2637;
  raiseException(e_21829, "AssertionError");
  framePtr = F.prev;
  }
  function raiseAssert_21816(msg_21818) {
  
  var F={procname:"system.raiseAssert",prev:framePtr,filename:"lib\\system.nim",line:0};
  framePtr = F;
  sysFatal_21821(msg_21818);
  framePtr = F.prev;
  }
  function failedAssertImpl_21839(msg_21841) {
  
  var F={procname:"system.failedAssertImpl",prev:framePtr,filename:"lib\\system.nim",line:0};
  framePtr = F;
  raiseAssert_21816(msg_21841);
  framePtr = F.prev;
  }
  function getContextWebgl_28957(c_28959) {
  
  var result_28960 = null;
  var F={procname:"webgl.getContextWebgl",prev:framePtr,filename:"C:\\Users\\stisa\\.nimble\\pkgs\\webgl-#head\\webgl.nim",line:0};
  framePtr = F;
  F.line = 425;
  result_28960 = c_28959.getContext("webgl");
  if ((result_28960 === null)) {
  F.line = 426;
  result_28960 = c_28959.getContext("experimental-webgl");
  }
  
  if (!(!((result_28960 === null)))) {
  failedAssertImpl_21839(makeNimstrLit("not isNil(result) "));
  }
  
  framePtr = F.prev;
  return result_28960;
  }
  function resizeToDisplaySize_61309(c_61311, pixelratio_61312) {
  
  var Tmp1;
  var result_61313 = false;
  var F={procname:"utils.resizeToDisplaySize",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\utils.nim",line:0};
  framePtr = F;
  F.line = 107;
  var multiplier_61315 = nimMax(1.0000000000000000e+000, pixelratio_61312);
  F.line = 108;
  var width_61316 = mulInt(c_61311.clientWidth, (multiplier_61315|0));
  F.line = 109;
  var height_61317 = mulInt(c_61311.clientHeight, (multiplier_61315|0));
  if (!((c_61311.width == width_61316))) Tmp1 = true; else {Tmp1 = !((c_61311.height == height_61317)); }if (Tmp1) {
  F.line = 112;
  c_61311.width = width_61316;
  F.line = 113;
  c_61311.height = height_61317;
  F.line = 114;
  result_61313 = true;
  }
  
  F.line = 115;
  result_61313 = false;
  framePtr = F.prev;
  return result_61313;
  }
  function buffer_64023(gl_64025, kind_64026, drawmode_64028) {
  
  var Tmp1;
  var result_64029 = {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0};
  var F={procname:"buffer.buffer",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\buffer.nim",line:0};
  framePtr = F;
  F.line = 23;
  if ((kind_64026 == 34963)) {
  Tmp1 = {gl: gl_64025, glbuffer: gl_64025.createBuffer(), kind: kind_64026, datatype: 5123, drawmode: drawmode_64028};
  }
  else {
  Tmp1 = {gl: gl_64025, glbuffer: gl_64025.createBuffer(), kind: kind_64026, datatype: 5126, drawmode: drawmode_64028};
  }
  
  nimCopy(result_64029, Tmp1, NTI64017);
  framePtr = F.prev;
  return result_64029;
  }
  function getStatus_29029(gl_29031, what_29032) {
  
  var result_29033 = false;
  var F={procname:"webgl.getStatus",prev:framePtr,filename:"C:\\Users\\stisa\\.nimble\\pkgs\\webgl-#head\\webgl.nim",line:0};
  framePtr = F;
  F.line = 446;
  result_29033 = gl_29031.getShaderParameter(what_29032, gl_29031.COMPILE_STATUS);framePtr = F.prev;
  return result_29033;
  }
  function getStatus_29034(gl_29036, what_29037) {
  
  var result_29038 = false;
  var F={procname:"webgl.getStatus",prev:framePtr,filename:"C:\\Users\\stisa\\.nimble\\pkgs\\webgl-#head\\webgl.nim",line:0};
  framePtr = F;
  F.line = 448;
  result_29038 = gl_29036.getProgramParameter(what_29037, gl_29036.LINK_STATUS);framePtr = F.prev;
  return result_29038;
  }
  function isPowerOfTwo_31626(x_31628) {
  
  var Tmp1;
  var result_31629 = false;
  BeforeRet: do {
  if (!(0 < x_31628)) Tmp1 = false; else {Tmp1 = ((x_31628 & (x_31628 - 1)) == 0); }result_31629 = Tmp1;
  break BeforeRet;
  } while (false); 
  return result_31629;
  }
  function raiseRangeError() {
  
  var e_13876 = null;
  e_13876 = {m_type: NTI3458, parent: null, name: null, message: null, trace: null};
  e_13876.message = nimCopy(null, makeNimstrLit("value out of range"), NTI138);
  e_13876.parent = null;
  raiseException(e_13876, "RangeError");
  }
  function initTable_62272(initialSize_62277) {
  
  var result_62279 = {data: null, counter: 0};
  var F={procname:"initTable.initTable",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  if (!(isPowerOfTwo_31626(initialSize_62277))) {
  failedAssertImpl_21839(makeNimstrLit("isPowerOfTwo(initialSize) "));
  }
  
  F.line = 312;
  result_62279.counter = 0;
  result_62279.data = new Array(chckRange(initialSize_62277, 0, 2147483647)); for (var i=0;i<chckRange(initialSize_62277, 0, 2147483647);++i) {result_62279.data[i]={Field0: 0, Field1: null, Field2: {location: null, name: null, size: 0, datatype: 0, normalize: false, kind: 0, mat2: new Float64Array(4), mat3: new Float64Array(9), mat4: new Float64Array(16)}};}framePtr = F.prev;
  return result_62279;
  }
  function initTable_62413(initialSize_62418) {
  
  var result_62420 = {data: null, counter: 0};
  var F={procname:"initTable.initTable",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  if (!(isPowerOfTwo_31626(initialSize_62418))) {
  failedAssertImpl_21839(makeNimstrLit("isPowerOfTwo(initialSize) "));
  }
  
  F.line = 312;
  result_62420.counter = 0;
  result_62420.data = new Array(chckRange(initialSize_62418, 0, 2147483647)); for (var i=0;i<chckRange(initialSize_62418, 0, 2147483647);++i) {result_62420.data[i]={Field0: 0, Field1: null, Field2: {name: null, location: 0, kind: 0, size: 0, datatype: 0, normalize: false}};}framePtr = F.prev;
  return result_62420;
  }
  function raiseIndexError() {
  
  var e_13894 = null;
  e_13894 = {m_type: NTI3454, parent: null, name: null, message: null, trace: null};
  e_13894.message = nimCopy(null, makeNimstrLit("index out of bounds"), NTI138);
  e_13894.parent = null;
  raiseException(e_13894, "IndexError");
  }
  function nsuSplitWhitespace(s_47653) {
  
  var result_47655 = null;
  result_47655 = nimCopy(null, [], NTI47672);
  L1: do {
  var x_47674 = null;
  var last_47690 = 0;
  var splits_47692 = -1;
  L2: do {
  L3: while (true) {
  if (!(last_47690 < (s_47653 != null ? s_47653.length-1 : 0))) break L3;
  L4: do {
  L5: while (true) {
  if (!(SetConstr(32, 9, 11, 13, 10, 12)[s_47653[last_47690]] != undefined)) break L5;
  last_47690 += 1;
  }
  } while(false);
  var first_47694 = last_47690;
  L6: do {
  L7: while (true) {
  if (!((last_47690 < (s_47653 != null ? s_47653.length-1 : 0)) && !((SetConstr(32, 9, 11, 13, 10, 12)[s_47653[last_47690]] != undefined)))) break L7;
  last_47690 += 1;
  }
  } while(false);
  if ((first_47694 <= (last_47690 - 1))) {
  if ((splits_47692 == 0)) {
  last_47690 = (s_47653 != null ? s_47653.length-1 : 0);
  }
  
  x_47674 = (s_47653.slice(first_47694, ((last_47690 - 1))+1).concat(0));
  if (result_47655 != null) { result_47655.push(x_47674); } else { result_47655 = [x_47674]; };
  if ((splits_47692 == 0)) {
  break L2;
  }
  
  splits_47692 -= 1;
  }
  
  }
  } while(false);
  } while(false);
  return result_47655;
  }
  function nsuStrip(s_47129, leading_47130, trailing_47131, chars_47133) {
  
  var Tmp5;
  var result_47134 = null;
  var first_47135 = 0;
  var last_47136 = ((s_47129 != null ? s_47129.length-1 : 0) - 1);
  if (leading_47130) {
  L1: do {
  L2: while (true) {
  if (!(chars_47133[s_47129[first_47135]] != undefined)) break L2;
  first_47135 += 1;
  }
  } while(false);
  }
  
  if (trailing_47131) {
  L3: do {
  L4: while (true) {
  if (!(0 <= last_47136)) Tmp5 = false; else {Tmp5 = (chars_47133[s_47129[last_47136]] != undefined); }if (!Tmp5) break L4;
  last_47136 -= 1;
  }
  } while(false);
  }
  
  result_47134 = nimCopy(null, (s_47129.slice(first_47135, (last_47136)+1).concat(0)), NTI138);
  return result_47134;
  }
  function mustRehash_57469(length_57471, counter_57472) {
  
  var result_57473 = false;
  var F={procname:"tables.mustRehash",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  if (!((counter_57472 < length_57471))) {
  failedAssertImpl_21839(makeNimstrLit("\x0D\x0A  counter < length "));
  }
  
  F.line = 25;
  result_57473 = ((mulInt(length_57471, 2) < mulInt(counter_57472, 3)) || (subInt(length_57471, counter_57472) < 4));
  framePtr = F.prev;
  return result_57473;
  }
  function isFilled_57464(hcode_57466) {
  
  var result_57467 = false;
  var F={procname:"tables.isFilled",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  F.line = 18;
  result_57467 = !((hcode_57466 == 0));
  framePtr = F.prev;
  return result_57467;
  }
  function nextTry_57601(h_57603, maxHash_57604) {
  
  var result_57605 = 0;
  var F={procname:"tables.nextTry",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  F.line = 28;
  result_57605 = (addInt(h_57603, 1) & maxHash_57604);
  framePtr = F.prev;
  return result_57605;
  }
  function rawInsert_62708(t_62715, data_62719, data_62719_Idx, key_62721, val_62723, hc_62725, h_62727) {
  
  var F={procname:"rawInsert.rawInsert",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  F.line = 64;
  data_62719[data_62719_Idx][chckIndx(h_62727, 0, data_62719[data_62719_Idx].length)-0].Field1 = nimCopy(null, key_62721, NTI138);
  F.line = 65;
  nimCopy(data_62719[data_62719_Idx][chckIndx(h_62727, 0, data_62719[data_62719_Idx].length)-0].Field2, val_62723, NTI62025);
  F.line = 79;
  data_62719[data_62719_Idx][chckIndx(h_62727, 0, data_62719[data_62719_Idx].length)-0].Field0 = hc_62725;
  framePtr = F.prev;
  }
  function enlarge_62654(t_62661) {
  
  var F={procname:"enlarge.enlarge",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  F.line = 273;
  var n_62665 = null;
  n_62665 = new Array(chckRange(mulInt((t_62661.data != null ? t_62661.data.length : 0), 2), 0, 2147483647)); for (var i=0;i<chckRange(mulInt((t_62661.data != null ? t_62661.data.length : 0), 2), 0, 2147483647);++i) {n_62665[i]={Field0: 0, Field1: null, Field2: {name: null, location: 0, kind: 0, size: 0, datatype: 0, normalize: false}};}var Tmp1 = t_62661.data; t_62661.data = n_62665; n_62665 = Tmp1;L2: do {
  F.line = 276;
  var i_62704 = 0;
  F.line = 1952;
  var colontmp__62733 = 0;
  F.line = 276;
  colontmp__62733 = (n_62665 != null ? (n_62665.length-1) : -1);
  F.line = 1942;
  var res_62736 = 0;
  L3: do {
  F.line = 1943;
  L4: while (true) {
  if (!(res_62736 <= colontmp__62733)) break L4;
  F.line = 1944;
  i_62704 = res_62736;
  F.line = 277;
  var eh_62705 = n_62665[chckIndx(i_62704, 0, n_62665.length)-0].Field0;
  if (isFilled_57464(eh_62705)) {
  F.line = 279;
  var j_62706 = (eh_62705 & (t_62661.data != null ? (t_62661.data.length-1) : -1));
  L5: do {
  F.line = 280;
  L6: while (true) {
  if (!isFilled_57464(t_62661.data[chckIndx(j_62706, 0, t_62661.data.length)-0].Field0)) break L6;
  F.line = 281;
  j_62706 = nextTry_57601(j_62706, (t_62661.data != null ? (t_62661.data.length-1) : -1));
  }
  } while(false);
  rawInsert_62708(t_62661, t_62661, "data", n_62665[chckIndx(i_62704, 0, n_62665.length)-0].Field1, n_62665[chckIndx(i_62704, 0, n_62665.length)-0].Field2, eh_62705, j_62706);
  }
  
  res_62736 = addInt(res_62736, 1);
  }
  } while(false);
  } while(false);
  framePtr = F.prev;
  }
  function emarkamp__54007(h_54009, val_54010) {
  
  var result_54011 = 0;
  var F={procname:"hashes.!&",prev:framePtr,filename:"lib\\pure\\hashes.nim",line:0};
  framePtr = F;
  F.line = 53;
  result_54011 = ((h_54009 + val_54010) >>> 0);
  F.line = 54;
  result_54011 = ((result_54011 + (result_54011 << 10)) >>> 0);
  F.line = 55;
  result_54011 = (result_54011 ^ ((result_54011 >>> 0) >>> 6));
  framePtr = F.prev;
  return result_54011;
  }
  function emarkdollar__54044(h_54046) {
  
  var result_54047 = 0;
  var F={procname:"hashes.!$",prev:framePtr,filename:"lib\\pure\\hashes.nim",line:0};
  framePtr = F;
  F.line = 60;
  result_54047 = ((h_54046 + (h_54046 << 3)) >>> 0);
  F.line = 61;
  result_54047 = (result_54047 ^ ((result_54047 >>> 0) >>> 11));
  F.line = 62;
  result_54047 = ((result_54047 + (result_54047 << 15)) >>> 0);
  framePtr = F.prev;
  return result_54047;
  }
  function hash_54836(x_54838) {
  
  var result_54839 = 0;
  var F={procname:"hashes.hash",prev:framePtr,filename:"lib\\pure\\hashes.nim",line:0};
  framePtr = F;
  F.line = 133;
  var h_54840 = 0;
  L1: do {
  F.line = 134;
  var i_54850 = 0;
  F.line = 1960;
  var colontmp__54860 = 0;
  F.line = 134;
  colontmp__54860 = subInt((x_54838 != null ? x_54838.length-1 : 0), 1);
  F.line = 1942;
  var res_54863 = 0;
  L2: do {
  F.line = 1943;
  L3: while (true) {
  if (!(res_54863 <= colontmp__54860)) break L3;
  F.line = 1944;
  i_54850 = res_54863;
  F.line = 135;
  h_54840 = emarkamp__54007(h_54840, x_54838[chckIndx(i_54850, 0, x_54838.length)-0]);
  res_54863 = addInt(res_54863, 1);
  }
  } while(false);
  } while(false);
  F.line = 136;
  result_54839 = emarkdollar__54044(h_54840);
  framePtr = F.prev;
  return result_54839;
  }
  function rawGetDeep_62742(t_62747, key_62749, hc_62751, hc_62751_Idx) {
  
  var result_62752 = 0;
  var F={procname:"rawGetDeep.rawGetDeep",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  F.line = 43;
  hc_62751[hc_62751_Idx] = hash_54836(key_62749);
  if ((hc_62751[hc_62751_Idx] == 0)) {
  F.line = 45;
  hc_62751[hc_62751_Idx] = 314159265;
  }
  
  F.line = 58;
  var h_62756 = (hc_62751[hc_62751_Idx] & (t_62747.data != null ? (t_62747.data.length-1) : -1));
  L1: do {
  F.line = 59;
  L2: while (true) {
  if (!isFilled_57464(t_62747.data[chckIndx(h_62756, 0, t_62747.data.length)-0].Field0)) break L2;
  F.line = 60;
  h_62756 = nextTry_57601(h_62756, (t_62747.data != null ? (t_62747.data.length-1) : -1));
  }
  } while(false);
  F.line = 72;
  result_62752 = h_62756;
  framePtr = F.prev;
  return result_62752;
  }
  function add_62634(t_62641, key_62643, val_62645) {
  
  var F={procname:"add.add",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  if (mustRehash_57469((t_62641.data != null ? t_62641.data.length : 0), t_62641.counter)) {
  enlarge_62654(t_62641);
  }
  
  F.line = 83;
  var hc_62740 = [0];
  F.line = 84;
  var j_62760 = rawGetDeep_62742(t_62641, key_62643, hc_62740, 0);
  rawInsert_62708(t_62641, t_62641, "data", key_62643, val_62645, hc_62740[0], j_62760);
  t_62641.counter = addInt(t_62641.counter, 1);
  framePtr = F.prev;
  }
  function attribute_62052(name_62054, kind_62055) {
  
  var Tmp1;
  var Tmp2;
  var result_62056 = {name: null, location: 0, kind: 0, size: 0, datatype: 0, normalize: false};
  var F={procname:"shader.attribute",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\shader.nim",line:0};
  framePtr = F;
  F.line = 67;
  F.line = 67;
  switch (toJSStr(kind_62055)) {
  case "float": Tmp1 = 1;
  
  break;
  case "vec2": Tmp1 = 2;
  
  break;
  case "vec3": Tmp1 = 3;
  
  break;
  case "vec4": Tmp1 = 4;
  
  break;
  case "mat2": Tmp1 = 44;
  
  break;
  case "mat3": Tmp1 = 9;
  
  break;
  case "mat4": Tmp1 = 16;
  
  break;
  default: 
  Tmp1 = 0;
  break;
  }
  var k_62114 = Tmp1;
  F.line = 76;
  var colontmp__66022 = {Field0: 0, Field1: 0, Field2: false};
  F.line = 76;
  var sz_62130 = 0;
  F.line = 76;
  var dt_62131 = 0;
  F.line = 76;
  var nrm_62132 = false;
  F.line = 76;
  F.line = 76;
  switch (k_62114) {
  case 1: Tmp2 = {Field0: 1, Field1: 5126, Field2: false};
  
  break;
  case 2: Tmp2 = {Field0: 2, Field1: 5126, Field2: false};
  
  break;
  case 3: Tmp2 = {Field0: 3, Field1: 5126, Field2: false};
  
  break;
  case 4: Tmp2 = {Field0: 4, Field1: 5126, Field2: false};
  
  break;
  case 44: Tmp2 = {Field0: 4, Field1: 5126, Field2: false};
  
  break;
  case 9: Tmp2 = {Field0: 9, Field1: 5126, Field2: false};
  
  break;
  case 16: Tmp2 = {Field0: 16, Field1: 5126, Field2: false};
  
  break;
  default: 
  Tmp2 = {Field0: 0, Field1: 5122, Field2: false};
  break;
  }
  nimCopy(colontmp__66022, Tmp2, NTI62116);
  F.line = 76;
  sz_62130 = colontmp__66022["Field0"];
  F.line = 76;
  dt_62131 = colontmp__66022["Field1"];
  F.line = 76;
  nrm_62132 = colontmp__66022["Field2"];
  F.line = 85;
  nimCopy(result_62056, {name: name_62054, kind: k_62114, datatype: dt_62131, size: sz_62130, normalize: nrm_62132, location: 0}, NTI62025);
  framePtr = F.prev;
  return result_62056;
  }
  function rawInsert_62869(t_62876, data_62880, data_62880_Idx, key_62882, val_62884, hc_62886, h_62888) {
  
  var F={procname:"rawInsert.rawInsert",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  F.line = 64;
  data_62880[data_62880_Idx][chckIndx(h_62888, 0, data_62880[data_62880_Idx].length)-0].Field1 = nimCopy(null, key_62882, NTI138);
  F.line = 65;
  nimCopy(data_62880[data_62880_Idx][chckIndx(h_62888, 0, data_62880[data_62880_Idx].length)-0].Field2, val_62884, NTI62033);
  F.line = 79;
  data_62880[data_62880_Idx][chckIndx(h_62888, 0, data_62880[data_62880_Idx].length)-0].Field0 = hc_62886;
  framePtr = F.prev;
  }
  function enlarge_62815(t_62822) {
  
  var F={procname:"enlarge.enlarge",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  F.line = 273;
  var n_62826 = null;
  n_62826 = new Array(chckRange(mulInt((t_62822.data != null ? t_62822.data.length : 0), 2), 0, 2147483647)); for (var i=0;i<chckRange(mulInt((t_62822.data != null ? t_62822.data.length : 0), 2), 0, 2147483647);++i) {n_62826[i]={Field0: 0, Field1: null, Field2: {location: null, name: null, size: 0, datatype: 0, normalize: false, kind: 0, mat2: new Float64Array(4), mat3: new Float64Array(9), mat4: new Float64Array(16)}};}var Tmp1 = t_62822.data; t_62822.data = n_62826; n_62826 = Tmp1;L2: do {
  F.line = 276;
  var i_62865 = 0;
  F.line = 1952;
  var colontmp__62894 = 0;
  F.line = 276;
  colontmp__62894 = (n_62826 != null ? (n_62826.length-1) : -1);
  F.line = 1942;
  var res_62897 = 0;
  L3: do {
  F.line = 1943;
  L4: while (true) {
  if (!(res_62897 <= colontmp__62894)) break L4;
  F.line = 1944;
  i_62865 = res_62897;
  F.line = 277;
  var eh_62866 = n_62826[chckIndx(i_62865, 0, n_62826.length)-0].Field0;
  if (isFilled_57464(eh_62866)) {
  F.line = 279;
  var j_62867 = (eh_62866 & (t_62822.data != null ? (t_62822.data.length-1) : -1));
  L5: do {
  F.line = 280;
  L6: while (true) {
  if (!isFilled_57464(t_62822.data[chckIndx(j_62867, 0, t_62822.data.length)-0].Field0)) break L6;
  F.line = 281;
  j_62867 = nextTry_57601(j_62867, (t_62822.data != null ? (t_62822.data.length-1) : -1));
  }
  } while(false);
  rawInsert_62869(t_62822, t_62822, "data", n_62826[chckIndx(i_62865, 0, n_62826.length)-0].Field1, n_62826[chckIndx(i_62865, 0, n_62826.length)-0].Field2, eh_62866, j_62867);
  }
  
  res_62897 = addInt(res_62897, 1);
  }
  } while(false);
  } while(false);
  framePtr = F.prev;
  }
  function rawGetDeep_62903(t_62908, key_62910, hc_62912, hc_62912_Idx) {
  
  var result_62913 = 0;
  var F={procname:"rawGetDeep.rawGetDeep",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  F.line = 43;
  hc_62912[hc_62912_Idx] = hash_54836(key_62910);
  if ((hc_62912[hc_62912_Idx] == 0)) {
  F.line = 45;
  hc_62912[hc_62912_Idx] = 314159265;
  }
  
  F.line = 58;
  var h_62917 = (hc_62912[hc_62912_Idx] & (t_62908.data != null ? (t_62908.data.length-1) : -1));
  L1: do {
  F.line = 59;
  L2: while (true) {
  if (!isFilled_57464(t_62908.data[chckIndx(h_62917, 0, t_62908.data.length)-0].Field0)) break L2;
  F.line = 60;
  h_62917 = nextTry_57601(h_62917, (t_62908.data != null ? (t_62908.data.length-1) : -1));
  }
  } while(false);
  F.line = 72;
  result_62913 = h_62917;
  framePtr = F.prev;
  return result_62913;
  }
  function add_62795(t_62802, key_62804, val_62806) {
  
  var F={procname:"add.add",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  if (mustRehash_57469((t_62802.data != null ? t_62802.data.length : 0), t_62802.counter)) {
  enlarge_62815(t_62802);
  }
  
  F.line = 83;
  var hc_62901 = [0];
  F.line = 84;
  var j_62921 = rawGetDeep_62903(t_62802, key_62804, hc_62901, 0);
  rawInsert_62869(t_62802, t_62802, "data", key_62804, val_62806, hc_62901[0], j_62921);
  t_62802.counter = addInt(t_62802.counter, 1);
  framePtr = F.prev;
  }
  function uniform_62134(name_62136, kind_62137) {
  
  var Tmp1;
  var Tmp2;
  var result_62138 = {location: null, name: null, size: 0, datatype: 0, normalize: false, kind: 0, mat2: new Float64Array(4), mat3: new Float64Array(9), mat4: new Float64Array(16)};
  var F={procname:"shader.uniform",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\shader.nim",line:0};
  framePtr = F;
  F.line = 88;
  F.line = 88;
  switch (toJSStr(kind_62137)) {
  case "float": Tmp1 = 1;
  
  break;
  case "vec2": Tmp1 = 2;
  
  break;
  case "vec3": Tmp1 = 3;
  
  break;
  case "vec4": Tmp1 = 4;
  
  break;
  case "mat2": Tmp1 = 44;
  
  break;
  case "mat3": Tmp1 = 9;
  
  break;
  case "mat4": Tmp1 = 16;
  
  break;
  default: 
  Tmp1 = 0;
  break;
  }
  var k_62196 = Tmp1;
  F.line = 97;
  var colontmp__66023 = {Field0: 0, Field1: 0, Field2: false};
  F.line = 97;
  var sz_62212 = 0;
  F.line = 97;
  var dt_62213 = 0;
  F.line = 97;
  var nrm_62214 = false;
  F.line = 97;
  F.line = 97;
  switch (k_62196) {
  case 1: Tmp2 = {Field0: 1, Field1: 5126, Field2: false};
  
  break;
  case 2: Tmp2 = {Field0: 2, Field1: 5126, Field2: false};
  
  break;
  case 3: Tmp2 = {Field0: 3, Field1: 5126, Field2: false};
  
  break;
  case 4: Tmp2 = {Field0: 4, Field1: 5126, Field2: false};
  
  break;
  case 44: Tmp2 = {Field0: 4, Field1: 5126, Field2: false};
  
  break;
  case 9: Tmp2 = {Field0: 9, Field1: 5126, Field2: false};
  
  break;
  case 16: Tmp2 = {Field0: 16, Field1: 5126, Field2: false};
  
  break;
  default: 
  Tmp2 = {Field0: 0, Field1: 5122, Field2: false};
  break;
  }
  nimCopy(colontmp__66023, Tmp2, NTI62198);
  F.line = 97;
  sz_62212 = colontmp__66023["Field0"];
  F.line = 97;
  dt_62213 = colontmp__66023["Field1"];
  F.line = 97;
  nrm_62214 = colontmp__66023["Field2"];
  F.line = 107;
  nimCopy(result_62138, {name: name_62136, kind: k_62196, datatype: dt_62213, size: sz_62212, normalize: nrm_62214, location: null, mat2: new Float64Array(4), mat3: new Float64Array(9), mat4: new Float64Array(16)}, NTI62033);
  framePtr = F.prev;
  return result_62138;
  }
  function extractAttrsAndUnifs_62216(vs_62218, fs_62219) {
  
  var result_62269 = {Field0: {data: null, counter: 0}, Field1: {data: null, counter: 0}};
  var F={procname:"shader.extractAttrsAndUnifs",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\shader.nim",line:0};
  framePtr = F;
  F.line = 158;
  nimCopy(result_62269, {Field0: initTable_62272(16), Field1: initTable_62413(16)}, NTI62220);
  L1: do {
  F.line = 161;
  var line_62612 = null;
  F.line = 749;
  var first_63008 = 0;
  F.line = 750;
  var last_63010 = 0;
  L2: do {
  F.line = 751;
  L3: while (true) {
  if (!true) break L3;
  L4: do {
  F.line = 752;
  L5: while (true) {
  if (!!((SetConstr(0, 13, 10)[vs_62218[chckIndx(last_63010, 0, vs_62218.length)-0]] != undefined))) break L5;
  last_63010 = addInt(last_63010, 1);
  }
  } while(false);
  F.line = 753;
  line_62612 = (vs_62218.slice(first_63008, (subInt(last_63010, 1))+1).concat(0));
  F.line = 162;
  var splitted_62625 = nsuSplitWhitespace(nsuStrip(line_62612, true, true, SetConstr([9, 13], 32, [58, 59])));
  if (((splitted_62625 != null ? splitted_62625.length : 0) == 3)) {
  F.line = 164;
  switch (toJSStr(nsuStrip(splitted_62625[0], true, true, SetConstr(32, 9, 11, 13, 10, 12)))) {
  case "attribute": add_62634(result_62269.Field1, splitted_62625[2], attribute_62052(splitted_62625[2], splitted_62625[1]));
  
  break;
  case "uniform": add_62795(result_62269.Field0, splitted_62625[2], uniform_62134(splitted_62625[2], splitted_62625[1]));
  
  break;
  default: 
  break;
  }
  }
  else {
  }
  
  if ((vs_62218[chckIndx(last_63010, 0, vs_62218.length)-0] == 10)) {
  last_63010 = addInt(last_63010, 1);
  }
  else {
  if ((vs_62218[chckIndx(last_63010, 0, vs_62218.length)-0] == 13)) {
  last_63010 = addInt(last_63010, 1);
  if ((vs_62218[chckIndx(last_63010, 0, vs_62218.length)-0] == 10)) {
  last_63010 = addInt(last_63010, 1);
  }
  
  }
  else {
  F.line = 759;
  break L2;
  }
  }
  F.line = 760;
  first_63008 = last_63010;
  }
  } while(false);
  } while(false);
  L6: do {
  F.line = 173;
  var line_62955 = null;
  F.line = 749;
  var first_63015 = 0;
  F.line = 750;
  var last_63017 = 0;
  L7: do {
  F.line = 751;
  L8: while (true) {
  if (!true) break L8;
  L9: do {
  F.line = 752;
  L10: while (true) {
  if (!!((SetConstr(0, 13, 10)[fs_62219[chckIndx(last_63017, 0, fs_62219.length)-0]] != undefined))) break L10;
  last_63017 = addInt(last_63017, 1);
  }
  } while(false);
  F.line = 753;
  line_62955 = (fs_62219.slice(first_63015, (subInt(last_63017, 1))+1).concat(0));
  F.line = 174;
  var splitted_62968 = nsuSplitWhitespace(nsuStrip(line_62955, true, true, SetConstr([9, 13], 32, [58, 59])));
  if (((splitted_62968 != null ? splitted_62968.length : 0) == 3)) {
  F.line = 177;
  switch (toJSStr(nsuStrip(splitted_62968[0], true, true, SetConstr(32, 9, 11, 13, 10, 12)))) {
  case "attribute": add_62634(result_62269.Field1, splitted_62968[2], attribute_62052(splitted_62968[2], splitted_62968[1]));
  
  break;
  case "uniform": add_62795(result_62269.Field0, splitted_62968[2], uniform_62134(splitted_62968[2], splitted_62968[1]));
  
  break;
  default: 
  break;
  }
  }
  else {
  }
  
  if ((fs_62219[chckIndx(last_63017, 0, fs_62219.length)-0] == 10)) {
  last_63017 = addInt(last_63017, 1);
  }
  else {
  if ((fs_62219[chckIndx(last_63017, 0, fs_62219.length)-0] == 13)) {
  last_63017 = addInt(last_63017, 1);
  if ((fs_62219[chckIndx(last_63017, 0, fs_62219.length)-0] == 10)) {
  last_63017 = addInt(last_63017, 1);
  }
  
  }
  else {
  F.line = 759;
  break L7;
  }
  }
  F.line = 760;
  first_63015 = last_63017;
  }
  } while(false);
  } while(false);
  framePtr = F.prev;
  return result_62269;
  }
  function shader_63051(gl_63053, vssrc_63054, fssrc_63055, usethis_63056) {
  
  var result_63057 = {glprogram: null, uniforms: {data: null, counter: 0}, attributes: {data: null, counter: 0}};
  var F={procname:"shader.shader",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\shader.nim",line:0};
  framePtr = F;
  F.line = 199;
  var vs_63066 = gl_63053.createShader(35633);
  gl_63053.shaderSource(vs_63066, toJSStr(vssrc_63054));
  gl_63053.compileShader(vs_63066);
  if (!(getStatus_29029(gl_63053, vs_63066))) {
  rawEcho(makeNimstrLit("error vertex shader"));
  }
  
  F.line = 204;
  var fs_63078 = gl_63053.createShader(35632);
  gl_63053.shaderSource(fs_63078, toJSStr(fssrc_63055));
  gl_63053.compileShader(fs_63078);
  if (!(getStatus_29029(gl_63053, fs_63078))) {
  rawEcho(makeNimstrLit("error fragment shader"));
  }
  
  F.line = 209;
  var prog_63082 = gl_63053.createProgram();
  gl_63053.attachShader(prog_63082, vs_63066);
  gl_63053.attachShader(prog_63082, fs_63078);
  gl_63053.linkProgram(prog_63082);
  if (!(getStatus_29034(gl_63053, prog_63082))) {
  rawEcho(makeNimstrLit("error linking program"));
  }
  
  F.line = 215;
  var ua_63086 = extractAttrsAndUnifs_62216(vssrc_63054, fssrc_63055);
  F.line = 216;
  nimCopy(result_63057.uniforms, ua_63086.Field0, NTI62226);
  F.line = 217;
  nimCopy(result_63057.attributes, ua_63086.Field1, NTI62250);
  F.line = 218;
  result_63057.glprogram = prog_63082;
  gl_63053.deleteShader(vs_63066);
  gl_63053.deleteShader(fs_63078);
  L1: do {
  F.line = 224;
  var a_63117 = null;
  L2: do {
  F.line = 265;
  var h_63237 = 0;
  F.line = 1960;
  var colontmp__63239 = 0;
  F.line = 265;
  colontmp__63239 = (result_63057.attributes.data != null ? (result_63057.attributes.data.length-1) : -1);
  F.line = 1942;
  var res_63241 = 0;
  L3: do {
  F.line = 1943;
  L4: while (true) {
  if (!(res_63241 <= colontmp__63239)) break L4;
  F.line = 1944;
  h_63237 = res_63241;
  if (isFilled_57464(result_63057.attributes.data[chckIndx(h_63237, 0, result_63057.attributes.data.length)-0].Field0)) {
  F.line = 266;
  a_63117 = result_63057.attributes.data[chckIndx(h_63237, 0, result_63057.attributes.data.length)-0].Field2;
  F.line = 225;
  a_63117.location = gl_63053.getAttribLocation(result_63057.glprogram, toJSStr(a_63117.name));
  if (!(!(((a_63117.location|0) == -1)))) {
  failedAssertImpl_21839((makeNimstrLit("\x0D\x0A  not (int(a.location) == -1) Problems with attribute: ").slice(0,-1)).concat(a_63117.name.slice(0,-1),makeNimstrLit(", misspelled?")));
  }
  
  }
  
  res_63241 = addInt(res_63241, 1);
  }
  } while(false);
  } while(false);
  } while(false);
  L5: do {
  F.line = 227;
  var u_63231 = null;
  L6: do {
  F.line = 265;
  var h_63248 = 0;
  F.line = 1960;
  var colontmp__63250 = 0;
  F.line = 265;
  colontmp__63250 = (result_63057.uniforms.data != null ? (result_63057.uniforms.data.length-1) : -1);
  F.line = 1942;
  var res_63252 = 0;
  L7: do {
  F.line = 1943;
  L8: while (true) {
  if (!(res_63252 <= colontmp__63250)) break L8;
  F.line = 1944;
  h_63248 = res_63252;
  if (isFilled_57464(result_63057.uniforms.data[chckIndx(h_63248, 0, result_63057.uniforms.data.length)-0].Field0)) {
  F.line = 266;
  u_63231 = result_63057.uniforms.data[chckIndx(h_63248, 0, result_63057.uniforms.data.length)-0].Field2;
  F.line = 228;
  u_63231.location = gl_63053.getUniformLocation(result_63057.glprogram, toJSStr(u_63231.name));
  }
  
  res_63252 = addInt(res_63252, 1);
  }
  } while(false);
  } while(false);
  } while(false);
  gl_63053.useProgram(result_63057.glprogram);
  framePtr = F.prev;
  return result_63057;
  }
  function bindBuffers_64050(bs_64053) {
  
  var F={procname:"buffer.bindBuffers",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\buffer.nim",line:0};
  framePtr = F;
  L1: do {
  F.line = 41;
  var b_64078 = {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0};
  F.line = 2033;
  var i_64093 = 0;
  L2: do {
  F.line = 2034;
  L3: while (true) {
  if (!(i_64093 < (bs_64053 != null ? bs_64053.length : 0))) break L3;
  F.line = 2035;
  b_64078 = bs_64053[chckIndx(i_64093, 0, bs_64053.length)-0];
  b_64078.gl.bindBuffer(b_64078.kind, b_64078.glbuffer);
  i_64093 = addInt(i_64093, 1);
  }
  } while(false);
  } while(false);
  framePtr = F.prev;
  }
  function state_65011(gl_65013, vs_65014, fs_65015) {
  
  var result_65016 = {gl: null, vb: {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0}, ib: {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0}, cb: {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0}, shader: {glprogram: null, uniforms: {data: null, counter: 0}, attributes: {data: null, counter: 0}}, il: 0, vl: 0, cl: 0};
  var F={procname:"state.state",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  F.line = 17;
  F.line = 17;
  var vb_65018 = buffer_64023(gl_65013, 34962, 35044);
  F.line = 18;
  var ib_65020 = buffer_64023(gl_65013, 34963, 35044);
  F.line = 19;
  var cb_65022 = buffer_64023(gl_65013, 34962, 35044);
  F.line = 20;
  var shd_65023 = shader_63051(gl_65013, vs_65014, fs_65015, true);
  gl_65013.clearColor(0.0, 0.0, 0.0, 0.0);
  gl_65013.enable(2929);
  gl_65013.clear(16640);
  resizeToDisplaySize_61309(gl_65013.canvas, window.devicePixelRatio);
  gl_65013.viewport(0, 0, gl_65013.drawingBufferWidth, gl_65013.drawingBufferHeight);
  bindBuffers_64050([vb_65018, ib_65020]);
  nimCopy(result_65016, {gl: gl_65013, vb: vb_65018, ib: ib_65020, cb: cb_65022, shader: shd_65023, il: 0, vl: 0, cl: 0}, NTI65002);
  framePtr = F.prev;
  return result_65016;
  }
  function initState_65053(canvasId_65055, vs_65056, fs_65057) {
  
  var result_65058 = {gl: null, vb: {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0}, ib: {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0}, cb: {gl: null, glbuffer: null, kind: 0, datatype: 0, drawmode: 0}, shader: {glprogram: null, uniforms: {data: null, counter: 0}, attributes: {data: null, counter: 0}}, il: 0, vl: 0, cl: 0};
  var F={procname:"state.initState",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  F.line = 34;
  var canvas_65059 = document.getElementById("sgl-canvas");
  F.line = 35;
  var gl_65060 = getContextWebgl_28957(canvas_65059);
  resizeToDisplaySize_61309(canvas_65059, window.devicePixelRatio);
  F.line = 37;
  nimCopy(result_65058, state_65011(gl_65060, vs_65056, fs_65057), NTI65002);
  framePtr = F.prev;
  return result_65058;
  }
  var sgl_66021 = /**/[initState_65053(makeNimstrLit("sgl-canvas"), vertcode_66002, fragCode_66001)];
  function upload_66041(b_66045, data_66048) {
  
  var F={procname:"upload.upload",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\buffer.nim",line:0};
  framePtr = F;
  b_66045.gl.bindBuffer(b_66045.kind, b_66045.glbuffer);
  b_66045.gl.bufferData(b_66045.kind, new Float32Array(data_66048), b_66045.drawmode);
  framePtr = F.prev;
  }
  function upload_66077(b_66081, data_66084) {
  
  var F={procname:"upload.upload",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\buffer.nim",line:0};
  framePtr = F;
  b_66081.gl.bindBuffer(b_66081.kind, b_66081.glbuffer);
  b_66081.gl.bufferData(b_66081.kind, new Uint16Array(data_66084), b_66081.drawmode);
  framePtr = F.prev;
  }
  function upload_66028(s_66033, vertices_66036, indices_66039) {
  
  var F={procname:"upload.upload",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  upload_66041(s_66033.vb, vertices_66036);
  upload_66077(s_66033.ib, indices_66039);
  bindBuffers_64050([s_66033.vb, s_66033.ib]);
  F.line = 47;
  s_66033.il = chckRange((indices_66039 != null ? indices_66039.length : 0), 0, 2147483647);
  F.line = 48;
  s_66033.vl = chckRange((vertices_66036 != null ? vertices_66036.length : 0), 0, 2147483647);
  framePtr = F.prev;
  }
  upload_66028(sgl_66021[0], positions_66017, indices_66020);
  function rawGet_63433(t_63438, key_63440, hc_63442, hc_63442_Idx) {
  
  var Tmp3;
  var result_63443 = 0;
  var F={procname:"rawGet.rawGet",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  BeforeRet: do {
  F.line = 43;
  hc_63442[hc_63442_Idx] = hash_54836(key_63440);
  if ((hc_63442[hc_63442_Idx] == 0)) {
  F.line = 45;
  hc_63442[hc_63442_Idx] = 314159265;
  }
  
  F.line = 31;
  var h_63447 = (hc_63442[hc_63442_Idx] & (t_63438.data != null ? (t_63438.data.length-1) : -1));
  L1: do {
  F.line = 32;
  L2: while (true) {
  if (!isFilled_57464(t_63438.data[chckIndx(h_63447, 0, t_63438.data.length)-0].Field0)) break L2;
  if (!(t_63438.data[chckIndx(h_63447, 0, t_63438.data.length)-0].Field0 == hc_63442[hc_63442_Idx])) Tmp3 = false; else {Tmp3 = eqStrings(t_63438.data[chckIndx(h_63447, 0, t_63438.data.length)-0].Field1, key_63440); }if (Tmp3) {
  F.line = 38;
  result_63443 = h_63447;
  break BeforeRet;
  }
  
  F.line = 39;
  h_63447 = nextTry_57601(h_63447, (t_63438.data != null ? (t_63438.data.length-1) : -1));
  }
  } while(false);
  F.line = 75;
  result_63443 = subInt(-1, h_63447);
  } while (false); 
  framePtr = F.prev;
  return result_63443;
  }
  function X5BX5D__63420(t_63426, key_63428) {
  
  var result_63429 = {name: null, location: 0, kind: 0, size: 0, datatype: 0, normalize: false};
  var F={procname:"[].[]",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  F.line = 146;
  var hc_63431 = [0];
  F.line = 147;
  var index_63452 = rawGet_63433(t_63426, key_63428, hc_63431, 0);
  if ((0 <= index_63452)) {
  F.line = 148;
  nimCopy(result_63429, t_63426.data[chckIndx(index_63452, 0, t_63426.data.length)-0].Field2, NTI62025);
  }
  else {
  F.line = 151;
  F.line = 2614;
  var e_63607 = null;
  e_63607 = {m_type: NTI3450, parent: null, name: null, message: null, trace: null};
  F.line = 2616;
  e_63607.message = nimCopy(null, (makeNimstrLit("key not found: ").slice(0,-1)).concat(key_63428), NTI138);
  F.line = 2617;
  e_63607.parent = null;
  raiseException(e_63607, "KeyError");
  }
  
  framePtr = F.prev;
  return result_63429;
  }
  function point_63018(gl_63020, a_63021) {
  
  var F={procname:"shader.point",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\shader.nim",line:0};
  framePtr = F;
  gl_63020.vertexAttribPointer(a_63021.location, a_63021.size, a_63021.datatype, a_63021.normalize, 0, 0);
  gl_63020.enableVertexAttribArray(a_63021.location);
  framePtr = F.prev;
  }
  function point_65112(s_65114, name_65115) {
  
  var F={procname:"state.point",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  F.line = 68;
  var coord_65126 = X5BX5D__63420(s_65114.shader.attributes, name_65115);
  point_63018(s_65114.gl, coord_65126);
  framePtr = F.prev;
  }
  point_65112(sgl_66021[0], makeNimstrLit("coordinates"));
  function rawGet_63276(t_63281, key_63283, hc_63285, hc_63285_Idx) {
  
  var Tmp3;
  var result_63286 = 0;
  var F={procname:"rawGet.rawGet",prev:framePtr,filename:"lib\\pure\\collections\\tableimpl.nim",line:0};
  framePtr = F;
  BeforeRet: do {
  F.line = 43;
  hc_63285[hc_63285_Idx] = hash_54836(key_63283);
  if ((hc_63285[hc_63285_Idx] == 0)) {
  F.line = 45;
  hc_63285[hc_63285_Idx] = 314159265;
  }
  
  F.line = 31;
  var h_63290 = (hc_63285[hc_63285_Idx] & (t_63281.data != null ? (t_63281.data.length-1) : -1));
  L1: do {
  F.line = 32;
  L2: while (true) {
  if (!isFilled_57464(t_63281.data[chckIndx(h_63290, 0, t_63281.data.length)-0].Field0)) break L2;
  if (!(t_63281.data[chckIndx(h_63290, 0, t_63281.data.length)-0].Field0 == hc_63285[hc_63285_Idx])) Tmp3 = false; else {Tmp3 = eqStrings(t_63281.data[chckIndx(h_63290, 0, t_63281.data.length)-0].Field1, key_63283); }if (Tmp3) {
  F.line = 38;
  result_63286 = h_63290;
  break BeforeRet;
  }
  
  F.line = 39;
  h_63290 = nextTry_57601(h_63290, (t_63281.data != null ? (t_63281.data.length-1) : -1));
  }
  } while(false);
  F.line = 75;
  result_63286 = subInt(-1, h_63290);
  } while (false); 
  framePtr = F.prev;
  return result_63286;
  }
  function X5BX5D__63263(t_63269, key_63271) {
  
  var result_63272 = {location: null, name: null, size: 0, datatype: 0, normalize: false, kind: 0, mat2: new Float64Array(4), mat3: new Float64Array(9), mat4: new Float64Array(16)};
  var F={procname:"[].[]",prev:framePtr,filename:"lib\\pure\\collections\\tables.nim",line:0};
  framePtr = F;
  F.line = 146;
  var hc_63274 = [0];
  F.line = 147;
  var index_63295 = rawGet_63276(t_63269, key_63271, hc_63274, 0);
  if ((0 <= index_63295)) {
  F.line = 148;
  nimCopy(result_63272, t_63269.data[chckIndx(index_63295, 0, t_63269.data.length)-0].Field2, NTI62033);
  }
  else {
  F.line = 151;
  F.line = 2614;
  var e_63407 = null;
  e_63407 = {m_type: NTI3450, parent: null, name: null, message: null, trace: null};
  F.line = 2616;
  e_63407.message = nimCopy(null, (makeNimstrLit("key not found: ").slice(0,-1)).concat(key_63271), NTI138);
  F.line = 2617;
  e_63407.parent = null;
  raiseException(e_63407, "KeyError");
  }
  
  framePtr = F.prev;
  return result_63272;
  }
  function X5BX5D__63255(s_63257, name_63258) {
  
  var result_63259 = 0;
  var F={procname:"shader.[]",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\shader.nim",line:0};
  framePtr = F;
  BeforeRet: do {
  F.line = 235;
  var nota_63260 = false;
  F.line = 236;
  var notu_63261 = false;
  F.line = 237;
  ++excHandler;
  try {
  F.line = 238;
  X5BX5D__63263(s_63257.uniforms, name_63258);
  F.line = 239;
  result_63259 = 0;
  --excHandler;
  } catch (EXC) {
   var prevJSError = lastJSError;
   lastJSError = EXC;
   --excHandler;
  framePtr = F;
  F.line = 241;
  notu_63261 = true;
  lastJSError = prevJSError;
  } finally {
  framePtr = F;
  }
  F.line = 242;
  ++excHandler;
  try {
  F.line = 243;
  X5BX5D__63420(s_63257.attributes, name_63258);
  F.line = 244;
  result_63259 = 1;
  --excHandler;
  } catch (EXC) {
   var prevJSError = lastJSError;
   lastJSError = EXC;
   --excHandler;
  framePtr = F;
  F.line = 246;
  nota_63260 = true;
  lastJSError = prevJSError;
  } finally {
  framePtr = F;
  }
  if (!((nota_63260 == notu_63261))) {
  F.line = 247;
  break BeforeRet;
  }
  else {
  F.line = 249;
  F.line = 2614;
  var e_63625 = null;
  e_63625 = {m_type: NTI3456, parent: null, name: null, message: null, trace: null};
  F.line = 2616;
  e_63625.message = nimCopy(null, (makeNimstrLit("Attribute/Uniform not found or found in both: ").slice(0,-1)).concat(name_63258), NTI138);
  F.line = 2617;
  e_63625.parent = null;
  raiseException(e_63625, "FieldError");
  }
  
  } while (false); 
  framePtr = F.prev;
  return result_63259;
  }
  function attribute_66141(s_66145, name_66147, val_66150) {
  
  var F={procname:"attribute.attribute",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  F.line = 88;
  var a_66161 = X5BX5D__63420(s_66145.shader.attributes, name_66147);
  if (!(((val_66150 != null ? val_66150.length : 0) == a_66161.kind))) {
  raiseAssert_21816((makeNimstrLit("len(val) == ord a.kind ").slice(0,-1)).concat(cstrToNimstr(((val_66150 != null ? val_66150.length : 0))+"").slice(0,-1),makeNimstrLit(" should have been ").slice(0,-1),cstrToNimstr((a_66161.kind)+"")));
  }
  
  upload_66041(s_66145.vb, val_66150);
  framePtr = F.prev;
  }
  function dollar__67038(x_67043) {
  
  var result_67044 = null;
  var F={procname:"$.$",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\utils.nim",line:0};
  framePtr = F;
  F.line = 43;
  result_67044 = nimCopy(null, makeNimstrLit("["), NTI138);
  L1: do {
  F.line = 44;
  var i_67060 = 0;
  F.line = 3752;
  var colontmp__67062 = 0;
  F.line = 44;
  colontmp__67062 = (x_67043 != null ? x_67043.length : 0);
  F.line = 3753;
  var i_67065 = 0;
  L2: do {
  F.line = 3754;
  L3: while (true) {
  if (!(i_67065 < colontmp__67062)) break L3;
  F.line = 3755;
  i_67060 = i_67065;
  if ((0 < i_67060)) {
  if (result_67044 != null) { result_67044 = (result_67044.slice(0, -1)).concat(makeNimstrLit(", ")); } else { result_67044 = makeNimstrLit(", ");};
  }
  
  if (result_67044 != null) { result_67044 = (result_67044.slice(0, -1)).concat(cstrToNimstr((x_67043[chckIndx(i_67060, 0, x_67043.length)-0])+"")); } else { result_67044 = cstrToNimstr((x_67043[chckIndx(i_67060, 0, x_67043.length)-0])+"");};
  i_67065 = addInt(i_67065, 1);
  }
  } while(false);
  } while(false);
  if (result_67044 != null) { result_67044 = (result_67044.slice(0, -1)).concat(makeNimstrLit("]")); } else { result_67044 = makeNimstrLit("]");};
  framePtr = F.prev;
  return result_67044;
  }
  function uniform_66212(s_66216, name_66218, val_66221) {
  
  var F={procname:"uniform.uniform",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  F.line = 97;
  var un_66232 = X5BX5D__63263(s_66216.shader.uniforms, name_66218);
  F.line = 98;
  switch (un_66232.kind) {
  case 1: if (!(((val_66221 != null ? val_66221.length : 0) == 1))) {
  raiseAssert_21816(makeNimstrLit("len(val) == 1 "));
  }
  
  s_66216.gl.uniform1fv(un_66232.location, new Float32Array(val_66221));
  
  break;
  case 2: if (!(((val_66221 != null ? val_66221.length : 0) == 2))) {
  raiseAssert_21816(makeNimstrLit("len(val) == 2 "));
  }
  
  s_66216.gl.uniform2fv(un_66232.location, new Float32Array(val_66221));
  
  break;
  case 3: if (!(((val_66221 != null ? val_66221.length : 0) == 3))) {
  raiseAssert_21816(makeNimstrLit("len(val) == 3 "));
  }
  
  s_66216.gl.uniform3fv(un_66232.location, new Float32Array(val_66221));
  
  break;
  case 4: if (!(((val_66221 != null ? val_66221.length : 0) == 4))) {
  raiseAssert_21816(makeNimstrLit("len(val) == 4 "));
  }
  
  s_66216.gl.uniform4fv(un_66232.location, new Float32Array(val_66221));
  
  break;
  case 44: if (!(((val_66221 != null ? val_66221.length : 0) == 4))) {
  raiseAssert_21816(makeNimstrLit("len(val) == 4 "));
  }
  
  if (false) {
  raiseAssert_21816(makeNimstrLit("true "));
  }
  
  s_66216.gl.uniformMatrix2fv(un_66232.location, false, new Float32Array(val_66221));
  
  break;
  case 9: if (!(((val_66221 != null ? val_66221.length : 0) == 9))) {
  raiseAssert_21816(makeNimstrLit("len(val) == 9 "));
  }
  
  if (false) {
  raiseAssert_21816(makeNimstrLit("true "));
  }
  
  s_66216.gl.uniformMatrix3fv(un_66232.location, false, new Float32Array(val_66221));
  
  break;
  case 16: if (!(((val_66221 != null ? val_66221.length : 0) == 16))) {
  raiseAssert_21816((makeNimstrLit("len(val) == 16 got: ").slice(0,-1)).concat(cstrToNimstr(((val_66221 != null ? val_66221.length : 0))+"")));
  }
  
  if (false) {
  raiseAssert_21816(makeNimstrLit("true "));
  }
  
  s_66216.gl.uniformMatrix4fv(un_66232.location, false, new Float32Array(val_66221));
  
  break;
  default: 
  F.line = 138;
  F.line = 2614;
  var e_67072 = null;
  e_67072 = {m_type: NTI3456, parent: null, name: null, message: null, trace: null};
  F.line = 2616;
  e_67072.message = nimCopy(null, (makeNimstrLit("Uniform ").slice(0,-1)).concat(name_66218.slice(0,-1),makeNimstrLit(":").slice(0,-1),dollar__67038(val_66221).slice(0,-1),makeNimstrLit(" doesn\'t match any data layout")), NTI138);
  F.line = 2617;
  e_67072.parent = null;
  raiseException(e_67072, "FieldError");
  break;
  }
  framePtr = F.prev;
  }
  function X5BX5Deq__66129(s_66133, name_66135, val_66138) {
  
  var F={procname:"[]=.[]=",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  F.line = 142;
  switch (X5BX5D__63255(s_66133.shader, name_66135)) {
  case 1: attribute_66141(s_66133, name_66135, val_66138);
  
  break;
  case 0: uniform_66212(s_66133, name_66135, val_66138);
  
  break;
  }
  framePtr = F.prev;
  }
  function degToRad_61171(d_61175) {
  
  var result_61176 = 0.0;
  result_61176 = (d_61175 * 1.7453292519943295e-002);
  return result_61176;
  }
  function rotation4Y_61259(theta_61261) {
  
  var result_61264 = new Float64Array(16);
  var F={procname:"utils.rotation4Y",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\utils.nim",line:0};
  framePtr = F;
  F.line = 83;
  result_61264[0] = Math.cos(degToRad_61171(theta_61261));
  F.line = 84;
  result_61264[2] = -(Math.sin(degToRad_61171(theta_61261)));
  F.line = 85;
  result_61264[8] = Math.sin(degToRad_61171(theta_61261));
  F.line = 86;
  result_61264[10] = Math.cos(degToRad_61171(theta_61261));
  F.line = 87;
  result_61264[5] = 1.0000000000000000e+000;
  F.line = 88;
  result_61264[15] = 1.0000000000000000e+000;
  framePtr = F.prev;
  return result_61264;
  }
  X5BX5Deq__66129(sgl_66021[0], makeNimstrLit("rot"), rotation4Y_61259(0.0));
  var theta_67083 = /**/[0.0];
  function getTime_68642() {
  
  var result_70613 = null;
  var F={procname:"times.getTime",prev:framePtr,filename:"lib\\pure\\times.nim",line:0};
  framePtr = F;
  BeforeRet: do {
  F.line = 1280;
  result_70613 = new Date();
  break BeforeRet;
  } while (false); 
  framePtr = F.prev;
  return result_70613;
  }
  var startMilsecs_70712 = /**/[getTime_68642()];
  function slash__21007(x_21009, y_21010) {
  
  var result_21011 = 0.0;
  var F={procname:"system./",prev:framePtr,filename:"lib\\system.nim",line:0};
  framePtr = F;
  F.line = 3306;
  result_21011 = (x_21009 / y_21010);
  framePtr = F.prev;
  return result_21011;
  }
  function toSeconds_68664(time_68666) {
  
  var result_70726 = 0.0;
  var F={procname:"times.toSeconds",prev:framePtr,filename:"lib\\pure\\times.nim",line:0};
  framePtr = F;
  F.line = 1329;
  result_70726 = slash__21007(time_68666.getTime(), 1000);
  framePtr = F.prev;
  return result_70726;
  }
  function epochTime_70731() {
  
  var result_70733 = 0.0;
  var F={procname:"times.epochTime",prev:framePtr,filename:"lib\\pure\\times.nim",line:0};
  framePtr = F;
  F.line = 1333;
  result_70733 = toSeconds_68664(new Date());
  framePtr = F.prev;
  return result_70733;
  }
  function appendFpsCounter_72003(toID_72005) {
  
  var F={procname:"cube.appendFpsCounter",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\utils.nim",line:0};
  framePtr = F;
  F.line = 136;
  var fel_72006 = document.createElement("P");
  F.line = 137;
  fel_72006.innerHTML = "FPS Counter";
  fel_72006.setAttribute("ID", "_fpsCounter_");
  fel_72006.setAttribute("STYLE", "position:relative;top:-2em;left:1em;border:0.1em solid black; max-width:5em;text-align:right;background-color:ghostwhite; z-index:10;");
  if (eqStrings(toID_72005, makeNimstrLit("body"))) {
  document.body.appendChild(fel_72006);
  }
  else {
  F.line = 144;
  var parent_72007 = document.getElementById(toJSStr(toID_72005));
  if ((parent_72007 === null)) {
  F.line = 145;
  parent_72007 = document.getElementById("body");
  }
  
  parent_72007.appendChild(fel_72006);
  }
  
  framePtr = F.prev;
  }
  var fpsPrevTime_72001 = /**/[0.0];
  var fpsFrames_72002 = /**/[0];
  fpsPrevTime_72001[0] = epochTime_70731();
  appendFpsCounter_72003(makeNimstrLit("output"));
  function minuseq__68785(x_68790, x_68790_Idx, y_68792) {
  
  var F={procname:"-=.-=",prev:framePtr,filename:"lib\\system.nim",line:0};
  framePtr = F;
  F.line = 3461;
  x_68790[x_68790_Idx] = (x_68790[x_68790_Idx] - y_68792);
  framePtr = F.prev;
  }
  function pluseq__52495(x_52500, x_52500_Idx, y_52502) {
  
  var F={procname:"+=.+=",prev:framePtr,filename:"lib\\system.nim",line:0};
  framePtr = F;
  F.line = 3456;
  x_52500[x_52500_Idx] = (x_52500[x_52500_Idx] + y_52502);
  framePtr = F.prev;
  }
  function keyev_72094(e_72097) {
  
  var F={procname:"cube.keyev",prev:framePtr,filename:"cube.nim",line:0};
  framePtr = F;
  if ((chckRange(e_72097.keyCode, 0, 255) == 113)) {
  minuseq__68785(theta_67083, 0, 5.0000000000000000e+000);
  }
  else {
  if ((chckRange(e_72097.keyCode, 0, 255) == 101)) {
  pluseq__52495(theta_67083, 0, 5.0000000000000000e+000);
  }
  }
  framePtr = F.prev;
  }
  document.addEventListener("keypress", keyev_72094, true);
  function drawElementsAs_65163(s_65165, pm_65166) {
  
  var F={procname:"state.drawElementsAs",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\state.nim",line:0};
  framePtr = F;
  s_65165.gl.drawElements(pm_65166, s_65165.il, s_65165.ib.datatype, 0);
  framePtr = F.prev;
  }
  function draw_72033() {
  
  var F={procname:"cube.draw",prev:framePtr,filename:"cube.nim",line:0};
  framePtr = F;
  X5BX5Deq__66129(sgl_66021[0], makeNimstrLit("color"), [1.0000000000000000e+000, 0.0, 0.0, 1.0000000000000000e+000]);
  drawElementsAs_65163(sgl_66021[0], 4);
  X5BX5Deq__66129(sgl_66021[0], makeNimstrLit("color"), [0.0, 0.0, 0.0, 1.0000000000000000e+000]);
  drawElementsAs_65163(sgl_66021[0], 2);
  framePtr = F.prev;
  }
  function updateFpsCounter_72015() {
  
  var F={procname:"cube.updateFpsCounter",prev:framePtr,filename:"C:\\Users\\stisa\\OneDrive\\Progetti\\sgl\\src\\sgl\\utils.nim",line:0};
  framePtr = F;
  F.line = 151;
  var fpsCounter_72017 = document.getElementById("_fpsCounter_");
  fpsFrames_72002[0] = addInt(fpsFrames_72002[0], 1);
  F.line = 153;
  var time_72027 = epochTime_70731();
  if (((fpsPrevTime_72001[0] + 1.0000000000000000e+000) < time_72027)) {
  F.line = 155;
  var fps_72029 = ((fpsFrames_72002[0] / (time_72027 - fpsPrevTime_72001[0]))|0);
  F.line = 156;
  fpsCounter_72017.innerHTML = toJSStr((cstrToNimstr((fps_72029)+"").slice(0,-1)).concat(makeNimstrLit(" FPS")));
  F.line = 157;
  fpsPrevTime_72001[0] = time_72027;
  F.line = 158;
  fpsFrames_72002[0] = 0;
  }
  
  framePtr = F.prev;
  }
  function requestAnimationFrame_29023(fn_29028) {
  
  var F={procname:"webgl.requestAnimationFrame",prev:framePtr,filename:"C:\\Users\\stisa\\.nimble\\pkgs\\webgl-#head\\webgl.nim",line:0};
  framePtr = F;
  F.line = 443;
  window.requestAnimationFrame(fn_29028);framePtr = F.prev;
  }
  function update_72069(then_72071) {
  
  var F={procname:"cube.update",prev:framePtr,filename:"cube.nim",line:0};
  framePtr = F;
  X5BX5Deq__66129(sgl_66021[0], makeNimstrLit("rot"), rotation4Y_61259(theta_67083[0]));
  pluseq__52495(theta_67083, 0, 5.0000000000000000e-001);
  draw_72033();
  updateFpsCounter_72015();
  requestAnimationFrame_29023(update_72069);
  framePtr = F.prev;
  }
  update_72069(0.0);
  