UNPKG

vult

Version:

Vult is a transcompiler well suited to write high-performance DSP code

737 lines 537 kB
#!/usr/bin/env node // Generated by js_of_ocaml 4.1.0 (function(b){typeof globalThis!=="object"&&(this?c():(b.defineProperty(b.prototype,"_T_",{configurable:true,get:c}),_T_));function c(){var c=this||self;c.globalThis=c;delete b.prototype._T_}}(Object));(function(af){"use strict";var tR="%s\n",tS="i",v_="function_",xi=" if(this.",kl="static_inline ",kk="switch_",uX=10000000.,uY="fix_sin",dZ="EXPORT void ",tQ="CodeC.printStmt: invalid tuple assign",uV="_default(data);",uW="unknow variable: ",fi='#include "vultin.h"',tP=4096,nT="[]",gi="0.0",v9="Expecting a %s but the file ended",v8="fix_tanh",v7="MakeMac.exp",oc=" */",cC=0xff,xh="){};",fo="tables.h",ob='.h\\"", Library = "',xg=" Creates short function names (default: off)",aH="@[<2>[",xf=32767.,nz="#else",v6=" Display this list of options",uU="bool_init_array",v5="int_copy_array",xe="_process_init(data);",eG=128,jT="log10",E="int",tO="fd ",oC=" return a;",tN="fix_eps",hM=">",D="float",xd=1027,tM="int_to_fix",oa="MakeTables.stmt_x",tL="int_to_float",cE="%B",ny="new ",kj="case ",hZ="_noteOn(",xc=" if(x > maxv)",jS=">>",v4="printStmt: invalid constant assign",h8="table",v3="_process",oB="e",tK="_tilde;",xb="_tilde), // size of the object",v2="float_to_fix",tJ="fix_init_array",xa="->data[i]);",j3=") end",eC="wrap_array",n$=": Not a directory",dw="'a",uT="_noteOn(this.context,note,velocity,channel); };",gs=" ",w$="_process_init(); else this.context = {};",v1="Out_of_memory",h7=" ",uS="do",gl=" {",v0=": closedir failed",n_="index out of bounds",vZ="Could not open the file ",ka="_bigarr02",G="))",nx='/Resources/Library");',hL="] = ",vY=-1.,z="}",w_="_tilde_delete, // destructor function",oA="type",n9="Object obj;",dv=0xffff,uR="int_init_array",eF=" }",jR="wavetable",vX=" if i > 6 or i < 1 then",uQ="_raw_c2",vW="External.",a2="@])",w9="infinity",jQ="switch",j2="private",vV="float in",w8="fix_get",nw="_tilde *x = (t_",cG="tuple",uP="fix_mul",hF="eps",n8=" // Microsoft VC++",oz=112,j$="switch(",tI="%x",gr="c1",jP=252,aL=".",tH="_tilde_class;",nS="performance",vU=" a[i] = val;",gq=" *data = (",uO=" data;",vT=0xf0,ki="0.0f",w7="' is not defined",tG="_default",gh="#include <math.h>",ex=" }",oy=" else ",uN="_noteOff",hY="max",nv="Invalid expression",jO="_process_ret_",tF="_default = null;",nR=-32,w6=" = block",c$="index",kh="boolean",j1=").",uM="The type of this expression is unknown.",w4="printStmt: invalid constant declaration",w5="_tilde {",w3="msu",tE="closedir",w2="../",tD=-32768.,nQ="%s",n7=" ret = ",w1="Assert_failure",tC="_process_init) this.context = this.",tB="Vult",et="&&",hX="cos",tA=-21,uK="fix_floor",uL="_tilde_delete(t_",w0="printLhsExp: All other cases should be already covered",ox="size",uJ=" processor.",nP=" #define EXPORT __declspec(dllexport)",uI=8388608.,vR="Expecting a list of value declarations '{ val x:... }' or a type alias ': type' but got %s",vS="This value '",fh="(@[",bT='"',fm="get",fn=",",n6="#if defined(_MSC_VER)",hW="<",wZ="Fatal error: exception %s\n",ty="_process(this.context,input); else return 0; };",F="(",tz=0x800,uF=".vult",uG="_noteOff(this.context,note,velocity,channel); };",uH=" 2>",ow=">=",n4=' #define EXPORT __attribute__((visibility("default")))',n5="file",nO="return",cT="#define ",uE="Expecting a string with a link name or a tag",da=256,vQ="real: invalid arguments",fl="samplerate",j_="--help",tx="The operator cannot be used with multiple arguments",n3='", IncludeDirectory = "modelica://',nu="integer",hE="local ",vP="The type of variable '",uD=' #include "',hV="__process(",fx="cpp",nN=" ",vO="_process_init();",vN="(x->data)",ov="ENOENT",nt="This attribute can only be applied to functions returning 'real'",tw="([^/]+)",n2=0xf,wY=" if not(i > 6 or i < 1) then",uC="@[<2>{ ",vM=125,wX="ENOTEMPTY",wW="fix_tan",h6="];",tv="Division_by_zero",gk="if",hD="ret",uA="the curve fitting returned more than three points",uB=" while (n--) {",wV="fix_set",bi="_TABLES_H",jN=": ",wU="_process(data, 0.0);",tu="_noteOn",cF='#include "',jM="Expecting a ",ou="(float) ",H="@,))@]",eE="%d",vL="@ }@]",vK="GetIdentifiers.exp",du="'",aY="[",uz="buffer.ml",wT="Cygwin",wS="float_to_int",tt=" (method)",ts="for_",tr="static t_class *",uy="if ",eB="lua",vJ="/dev/null",W=";@ ",dY="set",j9="min",wR="break_",hC="in_",tq=" >",ew=".field_",aB="real",j0='Invalid statement. All statements should be in the forms: "a = b; " or "_ = b(); " ',jL=254,tp=" }",fw=100,jZ="_tilde_class, (t_method)",n1=" : flags Open_text and Open_binary are not compatible",a1="*",fv="else",ot="val ",jK="default_",vI=-15,to="Redefinition of variable '%s'. Previously defined at %s",n0="fix_random",wQ="do_",hB="random",nZ=" ",kg="Unix.Unix_error",tn="init",os='} // extern "C"',hA="-help",ns="java",nM="out",tm=" this.",ux="Stack_overflow",tl=" ",vH="fix_to_float",l="@ ",uv="fix_pi",uw="/static/",jJ=-97,gg="#include <stdint.h>",vG="return_",gp="c0",or="};",wP="Not_found",vF="Math.abs",fu="clip",gd='extern "C" {',tk="#ifdef __cplusplus",cU="#endif // ",wO="./",tj=" vultProcess.",uu=" end",vE="fix_samplerate",wN="%h",ti="_raw_c0",nL="(int)",nK="rmdir",d2="js",vD="f",th="uncovered case",ut="fix_clip",fq=4298433,us=1026,nr="default: ",hK="this.",nJ="?",cD="false",vB=" /* ",vC="_controlChange(this.context,note,velocity,channel); };",tg="fix_sqrt",gj="string",wM="getInputVar: the variable does not have a type",nI="sinh",cS=0x80,oq="Fatal error: exception ",cB=":",wL="order",te="' cannot be represented with fixed-point numbers",tf="_controlChange) this.",ur="function ",hJ="tan",vA="fix_abs",aO="_",nH="compare: functional value",vz="Expecting a %s but got %s",fg="'size",jI="_tilde_class, (method)",hz="<<",wK="CodeC.printTypeAndName: invalid input",c_="true",nG="wave",uq="Invalid_argument",jH="Map.bal",hU="any",jG="@[",vy="_default) return this.",ft='.tables.h"',kf="_tilde_class);",up="_noteOff(t_",vx="_default(this.context); };",tc="fix_div",td="Unknown symbol '",uo="%ni",fk="abs",bP="<>",op="&",tb="*(out_",nF="vcv-prototype",ev="h",ta=-316113959,vw="CodeJs.printStmt: invalid tuple assign",un="fix_exp",co="_ctx",bk="]",oo="%F",vv="This expression has type '",nY="cosh",ax="; ",bM="_H",vu="_output_",on="~=",nq="field_",a5="0",um="fix_max",vt=" <",vs="Sys_blocked_io",wJ=" then",aM=248,b5="/* Code automatically generated by Vult https://github.com/modlfo/vult */",aG="@,]@]",om="_process_type",wI="The symbol '%s' is not defined",j8="arduino",d1="_noteOff(",vr=" but got ",bS=246,ul="_process_type data;",s$="%u",uk="break",wH="get: invalid arguments",s_="Not a supported wav file",jF=") return ",an="%S",uj="_unused_",gc=127,fj=1024,hT="var ",np="@{",no=" : flags Open_rdonly and Open_wronly are not compatible",nE="frandom",bb="-",hI="){",a0="fix16",nn=" : file already exists",dX=0xffffff,s9="_value;",hy="#endif",ol=-783600662,jE="public",gf="_process(",ke="in",ui=", characters ",s8=" this.",s7=12520,uh="none",s6="_tilde_dsp(t_",vq="_init",s5=" if(this.",nX="Simplify.exp",h5="double",ug="fix_wrap_array",vp="][i] / 10.0)",vo="Scope.getContext",vn="typedef struct _",vm="_default(this.context);",aZ="bool",eA=1000,cA="default",bc="{",uf="type ",p="",wG="fix_to_int",hS="^",wF="fix_min",es=0x3f,ud="_controlChange",ue="processor.context",jY="if(",vl="package ",s4="*(out_0++) = ",wE="printStmt: invalid variable declaration",s2="Unknown symbol '%s'",s3="Match_failure",vk="The script requires the functions:\nfun process() { } \nand update() { }",wC=" but the file ended",wD="_process) return this.",h4="); ",s1=" -> ",uc="float_copy_array",vj="++) = ",s0=" : is a directory",vi=" else",vh=16384,ok="c2",a6="+",ub="*data",j7=" : ",go="{ ",q="@,",vg="(block.inputs[",cR="!=",vf="%li",wB="Redefinition of variable '",dW="uint8_t",bU="array",ua=" = function(",t$=" if((int)velocity) ",jX=65536,hx="tanh",ge="void",sZ="]); ",x=")",wA="CodeJava.printStmt: invalid tuple assign",ez='.h"',ve=" return x;",wz="float_init_array",nm=" // GCC",nD="nan",br="@[%s =@ ",jD="The type of this expression could not be inferred. Add a type annotation.",sY=0xe0,t_="_raw_c1",h3="pi",cp="void ",wy=0xdfff,hw="%",bO="/",gb="return ",sW="void *",sX="could not evaluate if statement",oj="ENOTDIR",wx=1073741823,sV="The symbol '",cQ=250,ad=";",jW="function",vd=".\n",nW=1255,eu=255,nV="jsError",dx=0x8000,vc=" float dummy;",ww="a float",wv="fix_cos",t9="ProgToCode.convertLhsExp: everything should have types",bq="(Some ",gn="|",t8="End_of_file",nB="..",nC="Failure",t7="bool_copy_array",nl="pow",vb="_process_init()",wu="makeArray(",t6=0xdc00,va=-48,wt="fix_to_short(",nk="and",nj="EBADF",j6="while",bp="camlinternalFormat.ml",oi="(bool) ",fs="fixed",hH="_controlChange(",ws="Sys_error",wr=32768.,wq="src/core/CCString.pp.ml",sU="EEXIST",t5="out_",wp="Printexc.handle_uncaught_exception",wo="the type is not defined",av=" = ",sT="EXPORT ",hG=" }",bo="None",jV="int_of_string",dy="makeArray",J="fix16_t",t4=" 2>&1",oh="Invalid left hand side of assignment",jC="invalid env",ni=120,wn=103,sS="Expecting a list of value declarations '{ val x:... }' or a type alias ': type' but got ",hR=512,wm=" else return x;",cq="unit",sR=0x7ff0,t3="or",hQ=" *)object;",u$=" else if(x < minv)",sQ="_noteOff) this.",wj="getCopyArrayFunction: Invalid array type ",wk=" return minv;",wl="EXPORT void *",nA="(int) ",wi="This value '%f' cannot be represented with fixed-point numbers",nh="0x",t2="fix_copy_array",bj="@]",c9="\n",u_="_process_init = null;",t1=" return a[i];",t0="} t_",u9="); if(!block",cd="end",tZ=": file descriptor already closed",og='/Resources/Include", LibraryDirectory = "modelica://',gm="not",wh="%Li",fr=3851765,kd="makeComplexArray",ng="obj",u8="input",u7="invalid arguments",h2="sin",aa=" ",hP="log",wg="_controlChange(t_",h1="exp",hO=") {",eD="||",jU="x->data",tY="lexing: empty token",sP="for",sO=' #include "vultin.h"',nf="mkdir",aA=");",j5=": No such file or directory",wf="Cannot outdent more",tX="printLhsExpTuple: All other cases should be already covered\n",bn=" =",d0=" class_addmethod(",k="<2>",nU="_samples",h0="floor",t=",@ ",sN="_noteOn(t_",bN="%a",bB=", ",of="<=",sM="win32",u6="_noteOff(data, note, channel);",u5="CodeLua.printStmt: invalid tuple assign",tW="bound_check",u4="identifier",u3="|0)",jB="'. Previously defined at ",ne="audio_block_t * block",u2="void *object",we="CodeC.convertStmt: invalid alias type",sL="while(",tV="irandom",u1="_tilde *x){",wd="an integer",fp="mac",sK="Pervasives.do_at_exit",wc="_default) this.",A=" ",sJ="_tilde_new, // constructor function",wb="Undefined_recursive_module",sI=" return (void *)x;",wa="output",kc=" end",ff="==",ey="abstract",v$=" return maxv;",oe=" t_",kb="Set.bal",cP="#ifndef ",u0="cannot update array",tU="()",tT="%i",hN="sqrt",j4="break;",nd=" Arrays.fill(a, init);",od=") return;",uZ="{}";function aKV(b){var d=[0];while(b!==0){var e=b[1];for(var c=1;c<e.length;c++)d.push(e[c]);b=b[2]}return d}function aLI(c,b){throw[0,c,b]}function gy(c,b){if(c==0)return p;if(b.repeat)return b.repeat(c);var e=p,d=0;for(;;){if(c&1)e+=b;c>>=1;if(c==0)return e;b+=b;d++;if(d==9)b.slice(0,1)}}function ie(d,c,b){var e=String.fromCharCode;if(c==0&&b<=tP&&b==d.length)return e.apply(null,d);var f=p;for(;0<b;c+=fj,b-=fj)f+=e.apply(null,d.slice(c,c+Math.min(b,fj)));return f}function fA(b){if(b.t==2)b.c+=gy(b.l-b.c.length,"\0");else b.c=ie(b.c,0,b.c.length);b.t=0}function xQ(b){if(b.length<24){for(var c=0;c<b.length;c++)if(b.charCodeAt(c)>gc)return false;return true}else return!/[^\x00-\x7f]/.test(b)}function aLX(f){for(var j=p,d=p,g,a,h,b,c=0,i=f.length;c<i;c++){a=f.charCodeAt(c);if(a<cS){for(var e=c+1;e<i&&(a=f.charCodeAt(e))<cS;e++);if(e-c>hR){d.substr(0,1);j+=d;d=p;j+=f.slice(c,e)}else d+=f.slice(c,e);if(e==i)break;c=e}b=1;if(++c<i&&((h=f.charCodeAt(c))&-64)==eG){g=h+(a<<6);if(a<sY){b=g-0x3080;if(b<cS)b=1}else{b=2;if(++c<i&&((h=f.charCodeAt(c))&-64)==eG){g=h+(g<<6);if(a<vT){b=g-0xe2080;if(b<tz||b>=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c<i&&((h=f.charCodeAt(c))&-64)==eG&&a<0xf5){b=h-0x3c82080+(g<<6);if(b<0x10000||b>0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>dv)d+=String.fromCharCode(0xd7c0+(b>>10),t6+(b&0x3FF));else d+=String.fromCharCode(b);if(d.length>fj){d.substr(0,1);j+=d;d=p}}return j+d}function dz(d,b,c){this.t=d;this.c=b;this.l=c}dz.prototype.toString=function(){switch(this.t){case 9:return this.c;default:fA(this);case 0:if(xQ(this.c)){this.t=9;return this.c}this.t=8;case 8:return this.c}};dz.prototype.toUtf16=function(){var b=this.toString();if(this.t==9)return b;return aLX(b)};dz.prototype.slice=function(){var b=this.t==4?this.c.slice():this.c;return new dz(this.t,b,this.l)};function xt(b){return new dz(0,b,b.length)}function b(b){return xt(b)}function oX(d,c){aLI(d,b(c))}var cH=[0];function bl(b){oX(cH.Invalid_argument,b)}function gu(){bl(n_)}function aKW(c,b,d){if(b<0||b>=c.length-1)gu();c[b+1]=d;return 0}function xk(f,a,e){var b=new Array(e+1);b[0]=0;for(var c=1,d=a+1;c<=e;c++,d++)b[c]=f[d];return b}function ko(c){var d=new Uint8Array(c.l),f=c.c,e=f.length,b=0;for(;b<e;b++)d[b]=f.charCodeAt(b);for(e=c.l;b<e;b++)d[b]=0;c.c=d;c.t=4;return d}function d3(e,f,c,a,d){if(d==0)return 0;if(a==0&&(d>=c.l||c.t==2&&d>=c.c.length)){c.c=e.t==4?ie(e.c,f,d):f==0&&e.c.length==d?e.c:e.c.substr(f,d);c.t=c.c.length==c.l?0:2}else if(c.t==2&&a==c.c.length){c.c+=e.t==4?ie(e.c,f,d):f==0&&e.c.length==d?e.c:e.c.substr(f,d);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)ko(c);var g=e.c,h=c.c;if(e.t==4)if(a<=f)for(var b=0;b<d;b++)h[a+b]=g[f+b];else for(var b=d-1;b>=0;b--)h[a+b]=g[f+b];else{var i=Math.min(d,g.length-f);for(var b=0;b<i;b++)h[a+b]=g.charCodeAt(f+b);for(;b<d;b++)h[a+b]=0}}return 0}function b7(b){return b}function dA(b,c,d,e,f){d3(b7(b),c,d,e,f);return 0}function xr(){bl(n_)}function fz(b,c){switch(b.t&6){default:if(c>=b.c.length)return 0;case 0:return b.c.charCodeAt(c);case 4:return b.c[c]}}function aK0(c,b){if(b>>>0>=c.l)xr();return fz(c,b)}function aU(b,d,c){c&=cC;if(b.t!=4){if(d==b.c.length){b.c+=String.fromCharCode(c);if(d+1==b.l)b.t=0;return 0}ko(b)}b.c[d]=c;return 0}function bV(c,b,d){if(b>>>0>=c.l)xr();return aU(c,b,d)}function d4(c,b){if(c.fun)return d4(c.fun,b);if(typeof c!=="function")return c;var d=c.length|0;if(d===0)return c.apply(null,b);var f=b.length|0,e=d-f|0;if(e==0)return c.apply(null,b);else if(e<0)return d4(c.apply(null,b.slice(0,d)),b.slice(d));else return function(){var f=arguments.length==0?1:arguments.length,e=new Array(b.length+f);for(var d=0;d<b.length;d++)e[d]=b[d];for(var d=0;d<arguments.length;d++)e[b.length+d]=arguments[d];return d4(c,e)}}function N(b,c){if(c>>>0>=b.length-1)gu();return b}function kn(b){if(isFinite(b)){if(Math.abs(b)>=2.2250738585072014e-308)return 0;if(b!=0)return 1;return 2}return isNaN(b)?4:3}function dc(b){b.t&6&&fA(b);return b.c}var aL0=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function aLZ(b){if(aL0)return Math.floor(Math.log2(b));var c=0;if(b==0)return-Infinity;if(b>=1)while(b>=2){b/=2;c++}else while(b<1){b*=2;c--}return c}function oM(d){var b=new Float32Array(1);b[0]=d;var c=new Int32Array(b.buffer);return c[0]|0}var xA=Math.pow(2,-24);function oW(b){throw b}function kw(){oW(cH.Division_by_zero)}function X(c,d,b){this.lo=c&dX;this.mi=d&dX;this.hi=b&dv}X.prototype.caml_custom="_j";X.prototype.copy=function(){return new X(this.lo,this.mi,this.hi)};X.prototype.ucompare=function(b){if(this.hi>b.hi)return 1;if(this.hi<b.hi)return-1;if(this.mi>b.mi)return 1;if(this.mi<b.mi)return-1;if(this.lo>b.lo)return 1;if(this.lo<b.lo)return-1;return 0};X.prototype.compare=function(b){var c=this.hi<<16,d=b.hi<<16;if(c>d)return 1;if(c<d)return-1;if(this.mi>b.mi)return 1;if(this.mi<b.mi)return-1;if(this.lo>b.lo)return 1;if(this.lo<b.lo)return-1;return 0};X.prototype.neg=function(){var b=-this.lo,c=-this.mi+(b>>24),d=-this.hi+(c>>24);return new X(b,c,d)};X.prototype.add=function(b){var c=this.lo+b.lo,d=this.mi+b.mi+(c>>24),e=this.hi+b.hi+(d>>24);return new X(c,d,e)};X.prototype.sub=function(b){var c=this.lo-b.lo,d=this.mi-b.mi+(c>>24),e=this.hi-b.hi+(d>>24);return new X(c,d,e)};X.prototype.mul=function(b){var c=this.lo*b.lo,d=(c*xA|0)+this.mi*b.lo+this.lo*b.mi,e=(d*xA|0)+this.hi*b.lo+this.mi*b.mi+this.lo*b.hi;return new X(c,d,e)};X.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};X.prototype.isNeg=function(){return this.hi<<16<0};X.prototype.and=function(b){return new X(this.lo&b.lo,this.mi&b.mi,this.hi&b.hi)};X.prototype.or=function(b){return new X(this.lo|b.lo,this.mi|b.mi,this.hi|b.hi)};X.prototype.xor=function(b){return new X(this.lo^b.lo,this.mi^b.mi,this.hi^b.hi)};X.prototype.shift_left=function(b){b=b&63;if(b==0)return this;if(b<24)return new X(this.lo<<b,this.mi<<b|this.lo>>24-b,this.hi<<b|this.mi>>24-b);if(b<48)return new X(0,this.lo<<b-24,this.mi<<b-24|this.lo>>48-b);return new X(0,0,this.lo<<b-48)};X.prototype.shift_right_unsigned=function(b){b=b&63;if(b==0)return this;if(b<24)return new X(this.lo>>b|this.mi<<24-b,this.mi>>b|this.hi<<24-b,this.hi>>b);if(b<48)return new X(this.mi>>b-24|this.hi<<48-b,this.hi>>b-24,0);return new X(this.hi>>b-48,0,0)};X.prototype.shift_right=function(b){b=b&63;if(b==0)return this;var d=this.hi<<16>>16;if(b<24)return new X(this.lo>>b|this.mi<<24-b,this.mi>>b|d<<24-b,this.hi<<16>>b>>>16);var c=this.hi<<16>>31;if(b<48)return new X(this.mi>>b-24|this.hi<<48-b,this.hi<<16>>b-24>>16,c&dv);return new X(this.hi<<16>>b-32,c,c)};X.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&dX;this.lo=this.lo<<1&dX};X.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&dX;this.mi=(this.mi>>>1|this.hi<<23)&dX;this.hi=this.hi>>>1};X.prototype.udivmod=function(f){var d=0,c=this.copy(),b=f.copy(),e=new X(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};X.prototype.div=function(b){var c=this;if(b.isZero())kw();var e=c.hi^b.hi;if(c.hi&dx)c=c.neg();if(b.hi&dx)b=b.neg();var d=c.udivmod(b).quotient;if(e&dx)d=d.neg();return d};X.prototype.mod=function(c){var b=this;if(c.isZero())kw();var e=b.hi;if(b.hi&dx)b=b.neg();if(c.hi&dx)c=c.neg();var d=b.udivmod(c).modulus;if(e&dx)d=d.neg();return d};X.prototype.toInt=function(){return this.lo|this.mi<<24};X.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};X.prototype.toArray=function(){return[this.hi>>8,this.hi&cC,this.mi>>16,this.mi>>8&cC,this.mi&cC,this.lo>>16,this.lo>>8&cC,this.lo&cC]};X.prototype.lo32=function(){return this.lo|(this.mi&cC)<<24};X.prototype.hi32=function(){return this.mi>>>8&dv|this.hi<<16};function kt(c,d,b){return new X(c,d,b)}function ks(b){if(!isFinite(b)){if(isNaN(b))return kt(1,0,sR);return b>0?kt(0,0,sR):kt(0,0,0xfff0)}var a=b==0&&1/b==-Infinity?dx:b>=0?0:dx;if(a)b=-b;var c=aLZ(b)+1023;if(c<=0){c=0;b/=Math.pow(2,-us)}else{b/=Math.pow(2,c-xd);if(b<16){b*=2;c-=1}if(c==0)b/=2}var e=Math.pow(2,24),d=b|0;b=(b-d)*e;var f=b|0;b=(b-f)*e;var g=b|0;d=d&n2|a|c<<4;return kt(g,f,d)}function ia(b){return b.toArray()}function xq(d,c,g){d.write(32,c.dims.length);d.write(32,c.kind|c.layout<<8);if(c.caml_custom==ka)for(var b=0;b<c.dims.length;b++)if(c.dims[b]<dv)d.write(16,c.dims[b]);else{d.write(16,dv);d.write(32,0);d.write(32,c.dims[b])}else for(var b=0;b<c.dims.length;b++)d.write(32,c.dims[b]);switch(c.kind){case 2:case 3:case 12:for(var b=0;b<c.data.length;b++)d.write(8,c.data[b]);break;case 4:case 5:for(var b=0;b<c.data.length;b++)d.write(16,c.data[b]);break;case 6:for(var b=0;b<c.data.length;b++)d.write(32,c.data[b]);break;case 8:case 9:d.write(8,0);for(var b=0;b<c.data.length;b++)d.write(32,c.data[b]);break;case 7:for(var b=0;b<c.data.length/2;b++){var f=ia(c.get(b));for(var e=0;e<8;e++)d.write(8,f[e])}break;case 1:for(var b=0;b<c.data.length;b++){var f=ia(ks(c.get(b)));for(var e=0;e<8;e++)d.write(8,f[e])}break;case 0:for(var b=0;b<c.data.length;b++){var f=oM(c.get(b));d.write(32,f)}break;case 10:for(var b=0;b<c.data.length/2;b++){var e=c.get(b);d.write(32,oM(e[1]));d.write(32,oM(e[2]))}break;case 11:for(var b=0;b<c.data.length/2;b++){var a=c.get(b),f=ia(ks(a[1]));for(var e=0;e<8;e++)d.write(8,f[e]);var f=ia(ks(a[2]));for(var e=0;e<8;e++)d.write(8,f[e])}break}g[0]=(4+c.dims.length)*4;g[1]=(4+c.dims.length)*8}function xo(b){switch(b){case 7:case 10:case 11:return 2;default:return 1}}function aKX(c,e){var b;switch(c){case 0:b=Float32Array;break;case 1:b=Float64Array;break;case 2:b=Int8Array;break;case 3:b=Uint8Array;break;case 4:b=Int16Array;break;case 5:b=Uint16Array;break;case 6:b=Int32Array;break;case 7:b=Int32Array;break;case 8:b=Int32Array;break;case 9:b=Int32Array;break;case 10:b=Float32Array;break;case 11:b=Float64Array;break;case 12:b=Uint8Array;break}if(!b)bl("Bigarray.create: unsupported kind");var d=new b(e*xo(c));return d}function oN(d){var b=new Int32Array(1);b[0]=d;var c=new Float32Array(b.buffer);return c[0]}function h$(b){return new X(b[7]<<0|b[6]<<8|b[5]<<16,b[4]<<0|b[3]<<8|b[2]<<16,b[1]<<0|b[0]<<8)}function oO(e){var a=e.lo,g=e.mi,c=e.hi,d=(c&0x7fff)>>4;if(d==2047)return(a|g|c&n2)==0?c&dx?-Infinity:Infinity:NaN;var f=Math.pow(2,-24),b=(a*f+g)*f+(c&n2);if(d>0){b+=16;b*=Math.pow(2,d-xd)}else b*=Math.pow(2,-us);if(c&dx)b=-b;return b}function oD(c){var e=c.length,d=1;for(var b=0;b<e;b++){if(c[b]<0)bl("Bigarray.create: negative dimension");d=d*c[b]}return d}function aLf(c,b){return new X(c&dX,c>>>24&cC|(b&dv)<<8,b>>>16&dv)}function oP(b){return b.hi32()}function oQ(b){return b.lo32()}var aKY=ka;function eH(d,e,c,b){this.kind=d;this.layout=e;this.dims=c;this.data=b}eH.prototype.caml_custom=aKY;eH.prototype.offset=function(c){var d=0;if(typeof c==="number")c=[c];if(!(c instanceof Array))bl("bigarray.js: invalid offset");if(this.dims.length!=c.length)bl("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var b=0;b<this.dims.length;b++){if(c[b]<0||c[b]>=this.dims[b])gu();d=d*this.dims[b]+c[b]}else for(var b=this.dims.length-1;b>=0;b--){if(c[b]<1||c[b]>this.dims[b])gu();d=d*this.dims[b]+(c[b]-1)}return d};eH.prototype.get=function(b){switch(this.kind){case 7:var e=this.data[b*2+0],c=this.data[b*2+1];return aLf(e,c);case 10:case 11:var f=this.data[b*2+0],d=this.data[b*2+1];return[jL,f,d];default:return this.data[b]}};eH.prototype.set=function(b,c){switch(this.kind){case 7:this.data[b*2+0]=oQ(c);this.data[b*2+1]=oP(c);break;case 10:case 11:this.data[b*2+0]=c[1];this.data[b*2+1]=c[2];break;default:this.data[b]=c;break}return 0};eH.prototype.fill=function(c){switch(this.kind){case 7:var d=oQ(c),f=oP(c);if(d==f)this.data.fill(d);else for(var b=0;b<this.data.length;b++)this.data[b]=b%2==0?d:f;break;case 10:case 11:var e=c[1],a=c[2];if(e==a)this.data.fill(e);else for(var b=0;b<this.data.length;b++)this.data[b]=b%2==0?e:a;break;default:this.data.fill(c);break}};eH.prototype.compare=function(c,g){if(this.layout!=c.layout||this.kind!=c.kind){var f=this.kind|this.layout<<8,a=c.kind|c.layout<<8;return a-f}if(this.dims.length!=c.dims.length)return c.dims.length-this.dims.length;for(var b=0;b<this.dims.length;b++)if(this.dims[b]!=c.dims[b])return this.dims[b]<c.dims[b]?-1:1;switch(this.kind){case 0:case 1:case 10:case 11:var d,e;for(var b=0;b<this.data.length;b++){d=this.data[b];e=c.data[b];if(d<e)return-1;if(d>e)return 1;if(d!=e){if(!g)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case 7:for(var b=0;b<this.data.length;b+=2){if(this.data[b+1]<c.data[b+1])return-1;if(this.data[b+1]>c.data[b+1])return 1;if(this.data[b]>>>0<c.data[b]>>>0)return-1;if(this.data[b]>>>0>c.data[b]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var b=0;b<this.data.length;b++){if(this.data[b]<c.data[b])return-1;if(this.data[b]>c.data[b])return 1}break}return 0};function gt(d,e,c,b){this.kind=d;this.layout=e;this.dims=c;this.data=b}gt.prototype=new eH();gt.prototype.offset=function(b){if(typeof b!=="number")if(b instanceof Array&&b.length==1)b=b[0];else bl("Ml_Bigarray_c_1_1.offset");if(b<0||b>=this.dims[0])gu();return b};gt.prototype.get=function(b){return this.data[b]};gt.prototype.set=function(b,c){this.data[b]=c;return 0};gt.prototype.fill=function(b){this.data.fill(b);return 0};function xm(d,e,b,c){var f=xo(d);if(oD(b)*f!=c.length)bl("length doesn't match dims");if(e==0&&b.length==1&&f==1)return new gt(d,e,b,c);return new eH(d,e,b,c)}function cr(c){if(!cH.Failure)cH.Failure=[aM,b(nC),-3];oX(cH.Failure,c)}function xn(c,v,r){var i=c.read32s();if(i<0||i>16)cr("input_value: wrong number of bigarray dimensions");var p=c.read32s(),j=p&cC,o=p>>8&1,h=[];if(r==ka)for(var b=0;b<i;b++){var n=c.read16u();if(n==dv){var t=c.read32u(),u=c.read32u();if(t!=0)cr("input_value: bigarray dimension overflow in 32bit");n=u}h.push(n)}else for(var b=0;b<i;b++)h.push(c.read32u());var e=oD(h),a=aKX(j,e),g=xm(j,o,h,a);switch(j){case 2:for(var b=0;b<e;b++)a[b]=c.read8s();break;case 3:case 12:for(var b=0;b<e;b++)a[b]=c.read8u();break;case 4:for(var b=0;b<e;b++)a[b]=c.read16s();break;case 5:for(var b=0;b<e;b++)a[b]=c.read16u();break;case 6:for(var b=0;b<e;b++)a[b]=c.read32s();break;case 8:case 9:var s=c.read8u();if(s)cr("input_value: cannot read bigarray with 64-bit OCaml ints");for(var b=0;b<e;b++)a[b]=c.read32s();break;case 7:var f=new Array(8);for(var b=0;b<e;b++){for(var d=0;d<8;d++)f[d]=c.read8u();var q=h$(f);g.set(b,q)}break;case 1:var f=new Array(8);for(var b=0;b<e;b++){for(var d=0;d<8;d++)f[d]=c.read8u();var k=oO(h$(f));g.set(b,k)}break;case 0:for(var b=0;b<e;b++){var k=oN(c.read32s());g.set(b,k)}break;case 10:for(var b=0;b<e;b++){var m=oN(c.read32s()),l=oN(c.read32s());g.set(b,[jL,m,l])}break;case 11:var f=new Array(8);for(var b=0;b<e;b++){for(var d=0;d<8;d++)f[d]=c.read8u();var m=oO(h$(f));for(var d=0;d<8;d++)f[d]=c.read8u();var l=oO(h$(f));g.set(b,[jL,m,l])}break}v[0]=(4+i)*4;return xm(j,o,h,a)}function xl(b,c,d){return b.compare(c,d)}function eJ(b,c){return Math.imul(b,c)}function bX(c,b){b=eJ(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=eJ(b,0x1b873593);c^=b;c=c<<13|c>>>32-13;return(c+(c<<2)|0)+(0xe6546b64|0)|0}function aLa(b,c){b=bX(b,oQ(c));b=bX(b,oP(c));return b}function oK(b,c){return aLa(b,ks(c))}function xp(d){var c=oD(d.dims),e=0;switch(d.kind){case 2:case 3:case 12:if(c>da)c=da;var f=0,b=0;for(b=0;b+4<=d.data.length;b+=4){f=d.data[b+0]|d.data[b+1]<<8|d.data[b+2]<<16|d.data[b+3]<<24;e=bX(e,f)}f=0;switch(c&3){case 3:f=d.data[b+2]<<16;case 2:f|=d.data[b+1]<<8;case 1:f|=d.data[b+0];e=bX(e,f)}break;case 4:case 5:if(c>eG)c=eG;var f=0,b=0;for(b=0;b+2<=d.data.length;b+=2){f=d.data[b+0]|d.data[b+1]<<16;e=bX(e,f)}if((c&1)!=0)e=bX(e,d.data[b]);break;case 6:if(c>64)c=64;for(var b=0;b<c;b++)e=bX(e,d.data[b]);break;case 8:case 9:if(c>64)c=64;for(var b=0;b<c;b++)e=bX(e,d.data[b]);break;case 7:if(c>32)c=32;c*=2;for(var b=0;b<c;b++)e=bX(e,d.data[b]);break;case 10:c*=2;case 0:if(c>64)c=64;for(var b=0;b<c;b++)e=oK(e,d.data[b]);break;case 11:c*=2;case 1:if(c>32)c=32;for(var b=0;b<c;b++)e=oK(e,d.data[b]);break}return e}function aLd(b,c){c[0]=4;return b.read32s()}function aLB(b,c){switch(b.read8u()){case 1:c[0]=4;return b.read32s();case 2:cr("input_value: native integer value too large");default:cr("input_value: ill-formed native integer")}}function aLm(d,e){var c=new Array(8);for(var b=0;b<8;b++)c[b]=d.read8u();e[0]=8;return h$(c)}function aLk(f,e,c){var d=ia(e);for(var b=0;b<8;b++)f.write(8,d[b]);c[0]=8;c[1]=8}function aLe(b,c,d){return b.compare(c)}function aLh(b){return b.lo32()^b.hi32()}var h_={"_j":{deserialize:aLm,serialize:aLk,fixed_length:8,compare:aLe,hash:aLh},"_i":{deserialize:aLd,fixed_length:4},"_n":{deserialize:aLB,fixed_length:4},"_bigarray":{deserialize:function(b,c){return xn(b,c,"_bigarray")},serialize:xq,compare:xl,hash:xp},"_bigarr02":{deserialize:function(b,c){return xn(b,c,ka)},serialize:xq,compare:xl,hash:xp}};function oF(b){return h_[b.caml_custom]&&h_[b.caml_custom].compare}function xu(a,d,e,f){var c=oF(d);if(c){var b=e>0?c(d,a,f):c(a,d,f);if(f&&b!=b)return e;if(+b!=+b)return+b;if((b|0)!=0)return b|0}return e}function ic(b){return b instanceof dz}function kv(b){return ic(b)}function xv(b){if(typeof b==="number")return eA;else if(ic(b))return jP;else if(kv(b))return 1252;else if(b instanceof Array&&b[0]===b[0]>>>0&&b[0]<=eu){var c=b[0]|0;return c==jL?0:c}else if(b instanceof String)return s7;else if(typeof b=="string")return s7;else if(b instanceof Number)return eA;else if(b&&b.caml_custom)return nW;else if(b&&b.compare)return 1256;else if(typeof b=="function")return 1247;else if(typeof b=="symbol")return 1251;return 1001}function aq(b,c){if(b<c)return-1;if(b==c)return 0;return 1}function xs(b,c){b.t&6&&fA(b);c.t&6&&fA(c);return b.c<c.c?-1:b.c>c.c?1:0}function ae(b,c){return xs(b,c)}function gv(b,c,e){var f=[];for(;;){if(!(e&&b===c)){var a=xv(b);if(a==cQ){b=b[1];continue}var g=xv(c);if(g==cQ){c=c[1];continue}if(a!==g){if(a==eA){if(g==nW)return xu(b,c,-1,e);return-1}if(g==eA){if(a==nW)return xu(c,b,1,e);return 1}return a<g?-1:1}switch(a){case 247:bl(nH);break;case 248:var d=aq(b[2],c[2]);if(d!=0)return d|0;break;case 249:bl(nH);break;case 250:bl("equal: got Forward_tag, should not happen");break;case 251:bl("equal: abstract value");break;case 252:if(b!==c){var d=xs(b,c);if(d!=0)return d|0}break;case 253:bl("equal: got Double_tag, should not happen");break;case 254:bl("equal: got Double_array_tag, should not happen");break;case 255:bl("equal: got Custom_tag, should not happen");break;case 1247:bl(nH);break;case 1255:var i=oF(b);if(i!=oF(c))return b.caml_custom<c.caml_custom?-1:1;if(!i)bl("compare: abstract value");var d=i(b,c,e);if(d!=d)return e?-1:d;if(d!==(d|0))return-1;if(d!=0)return d|0;break;case 1256:var d=b.compare(c,e);if(d!=d)return e?-1:d;if(d!==(d|0))return-1;if(d!=0)return d|0;break;case 1000:b=+b;c=+c;if(b<c)return-1;if(b>c)return 1;if(b!=c){if(!e)return NaN;if(b==b)return 1;if(c==c)return-1}break;case 1001:if(b<c)return-1;if(b>c)return 1;if(b!=c){if(!e)return NaN;if(b==b)return 1;if(c==c)return-1}break;case 1251:if(b!==c){if(!e)return NaN;return 1}break;case 1252:var b=dc(b),c=dc(c);if(b!==c){if(b<c)return-1;if(b>c)return 1}break;case 12520:var b=b.toString(),c=c.toString();if(b!==c){if(b<c)return-1;if(b>c)return 1}break;case 246:case 254:default:if(b.length!=c.length)return b.length<c.length?-1:1;if(b.length>1)f.push(b,c,1);break}}if(f.length==0)return 0;var h=f.pop();c=f.pop();b=f.pop();if(h+1<b.length)f.push(b,c,h+1);b=b[h];c=c[h]}}function bW(b,c){return gv(b,c,true)}function aK2(){return[0]}function aK3(b){return Math.cosh(b)}function aN(b){if(b<0)bl("Bytes.create");return new dz(b?2:9,p,b)}function oG(c,b){if(b==0)kw();return c/b|0}function aT(b,c){return+(gv(b,c,false)==0)}function aK5(b,d,c,e){if(c>0)if(d==0&&(c>=b.l||b.t==2&&c>=b.c.length))if(e==0){b.c=p;b.t=2}else{b.c=gy(c,String.fromCharCode(e));b.t=c==b.l?0:2}else{if(b.t!=4)ko(b);for(c+=d;d<c;d++)b.c[d]=e}return 0}function oI(b,c){if(b===c)return 0;if(b<c)return-1;if(b>c)return 1;if(b===b)return 1;if(c===c)return-1;return 0}function kp(b){var c;b=dc(b);c=+b;if(b.length>0&&c===c)return c;b=b.replace(/_/g,p);c=+b;if(b.length>0&&c===c||/^[+-]?nan$/i.test(b))return c;var d=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(b);if(d){var e=d[3].replace(/0+$/,p),a=parseInt(d[1]+d[2]+e,16),f=(d[5]|0)-4*e.length;c=a*Math.pow(2,f);return c}if(/^\+?inf(inity)?$/i.test(b))return Infinity;if(/^-inf(inity)?$/i.test(b))return-Infinity;cr("float_of_string")}function oV(e){e=dc(e);var f=e.length;if(f>31)bl("format_int: format too long");var b={justify:a6,signstyle:bb,filler:A,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:vD};for(var d=0;d<f;d++){var c=e.charAt(d);switch(c){case"-":b.justify=bb;break;case"+":case" ":b.signstyle=c;break;case"0":b.filler=a5;break;case"#":b.alternate=true;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":b.width=0;while(c=e.charCodeAt(d)-48,c>=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=e.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function oH(c,a){if(c.uppercase)a=a.toUpperCase();var f=a.length;if(c.signedconv&&(c.sign<0||c.signstyle!=bb))f++;if(c.alternate){if(c.base==8)f+=1;if(c.base==16)f+=2}var d=p;if(c.justify==a6&&c.filler==A)for(var e=f;e<c.width;e++)d+=A;if(c.signedconv)if(c.sign<0)d+=bb;else if(c.signstyle!=bb)d+=c.signstyle;if(c.alternate&&c.base==8)d+=a5;if(c.alternate&&c.base==16)d+=c.uppercase?"0X":nh;if(c.justify==a6&&c.filler==a5)for(var e=f;e<c.width;e++)d+=a5;d+=a;if(c.justify==bb)for(var e=f;e<c.width;e++)d+=A;return b(d)}function oJ(i,d){function j(b,c){if(Math.abs(b)<1.0)return b.toFixed(c);else{var d=parseInt(b.toString().split(a6)[1]);if(d>20){d-=20;b/=Math.pow(10,d);b+=new Array(d+1).join(a5);if(c>0)b=b+aL+new Array(c+1).join(a5);return b}else return b.toFixed(c)}}var b,f=oV(i),e=f.prec<0?6:f.prec;if(d<0||d==0&&1/d==-Infinity){f.sign=-1;d=-d}if(isNaN(d)){b=nD;f.filler=A}else if(!isFinite(d)){b="inf";f.filler=A}else switch(f.conv){case"e":var b=d.toExponential(e),c=b.length;if(b.charAt(c-3)==oB)b=b.slice(0,c-1)+a5+b.slice(c-1);break;case"f":b=j(d,e);break;case"g":e=e?e:1;b=d.toExponential(e-1);var h=b.indexOf(oB),g=+b.slice(h+1);if(g<-4||d>=1e21||d.toFixed(0).length>e){var c=h-1;while(b.charAt(c)==a5)c--;if(b.charAt(c)==aL)c--;b=b.slice(0,c+1)+b.slice(h);c=b.length;if(b.charAt(c-3)==oB)b=b.slice(0,c-1)+a5+b.slice(c-1);break}else{var a=e;if(g<0){a-=g+1;b=d.toFixed(a)}else while(b=d.toFixed(a),b.length>e+1)a--;if(a){var c=b.length-1;while(b.charAt(c)==a5)c--;if(b.charAt(c)==aL)c--;b=b.slice(0,c+1)}}break}return oH(f,b)}function kq(f,d){if(dc(f)==eE)return b(p+d);var c=oV(f);if(d<0)if(c.signedconv){c.sign=-1;d=-d}else d>>>=0;var e=d.toString(c.base);if(c.prec>=0){c.filler=A;var a=c.prec-e.length;if(a>0)e=gy(a,a5)+e}return oH(c,e)}var aLE=0;function cV(){return aLE++}function dB(b){return b.toUtf16()}function ig(){return typeof af.process!=="undefined"&&typeof af.process.versions!=="undefined"&&typeof af.process.versions.node!=="undefined"}function aL1(){function b(b){if(b.charAt(0)===bO)return[p,b.substring(1)];return}function c(d){var g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=g.exec(d),c=b[1]||p,f=Boolean(c&&c.charAt(1)!==cB);if(Boolean(b[2]||f)){var e=b[1]||p,a=b[2]||p;return[e,d.substring(e.length+a.length)]}return}return ig()&&af.process&&af.process.platform?af.process.platform===sM?c:b:b}var o0=aL1();function xO(b){return b.slice(-1)!==bO?b+bO:b}if(ig()&&af.process&&af.process.cwd)var gw=af.process.cwd().replace(/\\/g,bO);else var gw="/static";gw=xO(gw);function aLs(b){b=dB(b);if(!o0(b))b=gw+b;var f=o0(b),e=f[1].split(bO),c=[];for(var d=0;d<e.length;d++)switch(e[d]){case"..":if(c.length>1)c.pop();break;case".":break;case"":break;default:c.push(e[d]);break}c.unshift(f[0]);c.orig=b;return c}function aLY(f){for(var a=p,c=a,b,h,d=0,g=f.length;d<g;d++){b=f.charCodeAt(d);if(b<cS){for(var e=d+1;e<g&&(b=f.charCodeAt(e))<cS;e++);if(e-d>hR){c.substr(0,1);a+=c;c=p;a+=f.slice(d,e)}else c+=f.slice(d,e);if(e==g)break;d=e}if(b<tz){c+=String.fromCharCode(0xc0|b>>6);c+=String.fromCharCode(cS|b&es)}else if(b<0xd800||b>=wy)c+=String.fromCharCode(sY|b>>12,cS|b>>6&es,cS|b&es);else if(b>=0xdbff||d+1==g||(h=f.charCodeAt(d+1))<t6||h>wy)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+h-0x35fdc00;c+=String.fromCharCode(vT|b>>18,cS|b>>12&es,cS|b>>6&es,cS|b&es)}if(c.length>fj){c.substr(0,1);a+=c;c=p}}return a+c}function aK1(b){var c=9;if(!xQ(b))c=8,b=aLY(b);return new dz(c,b,b.length)}function b8(b){return aK1(b)}var aL3=["E2BIG","EACCES","EAGAIN",nj,"EBUSY","ECHILD","EDEADLK","EDOM",sU,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",ov,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",oj,wX,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function d7(e,a,f,b){var c=aL3.indexOf(e);if(c<0){if(b==null)b=-9999;c=[0,b]}var d=[c,b8(a||p),b8(f||p)];return d}var xI={};function eK(b){return xI[b]}function d5(c,b){throw[0,c].concat(b)}function oE(b){if(!(b instanceof Uint8Array))b=new Uint8Array(b);return new dz(4,b,b.length)}function aj(b){oX(cH.Sys_error,b)}function xK(b){aj(b+j5)}function gA(b){if(b.t!=4)ko(b);return b.c}function bC(b){return b.l}function xj(){}function b6(b){this.data=b}b6.prototype=new xj();b6.prototype.constructor=b6;b6.prototype.truncate=function(b){var c=this.data;this.data=aN(b|0);d3(c,0,this.data,0,b)};b6.prototype.length=function(){return bC(this.data)};b6.prototype.write=function(c,e,g,b){var d=this.length();if(c+b>=d){var f=aN(c+b),a=this.data;this.data=f;d3(a,0,this.data,0,d)}d3(oE(e),g,this.data,c,b);return 0};b6.prototype.read=function(c,f,a,b){var d=this.length();if(c+b>=d)b=d-c;if(b){var e=aN(b|0);d3(this.data,c,e,0,b);f.set(gA(e),a)}return b};function fy(d,b,c){this.file=b;this.name=d;this.flags=c}fy.prototype.err_closed=function(){aj(this.name+tZ)};fy.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};fy.prototype.write=function(d,b,e,c){if(this.file)return this.file.write(d,b,e,c);this.err_closed()};fy.prototype.read=function(d,b,e,c){if(this.file)return this.file.read(d,b,e,c);this.err_closed()};fy.prototype.close=function(){this.file=undefined};function bQ(c,b){this.content={};this.root=c;this.lookupFun=b}bQ.prototype.nm=function(b){return this.root+b};bQ.prototype.create_dir_if_needed=function(e){var d=e.split(bO),c=p;for(var b=0;b<d.length-1;b++){c+=d[b]+bO;if(this.content[c])continue;this.content[c]=Symbol("directory")}};bQ.prototype.slash=function(b){return/\/$/.test(b)?b:b+bO};bQ.prototype.lookup=function(c){if(!this.content[c]&&this.lookupFun){var d=this.lookupFun(b(this.root),b(c));if(d!==0){this.create_dir_if_needed(c);this.content[c]=new b6(b7(d[1]))}}};bQ.prototype.exists=function(b){if(b==p)return 1;var c=this.slash(b);if(this.content[c])return 1;this.lookup(b);return this.content[b]?1:0};bQ.prototype.mkdir=function(d,f,e){var c=e&&eK(kg);if(this.exists(d))if(c)d5(c,d7(sU,nf,this.nm(d)));else aj(d+": File exists");var b=/^(.*)\/[^/]+/.exec(d);b=b&&b[1]||p;if(!this.exists(b))if(c)d5(c,d7(ov,nf,this.nm(b)));else aj(b+j5);if(!this.is_dir(b))if(c)d5(c,d7(oj,nf,this.nm(b)));else aj(b+n$);this.create_dir_if_needed(this.slash(d))};bQ.prototype.rmdir=function(b,a){var c=a&&eK(kg),d=b==p?p:this.slash(b),f=new RegExp(hS+d+tw);if(!this.exists(b))if(c)d5(c,d7(ov,nK,this.nm(b)));else aj(b+j5);if(!this.is_dir(b))if(c)d5(c,d7(oj,nK,this.nm(b)));else aj(b+n$);for(var e in this.content)if(e.match(f))if(c)d5(c,d7(wX,nK,this.nm(b)));else aj(this.nm(b)+": Directory not empty");delete this.content[d]};bQ.prototype.readdir=function(b){var a=b==p?p:this.slash(b);if(!this.exists(b))aj(b+j5);if(!this.is_dir(b))aj(b+n$);var g=new RegExp(hS+a+tw),e={},d=[];for(var f in this.content){var c=f.match(g);if(c&&!e[c[1]]){e[c[1]]=true;d.push(c[1])}}return d};bQ.prototype.opendir=function(b,a){var c=a&&eK(kg),d=this.readdir(b),e=false,f=0;return{readSync:function(){if(e)if(c)d5(c,d7(nj,tE,this.nm(b)));else aj(b+v0);if(f==d.length)return null;var a=d[f];f++;return{name:a}},closeSync:function(){if(e)if(c)d5(c,d7(nj,tE,this.nm(b)));else aj(b+v0);e=true;d=[]}}};bQ.prototype.is_dir=function(b){if(b==p)return true;var c=this.slash(b);return this.content[c]?1:0};bQ.prototype.unlink=function(b){var c=this.content[b]?true:false;delete this.content[b];return c};bQ.prototype.open=function(b,c){var d;if(c.rdonly&&c.wronly)aj(this.nm(b)+no);if(c.text&&c.binary)aj(this.nm(b)+n1);this.lookup(b);if(this.content[b]){if(this.is_dir(b))aj(this.nm(b)+s0);if(c.create&&c.excl)aj(this.nm(b)+nn);d=this.content[b];if(c.truncate)d.truncate()}else if(c.create){this.create_dir_if_needed(b);this.content[b]=new b6(aN(0));d=this.content[b]}else xK(this.nm(b));return new fy(this.nm(b),d,c)};bQ.prototype.open=function(b,c){var d;if(c.rdonly&&c.wronly)aj(this.nm(b)+no);if(c.text&&c.binary)aj(this.nm(b)+n1);this.lookup(b);if(this.content[b]){if(this.is_dir(b))aj(this.nm(b)+s0);if(c.create&&c.excl)aj(this.nm(b)+nn);d=this.content[b];if(c.truncate)d.truncate()}else if(c.create){this.create_dir_if_needed(b);this.content[b]=new b6(aN(0));d=this.content[b]}else xK(this.nm(b));return new fy(this.nm(b),d,c)};bQ.prototype.register=function(d,b){var c;if(this.content[d])aj(this.nm(d)+nn);if(ic(b))c=new b6(b);if(kv(b))c=new b6(b7(b));else if(b instanceof Array)c=new b6(oE(b));else if(typeof b==="string")c=new b6(xt(b));else if(b.toString){var e=b7(b8(b.toString()));c=new b6(e)}if(c){this.create_dir_if_needed(d);this.content[d]=c}else aj(this.nm(d)+" : registering file with invalid content type")};bQ.prototype.constructor=bQ;function v(b){return bC(b)}function cs(c,b){return fz(c,b)}function aLW(e){var d=v(e),c=new Array(d),b=0;for(;b<d;b++)c[b]=cs(e,b);return c}function db(b,c){this.fs=require("fs");this.fd=b;this.flags=c}db.prototype=new xj();db.prototype.constructor=db;db.prototype.truncate=function(b){try{this.fs.ftruncateSync(this.fd,b|0)}catch(b){aj(b.toString())}};db.prototype.length=function(){try{return this.fs.fstatSync(this.fd).size}catch(b){aj(b.toString())}};db.prototype.write=function(e,b,c,d){try{if(this.flags.isCharacterDevice)this.fs.writeSync(this.fd,b,c,d);else this.fs.writeSync(this.fd,b,c,d,e)}catch(b){aj(b.toString())}return 0};db.prototype.read=function(f,b,c,d){try{if(this.flags.isCharacterDevice)var e=this.fs.readSync(this.fd,b,c,d);else var e=this.fs.readSync(this.fd,b,c,d,f);return e}catch(b){aj(b.toString())}};db.prototype.close=function(){try{this.fs.closeSync(this.fd);return 0}catch(b){aj(b.toString())}};function bs(b){this.fs=require("fs");this.root=b}bs.prototype.nm=function(b){return this.root+b};bs.prototype.exists=function(b){try{return this.fs.existsSync(this.nm(b))?1:0}catch(a){return 0}};bs.prototype.mkdir=function(c,b,d){try{this.fs.mkdirSync(this.nm(c),{mode:b});return 0}catch(b){this.raise_nodejs_error(b,d)}};bs.prototype.rmdir=function(b,c){try{this.fs.rmdirSync(this.nm(b));return 0}catch(b){this.raise_nodejs_error(b,c)}};bs.prototype.readdir=function(b,c){try{return this.fs.readdirSync(this.nm(b))}catch(b){this.raise_nodejs_error(b,c)}};bs.prototype.is_dir=function(b){try{return this.fs.statSync(this.nm(b)).isDirectory()?1:0}catch(b){aj(b.toString())}};bs.prototype.unlink=function(b,d){try{var c=this.fs.existsSync(this.nm(b))?1:0;this.fs.unlinkSync(this.nm(b));return c}catch(b){this.raise_nodejs_error(b,d)}};bs.prototype.open=function(e,d,h){var b=require("constants"),c=0;for(var g in d)switch(g){case"rdonly":c|=b.O_RDONLY;break;case"wronly":c|=b.O_WRONLY;break;case"append":c|=b.O_WRONLY|b.O_APPEND;break;case"create":c|=b.O_CREAT;break;case"truncate":c|=b.O_TRUNC;break;case"excl":c|=b.O_EXCL;break;case"binary":c|=b.O_BINARY;break;case"text":c|=b.O_TEXT;break;case"nonblock":c|=b.O_NONBLOCK;break}try{var f=this.fs.openSync(this.nm(e),c),a=this.fs.lstatSync(this.nm(e)).isCharacterDevice();d.isCharacterDevice=a;return new db(f,d)}catch(b){this.raise_nodejs_error(b,h)}};bs.prototype.rename=function(c,b,d){try{this.fs.renameSync(this.nm(c),this.nm(b))}catch(b){this.raise_nodejs_error(b,d)}};bs.prototype.stat=function(c,d){try{var b=this.fs.statSync(this.nm(c));return this.stats_from_js(b)}catch(b){this.raise_nodejs_error(b,d)}};bs.prototype.lstat=function(c,d){try{var b=this.fs.lstatSync(this.nm(c));return this.stats_from_js(b)}catch(b){this.raise_nodejs_error(b,d)}};bs.prototype.symlink=function(e,d,b,c){try{this.fs.symlinkSync(this.nm(d),this.nm(b),e?"dir":n5);return 0}catch(b){this.raise_nodejs_error(b,c)}};bs.prototype.readlink=function(c,d){try{var b=this.fs.readlinkSync(this.nm(c),"utf8");return b8(b)}catch(b){this.raise_nodejs_error(b,d)}};bs.prototype.opendir=function(b,c){try{return this.fs.opendirSync(this.nm(b))}catch(b){this.raise_nodejs_error(b,c)}};bs.prototype.raise_nodejs_error=function(b,e){var c=eK(kg);if(e&&c){var d=d7(b.code,b.syscall,b.path,b.errno);d5(c,d)}else aj(b.toString())};bs.prototype.stats_from_js=function(b){var c;if(b.isFile())c=0;else if(b.isDirectory())c=1;else if(b.isCharacterDevice())c=2;else if(b.isBlockDevice())c=3;else if(b.isSymbolicLink())c=4;else if(b.isFIFO())c=5;else if(b.isSocket())c=6;return[0,b.dev,b.ino,c,b.mode,b.nlink,b.uid,b.gid,b.rdev,b.size,b.atimeMs,b.mtimeMs,b.ctimeMs]};bs.prototype.constructor=bs;function xy(c){var b=o0(c);if(!b)return;return b[0]+bO}var kx=xy(gw)||cr("unable to compute caml_root"),gB=[];if(ig())gB.push({path:kx,device:new bs(kx)});else gB.push({path:kx,device:new bQ(kx)});gB.push({path:uw,device:new bQ(uw)});function o1(c){var g=aLs(c),c=g.join(bO),a=xO(c),d;for(var f=0;f<gB.length;f++){var b=gB[f];if(a.search(b.path)==0&&(!d||d.path.length<b.path.length))d={path:b.path,device:b.device,rest:c.substring(b.path.length,c.length)}}if(!d&&ig()){var e=xy(c);if(e&&e.match(/^[a-zA-Z]:\/$/)){var b={path:e,device:new bs(e)};gB.push(b);d={path:b.path,device:b.device,rest:c.substring(b.path.length,c.length)}}}if(d)return d;aj("no device found for "+a)}function aK4(d,c){var b=o1(d);if(!b.device.register)cr("cannot register file");b.device.register(b.rest,c);return 0}function xP(d,c){var d=b(d),c=b(c);return aK4(d,c)}function aK7(){var c=af.caml_fs_tmp;if(c)for(var b=0;b<c.length;b++)xP(c[b].name,c[b].content);af.jsoo_create_file=xP;af.caml_fs_tmp=[];return 0}function xx(){return[0]}function aK8(b,c){return+(gv(b,c,false)>=0)}function oL(e,c){var f=c.length,b,d;for(b=0;b+4<=f;b+=4){d=c.charCodeAt(b)|c.charCodeAt(b+1)<<8|c.charCodeAt(b+2)<<16|c.charCodeAt(b+3)<<24;e=bX(e,d)}d=0;switch(f&3){case 3:d=c.charCodeAt(b+2)<<16;case 2:d|=c.charCodeAt(b+1)<<8;case 1:d|=c.charCodeAt(b);e=bX(e,d)}e^=f;return e}function aLb(b,c){return oL(b,dc(c))}function aK_(e,c){var f=c.length,b,d;for(b=0;b+4<=f;b+=4){d=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24;e=bX(e,d)}d=0;switch(f&3){case 3:d=c[b+2]<<16;case 2:d|=c[b+1]<<8;case 1:d|=c[b];e=bX(e,d)}e^=f;return e}function aLv(b){switch(b.t&6){default:fA(b);case 0:return b.c;case 4:return b.c}}function aK9(c,d){var b=aLv(d);return typeof b==="string"?oL(c,b):aK_(c,b)}function aK$(b){b^=b>>>16;b=eJ(b,0x85ebca6b|0);b^=b>>>13;b=eJ(b,0xc2b2ae35|0);b^=b>>>16;return b}function xz(j,l,n,m){var a,g,h,e,d,c,b,f,i;e=l;if(e<0||e>da)e=da;d=j;c=n;a=[m];g=0;h=1;while(g<h&&d>0){b=a[g++];if(b&&b.caml_custom){if(h_[b.caml_custom]&&h_[b.caml_custom].hash){var k=h_[b.caml_custom].hash(b);c=bX(c,k);d--}}else if(b instanceof Array&&b[0]===(b[0]|0))switch(b[0]){case 248:c=bX(c,b[2]);d--;break;case 250:a[--g]=b[1];break;default:var o=b.length-1<<10|b[0];c=bX(c,o);for(f=1,i=b.length;f<i;f++){if(h>=e)break;a[h++]=b[f]}break}else if(ic(b)){c=aK9(c,b);d--}else if(kv(b)){c=aLb(c,b);d--}else if(typeof b==="string"){c=oL(c,b);d--}else if(b===(b|0)){c=bX(c,b+b+1);d--}else if(b===+b){c=oK(c,b);d--}}c=aK$(c);return c&0x3FFFFFFF}function aLc(b,d,k){if(!isFinite(b)){if(isNaN(b))return b8(nD);return b8(b>0?w9:"-infinity")}var i=b==0&&1/b==-Infinity?1:b>=0?0:1;if(i)b=-b;var e=0;if(b==0);else if(b<1)while(b<1&&e>-1022){b*=2;e--}else while(b>=2){b/=2;e++}var j=e<0?p:a6,f=p;if(i)f=bb;else switch(k){case 43:f=a6;break;case 32:f=A;break;default:break}if(d>=0&&d<13){var g=Math.pow(2,d*4);b=Math.round(b*g)/g}var c=b.toString(16);if(d>=0){var h=c.indexOf(aL);if(h<0)c+=aL+gy(d,a5);else{var a=h+1+d;if(c.length<a)c+=gy(a-c.length,a5);else c=c.substr(0,a)}}return b8(f+nh+c+"p"+j+e.toString(10))}function kr(b,c){return b.and(c)}function aLj(b){return+b.isZero()}function eI(b){return new X(b&dX,b>>24&dX,b>>31&dv)}function ib(b){return b.toInt()}function aLi(b){return+b.isNeg()}function aLl(b){return b.neg()}function aLg(g,d){var b=oV(g);if(b.signedconv&&aLi(d)){b.sign=-1;d=aLl(d)}var c=p,h=eI(b.base),a="0123456789abcdef";do{var f=d.udivmod(h);d=f.quotient;c=a.charAt(ib(f.modulus))+c}while(!aLj(d));if(b.prec>=0){b.filler=A;var e=b.prec-c.length;if(e>0)c=gy(e,a5)+c}return oH(b,c)}function xB(b,c){return b.or(c)}function gx(c,b){return c.shift_left(b)}function ku(c,b){return c.shift_right(b)}function aLF(d){var b=0,f=v(d),c=10,e=1;if(f>0)switch(cs(d,b)){case 45:b++;e=-1;break;case 43:b++;e=1;break}if(b+1<f&&cs(d,b)==48)switch(cs(d,b+1)){case 120:case 88:c=16;b+=2;break;case 111:case 79:c=8;b+=2;break;case 98:case 66:c=2;b+=2;break;case 117:case 85:b+=2;break}return[b,e,c]}function xJ(b){if(b>=48&&b<=57)return b-48;if(b>=65&&b<=90)return b-55;if(b>=97&&b<=122)return b-87;return-1}function fB(a){var h=aLF(a),d=h[0],i=h[1],e=h[2],g=v(a),j=-1>>>0,f=d<g?cs(a,d):0,c=xJ(f);if(c<0||c>=e)cr(jV);var b=c;for(d++;d<g;d++){f=cs(a,d);if(f==95)continue;c=xJ(f);if(c<0||c>=e)break;b=e*b+c;if(b>j)cr(jV)}if(d!=g)cr(jV);b=i*b;if(e==10&&(b|0)!=b)cr(jV);return b|0}function aLo(b,c){return+(gv(b,c,false)<=0)}function xC(b,c){return+(gv(b,c,false)<0)}function ce(c){c=dc(c);var e=c.length/2,d=new Array(e);for(var b=0;b<e;b++)d[b]=(c.charCodeAt(2*b)|c.charCodeAt(2*b+1)<<8)<<16>>16;return d}function aLp(c,t,b){var n=2,o=3,r=5,e=6,h=7,g=8,j=9,m=1,l=2,q=3,s=4,p=5;if(!c.lex_default){c.lex_base=ce(c[m]);c.lex_backtrk=ce(c[l]);c.lex_check=ce(c[p]);c.lex_trans=ce(c[s]);c.lex_default=ce(c[q])}var f,d=t,k=gA(b[n]);if(d>=0){b[h]=b[r]=b[e];b[g]=-1}else d=-d-1;for(;;){var a=c.lex_base[d];if(a<0)return-a-1;var i=c.lex_backtrk[d];if(i>=0){b[h]=b[e];b[g]=i}if(b[e]>=b[o])if(b[j]==0)return-d-1;else f=da;else{f=k[b[e]];b[e]++}if(c.lex_check[a+f]==d)d=c.lex_trans[a+f];else d=c.lex_default[d];if(d<0){b[e]=b[h];if(b[g]==-1)cr(tY);else return b[g]}else if(f==da)b[j]=0}}function id(d){var c=0;for(var b=d.length-1;b>=0;b--){var e=d[b];c=[0,e,c]}return c}function aLr(b){return Math.log10(b)}function d