// Generated by js_of_ocaml
//# buildInfo:effects=disabled, kind=unknown, use-js-string=true, version=6.3.2
//# 7 ".sx_browser.eobjs/jsoo/sx_browser.bc.runtime.js"
(function
  (Object){
   typeof globalThis !== "object"
   &&
    (this
      ? get()
      : (Object.defineProperty
         (Object.prototype, "_T_", {configurable: true, get: get}),
        _T_));
   function get(){
    var global = this || self;
    global.globalThis = global;
    delete Object.prototype._T_;
   }
  }
  (Object));
(function(globalThis){
   "use strict";
   function caml_string_of_jsbytes(x){return x;}
   class JsStringReader{
     constructor(s, i){this.s = s; this.i = i;}
     read8u(){return this.s.charCodeAt(this.i++);}
     read8s(){return this.s.charCodeAt(this.i++) << 24 >> 24;}
     read16u(){
      var s = this.s, i = this.i;
      this.i = i + 2;
      return s.charCodeAt(i) << 8 | s.charCodeAt(i + 1);
     }
     read16s(){
      var s = this.s, i = this.i;
      this.i = i + 2;
      return s.charCodeAt(i) << 24 >> 16 | s.charCodeAt(i + 1);
     }
     read32u(){
      var s = this.s, i = this.i;
      this.i = i + 4;
      return (s.charCodeAt(i) << 24 | s.charCodeAt(i + 1) << 16
             | s.charCodeAt(i + 2) << 8
             | s.charCodeAt(i + 3))
             >>> 0;
     }
     read32s(){
      var s = this.s, i = this.i;
      this.i = i + 4;
      return s.charCodeAt(i) << 24 | s.charCodeAt(i + 1) << 16
             | s.charCodeAt(i + 2) << 8
             | s.charCodeAt(i + 3);
     }
     readstr(len){
      var i = this.i;
      this.i = i + len;
      return caml_string_of_jsbytes(this.s.slice(i, i + len));
     }
     readuint8array(len){
      var b = new Uint8Array(len), s = this.s, i = this.i;
      for(var j = 0; j < len; j++) b[j] = s.charCodeAt(i + j);
      this.i = i + len;
      return b;
     }
   }
   var jsoo_text_decoder = new TextDecoder();
   function caml_convert_bytes_to_array(s){
    var a = new Uint8Array(s.l), b = s.c, l = b.length, i = 0;
    for(; i < l; i++) a[i] = b.charCodeAt(i);
    for(l = s.l; i < l; i++) a[i] = 0;
    s.c = a;
    s.t = 4;
    return a;
   }
   function caml_uint8_array_of_bytes(s){
    if(s.t !== 4) caml_convert_bytes_to_array(s);
    return s.c;
   }
   function caml_str_repeat(n, s){return s.repeat(n);}
   function caml_sub_uint8_array_to_jsbytes(a, i, len){
    var f = String.fromCharCode;
    if(i === 0 && len <= 4096 && len === a.length) return f.apply(null, a);
    var s = "";
    for(; 0 < len; i += 1024, len -= 1024)
     s += f.apply(null, a.subarray(i, i + Math.min(len, 1024)));
    return s;
   }
   function caml_convert_string_to_bytes(s){
    if(s.t === 2)
     s.c += caml_str_repeat(s.l - s.c.length, "\0");
    else
     s.c = caml_sub_uint8_array_to_jsbytes(s.c, 0, s.c.length);
    s.t = 0;
   }
   function jsoo_is_ascii(s){
    if(s.length < 24){
     for(var i = 0; i < s.length; i++) if(s.charCodeAt(i) > 127) return false;
     return true;
    }
    else
     return ! /[^\x00-\x7f]/.test(s);
   }
   class MlBytes{
     constructor(tag, contents, length){
      this.t = tag;
      this.c = contents;
      this.l = length;
     }
     toString(){
      switch(this.t){
        case 9:
        case 8:
         return this.c;
        case 4:
        case 2:
         caml_convert_string_to_bytes(this);
        case 0:
         if(jsoo_is_ascii(this.c)) this.t = 9; else this.t = 8; return this.c;
      }
     }
     toUtf16(){
      if(this.t === 9) return this.c;
      var a = caml_uint8_array_of_bytes(this);
      return jsoo_text_decoder.decode(a);
     }
     slice(){
      var content = this.t === 4 ? this.c.slice() : this.c;
      return new MlBytes(this.t, content, this.l);
     }
   }
   function MlChanid(id){this.id = id;}
   var jsoo_static_env = {};
   function jsoo_sys_getenv(n){
    if(jsoo_static_env[n]) return jsoo_static_env[n];
    var process = globalThis.process;
    if(process && process.env && process.env[n] !== undefined)
     return process.env[n];
    if(globalThis.jsoo_env && typeof globalThis.jsoo_env[n] === "string")
     return globalThis.jsoo_env[n];
   }
   var caml_record_backtrace_env_flag = 0;
   (function(){
      var r = jsoo_sys_getenv("OCAMLRUNPARAM");
      if(r !== undefined){
       var l = r.split(",");
       for(var i = 0; i < l.length; i++)
        if(l[i] === "b"){
         caml_record_backtrace_env_flag = 1;
         break;
        }
        else if(l[i].startsWith("b="))
         caml_record_backtrace_env_flag = + l[i].slice(2);
        else
         continue;
      }
     }
     ());
   var
    caml_record_backtrace_runtime_flag = caml_record_backtrace_env_flag,
    caml_global_data = [0];
   function caml_exn_with_js_backtrace(exn, force){
    if(! exn.js_error || force || exn[0] === 248)
     exn.js_error = new globalThis.Error("Js exception containing backtrace");
    return exn;
   }
   function caml_maybe_attach_backtrace(exn, force){
    return caml_record_backtrace_env_flag
            && caml_record_backtrace_runtime_flag
            ? caml_exn_with_js_backtrace(exn, force)
            : exn;
   }
   function caml_raise_with_arg(tag, arg){
    throw caml_maybe_attach_backtrace([0, tag, arg]);
   }
   var jsoo_text_encoder = new TextEncoder();
   function caml_subarray_to_jsbytes(a, i, len){
    var f = String.fromCharCode;
    if(i === 0 && len <= 4096 && len === a.length) return f.apply(null, a);
    var s = "";
    for(; 0 < len; i += 1024, len -= 1024)
     s += f.apply(null, a.slice(i, i + Math.min(len, 1024)));
    return s;
   }
   function caml_string_of_array(a){
    return caml_string_of_jsbytes(caml_subarray_to_jsbytes(a, 0, a.length));
   }
   function caml_string_of_jsstring(s){
    if(jsoo_is_ascii(s)) return caml_string_of_jsbytes(s);
    var a = jsoo_text_encoder.encode(s);
    return caml_string_of_array(a);
   }
   function caml_raise_sys_error(msg){
    caml_raise_with_arg
     (caml_global_data.Sys_error, caml_string_of_jsstring(msg));
   }
   function caml_raise_with_args(tag, args){
    throw caml_maybe_attach_backtrace([0, tag].concat(args));
   }
   var
    unix_error =
      ["E2BIG",
       "EACCES",
       "EAGAIN",
       "EBADF",
       "EBUSY",
       "ECHILD",
       "EDEADLK",
       "EDOM",
       "EEXIST",
       "EFAULT",
       "EFBIG",
       "EINTR",
       "EINVAL",
       "EIO",
       "EISDIR",
       "EMFILE",
       "EMLINK",
       "ENAMETOOLONG",
       "ENFILE",
       "ENODEV",
       "ENOENT",
       "ENOEXEC",
       "ENOLCK",
       "ENOMEM",
       "ENOSPC",
       "ENOSYS",
       "ENOTDIR",
       "ENOTEMPTY",
       "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 make_unix_err_args(code, syscall, path, errno){
    var variant = unix_error.indexOf(code);
    if(variant < 0){if(errno == null) errno = - 9999; variant = [0, - errno];}
    var
     args =
       [variant,
        caml_string_of_jsstring(syscall || ""),
        caml_string_of_jsstring(path || "")];
    return args;
   }
   var caml_named_values = {};
   function caml_named_value(nm){return caml_named_values[nm];}
   function caml_raise_system_error(raise_unix, code, cmd, msg, path){
    var unix_error = caml_named_value("Unix.Unix_error");
    if(raise_unix && unix_error)
     caml_raise_with_args(unix_error, make_unix_err_args(code, cmd, path));
    else{
     var msg = code + ": " + msg + ", " + cmd;
     if(path !== undefined) msg += " '" + path + "'";
     caml_raise_sys_error(msg);
    }
   }
   function caml_is_ml_bytes(s){return s instanceof MlBytes;}
   function caml_is_ml_string(s){
    return typeof s === "string" && ! /[^\x00-\xff]/.test(s);
   }
   function caml_bytes_of_array(a){
    if(! (a instanceof Uint8Array)) a = new Uint8Array(a);
    return new MlBytes(4, a, a.length);
   }
   function caml_bytes_of_jsbytes(s){return new MlBytes(0, s, s.length);}
   function caml_jsbytes_of_string(x){return x;}
   function caml_bytes_of_string(s){
    return caml_bytes_of_jsbytes(caml_jsbytes_of_string(s));
   }
   function caml_raise_no_such_file(name, raise_unix){
    caml_raise_system_error
     (raise_unix, "ENOENT", "no such file or directory", name);
   }
   function caml_bytes_of_uint8_array(a){return new MlBytes(4, a, a.length);}
   function caml_raise_with_string(tag, msg){
    caml_raise_with_arg(tag, caml_string_of_jsbytes(msg));
   }
   function caml_invalid_argument(msg){
    caml_raise_with_string(caml_global_data.Invalid_argument, msg);
   }
   function caml_create_bytes(len){
    if(len < 0) caml_invalid_argument("Bytes.create");
    return new MlBytes(len ? 2 : 9, "", len);
   }
   function caml_ml_bytes_length(s){return s.l;}
   function caml_blit_bytes(s1, i1, s2, i2, len){
    if(len === 0) return 0;
    if(i2 === 0 && (len >= s2.l || s2.t === 2 && len >= s2.c.length)){
     s2.c =
      s1.t === 4
       ? caml_sub_uint8_array_to_jsbytes(s1.c, i1, len)
       : i1 === 0 && s1.c.length === len ? s1.c : s1.c.slice(i1, i1 + len);
     s2.t = s2.c.length === s2.l ? 0 : 2;
    }
    else if(s2.t === 2 && i2 === s2.c.length){
     s2.c +=
      s1.t === 4
       ? caml_sub_uint8_array_to_jsbytes(s1.c, i1, len)
       : i1 === 0 && s1.c.length === len ? s1.c : s1.c.slice(i1, i1 + len);
     s2.t = s2.c.length === s2.l ? 0 : 2;
    }
    else{
     if(s2.t !== 4) caml_convert_bytes_to_array(s2);
     var c1 = s1.c, c2 = s2.c;
     if(s1.t === 4)
      if(i2 <= i1)
       for(var i = 0; i < len; i++) c2[i2 + i] = c1[i1 + i];
      else
       for(var i = len - 1; i >= 0; i--) c2[i2 + i] = c1[i1 + i];
     else{
      var l = Math.min(len, c1.length - i1);
      for(var i = 0; i < l; i++) c2[i2 + i] = c1.charCodeAt(i1 + i);
      for(; i < len; i++) c2[i2 + i] = 0;
     }
    }
    return 0;
   }
   function MlFile(){}
   class MlFakeFile extends MlFile {
     constructor(content){super(); this.data = content;}
     truncate(len){
      var old = this.data, old_len = caml_ml_bytes_length(old);
      this.data = caml_create_bytes(len | 0);
      caml_blit_bytes(old, 0, this.data, 0, Math.min(len, old_len));
     }
     length(){return caml_ml_bytes_length(this.data);}
     write(offset, buf, pos, len){
      var clen = this.length();
      if(offset + len >= clen){
       var new_str = caml_create_bytes(offset + len), old_data = this.data;
       this.data = new_str;
       caml_blit_bytes(old_data, 0, this.data, 0, clen);
      }
      caml_blit_bytes
       (caml_bytes_of_uint8_array(buf), pos, this.data, offset, len);
      return len;
     }
     read(offset, buf, pos, len){
      var clen = this.length();
      if(offset + len >= clen) len = clen - offset;
      if(len > 0){
       var data = caml_create_bytes(len | 0);
       caml_blit_bytes(this.data, offset, data, 0, len);
       buf.set(caml_uint8_array_of_bytes(data), pos);
       return len;
      }
      return 0;
     }
   }
   class MlFakeFd{
     constructor(name, file, flags){
      this.file = file;
      this.name = name;
      this.flags = flags;
      this.offset = 0;
      this.seeked = false;
     }
     err_closed(cmd, raise_unix){
      caml_raise_system_error(raise_unix, "EBADF", cmd, "bad file descriptor");
     }
     length(){
      if(this.file) return this.file.length();
      this.err_closed("length");
     }
     truncate(len, raise_unix){
      if(this.file){
       if(! (this.flags.wronly || this.flags.rdwr))
        caml_raise_system_error
         (raise_unix, "EINVAL", "truncate", "invalid argument");
       return this.file.truncate(len);
      }
      this.err_closed("truncate", raise_unix);
     }
     write(buf, pos, len, raise_unix){
      if(this.file && (this.flags.wronly || this.flags.rdwr)){
       var offset = this.offset;
       len = this.file.write(offset, buf, pos, len);
       this.offset += len;
       return len;
      }
      this.err_closed("write", raise_unix);
     }
     read(buf, pos, len, raise_unix){
      if(this.file && ! this.flags.wronly){
       var offset = this.offset;
       len = this.file.read(offset, buf, pos, len);
       this.offset += len;
       return len;
      }
      this.err_closed("read", raise_unix);
     }
     seek(offset, whence, raise_unix){
      switch(whence){
        case 0: break;
        case 1:
         offset += this.offset; break;
        case 2:
         offset += this.length(); break;
      }
      if(offset < 0)
       caml_raise_system_error
        (raise_unix, "EINVAL", "lseek", "invalid argument");
      this.offset = offset;
      this.seeked = true;
      return offset;
     }
     pos(){return this.offset;}
     close(){if(! this.file) this.err_closed("close"); this.file = undefined;}
     check_stream_semantics(cmd){
      if(! this.file) return this.err_closed(cmd, 1);
     }
   }
   class MlFakeDevice{
     constructor(root, f){
      this.content = {};
      this.root = root;
      this.lookupFun = f;
     }
     nm(name){return this.root + name;}
     create_dir_if_needed(name){
      var comp = name.split("/"), res = "";
      for(var i = 0; i < comp.length - 1; i++){
       res += comp[i] + "/";
       if(this.content[res]) continue;
       this.content[res] = Symbol("directory");
      }
     }
     slash(name){return /\/$/.test(name) ? name : name + "/";}
     lookup(name){
      if(! this.content[name] && this.lookupFun){
       var
        res =
          this.lookupFun
           (caml_string_of_jsstring(this.root), caml_string_of_jsstring(name));
       if(res !== 0){
        this.create_dir_if_needed(name);
        this.content[name] = new MlFakeFile(caml_bytes_of_string(res[1]));
       }
      }
     }
     exists(name, do_not_lookup){
      if(name === "") return 1;
      var name_slash = this.slash(name);
      if(this.content[name_slash]) return 1;
      if(! do_not_lookup) this.lookup(name);
      return this.content[name] ? 1 : 0;
     }
     isFile(name){return this.exists(name) && ! this.is_dir(name) ? 1 : 0;}
     rename_dir(oldname, newname){
      if(this.exists(newname)){
       if(! this.is_dir(newname))
        caml_raise_sys_error
         (this.nm(newname) + " : file already exists and is not a directory");
       if(this.readdir(newname).length > 0)
        caml_raise_sys_error(this.nm(newname) + " : directory not empty");
      }
      var old_slash = this.slash(oldname), new_slash = this.slash(newname);
      this.create_dir_if_needed(new_slash);
      for(const f of this.readdir(oldname))
       this.rename(old_slash + f, new_slash + f);
      delete this.content[old_slash];
     }
     rename(oldname, newname){
      if(! this.exists(oldname))
       caml_raise_sys_error(this.nm(oldname) + " : no such file or directory");
      if(this.is_dir(oldname))
       this.rename_dir(oldname, newname);
      else{
       if(this.exists(newname) && this.is_dir(newname))
        caml_raise_sys_error
         (this.nm(newname) + " : file already exists and is a directory");
       this.content[newname] = this.content[oldname];
       delete this.content[oldname];
      }
     }
     mkdir(name, _mode, raise_unix){
      if(this.exists(name))
       caml_raise_system_error
        (raise_unix, "EEXIST", "mkdir", "file already exists", this.nm(name));
      var parent = /^(.*)\/[^/]+/.exec(name);
      parent = parent?.[1] || "";
      if(! this.exists(parent))
       caml_raise_system_error
        (raise_unix,
         "ENOENT",
         "mkdir",
         "no such file or directory",
         this.nm(name));
      if(! this.is_dir(parent))
       caml_raise_system_error
        (raise_unix, "ENOTDIR", "mkdir", "not a directory", this.nm(name));
      this.create_dir_if_needed(this.slash(name));
     }
     rmdir(name, raise_unix){
      var name_slash = name === "" ? "" : this.slash(name);
      if(! this.exists(name))
       caml_raise_system_error
        (raise_unix,
         "ENOENT",
         "rmdir",
         "no such file or directory",
         this.nm(name));
      if(! this.is_dir(name))
       caml_raise_system_error
        (raise_unix, "ENOTDIR", "rmdir", "not a directory", this.nm(name));
      for(var n in this.content)
       if(n.startsWith(name_slash) && n !== name_slash)
        caml_raise_system_error
         (raise_unix,
          "ENOTEMPTY",
          "rmdir",
          "directory not empty",
          this.nm(name));
      delete this.content[name_slash];
     }
     readdir(name){
      var name_slash = name === "" ? "" : this.slash(name);
      if(! this.exists(name))
       caml_raise_sys_error(name + ": No such file or directory");
      if(! this.is_dir(name))
       caml_raise_sys_error(name + ": Not a directory");
      var seen = {}, a = [];
      for(var n in this.content)
       if(n.startsWith(name_slash) && n !== name_slash){
        var last = n.indexOf("/", name_slash.length);
        if(last < 0) last = undefined;
        var m = n.slice(name_slash.length, last);
        if(m && ! seen[m]){seen[m] = true; a.push(m);}
       }
      return a;
     }
     opendir(name, raise_unix){
      var a = this.readdir(name), c = false, i = 0;
      return {readSync:
              function(){
               if(c)
                caml_raise_system_error
                 (raise_unix, "EBADF", "readdir", "bad file descriptor");
               if(i === a.length) return null;
               var entry = a[i];
               i++;
               return {name: entry};
              },
              closeSync:
              function(){
               if(c)
                caml_raise_system_error
                 (raise_unix, "EBADF", "readdir", "bad file descriptor");
               c = true;
               a = [];
              }};
     }
     is_dir(name){
      if(name === "") return true;
      var name_slash = this.slash(name);
      return this.content[name_slash] ? 1 : 0;
     }
     unlink(name, raise_unix){
      if(! this.exists(name, true))
       caml_raise_system_error
        (raise_unix, "ENOENT", "unlink", "no such file or directory", name);
      delete this.content[name];
      return 0;
     }
     access(name, _flags, raise_unix){
      this.lookup(name);
      if(this.content[name]){
       if(this.is_dir(name))
        caml_raise_system_error
         (raise_unix,
          "EACCESS",
          "access",
          "permission denied,",
          this.nm(name));
      }
      else
       caml_raise_no_such_file(this.nm(name), raise_unix);
      return 0;
     }
     open(name, f, _perms, raise_unix){
      var file;
      this.lookup(name);
      if(this.content[name]){
       if(this.is_dir(name))
        caml_raise_system_error
         (raise_unix,
          "EISDIR",
          "open",
          "illegal operation on a directory",
          this.nm(name));
       if(f.create && f.excl)
        caml_raise_system_error
         (raise_unix, "EEXIST", "open", "file already exists", this.nm(name));
       file = this.content[name];
       if(f.truncate) file.truncate(0);
      }
      else if(f.create){
       this.create_dir_if_needed(name);
       this.content[name] = new MlFakeFile(caml_create_bytes(0));
       file = this.content[name];
      }
      else
       caml_raise_no_such_file(this.nm(name), raise_unix);
      return new MlFakeFd(this.nm(name), file, f);
     }
     truncate(name, len, raise_unix){
      var file;
      this.lookup(name);
      if(this.content[name]){
       if(this.is_dir(name))
        caml_raise_system_error
         (raise_unix,
          "EISDIR",
          "open",
          "illegal operation on a directory",
          this.nm(name));
       file = this.content[name];
       file.truncate(len);
      }
      else
       caml_raise_no_such_file(this.nm(name), raise_unix);
     }
     register(name, content){
      var file;
      if(this.content[name])
       caml_raise_sys_error(this.nm(name) + " : file already exists");
      if(caml_is_ml_bytes(content)) file = new MlFakeFile(content);
      if(caml_is_ml_string(content))
       file = new MlFakeFile(caml_bytes_of_string(content));
      else if(Array.isArray(content))
       file = new MlFakeFile(caml_bytes_of_array(content));
      else if(typeof content === "string")
       file = new MlFakeFile(caml_bytes_of_jsbytes(content));
      else if(content.toString){
       var
        bytes =
          caml_bytes_of_string(caml_string_of_jsstring(content.toString()));
       file = new MlFakeFile(bytes);
      }
      if(file){
       this.create_dir_if_needed(name);
       this.content[name] = file;
      }
      else
       caml_raise_sys_error
        (this.nm(name) + " : registering file with invalid content type");
     }
   }
   class MlFakeFd_out extends MlFakeFile {
     constructor(fd, flags){
      super(caml_create_bytes(0));
      this.log = function(_s){return 0;};
      if(fd === 1 && typeof console.log === "function")
       this.log = console.log;
      else if(fd === 2 && typeof console.error === "function")
       this.log = console.error;
      else if(typeof console.log === "function") this.log = console.log;
      this.flags = flags;
     }
     length(){return 0;}
     truncate(_len, raise_unix){
      caml_raise_system_error
       (raise_unix, "EINVAL", "ftruncate", "invalid argument");
     }
     write(buf, pos, len, raise_unix){
      var written = len;
      if(this.log){
       if
        (len > 0 && pos >= 0 && pos + len <= buf.length
         && buf[pos + len - 1] === 10)
        len--;
       var src = caml_create_bytes(len);
       caml_blit_bytes(caml_bytes_of_uint8_array(buf), pos, src, 0, len);
       this.log(src.toUtf16());
       return written;
      }
      caml_raise_system_error
       (raise_unix, "EBADF", "write", "bad file descriptor");
     }
     read(_buf, _pos, _len, raise_unix){
      caml_raise_system_error
       (raise_unix, "EBADF", "read", "bad file descriptor");
     }
     seek(_len, _whence, raise_unix){
      caml_raise_system_error(raise_unix, "ESPIPE", "lseek", "illegal seek");
     }
     pos(){return - 1;}
     close(){this.log = undefined;}
     check_stream_semantics(_cmd){}
   }
   var caml_int64_offset = Math.pow(2, - 24);
   function caml_raise_constant(tag){throw tag;}
   function caml_raise_zero_divide(){
    caml_raise_constant(caml_global_data.Division_by_zero);
   }
   class MlInt64{
     constructor(lo, mi, hi){
      this.lo = lo & 0xffffff;
      this.mi = mi & 0xffffff;
      this.hi = hi & 0xffff;
      this.caml_custom = "_j";
     }
     static UNSIGNED_MAX = new MlInt64(0xffffff, 0xffffff, 0xffff);
     static SIGNED_MAX = new MlInt64(0xffffff, 0xffffff, 0x7fff);
     static SIGNED_MIN = new MlInt64(0x000000, 0x000000, 0x8000);
     slice(){return new MlInt64(this.lo, this.mi, this.hi);}
     ucompare(x){
      if(this.hi > x.hi) return 1;
      if(this.hi < x.hi) return - 1;
      if(this.mi > x.mi) return 1;
      if(this.mi < x.mi) return - 1;
      if(this.lo > x.lo) return 1;
      if(this.lo < x.lo) return - 1;
      return 0;
     }
     compare(x){
      var hi = this.hi << 16, xhi = x.hi << 16;
      if(hi > xhi) return 1;
      if(hi < xhi) return - 1;
      if(this.mi > x.mi) return 1;
      if(this.mi < x.mi) return - 1;
      if(this.lo > x.lo) return 1;
      if(this.lo < x.lo) return - 1;
      return 0;
     }
     neg(){
      var
       lo = - this.lo,
       mi = - this.mi + (lo >> 24),
       hi = - this.hi + (mi >> 24);
      return new MlInt64(lo, mi, hi);
     }
     add(x){
      var
       lo = this.lo + x.lo,
       mi = this.mi + x.mi + (lo >> 24),
       hi = this.hi + x.hi + (mi >> 24);
      return new MlInt64(lo, mi, hi);
     }
     sub(x){
      var
       lo = this.lo - x.lo,
       mi = this.mi - x.mi + (lo >> 24),
       hi = this.hi - x.hi + (mi >> 24);
      return new MlInt64(lo, mi, hi);
     }
     mul(x){
      var
       lo = this.lo * x.lo,
       mi = (lo * caml_int64_offset | 0) + this.mi * x.lo + this.lo * x.mi,
       hi =
         (mi * caml_int64_offset | 0) + this.hi * x.lo + this.mi * x.mi
         + this.lo * x.hi;
      return new MlInt64(lo, mi, hi);
     }
     isZero(){return (this.lo | this.mi | this.hi) === 0;}
     isNeg(){return this.hi << 16 < 0;}
     and(x){
      return new MlInt64(this.lo & x.lo, this.mi & x.mi, this.hi & x.hi);
     }
     or(x){
      return new MlInt64(this.lo | x.lo, this.mi | x.mi, this.hi | x.hi);
     }
     xor(x){
      return new MlInt64(this.lo ^ x.lo, this.mi ^ x.mi, this.hi ^ x.hi);
     }
     shift_left(s){
      s = s & 63;
      if(s === 0) return this;
      if(s < 24)
       return new
               MlInt64
               (this.lo << s,
                this.mi << s | this.lo >> 24 - s,
                this.hi << s | this.mi >> 24 - s);
      if(s < 48)
       return new
               MlInt64
               (0, this.lo << s - 24, this.mi << s - 24 | this.lo >> 48 - s);
      return new MlInt64(0, 0, this.lo << s - 48);
     }
     shift_right_unsigned(s){
      s = s & 63;
      if(s === 0) return this;
      if(s < 24)
       return new
               MlInt64
               (this.lo >> s | this.mi << 24 - s,
                this.mi >> s | this.hi << 24 - s,
                this.hi >> s);
      if(s < 48)
       return new
               MlInt64
               (this.mi >> s - 24 | this.hi << 48 - s, this.hi >> s - 24, 0);
      return new MlInt64(this.hi >> s - 48, 0, 0);
     }
     shift_right(s){
      s = s & 63;
      if(s === 0) return this;
      var h = this.hi << 16 >> 16;
      if(s < 24)
       return new
               MlInt64
               (this.lo >> s | this.mi << 24 - s,
                this.mi >> s | h << 24 - s,
                this.hi << 16 >> s >>> 16);
      var sign = this.hi << 16 >> 31;
      if(s < 48)
       return new
               MlInt64
               (this.mi >> s - 24 | this.hi << 48 - s,
                this.hi << 16 >> s - 24 >> 16,
                sign & 0xffff);
      return new MlInt64(this.hi << 16 >> s - 32, sign, sign);
     }
     lsl1(){
      this.hi = this.hi << 1 | this.mi >> 23;
      this.mi = (this.mi << 1 | this.lo >> 23) & 0xffffff;
      this.lo = this.lo << 1 & 0xffffff;
     }
     lsr1(){
      this.lo = (this.lo >>> 1 | this.mi << 23) & 0xffffff;
      this.mi = (this.mi >>> 1 | this.hi << 23) & 0xffffff;
      this.hi = this.hi >>> 1;
     }
     udivmod(x){
      var
       offset = 0,
       modulus = this.slice(),
       divisor = x.slice(),
       quotient = new MlInt64(0, 0, 0);
      while(modulus.ucompare(divisor) > 0){offset++; divisor.lsl1();}
      while(offset >= 0){
       offset--;
       quotient.lsl1();
       if(modulus.ucompare(divisor) >= 0){
        quotient.lo++;
        modulus = modulus.sub(divisor);
       }
       divisor.lsr1();
      }
      return {quotient: quotient, modulus: modulus};
     }
     div(y){
      var x = this;
      if(y.isZero()) caml_raise_zero_divide();
      var sign = x.hi ^ y.hi;
      if(x.hi & 0x8000) x = x.neg();
      if(y.hi & 0x8000) y = y.neg();
      var q = x.udivmod(y).quotient;
      if(sign & 0x8000) q = q.neg();
      return q;
     }
     mod(y){
      var x = this;
      if(y.isZero()) caml_raise_zero_divide();
      var sign = x.hi;
      if(x.hi & 0x8000) x = x.neg();
      if(y.hi & 0x8000) y = y.neg();
      var r = x.udivmod(y).modulus;
      if(sign & 0x8000) r = r.neg();
      return r;
     }
     toInt(){return this.lo | this.mi << 24;}
     toFloat(){
      return (this.hi << 16) * Math.pow(2, 32) + this.mi * Math.pow(2, 24)
             + this.lo;
     }
     toArray(){
      return [this.hi >> 8,
              this.hi & 0xff,
              this.mi >> 16,
              this.mi >> 8 & 0xff,
              this.mi & 0xff,
              this.lo >> 16,
              this.lo >> 8 & 0xff,
              this.lo & 0xff];
     }
     lo32(){return this.lo | (this.mi & 0xff) << 24;}
     hi32(){return this.mi >>> 8 & 0xffff | this.hi << 16;}
   }
   class MlMutex{constructor(){this.locked = false;}}
   class MlNat{
     constructor(x){
      this.data = new Int32Array(x);
      this.length = this.data.length + 2;
      this.caml_custom = "_nat";
     }
   }
   var
    jsoo_is_win32 =
      globalThis.Deno?.build?.os === "windows"
      || globalThis.process?.platform === "win32";
   function caml_raise_nodejs_error(err, raise_unix, cmd){
    var unix_error = caml_named_value("Unix.Unix_error");
    if(raise_unix && unix_error){
     var
      args =
        make_unix_err_args(err.code, cmd || err.syscall, err.path, err.errno);
     caml_raise_with_args(unix_error, args);
    }
    else
     caml_raise_sys_error(err.toString());
   }
   function caml_int64_of_float(x){
    if(x < 0) x = Math.ceil(x);
    return new
            MlInt64
            (x & 0xffffff,
             Math.floor(x * caml_int64_offset) & 0xffffff,
             Math.floor(x * caml_int64_offset * caml_int64_offset) & 0xffff);
   }
   function ocaml_stats_from_node_stats(js_stats, large){
    var file_kind;
    if(js_stats.isFile())
     file_kind = 0;
    else if(js_stats.isDirectory())
     file_kind = 1;
    else if(js_stats.isCharacterDevice())
     file_kind = 2;
    else if(js_stats.isBlockDevice())
     file_kind = 3;
    else if(js_stats.isSymbolicLink())
     file_kind = 4;
    else if(js_stats.isFIFO())
     file_kind = 5;
    else if(js_stats.isSocket()) file_kind = 6;
    return [0,
            js_stats.dev,
            js_stats.ino | 0,
            file_kind,
            js_stats.mode,
            js_stats.nlink,
            js_stats.uid,
            js_stats.gid,
            js_stats.rdev,
            large ? caml_int64_of_float(js_stats.size) : js_stats.size | 0,
            js_stats.atimeMs / 1000,
            js_stats.mtimeMs / 1000,
            js_stats.ctimeMs / 1000];
   }
   function caml_ml_string_length(s){return s.length;}
   function caml_string_unsafe_get(s, i){return s.charCodeAt(i);}
   function caml_uint8_array_of_string(s){
    var l = caml_ml_string_length(s), a = new Uint8Array(l), i = 0;
    for(; i < l; i++) a[i] = caml_string_unsafe_get(s, i);
    return a;
   }
   function caml_bytes_bound_error(){
    caml_invalid_argument("index out of bounds");
   }
   function caml_bytes_unsafe_set(s, i, c){
    c &= 0xff;
    if(s.t !== 4){
     if(i === s.c.length){
      s.c += String.fromCharCode(c);
      if(i + 1 === s.l) s.t = 0;
      return 0;
     }
     caml_convert_bytes_to_array(s);
    }
    s.c[i] = c;
    return 0;
   }
   function caml_bytes_set(s, i, c){
    if(i >>> 0 >= s.l) caml_bytes_bound_error();
    return caml_bytes_unsafe_set(s, i, c);
   }
   class MlNodeFd extends MlFile {
     constructor(fd, flags){
      super();
      this.fs = require("node:fs");
      this.fd = fd;
      this.flags = flags;
      try{
       var stats = this.fs.fstatSync(fd);
       flags.noSeek =
        stats.isCharacterDevice() || stats.isFIFO() || stats.isSocket();
       this.offset = this.flags.append ? stats.size : 0;
      }
      catch(err){flags.noSeek = true; this.offset = 0;}
      this.seeked = false;
     }
     truncate(len, raise_unix){
      try{
       this.fs.ftruncateSync(this.fd, len | 0);
       if(this.offset > len) this.offset = len;
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     isatty(){
      var tty = require("node:tty");
      return tty.isatty(this.fd) ? 1 : 0;
     }
     length(){
      try{return this.fs.fstatSync(this.fd).size;}
      catch(err){caml_raise_sys_error(err.toString());}
     }
     write(buf, buf_offset, len, raise_unix){
      try{
       if(this.flags.noSeek || ! this.seeked)
        var written = this.fs.writeSync(this.fd, buf, buf_offset, len);
       else
        var
         written =
           this.fs.writeSync(this.fd, buf, buf_offset, len, this.offset);
       this.offset += written;
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
      return written;
     }
     read(a, buf_offset, len, raise_unix){
      try{
       if(this.flags.noSeek || ! this.seeked)
        var read = this.fs.readSync(this.fd, a, buf_offset, len);
       else
        var read = this.fs.readSync(this.fd, a, buf_offset, len, this.offset);
       this.offset += read;
       return read;
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     seek(offset, whence, raise_unix){
      if(this.flags.noSeek)
       caml_raise_system_error(raise_unix, "ESPIPE", "lseek", "illegal seek");
      switch(whence){
        case 0: break;
        case 1:
         offset += this.offset; break;
        case 2:
         offset += this.length(); break;
      }
      if(offset < 0)
       caml_raise_system_error
        (raise_unix, "EINVAL", "lseek", "invalid argument");
      this.offset = offset;
      this.seeked = true;
      return this.offset;
     }
     pos(){return this.offset;}
     stat(large){
      try{
       var js_stats = this.fs.fstatSync(this.fd);
       return ocaml_stats_from_node_stats(js_stats, large);
      }
      catch(err){caml_raise_nodejs_error(err, 1);}
     }
     chmod(perms){
      try{this.fs.fchmodSync(this.fd, perms); return 0;}
      catch(err){caml_raise_nodejs_error(err, 1);}
     }
     sync(){
      try{this.fs.fsyncSync(this.fd); return 0;}
      catch(err){caml_raise_nodejs_error(err, 1);}
     }
     close(raise_unix){
      try{this.fs.closeSync(this.fd); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     check_stream_semantics(cmd){
      try{var js_stats = this.fs.fstatSync(this.fd);}
      catch(err){caml_raise_nodejs_error(err, 1, cmd);}
      if
       (!
        (js_stats.isFile() || js_stats.isCharacterDevice()
        || js_stats.isFIFO()
        || js_stats.isSocket()))
       caml_raise_system_error(1, "EINVAL", cmd, "invalid argument");
     }
   }
   class MlNodeDevice{
     constructor(root){this.fs = require("node:fs"); this.root = root;}
     nm(name){return this.root + name;}
     exists(name){
      try{return this.fs.existsSync(this.nm(name)) ? 1 : 0;}
      catch(err){return 0;}
     }
     isFile(name){
      try{return this.fs.statSync(this.nm(name)).isFile() ? 1 : 0;}
      catch(err){caml_raise_sys_error(err.toString());}
     }
     mkdir(name, mode, raise_unix){
      try{this.fs.mkdirSync(this.nm(name), {mode: mode}); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     rmdir(name, raise_unix){
      try{this.fs.rmdirSync(this.nm(name)); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     readdir(name, raise_unix){
      try{return this.fs.readdirSync(this.nm(name));}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     is_dir(name){
      try{return this.fs.statSync(this.nm(name)).isDirectory() ? 1 : 0;}
      catch(err){caml_raise_sys_error(err.toString());}
     }
     unlink(name, raise_unix){
      try{this.fs.unlinkSync(this.nm(name)); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     utimes(name, atime, mtime, raise_unix){
      try{
       if(atime === 0 && mtime === 0){
        atime = new Date().getTime() / 1000;
        mtime = atime;
       }
       this.fs.utimesSync(this.nm(name), atime, mtime);
       return 0;
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     truncate(name, len, raise_unix){
      try{this.fs.truncateSync(this.nm(name), len | 0); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     access(name, f, raise_unix){
      var consts = this.fs.constants, res = 0;
      for(var key in f)
       switch(key){
         case "r":
          res |= consts.R_OK; break;
         case "w":
          res |= consts.W_OK; break;
         case "x":
          res |= jsoo_is_win32 ? consts.R_OK : consts.X_OK; break;
         case "f":
          res |= consts.F_OK; break;
       }
      try{this.fs.accessSync(this.nm(name), res); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     open(name, f, perms, raise_unix){
      var consts = this.fs.constants, res = 0;
      for(var key in f)
       switch(key){
         case "rdonly":
          res |= consts.O_RDONLY; break;
         case "wronly":
          res |= consts.O_WRONLY; break;
         case "rdwr":
          res |= consts.O_RDWR; break;
         case "append":
          res |= consts.O_APPEND; break;
         case "create":
          res |= consts.O_CREAT; break;
         case "truncate":
          res |= consts.O_TRUNC; break;
         case "excl":
          res |= consts.O_EXCL; break;
         case "binary":
          res |= consts.O_BINARY; break;
         case "text":
          res |= consts.O_TEXT; break;
         case "nonblock":
          res |= consts.O_NONBLOCK; break;
         case "noctty":
          res |= consts.O_NOCTTY; break;
         case "dsync":
          res |= consts.O_DSYNC; break;
         case "sync":
          res |= consts.O_SYNC; break;
       }
      try{
       var fd = this.fs.openSync(this.nm(name), res, perms);
       return new MlNodeFd(fd, f);
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     slash(name){return /\/$/.test(name) ? name : name + "/";}
     rename(o, n, raise_unix){
      if(jsoo_is_win32)
       try{
        var
         target = this.nm(n),
         source = this.nm(o),
         target_stats,
         source_stats;
        if
         ((target_stats = this.fs.statSync(target, {throwIfNoEntry: false}))
          &&
           (source_stats = this.fs.statSync(source, {throwIfNoEntry: false}))
          && source_stats.isDirectory())
         if(target_stats.isDirectory()){
          if(! this.slash(target).startsWith(this.slash(source)))
           try{this.fs.rmdirSync(target);}catch{}
         }
         else{
          var
           err =
             new
              Error
              (`ENOTDIR: not a directory, rename '${source}' -> '${target}'`);
          throw Object.assign
                 (err,
                  {errno: - 20,
                   code: "ENOTDIR",
                   syscall: "rename",
                   path: target});
         }
        this.fs.renameSync(this.nm(o), this.nm(n));
       }
       catch(err){caml_raise_nodejs_error(err, raise_unix);}
      else
       try{this.fs.renameSync(this.nm(o), this.nm(n));}
       catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     stat(name, large, raise_unix){
      try{
       var js_stats = this.fs.statSync(this.nm(name));
       return ocaml_stats_from_node_stats(js_stats, large);
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     lstat(name, large, raise_unix){
      try{
       var js_stats = this.fs.lstatSync(this.nm(name));
       return ocaml_stats_from_node_stats(js_stats, large);
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     chmod(name, perms, raise_unix){
      try{this.fs.chmodSync(this.nm(name), perms); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     link(target, path, raise_unix){
      try{this.fs.linkSync(this.nm(target), this.nm(path)); return 0;}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     symlink(to_dir, target, path, raise_unix){
      try{
       this.fs.symlinkSync
        (target,
         this.nm(path),
         to_dir === 0 ? null : to_dir[1] ? "dir" : "file");
       return 0;
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     readlink(name, raise_unix){
      try{
       var link = this.fs.readlinkSync(this.nm(name), "utf8");
       return caml_string_of_jsstring(link);
      }
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
     opendir(name, raise_unix){
      try{return this.fs.opendirSync(this.nm(name));}
      catch(err){caml_raise_nodejs_error(err, raise_unix);}
     }
   }
   class MlObjectTable{
     constructor(){this.objs = []; this.lookup = new globalThis.Map();}
     store(v){this.lookup.set(v, this.objs.length); this.objs.push(v);}
     recall(v){
      var i = this.lookup.get(v);
      return i === undefined ? undefined : this.objs.length - i;
     }
   }
   var
    caml_packFloat16 =
      function(){
        const INVERSE_OF_EPSILON = 1 / Number.EPSILON;
        function roundTiesToEven(num){
         return num + INVERSE_OF_EPSILON - INVERSE_OF_EPSILON;
        }
        const
         FLOAT16_MIN_VALUE = 6.103515625e-5,
         FLOAT16_MAX_VALUE = 65504,
         FLOAT16_EPSILON = 0.0009765625,
         FLOAT16_EPSILON_MULTIPLIED_BY_FLOAT16_MIN_VALUE = FLOAT16_EPSILON * FLOAT16_MIN_VALUE,
         FLOAT16_EPSILON_DEVIDED_BY_EPSILON =
           FLOAT16_EPSILON * INVERSE_OF_EPSILON;
        function roundToFloat16(num){
         const number = + num;
         if(! Number.isFinite(number) || number === 0) return number;
         const sign = number > 0 ? 1 : - 1, absolute = Math.abs(number);
         if(absolute < FLOAT16_MIN_VALUE)
          return sign
                 *
                  roundTiesToEven
                   (absolute / FLOAT16_EPSILON_MULTIPLIED_BY_FLOAT16_MIN_VALUE)
                 * FLOAT16_EPSILON_MULTIPLIED_BY_FLOAT16_MIN_VALUE;
         const
          temp = (1 + FLOAT16_EPSILON_DEVIDED_BY_EPSILON) * absolute,
          result = temp - (temp - absolute);
         if(result > FLOAT16_MAX_VALUE || Number.isNaN(result))
          return sign * Number.POSITIVE_INFINITY;
         return sign * result;
        }
        const
         baseTable = new Uint16Array(512),
         shiftTable = new Uint8Array(512);
        for(let i = 0; i < 256; ++i){
         const e = i - 127;
         if(e < - 24){
          baseTable[i] = 0x0000;
          baseTable[i | 0x100] = 0x8000;
          shiftTable[i] = 24;
          shiftTable[i | 0x100] = 24;
         }
         else if(e < - 14){
          baseTable[i] = 0x0400 >> - e - 14;
          baseTable[i | 0x100] = 0x0400 >> - e - 14 | 0x8000;
          shiftTable[i] = - e - 1;
          shiftTable[i | 0x100] = - e - 1;
         }
         else if(e <= 15){
          baseTable[i] = e + 15 << 10;
          baseTable[i | 0x100] = e + 15 << 10 | 0x8000;
          shiftTable[i] = 13;
          shiftTable[i | 0x100] = 13;
         }
         else if(e < 128){
          baseTable[i] = 0x7c00;
          baseTable[i | 0x100] = 0xfc00;
          shiftTable[i] = 24;
          shiftTable[i | 0x100] = 24;
         }
         else{
          baseTable[i] = 0x7c00;
          baseTable[i | 0x100] = 0xfc00;
          shiftTable[i] = 13;
          shiftTable[i | 0x100] = 13;
         }
        }
        const
         buffer = new ArrayBuffer(4),
         floatView = new Float32Array(buffer),
         uint32View = new Uint32Array(buffer);
        return function(num){
         floatView[0] = roundToFloat16(num);
         const f = uint32View[0], e = f >> 23 & 0x1ff;
         return baseTable[e] + ((f & 0x007fffff) >> shiftTable[e]);};
       }
       (),
    caml_unpackFloat16 =
      function(){
        var
         pow = Math.pow,
         EXP_MASK16 = 31,
         SIGNIFICAND_MASK16 = 1023,
         MIN_SUBNORMAL16 = pow(2, - 24),
         SIGNIFICAND_DENOM16 = 0.0009765625;
        return function(bytes){
         var
          sign = bytes >>> 15,
          exponent = bytes >>> 10 & EXP_MASK16,
          significand = bytes & SIGNIFICAND_MASK16;
         if(exponent === EXP_MASK16)
          return significand === 0
                  ? sign
                    === 0
                    ? Number.POSITIVE_INFINITY
                    : Number.NEGATIVE_INFINITY
                  : Number.NaN;
         if(exponent === 0)
          return significand
                 * (sign === 0 ? MIN_SUBNORMAL16 : - MIN_SUBNORMAL16);
         var
          r =
            pow(2, exponent - 15)
            *
             (sign === 0
               ? 1 + significand * SIGNIFICAND_DENOM16
               : - 1 - significand * SIGNIFICAND_DENOM16);
         return r;};
       }
       ();
   function caml_int64_create_lo_hi(lo, hi){
    return new
            MlInt64
            (lo & 0xffffff,
             lo >>> 24 & 0xff | (hi & 0xffff) << 8,
             hi >>> 16 & 0xffff);
   }
   function caml_int64_hi32(v){return v.hi32();}
   function caml_int64_lo32(v){return v.lo32();}
   function caml_array_bound_error(){
    caml_invalid_argument("index out of bounds");
   }
   var caml_ba_custom_name = "_bigarr02";
   class Ml_Bigarray{
     constructor(kind, layout, dims, buffer){
      this.kind = kind;
      this.layout = layout;
      this.dims = dims;
      this.data = buffer;
      this.caml_custom = caml_ba_custom_name;
     }
     offset(arg){
      var ofs = 0;
      if(typeof arg === "number") arg = [arg];
      if(! Array.isArray(arg))
       caml_invalid_argument("bigarray.js: invalid offset");
      if(this.dims.length !== arg.length)
       caml_invalid_argument("Bigarray.get/set: bad number of dimensions");
      if(this.layout === 0)
       for(var i = 0; i < this.dims.length; i++){
        if(arg[i] < 0 || arg[i] >= this.dims[i]) caml_array_bound_error();
        ofs = ofs * this.dims[i] + arg[i];
       }
      else
       for(var i = this.dims.length - 1; i >= 0; i--){
        if(arg[i] < 1 || arg[i] > this.dims[i]) caml_array_bound_error();
        ofs = ofs * this.dims[i] + (arg[i] - 1);
       }
      return ofs;
     }
     get(ofs){
      switch(this.kind){
        case 7:
         var l = this.data[ofs * 2 + 0], h = this.data[ofs * 2 + 1];
         return caml_int64_create_lo_hi(l, h);
        case 10:
        case 11:
         var r = this.data[ofs * 2 + 0], i = this.data[ofs * 2 + 1];
         return [254, r, i];
        case 13:
         return caml_unpackFloat16(this.data[ofs]);
        default: return this.data[ofs];
      }
     }
     set(ofs, v){
      switch(this.kind){
        case 7:
         this.data[ofs * 2 + 0] = caml_int64_lo32(v);
         this.data[ofs * 2 + 1] = caml_int64_hi32(v);
         break;
        case 10:
        case 11:
         this.data[ofs * 2 + 0] = v[1]; this.data[ofs * 2 + 1] = v[2]; break;
        case 13:
         this.data[ofs] = caml_packFloat16(v); break;
        default: this.data[ofs] = v; break;
      }
      return 0;
     }
     fill(v){
      switch(this.kind){
        case 7:
         var a = caml_int64_lo32(v), b = caml_int64_hi32(v);
         if(a === b)
          this.data.fill(a);
         else
          for(var i = 0; i < this.data.length; i++)
           this.data[i] = i % 2 === 0 ? a : b;
         break;
        case 10:
        case 11:
         var im = v[1], re = v[2];
         if(im === re)
          this.data.fill(im);
         else
          for(var i = 0; i < this.data.length; i++)
           this.data[i] = i % 2 === 0 ? im : re;
         break;
        case 13:
         this.data.fill(caml_packFloat16(v)); break;
        default: this.data.fill(v); break;
      }
     }
     compare(b, total){
      if(this.layout !== b.layout || this.kind !== b.kind){
       var k1 = this.kind | this.layout << 8, k2 = b.kind | b.layout << 8;
       return k2 - k1;
      }
      if(this.dims.length !== b.dims.length)
       return b.dims.length - this.dims.length;
      for(var i = 0; i < this.dims.length; i++)
       if(this.dims[i] !== b.dims[i])
        return this.dims[i] < b.dims[i] ? - 1 : 1;
      switch(this.kind){
        case 0:
        case 1:
        case 10:
        case 11:
         var x, y;
         for(var i = 0; i < this.data.length; i++){
          x = this.data[i];
          y = b.data[i];
          if(x < y) return - 1;
          if(x > y) return 1;
          if(x !== y){
           if(! total) return Number.NaN;
           if(! Number.isNaN(x)) return 1;
           if(! Number.isNaN(y)) return - 1;
          }
         }
         break;
        case 7:
         for(var i = 0; i < this.data.length; i += 2){
          if(this.data[i + 1] < b.data[i + 1]) return - 1;
          if(this.data[i + 1] > b.data[i + 1]) return 1;
          if(this.data[i] >>> 0 < b.data[i] >>> 0) return - 1;
          if(this.data[i] >>> 0 > b.data[i] >>> 0) return 1;
         }
         break;
        case 13:
         for(var i = 0; i < this.data.length; i++){
          var
           aa = caml_unpackFloat16(this.data[i]),
           bb = caml_unpackFloat16(b.data[i]);
          if(aa < bb) return - 1;
          if(aa > bb) return 1;
         }
         break;
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 8:
        case 9:
        case 12:
         for(var i = 0; i < this.data.length; i++){
          if(this.data[i] < b.data[i]) return - 1;
          if(this.data[i] > b.data[i]) return 1;
         }
         break;
      }
      return 0;
     }
   }
   class Ml_Bigarray_c_1_1 extends Ml_Bigarray {
     offset(arg){
      if(typeof arg !== "number")
       if(Array.isArray(arg) && arg.length === 1)
        arg = arg[0];
       else
        caml_invalid_argument("Ml_Bigarray_c_1_1.offset");
      if(arg < 0 || arg >= this.dims[0]) caml_array_bound_error();
      return arg;
     }
     get(ofs){return this.data[ofs];}
     set(ofs, v){this.data[ofs] = v; return 0;}
     fill(v){this.data.fill(v); return 0;}
   }
   function caml_string_of_uint8_array(a){
    return caml_sub_uint8_array_to_jsbytes(a, 0, a.length);
   }
   class UInt8ArrayReader{
     constructor(s, i){this.s = s; this.i = i;}
     read8u(){return this.s[this.i++];}
     read8s(){return this.s[this.i++] << 24 >> 24;}
     read16u(){
      var s = this.s, i = this.i;
      this.i = i + 2;
      return s[i] << 8 | s[i + 1];
     }
     read16s(){
      var s = this.s, i = this.i;
      this.i = i + 2;
      return s[i] << 24 >> 16 | s[i + 1];
     }
     read32u(){
      var s = this.s, i = this.i;
      this.i = i + 4;
      return (s[i] << 24 | s[i + 1] << 16 | s[i + 2] << 8 | s[i + 3]) >>> 0;
     }
     read32s(){
      var s = this.s, i = this.i;
      this.i = i + 4;
      return s[i] << 24 | s[i + 1] << 16 | s[i + 2] << 8 | s[i + 3];
     }
     readstr(len){
      var i = this.i;
      this.i = i + len;
      return caml_string_of_uint8_array(this.s.subarray(i, i + len));
     }
     readuint8array(len){
      var i = this.i;
      this.i = i + len;
      return this.s.subarray(i, i + len);
     }
   }
   function incr_nat(nat, ofs, len, carry_in){
    var carry = carry_in;
    for(var i = 0; i < len; i++){
     var x = (nat.data[ofs + i] >>> 0) + carry;
     nat.data[ofs + i] = x | 0;
     if(x === x >>> 0){carry = 0; break;} else carry = 1;
    }
    return carry;
   }
   function add_nat(nat1, ofs1, len1, nat2, ofs2, len2, carry_in){
    var carry = carry_in;
    for(var i = 0; i < len2; i++){
     var
      x = (nat1.data[ofs1 + i] >>> 0) + (nat2.data[ofs2 + i] >>> 0) + carry;
     nat1.data[ofs1 + i] = x;
     if(x === x >>> 0) carry = 0; else carry = 1;
    }
    return incr_nat(nat1, ofs1 + len2, len1 - len2, carry);
   }
   function caml_ba_get_size(dims){
    var n_dims = dims.length, size = 1;
    for(var i = 0; i < n_dims; i++){
     if(dims[i] < 0)
      caml_invalid_argument("Bigarray.create: negative dimension");
     size = size * dims[i];
    }
    return size;
   }
   function caml_ba_get_size_per_element(kind){
    switch(kind){case 7:case 10:case 11: return 2;default: return 1;
    }
   }
   function caml_ba_create_unsafe(kind, layout, dims, data){
    var size_per_element = caml_ba_get_size_per_element(kind);
    if(caml_ba_get_size(dims) * size_per_element !== data.length)
     caml_invalid_argument("length doesn't match dims");
    if
     (layout === 0 && dims.length === 1 && size_per_element === 1
      && kind !== 13)
     return new Ml_Bigarray_c_1_1(kind, layout, dims, data);
    return new Ml_Bigarray(kind, layout, dims, data);
   }
   function bigstring_of_array_buffer(ab){
    var ta = new Uint8Array(ab);
    return caml_ba_create_unsafe(12, 0, [ta.length], ta);
   }
   function bigstring_of_typed_array(ba){
    var
     ta =
       new
        Uint8Array
        (ba.buffer, ba.byteOffset, ba.length * ba.BYTES_PER_ELEMENT);
    return caml_ba_create_unsafe(12, 0, [ta.length], ta);
   }
   function bigstring_to_array_buffer(bs){return bs.data.buffer;}
   function bigstring_to_typed_array(bs){return bs.data;}
   var
    blake2b =
      function(){
        function ADD64AA(v, a, b){
         const o0 = v[a] + v[b];
         let o1 = v[a + 1] + v[b + 1];
         if(o0 >= 0x100000000) o1++;
         v[a] = o0;
         v[a + 1] = o1;
        }
        function ADD64AC(v, a, b0, b1){
         let o0 = v[a] + b0;
         if(b0 < 0) o0 += 0x100000000;
         let o1 = v[a + 1] + b1;
         if(o0 >= 0x100000000) o1++;
         v[a] = o0;
         v[a + 1] = o1;
        }
        function B2B_GET32(arr, i){
         return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24;
        }
        function B2B_G(a, b, c, d, ix, iy){
         const x0 = m[ix], x1 = m[ix + 1], y0 = m[iy], y1 = m[iy + 1];
         ADD64AA(v, a, b);
         ADD64AC(v, a, x0, x1);
         let xor0 = v[d] ^ v[a], xor1 = v[d + 1] ^ v[a + 1];
         v[d] = xor1;
         v[d + 1] = xor0;
         ADD64AA(v, c, d);
         xor0 = v[b] ^ v[c];
         xor1 = v[b + 1] ^ v[c + 1];
         v[b] = xor0 >>> 24 ^ xor1 << 8;
         v[b + 1] = xor1 >>> 24 ^ xor0 << 8;
         ADD64AA(v, a, b);
         ADD64AC(v, a, y0, y1);
         xor0 = v[d] ^ v[a];
         xor1 = v[d + 1] ^ v[a + 1];
         v[d] = xor0 >>> 16 ^ xor1 << 16;
         v[d + 1] = xor1 >>> 16 ^ xor0 << 16;
         ADD64AA(v, c, d);
         xor0 = v[b] ^ v[c];
         xor1 = v[b + 1] ^ v[c + 1];
         v[b] = xor1 >>> 31 ^ xor0 << 1;
         v[b + 1] = xor0 >>> 31 ^ xor1 << 1;
        }
        const
         BLAKE2B_IV32 =
           new
            Uint32Array
            ([0xf3bcc908,
              0x6a09e667,
              0x84caa73b,
              0xbb67ae85,
              0xfe94f82b,
              0x3c6ef372,
              0x5f1d36f1,
              0xa54ff53a,
              0xade682d1,
              0x510e527f,
              0x2b3e6c1f,
              0x9b05688c,
              0xfb41bd6b,
              0x1f83d9ab,
              0x137e2179,
              0x5be0cd19]),
         SIGMA8 =
           [0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            14,
            10,
            4,
            8,
            9,
            15,
            13,
            6,
            1,
            12,
            0,
            2,
            11,
            7,
            5,
            3,
            11,
            8,
            12,
            0,
            5,
            2,
            15,
            13,
            10,
            14,
            3,
            6,
            7,
            1,
            9,
            4,
            7,
            9,
            3,
            1,
            13,
            12,
            11,
            14,
            2,
            6,
            5,
            10,
            4,
            0,
            15,
            8,
            9,
            0,
            5,
            7,
            2,
            4,
            10,
            15,
            14,
            1,
            11,
            12,
            6,
            8,
            3,
            13,
            2,
            12,
            6,
            10,
            0,
            11,
            8,
            3,
            4,
            13,
            7,
            5,
            15,
            14,
            1,
            9,
            12,
            5,
            1,
            15,
            14,
            13,
            4,
            10,
            0,
            7,
            6,
            3,
            9,
            2,
            8,
            11,
            13,
            11,
            7,
            14,
            12,
            1,
            3,
            9,
            5,
            0,
            15,
            4,
            8,
            6,
            2,
            10,
            6,
            15,
            14,
            9,
            11,
            3,
            0,
            8,
            12,
            2,
            13,
            7,
            1,
            4,
            10,
            5,
            10,
            2,
            8,
            4,
            7,
            6,
            1,
            5,
            15,
            11,
            9,
            14,
            3,
            12,
            13,
            0,
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            14,
            10,
            4,
            8,
            9,
            15,
            13,
            6,
            1,
            12,
            0,
            2,
            11,
            7,
            5,
            3],
         SIGMA82 = new Uint8Array(SIGMA8.map(function(x){return x * 2;})),
         v = new Uint32Array(32),
         m = new Uint32Array(32);
        function blake2bCompress(ctx, last){
         let i = 0;
         for(i = 0; i < 16; i++){
          v[i] = ctx.h[i];
          v[i + 16] = BLAKE2B_IV32[i];
         }
         v[24] = v[24] ^ ctx.t;
         v[25] = v[25] ^ ctx.t / 0x100000000;
         if(last){v[28] = ~ v[28]; v[29] = ~ v[29];}
         for(i = 0; i < 32; i++) m[i] = B2B_GET32(ctx.b, 4 * i);
         for(i = 0; i < 12; i++){
          B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]);
          B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]);
          B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]);
          B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]);
          B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]);
          B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]);
          B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]);
          B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]);
         }
         for(i = 0; i < 16; i++) ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16];
        }
        const
         parameterBlock =
           new
            Uint8Array
            ([0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0]);
        function blake2bInit(outlen, key){
         if(outlen === 0 || outlen > 64)
          throw new Error("Illegal output length, expected 0 < length <= 64");
         if(key.length > 64)
          throw new
                 Error
                 ("Illegal key, expected Uint8Array with 0 < length <= 64");
         const
          ctx =
            {b: new Uint8Array(128),
             h: new Uint32Array(16),
             t: 0,
             c: 0,
             outlen: outlen};
         parameterBlock.fill(0);
         parameterBlock[0] = outlen;
         parameterBlock[1] = key.length;
         parameterBlock[2] = 1;
         parameterBlock[3] = 1;
         for(let i = 0; i < 16; i++)
          ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4);
         if(key.length > 0){blake2bUpdate(ctx, key); ctx.c = 128;}
         return ctx;
        }
        function blake2bUpdate(ctx, input){
         for(let i = 0; i < input.length; i++){
          if(ctx.c === 128){
           ctx.t += ctx.c;
           blake2bCompress(ctx, false);
           ctx.c = 0;
          }
          ctx.b[ctx.c++] = input[i];
         }
        }
        function blake2bFinal(ctx){
         ctx.t += ctx.c;
         while(ctx.c < 128) ctx.b[ctx.c++] = 0;
         blake2bCompress(ctx, true);
         const out = new Uint8Array(ctx.outlen);
         for(let i = 0; i < ctx.outlen; i++)
          out[i] = ctx.h[i >> 2] >> 8 * (i & 3);
         return out;
        }
        return {Init: blake2bInit, Update: blake2bUpdate, Final: blake2bFinal};
       }
       ();
   function blit_nat(nat1, ofs1, nat2, ofs2, len){
    for(var i = 0; i < len; i++) nat1.data[ofs1 + i] = nat2.data[ofs2 + i];
    return 0;
   }
   var
    caml_MD5Transform =
      function(){
        function add(x, y){return x + y | 0;}
        function xx(q, a, b, x, s, t){
         a = add(add(a, q), add(x, t));
         return add(a << s | a >>> 32 - s, b);
        }
        function ff(a, b, c, d, x, s, t){
         return xx(b & c | ~ b & d, a, b, x, s, t);
        }
        function gg(a, b, c, d, x, s, t){
         return xx(b & d | c & ~ d, a, b, x, s, t);
        }
        function hh(a, b, c, d, x, s, t){return xx(b ^ c ^ d, a, b, x, s, t);}
        function ii(a, b, c, d, x, s, t){
         return xx(c ^ (b | ~ d), a, b, x, s, t);
        }
        return function(w, buffer){
         var a = w[0], b = w[1], c = w[2], d = w[3];
         a = ff(a, b, c, d, buffer[0], 7, 0xd76aa478);
         d = ff(d, a, b, c, buffer[1], 12, 0xe8c7b756);
         c = ff(c, d, a, b, buffer[2], 17, 0x242070db);
         b = ff(b, c, d, a, buffer[3], 22, 0xc1bdceee);
         a = ff(a, b, c, d, buffer[4], 7, 0xf57c0faf);
         d = ff(d, a, b, c, buffer[5], 12, 0x4787c62a);
         c = ff(c, d, a, b, buffer[6], 17, 0xa8304613);
         b = ff(b, c, d, a, buffer[7], 22, 0xfd469501);
         a = ff(a, b, c, d, buffer[8], 7, 0x698098d8);
         d = ff(d, a, b, c, buffer[9], 12, 0x8b44f7af);
         c = ff(c, d, a, b, buffer[10], 17, 0xffff5bb1);
         b = ff(b, c, d, a, buffer[11], 22, 0x895cd7be);
         a = ff(a, b, c, d, buffer[12], 7, 0x6b901122);
         d = ff(d, a, b, c, buffer[13], 12, 0xfd987193);
         c = ff(c, d, a, b, buffer[14], 17, 0xa679438e);
         b = ff(b, c, d, a, buffer[15], 22, 0x49b40821);
         a = gg(a, b, c, d, buffer[1], 5, 0xf61e2562);
         d = gg(d, a, b, c, buffer[6], 9, 0xc040b340);
         c = gg(c, d, a, b, buffer[11], 14, 0x265e5a51);
         b = gg(b, c, d, a, buffer[0], 20, 0xe9b6c7aa);
         a = gg(a, b, c, d, buffer[5], 5, 0xd62f105d);
         d = gg(d, a, b, c, buffer[10], 9, 0x02441453);
         c = gg(c, d, a, b, buffer[15], 14, 0xd8a1e681);
         b = gg(b, c, d, a, buffer[4], 20, 0xe7d3fbc8);
         a = gg(a, b, c, d, buffer[9], 5, 0x21e1cde6);
         d = gg(d, a, b, c, buffer[14], 9, 0xc33707d6);
         c = gg(c, d, a, b, buffer[3], 14, 0xf4d50d87);
         b = gg(b, c, d, a, buffer[8], 20, 0x455a14ed);
         a = gg(a, b, c, d, buffer[13], 5, 0xa9e3e905);
         d = gg(d, a, b, c, buffer[2], 9, 0xfcefa3f8);
         c = gg(c, d, a, b, buffer[7], 14, 0x676f02d9);
         b = gg(b, c, d, a, buffer[12], 20, 0x8d2a4c8a);
         a = hh(a, b, c, d, buffer[5], 4, 0xfffa3942);
         d = hh(d, a, b, c, buffer[8], 11, 0x8771f681);
         c = hh(c, d, a, b, buffer[11], 16, 0x6d9d6122);
         b = hh(b, c, d, a, buffer[14], 23, 0xfde5380c);
         a = hh(a, b, c, d, buffer[1], 4, 0xa4beea44);
         d = hh(d, a, b, c, buffer[4], 11, 0x4bdecfa9);
         c = hh(c, d, a, b, buffer[7], 16, 0xf6bb4b60);
         b = hh(b, c, d, a, buffer[10], 23, 0xbebfbc70);
         a = hh(a, b, c, d, buffer[13], 4, 0x289b7ec6);
         d = hh(d, a, b, c, buffer[0], 11, 0xeaa127fa);
         c = hh(c, d, a, b, buffer[3], 16, 0xd4ef3085);
         b = hh(b, c, d, a, buffer[6], 23, 0x04881d05);
         a = hh(a, b, c, d, buffer[9], 4, 0xd9d4d039);
         d = hh(d, a, b, c, buffer[12], 11, 0xe6db99e5);
         c = hh(c, d, a, b, buffer[15], 16, 0x1fa27cf8);
         b = hh(b, c, d, a, buffer[2], 23, 0xc4ac5665);
         a = ii(a, b, c, d, buffer[0], 6, 0xf4292244);
         d = ii(d, a, b, c, buffer[7], 10, 0x432aff97);
         c = ii(c, d, a, b, buffer[14], 15, 0xab9423a7);
         b = ii(b, c, d, a, buffer[5], 21, 0xfc93a039);
         a = ii(a, b, c, d, buffer[12], 6, 0x655b59c3);
         d = ii(d, a, b, c, buffer[3], 10, 0x8f0ccc92);
         c = ii(c, d, a, b, buffer[10], 15, 0xffeff47d);
         b = ii(b, c, d, a, buffer[1], 21, 0x85845dd1);
         a = ii(a, b, c, d, buffer[8], 6, 0x6fa87e4f);
         d = ii(d, a, b, c, buffer[15], 10, 0xfe2ce6e0);
         c = ii(c, d, a, b, buffer[6], 15, 0xa3014314);
         b = ii(b, c, d, a, buffer[13], 21, 0x4e0811a1);
         a = ii(a, b, c, d, buffer[4], 6, 0xf7537e82);
         d = ii(d, a, b, c, buffer[11], 10, 0xbd3af235);
         c = ii(c, d, a, b, buffer[2], 15, 0x2ad7d2bb);
         b = ii(b, c, d, a, buffer[9], 21, 0xeb86d391);
         w[0] = add(a, w[0]);
         w[1] = add(b, w[1]);
         w[2] = add(c, w[2]);
         w[3] = add(d, w[3]);};
       }
       ();
   function caml_MD5Final(ctx){
    var in_buf = ctx.len & 0x3f;
    ctx.b8[in_buf] = 0x80;
    in_buf++;
    if(in_buf > 56){
     for(var j = in_buf; j < 64; j++) ctx.b8[j] = 0;
     caml_MD5Transform(ctx.w, ctx.b32);
     for(var j = 0; j < 56; j++) ctx.b8[j] = 0;
    }
    else
     for(var j = in_buf; j < 56; j++) ctx.b8[j] = 0;
    ctx.b32[14] = ctx.len << 3;
    ctx.b32[15] = ctx.len >> 29 & 0x1fffffff;
    caml_MD5Transform(ctx.w, ctx.b32);
    var t = new Uint8Array(16);
    for(var i = 0; i < 4; i++)
     for(var j = 0; j < 4; j++) t[i * 4 + j] = ctx.w[i] >> 8 * j & 0xff;
    return t;
   }
   function caml_MD5Init(){
    var
     buffer = new ArrayBuffer(64),
     b32 = new Uint32Array(buffer),
     b8 = new Uint8Array(buffer);
    return {len: 0,
            w:
            new Uint32Array([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]),
            b32: b32,
            b8: b8};
   }
   function caml_MD5Update(ctx, input, input_len){
    var in_buf = ctx.len & 0x3f, input_pos = 0;
    ctx.len += input_len;
    if(in_buf){
     var missing = 64 - in_buf;
     if(input_len < missing){
      ctx.b8.set(input.subarray(0, input_len), in_buf);
      return;
     }
     ctx.b8.set(input.subarray(0, missing), in_buf);
     caml_MD5Transform(ctx.w, ctx.b32);
     input_len -= missing;
     input_pos += missing;
    }
    while(input_len >= 64){
     ctx.b8.set(input.subarray(input_pos, input_pos + 64), 0);
     caml_MD5Transform(ctx.w, ctx.b32);
     input_len -= 64;
     input_pos += 64;
    }
    if(input_len)
     ctx.b8.set(input.subarray(input_pos, input_pos + input_len), 0);
   }
   function caml_acosh_float(x){return Math.acosh(x);}
   function caml_call_gen(f, args){
    var
     n = f.l >= 0 ? f.l : f.l = f.length,
     argsLen = args.length,
     d = n - argsLen;
    if(d === 0)
     return f(...args);
    else if(d < 0){
     var g = f(...args.slice(0, n));
     if(typeof g !== "function") return g;
     return caml_call_gen(g, args.slice(n));
    }
    else{
     switch(d){
       case 1:
        {
         var
          g =
            function(x){
             var nargs = new Array(argsLen + 1);
             for(var i = 0; i < argsLen; i++) nargs[i] = args[i];
             nargs[argsLen] = x;
             return f(...nargs);
            };
         break;
        }
       case 2:
        {
         var
          g =
            function(x, y){
             var nargs = new Array(argsLen + 2);
             for(var i = 0; i < argsLen; i++) nargs[i] = args[i];
             nargs[argsLen] = x;
             nargs[argsLen + 1] = y;
             return f(...nargs);
            };
         break;
        }
       default:
        var
         g =
           function(...extra_args){
            if(extra_args.length === 0) extra_args = [undefined];
            return caml_call_gen(f, args.concat(extra_args));
           };
     }
     g.l = d;
     return g;
    }
   }
   function caml_alloc_dummy_infix(){
    return function f(x){return caml_call_gen(f.fun, [x]);};
   }
   function caml_alloc_stack(_hv, _hx, _hf){return 0;}
   var
    caml_argv =
      function(){
        var process = globalThis.process, main = "a.out", args = [];
        if(process?.argv?.length > 1){
         var argv = process.argv;
         main = argv[1];
         args = argv.slice(2);
        }
        var p = caml_string_of_jsstring(main), args2 = [0, p];
        for(var i = 0; i < args.length; i++)
         args2.push(caml_string_of_jsstring(args[i]));
        return args2;
       }
       ();
   function caml_array_append(a1, a2){
    var l1 = a1.length, l2 = a2.length, l = l1 + l2 - 1, a = new Array(l);
    a[0] = 0;
    var i = 1, j = 1;
    for(; i < l1; i++) a[i] = a1[i];
    for(; i < l; i++, j++) a[i] = a2[j];
    return a;
   }
   function caml_array_blit(a1, i1, a2, i2, len){
    if(i2 <= i1)
     for(var j = 1; j <= len; j++) a2[i2 + j] = a1[i1 + j];
    else
     for(var j = len; j >= 1; j--) a2[i2 + j] = a1[i1 + j];
    return 0;
   }
   function caml_array_concat(l){
    var a = [0];
    while(l !== 0){
     var b = l[1];
     for(var i = 1; i < b.length; i++) a.push(b[i]);
     l = l[2];
    }
    return a;
   }
   function caml_array_fill(array, ofs, len, v){
    for(var i = 0; i < len; i++) array[ofs + i + 1] = v;
    return 0;
   }
   function caml_array_get(array, index){
    if(index < 0 || index >= array.length - 1) caml_array_bound_error();
    return array[index + 1];
   }
   function caml_array_make(len, init){
    if(len >>> 0 >= (0x7fffffff / 4 | 0)) caml_array_bound_error();
    var len = len + 1 | 0, b = new Array(len);
    b[0] = 0;
    for(var i = 1; i < len; i++) b[i] = init;
    return b;
   }
   function caml_array_of_bytes(x){return caml_uint8_array_of_bytes(x);}
   function caml_array_of_string(x){return caml_uint8_array_of_string(x);}
   function caml_array_set(array, index, newval){
    if(index < 0 || index >= array.length - 1) caml_array_bound_error();
    array[index + 1] = newval;
    return 0;
   }
   function caml_array_sub(a, i, len){
    var a2 = new Array(len + 1);
    a2[0] = 0;
    for(var i2 = 1, i1 = i + 1; i2 <= len; i2++, i1++) a2[i2] = a[i1];
    return a2;
   }
   function caml_asinh_float(x){return Math.asinh(x);}
   function caml_atanh_float(x){return Math.atanh(x);}
   function caml_atomic_cas(ref, o, n){
    if(ref[1] === o){ref[1] = n; return 1;}
    return 0;
   }
   function caml_atomic_exchange(ref, v){
    var r = ref[1];
    ref[1] = v;
    return r;
   }
   function caml_atomic_fetch_add(ref, i){
    var old = ref[1];
    ref[1] += i;
    return old;
   }
   function caml_atomic_load(ref){return ref[1];}
   function caml_atomic_make_contended(a){return [0, a];}
   function caml_ba_blit(src, dst){
    if(dst.dims.length !== src.dims.length)
     caml_invalid_argument("Bigarray.blit: dimension mismatch");
    for(var i = 0; i < dst.dims.length; i++)
     if(dst.dims[i] !== src.dims[i])
      caml_invalid_argument("Bigarray.blit: dimension mismatch");
    dst.data.set(src.data);
    return 0;
   }
   function caml_ba_change_layout(ba, layout){
    if(ba.layout === layout) return ba;
    var new_dims = [];
    for(var i = 0; i < ba.dims.length; i++)
     new_dims[i] = ba.dims[ba.dims.length - i - 1];
    return caml_ba_create_unsafe(ba.kind, layout, new_dims, ba.data);
   }
   function caml_ba_compare(a, b, total){return a.compare(b, total);}
   function caml_ba_create_buffer(kind, size){
    var view;
    switch(kind){
      case 0:
       view = Float32Array; break;
      case 1:
       view = Float64Array; break;
      case 2:
       view = Int8Array; break;
      case 3:
       view = Uint8Array; break;
      case 4:
       view = Int16Array; break;
      case 5:
       view = Uint16Array; break;
      case 6:
       view = Int32Array; break;
      case 7:
       view = Int32Array; break;
      case 8:
       view = Int32Array; break;
      case 9:
       view = Int32Array; break;
      case 10:
       view = Float32Array; break;
      case 11:
       view = Float64Array; break;
      case 12:
       view = Uint8Array; break;
      case 13:
       view = Uint16Array; break;
    }
    if(! view) caml_invalid_argument("Bigarray.create: unsupported kind");
    var data = new view(size * caml_ba_get_size_per_element(kind));
    return data;
   }
   function caml_js_from_array(a){return a.slice(1);}
   function caml_ba_create(kind, layout, dims_ml){
    var
     dims = caml_js_from_array(dims_ml),
     data = caml_ba_create_buffer(kind, caml_ba_get_size(dims));
    return caml_ba_create_unsafe(kind, layout, dims, data);
   }
   function caml_ba_create_from(data1, data2, _jstyp, kind, layout, dims){
    if(data2 || caml_ba_get_size_per_element(kind) === 2)
     caml_invalid_argument
      ("caml_ba_create_from: use return caml_ba_create_unsafe");
    return caml_ba_create_unsafe(kind, layout, dims, data1);
   }
   var jsoo_dataview = new DataView(new ArrayBuffer(8));
   function caml_int32_float_of_bits(x){
    jsoo_dataview.setUint32(0, x, true);
    return jsoo_dataview.getFloat32(0, true);
   }
   function caml_int64_of_bytes(a){
    return new
            MlInt64
            (a[7] << 0 | a[6] << 8 | a[5] << 16,
             a[4] << 0 | a[3] << 8 | a[2] << 16,
             a[1] << 0 | a[0] << 8);
   }
   function caml_int64_float_of_bits(x){
    var lo = x.lo, mi = x.mi, hi = x.hi;
    if((hi & 0x7ff8) === 0x7ff0 && (mi | lo | hi & 0xf) !== 0) hi |= 8;
    jsoo_dataview.setUint32(0, lo | mi << 24, true);
    jsoo_dataview.setUint32(4, mi >>> 8 | hi << 16, true);
    return jsoo_dataview.getFloat64(0, true);
   }
   function caml_failwith(msg){
    if(! caml_global_data.Failure)
     caml_global_data.Failure = [248, caml_string_of_jsbytes("Failure"), - 3];
    caml_raise_with_string(caml_global_data.Failure, msg);
   }
   function caml_ba_deserialize(reader, sz, name){
    var num_dims = reader.read32s();
    if(num_dims < 0 || num_dims > 16)
     caml_failwith("input_value: wrong number of bigarray dimensions");
    var
     tag = reader.read32s(),
     kind = tag & 0xff,
     layout = tag >> 8 & 1,
     dims = [];
    if(name === "_bigarr02")
     for(var i = 0; i < num_dims; i++){
      var size_dim = reader.read16u();
      if(size_dim === 0xffff){
       var size_dim_hi = reader.read32u(), size_dim_lo = reader.read32u();
       if(size_dim_hi !== 0)
        caml_failwith("input_value: bigarray dimension overflow in 32bit");
       size_dim = size_dim_lo;
      }
      dims.push(size_dim);
     }
    else
     for(var i = 0; i < num_dims; i++) dims.push(reader.read32u());
    var
     size = caml_ba_get_size(dims),
     data = caml_ba_create_buffer(kind, size),
     ba = caml_ba_create_unsafe(kind, layout, dims, data);
    switch(kind){
      case 2:
       for(var i = 0; i < size; i++) data[i] = reader.read8s(); break;
      case 3:
      case 12:
       for(var i = 0; i < size; i++) data[i] = reader.read8u(); break;
      case 4:
       for(var i = 0; i < size; i++) data[i] = reader.read16s(); break;
      case 5:
       for(var i = 0; i < size; i++) data[i] = reader.read16u(); break;
      case 6:
       for(var i = 0; i < size; i++) data[i] = reader.read32s(); break;
      case 8:
      case 9:
       var sixty = reader.read8u();
       if(sixty)
        caml_failwith
         ("input_value: cannot read bigarray with 64-bit OCaml ints");
       for(var i = 0; i < size; i++) data[i] = reader.read32s();
       break;
      case 7:
       var t = new Array(8);
       for(var i = 0; i < size; i++){
        for(var j = 0; j < 8; j++) t[j] = reader.read8u();
        var int64 = caml_int64_of_bytes(t);
        ba.set(i, int64);
       }
       break;
      case 1:
       var t = new Array(8);
       for(var i = 0; i < size; i++){
        for(var j = 0; j < 8; j++) t[j] = reader.read8u();
        var f = caml_int64_float_of_bits(caml_int64_of_bytes(t));
        ba.set(i, f);
       }
       break;
      case 13:
       for(var i = 0; i < size; i++) data[i] = reader.read16u(); break;
      case 0:
       for(var i = 0; i < size; i++){
        var f = caml_int32_float_of_bits(reader.read32s());
        ba.set(i, f);
       }
       break;
      case 10:
       for(var i = 0; i < size; i++){
        var
         re = caml_int32_float_of_bits(reader.read32s()),
         im = caml_int32_float_of_bits(reader.read32s());
        ba.set(i, [254, re, im]);
       }
       break;
      case 11:
       var t = new Array(8);
       for(var i = 0; i < size; i++){
        for(var j = 0; j < 8; j++) t[j] = reader.read8u();
        var re = caml_int64_float_of_bits(caml_int64_of_bytes(t));
        for(var j = 0; j < 8; j++) t[j] = reader.read8u();
        var im = caml_int64_float_of_bits(caml_int64_of_bytes(t));
        ba.set(i, [254, re, im]);
       }
       break;
    }
    sz[0] = (4 + num_dims) * 4;
    return caml_ba_create_unsafe(kind, layout, dims, data);
   }
   function caml_ba_dim(ba, i){
    if(i < 0 || i >= ba.dims.length) caml_invalid_argument("Bigarray.dim");
    return ba.dims[i];
   }
   function caml_ba_dim_1(ba){return caml_ba_dim(ba, 0);}
   function caml_ba_dim_2(ba){return caml_ba_dim(ba, 1);}
   function caml_ba_dim_3(ba){return caml_ba_dim(ba, 2);}
   function caml_ba_fill(ba, v){ba.fill(v); return 0;}
   function caml_ba_kind_of_typed_array(ta){
    var kind;
    if(ta instanceof Float32Array)
     kind = 0;
    else if(ta instanceof Float64Array)
     kind = 1;
    else if(ta instanceof Int8Array)
     kind = 2;
    else if(ta instanceof Uint8Array)
     kind = 3;
    else if(ta instanceof Uint8ClampedArray)
     kind = 3;
    else if(ta instanceof Int16Array)
     kind = 4;
    else if(ta instanceof Uint16Array)
     kind = 5;
    else if(ta instanceof Int32Array)
     kind = 6;
    else if(ta instanceof Uint32Array)
     kind = 6;
    else
     caml_invalid_argument("caml_ba_kind_of_typed_array: unsupported kind");
    return kind;
   }
   function caml_ba_from_typed_array(ta){
    var
     kind = caml_ba_kind_of_typed_array(ta),
     ta =
       ta instanceof Uint32Array
        ? new Int32Array(ta.buffer, ta.byteOffset, ta.length)
        : ta;
    return caml_ba_create_unsafe(kind, 0, [ta.length], ta);
   }
   function caml_ba_get_1(ba, i0){return ba.get(ba.offset(i0));}
   function caml_ba_get_2(ba, i0, i1){return ba.get(ba.offset([i0, i1]));}
   function caml_ba_get_3(ba, i0, i1, i2){
    return ba.get(ba.offset([i0, i1, i2]));
   }
   function caml_ba_get_generic(ba, i){
    var ofs = ba.offset(caml_js_from_array(i));
    return ba.get(ofs);
   }
   function caml_mul(a, b){return Math.imul(a, b);}
   function caml_hash_mix_int(h, d){
    d = caml_mul(d, 0xcc9e2d51 | 0);
    d = d << 15 | d >>> 32 - 15;
    d = caml_mul(d, 0x1b873593);
    h ^= d;
    h = h << 13 | h >>> 32 - 13;
    return (h + (h << 2) | 0) + (0xe6546b64 | 0) | 0;
   }
   function caml_hash_mix_float16(hash, d){
    if((d & 0x7c00) === 0x7c00 && (d & 0x03ff) !== 0)
     d = 0x7c01;
    else if(d === 0x8000) d = 0;
    return caml_hash_mix_int(hash, d);
   }
   function caml_int32_bits_of_float(x){
    jsoo_dataview.setFloat32(0, x, true);
    return jsoo_dataview.getUint32(0, true) | 0;
   }
   function caml_hash_mix_float32(hash, v){
    var i = caml_int32_bits_of_float(v);
    if((i & 0x7f800000) === 0x7f800000 && (i & 0x7fffff) !== 0)
     i = 0x7f800001;
    else if(i === (0x80000000 | 0)) i = 0;
    hash = caml_hash_mix_int(hash, i);
    return hash;
   }
   function caml_int64_create_lo_mi_hi(lo, mi, hi){return new MlInt64(lo, mi, hi);
   }
   function caml_int64_bits_of_float(x){
    jsoo_dataview.setFloat64(0, x, true);
    var
     lo32 = jsoo_dataview.getUint32(0, true),
     hi32 = jsoo_dataview.getUint32(4, true),
     lo = lo32 & 0xffffff,
     mi = lo32 >>> 24 | hi32 << 8 & 0xffffff,
     hi = hi32 >>> 16 & 0xffff;
    if((hi & 0x7ff8) === 0x7ff0 && (mi | lo | hi & 0xf) !== 0) hi |= 8;
    return caml_int64_create_lo_mi_hi(lo, mi, hi);
   }
   function caml_hash_mix_float(hash, v0){
    var
     i64 = caml_int64_bits_of_float(v0),
     l = caml_int64_lo32(i64),
     h = caml_int64_hi32(i64);
    if((h & 0x7ff00000) === 0x7ff00000 && (l | h & 0xfffff) !== 0){h = 0x7ff00000; l = 0x00000001;}
    else if(h === (0x80000000 | 0) && l === 0) h = 0;
    hash = caml_hash_mix_int(hash, l);
    hash = caml_hash_mix_int(hash, h);
    return hash;
   }
   function caml_ba_hash(ba){
    var num_elts = caml_ba_get_size(ba.dims), h = 0;
    switch(ba.kind){
      case 2:
      case 3:
      case 12:
       if(num_elts > 256) num_elts = 256;
       var w = 0, i = 0;
       for(i = 0; i + 4 <= num_elts; i += 4){
        w =
         ba.data[i + 0] & 0xff | (ba.data[i + 1] & 0xff) << 8
         | (ba.data[i + 2] & 0xff) << 16
         | ba.data[i + 3] << 24;
        h = caml_hash_mix_int(h, w);
       }
       w = 0;
       switch(num_elts & 3){
         case 3:
          w = ba.data[i + 2] << 16;
         case 2:
          w |= ba.data[i + 1] << 8;
         case 1:
          w |= ba.data[i + 0]; h = caml_hash_mix_int(h, w);
       }
       break;
      case 4:
      case 5:
       if(num_elts > 128) num_elts = 128;
       var w = 0, i = 0;
       for(i = 0; i + 2 <= num_elts; i += 2){
        w = ba.data[i + 0] & 0xffff | ba.data[i + 1] << 16;
        h = caml_hash_mix_int(h, w);
       }
       if((num_elts & 1) !== 0) h = caml_hash_mix_int(h, ba.data[i]);
       break;
      case 6:
       if(num_elts > 64) num_elts = 64;
       for(var i = 0; i < num_elts; i++) h = caml_hash_mix_int(h, ba.data[i]);
       break;
      case 8:
      case 9:
       if(num_elts > 64) num_elts = 64;
       for(var i = 0; i < num_elts; i++) h = caml_hash_mix_int(h, ba.data[i]);
       break;
      case 7:
       if(num_elts > 32) num_elts = 32;
       num_elts *= 2;
       for(var i = 0; i < num_elts; i++) h = caml_hash_mix_int(h, ba.data[i]);
       break;
      case 10:
       num_elts *= 2;
      case 0:
       if(num_elts > 64) num_elts = 64;
       for(var i = 0; i < num_elts; i++)
        h = caml_hash_mix_float32(h, ba.data[i]);
       break;
      case 11:
       num_elts *= 2;
      case 1:
       if(num_elts > 32) num_elts = 32;
       for(var i = 0; i < num_elts; i++)
        h = caml_hash_mix_float(h, ba.data[i]);
       break;
      case 13:
       if(num_elts > 128) num_elts = 128;
       for(var i = 0; i < num_elts; i++)
        h = caml_hash_mix_float16(h, ba.data[i]);
       break;
    }
    return h;
   }
   function caml_ba_init(){return 0;}
   function caml_ba_kind(ba){return ba.kind;}
   function caml_ba_layout(ba){return ba.layout;}
   function caml_ba_map_file(_vfd, _kind, _layout, _shared, _dims, _pos){caml_failwith("caml_ba_map_file not implemented");
   }
   function caml_ba_map_file_bytecode(argv, _argn){
    return caml_ba_map_file
            (argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
   }
   function caml_ba_num_dims(ba){return ba.dims.length;}
   function caml_ba_reshape(ba, vind){
    vind = caml_js_from_array(vind);
    var new_dim = [], num_dims = vind.length;
    if(num_dims < 0 || num_dims > 16)
     caml_invalid_argument("Bigarray.reshape: bad number of dimensions");
    var num_elts = 1;
    for(var i = 0; i < num_dims; i++){
     new_dim[i] = vind[i];
     if(new_dim[i] < 0)
      caml_invalid_argument("Bigarray.reshape: negative dimension");
     num_elts = num_elts * new_dim[i];
    }
    var size = caml_ba_get_size(ba.dims);
    if(num_elts !== size)
     caml_invalid_argument("Bigarray.reshape: size mismatch");
    return caml_ba_create_unsafe(ba.kind, ba.layout, new_dim, ba.data);
   }
   function caml_int64_to_bytes(x){return x.toArray();}
   function caml_ba_serialize(writer, ba, sz){
    writer.write(32, ba.dims.length);
    writer.write(32, ba.kind | ba.layout << 8);
    if(ba.caml_custom === "_bigarr02")
     for(var i = 0; i < ba.dims.length; i++)
      if(ba.dims[i] < 0xffff)
       writer.write(16, ba.dims[i]);
      else{
       writer.write(16, 0xffff);
       writer.write(32, 0);
       writer.write(32, ba.dims[i]);
      }
    else
     for(var i = 0; i < ba.dims.length; i++) writer.write(32, ba.dims[i]);
    switch(ba.kind){
      case 2:
      case 3:
      case 12:
       for(var i = 0; i < ba.data.length; i++) writer.write(8, ba.data[i]);
       break;
      case 4:
      case 5:
       for(var i = 0; i < ba.data.length; i++) writer.write(16, ba.data[i]);
       break;
      case 6:
       for(var i = 0; i < ba.data.length; i++) writer.write(32, ba.data[i]);
       break;
      case 8:
      case 9:
       writer.write(8, 0);
       for(var i = 0; i < ba.data.length; i++) writer.write(32, ba.data[i]);
       break;
      case 7:
       for(var i = 0; i < ba.data.length / 2; i++){
        var b = caml_int64_to_bytes(ba.get(i));
        for(var j = 0; j < 8; j++) writer.write(8, b[j]);
       }
       break;
      case 1:
       for(var i = 0; i < ba.data.length; i++){
        var b = caml_int64_to_bytes(caml_int64_bits_of_float(ba.get(i)));
        for(var j = 0; j < 8; j++) writer.write(8, b[j]);
       }
       break;
      case 13:
       for(var i = 0; i < ba.data.length; i++) writer.write(16, ba.data[i]);
       break;
      case 0:
       for(var i = 0; i < ba.data.length; i++){
        var b = caml_int32_bits_of_float(ba.get(i));
        writer.write(32, b);
       }
       break;
      case 10:
       for(var i = 0; i < ba.data.length / 2; i++){
        var j = ba.get(i);
        writer.write(32, caml_int32_bits_of_float(j[1]));
        writer.write(32, caml_int32_bits_of_float(j[2]));
       }
       break;
      case 11:
       for(var i = 0; i < ba.data.length / 2; i++){
        var
         complex = ba.get(i),
         b = caml_int64_to_bytes(caml_int64_bits_of_float(complex[1]));
        for(var j = 0; j < 8; j++) writer.write(8, b[j]);
        var b = caml_int64_to_bytes(caml_int64_bits_of_float(complex[2]));
        for(var j = 0; j < 8; j++) writer.write(8, b[j]);
       }
       break;
    }
    sz[0] = (4 + ba.dims.length) * 4;
    sz[1] = (4 + ba.dims.length) * 8;
   }
   function caml_ba_set_1(ba, i0, v){ba.set(ba.offset(i0), v); return 0;}
   function caml_ba_set_2(ba, i0, i1, v){
    ba.set(ba.offset([i0, i1]), v);
    return 0;
   }
   function caml_ba_set_3(ba, i0, i1, i2, v){
    ba.set(ba.offset([i0, i1, i2]), v);
    return 0;
   }
   function caml_ba_set_generic(ba, i, v){
    ba.set(ba.offset(caml_js_from_array(i)), v);
    return 0;
   }
   function caml_ba_slice(ba, vind){
    vind = caml_js_from_array(vind);
    var num_inds = vind.length, index = [], sub_dims = [], ofs;
    if(num_inds > ba.dims.length)
     caml_invalid_argument("Bigarray.slice: too many indices");
    if(ba.layout === 0){
     for(var i = 0; i < num_inds; i++) index[i] = vind[i];
     for(; i < ba.dims.length; i++) index[i] = 0;
     sub_dims = ba.dims.slice(num_inds);
    }
    else{
     for(var i = 0; i < num_inds; i++)
      index[ba.dims.length - num_inds + i] = vind[i];
     for(var i = 0; i < ba.dims.length - num_inds; i++) index[i] = 1;
     sub_dims = ba.dims.slice(0, ba.dims.length - num_inds);
    }
    ofs = ba.offset(index);
    var
     size = caml_ba_get_size(sub_dims),
     size_per_element = caml_ba_get_size_per_element(ba.kind),
     new_data =
       ba.data.subarray
        (ofs * size_per_element, (ofs + size) * size_per_element);
    return caml_ba_create_unsafe(ba.kind, ba.layout, sub_dims, new_data);
   }
   function caml_ba_sub(ba, ofs, len){
    var changed_dim, mul = 1;
    if(ba.layout === 0){
     for(var i = 1; i < ba.dims.length; i++) mul = mul * ba.dims[i];
     changed_dim = 0;
    }
    else{
     for(var i = 0; i < ba.dims.length - 1; i++) mul = mul * ba.dims[i];
     changed_dim = ba.dims.length - 1;
     ofs = ofs - 1;
    }
    if(ofs < 0 || len < 0 || ofs + len > ba.dims[changed_dim])
     caml_invalid_argument("Bigarray.sub: bad sub-array");
    var new_dims = [];
    for(var i = 0; i < ba.dims.length; i++) new_dims[i] = ba.dims[i];
    new_dims[changed_dim] = len;
    mul *= caml_ba_get_size_per_element(ba.kind);
    var new_data = ba.data.subarray(ofs * mul, (ofs + len) * mul);
    return caml_ba_create_unsafe(ba.kind, ba.layout, new_dims, new_data);
   }
   function caml_ba_to_typed_array(ba){return ba.data;}
   function caml_ba_uint8_get16(ba, i0){
    var ofs = ba.offset(i0);
    if(ofs + 1 >= ba.data.length) caml_array_bound_error();
    var b1 = ba.get(ofs), b2 = ba.get(ofs + 1);
    return b1 | b2 << 8;
   }
   function caml_ba_uint8_get32(ba, i0){
    var ofs = ba.offset(i0);
    if(ofs + 3 >= ba.data.length) caml_array_bound_error();
    var
     b1 = ba.get(ofs + 0),
     b2 = ba.get(ofs + 1),
     b3 = ba.get(ofs + 2),
     b4 = ba.get(ofs + 3);
    return b1 << 0 | b2 << 8 | b3 << 16 | b4 << 24;
   }
   function caml_ba_uint8_get64(ba, i0){
    var ofs = ba.offset(i0);
    if(ofs + 7 >= ba.data.length) caml_array_bound_error();
    var
     b1 = ba.get(ofs + 0),
     b2 = ba.get(ofs + 1),
     b3 = ba.get(ofs + 2),
     b4 = ba.get(ofs + 3),
     b5 = ba.get(ofs + 4),
     b6 = ba.get(ofs + 5),
     b7 = ba.get(ofs + 6),
     b8 = ba.get(ofs + 7);
    return caml_int64_of_bytes([b8, b7, b6, b5, b4, b3, b2, b1]);
   }
   function caml_ba_uint8_set16(ba, i0, v){
    var ofs = ba.offset(i0);
    if(ofs + 1 >= ba.data.length) caml_array_bound_error();
    ba.set(ofs + 0, v & 0xff);
    ba.set(ofs + 1, v >>> 8 & 0xff);
    return 0;
   }
   function caml_ba_uint8_set32(ba, i0, v){
    var ofs = ba.offset(i0);
    if(ofs + 3 >= ba.data.length) caml_array_bound_error();
    ba.set(ofs + 0, v & 0xff);
    ba.set(ofs + 1, v >>> 8 & 0xff);
    ba.set(ofs + 2, v >>> 16 & 0xff);
    ba.set(ofs + 3, v >>> 24 & 0xff);
    return 0;
   }
   function caml_ba_uint8_set64(ba, i0, v){
    var ofs = ba.offset(i0);
    if(ofs + 7 >= ba.data.length) caml_array_bound_error();
    var v = caml_int64_to_bytes(v);
    for(var i = 0; i < 8; i++) ba.set(ofs + i, v[7 - i]);
    return 0;
   }
   function caml_backtrace_status(_unit){
    return caml_record_backtrace_runtime_flag ? 1 : 0;
   }
   function caml_bigstring_blit_ba_to_ba(ba1, pos1, ba2, pos2, len){
    if(12 !== ba1.kind)
     caml_invalid_argument("caml_bigstring_blit_ba_to_ba: kind mismatch");
    if(12 !== ba2.kind)
     caml_invalid_argument("caml_bigstring_blit_ba_to_ba: kind mismatch");
    if(len === 0) return 0;
    var ofs1 = ba1.offset(pos1), ofs2 = ba2.offset(pos2);
    if(ofs1 + len > ba1.data.length) caml_array_bound_error();
    if(ofs2 + len > ba2.data.length) caml_array_bound_error();
    var slice = ba1.data.subarray(ofs1, ofs1 + len);
    ba2.data.set(slice, pos2);
    return 0;
   }
   function caml_bigstring_blit_ba_to_bytes(ba1, pos1, bytes2, pos2, len){
    if(12 !== ba1.kind)
     caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch");
    if(len === 0) return 0;
    var ofs1 = ba1.offset(pos1);
    if(ofs1 + len > ba1.data.length) caml_array_bound_error();
    if(pos2 + len > caml_ml_bytes_length(bytes2)) caml_array_bound_error();
    var slice = ba1.data.subarray(ofs1, ofs1 + len);
    caml_blit_bytes(caml_bytes_of_uint8_array(slice), 0, bytes2, pos2, len);
    return 0;
   }
   function caml_bigstring_blit_bytes_to_ba(str1, pos1, ba2, pos2, len){
    if(12 !== ba2.kind)
     caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch");
    if(len === 0) return 0;
    var ofs2 = ba2.offset(pos2);
    if(pos1 + len > caml_ml_bytes_length(str1)) caml_array_bound_error();
    if(ofs2 + len > ba2.data.length) caml_array_bound_error();
    var slice = caml_uint8_array_of_bytes(str1).subarray(pos1, pos1 + len);
    ba2.data.set(slice, ofs2);
    return 0;
   }
   function caml_bigstring_blit_string_to_ba(str1, pos1, ba2, pos2, len){
    if(12 !== ba2.kind)
     caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch");
    if(len === 0) return 0;
    var ofs2 = ba2.offset(pos2);
    if(pos1 + len > caml_ml_string_length(str1)) caml_array_bound_error();
    if(ofs2 + len > ba2.data.length) caml_array_bound_error();
    var slice = caml_uint8_array_of_string(str1).subarray(pos1, pos1 + len);
    ba2.data.set(slice, ofs2);
    return 0;
   }
   function caml_bigstring_memcmp(s1, pos1, s2, pos2, len){
    for(var i = 0; i < len; i++){
     var a = caml_ba_get_1(s1, pos1 + i), b = caml_ba_get_1(s2, pos2 + i);
     if(a < b) return - 1;
     if(a > b) return 1;
    }
    return 0;
   }
   function caml_blake2_create(hashlen, key){
    key = caml_uint8_array_of_string(key);
    if(key.length > 64) key.subarray(0, 64);
    return blake2b.Init(hashlen, key);
   }
   function caml_blake2_final(ctx, _hashlen){
    var r = blake2b.Final(ctx);
    return caml_string_of_uint8_array(r);
   }
   function caml_blake2_update(ctx, buf, ofs, len){
    var input = caml_uint8_array_of_string(buf);
    input = input.subarray(ofs, ofs + len);
    blake2b.Update(ctx, input);
    return 0;
   }
   function caml_blake2_string(hashlen, key, buf, ofs, len){
    var ctx = caml_blake2_create(hashlen, key);
    caml_blake2_update(ctx, buf, ofs, len);
    return caml_blake2_final(ctx, hashlen);
   }
   function caml_blit_string(a, b, c, d, e){
    caml_blit_bytes(caml_bytes_of_string(a), b, c, d, e);
    return 0;
   }
   function caml_bswap16(x){return (x & 0x00ff) << 8 | (x & 0xff00) >> 8;}
   var jsoo_text_decoder_buff = new ArrayBuffer(1024);
   function caml_jsstring_of_string(s){
    if(jsoo_is_ascii(s)) return s;
    var
     a =
       s.length <= jsoo_text_decoder_buff.length
        ? new Uint8Array(jsoo_text_decoder_buff, 0, s.length)
        : new Uint8Array(s.length);
    for(var i = 0; i < s.length; i++) a[i] = s.charCodeAt(i);
    return jsoo_text_decoder.decode(a);
   }
   function caml_build_symbols(symb){
    var r = {}, max = - 1;
    if(symb)
     for(var i = 1; i < symb.length; i++){
      var idx = symb[i][2];
      max = Math.max(max, idx);
      r[caml_jsstring_of_string(symb[i][1])] = idx;
     }
    r.next_idx = max + 1;
    return r;
   }
   function caml_bytes_compare(s1, s2){
    s1.t & 6 && caml_convert_string_to_bytes(s1);
    s2.t & 6 && caml_convert_string_to_bytes(s2);
    return s1.c < s2.c ? - 1 : s1.c > s2.c ? 1 : 0;
   }
   function caml_bytes_equal(s1, s2){
    if(s1 === s2) return 1;
    s1.t & 6 && caml_convert_string_to_bytes(s1);
    s2.t & 6 && caml_convert_string_to_bytes(s2);
    return s1.c === s2.c ? 1 : 0;
   }
   function caml_bytes_unsafe_get(s, i){
    switch(s.t & 6){
      case 0:
       return s.c.charCodeAt(i);
      case 2:
       if(i >= s.c.length) return 0; return s.c.charCodeAt(i);
      case 4:
       return s.c[i];
    }
   }
   function caml_bytes_get(s, i){
    if(i >>> 0 >= s.l) caml_bytes_bound_error();
    return caml_bytes_unsafe_get(s, i);
   }
   function caml_bytes_get16(s, i){
    if(i >>> 0 >= s.l - 1) caml_bytes_bound_error();
    var
     b1 = caml_bytes_unsafe_get(s, i),
     b2 = caml_bytes_unsafe_get(s, i + 1);
    return b2 << 8 | b1;
   }
   function caml_bytes_get32(s, i){
    if(i >>> 0 >= s.l - 3) caml_bytes_bound_error();
    var
     b1 = caml_bytes_unsafe_get(s, i),
     b2 = caml_bytes_unsafe_get(s, i + 1),
     b3 = caml_bytes_unsafe_get(s, i + 2),
     b4 = caml_bytes_unsafe_get(s, i + 3);
    return b4 << 24 | b3 << 16 | b2 << 8 | b1;
   }
   function caml_bytes_get64(s, i){
    if(i >>> 0 >= s.l - 7) caml_bytes_bound_error();
    var a = new Array(8);
    for(var j = 0; j < 8; j++) a[7 - j] = caml_bytes_unsafe_get(s, i + j);
    return caml_int64_of_bytes(a);
   }
   function caml_bytes_lessequal(s1, s2){
    s1.t & 6 && caml_convert_string_to_bytes(s1);
    s2.t & 6 && caml_convert_string_to_bytes(s2);
    return s1.c <= s2.c ? 1 : 0;
   }
   function caml_bytes_greaterequal(s1, s2){return caml_bytes_lessequal(s2, s1);
   }
   function caml_bytes_lessthan(s1, s2){
    s1.t & 6 && caml_convert_string_to_bytes(s1);
    s2.t & 6 && caml_convert_string_to_bytes(s2);
    return s1.c < s2.c ? 1 : 0;
   }
   function caml_bytes_greaterthan(s1, s2){return caml_bytes_lessthan(s2, s1);
   }
   function caml_bytes_notequal(s1, s2){return 1 - caml_bytes_equal(s1, s2);}
   function caml_bytes_of_utf16_jsstring(s){
    if(jsoo_is_ascii(s))
     return new MlBytes(9, s, s.length);
    else{
     var a = jsoo_text_encoder.encode(s);
     return new MlBytes(4, a, a.length);
    }
   }
   function caml_bytes_set16(s, i, i16){
    if(i >>> 0 >= s.l - 1) caml_bytes_bound_error();
    var b2 = 0xff & i16 >> 8, b1 = 0xff & i16;
    caml_bytes_unsafe_set(s, i + 0, b1);
    caml_bytes_unsafe_set(s, i + 1, b2);
    return 0;
   }
   function caml_bytes_set32(s, i, i32){
    if(i >>> 0 >= s.l - 3) caml_bytes_bound_error();
    var
     b4 = 0xff & i32 >> 24,
     b3 = 0xff & i32 >> 16,
     b2 = 0xff & i32 >> 8,
     b1 = 0xff & i32;
    caml_bytes_unsafe_set(s, i + 0, b1);
    caml_bytes_unsafe_set(s, i + 1, b2);
    caml_bytes_unsafe_set(s, i + 2, b3);
    caml_bytes_unsafe_set(s, i + 3, b4);
    return 0;
   }
   function caml_bytes_set64(s, i, i64){
    if(i >>> 0 >= s.l - 7) caml_bytes_bound_error();
    var a = caml_int64_to_bytes(i64);
    for(var j = 0; j < 8; j++) caml_bytes_unsafe_set(s, i + 7 - j, a[j]);
    return 0;
   }
   var caml_callback = caml_call_gen;
   function caml_cbrt_float(x){return Math.cbrt(x);}
   class caml_ml_channels_state{
     constructor(){
      this.map = new globalThis.WeakMap();
      this.opened = new globalThis.Set();
     }
     close(chanid){this.opened.delete(chanid);}
     get(chanid){return this.map.get(chanid);}
     set(chanid, val){
      if(val.opened) this.opened.add(chanid);
      return this.map.set(chanid, val);
     }
     all(){return this.opened.values();}
   }
   var caml_ml_channels = new caml_ml_channels_state();
   function caml_ml_channel_get(id){return caml_ml_channels.get(id);}
   function caml_channel_descriptor(chanid){
    var chan = caml_ml_channel_get(chanid);
    return chan.fd;
   }
   function caml_check_bound(array, index){
    if(index >>> 0 >= array.length - 1) caml_array_bound_error();
    return array;
   }
   function caml_classify_float(x){
    if(Number.isFinite(x)){
     if(Math.abs(x) >= 2.2250738585072014e-308) return 0;
     if(x !== 0) return 1;
     return 2;
    }
    return Number.isNaN(x) ? 4 : 3;
   }
   function caml_is_continuation_tag(t){return t === 245 ? 1 : 0;}
   function caml_int32_unmarshal(reader, size){size[0] = 4; return reader.read32s();
   }
   function caml_nativeint_unmarshal(reader, size){
    switch(reader.read8u()){
      case 1:
       size[0] = 4; return reader.read32s();
      case 2:
       caml_failwith("input_value: native integer value too large"); break;
      default: caml_failwith("input_value: ill-formed native integer");
    }
   }
   function caml_int64_unmarshal(reader, size){
    var t = new Array(8);
    for(var j = 0; j < 8; j++) t[j] = reader.read8u();
    size[0] = 8;
    return caml_int64_of_bytes(t);
   }
   function caml_int64_marshal(writer, v, sizes){
    var b = caml_int64_to_bytes(v);
    for(var i = 0; i < 8; i++) writer.write(8, b[i]);
    sizes[0] = 8;
    sizes[1] = 8;
   }
   function caml_int64_compare(x, y, _total){return x.compare(y);}
   function caml_int64_hash(v){return v.lo32() ^ v.hi32();}
   var
    caml_custom_ops =
      {_j:
       {deserialize: caml_int64_unmarshal,
        serialize: caml_int64_marshal,
        fixed_length: 8,
        compare: caml_int64_compare,
        hash: caml_int64_hash},
       _i: {deserialize: caml_int32_unmarshal, fixed_length: 4},
       _n: {deserialize: caml_nativeint_unmarshal, fixed_length: 4},
       _bigarray:
       {deserialize:
        function(reader, sz){
         return caml_ba_deserialize(reader, sz, "_bigarray");
        },
        serialize: caml_ba_serialize,
        compare: caml_ba_compare,
        hash: caml_ba_hash},
       _bigarr02:
       {deserialize:
        function(reader, sz){
         return caml_ba_deserialize(reader, sz, "_bigarr02");
        },
        serialize: caml_ba_serialize,
        compare: caml_ba_compare,
        hash: caml_ba_hash}};
   function caml_compare_val_get_custom(a){
    return caml_custom_ops[a.caml_custom]
           && caml_custom_ops[a.caml_custom].compare;
   }
   function caml_compare_val_number_custom(num, custom, swap, total){
    var comp = caml_compare_val_get_custom(custom);
    if(comp){
     var x = swap > 0 ? comp(custom, num, total) : comp(num, custom, total);
     if(total && Number.isNaN(x)) return swap;
     if(Number.isNaN(+ x)) return + x;
     if((x | 0) !== 0) return x | 0;
    }
    return swap;
   }
   function caml_compare_val_tag(a){
    if(typeof a === "number")
     return 1000;
    else if(caml_is_ml_bytes(a))
     return 252;
    else if(caml_is_ml_string(a))
     return 1252;
    else if(Array.isArray(a) && a[0] === a[0] >>> 0 && a[0] <= 255){var tag = a[0] | 0; return tag === 254 ? 0 : tag;}
    else if(a instanceof String)
     return 12520;
    else if(typeof a === "string")
     return 12520;
    else if(a instanceof Number)
     return 1000;
    else if(a?.caml_custom)
     return 1255;
    else if(a?.compare)
     return 1256;
    else if(typeof a === "function")
     return 1247;
    else if(typeof a === "symbol") return 1251;
    return 1001;
   }
   function caml_int_compare(a, b){
    if(a < b) return - 1;
    if(a === b) return 0;
    return 1;
   }
   function caml_string_compare(s1, s2){
    return s1 < s2 ? - 1 : s1 > s2 ? 1 : 0;
   }
   function caml_compare_val(a, b, total){
    var stack = [];
    for(;;){
     if(! (total && a === b)){
      var tag_a = caml_compare_val_tag(a);
      if(tag_a === 250){a = a[1]; continue;}
      var tag_b = caml_compare_val_tag(b);
      if(tag_b === 250){b = b[1]; continue;}
      if(tag_a !== tag_b){
       if(tag_a === 1000){
        if(tag_b === 1255)
         return caml_compare_val_number_custom(a, b, - 1, total);
        return - 1;
       }
       if(tag_b === 1000){
        if(tag_a === 1255)
         return caml_compare_val_number_custom(b, a, 1, total);
        return 1;
       }
       return tag_a < tag_b ? - 1 : 1;
      }
      switch(tag_a){
        case 247:
         caml_invalid_argument("compare: functional value"); break;
        case 248:
         var x = caml_int_compare(a[2], b[2]) | 0;
         if(x !== 0) return x;
         break;
        case 249:
         caml_invalid_argument("compare: functional value"); break;
        case 250:
         caml_invalid_argument("equal: got Forward_tag, should not happen");
         break;
        case 251:
         caml_invalid_argument("equal: abstract value"); break;
        case 252:
         if(a !== b){
          var x = caml_bytes_compare(a, b) | 0;
          if(x !== 0) return x;
         }
         break;
        case 253:
         caml_invalid_argument("equal: got Double_tag, should not happen");
         break;
        case 254:
         caml_invalid_argument
          ("equal: got Double_array_tag, should not happen");
         break;
        case 255:
         caml_invalid_argument("equal: got Custom_tag, should not happen");
         break;
        case 1247:
         caml_invalid_argument("compare: functional value"); break;
        case 1255:
         var comp = caml_compare_val_get_custom(a);
         if(comp !== caml_compare_val_get_custom(b))
          return a.caml_custom < b.caml_custom ? - 1 : 1;
         if(! comp) caml_invalid_argument("compare: abstract value");
         var x = comp(a, b, total);
         if(Number.isNaN(x)) return total ? - 1 : x;
         if(x !== (x | 0)) return - 1;
         if(x !== 0) return x | 0;
         break;
        case 1256:
         var x = a.compare(b, total);
         if(Number.isNaN(x)) return total ? - 1 : x;
         if(x !== (x | 0)) return - 1;
         if(x !== 0) return x | 0;
         break;
        case 1000:
         a = + a;
         b = + b;
         if(a < b) return - 1;
         if(a > b) return 1;
         if(a !== b){
          if(! total) return Number.NaN;
          if(! Number.isNaN(a)) return 1;
          if(! Number.isNaN(b)) return - 1;
         }
         break;
        case 1001:
         if(a < b) return - 1;
         if(a > b) return 1;
         if(a !== b) return total ? 1 : Number.NaN;
         break;
        case 1251:
         if(a !== b) return total ? 1 : Number.NaN; break;
        case 1252:
         var a = caml_jsbytes_of_string(a), b = caml_jsbytes_of_string(b);
         if(a !== b){if(a < b) return - 1; if(a > b) return 1;}
         break;
        case 12520:
         var a = a.toString(), b = b.toString();
         if(a !== b){if(a < b) return - 1; if(a > b) return 1;}
         break;
        default:
         if(caml_is_continuation_tag(tag_a)){
          caml_invalid_argument("compare: continuation value");
          break;
         }
         if(a.length !== b.length) return a.length < b.length ? - 1 : 1;
         if(a.length > 1) stack.push(a, b, 1);
         break;
      }
     }
     if(stack.length === 0) return 0;
     var i = stack.pop();
     b = stack.pop();
     a = stack.pop();
     if(i + 1 < a.length) stack.push(a, b, i + 1);
     a = a[i];
     b = b[i];
    }
   }
   function caml_compare(a, b){return caml_compare_val(a, b, true);}
   function caml_continuation_use_noexc(cont){
    var stack = cont[1];
    cont[1] = 0;
    return stack;
   }
   function caml_continuation_use_and_update_handler_noexc
   (cont, hval, hexn, heff){
    var stack = caml_continuation_use_noexc(cont);
    if(stack === 0) return stack;
    var last = cont[2];
    last.h[1] = hval;
    last.h[2] = hexn;
    last.h[3] = heff;
    return stack;
   }
   function caml_convert_raw_backtrace(){return [0];}
   function caml_convert_raw_backtrace_slot(_rbt){
    caml_failwith("caml_convert_raw_backtrace_slot");
   }
   function caml_copysign_float(x, y){
    if(y === 0) y = 1 / y;
    x = Math.abs(x);
    return y < 0 ? - x : x;
   }
   function caml_cosh_float(x){return Math.cosh(x);}
   function fs_node_supported(){
    return globalThis.process?.versions?.node !== undefined;
   }
   function make_path_is_absolute(){
    function posix(path){
     if(path.charAt(0) === "/") return ["", path.slice(1)];
     return;
    }
    function win32(path){
     var
      splitDeviceRe =
        /^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,
      result = splitDeviceRe.exec(path),
      device = result[1] || "",
      isUnc = device.length > 0 && device.charAt(1) !== ":";
     if(result[2] || isUnc){
      var root = result[1] || "", sep = result[2] || "";
      return [root, path.slice(root.length + sep.length)];
     }
     return;
    }
    return jsoo_is_win32 ? win32 : posix;
   }
   var path_is_absolute = make_path_is_absolute();
   function caml_trailing_slash(name){
    return name.slice(- 1) !== "/" ? name + "/" : name;
   }
   if(fs_node_supported() && globalThis.process && globalThis.process.cwd)
    var caml_current_dir = globalThis.process.cwd().replace(/\\/g, "/");
   else
    var caml_current_dir = "/static";
   caml_current_dir = caml_trailing_slash(caml_current_dir);
   function caml_make_path(name){
    name = caml_jsstring_of_string(name);
    if(! path_is_absolute(name)) name = caml_current_dir + name;
    var
     comp0 = path_is_absolute(name),
     comp = comp0[1].split(/[/\\]/),
     ncomp = [];
    for(var i = 0; i < comp.length; i++)
     switch(comp[i]){
       case "..":
        ncomp.pop(); break;
       case ".": break;
       case "": break;
       default: ncomp.push(comp[i]); break;
     }
    ncomp.unshift(comp0[0]);
    ncomp.orig = name;
    return ncomp;
   }
   function caml_get_root(path){
    var x = path_is_absolute(path);
    if(! x) return;
    return x[0] + "/";
   }
   var
    caml_root =
      caml_get_root(caml_current_dir)
      || caml_failwith("unable to compute caml_root"),
    jsoo_mount_point = [];
   if(fs_node_supported())
    jsoo_mount_point.push
     ({path: caml_root, device: new MlNodeDevice(caml_root)});
   else
    jsoo_mount_point.push
     ({path: caml_root, device: new MlFakeDevice(caml_root)});
   jsoo_mount_point.push
    ({path: "/static/", device: new MlFakeDevice("/static/")});
   function resolve_fs_device(name){
    var
     path = caml_make_path(name),
     name = path.join("/"),
     name_slash = caml_trailing_slash(name),
     res;
    for(var i = 0; i < jsoo_mount_point.length; i++){
     var m = jsoo_mount_point[i];
     if
      (name_slash.search(m.path) === 0
       && (! res || res.path.length < m.path.length))
      res =
       {path: m.path,
        device: m.device,
        rest: name.slice(m.path.length, name.length)};
    }
    if(! res && fs_node_supported()){
     var root = caml_get_root(name);
     if(root?.match(/^[a-zA-Z]:\/$/)){
      var m = {path: root, device: new MlNodeDevice(root)};
      jsoo_mount_point.push(m);
      res =
       {path: m.path,
        device: m.device,
        rest: name.slice(m.path.length, name.length)};
     }
    }
    if(res) return res;
    caml_raise_sys_error("no device found for " + name_slash);
   }
   function caml_create_file(name, content){
    var root = resolve_fs_device(name);
    if(! root.device.register) caml_failwith("cannot register file");
    root.device.register(root.rest, content);
    return 0;
   }
   function caml_create_string(_len){caml_invalid_argument("String.create");}
   var caml_custom_event_index = 0;
   function caml_custom_identifier(o){
    return caml_string_of_jsstring(o.caml_custom || "");
   }
   var
    zstd_decompress =
      function(){
        var
         ab = ArrayBuffer,
         u8 = Uint8Array,
         u16 = Uint16Array,
         i16 = Int16Array,
         i32 = Int32Array;
        function slc(v, s, e){
         if(u8.prototype.slice) return u8.prototype.slice.call(v, s, e);
         if(s == null || s < 0) s = 0;
         if(e == null || e > v.length) e = v.length;
         var n = new u8(e - s);
         n.set(v.subarray(s, e));
         return n;
        }
        function fill(v, n, s, e){
         if(u8.prototype.fill) return u8.prototype.fill.call(v, n, s, e);
         if(s == null || s < 0) s = 0;
         if(e == null || e > v.length) e = v.length;
         for(; s < e; ++s) v[s] = n;
         return v;
        }
        function cpw(v, t, s, e){
         if(u8.prototype.copyWithin)
          return u8.prototype.copyWithin.call(v, t, s, e);
         if(s == null || s < 0) s = 0;
         if(e == null || e > v.length) e = v.length;
         while(s < e) v[t++] = v[s++];
        }
        var
         ec =
           ["invalid zstd data",
            "window size too large (>2046MB)",
            "invalid block type",
            "FSE accuracy too high",
            "match distance too far back",
            "unexpected EOF"];
        function err(ind, msg, nt){
         var e = new Error(msg || ec[ind]);
         e.code = ind;
         if(! nt) throw e;
         return e;
        }
        function rb(d, b, n){
         var i = 0, o = 0;
         for(; i < n; ++i) o |= d[b++] << (i << 3);
         return o;
        }
        function b4(d, b){
         return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;
        }
        function rzfh(dat, w){
         var n3 = dat[0] | dat[1] << 8 | dat[2] << 16;
         if(n3 === 0x2fb528 && dat[3] === 253){
          var
           flg = dat[4],
           ss = flg >> 5 & 1,
           cc = flg >> 2 & 1,
           df = flg & 3,
           fcf = flg >> 6;
          if(flg & 8) err(0);
          var bt = 6 - ss, db = df === 3 ? 4 : df, di = rb(dat, bt, db);
          bt += db;
          var
           fsb = fcf ? 1 << fcf : ss,
           fss = rb(dat, bt, fsb) + (fcf === 1 && 256),
           ws = fss;
          if(! ss){
           var wb = 1 << 10 + (dat[5] >> 3);
           ws = wb + (wb >> 3) * (dat[5] & 7);
          }
          if(ws > 2145386496) err(1);
          var buf = new u8((w === 1 ? fss || ws : w ? 0 : ws) + 12);
          buf[0] = 1, buf[4] = 4, buf[8] = 8;
          return {b: bt + fsb,
                  y: 0,
                  l: 0,
                  d: di,
                  w: w && w !== 1 ? w : buf.subarray(12),
                  e: ws,
                  o: new i32(buf.buffer, 0, 3),
                  u: fss,
                  c: cc,
                  m: Math.min(131072, ws)};
         }
         else if((n3 >> 4 | dat[3] << 20) === 0x184d2a5)
          return b4(dat, 4) + 8;
         err(0);
        }
        function msb(val){
         var bits = 0;
         for(; 1 << bits <= val; ++bits) ;
         return bits - 1;
        }
        function rfse(dat, bt, mal){
         var tpos = (bt << 3) + 4, al = (dat[bt] & 15) + 5;
         if(al > mal) err(3);
         var
          sz = 1 << al,
          probs = sz,
          sym = - 1,
          re = - 1,
          i = - 1,
          ht = sz,
          buf = new ab(512 + (sz << 2)),
          freq = new i16(buf, 0, 256),
          dstate = new u16(buf, 0, 256),
          nstate = new u16(buf, 512, sz),
          bb1 = 512 + (sz << 1),
          syms = new u8(buf, bb1, sz),
          nbits = new u8(buf, bb1 + sz);
         while(sym < 255 && probs > 0){
          var
           bits = msb(probs + 1),
           cbt = tpos >> 3,
           msk = (1 << bits + 1) - 1,
           val =
             (dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16) >> (tpos & 7)
             & msk,
           msk1fb = (1 << bits) - 1,
           msv = msk - probs - 1,
           sval = val & msk1fb;
          if(sval < msv)
           tpos += bits, val = sval;
          else{tpos += bits + 1; if(val > msk1fb) val -= msv;}
          freq[++sym] = --val;
          if(val === - 1){probs += val; syms[--ht] = sym;} else probs -= val;
          if(! val)
           do{
            var rbt = tpos >> 3;
            re = (dat[rbt] | dat[rbt + 1] << 8) >> (tpos & 7) & 3;
            tpos += 2;
            sym += re;
           }
           while
            (re === 3);
         }
         if(sym > 255 || probs) err(0);
         var sympos = 0, sstep = (sz >> 1) + (sz >> 3) + 3, smask = sz - 1;
         for(var s = 0; s <= sym; ++s){
          var sf = freq[s];
          if(sf < 1){dstate[s] = - sf; continue;}
          for(i = 0; i < sf; ++i){
           syms[sympos] = s;
           do sympos = sympos + sstep & smask;while(sympos >= ht);
          }
         }
         if(sympos) err(0);
         for(i = 0; i < sz; ++i){
          var ns = dstate[syms[i]]++, nb = nbits[i] = al - msb(ns);
          nstate[i] = (ns << nb) - sz;
         }
         return [tpos + 7 >> 3, {b: al, s: syms, n: nbits, t: nstate}];
        }
        function rhu(dat, bt){
         var
          i = 0,
          wc = - 1,
          buf = new u8(292),
          hb = dat[bt],
          hw = buf.subarray(0, 256),
          rc = buf.subarray(256, 268),
          ri = new u16(buf.buffer, 268);
         if(hb < 128){
          var _a = rfse(dat, bt + 1, 6), ebt = _a[0], fdt = _a[1];
          bt += hb;
          var epos = ebt << 3, lb = dat[bt];
          if(! lb) err(0);
          var
           st1 = 0,
           st2 = 0,
           btr1 = fdt.b,
           btr2 = btr1,
           fpos = (++bt << 3) - 8 + msb(lb);
          for(;;){
           fpos -= btr1;
           if(fpos < epos) break;
           var cbt = fpos >> 3;
           st1 +=
            (dat[cbt] | dat[cbt + 1] << 8) >> (fpos & 7) & (1 << btr1) - 1;
           hw[++wc] = fdt.s[st1];
           fpos -= btr2;
           if(fpos < epos) break;
           cbt = fpos >> 3;
           st2 +=
            (dat[cbt] | dat[cbt + 1] << 8) >> (fpos & 7) & (1 << btr2) - 1;
           hw[++wc] = fdt.s[st2];
           btr1 = fdt.n[st1];
           st1 = fdt.t[st1];
           btr2 = fdt.n[st2];
           st2 = fdt.t[st2];
          }
          if(++wc > 255) err(0);
         }
         else{
          wc = hb - 127;
          for(; i < wc; i += 2){
           var byte = dat[++bt];
           hw[i] = byte >> 4;
           hw[i + 1] = byte & 15;
          }
          ++bt;
         }
         var wes = 0;
         for(i = 0; i < wc; ++i){
          var wt = hw[i];
          if(wt > 11) err(0);
          wes += wt && 1 << wt - 1;
         }
         var mb = msb(wes) + 1, ts = 1 << mb, rem = ts - wes;
         if(rem & rem - 1) err(0);
         hw[wc++] = msb(rem) + 1;
         for(i = 0; i < wc; ++i){
          var wt = hw[i];
          ++rc[hw[i] = wt && mb + 1 - wt];
         }
         var
          hbuf = new u8(ts << 1),
          syms = hbuf.subarray(0, ts),
          nb = hbuf.subarray(ts);
         ri[mb] = 0;
         for(i = mb; i > 0; --i){
          var pv = ri[i];
          fill(nb, i, pv, ri[i - 1] = pv + rc[i] * (1 << mb - i));
         }
         if(ri[0] !== ts) err(0);
         for(i = 0; i < wc; ++i){
          var bits = hw[i];
          if(bits){
           var code = ri[bits];
           fill(syms, i, code, ri[bits] = code + (1 << mb - bits));
          }
         }
         return [bt, {n: nb, b: mb, s: syms}];
        }
        var
         dllt =
           rfse
             (new
               u8
               ([81,
                 16,
                 99,
                 140,
                 49,
                 198,
                 24,
                 99,
                 12,
                 33,
                 196,
                 24,
                 99,
                 102,
                 102,
                 134,
                 70,
                 146,
                 4]),
              0,
              6)
            [1],
         dmlt =
           rfse
             (new
               u8
               ([33,
                 20,
                 196,
                 24,
                 99,
                 140,
                 33,
                 132,
                 16,
                 66,
                 8,
                 33,
                 132,
                 16,
                 66,
                 8,
                 33,
                 68,
                 68,
                 68,
                 68,
                 68,
                 68,
                 68,
                 68,
                 36,
                 9]),
              0,
              6)
            [1],
         doct =
           rfse
             (new u8([32, 132, 16, 66, 102, 70, 68, 68, 68, 68, 36, 73, 2]),
              0,
              5)
            [1];
        function b2bl(b, s){
         var len = b.length, bl = new i32(len);
         for(var i = 0; i < len; ++i){bl[i] = s; s += 1 << b[i];}
         return bl;
        }
        var
         llb =
           new
            u8
            (new
              i32
              ([0,
                0,
                0,
                0,
                16843009,
                50528770,
                134678020,
                202050057,
                269422093]).buffer,
             0,
             36),
         llbl = b2bl(llb, 0),
         mlb =
           new
            u8
            (new
              i32
              ([0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                16843009,
                50528770,
                117769220,
                185207048,
                252579084,
                16]).buffer,
             0,
             53),
         mlbl = b2bl(mlb, 3);
        function dhu(dat, out, hu){
         var
          len = dat.length,
          ss = out.length,
          lb = dat[len - 1],
          msk = (1 << hu.b) - 1,
          eb = - hu.b;
         if(! lb) err(0);
         var
          st = 0,
          btr = hu.b,
          pos = (len << 3) - 8 + msb(lb) - btr,
          i = - 1;
         while(pos > eb && i < ss){
          var
           cbt = pos >> 3,
           val =
             (dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16) >> (pos & 7);
          st = (st << btr | val) & msk;
          out[++i] = hu.s[st];
          pos -= btr = hu.n[st];
         }
         if(pos !== eb || i + 1 !== ss) err(0);
        }
        function dhu4(dat, out, hu){
         var
          bt = 6,
          ss = out.length,
          sz1 = ss + 3 >> 2,
          sz2 = sz1 << 1,
          sz3 = sz1 + sz2;
         dhu
          (dat.subarray(bt, bt += dat[0] | dat[1] << 8),
           out.subarray(0, sz1),
           hu);
         dhu
          (dat.subarray(bt, bt += dat[2] | dat[3] << 8),
           out.subarray(sz1, sz2),
           hu);
         dhu
          (dat.subarray(bt, bt += dat[4] | dat[5] << 8),
           out.subarray(sz2, sz3),
           hu);
         dhu(dat.subarray(bt), out.subarray(sz3), hu);
        }
        function rzb(dat, st, out){
         var _a, bt = st.b, b0 = dat[bt], btype = b0 >> 1 & 3;
         st.l = b0 & 1;
         var
          sz = b0 >> 3 | dat[bt + 1] << 5 | dat[bt + 2] << 13,
          ebt = (bt += 3) + sz;
         if(btype === 1){
          if(bt >= dat.length) return;
          st.b = bt + 1;
          if(out){fill(out, dat[bt], st.y, st.y += sz); return out;}
          return fill(new u8(sz), dat[bt]);
         }
         if(ebt > dat.length) return;
         if(btype === 0){
          st.b = ebt;
          if(out){
           out.set(dat.subarray(bt, ebt), st.y);
           st.y += sz;
           return out;
          }
          return slc(dat, bt, ebt);
         }
         if(btype === 2){
          var
           b3 = dat[bt],
           lbt = b3 & 3,
           sf = b3 >> 2 & 3,
           lss = b3 >> 4,
           lcs = 0,
           s4 = 0;
          if(lbt < 2)
           if(sf & 1)
            lss |= dat[++bt] << 4 | (sf & 2 && dat[++bt] << 12);
           else
            lss = b3 >> 3;
          else{
           s4 = sf;
           if(sf < 2)
            lss |= (dat[++bt] & 63) << 4, lcs = dat[bt] >> 6 | dat[++bt] << 2;
           else if(sf === 2)
            lss |= dat[++bt] << 4 | (dat[++bt] & 3) << 12,
            lcs = dat[bt] >> 2 | dat[++bt] << 6;
           else
            lss |= dat[++bt] << 4 | (dat[++bt] & 63) << 12,
            lcs = dat[bt] >> 6 | dat[++bt] << 2 | dat[++bt] << 10;
          }
          ++bt;
          var
           buf = out ? out.subarray(st.y, st.y + st.m) : new u8(st.m),
           spl = buf.length - lss;
          if(lbt === 0)
           buf.set(dat.subarray(bt, bt += lss), spl);
          else if(lbt === 1)
           fill(buf, dat[bt++], spl);
          else{
           var hu = st.h;
           if(lbt === 2){
            var hud = rhu(dat, bt);
            lcs += bt - (bt = hud[0]);
            st.h = hu = hud[1];
           }
           else if(! hu) err(0);
           (s4 ? dhu4 : dhu)
            (dat.subarray(bt, bt += lcs), buf.subarray(spl), hu);
          }
          var ns = dat[bt++];
          if(ns){
           if(ns === 255)
            ns = (dat[bt++] | dat[bt++] << 8) + 0x7f00;
           else if(ns > 127) ns = ns - 128 << 8 | dat[bt++];
           var scm = dat[bt++];
           if(scm & 3) err(0);
           var dts = [dmlt, doct, dllt];
           for(var i = 2; i > - 1; --i){
            var md = scm >> (i << 1) + 2 & 3;
            if(md === 1){
             var rbuf = new u8([0, 0, dat[bt++]]);
             dts[i] =
              {s: rbuf.subarray(2, 3),
               n: rbuf.subarray(0, 1),
               t: new u16(rbuf.buffer, 0, 1),
               b: 0};
            }
            else if(md === 2)
             _a = rfse(dat, bt, 9 - (i & 1)), bt = _a[0], dts[i] = _a[1];
            else if(md === 3){if(! st.t) err(0); dts[i] = st.t[i];}
           }
           var
            _b = st.t = dts,
            mlt = _b[0],
            oct = _b[1],
            llt = _b[2],
            lb = dat[ebt - 1];
           if(! lb) err(0);
           var
            spos = (ebt << 3) - 8 + msb(lb) - llt.b,
            cbt = spos >> 3,
            oubt = 0,
            lst =
              (dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << llt.b) - 1;
           cbt = (spos -= oct.b) >> 3;
           var
            ost =
              (dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << oct.b) - 1;
           cbt = (spos -= mlt.b) >> 3;
           var
            mst =
              (dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << mlt.b) - 1;
           for(++ns; --ns;){
            var
             llc = llt.s[lst],
             lbtr = llt.n[lst],
             mlc = mlt.s[mst],
             mbtr = mlt.n[mst],
             ofc = oct.s[ost],
             obtr = oct.n[ost];
            cbt = (spos -= ofc) >> 3;
            var
             ofp = 1 << ofc,
             off =
               ofp
               +
                ((dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16
                | dat[cbt + 3] << 24)
                >>> (spos & 7)
                & ofp - 1);
            cbt = (spos -= mlb[mlc]) >> 3;
            var
             ml =
               mlbl[mlc]
               +
                ((dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16)
                >> (spos & 7)
                & (1 << mlb[mlc]) - 1);
            cbt = (spos -= llb[llc]) >> 3;
            var
             ll =
               llbl[llc]
               +
                ((dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16)
                >> (spos & 7)
                & (1 << llb[llc]) - 1);
            cbt = (spos -= lbtr) >> 3;
            lst =
             llt.t[lst]
             +
              ((dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << lbtr) - 1);
            cbt = (spos -= mbtr) >> 3;
            mst =
             mlt.t[mst]
             +
              ((dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << mbtr) - 1);
            cbt = (spos -= obtr) >> 3;
            ost =
             oct.t[ost]
             +
              ((dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << obtr) - 1);
            if(off > 3){
             st.o[2] = st.o[1];
             st.o[1] = st.o[0];
             st.o[0] = off -= 3;
            }
            else{
             var idx = off - (ll !== 0);
             if(idx){
              off = idx === 3 ? st.o[0] - 1 : st.o[idx];
              if(idx > 1) st.o[2] = st.o[1];
              st.o[1] = st.o[0];
              st.o[0] = off;
             }
             else
              off = st.o[0];
            }
            for(var i = 0; i < ll; ++i) buf[oubt + i] = buf[spl + i];
            oubt += ll, spl += ll;
            var stin = oubt - off;
            if(stin < 0){
             var len = - stin, bs = st.e + stin;
             if(len > ml) len = ml;
             for(var i = 0; i < len; ++i) buf[oubt + i] = st.w[bs + i];
             oubt += len, ml -= len, stin = 0;
            }
            for(var i = 0; i < ml; ++i) buf[oubt + i] = buf[stin + i];
            oubt += ml;
           }
           if(oubt !== spl)
            while(spl < buf.length) buf[oubt++] = buf[spl++];
           else
            oubt = buf.length;
           if(out) st.y += oubt; else buf = slc(buf, 0, oubt);
          }
          else if(out){
           st.y += lss;
           if(spl) for(var i = 0; i < lss; ++i) buf[i] = buf[spl + i];
          }
          else if(spl) buf = slc(buf, spl);
          st.b = ebt;
          return buf;
         }
         err(2);
        }
        function cct(bufs, ol){
         if(bufs.length === 1) return bufs[0];
         var buf = new u8(ol);
         for(var i = 0, b = 0; i < bufs.length; ++i){
          var chk = bufs[i];
          buf.set(chk, b);
          b += chk.length;
         }
         return buf;
        }
        return function(dat, buf){
         var bt = 0, bufs = [], nb = + ! buf, ol = 0;
         while(dat.length){
          var st = rzfh(dat, nb || buf);
          if(typeof st === "object"){
           if(nb){
            buf = null;
            if(st.w.length === st.u){bufs.push(buf = st.w); ol += st.u;}
           }
           else{bufs.push(buf); st.e = 0;}
           while(! st.l){
            var blk = rzb(dat, st, buf);
            if(! blk) err(5);
            if(buf)
             st.e = st.y;
            else{
             bufs.push(blk);
             ol += blk.length;
             cpw(st.w, 0, blk.length);
             st.w.set(blk, st.w.length - blk.length);
            }
           }
           bt = st.b + st.c * 4;
          }
          else
           bt = st;
          dat = dat.subarray(bt);
         }
         return cct(bufs, ol);};
       }
       (),
    caml_decompress_input = zstd_decompress;
   function caml_div(x, y){
    if(y === 0) caml_raise_zero_divide();
    return x / y | 0;
   }
   var caml_domain_dls = [0];
   function caml_domain_dls_compare_and_set(old, n){
    if(caml_domain_dls !== old) return 0;
    caml_domain_dls = n;
    return 1;
   }
   function caml_domain_dls_get(_unit){return caml_domain_dls;}
   function caml_domain_dls_set(a){caml_domain_dls = a;}
   var caml_domain_id = 0;
   function caml_ml_mutex_unlock(t){t.locked = false; return 0;}
   var caml_domain_latest_idx = 1;
   function caml_domain_spawn(f, term_sync){
    var id = caml_domain_latest_idx++, old = caml_domain_id;
    caml_domain_id = id;
    var res = caml_callback(f, [0]);
    caml_domain_id = old;
    caml_ml_mutex_unlock(term_sync[2]);
    term_sync[1] = [0, [0, res]];
    return id;
   }
   var
    caml_ephe_none = {caml_ephe_none: 0},
    caml_ephe_data_offset = 2,
    caml_ephe_key_offset = 3;
   function caml_ephe_get_data(x){
    var data = x[caml_ephe_data_offset];
    if(data === caml_ephe_none) return 0;
    for(var i = caml_ephe_key_offset; i < x.length; i++){
     var k = x[i];
     if(globalThis.WeakRef && k instanceof globalThis.WeakRef){
      var d = k.deref();
      if(d === undefined){
       x[i] = caml_ephe_none;
       x[caml_ephe_data_offset] = caml_ephe_none;
       return 0;
      }
      if(globalThis.WeakMap){
       data = data.get(k);
       if(data === undefined){
        x[caml_ephe_data_offset] = caml_ephe_none;
        return 0;
       }
      }
     }
    }
    return [0, data];
   }
   function caml_ephe_unset_data(x){
    x[caml_ephe_data_offset] = caml_ephe_none;
    return 0;
   }
   function caml_ephe_set_data(x, data){
    for(var i = x.length - 1; i >= caml_ephe_key_offset; i--){
     var k = x[i];
     if(globalThis.WeakRef && k instanceof globalThis.WeakRef){
      var d = k.deref();
      if(d === undefined){x[i] = caml_ephe_none; continue;}
      if(globalThis.WeakMap) data = new globalThis.WeakMap().set(k, data);
     }
    }
    x[caml_ephe_data_offset] = data;
    return 0;
   }
   function caml_ephe_set_data_opt(x, data_opt){
    if(data_opt === 0)
     caml_ephe_unset_data(x);
    else
     caml_ephe_set_data(x, data_opt[1]);
    return 0;
   }
   function caml_ephe_blit_data(src, dst){
    var old = caml_ephe_get_data(src);
    caml_ephe_set_data_opt(dst, old);
    return 0;
   }
   function caml_ephe_blit_key(a1, i1, a2, i2, len){
    var old = caml_ephe_get_data(a1);
    caml_array_blit
     (a1,
      caml_ephe_key_offset + i1 - 1,
      a2,
      caml_ephe_key_offset + i2 - 1,
      len);
    caml_ephe_set_data_opt(a2, old);
    return 0;
   }
   function caml_ephe_check_data(x){
    var data = caml_ephe_get_data(x);
    return data === 0 ? 0 : 1;
   }
   function caml_ephe_check_key(x, i){
    var weak = x[caml_ephe_key_offset + i];
    if(weak === caml_ephe_none) return 0;
    if(globalThis.WeakRef && weak instanceof globalThis.WeakRef){
     weak = weak.deref();
     if(weak === undefined){
      x[caml_ephe_key_offset + i] = caml_ephe_none;
      x[caml_ephe_data_offset] = caml_ephe_none;
      return 0;
     }
    }
    return 1;
   }
   function caml_weak_create(n){
    var alen = caml_ephe_key_offset + n, x = new Array(alen);
    x[0] = 251;
    x[1] = "caml_ephe_list_head";
    for(var i = 2; i < alen; i++) x[i] = caml_ephe_none;
    return x;
   }
   function caml_ephe_create(n){return caml_weak_create(n);}
   function caml_obj_dup(x){return typeof x === "number" ? x : x.slice();}
   function caml_ephe_get_data_copy(x){
    var r = caml_ephe_get_data(x);
    if(r === 0) return 0;
    var z = r[1];
    if(Array.isArray(z)) return [0, caml_obj_dup(z)];
    return r;
   }
   function caml_ephe_get_key(x, i){
    var weak = x[caml_ephe_key_offset + i];
    if(weak === caml_ephe_none) return 0;
    if(globalThis.WeakRef && weak instanceof globalThis.WeakRef){
     weak = weak.deref();
     if(weak === undefined){
      x[caml_ephe_key_offset + i] = caml_ephe_none;
      x[caml_ephe_data_offset] = caml_ephe_none;
      return 0;
     }
    }
    return [0, weak];
   }
   function caml_ephe_get_key_copy(x, i){
    var y = caml_ephe_get_key(x, i);
    if(y === 0) return y;
    var z = y[1];
    if(Array.isArray(z)) return [0, caml_obj_dup(z)];
    return y;
   }
   function caml_ephe_set_key(x, i, v){
    var old = caml_ephe_get_data(x);
    if(globalThis.WeakRef && v instanceof Object)
     v = new globalThis.WeakRef(v);
    x[caml_ephe_key_offset + i] = v;
    caml_ephe_set_data_opt(x, old);
    return 0;
   }
   function caml_ephe_unset_key(x, i){
    var old = caml_ephe_get_data(x);
    x[caml_ephe_key_offset + i] = caml_ephe_none;
    caml_ephe_set_data_opt(x, old);
    return 0;
   }
   function caml_equal(x, y){return + (caml_compare_val(x, y, false) === 0);}
   function caml_erf_float(x){
    var
     a1 = 0.254829592,
     a2 = - 0.284496736,
     a3 = 1.421413741,
     a4 = - 1.453152027,
     a5 = 1.061405429,
     p = 0.3275911,
     sign = 1;
    if(x < 0) sign = - 1;
    x = Math.abs(x);
    var
     t = 1.0 / (1.0 + p * x),
     y =
       1.0
       -
        ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(- x * x);
    return sign * y;
   }
   function caml_erfc_float(x){return 1 - caml_erf_float(x);}
   var caml_executable_name = caml_argv[1];
   function caml_exp2_float(x){return Math.pow(2, x);}
   function caml_expm1_float(x){return Math.expm1(x);}
   function caml_is_special_exception(exn){
    switch(exn[2]){case - 8:case - 11:case - 12: return 1;default: return 0;
    }
   }
   function caml_format_exception(exn){
    var r = "";
    if(exn[0] === 0){
     r += exn[1][1];
     if
      (exn.length === 3 && exn[2][0] === 0
       && caml_is_special_exception(exn[1]))
      var bucket = exn[2], start = 1;
     else
      var start = 2, bucket = exn;
     r += "(";
     for(var i = start; i < bucket.length; i++){
      if(i > start) r += ", ";
      var v = bucket[i];
      if(typeof v === "number")
       r += v.toString();
      else if(v instanceof MlBytes)
       r += '"' + v.toString() + '"';
      else if(typeof v === "string")
       r += '"' + v.toString() + '"';
      else
       r += "_";
     }
     r += ")";
    }
    else if(exn[0] === 248) r += exn[1];
    return r;
   }
   function caml_fatal_uncaught_exception(err){
    if(Array.isArray(err) && (err[0] === 0 || err[0] === 248)){
     var handler = caml_named_value("Printexc.handle_uncaught_exception");
     if(handler)
      caml_callback(handler, [err, false]);
     else{
      var
       msg = caml_format_exception(err),
       at_exit = caml_named_value("Pervasives.do_at_exit");
      if(at_exit) caml_callback(at_exit, [0]);
      console.error("Fatal error: exception " + msg);
      if(err.js_error) throw err.js_error;
     }
    }
    else
     throw err;
   }
   function caml_fill_bytes(s, i, l, c){
    if(l > 0)
     if(i === 0 && (l >= s.l || s.t === 2 && l >= s.c.length))
      if(c === 0){
       s.c = "";
       s.t = 2;
      }
      else{
       s.c = caml_str_repeat(l, String.fromCharCode(c));
       s.t = l === s.l ? 0 : 2;
      }
     else{
      if(s.t !== 4) caml_convert_bytes_to_array(s);
      for(l += i; i < l; i++) s.c[i] = c;
     }
    return 0;
   }
   function caml_final_register(_f, _x){return 0;}
   var all_finalizers = new globalThis.Set();
   function caml_final_register_called_without_value(cb, a){
    if(globalThis.FinalizationRegistry && a instanceof Object){
     var
      x =
        new
         globalThis.FinalizationRegistry
         (function(x){all_finalizers.delete(x); cb(0); return;});
     x.register(a, x);
     all_finalizers.add(x);
    }
    return 0;
   }
   function caml_final_release(_unit){return 0;}
   function caml_finish_formatting(f, rawbuffer){
    if(f.uppercase) rawbuffer = rawbuffer.toUpperCase();
    var len = rawbuffer.length;
    if(f.signedconv && (f.sign < 0 || f.signstyle !== "-")) len++;
    if(f.alternate){if(f.base === 8) len += 1; if(f.base === 16) len += 2;}
    var buffer = "";
    if(f.justify === "+" && f.filler === " ")
     for(var i = len; i < f.width; i++) buffer += " ";
    if(f.signedconv)
     if(f.sign < 0)
      buffer += "-";
     else if(f.signstyle !== "-") buffer += f.signstyle;
    if(f.alternate && f.base === 8) buffer += "0";
    if(f.alternate && f.base === 16) buffer += f.uppercase ? "0X" : "0x";
    if(f.justify === "+" && f.filler === "0")
     for(var i = len; i < f.width; i++) buffer += "0";
    buffer += rawbuffer;
    if(f.justify === "-") for(var i = len; i < f.width; i++) buffer += " ";
    return caml_string_of_jsbytes(buffer);
   }
   function caml_float_compare(x, y){
    if(x === y) return 0;
    if(x < y) return - 1;
    if(x > y) return 1;
    if(! Number.isNaN(x)) return 1;
    if(! Number.isNaN(y)) return - 1;
    return 0;
   }
   function caml_float_of_bytes(a){
    return caml_int64_float_of_bits(caml_int64_of_bytes(a));
   }
   function caml_float_of_string(s){
    var res, r_float = /^ *[-+]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][-+]?\d+)?$/;
    s = caml_jsbytes_of_string(s);
    res = + s;
    if(! Number.isNaN(res) && r_float.test(s)) return res;
    s = s.replace(/_/g, "");
    res = + s;
    if(! Number.isNaN(res) && r_float.test(s) || /^[+-]?nan$/i.test(s))
     return res;
    var
     m = /^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?$/i.exec(s);
    if(m){
     var
      m3 = m[3].replace(/0+$/, ""),
      mantissa = Number.parseInt(m[1] + m[2] + m3, 16),
      exponent = (+ m[5] || 0) - 4 * m3.length;
     res = mantissa * Math.pow(2, exponent);
     return res;
    }
    if(/^\+?inf(inity)?$/i.test(s)) return Number.POSITIVE_INFINITY;
    if(/^-inf(inity)?$/i.test(s)) return Number.NEGATIVE_INFINITY;
    caml_failwith("float_of_string");
   }
   function caml_floatarray_blit(a1, i1, a2, i2, len){return caml_array_blit(a1, i1, a2, i2, len);
   }
   function caml_floatarray_create(len){
    if(len >>> 0 >= (0x7fffffff / 8 | 0)) caml_array_bound_error();
    var len = len + 1 | 0, b = new Array(len);
    b[0] = 254;
    for(var i = 1; i < len; i++) b[i] = 0;
    return b;
   }
   function caml_fma_float(x, y, z){
    var
     SPLIT = Math.pow(2, 27) + 1,
     MIN_VALUE = Math.pow(2, - 1022),
     EPSILON = Math.pow(2, - 52),
     C = 416,
     A = Math.pow(2, + C),
     B = Math.pow(2, - C);
    function multiply(a, b){
     var
      at = SPLIT * a,
      ahi = at - (at - a),
      alo = a - ahi,
      bt = SPLIT * b,
      bhi = bt - (bt - b),
      blo = b - bhi,
      p = a * b,
      e = ahi * bhi - p + ahi * blo + alo * bhi + alo * blo;
     return {p: p, e: e};
    }
    function add(a, b){
     var s = a + b, v = s - a, e = a - (s - v) + (b - v);
     return {s: s, e: e};
    }
    function adjust(x, y){
     return x !== 0 && y !== 0 && SPLIT * x - (SPLIT * x - x) === x
             ? x * (1 + (x < 0 ? - 1 : + 1) * (y < 0 ? - 1 : + 1) * EPSILON)
             : x;
    }
    if(x === 0 || y === 0 || ! Number.isFinite(x) || ! Number.isFinite(y))
     return x * y + z;
    if(z === 0) return x * y;
    if(! Number.isFinite(z)) return z;
    var scale = 1;
    while(Math.abs(x) > A){scale *= A; x *= B;}
    while(Math.abs(y) > A){scale *= A; y *= B;}
    if(scale === 1 / 0) return x * y * scale;
    while(Math.abs(x) < B){scale *= B; x *= A;}
    while(Math.abs(y) < B){scale *= B; y *= A;}
    if(scale === 0) return z;
    var xs = x, ys = y, zs = z / scale;
    if(Math.abs(zs) > Math.abs(xs * ys) * 4 / EPSILON) return z;
    if(Math.abs(zs) < Math.abs(xs * ys) * EPSILON / 4 * EPSILON / 4)
     zs = (z < 0 ? - 1 : + 1) * MIN_VALUE;
    var
     xy = multiply(xs, ys),
     s = add(xy.p, zs),
     u = add(xy.e, s.e),
     i = add(s.s, u.s),
     f = i.s + adjust(i.e, u.e);
    if(f === 0) return f;
    var fs = f * scale;
    if(Math.abs(fs) > MIN_VALUE) return fs;
    return fs + adjust(f - fs / scale, i.e) * scale;
   }
   function caml_parse_format(fmt){
    fmt = caml_jsbytes_of_string(fmt);
    var len = fmt.length;
    if(len > 31) caml_invalid_argument("format_int: format too long");
    var
     f =
       {justify: "+",
        signstyle: "-",
        filler: " ",
        alternate: false,
        base: 0,
        signedconv: false,
        width: 0,
        uppercase: false,
        sign: 1,
        prec: - 1,
        conv: "f"};
    for(var i = 0; i < len; i++){
     var c = fmt.charAt(i);
     switch(c){
       case "-":
        f.justify = "-"; break;
       case "+":
       case " ":
        f.signstyle = c; break;
       case "0":
        f.filler = "0"; break;
       case "#":
        f.alternate = true; break;
       case "1":
       case "2":
       case "3":
       case "4":
       case "5":
       case "6":
       case "7":
       case "8":
       case "9":
        f.width = 0;
        while(c = fmt.charCodeAt(i) - 48, c >= 0 && c <= 9){f.width = f.width * 10 + c; i++;}
        i--;
        break;
       case ".":
        f.prec = 0;
        i++;
        while(c = fmt.charCodeAt(i) - 48, c >= 0 && c <= 9){f.prec = f.prec * 10 + c; i++;}
        i--;
        break;
       case "d":
       case "i":
        f.signedconv = true; f.base = 10; break;
       case "u":
        f.base = 10; break;
       case "x":
        f.base = 16; break;
       case "X":
        f.base = 16; f.uppercase = true; break;
       case "o":
        f.base = 8; break;
       case "e":
       case "f":
       case "g":
        f.signedconv = true; f.conv = c; break;
       case "E":
       case "F":
       case "G":
        f.signedconv = true;
        f.uppercase = true;
        f.conv = c.toLowerCase();
        break;
     }
    }
    return f;
   }
   function caml_format_float(fmt, x){
    function toFixed(x, dp){
     if(Math.abs(x) < 1.0)
      return x.toFixed(dp);
     else{
      var e = Number.parseInt(x.toString().split("+")[1]);
      if(e > 20){
       e -= 20;
       x /= Math.pow(10, e);
       x += caml_str_repeat(e, "0");
       if(dp > 0) x = x + "." + caml_str_repeat(dp, "0");
       return x;
      }
      else
       return x.toFixed(dp);
     }
    }
    var s, f = caml_parse_format(fmt), prec = f.prec < 0 ? 6 : f.prec;
    if(x < 0 || x === 0 && 1 / x === Number.NEGATIVE_INFINITY){f.sign = - 1; x = - x;}
    if(Number.isNaN(x)){
     s = "nan";
     f.filler = " ";
    }
    else if(! Number.isFinite(x)){s = "inf"; f.filler = " ";}
    else
     switch(f.conv){
       case "e":
        var s = x.toExponential(prec), i = s.length;
        if(s.charAt(i - 3) === "e")
         s = s.slice(0, i - 1) + "0" + s.slice(i - 1);
        break;
       case "f":
        s = toFixed(x, prec); break;
       case "g":
        prec = prec ? prec : 1;
        s = x.toExponential(prec - 1);
        var j = s.indexOf("e"), exp = + s.slice(j + 1);
        if(exp < - 4 || x >= 1e21 || x.toFixed(0).length > prec){
         var i = j - 1;
         while(s.charAt(i) === "0") i--;
         if(s.charAt(i) === ".") i--;
         s = s.slice(0, i + 1) + s.slice(j);
         i = s.length;
         if(s.charAt(i - 3) === "e")
          s = s.slice(0, i - 1) + "0" + s.slice(i - 1);
         break;
        }
        else{
         var p = prec;
         if(exp < 0){
          p -= exp + 1;
          s = x.toFixed(p);
         }
         else
          while(s = x.toFixed(p), s.length > prec + 1) p--;
         if(p){
          var i = s.length - 1;
          while(s.charAt(i) === "0") i--;
          if(s.charAt(i) === ".") i--;
          s = s.slice(0, i + 1);
         }
        }
        break;
     }
    return caml_finish_formatting(f, s);
   }
   function caml_format_int(fmt, i){
    if(caml_jsbytes_of_string(fmt) === "%d")
     return caml_string_of_jsbytes("" + i);
    var f = caml_parse_format(fmt);
    if(i < 0) if(f.signedconv){f.sign = - 1; i = - i;} else i >>>= 0;
    var s = i.toString(f.base);
    if(f.prec >= 0){
     f.filler = " ";
     var n = f.prec - s.length;
     if(n > 0) s = caml_str_repeat(n, "0") + s;
    }
    return caml_finish_formatting(f, s);
   }
   var caml_oo_last_id = 0;
   function caml_fresh_oo_id(){return caml_oo_last_id++;}
   function caml_frexp_float(x){
    if(x === 0 || ! Number.isFinite(x)) return [0, x, 0];
    var neg = x < 0;
    if(neg) x = - x;
    var exp = Math.max(- 1023, Math.floor(Math.log2(x)) + 1);
    x *= Math.pow(2, - exp);
    while(x < 0.5){x *= 2; exp--;}
    while(x >= 1){x *= 0.5; exp++;}
    if(neg) x = - x;
    return [0, x, exp];
   }
   function jsoo_create_file(name, content){
    var
     name = caml_string_of_jsstring(name),
     content = caml_string_of_jsbytes(content);
    return caml_create_file(name, content);
   }
   function caml_fs_init(){
    var tmp = globalThis.jsoo_fs_tmp;
    if(tmp)
     for(var i = 0; i < tmp.length; i++)
      jsoo_create_file(tmp[i].name, tmp[i].content);
    globalThis.jsoo_create_file = jsoo_create_file;
    globalThis.jsoo_fs_tmp = [];
    return 0;
   }
   function caml_gc_compaction(_unit){return 0;}
   function caml_gc_counters(_unit){return [254, 0, 0, 0];}
   function caml_gc_full_major(_unit){
    if(typeof globalThis.gc === "function") globalThis.gc();
    return 0;
   }
   function caml_gc_get(_unit){return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];}
   function caml_gc_major(_unit){
    if(typeof globalThis.gc === "function") globalThis.gc();
    return 0;
   }
   function caml_gc_major_slice(_work){return 0;}
   function caml_gc_minor(_unit){
    if(typeof globalThis.gc === "function") globalThis.gc(true);
    return 0;
   }
   function caml_gc_minor_words(_unit){return 0;}
   function caml_gc_quick_stat(_unit){
    return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
   }
   function caml_gc_set(_control){return 0;}
   function caml_gc_stat(unit){return caml_gc_quick_stat(unit);}
   var caml_method_cache = [];
   function caml_get_cached_method(obj, tag, cacheid){
    var meths = obj[1], ofs = caml_method_cache[cacheid];
    if(meths[ofs + 4] === tag) return meths[ofs + 3];
    var li = 3, hi = meths[1] * 2 + 1, mi;
    while(li < hi){
     mi = li + hi >> 1 | 1;
     if(tag < meths[mi + 1]) hi = mi - 2; else li = mi;
    }
    caml_method_cache[cacheid] = li - 3;
    return meths[li];
   }
   function caml_get_continuation_callstack(){return [0];}
   function caml_get_current_callstack(){return [0];}
   function caml_get_exception_backtrace(){return 0;}
   function caml_get_exception_raw_backtrace(_unit){return [0];}
   function caml_get_global_data(_unit){return caml_global_data;}
   function caml_get_minor_free(_unit){return 0;}
   function caml_get_public_method(obj, tag){
    var meths = obj[1], li = 3, hi = meths[1] * 2 + 1, mi;
    while(li < hi){
     mi = li + hi >> 1 | 1;
     if(tag < meths[mi + 1]) hi = mi - 2; else li = mi;
    }
    return tag === meths[li + 1] ? meths[li] : 0;
   }
   function caml_gr_arc_aux(ctx, cx, cy, ry, rx, a1, a2){
    while(a1 > a2) a2 += 360;
    a1 /= 180;
    a2 /= 180;
    var
     rot = 0,
     xPos,
     yPos,
     xPos_prev,
     yPos_prev,
     space = 2,
     num = (a2 - a1) * Math.PI * ((rx + ry) / 2) / space | 0,
     delta = (a2 - a1) * Math.PI / num,
     i = a1 * Math.PI;
    for(var j = 0; j <= num; j++){
     xPos =
      cx - rx * Math.sin(i) * Math.sin(rot * Math.PI)
      + ry * Math.cos(i) * Math.cos(rot * Math.PI);
     xPos = xPos.toFixed(2);
     yPos =
      cy + ry * Math.cos(i) * Math.sin(rot * Math.PI)
      + rx * Math.sin(i) * Math.cos(rot * Math.PI);
     yPos = yPos.toFixed(2);
     if(j === 0)
      ctx.moveTo(xPos, yPos);
     else if(xPos_prev !== xPos || yPos_prev !== yPos) ctx.lineTo(xPos, yPos);
     xPos_prev = xPos;
     yPos_prev = yPos;
     i -= delta;
    }
    return 0;
   }
   var caml_gr_state;
   function caml_gr_state_get(){
    if(caml_gr_state) return caml_gr_state;
    throw caml_maybe_attach_backtrace
           ([0,
             caml_named_value("Graphics.Graphic_failure"),
             caml_string_of_jsbytes("Not initialized")]);
   }
   function caml_gr_blit_image(im, x, y){
    var
     s = caml_gr_state_get(),
     im2 =
       s.context.getImageData
        (x, s.height - im.height - y, im.width, im.height);
    for(var i = 0; i < im2.data.length; i += 4){
     im.data[i] = im2.data[i];
     im.data[i + 1] = im2.data[i + 1];
     im.data[i + 2] = im2.data[i + 2];
     im.data[i + 3] = im2.data[i + 3];
    }
    return 0;
   }
   function caml_gr_clear_graph(){
    var s = caml_gr_state_get();
    s.context.clearRect(0, 0, s.canvas.width, s.canvas.height);
    return 0;
   }
   function caml_gr_close_graph(){
    var s = caml_gr_state_get();
    s.canvas.width = 0;
    s.canvas.height = 0;
    return 0;
   }
   function caml_gr_close_subwindow(_a){
    caml_failwith("caml_gr_close_subwindow not Implemented");
   }
   function caml_gr_create_image(x, y){
    var s = caml_gr_state_get();
    return s.context.createImageData(x, y);
   }
   function caml_gr_current_x(){var s = caml_gr_state_get(); return s.x;}
   function caml_gr_current_y(){var s = caml_gr_state_get(); return s.y;}
   function caml_gr_display_mode(){
    caml_failwith("caml_gr_display_mode not Implemented");
   }
   function caml_gr_doc_of_state(state){
    if(state.canvas.ownerDocument) return state.canvas.ownerDocument;
   }
   function caml_gr_draw_arc(x, y, rx, ry, a1, a2){
    var s = caml_gr_state_get();
    s.context.beginPath();
    caml_gr_arc_aux(s.context, x, s.height - y, rx, ry, a1, a2);
    s.context.stroke();
    return 0;
   }
   function caml_gr_draw_str(str){
    var s = caml_gr_state_get(), m = s.context.measureText(str), dx = m.width;
    s.context.fillText(str, s.x, s.height - s.y);
    s.x += dx | 0;
    return 0;
   }
   function caml_gr_draw_char(c){
    caml_gr_draw_str(String.fromCharCode(c));
    return 0;
   }
   function caml_gr_draw_image(im, x, y){
    var s = caml_gr_state_get();
    if(! im.image){
     var canvas = document.createElement("canvas");
     canvas.width = s.width;
     canvas.height = s.height;
     canvas.getContext("2d").putImageData(im, 0, 0);
     var image = new globalThis.Image();
     image.onload =
      function(){
       s.context.drawImage(image, x, s.height - im.height - y);
       im.image = image;
      };
     image.src = canvas.toDataURL("image/png");
    }
    else
     s.context.drawImage(im.image, x, s.height - im.height - y);
    return 0;
   }
   function caml_gr_draw_rect(x, y, w, h){
    var s = caml_gr_state_get();
    s.context.strokeRect(x, s.height - y, w, - h);
    return 0;
   }
   function caml_gr_draw_string(str){
    caml_gr_draw_str(caml_jsstring_of_string(str));
    return 0;
   }
   function caml_gr_dump_image(im){
    var data = [0];
    for(var i = 0; i < im.height; i++){
     data[i + 1] = [0];
     for(var j = 0; j < im.width; j++){
      var
       o = i * (im.width * 4) + j * 4,
       r = im.data[o + 0],
       g = im.data[o + 1],
       b = im.data[o + 2];
      data[i + 1][j + 1] = (r << 16) + (g << 8) + b;
     }
    }
    return data;
   }
   function caml_gr_fill_arc(x, y, rx, ry, a1, a2){
    var s = caml_gr_state_get();
    s.context.beginPath();
    caml_gr_arc_aux(s.context, x, s.height - y, rx, ry, a1, a2);
    s.context.fill();
    return 0;
   }
   function caml_gr_fill_poly(ar){
    var s = caml_gr_state_get();
    s.context.beginPath();
    s.context.moveTo(ar[1][1], s.height - ar[1][2]);
    for(var i = 2; i < ar.length; i++)
     s.context.lineTo(ar[i][1], s.height - ar[i][2]);
    s.context.lineTo(ar[1][1], s.height - ar[1][2]);
    s.context.fill();
    return 0;
   }
   function caml_gr_fill_rect(x, y, w, h){
    var s = caml_gr_state_get();
    s.context.fillRect(x, s.height - y, w, - h);
    return 0;
   }
   function caml_gr_lineto(x, y){
    var s = caml_gr_state_get();
    s.context.beginPath();
    s.context.moveTo(s.x, s.height - s.y);
    s.context.lineTo(x, s.height - y);
    s.context.stroke();
    s.x = x;
    s.y = y;
    return 0;
   }
   function caml_gr_make_image(arr){
    var
     s = caml_gr_state_get(),
     h = arr.length - 1,
     w = arr[1].length - 1,
     im = s.context.createImageData(w, h);
    for(var i = 0; i < h; i++)
     for(var j = 0; j < w; j++){
      var c = arr[i + 1][j + 1], o = i * (w * 4) + j * 4;
      if(c === - 1){
       im.data[o + 0] = 0;
       im.data[o + 1] = 0;
       im.data[o + 2] = 0;
       im.data[o + 3] = 0;
      }
      else{
       im.data[o + 0] = c >> 16 & 0xff;
       im.data[o + 1] = c >> 8 & 0xff;
       im.data[o + 2] = c >> 0 & 0xff;
       im.data[o + 3] = 0xff;
      }
     }
    return im;
   }
   function caml_gr_moveto(x, y){
    var s = caml_gr_state_get();
    s.x = x;
    s.y = y;
    return 0;
   }
   function caml_gr_set_window_title(name){
    var s = caml_gr_state_get();
    s.title = name;
    var jsname = caml_jsstring_of_string(name);
    if(s.set_title) s.set_title(jsname);
    return 0;
   }
   function caml_gr_set_line_width(w){
    var s = caml_gr_state_get();
    s.line_width = w;
    s.context.lineWidth = w;
    return 0;
   }
   function caml_gr_set_text_size(size){
    var s = caml_gr_state_get();
    s.text_size = size;
    s.context.font = s.text_size + "px " + caml_jsstring_of_string(s.font);
    return 0;
   }
   function caml_gr_set_font(f){
    var s = caml_gr_state_get();
    s.font = f;
    s.context.font = s.text_size + "px " + caml_jsstring_of_string(s.font);
    return 0;
   }
   function caml_gr_set_color(color){
    var s = caml_gr_state_get();
    function convert(number){
     var str = "" + number.toString(16);
     while(str.length < 2) str = "0" + str;
     return str;
    }
    var r = color >> 16 & 0xff, g = color >> 8 & 0xff, b = color >> 0 & 0xff;
    s.color = color;
    var c_str = "#" + convert(r) + convert(g) + convert(b);
    s.context.fillStyle = c_str;
    s.context.strokeStyle = c_str;
    return 0;
   }
   function caml_gr_resize_window(w, h){
    var s = caml_gr_state_get();
    s.width = w;
    s.height = h;
    if(w !== s.canvas.width) s.canvas.width = w;
    if(h !== s.canvas.height) s.canvas.height = h;
    return 0;
   }
   function caml_gr_state_init(){
    caml_gr_moveto(caml_gr_state.x, caml_gr_state.y);
    caml_gr_resize_window(caml_gr_state.width, caml_gr_state.height);
    caml_gr_set_line_width(caml_gr_state.line_width);
    caml_gr_set_text_size(caml_gr_state.text_size);
    caml_gr_set_font(caml_gr_state.font);
    caml_gr_set_color(caml_gr_state.color);
    caml_gr_set_window_title(caml_gr_state.title);
    caml_gr_state.context.textBaseline = "bottom";
   }
   function caml_gr_state_set(ctx){
    caml_gr_state = ctx;
    caml_gr_state_init();
    return 0;
   }
   function caml_gr_state_create(canvas, w, h){
    var context = canvas.getContext("2d");
    return {context: context,
            canvas: canvas,
            x: 0,
            y: 0,
            width: w,
            height: h,
            line_width: 1,
            font: caml_string_of_jsbytes("fixed"),
            text_size: 26,
            color: 0x000000,
            title: caml_string_of_jsbytes("")};
   }
   function caml_gr_open_graph(info){
    var info = caml_jsstring_of_string(info);
    function get(name){
     var res = info.match("(^|,) *" + name + " *= *([a-zA-Z0-9_]+) *(,|$)");
     if(res) return res[2];
    }
    var specs = [];
    if(! (info === "")) specs.push(info);
    var target = get("target");
    if(! target) target = "";
    var status = get("status");
    if(! status) specs.push("status=1");
    var w = get("width");
    w = w ? Number.parseInt(w) : 200;
    specs.push("width=" + w);
    var h = get("height");
    h = h ? Number.parseInt(h) : 200;
    specs.push("height=" + h);
    var win = globalThis.open("about:blank", target, specs.join(","));
    if(! win) caml_failwith("Graphics.open_graph: cannot open the window");
    var doc = win.document, canvas = doc.createElement("canvas");
    canvas.width = w;
    canvas.height = h;
    var ctx = caml_gr_state_create(canvas, w, h);
    ctx.set_title = function(title){doc.title = title;};
    caml_gr_state_set(ctx);
    var body = doc.body;
    body.style.margin = "0px";
    body.appendChild(canvas);
    return 0;
   }
   function caml_gr_open_subwindow(_a, _b, _c, _d){
    caml_failwith("caml_gr_open_subwindow not Implemented");
   }
   function caml_gr_plot(x, y){
    var
     s = caml_gr_state_get(),
     im = s.context.createImageData(1, 1),
     d = im.data,
     color = s.color;
    d[0] = color >> 16 & 0xff;
    d[1] = color >> 8 & 0xff, d[2] = color >> 0 & 0xff;
    d[3] = 0xff;
    s.x = x;
    s.y = y;
    s.context.putImageData(im, x, s.height - y);
    return 0;
   }
   function caml_gr_point_color(x, y){
    var
     s = caml_gr_state_get(),
     im = s.context.getImageData(x, s.height - y, 1, 1),
     d = im.data;
    return (d[0] << 16) + (d[1] << 8) + d[2];
   }
   function caml_gr_remember_mode(){
    caml_failwith("caml_gr_remember_mode not Implemented");
   }
   function caml_gr_sigio_handler(){return 0;}
   function caml_gr_sigio_signal(){return 0;}
   function caml_gr_size_x(){var s = caml_gr_state_get(); return s.width;}
   function caml_gr_size_y(){var s = caml_gr_state_get(); return s.height;}
   function caml_gr_synchronize(){
    caml_failwith("caml_gr_synchronize not Implemented");
   }
   function caml_gr_text_size(txt){
    var
     s = caml_gr_state_get(),
     w = s.context.measureText(caml_jsstring_of_string(txt)).width;
    return [0, w, s.text_size];
   }
   function caml_gr_wait_event(_evl){
    caml_failwith
     ("caml_gr_wait_event not Implemented: use Graphics_js instead");
   }
   function caml_gr_window_id(_a){
    caml_failwith("caml_gr_window_id not Implemented");
   }
   function caml_greaterequal(x, y){
    return + (caml_compare_val(x, y, false) >= 0);
   }
   function caml_greaterthan(x, y){
    return + (caml_compare_val(x, y, false) > 0);
   }
   function caml_hash_mix_jsbytes(h, s){
    var len = s.length, i, w;
    for(i = 0; i + 4 <= len; i += 4){
     w =
      s.charCodeAt(i) | s.charCodeAt(i + 1) << 8 | s.charCodeAt(i + 2) << 16
      | s.charCodeAt(i + 3) << 24;
     h = caml_hash_mix_int(h, w);
    }
    w = 0;
    switch(len & 3){
      case 3:
       w = s.charCodeAt(i + 2) << 16;
      case 2:
       w |= s.charCodeAt(i + 1) << 8;
      case 1:
       w |= s.charCodeAt(i); h = caml_hash_mix_int(h, w);
    }
    h ^= len;
    return h;
   }
   function caml_hash_mix_string(h, v){
    return caml_hash_mix_jsbytes(h, caml_jsbytes_of_string(v));
   }
   function caml_hash_mix_bytes_arr(h, s){
    var len = s.length, i, w;
    for(i = 0; i + 4 <= len; i += 4){
     w = s[i] | s[i + 1] << 8 | s[i + 2] << 16 | s[i + 3] << 24;
     h = caml_hash_mix_int(h, w);
    }
    w = 0;
    switch(len & 3){
      case 3:
       w = s[i + 2] << 16;
      case 2:
       w |= s[i + 1] << 8;
      case 1:
       w |= s[i]; h = caml_hash_mix_int(h, w);
    }
    h ^= len;
    return h;
   }
   function caml_ml_bytes_content(s){
    switch(s.t & 6){
      case 2:
       caml_convert_string_to_bytes(s); return s.c;
      default: return s.c;
    }
   }
   function caml_hash_mix_bytes(h, v){
    var content = caml_ml_bytes_content(v);
    return typeof content === "string"
            ? caml_hash_mix_jsbytes(h, content)
            : caml_hash_mix_bytes_arr(h, content);
   }
   function caml_hash_mix_final(h){
    h ^= h >>> 16;
    h = caml_mul(h, 0x85ebca6b | 0);
    h ^= h >>> 13;
    h = caml_mul(h, 0xc2b2ae35 | 0);
    h ^= h >>> 16;
    return h;
   }
   function caml_hash(count, limit, seed, obj){
    var queue, rd, wr, sz, num, h, v, i, len;
    sz = limit;
    if(sz < 0 || sz > 256) sz = 256;
    num = count;
    h = seed;
    queue = [obj];
    rd = 0;
    wr = 1;
    while(rd < wr && num > 0){
     v = queue[rd++];
     if(v?.caml_custom){
      if
       (caml_custom_ops[v.caml_custom] && caml_custom_ops[v.caml_custom].hash){
       var hh = caml_custom_ops[v.caml_custom].hash(v);
       h = caml_hash_mix_int(h, hh);
       num--;
      }
     }
     else if(Array.isArray(v) && v[0] === (v[0] | 0))
      switch(v[0]){
        case 248:
         h = caml_hash_mix_int(h, v[2]); num--; break;
        case 250:
         queue[--rd] = v[1]; break;
        default:
         if(caml_is_continuation_tag(v[0])) break;
         var tag = v.length - 1 << 10 | v[0];
         h = caml_hash_mix_int(h, tag);
         for(i = 1, len = v.length; i < len; i++){if(wr >= sz) break; queue[wr++] = v[i];
         }
         break;
      }
     else if(caml_is_ml_bytes(v)){
      h = caml_hash_mix_bytes(h, v);
      num--;
     }
     else if(caml_is_ml_string(v)){
      h = caml_hash_mix_string(h, v);
      num--;
     }
     else if(typeof v === "string"){
      h = caml_hash_mix_jsbytes(h, v);
      num--;
     }
     else if(v === (v | 0)){
      h = caml_hash_mix_int(h, v + v + 1);
      num--;
     }
     else if(typeof v === "number"){h = caml_hash_mix_float(h, v); num--;}
    }
    h = caml_hash_mix_final(h);
    return h & 0x3fffffff;
   }
   function caml_hash_mix_bigstring(h, bs){
    return caml_hash_mix_bytes_arr(h, bs.data);
   }
   function caml_hash_mix_int64(h, v){
    h = caml_hash_mix_int(h, caml_int64_lo32(v));
    h = caml_hash_mix_int(h, caml_int64_hi32(v));
    return h;
   }
   function num_digits_nat(nat, ofs, len){
    for(var i = len - 1; i >= 0; i--)
     if(nat.data[ofs + i] !== 0) return i + 1;
    return 1;
   }
   function caml_hash_nat(x){
    var len = num_digits_nat(x, 0, x.data.length), h = 0;
    for(var i = 0; i < len; i++) h = caml_hash_mix_int(h, x.data[i]);
    return h;
   }
   function caml_hexstring_of_float(x, prec, style){
    if(! Number.isFinite(x)){
     if(Number.isNaN(x)) return caml_string_of_jsstring("nan");
     return caml_string_of_jsstring(x > 0 ? "infinity" : "-infinity");
    }
    var
     sign = x === 0 && 1 / x === Number.NEGATIVE_INFINITY ? 1 : x >= 0 ? 0 : 1;
    if(sign) x = - x;
    var exp = 0;
    if(x === 0)
     ;
    else if(x < 1)
     while(x < 1 && exp > - 1022){x *= 2; exp--;}
    else
     while(x >= 2){x /= 2; exp++;}
    var exp_sign = exp < 0 ? "" : "+", sign_str = "";
    if(sign)
     sign_str = "-";
    else
     switch(style){
       case 43:
        sign_str = "+"; break;
       case 32:
        sign_str = " "; break;
       default: break;
     }
    if(prec >= 0 && prec < 13){
     var cst = Math.pow(2, prec * 4);
     x = Math.round(x * cst) / cst;
    }
    var x_str = x.toString(16);
    if(prec >= 0){
     var idx = x_str.indexOf(".");
     if(idx < 0)
      x_str += "." + caml_str_repeat(prec, "0");
     else{
      var size = idx + 1 + prec;
      if(x_str.length < size)
       x_str += caml_str_repeat(size - x_str.length, "0");
      else
       x_str = x_str.slice(0, size);
     }
    }
    return caml_string_of_jsstring
            (sign_str + "0x" + x_str + "p" + exp_sign + exp.toString(10));
   }
   function caml_hypot_float(x, y){return Math.hypot(x, y);}
   var caml_marshal_header_size = 16;
   function caml_refill(chan){
    if(chan.refill != null){
     var str = chan.refill(), str_a = caml_uint8_array_of_string(str);
     if(str_a.length === 0)
      chan.refill = null;
     else{
      if(chan.buffer.length < chan.buffer_max + str_a.length){
       var b = new Uint8Array(chan.buffer_max + str_a.length);
       b.set(chan.buffer);
       chan.buffer = b;
      }
      chan.buffer.set(str_a, chan.buffer_max);
      chan.offset += str_a.length;
      chan.buffer_max += str_a.length;
     }
    }
    else{
     if(chan.fd === - 1) caml_raise_sys_error("Bad file descriptor");
     var
      nread =
        chan.file.read
         (chan.buffer,
          chan.buffer_max,
          chan.buffer.length - chan.buffer_max,
          false);
     chan.offset += nread;
     chan.buffer_max += nread;
    }
   }
   function caml_raise_end_of_file(){
    caml_raise_constant(caml_global_data.End_of_file);
   }
   function caml_marshal_data_size(s, ofs){
    var r = new UInt8ArrayReader(caml_uint8_array_of_bytes(s), ofs);
    function readvlq(overflow){
     var c = r.read8u(), n = c & 0x7f;
     while((c & 0x80) !== 0){
      c = r.read8u();
      var n7 = n << 7;
      if(n !== n7 >> 7) overflow[0] = true;
      n = n7 | c & 0x7f;
     }
     return n;
    }
    switch(r.read32u()){
      case 0x8495a6be:
       var header_len = 20, data_len = r.read32u(); break;
      case 0x8495a6bd:
       var
        header_len = r.read8u() & 0x3f,
        overflow = [false],
        data_len = readvlq(overflow);
       if(overflow[0])
        caml_failwith
         ("Marshal.data_size: object too large to be read back on this platform");
       break;
      case 0x8495a6bf:
       caml_failwith
        ("Marshal.data_size: object too large to be read back on a 32-bit platform");
       break;
      default: caml_failwith("Marshal.data_size: bad object"); break;
    }
    return header_len - caml_marshal_header_size + data_len;
   }
   function caml_set_oo_id(b){b[2] = caml_oo_last_id++; return b;}
   function caml_input_value_from_reader(reader){
    function readvlq(overflow){
     var c = reader.read8u(), n = c & 0x7f;
     while((c & 0x80) !== 0){
      c = reader.read8u();
      var n7 = n << 7;
      if(n !== n7 >> 7) overflow[0] = true;
      n = n7 | c & 0x7f;
     }
     return n;
    }
    var old_pos = reader.i, magic = reader.read32u();
    switch(magic){
      case 0x8495a6be:
       var
        header_len = 20,
        compressed = 0,
        data_len = reader.read32u(),
        uncompressed_data_len = data_len,
        num_objects = reader.read32u(),
        _size_32 = reader.read32u(),
        _size_64 = reader.read32u();
       break;
      case 0x8495a6bd:
       var
        header_len = reader.read8u() & 0x3f,
        compressed = 1,
        overflow = [false],
        data_len = readvlq(overflow),
        uncompressed_data_len = readvlq(overflow),
        num_objects = readvlq(overflow),
        _size_32 = readvlq(overflow),
        _size_64 = readvlq(overflow);
       if(overflow[0])
        caml_failwith
         ("caml_input_value_from_reader: object too large to be read back on this platform");
       break;
      case 0x8495a6bf:
       caml_failwith
        ("caml_input_value_from_reader: object too large to be read back on a 32-bit platform");
       break;
      default:
       caml_failwith("caml_input_value_from_reader: bad object"); break;
    }
    if(header_len !== reader.i - old_pos)
     caml_failwith("caml_input_value_from_reader: invalid header");
    var
     stack = [],
     objects = [],
     intern_obj_table = num_objects > 0 ? [] : null,
     obj_counter = 0;
    function intern_rec(reader){
     var code = reader.read8u();
     if(code >= 0x40)
      if(code >= 0x80){
       var tag = code & 0xf, size = code >> 4 & 0x7, v = [tag];
       if(size === 0) return v;
       if(intern_obj_table) intern_obj_table[obj_counter++] = v;
       if(tag === 248) objects.push(v);
       stack.push(v, size);
       return v;
      }
      else
       return code & 0x3f;
     else if(code >= 0x20){
      var len = code & 0x1f, v = reader.readstr(len);
      if(intern_obj_table) intern_obj_table[obj_counter++] = v;
      return v;
     }
     else
      switch(code){
        case 0x00:
         return reader.read8s();
        case 0x01:
         return reader.read16s();
        case 0x02:
         return reader.read32s();
        case 0x03:
         caml_failwith("input_value: integer too large"); break;
        case 0x04:
         var offset = reader.read8u();
         if(compressed === 0) offset = obj_counter - offset;
         return intern_obj_table[offset];
        case 0x05:
         var offset = reader.read16u();
         if(compressed === 0) offset = obj_counter - offset;
         return intern_obj_table[offset];
        case 0x06:
         var offset = reader.read32u();
         if(compressed === 0) offset = obj_counter - offset;
         return intern_obj_table[offset];
        case 0x08:
         var
          header = reader.read32u(),
          tag = header & 0xff,
          size = header >> 10,
          v = [tag];
         if(size === 0) return v;
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         if(tag === 248) objects.push(v);
         stack.push(v, size);
         return v;
        case 0x13:
         caml_failwith("input_value: data block too large"); break;
        case 0x09:
         var len = reader.read8u(), v = reader.readstr(len);
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         return v;
        case 0x0a:
         var len = reader.read32u(), v = reader.readstr(len);
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         return v;
        case 0x0c:
         var t = new Array(8);
         for(var i = 0; i < 8; i++) t[7 - i] = reader.read8u();
         var v = caml_float_of_bytes(t);
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         return v;
        case 0x0b:
         var t = new Array(8);
         for(var i = 0; i < 8; i++) t[i] = reader.read8u();
         var v = caml_float_of_bytes(t);
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         return v;
        case 0x0e:
         var len = reader.read8u(), v = new Array(len + 1);
         v[0] = 254;
         var t = new Array(8);
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         for(var i = 1; i <= len; i++){
          for(var j = 0; j < 8; j++) t[7 - j] = reader.read8u();
          v[i] = caml_float_of_bytes(t);
         }
         return v;
        case 0x0d:
         var len = reader.read8u(), v = new Array(len + 1);
         v[0] = 254;
         var t = new Array(8);
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         for(var i = 1; i <= len; i++){
          for(var j = 0; j < 8; j++) t[j] = reader.read8u();
          v[i] = caml_float_of_bytes(t);
         }
         return v;
        case 0x07:
         var len = reader.read32u(), v = new Array(len + 1);
         v[0] = 254;
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         var t = new Array(8);
         for(var i = 1; i <= len; i++){
          for(var j = 0; j < 8; j++) t[7 - j] = reader.read8u();
          v[i] = caml_float_of_bytes(t);
         }
         return v;
        case 0x0f:
         var len = reader.read32u(), v = new Array(len + 1);
         v[0] = 254;
         var t = new Array(8);
         for(var i = 1; i <= len; i++){
          for(var j = 0; j < 8; j++) t[j] = reader.read8u();
          v[i] = caml_float_of_bytes(t);
         }
         return v;
        case 0x10:
        case 0x11:
         caml_failwith("input_value: code pointer"); break;
        case 0x12:
        case 0x18:
        case 0x19:
         var c, s = "";
         while((c = reader.read8u()) !== 0) s += String.fromCharCode(c);
         var ops = caml_custom_ops[s], expected_size;
         if(! ops)
          caml_failwith("input_value: unknown custom block identifier");
         switch(code){
           case 0x12: break;
           case 0x19:
            if(! ops.fixed_length)
             caml_failwith("input_value: expected a fixed-size custom block");
            expected_size = ops.fixed_length;
            break;
           case 0x18:
            expected_size = reader.read32u();
            reader.read32s();
            reader.read32s();
            break;
         }
         var size = [0], v = ops.deserialize(reader, size);
         if(expected_size !== undefined)
          if(expected_size !== size[0])
           caml_failwith
            ("input_value: incorrect length of serialized custom block");
         if(intern_obj_table) intern_obj_table[obj_counter++] = v;
         return v;
        default: caml_failwith("input_value: ill-formed message");
      }
    }
    if(compressed)
     if(caml_decompress_input)
      var
       data = reader.readuint8array(data_len),
       res = new Uint8Array(uncompressed_data_len),
       res = caml_decompress_input(data, res),
       reader = new UInt8ArrayReader(res, 0);
     else
      caml_failwith("input_value: compressed object, cannot decompress");
    var res = intern_rec(reader);
    while(stack.length > 0){
     var size = stack.pop(), v = stack.pop(), d = v.length;
     if(d < size) stack.push(v, size);
     v[d] = intern_rec(reader);
    }
    while(objects.length > 0){
     var x = objects.pop();
     if(x[2] >= 0) caml_set_oo_id(x);
    }
    return res;
   }
   function caml_input_value_from_bytes(s, ofs){
    var
     c = caml_ml_bytes_content(s),
     ofs = typeof ofs === "number" ? ofs : ofs[0],
     reader =
       c instanceof Uint8Array
        ? new UInt8ArrayReader(c, ofs)
        : new JsStringReader(c, ofs);
    return caml_input_value_from_reader(reader);
   }
   function caml_input_value(chanid){
    var
     chan = caml_ml_channel_get(chanid),
     header = new Uint8Array(caml_marshal_header_size);
    function block(buffer, offset, n){
     var r = 0;
     while(r < n){
      if(chan.buffer_curr >= chan.buffer_max){
       chan.buffer_curr = 0;
       chan.buffer_max = 0;
       caml_refill(chan);
      }
      if(chan.buffer_curr >= chan.buffer_max) break;
      buffer[offset + r] = chan.buffer[chan.buffer_curr];
      chan.buffer_curr++;
      r++;
     }
     return r;
    }
    var r = block(header, 0, caml_marshal_header_size);
    if(r === 0)
     caml_raise_end_of_file();
    else if(r < caml_marshal_header_size)
     caml_failwith("input_value: truncated object");
    var
     len = caml_marshal_data_size(caml_bytes_of_uint8_array(header), 0),
     buf = new Uint8Array(len + caml_marshal_header_size);
    buf.set(header, 0);
    var r = block(buf, caml_marshal_header_size, len);
    if(r < len)
     caml_failwith("input_value: truncated object " + r + "  " + len);
    var res = caml_input_value_from_bytes(caml_bytes_of_uint8_array(buf), 0);
    return res;
   }
   function caml_input_value_to_outside_heap(c){return caml_input_value(c);}
   function caml_install_signal_handler(){return 0;}
   function caml_int32_bswap(x){
    return (x & 0x000000ff) << 24 | (x & 0x0000ff00) << 8
           | (x & 0x00ff0000) >>> 8
           | (x & 0xff000000) >>> 24;
   }
   function caml_int64_add(x, y){return x.add(y);}
   function caml_int64_and(x, y){return x.and(y);}
   function caml_int64_bswap(x){
    var y = caml_int64_to_bytes(x);
    return caml_int64_of_bytes
            ([y[7], y[6], y[5], y[4], y[3], y[2], y[1], y[0]]);
   }
   function caml_int64_div(x, y){return x.div(y);}
   function caml_int64_is_zero(x){return + x.isZero();}
   function caml_int64_of_int32(x){
    return new MlInt64(x & 0xffffff, x >> 24 & 0xffffff, x >> 31 & 0xffff);
   }
   function caml_int64_to_int32(x){return x.toInt();}
   function caml_int64_is_negative(x){return + x.isNeg();}
   function caml_int64_neg(x){return x.neg();}
   function caml_int64_format(fmt, x){
    var f = caml_parse_format(fmt);
    if(f.signedconv && caml_int64_is_negative(x)){f.sign = - 1; x = caml_int64_neg(x);}
    var
     buffer = "",
     wbase = caml_int64_of_int32(f.base),
     cvtbl = "0123456789abcdef";
    do{
     var p = x.udivmod(wbase);
     x = p.quotient;
     buffer = cvtbl.charAt(caml_int64_to_int32(p.modulus)) + buffer;
    }
    while
     (! caml_int64_is_zero(x));
    if(f.prec >= 0){
     f.filler = " ";
     var n = f.prec - buffer.length;
     if(n > 0) buffer = caml_str_repeat(n, "0") + buffer;
    }
    return caml_finish_formatting(f, buffer);
   }
   function caml_int64_mod(x, y){return x.mod(y);}
   function caml_int64_mul(x, y){return x.mul(y);}
   function caml_int64_ult(x, y){return x.ucompare(y) < 0;}
   function caml_parse_sign_and_base(s){
    var
     i = 0,
     len = caml_ml_string_length(s),
     base = 10,
     sign = 1,
     signedness = 1;
    if(len > 0)
     switch(caml_string_unsafe_get(s, i)){
       case 45:
        i++; sign = - 1; break;
       case 43:
        i++; sign = 1; break;
     }
    if(i + 1 < len && caml_string_unsafe_get(s, i) === 48)
     switch(caml_string_unsafe_get(s, i + 1)){
       case 120:
       case 88:
        signedness = 0; base = 16; i += 2; break;
       case 111:
       case 79:
        signedness = 0; base = 8; i += 2; break;
       case 98:
       case 66:
        signedness = 0; base = 2; i += 2; break;
       case 117:
       case 85:
        signedness = 0; i += 2; break;
     }
    return [i, sign, base, signedness];
   }
   function caml_parse_digit(c){
    if(c >= 48 && c <= 57) return c - 48;
    if(c >= 65 && c <= 90) return c - 55;
    if(c >= 97 && c <= 122) return c - 87;
    return - 1;
   }
   function caml_int64_of_string(s){
    var
     r = caml_parse_sign_and_base(s),
     i = r[0],
     sign = r[1],
     base = r[2],
     signedness = r[3],
     base64 = caml_int64_of_int32(base),
     threshold = MlInt64.UNSIGNED_MAX.udivmod(base64).quotient,
     c = caml_string_unsafe_get(s, i),
     d = caml_parse_digit(c);
    if(d < 0 || d >= base) caml_failwith("Int64.of_string");
    var res = caml_int64_of_int32(d);
    for(;;){
     i++;
     c = caml_string_unsafe_get(s, i);
     if(c === 95) continue;
     d = caml_parse_digit(c);
     if(d < 0 || d >= base) break;
     if(caml_int64_ult(threshold, res)) caml_failwith("Int64.of_string");
     d = caml_int64_of_int32(d);
     res = caml_int64_add(caml_int64_mul(base64, res), d);
     if(caml_int64_ult(res, d)) caml_failwith("Int64.of_string");
    }
    if(i !== caml_ml_string_length(s)) caml_failwith("Int64.of_string");
    if
     (signedness
      &&
       caml_int64_ult(sign < 0 ? MlInt64.SIGNED_MIN : MlInt64.SIGNED_MAX, res))
     caml_failwith("Int64.of_string");
    if(sign < 0) res = caml_int64_neg(res);
    return res;
   }
   function caml_int64_or(x, y){return x.or(y);}
   function caml_int64_shift_left(x, s){return x.shift_left(s);}
   function caml_int64_shift_right(x, s){return x.shift_right(s);}
   function caml_int64_shift_right_unsigned(x, s){return x.shift_right_unsigned(s);
   }
   function caml_int64_sub(x, y){return x.sub(y);}
   function caml_int64_to_float(x){return x.toFloat();}
   function caml_int64_xor(x, y){return x.xor(y);}
   function caml_int_of_string(s){
    var
     r = caml_parse_sign_and_base(s),
     i = r[0],
     sign = r[1],
     base = r[2],
     signedness = r[3],
     len = caml_ml_string_length(s),
     threshold = - 1 >>> 0,
     c = i < len ? caml_string_unsafe_get(s, i) : 0,
     d = caml_parse_digit(c);
    if(d < 0 || d >= base) caml_failwith("int_of_string");
    var res = d;
    for(i++; i < len; i++){
     c = caml_string_unsafe_get(s, i);
     if(c === 95) continue;
     d = caml_parse_digit(c);
     if(d < 0 || d >= base) break;
     res = base * res + d;
     if(res > threshold) caml_failwith("int_of_string");
    }
    if(i !== len) caml_failwith("int_of_string");
    res = sign * res;
    if(signedness && (res | 0) !== res) caml_failwith("int_of_string");
    return res | 0;
   }
   var caml_io_buffer_size = 65536;
   function caml_is_js(){return 1;}
   function caml_is_printable(c){return + (c > 31 && c < 127);}
   function caml_js_call(f, o, args){
    return f.apply(o, caml_js_from_array(args));
   }
   function caml_js_delete(o, f){delete o[f]; return 0;}
   function caml_js_equals(x, y){return + (x == y);}
   function caml_js_error_of_exception(exn){
    if(exn.js_error) return exn.js_error;
    return null;
   }
   function caml_js_error_option_of_exception(exn){
    if(exn.js_error) return [0, exn.js_error];
    return 0;
   }
   function caml_js_eval_string(s){
    return eval?.('"use strict";' + caml_jsstring_of_string(s));
   }
   function caml_js_expr(s){
    console.error("caml_js_expr: fallback to runtime evaluation\n");
    return eval?.('"use strict";(' + caml_jsstring_of_string(s) + ")");
   }
   function caml_js_from_bool(x){return ! ! x;}
   function caml_js_from_float(x){return x;}
   function caml_js_from_string(s){return caml_jsstring_of_string(s);}
   function caml_js_fun_call(f, a){
    switch(a.length){
      case 1:
       return f();
      case 2:
       return f(a[1]);
      case 3:
       return f(a[1], a[2]);
      case 4:
       return f(a[1], a[2], a[3]);
      case 5:
       return f(a[1], a[2], a[3], a[4]);
      case 6:
       return f(a[1], a[2], a[3], a[4], a[5]);
      case 7:
       return f(a[1], a[2], a[3], a[4], a[5], a[6]);
      case 8:
       return f(a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
    }
    return f.apply(null, caml_js_from_array(a));
   }
   function caml_js_function_arity(f){return f.l >= 0 ? f.l : f.l = f.length;}
   function caml_js_get(o, f){return o[f];}
   function caml_js_get_console(){
    var
     c = console,
     m =
       ["log",
        "debug",
        "info",
        "warn",
        "error",
        "assert",
        "dir",
        "dirxml",
        "trace",
        "group",
        "groupCollapsed",
        "groupEnd",
        "time",
        "timeEnd"];
    function f(){}
    for(var i = 0; i < m.length; i++) if(! c[m[i]]) c[m[i]] = f;
    return c;
   }
   function caml_js_html_entities(s){
    var entity = /^&#?[0-9a-zA-Z]+;$/;
    if(s.match(entity)){
     var str, temp = document.createElement("p");
     temp.innerHTML = s;
     str = temp.textContent || temp.innerText;
     temp = null;
     return str;
    }
    else
     return null;
   }
   var caml_js_regexps = {amp: /&/g, lt: /</g, quot: /"/g, all: /[&<"]/};
   function caml_js_html_escape(s){
    if(! caml_js_regexps.all.test(s)) return s;
    return s.replace(caml_js_regexps.amp, "&amp;").replace
             (caml_js_regexps.lt, "&lt;").replace
            (caml_js_regexps.quot, "&quot;");
   }
   function caml_js_instanceof(o, c){return o instanceof c ? 1 : 0;}
   function caml_js_meth_call(o, f, args){
    return o[caml_jsstring_of_string(f)].apply(o, caml_js_from_array(args));
   }
   function caml_js_new(c, a){
    switch(a.length){
      case 1:
       return new c();
      case 2:
       return new c(a[1]);
      case 3:
       return new c(a[1], a[2]);
      case 4:
       return new c(a[1], a[2], a[3]);
      case 5:
       return new c(a[1], a[2], a[3], a[4]);
      case 6:
       return new c(a[1], a[2], a[3], a[4], a[5]);
      case 7:
       return new c(a[1], a[2], a[3], a[4], a[5], a[6]);
      case 8:
       return new c(a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
    }
    function F(){return c.apply(this, caml_js_from_array(a));}
    F.prototype = c.prototype;
    return new F();
   }
   function caml_js_object(a){
    var o = {};
    for(var i = 1; i < a.length; i++){
     var p = a[i];
     o[caml_jsstring_of_string(p[1])] = p[2];
    }
    return o;
   }
   function caml_js_pure_expr(f){return caml_callback(f, [0]);}
   function caml_js_set(o, f, v){o[f] = v; return 0;}
   function caml_js_strict_equals(x, y){return + (x === y);}
   function caml_js_to_array(a){
    var len = a.length, b = new Array(len + 1);
    b[0] = 0;
    for(var i = 0; i < len; i++) b[i + 1] = a[i];
    return b;
   }
   function caml_js_to_bool(x){return + x;}
   function caml_js_to_byte_string(s){return caml_string_of_jsbytes(s);}
   function caml_js_to_float(x){return x;}
   function caml_js_to_int32(x){return x | 0;}
   function caml_js_to_string(s){return caml_string_of_jsstring(s);}
   function caml_js_typeof(o){return typeof o;}
   function caml_js_var(x){
    var x = caml_jsstring_of_string(x);
    if(! x.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*(\.[a-zA-Z_$][a-zA-Z_$0-9]*)*$/))
     console.error
      ('caml_js_var: "' + x
       + '" is not a valid JavaScript variable. continuing ..');
    return eval?.(x);
   }
   function caml_js_wrap_callback(f){
    return function(...args){
     if(args.length === 0) args = [undefined];
     var res = caml_callback(f, args);
     return res instanceof Function ? caml_js_wrap_callback(res) : res;};
   }
   function caml_js_wrap_callback_arguments(f){
    return function(...args){return caml_callback(f, [args]);};
   }
   function caml_js_wrap_callback_strict(arity, f){
    return function(...args){
     args.length = arity;
     return caml_callback(f, args);};
   }
   function caml_js_wrap_callback_unsafe(f){
    return function(...args){
     var len = caml_js_function_arity(f);
     args.length = len;
     return caml_callback(f, args);};
   }
   function caml_js_wrap_meth_callback(f){
    return function(...args){
     args.unshift(this);
     var res = caml_callback(f, args);
     return res instanceof Function ? caml_js_wrap_callback(res) : res;};
   }
   function caml_js_wrap_meth_callback_arguments(f){
    return function(...args){return caml_callback(f, [this, args]);};
   }
   function caml_js_wrap_meth_callback_strict(arity, f){
    return function(...args){
     args.length = arity;
     args.unshift(this);
     return caml_callback(f, args);};
   }
   function caml_js_wrap_meth_callback_unsafe(f){
    return function(...args){
     var len = caml_js_function_arity(f);
     args.unshift(this);
     args.length = len;
     return caml_callback(f, args);};
   }
   function caml_jsoo_flags_effects(_unit){
    return caml_string_of_jsstring("disabled");
   }
   function caml_jsoo_flags_use_js_string(_unit){return 1;}
   function caml_lazy_make_forward(v){return [250, v];}
   function caml_obj_tag(x){
    if(Array.isArray(x) && x[0] === x[0] >>> 0)
     return x[0];
    else if(caml_is_ml_bytes(x))
     return 252;
    else if(caml_is_ml_string(x))
     return 252;
    else if(x instanceof Function || typeof x === "function")
     return 247;
    else if(x?.caml_custom) return 255; else return 1000;
   }
   function caml_lazy_read_result(o){
    return caml_obj_tag(o) === 250 ? o[1] : o;
   }
   function caml_obj_update_tag(b, o, n){
    if(b[0] === o){b[0] = n; return 1;}
    return 0;
   }
   function caml_lazy_reset_to_lazy(o){
    caml_obj_update_tag(o, 244, 246);
    return 0;
   }
   function caml_lazy_update_to_forcing(o){
    return Array.isArray(o) && o[0] === o[0] >>> 0
            && caml_obj_update_tag(o, 246, 244)
            ? 0
            : 1;
   }
   function caml_lazy_update_to_forward(o){
    caml_obj_update_tag(o, 244, 250);
    return 0;
   }
   function caml_ldexp_float(x, exp){
    exp |= 0;
    if(exp > 1023){
     exp -= 1023;
     x *= Math.pow(2, 1023);
     if(exp > 1023){exp -= 1023; x *= Math.pow(2, 1023);}
    }
    if(exp < - 1023){exp += 1023; x *= Math.pow(2, - 1023);}
    x *= Math.pow(2, exp);
    return x;
   }
   function caml_lessequal(x, y){
    return + (caml_compare_val(x, y, false) <= 0);
   }
   function caml_lessthan(x, y){return + (caml_compare_val(x, y, false) < 0);}
   function caml_lex_array(s){
    s = caml_jsbytes_of_string(s);
    var l = s.length / 2, a = new Array(l);
    for(var i = 0; i < l; i++)
     a[i] = (s.charCodeAt(2 * i) | s.charCodeAt(2 * i + 1) << 8) << 16 >> 16;
    return a;
   }
   function caml_lex_engine(tbl, start_state, lexbuf){
    var
     lex_buffer = 2,
     lex_buffer_len = 3,
     lex_start_pos = 5,
     lex_curr_pos = 6,
     lex_last_pos = 7,
     lex_last_action = 8,
     lex_eof_reached = 9,
     lex_base = 1,
     lex_backtrk = 2,
     lex_default = 3,
     lex_trans = 4,
     lex_check = 5;
    if(! tbl.lex_default){
     tbl.lex_base = caml_lex_array(tbl[lex_base]);
     tbl.lex_backtrk = caml_lex_array(tbl[lex_backtrk]);
     tbl.lex_check = caml_lex_array(tbl[lex_check]);
     tbl.lex_trans = caml_lex_array(tbl[lex_trans]);
     tbl.lex_default = caml_lex_array(tbl[lex_default]);
    }
    var c, state = start_state, buffer = lexbuf[lex_buffer];
    if(state >= 0){
     lexbuf[lex_last_pos] = lexbuf[lex_start_pos] = lexbuf[lex_curr_pos];
     lexbuf[lex_last_action] = - 1;
    }
    else
     state = - state - 1;
    for(;;){
     var base = tbl.lex_base[state];
     if(base < 0) return - base - 1;
     var backtrk = tbl.lex_backtrk[state];
     if(backtrk >= 0){
      lexbuf[lex_last_pos] = lexbuf[lex_curr_pos];
      lexbuf[lex_last_action] = backtrk;
     }
     if(lexbuf[lex_curr_pos] >= lexbuf[lex_buffer_len])
      if(lexbuf[lex_eof_reached] === 0) return - state - 1; else c = 256;
     else{
      c = caml_bytes_unsafe_get(buffer, lexbuf[lex_curr_pos]);
      lexbuf[lex_curr_pos]++;
     }
     if(tbl.lex_check[base + c] === state)
      state = tbl.lex_trans[base + c];
     else
      state = tbl.lex_default[state];
     if(state < 0){
      lexbuf[lex_curr_pos] = lexbuf[lex_last_pos];
      if(lexbuf[lex_last_action] === - 1)
       caml_failwith("lexing: empty token");
      else
       return lexbuf[lex_last_action];
     }
     else if(c === 256) lexbuf[lex_eof_reached] = 0;
    }
   }
   function caml_list_mount_point(){
    var prev = 0;
    for(var i = 0; i < jsoo_mount_point.length; i++){
     var old = prev;
     prev = [0, caml_string_of_jsstring(jsoo_mount_point[i].path), old];
    }
    return prev;
   }
   function caml_list_of_js_array(a){
    var l = 0;
    for(var i = a.length - 1; i >= 0; i--){var e = a[i]; l = [0, e, l];}
    return l;
   }
   function caml_list_to_js_array(l){
    var a = [];
    for(; l !== 0; l = l[2]) a.push(l[1]);
    return a;
   }
   function caml_log10_float(x){return Math.log10(x);}
   function caml_log1p_float(x){return Math.log1p(x);}
   function caml_log2_float(x){return Math.log2(x);}
   var
    caml_lxm_M =
      caml_int64_of_string(caml_string_of_jsstring("0xd1342543de82ef95")),
    caml_lxm_daba =
      caml_int64_of_string(caml_string_of_jsstring("0xdaba0b6eb09322e3"));
   function caml_lxm_next(v){
    function shift_l(x, k){return caml_int64_shift_left(x, k);}
    function shift_r(x, k){return caml_int64_shift_right_unsigned(x, k);}
    function or(a, b){return caml_int64_or(a, b);}
    function xor(a, b){return caml_int64_xor(a, b);}
    function add(a, b){return caml_int64_add(a, b);}
    function mul(a, b){return caml_int64_mul(a, b);}
    function rotl(x, k){return or(shift_l(x, k), shift_r(x, 64 - k));}
    function get(a, i){return caml_ba_get_1(a, i);}
    function set(a, i, x){return caml_ba_set_1(a, i, x);}
    var
     M = caml_lxm_M,
     daba = caml_lxm_daba,
     z,
     q0,
     q1,
     st = v,
     a = get(st, 0),
     s = get(st, 1),
     x0 = get(st, 2),
     x1 = get(st, 3);
    z = add(s, x0);
    z = mul(xor(z, shift_r(z, 32)), daba);
    z = mul(xor(z, shift_r(z, 32)), daba);
    z = xor(z, shift_r(z, 32));
    set(st, 1, add(mul(s, M), a));
    var q0 = x0, q1 = x1;
    q1 = xor(q1, q0);
    q0 = rotl(q0, 24);
    q0 = xor(xor(q0, q1), shift_l(q1, 16));
    q1 = rotl(q1, 37);
    set(st, 2, q0);
    set(st, 3, q1);
    return z;
   }
   function caml_make_float_vect(len){
    if(len >>> 0 >= (0x7fffffff / 8 | 0)) caml_array_bound_error();
    var len = len + 1 | 0, b = new Array(len);
    b[0] = 254;
    for(var i = 1; i < len; i++) b[i] = 0;
    return b;
   }
   function caml_make_vect(len, init){return caml_array_make(len, init);}
   var
    caml_marshal_constants =
      {PREFIX_SMALL_BLOCK: 0x80,
       PREFIX_SMALL_INT: 0x40,
       PREFIX_SMALL_STRING: 0x20,
       CODE_INT8: 0x00,
       CODE_INT16: 0x01,
       CODE_INT32: 0x02,
       CODE_INT64: 0x03,
       CODE_SHARED8: 0x04,
       CODE_SHARED16: 0x05,
       CODE_SHARED32: 0x06,
       CODE_BLOCK32: 0x08,
       CODE_BLOCK64: 0x13,
       CODE_STRING8: 0x09,
       CODE_STRING32: 0x0a,
       CODE_DOUBLE_BIG: 0x0b,
       CODE_DOUBLE_LITTLE: 0x0c,
       CODE_DOUBLE_ARRAY8_BIG: 0x0d,
       CODE_DOUBLE_ARRAY8_LITTLE: 0x0e,
       CODE_DOUBLE_ARRAY32_BIG: 0x0f,
       CODE_DOUBLE_ARRAY32_LITTLE: 0x07,
       CODE_CODEPOINTER: 0x10,
       CODE_INFIXPOINTER: 0x11,
       CODE_CUSTOM: 0x12,
       CODE_CUSTOM_LEN: 0x18,
       CODE_CUSTOM_FIXED: 0x19};
   function caml_maybe_print_stats(_unit){return 0;}
   function caml_md5_bytes(s, ofs, len){
    var ctx = caml_MD5Init(), a = caml_uint8_array_of_bytes(s);
    caml_MD5Update(ctx, a.subarray(ofs, ofs + len), len);
    return caml_string_of_uint8_array(caml_MD5Final(ctx));
   }
   function caml_ml_input_block(chanid, ba, i, l){
    var
     chan = caml_ml_channel_get(chanid),
     n = l,
     avail = chan.buffer_max - chan.buffer_curr;
    if(l <= avail){
     ba.set(chan.buffer.subarray(chan.buffer_curr, chan.buffer_curr + l), i);
     chan.buffer_curr += l;
    }
    else if(avail > 0){
     ba.set
      (chan.buffer.subarray(chan.buffer_curr, chan.buffer_curr + avail), i);
     chan.buffer_curr += avail;
     n = avail;
    }
    else{
     chan.buffer_curr = 0;
     chan.buffer_max = 0;
     caml_refill(chan);
     var avail = chan.buffer_max - chan.buffer_curr;
     if(n > avail) n = avail;
     ba.set(chan.buffer.subarray(chan.buffer_curr, chan.buffer_curr + n), i);
     chan.buffer_curr += n;
    }
    return n | 0;
   }
   function caml_md5_chan(chanid, toread){
    var ctx = caml_MD5Init(), buffer = new Uint8Array(4096);
    if(toread < 0)
     while(true){
      var read = caml_ml_input_block(chanid, buffer, 0, buffer.length);
      if(read === 0) break;
      caml_MD5Update(ctx, buffer.subarray(0, read), read);
     }
    else
     while(toread > 0){
      var
       read =
         caml_ml_input_block
          (chanid, buffer, 0, toread > buffer.length ? buffer.length : toread);
      if(read === 0) caml_raise_end_of_file();
      caml_MD5Update(ctx, buffer.subarray(0, read), read);
      toread -= read;
     }
    return caml_string_of_uint8_array(caml_MD5Final(ctx));
   }
   function caml_md5_string(s, ofs, len){
    return caml_md5_bytes(caml_bytes_of_string(s), ofs, len);
   }
   function caml_memprof_discard(_t){return 0;}
   function caml_memprof_start(_rate, _stack_size, _tracker){return 0;}
   function caml_memprof_stop(_unit){return 0;}
   function caml_ml_channel_redirect(captured, into){
    var
     to_restore = caml_ml_channel_get(captured),
     new_ = caml_ml_channel_get(into);
    caml_ml_channels.set(captured, new_);
    return to_restore;
   }
   function caml_ml_channel_restore(captured, to_restore){caml_ml_channels.set(captured, to_restore); return 0;
   }
   function caml_ml_channel_size(chanid){
    var chan = caml_ml_channel_get(chanid);
    return chan.file.length() | 0;
   }
   function caml_ml_channel_size_64(chanid){
    var chan = caml_ml_channel_get(chanid);
    return caml_int64_of_float(chan.file.length());
   }
   var caml_sys_fds = new Array(3);
   function caml_sys_close(fd){
    var x = caml_sys_fds[fd];
    if(x){x.file.close(false); delete caml_sys_fds[fd];}
    return 0;
   }
   function caml_ml_flush(chanid){
    var chan = caml_ml_channel_get(chanid);
    if(! chan.opened) caml_raise_sys_error("Cannot flush a closed channel");
    if(! chan.buffer || chan.buffer_curr === 0) return 0;
    if(chan.output)
     chan.output
      (caml_sub_uint8_array_to_jsbytes(chan.buffer, 0, chan.buffer_curr));
    else
     for(var pos = 0; pos < chan.buffer_curr;)
      pos += chan.file.write(chan.buffer, pos, chan.buffer_curr - pos, false);
    chan.offset += chan.buffer_curr;
    chan.buffer_curr = 0;
    return 0;
   }
   function caml_ml_close_channel(chanid){
    var chan = caml_ml_channel_get(chanid);
    if(chan.opened){
     chan.opened = false;
     caml_ml_channels.close(chanid);
     caml_sys_close(chan.fd);
     chan.fd = - 1;
     chan.buffer = new Uint8Array(0);
     chan.buffer_curr = 0;
     chan.buffer_max = 0;
    }
    return 0;
   }
   function caml_ml_condition_broadcast(_t){return 0;}
   function caml_ml_condition_new(_unit){return {condition: 1};}
   function caml_ml_condition_signal(_t){return 0;}
   function caml_ml_condition_wait(_t, _mutext){return 0;}
   function caml_ml_debug_info_status(){return 0;}
   function caml_ml_domain_cpu_relax(_unit){return 0;}
   function caml_ml_domain_id(_unit){return caml_domain_id;}
   var caml_runtime_warnings = 0;
   function caml_ml_enable_runtime_warnings(bool){caml_runtime_warnings = bool; return 0;
   }
   function caml_ml_input(chanid, b, i, l){
    var ba = caml_uint8_array_of_bytes(b);
    return caml_ml_input_block(chanid, ba, i, l);
   }
   function caml_ml_input_bigarray(chanid, b, i, l){
    var ba = caml_ba_to_typed_array(b);
    return caml_ml_input_block(chanid, ba, i, l);
   }
   function caml_ml_input_char(chanid){
    var chan = caml_ml_channel_get(chanid);
    if(chan.buffer_curr >= chan.buffer_max){
     chan.buffer_curr = 0;
     chan.buffer_max = 0;
     caml_refill(chan);
    }
    if(chan.buffer_curr >= chan.buffer_max) caml_raise_end_of_file();
    var res = chan.buffer[chan.buffer_curr];
    chan.buffer_curr++;
    return res;
   }
   function caml_ml_input_int(chanid){
    var res = 0;
    for(var i = 0; i < 4; i++)
     res = (res << 8) + caml_ml_input_char(chanid) | 0;
    return res | 0;
   }
   function caml_ml_input_scan_line(chanid){
    var chan = caml_ml_channel_get(chanid), p = chan.buffer_curr;
    do
     if(p >= chan.buffer_max){
      if(chan.buffer_curr > 0){
       chan.buffer.set(chan.buffer.subarray(chan.buffer_curr), 0);
       p -= chan.buffer_curr;
       chan.buffer_max -= chan.buffer_curr;
       chan.buffer_curr = 0;
      }
      if(chan.buffer_max >= chan.buffer.length) return - chan.buffer_max | 0;
      var prev_max = chan.buffer_max;
      caml_refill(chan);
      if(prev_max === chan.buffer_max) return - chan.buffer_max | 0;
     }
    while
     (chan.buffer[p++] !== 10);
    return p - chan.buffer_curr | 0;
   }
   function caml_ml_is_binary_mode(chanid){
    var chan = caml_ml_channel_get(chanid);
    return chan.file.flags.binary;
   }
   function caml_ml_is_buffered(chanid){
    return caml_ml_channel_get(chanid).buffered ? 1 : 0;
   }
   function caml_ml_mutex_lock(t){
    if(t.locked)
     caml_failwith("Mutex.lock: mutex already locked. Cannot wait.");
    else
     t.locked = true;
    return 0;
   }
   function caml_ml_mutex_new(_unit){return new MlMutex();}
   function caml_ml_mutex_try_lock(t){
    if(! t.locked){t.locked = true; return 1;}
    return 0;
   }
   function caml_sys_open_for_node(fd, flags){
    if(flags.altname)
     try{
      var fs = require("node:fs"), fd2 = fs.openSync(flags.altname, "rs");
      return new MlNodeFd(fd2, flags);
     }
     catch(e){}
    return new MlNodeFd(fd, flags);
   }
   function caml_sys_open_internal(file, idx){
    var chanid;
    if(idx === undefined){
     idx = caml_sys_fds.length;
     chanid = new MlChanid(idx);
    }
    else if(caml_sys_fds[idx])
     chanid = caml_sys_fds[idx].chanid;
    else
     chanid = new MlChanid(idx);
    caml_sys_fds[idx] = {file: file, chanid: chanid};
    return idx | 0;
   }
   function caml_sys_open(name, flags, perms){
    var f = {};
    while(flags){
     switch(flags[1]){
       case 0:
        f.rdonly = 1; break;
       case 1:
        f.wronly = 1; break;
       case 2:
        f.append = 1; f.writeonly = 1; break;
       case 3:
        f.create = 1; break;
       case 4:
        f.truncate = 1; break;
       case 5:
        f.excl = 1; break;
       case 6:
        f.binary = 1; break;
       case 7:
        f.text = 1; break;
       case 8:
        f.nonblock = 1; break;
     }
     flags = flags[2];
    }
    var
     root = resolve_fs_device(name),
     file = root.device.open(root.rest, f, perms);
    return caml_sys_open_internal(file, undefined);
   }
   (function(){
      var is_node = fs_node_supported();
      function file(fd, flags){
       return is_node
               ? caml_sys_open_for_node(fd, flags)
               : new MlFakeFd_out(fd, flags);
      }
      caml_sys_open_internal
       (file(0, {rdonly: 1, altname: "/dev/stdin", isCharacterDevice: true}),
        0);
      caml_sys_open_internal
       (file
         (1, {buffered: is_node ? 1 : 2, wronly: 1, isCharacterDevice: true}),
        1);
      caml_sys_open_internal
       (file
         (2, {buffered: is_node ? 1 : 2, wronly: 1, isCharacterDevice: true}),
        2);
     }
     ());
   function caml_ml_open_descriptor_in(fd){
    var fd_desc = caml_sys_fds[fd];
    if(fd_desc === undefined)
     caml_raise_sys_error("fd " + fd + " doesn't exist");
    var
     file = fd_desc.file,
     chanid = fd_desc.chanid,
     refill = null,
     channel =
       {file: file,
        offset: file.pos(),
        fd: fd,
        opened: true,
        out: false,
        buffer_curr: 0,
        buffer_max: 0,
        buffer: new Uint8Array(caml_io_buffer_size),
        refill: refill};
    caml_ml_channels.set(chanid, channel);
    return chanid;
   }
   function caml_ml_open_descriptor_in_with_flags(fd, _flags){return caml_ml_open_descriptor_in(fd);
   }
   function caml_ml_open_descriptor_out(fd){
    var fd_desc = caml_sys_fds[fd];
    if(fd_desc === undefined)
     caml_raise_sys_error("fd " + fd + " doesn't exist");
    var
     file = fd_desc.file,
     chanid = fd_desc.chanid,
     buffered = file.flags.buffered !== undefined ? file.flags.buffered : 1,
     channel =
       {file: file,
        offset: file.pos(),
        fd: fd,
        opened: true,
        out: true,
        buffer_curr: 0,
        buffer: new Uint8Array(caml_io_buffer_size),
        buffered: buffered};
    caml_ml_channels.set(chanid, channel);
    return chanid;
   }
   function caml_ml_open_descriptor_out_with_flags(fd, _flags){return caml_ml_open_descriptor_out(fd);
   }
   function caml_ml_out_channels_list(){
    var l = 0, keys = caml_ml_channels.all();
    for(var k of keys){
     var chan = caml_ml_channel_get(k);
     if(chan.opened && chan.out) l = [0, k, l];
    }
    return l;
   }
   function caml_ml_output_ta(chanid, buffer, offset, len){
    var chan = caml_ml_channel_get(chanid);
    if(! chan.opened)
     caml_raise_sys_error("Cannot output to a closed channel");
    buffer = buffer.subarray(offset, offset + len);
    if(chan.buffer_curr + buffer.length > chan.buffer.length){
     var b = new Uint8Array(chan.buffer_curr + buffer.length);
     b.set(chan.buffer);
     chan.buffer = b;
    }
    switch(chan.buffered){
      case 0:
       chan.buffer.set(buffer, chan.buffer_curr);
       chan.buffer_curr += buffer.length;
       caml_ml_flush(chanid);
       break;
      case 1:
       chan.buffer.set(buffer, chan.buffer_curr);
       chan.buffer_curr += buffer.length;
       if(chan.buffer_curr >= chan.buffer.length) caml_ml_flush(chanid);
       break;
      case 2:
       var id = buffer.lastIndexOf(10);
       if(id < 0){
        chan.buffer.set(buffer, chan.buffer_curr);
        chan.buffer_curr += buffer.length;
        if(chan.buffer_curr >= chan.buffer.length) caml_ml_flush(chanid);
       }
       else{
        chan.buffer.set(buffer.subarray(0, id + 1), chan.buffer_curr);
        chan.buffer_curr += id + 1;
        caml_ml_flush(chanid);
        chan.buffer.set(buffer.subarray(id + 1), chan.buffer_curr);
        chan.buffer_curr += buffer.length - id - 1;
       }
       break;
    }
    return 0;
   }
   function caml_ml_output_bytes(chanid, buffer, offset, len){
    var buffer = caml_uint8_array_of_bytes(buffer);
    return caml_ml_output_ta(chanid, buffer, offset, len);
   }
   function caml_ml_output(chanid, buffer, offset, len){
    return caml_ml_output_bytes
            (chanid, caml_bytes_of_string(buffer), offset, len);
   }
   function caml_ml_output_bigarray(chanid, buffer, offset, len){
    var buffer = caml_ba_to_typed_array(buffer);
    return caml_ml_output_ta(chanid, buffer, offset, len);
   }
   function caml_ml_output_char(chanid, c){
    var s = caml_string_of_jsbytes(String.fromCharCode(c));
    caml_ml_output(chanid, s, 0, 1);
    return 0;
   }
   function caml_ml_output_int(chanid, i){
    var arr = [i >> 24 & 0xff, i >> 16 & 0xff, i >> 8 & 0xff, i & 0xff];
    caml_ml_output_ta(chanid, new Uint8Array(arr), 0, 4);
    return 0;
   }
   function caml_pos_in(chanid){
    var chan = caml_ml_channel_get(chanid);
    return chan.offset - (chan.buffer_max - chan.buffer_curr);
   }
   function caml_ml_pos_in(chanid){return caml_pos_in(chanid) | 0;}
   function caml_ml_pos_in_64(chanid){
    return caml_int64_of_float(caml_pos_in(chanid));
   }
   function caml_pos_out(chanid){
    var chan = caml_ml_channel_get(chanid);
    return chan.offset + chan.buffer_curr;
   }
   function caml_ml_pos_out(chanid){return caml_pos_out(chanid) | 0;}
   function caml_ml_pos_out_64(chanid){
    return caml_int64_of_float(caml_pos_out(chanid));
   }
   function caml_ml_runtime_events_are_active(){return 0;}
   function caml_ml_runtime_events_pause(){return 0;}
   function caml_ml_runtime_events_resume(){return 0;}
   function caml_ml_runtime_events_start(){return 0;}
   function caml_ml_runtime_warnings_enabled(_unit){return caml_runtime_warnings;
   }
   function caml_seek_in(chanid, pos){
    var chan = caml_ml_channel_get(chanid);
    if(chan.refill != null) caml_raise_sys_error("Illegal seek");
    if
     (pos >= chan.offset - chan.buffer_max && pos <= chan.offset
      && chan.file.flags.binary)
     chan.buffer_curr = chan.buffer_max - (chan.offset - pos);
    else{
     chan.file.seek(pos, 0);
     chan.offset = pos;
     chan.buffer_curr = 0;
     chan.buffer_max = 0;
    }
    return 0;
   }
   function caml_ml_seek_in(chanid, pos){return caml_seek_in(chanid, pos);}
   function caml_ml_seek_in_64(chanid, pos){
    var pos = caml_int64_to_float(pos);
    return caml_seek_in(chanid, pos);
   }
   function caml_seek_out(chanid, pos){
    caml_ml_flush(chanid);
    var chan = caml_ml_channel_get(chanid);
    chan.file.seek(pos, 0);
    chan.offset = pos;
    return 0;
   }
   function caml_ml_seek_out(chanid, pos){return caml_seek_out(chanid, pos);}
   function caml_ml_seek_out_64(chanid, pos){
    var pos = caml_int64_to_float(pos);
    return caml_seek_out(chanid, pos);
   }
   function caml_ml_set_binary_mode(chanid, mode){
    var chan = caml_ml_channel_get(chanid);
    chan.file.flags.text = ! mode;
    chan.file.flags.binary = mode;
    return 0;
   }
   function caml_ml_set_buffered(chanid, v){
    caml_ml_channel_get(chanid).buffered = v;
    if(! v) caml_ml_flush(chanid);
    return 0;
   }
   function caml_ml_set_channel_name(chanid, name){
    var chan = caml_ml_channel_get(chanid);
    chan.name = name;
    return 0;
   }
   function caml_ml_set_channel_output(chanid, f){
    var chan = caml_ml_channel_get(chanid);
    chan.output = function(s){f(s);};
    return 0;
   }
   function caml_ml_set_channel_refill(chanid, f){
    caml_ml_channel_get(chanid).refill = f;
    return 0;
   }
   function caml_mod(x, y){
    if(y === 0) caml_raise_zero_divide();
    return x % y;
   }
   function caml_modf_float(x){
    if(Number.isFinite(x)){
     var neg = 1 / x < 0;
     x = Math.abs(x);
     var i = Math.floor(x), f = x - i;
     if(neg){i = - i; f = - f;}
     return [0, f, i];
    }
    if(Number.isNaN(x)) return [0, Number.NaN, Number.NaN];
    return [0, 1 / x, x];
   }
   function caml_mount_autoload(name, f){
    var
     path = caml_make_path(name),
     name = caml_trailing_slash(path.join("/"));
    jsoo_mount_point.push({path: name, device: new MlFakeDevice(name, f)});
    return 0;
   }
   function caml_lex_run_mem(s, i, mem, curr_pos){
    for(;;){
     var dst = s.charCodeAt(i);
     i++;
     if(dst === 0xff) return;
     var src = s.charCodeAt(i);
     i++;
     if(src === 0xff)
      mem[dst + 1] = curr_pos;
     else
      mem[dst + 1] = mem[src + 1];
    }
   }
   function caml_lex_run_tag(s, i, mem){
    for(;;){
     var dst = s.charCodeAt(i);
     i++;
     if(dst === 0xff) return;
     var src = s.charCodeAt(i);
     i++;
     if(src === 0xff) mem[dst + 1] = - 1; else mem[dst + 1] = mem[src + 1];
    }
   }
   function caml_new_lex_engine(tbl, start_state, lexbuf){
    var
     lex_buffer = 2,
     lex_buffer_len = 3,
     lex_start_pos = 5,
     lex_curr_pos = 6,
     lex_last_pos = 7,
     lex_last_action = 8,
     lex_eof_reached = 9,
     lex_mem = 10,
     lex_base = 1,
     lex_backtrk = 2,
     lex_default = 3,
     lex_trans = 4,
     lex_check = 5,
     lex_base_code = 6,
     lex_backtrk_code = 7,
     lex_default_code = 8,
     lex_trans_code = 9,
     lex_check_code = 10,
     lex_code = 11;
    if(! tbl.lex_default){
     tbl.lex_base = caml_lex_array(tbl[lex_base]);
     tbl.lex_backtrk = caml_lex_array(tbl[lex_backtrk]);
     tbl.lex_check = caml_lex_array(tbl[lex_check]);
     tbl.lex_trans = caml_lex_array(tbl[lex_trans]);
     tbl.lex_default = caml_lex_array(tbl[lex_default]);
    }
    if(! tbl.lex_default_code){
     tbl.lex_base_code = caml_lex_array(tbl[lex_base_code]);
     tbl.lex_backtrk_code = caml_lex_array(tbl[lex_backtrk_code]);
     tbl.lex_check_code = caml_lex_array(tbl[lex_check_code]);
     tbl.lex_trans_code = caml_lex_array(tbl[lex_trans_code]);
     tbl.lex_default_code = caml_lex_array(tbl[lex_default_code]);
    }
    if(tbl.lex_code == null)
     tbl.lex_code = caml_jsbytes_of_string(tbl[lex_code]);
    var c, state = start_state, buffer = lexbuf[lex_buffer];
    if(state >= 0){
     lexbuf[lex_last_pos] = lexbuf[lex_start_pos] = lexbuf[lex_curr_pos];
     lexbuf[lex_last_action] = - 1;
    }
    else
     state = - state - 1;
    for(;;){
     var base = tbl.lex_base[state];
     if(base < 0){
      var pc_off = tbl.lex_base_code[state];
      caml_lex_run_tag(tbl.lex_code, pc_off, lexbuf[lex_mem]);
      return - base - 1;
     }
     var backtrk = tbl.lex_backtrk[state];
     if(backtrk >= 0){
      var pc_off = tbl.lex_backtrk_code[state];
      caml_lex_run_tag(tbl.lex_code, pc_off, lexbuf[lex_mem]);
      lexbuf[lex_last_pos] = lexbuf[lex_curr_pos];
      lexbuf[lex_last_action] = backtrk;
     }
     if(lexbuf[lex_curr_pos] >= lexbuf[lex_buffer_len])
      if(lexbuf[lex_eof_reached] === 0) return - state - 1; else c = 256;
     else{
      c = caml_bytes_unsafe_get(buffer, lexbuf[lex_curr_pos]);
      lexbuf[lex_curr_pos]++;
     }
     var pstate = state;
     if(tbl.lex_check[base + c] === state)
      state = tbl.lex_trans[base + c];
     else
      state = tbl.lex_default[state];
     if(state < 0){
      lexbuf[lex_curr_pos] = lexbuf[lex_last_pos];
      if(lexbuf[lex_last_action] === - 1)
       caml_failwith("lexing: empty token");
      else
       return lexbuf[lex_last_action];
     }
     else{
      var base_code = tbl.lex_base_code[pstate], pc_off;
      if(tbl.lex_check_code[base_code + c] === pstate)
       pc_off = tbl.lex_trans_code[base_code + c];
      else
       pc_off = tbl.lex_default_code[pstate];
      if(pc_off > 0)
       caml_lex_run_mem
        (tbl.lex_code, pc_off, lexbuf[lex_mem], lexbuf[lex_curr_pos]);
      if(c === 256) lexbuf[lex_eof_reached] = 0;
     }
    }
   }
   function caml_new_string(s){return caml_string_of_jsbytes(s);}
   function caml_nextafter_float(x, y){
    if(Number.isNaN(x) || Number.isNaN(y)) return Number.NaN;
    if(x === y) return y;
    if(x === 0) return y < 0 ? - Math.pow(2, - 1074) : Math.pow(2, - 1074);
    var bits = caml_int64_bits_of_float(x), one = caml_int64_of_int32(1);
    if(x < y === x > 0)
     bits = caml_int64_add(bits, one);
    else
     bits = caml_int64_sub(bits, one);
    return caml_int64_float_of_bits(bits);
   }
   function caml_notequal(x, y){
    return + (caml_compare_val(x, y, false) !== 0);
   }
   function caml_obj_add_offset(_v, _offset){
    caml_failwith("Obj.add_offset is not supported");
   }
   function caml_obj_block(tag, size){
    var o = new Array(size + 1);
    o[0] = tag;
    for(var i = 1; i <= size; i++) o[i] = 0;
    return o;
   }
   function caml_obj_compare_and_swap(x, i, old, n){
    if(x[i + 1] === old){x[i + 1] = n; return 1;}
    return 0;
   }
   function caml_obj_is_shared(_x){return 1;}
   function caml_obj_raw_field(o, i){return o[i + 1];}
   function caml_obj_reachable_words(_o){return 0;}
   function caml_obj_set_raw_field(o, i, v){return o[i + 1] = v;}
   function caml_obj_with_tag(tag, x){
    var l = x.length, a = new Array(l);
    a[0] = tag;
    for(var i = 1; i < l; i++) a[i] = x[i];
    return a;
   }
   function caml_ojs_new_arr(c, a){
    switch(a.length){
      case 0:
       return new c();
      case 1:
       return new c(a[0]);
      case 2:
       return new c(a[0], a[1]);
      case 3:
       return new c(a[0], a[1], a[2]);
      case 4:
       return new c(a[0], a[1], a[2], a[3]);
      case 5:
       return new c(a[0], a[1], a[2], a[3], a[4]);
      case 6:
       return new c(a[0], a[1], a[2], a[3], a[4], a[5]);
      case 7:
       return new c(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
    }
    function F(){return c.apply(this, a);}
    F.prototype = c.prototype;
    return new F();
   }
   function caml_oo_cache_id(){
    var cacheid = caml_method_cache.length;
    caml_method_cache[cacheid] = 0;
   }
   var
    caml_output_val =
      function(){
        class Writer{
          constructor(){
           this.chunk = [];
           this.chunk_idx = 20;
           this.block_len = 0;
           this.obj_counter = 0;
           this.size_32 = 0;
           this.size_64 = 0;
          }
          write(size, value){
           for(var i = size - 8; i >= 0; i -= 8)
            this.chunk[this.chunk_idx++] = value >> i & 0xff;
          }
          write_at(pos, size, value){
           var pos = pos;
           for(var i = size - 8; i >= 0; i -= 8)
            this.chunk[pos++] = value >> i & 0xff;
          }
          write_code(size, code, value){
           this.chunk[this.chunk_idx++] = code;
           for(var i = size - 8; i >= 0; i -= 8)
            this.chunk[this.chunk_idx++] = value >> i & 0xff;
          }
          write_shared(offset){
           if(offset < 1 << 8)
            this.write_code(8, 0x04, offset);
           else if(offset < 1 << 16)
            this.write_code(16, 0x05, offset);
           else
            this.write_code(32, 0x06, offset);
          }
          pos(){return this.chunk_idx;}
          finalize(){
           this.block_len = this.chunk_idx - 20;
           this.chunk_idx = 0;
           this.write(32, 0x8495a6be);
           this.write(32, this.block_len);
           this.write(32, this.obj_counter);
           this.write(32, this.size_32);
           this.write(32, this.size_64);
           return this.chunk;
          }
        }
        return function(v, flags){
         flags = caml_list_to_js_array(flags);
         var
          no_sharing = flags.indexOf(0) !== - 1,
          closures = flags.indexOf(1) !== - 1;
         if(closures)
          console.warn
           ("in caml_output_val: flag Marshal.Closures is not supported.");
         var
          writer = new Writer(),
          stack = [],
          intern_obj_table = no_sharing ? null : new MlObjectTable();
         function memo(v){
          if(no_sharing) return false;
          var existing_offset = intern_obj_table.recall(v);
          if(existing_offset){
           writer.write_shared(existing_offset);
           return true;
          }
          else{intern_obj_table.store(v); return false;}
         }
         function extern_rec(v){
          if(v.caml_custom){
           if(memo(v)) return;
           var
            name = v.caml_custom,
            ops = caml_custom_ops[name],
            sz_32_64 = [0, 0];
           if(! ops.serialize)
            caml_invalid_argument("output_value: abstract value (Custom)");
           if(ops.fixed_length === undefined){
            writer.write(8, 0x18);
            for(var i = 0; i < name.length; i++)
             writer.write(8, name.charCodeAt(i));
            writer.write(8, 0);
            var header_pos = writer.pos();
            for(var i = 0; i < 12; i++) writer.write(8, 0);
            ops.serialize(writer, v, sz_32_64);
            writer.write_at(header_pos, 32, sz_32_64[0]);
            writer.write_at(header_pos + 4, 32, 0);
            writer.write_at(header_pos + 8, 32, sz_32_64[1]);
           }
           else{
            writer.write(8, 0x19);
            for(var i = 0; i < name.length; i++)
             writer.write(8, name.charCodeAt(i));
            writer.write(8, 0);
            ops.serialize(writer, v, sz_32_64);
            if(ops.fixed_length !== sz_32_64[0])
             caml_failwith
              ("output_value: incorrect fixed sizes specified by " + name);
           }
           writer.size_32 += 2 + (sz_32_64[0] + 3 >> 2);
           writer.size_64 += 2 + (sz_32_64[1] + 7 >> 3);
          }
          else if(Array.isArray(v) && v[0] === (v[0] | 0)){
           if(v[0] === 251)
            caml_failwith("output_value: abstract value (Abstract)");
           if(caml_is_continuation_tag(v[0]))
            caml_invalid_argument("output_value: continuation value");
           if(v.length > 1 && memo(v)) return;
           if(v[0] < 16 && v.length - 1 < 8)
            writer.write(8, 0x80 + v[0] + (v.length - 1 << 4));
           else
            writer.write_code(32, 0x08, v.length - 1 << 10 | v[0]);
           writer.size_32 += v.length;
           writer.size_64 += v.length;
           if(v.length > 1) stack.push(v, 1);
          }
          else if(caml_is_ml_bytes(v)){
           if(! caml_is_ml_bytes(caml_string_of_jsbytes("")))
            caml_failwith
             ("output_value: [Bytes.t] cannot safely be marshaled with [--enable use-js-string]");
           if(memo(v)) return;
           var len = caml_ml_bytes_length(v);
           if(len < 0x20)
            writer.write(8, 0x20 + len);
           else if(len < 0x100)
            writer.write_code(8, 0x09, len);
           else
            writer.write_code(32, 0x0a, len);
           for(var i = 0; i < len; i++)
            writer.write(8, caml_bytes_unsafe_get(v, i));
           writer.size_32 += 1 + ((len + 4) / 4 | 0);
           writer.size_64 += 1 + ((len + 8) / 8 | 0);
          }
          else if(caml_is_ml_string(v)){
           if(memo(v)) return;
           var len = caml_ml_string_length(v);
           if(len < 0x20)
            writer.write(8, 0x20 + len);
           else if(len < 0x100)
            writer.write_code(8, 0x09, len);
           else
            writer.write_code(32, 0x0a, len);
           for(var i = 0; i < len; i++)
            writer.write(8, caml_string_unsafe_get(v, i));
           writer.size_32 += 1 + ((len + 4) / 4 | 0);
           writer.size_64 += 1 + ((len + 8) / 8 | 0);
          }
          else if(v !== (v | 0)){
           var type_of_v = typeof v;
           if(type_of_v !== "number")
            caml_failwith("output_value: abstract value (" + type_of_v + ")");
           if(memo(v)) return;
           var t = caml_int64_to_bytes(caml_int64_bits_of_float(v));
           writer.write(8, 0x0c);
           for(var i = 0; i < 8; i++) writer.write(8, t[7 - i]);
           writer.size_32 += 3;
           writer.size_64 += 2;
          }
          else if(v >= 0 && v < 0x40)
           writer.write(8, 0x40 + v);
          else if(v >= - (1 << 7) && v < 1 << 7)
           writer.write_code(8, 0x00, v);
          else if(v >= - (1 << 15) && v < 1 << 15)
           writer.write_code(16, 0x01, v);
          else
           writer.write_code(32, 0x02, v);
         }
         extern_rec(v);
         while(stack.length > 0){
          var i = stack.pop(), v = stack.pop();
          if(i + 1 < v.length) stack.push(v, i + 1);
          extern_rec(v[i]);
         }
         if(intern_obj_table)
          writer.obj_counter = intern_obj_table.objs.length;
         writer.finalize();
         return new Uint8Array(writer.chunk);};
       }
       ();
   function caml_output_value_to_string(v, flags){
    return caml_string_of_uint8_array(caml_output_val(v, flags));
   }
   function caml_output_value(chanid, v, flags){
    var s = caml_output_value_to_string(v, flags);
    caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
    return 0;
   }
   function caml_output_value_to_buffer(s, ofs, len, v, flags){
    var t = caml_output_val(v, flags);
    if(t.length > len) caml_failwith("Marshal.to_buffer: buffer overflow");
    caml_blit_bytes(caml_bytes_of_uint8_array(t), 0, s, ofs, t.length);
    return 0;
   }
   function caml_output_value_to_bytes(v, flags){
    return caml_bytes_of_uint8_array(caml_output_val(v, flags));
   }
   var caml_parser_trace = 0;
   function caml_parse_engine(tables, env, cmd, arg){
    var
     ERRCODE = 256,
     loop = 6,
     testshift = 7,
     shift = 8,
     shift_recover = 9,
     reduce = 10,
     READ_TOKEN = 0,
     RAISE_PARSE_ERROR = 1,
     GROW_STACKS_1 = 2,
     GROW_STACKS_2 = 3,
     COMPUTE_SEMANTIC_ACTION = 4,
     CALL_ERROR_FUNCTION = 5,
     env_s_stack = 1,
     env_v_stack = 2,
     env_symb_start_stack = 3,
     env_symb_end_stack = 4,
     env_stacksize = 5,
     env_stackbase = 6,
     env_curr_char = 7,
     env_lval = 8,
     env_symb_start = 9,
     env_symb_end = 10,
     env_asp = 11,
     env_rule_len = 12,
     env_rule_number = 13,
     env_sp = 14,
     env_state = 15,
     env_errflag = 16,
     tbl_transl_const = 2,
     tbl_transl_block = 3,
     tbl_lhs = 4,
     tbl_len = 5,
     tbl_defred = 6,
     tbl_dgoto = 7,
     tbl_sindex = 8,
     tbl_rindex = 9,
     tbl_gindex = 10,
     tbl_tablesize = 11,
     tbl_table = 12,
     tbl_check = 13,
     tbl_names_const = 15,
     tbl_names_block = 16;
    function log(x){
     var s = caml_string_of_jsbytes(x + "\n");
     caml_ml_output(caml_sys_fds[2].chanid, s, 0, caml_ml_string_length(s));
    }
    function token_name(names, number){
     var str = caml_jsstring_of_string(names);
     if(str[0] === "\x00") return "<unknown token>";
     return str.split("\x00")[number];
    }
    function print_token(state, tok){
     var token, kind;
     if(Array.isArray(tok)){
      token = token_name(tables[tbl_names_block], tok[0]);
      if(typeof tok[1] === "number")
       kind = "" + tok[1];
      else if(typeof tok[1] === "string")
       kind = tok[1];
      else if(tok[1] instanceof MlBytes)
       kind = caml_jsbytes_of_string(tok[1]);
      else
       kind = "_";
      log("State " + state + ": read token " + token + "(" + kind + ")");
     }
     else{
      token = token_name(tables[tbl_names_const], tok);
      log("State " + state + ": read token " + token);
     }
    }
    if(! tables.dgoto){
     tables.defred = caml_lex_array(tables[tbl_defred]);
     tables.sindex = caml_lex_array(tables[tbl_sindex]);
     tables.check = caml_lex_array(tables[tbl_check]);
     tables.rindex = caml_lex_array(tables[tbl_rindex]);
     tables.table = caml_lex_array(tables[tbl_table]);
     tables.len = caml_lex_array(tables[tbl_len]);
     tables.lhs = caml_lex_array(tables[tbl_lhs]);
     tables.gindex = caml_lex_array(tables[tbl_gindex]);
     tables.dgoto = caml_lex_array(tables[tbl_dgoto]);
    }
    var
     res = 0,
     n,
     n1,
     n2,
     state1,
     sp = env[env_sp],
     state = env[env_state],
     errflag = env[env_errflag];
    the_loop:
    for(;;)
     switch(cmd){
       case 0:
        state = 0; errflag = 0;
       case 6:
        n = tables.defred[state];
        if(n !== 0){cmd = reduce; continue the_loop;}
        if(env[env_curr_char] >= 0){cmd = testshift; continue the_loop;}
        res = READ_TOKEN;
        break the_loop;
       case 1:
        if(Array.isArray(arg)){
         env[env_curr_char] = tables[tbl_transl_block][arg[0] + 1];
         env[env_lval] = arg[1];
        }
        else{
         env[env_curr_char] = tables[tbl_transl_const][arg + 1];
         env[env_lval] = 0;
        }
        if(caml_parser_trace) print_token(state, arg);
       case 7:
        n1 = tables.sindex[state];
        n2 = n1 + env[env_curr_char];
        if
         (n1 !== 0 && n2 >= 0 && n2 <= tables[tbl_tablesize]
          && tables.check[n2] === env[env_curr_char]){cmd = shift; continue the_loop;}
        n1 = tables.rindex[state];
        n2 = n1 + env[env_curr_char];
        if
         (n1 !== 0 && n2 >= 0 && n2 <= tables[tbl_tablesize]
          && tables.check[n2] === env[env_curr_char]){
         n = tables.table[n2];
         cmd = reduce;
         continue the_loop;
        }
        if(errflag <= 0){res = CALL_ERROR_FUNCTION; break the_loop;}
       case 5:
        if(errflag < 3){
         errflag = 3;
         for(;;){
          state1 = env[env_s_stack][sp + 1];
          n1 = tables.sindex[state1];
          n2 = n1 + ERRCODE;
          if
           (n1 !== 0 && n2 >= 0 && n2 <= tables[tbl_tablesize]
            && tables.check[n2] === ERRCODE){
           if(caml_parser_trace) log("Recovering in state " + state1);
           cmd = shift_recover;
           continue the_loop;
          }
          else{
           if(caml_parser_trace) log("Discarding state " + state1);
           if(sp <= env[env_stackbase]){
            if(caml_parser_trace) log("No more states to discard");
            return RAISE_PARSE_ERROR;
           }
           sp--;
          }
         }
        }
        else{
         if(env[env_curr_char] === 0) return RAISE_PARSE_ERROR;
         if(caml_parser_trace) log("Discarding last token read");
         env[env_curr_char] = - 1;
         cmd = loop;
         continue the_loop;
        }
       case 8:
        env[env_curr_char] = - 1; if(errflag > 0) errflag--;
       case 9:
        if(caml_parser_trace)
         log("State " + state + ": shift to state " + tables.table[n2]);
        state = tables.table[n2];
        sp++;
        if(sp >= env[env_stacksize]){res = GROW_STACKS_1; break the_loop;}
       case 2:
        env[env_s_stack][sp + 1] = state;
        env[env_v_stack][sp + 1] = env[env_lval];
        env[env_symb_start_stack][sp + 1] = env[env_symb_start];
        env[env_symb_end_stack][sp + 1] = env[env_symb_end];
        cmd = loop;
        continue the_loop;
       case 10:
        if(caml_parser_trace) log("State " + state + ": reduce by rule " + n);
        var m = tables.len[n];
        env[env_asp] = sp;
        env[env_rule_number] = n;
        env[env_rule_len] = m;
        sp = sp - m + 1;
        m = tables.lhs[n];
        state1 = env[env_s_stack][sp];
        n1 = tables.gindex[m];
        n2 = n1 + state1;
        if
         (n1 !== 0 && n2 >= 0 && n2 <= tables[tbl_tablesize]
          && tables.check[n2] === state1)
         state = tables.table[n2];
        else
         state = tables.dgoto[m];
        if(sp >= env[env_stacksize]){res = GROW_STACKS_2; break the_loop;}
       case 3:
        res = COMPUTE_SEMANTIC_ACTION; break the_loop;
       case 4:
        env[env_s_stack][sp + 1] = state;
        env[env_v_stack][sp + 1] = arg;
        var asp = env[env_asp];
        env[env_symb_end_stack][sp + 1] = env[env_symb_end_stack][asp + 1];
        if(sp > asp)
         env[env_symb_start_stack][sp + 1] = env[env_symb_end_stack][asp + 1];
        cmd = loop;
        continue the_loop;
       default: return RAISE_PARSE_ERROR;
     }
    env[env_sp] = sp;
    env[env_state] = state;
    env[env_errflag] = errflag;
    return res;
   }
   function caml_pure_js_expr(s){
    console.error("caml_pure_js_expr: fallback to runtime evaluation\n");
    return eval?.('"use strict";(' + caml_jsstring_of_string(s) + ")");
   }
   function caml_raise_not_found(){
    caml_raise_constant(caml_global_data.Not_found);
   }
   function caml_raw_backtrace_length(){return 0;}
   function caml_raw_backtrace_next_slot(_slot){return 0;}
   function caml_raw_backtrace_slot(_bt, _idx){
    caml_invalid_argument
     ("Printexc.get_raw_backtrace_slot: index out of bounds");
   }
   function caml_read_file_content(name){
    var
     name = typeof name === "string" ? caml_string_of_jsstring(name) : name,
     root = resolve_fs_device(name);
    if(root.device.exists(root.rest)){
     var
      file = root.device.open(root.rest, {rdonly: 1}),
      len = file.length(),
      buf = new Uint8Array(len);
     file.read(buf, 0, len, false);
     return caml_string_of_uint8_array(buf);
    }
    caml_raise_no_such_file(caml_jsstring_of_string(name));
   }
   function caml_recommended_domain_count(_unit){return 1;}
   function caml_record_backtrace(b){
    caml_record_backtrace_runtime_flag = b;
    return 0;
   }
   var jsoo_toplevel_reloc = undefined;
   function caml_register_global(n, v, name_opt){
    if(name_opt){
     var name = name_opt;
     if(jsoo_toplevel_reloc)
      n = caml_callback(jsoo_toplevel_reloc, [name]);
     else if(caml_global_data.symbols){
      if(! caml_global_data.symidx)
       caml_global_data.symidx = caml_build_symbols(caml_global_data.symbols);
      var nid = caml_global_data.symidx[name];
      if(nid >= 0)
       n = nid;
      else{
       var n = caml_global_data.symidx.next_idx++;
       caml_global_data.symidx[name] = n;
      }
     }
    }
    caml_global_data[n + 1] = v;
    if(name_opt) caml_global_data[name_opt] = v;
   }
   function caml_register_named_value(nm, v){
    caml_named_values[caml_jsbytes_of_string(nm)] = v;
    return 0;
   }
   function caml_restore_raw_backtrace(_exn, _bt){return 0;}
   function caml_round_float(x){
    if(x >= 0){
     var y = Math.floor(x);
     return x - y >= 0.5 ? y + 1 : y;
    }
    else{var y = Math.ceil(x); return y - x >= 0.5 ? y - 1 : y;}
   }
   function caml_runtime_events_create_cursor(_target){return {};}
   function caml_runtime_events_free_cursor(_cursor){return 0;}
   function caml_runtime_events_read_poll(_cursor, _callbacks, _num){return 0;
   }
   function caml_runtime_events_user_register
   (event_name, event_tag, event_type){
    caml_custom_event_index += 1;
    return [0, caml_custom_event_index, event_name, event_type, event_tag];
   }
   function caml_runtime_events_user_resolve(){return 0;}
   function caml_runtime_events_user_write(_event, _event_content){return 0;}
   function caml_runtime_parameters(_unit){return caml_string_of_jsbytes("");}
   function caml_runtime_variant(_unit){return caml_string_of_jsbytes("");}
   function caml_set_parser_trace(bool){
    var oldflag = caml_parser_trace;
    caml_parser_trace = bool;
    return oldflag;
   }
   function caml_set_static_env(k, v){jsoo_static_env[k] = v; return 0;}
   function caml_signbit_float(x){
    if(x === 0) x = 1 / x;
    return x < 0 ? 1 : 0;
   }
   function caml_sinh_float(x){return Math.sinh(x);}
   function caml_strerror(errno){
    const util = require("node:util");
    if(errno >= 0){
     const code = unix_error[errno];
     return util.getSystemErrorMap().entries().find(x=>x[1][0] === code)[1][1];
    }
    else
     return util.getSystemErrorMessage(errno);
   }
   function caml_string_bound_error(){
    caml_invalid_argument("index out of bounds");
   }
   function caml_string_concat(a, b){return a + b;}
   function caml_string_equal(s1, s2){if(s1 === s2) return 1; return 0;}
   function caml_string_get(s, i){
    if(i >>> 0 >= caml_ml_string_length(s)) caml_string_bound_error();
    return caml_string_unsafe_get(s, i);
   }
   function caml_string_get16(s, i){
    if(i >>> 0 >= caml_ml_string_length(s) - 1) caml_string_bound_error();
    var
     b1 = caml_string_unsafe_get(s, i),
     b2 = caml_string_unsafe_get(s, i + 1);
    return b2 << 8 | b1;
   }
   function caml_string_get32(s, i){
    if(i >>> 0 >= caml_ml_string_length(s) - 3) caml_string_bound_error();
    var
     b1 = caml_string_unsafe_get(s, i),
     b2 = caml_string_unsafe_get(s, i + 1),
     b3 = caml_string_unsafe_get(s, i + 2),
     b4 = caml_string_unsafe_get(s, i + 3);
    return b4 << 24 | b3 << 16 | b2 << 8 | b1;
   }
   function caml_string_get64(s, i){
    if(i >>> 0 >= caml_ml_string_length(s) - 7) caml_string_bound_error();
    var a = new Array(8);
    for(var j = 0; j < 8; j++) a[7 - j] = caml_string_unsafe_get(s, i + j);
    return caml_int64_of_bytes(a);
   }
   function caml_string_lessequal(s1, s2){return s1 <= s2 ? 1 : 0;}
   function caml_string_greaterequal(s1, s2){return caml_string_lessequal(s2, s1);
   }
   function caml_string_lessthan(s1, s2){return s1 < s2 ? 1 : 0;}
   function caml_string_greaterthan(s1, s2){return caml_string_lessthan(s2, s1);
   }
   function caml_string_hash(h, v){
    var h = caml_hash_mix_string(h, v), h = caml_hash_mix_final(h);
    return h & 0x3fffffff;
   }
   function caml_string_notequal(s1, s2){
    return 1 - caml_string_equal(s1, s2);
   }
   function caml_string_of_bytes(s){
    s.t & 6 && caml_convert_string_to_bytes(s);
    return caml_string_of_jsbytes(s.c);
   }
   function caml_string_set(_s, _i, _c){caml_failwith("caml_string_set");}
   function caml_sys_argv(_unit){return caml_argv;}
   function caml_sys_chdir(dir, raise_unix){
    var root = resolve_fs_device(dir);
    if(root.device.is_dir(root.rest)){
     if(root.rest)
      caml_current_dir = caml_trailing_slash(root.path + root.rest);
     else
      caml_current_dir = root.path;
     return 0;
    }
    else if(root.device.exists(root.rest))
     caml_raise_system_error
      (raise_unix,
       "ENOTDIR",
       "chdir",
       "not a directory",
       caml_jsstring_of_string(dir));
    else
     caml_raise_no_such_file(caml_jsstring_of_string(dir), raise_unix);
   }
   function caml_sys_const_backend_type(){
    return [0, caml_string_of_jsbytes("js_of_ocaml")];
   }
   function caml_sys_const_big_endian(){return 0;}
   function caml_sys_const_int_size(){return 32;}
   function caml_sys_const_max_wosize(){return 0x7fffffff / 4 | 0;}
   function caml_sys_const_naked_pointers_checked(_unit){return 0;}
   var os_type = jsoo_is_win32 ? "Win32" : "Unix";
   function caml_sys_const_ostype_cygwin(){return os_type === "Cygwin" ? 1 : 0;
   }
   function caml_sys_const_ostype_unix(){return os_type === "Unix" ? 1 : 0;}
   function caml_sys_const_ostype_win32(){return os_type === "Win32" ? 1 : 0;}
   function caml_sys_const_word_size(){return 32;}
   function caml_sys_executable_name(_unit){return caml_executable_name;}
   function caml_sys_exit(code){
    if(globalThis.quit) globalThis.quit(code);
    if(globalThis.process?.exit) globalThis.process.exit(code);
    caml_invalid_argument("Function 'exit' not implemented");
   }
   function caml_sys_file_exists(name){
    var root = resolve_fs_device(name);
    return root.device.exists(root.rest);
   }
   function caml_sys_get_argv(_unit){return [0, caml_argv[1], caml_argv];}
   function caml_sys_get_config(){
    return [0, caml_string_of_jsbytes(os_type), 32, 0];
   }
   function caml_sys_getcwd(){
    return caml_string_of_jsstring(caml_current_dir);
   }
   function caml_sys_getenv(name){
    var r = jsoo_sys_getenv(caml_jsstring_of_string(name));
    if(r === undefined) caml_raise_not_found();
    return caml_string_of_jsstring(r);
   }
   function caml_sys_is_directory(name){
    var root = resolve_fs_device(name), a = root.device.is_dir(root.rest);
    return a ? 1 : 0;
   }
   function caml_sys_is_regular_file(name){
    var root = resolve_fs_device(name);
    return root.device.isFile(root.rest);
   }
   function caml_sys_isatty(_chan){return 0;}
   function caml_sys_mkdir(name, perm){
    var root = resolve_fs_device(name);
    root.device.mkdir(root.rest, perm);
    return 0;
   }
   function caml_sys_modify_argv(arg){caml_argv = arg; return 0;}
   function caml_sys_random_seed(){
    if(globalThis.crypto)
     if(globalThis.crypto.getRandomValues){
      var a = globalThis.crypto.getRandomValues(new Int32Array(4));
      return [0, a[0], a[1], a[2], a[3]];
     }
     else if(globalThis.crypto.randomBytes){
      var a = new Int32Array(globalThis.crypto.randomBytes(16).buffer);
      return [0, a[0], a[1], a[2], a[3]];
     }
    var now = new Date().getTime(), x = now ^ 0xffffffff * Math.random();
    return [0, x];
   }
   function caml_sys_read_directory(name){
    var
     root = resolve_fs_device(name),
     a = root.device.readdir(root.rest),
     l = new Array(a.length + 1);
    l[0] = 0;
    for(var i = 0; i < a.length; i++)
     l[i + 1] = caml_string_of_jsstring(a[i]);
    return l;
   }
   function caml_sys_remove(name){
    var root = resolve_fs_device(name);
    return root.device.unlink(root.rest);
   }
   function caml_sys_rename(o, n){
    var o_root = resolve_fs_device(o), n_root = resolve_fs_device(n);
    if(o_root.device !== n_root.device)
     caml_failwith("caml_sys_rename: cannot move file between two filesystem");
    if(! o_root.device.rename)
     caml_failwith("caml_sys_rename: not implemented");
    o_root.device.rename(o_root.rest, n_root.rest);
   }
   function caml_sys_rmdir(name){
    var root = resolve_fs_device(name);
    root.device.rmdir(root.rest);
    return 0;
   }
   function caml_sys_system_command(cmd){
    var cmd = caml_jsstring_of_string(cmd);
    if(typeof require !== "undefined"){
     var child_process = require("node:child_process");
     if(child_process?.execSync)
      try{child_process.execSync(cmd, {stdio: "inherit"}); return 0;}
      catch(e){return 1;}
    }
    else
     return 127;
   }
   var caml_initial_time = new Date().getTime() * 0.001;
   function caml_sys_time(){
    var now = new Date().getTime();
    return now * 0.001 - caml_initial_time;
   }
   function caml_sys_time_include_children(_b){return caml_sys_time();}
   function caml_sys_unsafe_getenv(name){return caml_sys_getenv(name);}
   function caml_tanh_float(x){return Math.tanh(x);}
   function caml_throw_js_exception(exn){throw exn;}
   function caml_to_js_string(s){return caml_jsstring_of_string(s);}
   function caml_trampoline(res){
    var c = 1;
    while(res?.joo_tramp){res = res.joo_tramp.apply(null, res.joo_args); c++;}
    return res;
   }
   function caml_trampoline_return(f, args, direct){
    return {joo_tramp: f, joo_args: args, joo_direct: direct};
   }
   function caml_trunc_float(x){return Math.trunc(x);}
   function caml_unix_access(name, flags){
    var f = {};
    while(flags){
     switch(flags[1]){
       case 0:
        f.r = 1; break;
       case 1:
        f.w = 1; break;
       case 2:
        f.x = 1; break;
       case 3:
        f.f = 1; break;
     }
     flags = flags[2];
    }
    var root = resolve_fs_device(name);
    if(! root.device.access)
     caml_failwith("caml_unix_access: not implemented");
    root.device.access(root.rest, f, true);
    return 0;
   }
   function caml_unix_chdir(dir){return caml_sys_chdir(dir, true);}
   function caml_unix_chmod(name, perms){
    var root = resolve_fs_device(name);
    if(! root.device.chmod) caml_failwith("caml_unix_chmod: not implemented");
    return root.device.chmod(root.rest, perms);
   }
   function caml_unix_cleanup(){}
   function caml_unix_lookup_file(fd, cmd){
    var fd_desc = caml_sys_fds[fd];
    if(fd_desc === undefined) caml_raise_system_error(1, "EBADF", cmd);
    return fd_desc.file;
   }
   function caml_unix_close(fd){
    var file = caml_unix_lookup_file(fd, "close");
    file.close(1);
    return 0;
   }
   function caml_unix_closedir(dir_handle){
    try{dir_handle.pointer.closeSync();}
    catch(e){caml_raise_system_error(1, "EBADF", "closedir");}
   }
   function caml_unix_fchmod(fd, perms){
    var file = caml_unix_lookup_file(fd, "fchmod");
    if(! file.chmod) caml_failwith("caml_unix_fchmod: not implemented");
    return file.chmod(perms);
   }
   function caml_unix_filedescr_of_fd(x){return x;}
   function caml_unix_findclose(dir_handle){return caml_unix_closedir(dir_handle);
   }
   function caml_unix_opendir(path){
    var root = resolve_fs_device(path);
    if(! root.device.opendir)
     caml_failwith("caml_unix_opendir: not implemented");
    var dir_handle = root.device.opendir(root.rest, true);
    return {pointer: dir_handle, path: path};
   }
   function caml_unix_readdir(dir_handle){
    var entry;
    try{entry = dir_handle.pointer.readSync();}
    catch(e){caml_raise_system_error(1, "EBADF", "readdir");}
    if(entry === null)
     caml_raise_end_of_file();
    else
     return caml_string_of_jsstring(entry.name);
   }
   function caml_unix_findfirst(path){
    var path_js = caml_jsstring_of_string(path);
    path_js = path_js.replace(/(^|[\\/])\*\.\*$/, "");
    path = caml_string_of_jsstring(path_js);
    var
     dir_handle = caml_unix_opendir(path),
     first_entry = caml_unix_readdir(dir_handle);
    return [0, first_entry, dir_handle];
   }
   function caml_unix_findnext(dir_handle){return caml_unix_readdir(dir_handle);
   }
   function caml_unix_fstat(fd){
    var file = caml_unix_lookup_file(fd, "fstat");
    if(! file.stat) caml_failwith("caml_unix_fstat: not implemented");
    return file.stat(false);
   }
   function caml_unix_fstat_64(fd){
    var file = caml_unix_lookup_file(fd, "fstat");
    if(! file.stat) caml_failwith("caml_unix_fstat64: not implemented");
    return file.stat(true);
   }
   function caml_unix_fsync(fd){
    var file = caml_unix_lookup_file(fd, "fsync");
    if(! file.sync) caml_failwith("caml_unix_fsync: not implemented");
    return file.sync();
   }
   function caml_unix_ftruncate(fd, len){
    var file = caml_unix_lookup_file(fd, "ftruncate");
    if(! file.truncate) caml_failwith("caml_unix_ftruncate: not implemented");
    file.truncate(len, 1);
    return 0;
   }
   function caml_unix_ftruncate_64(fd, len){
    var file = caml_unix_lookup_file(fd, "ftruncate");
    if(! file.truncate)
     caml_failwith("caml_unix_ftruncate_64: not implemented");
    file.truncate(caml_int64_to_float(len), 1);
    return 0;
   }
   function caml_unix_getegid(_unit){
    if(globalThis.process?.getegid) return globalThis.process.getegid();
    return 1;
   }
   function caml_unix_geteuid(_unit){
    if(globalThis.process?.geteuid) return globalThis.process.geteuid();
    return 1;
   }
   function caml_unix_getgid(_unit){
    if(globalThis.process?.getgid) return globalThis.process.getgid();
    return 1;
   }
   function caml_unix_getpwnam(_unit){caml_raise_not_found();}
   function caml_unix_gettimeofday(){return new Date().getTime() / 1000;}
   function caml_unix_getuid(_unit){
    if(globalThis.process?.getuid) return globalThis.process.getuid();
    return 1;
   }
   function caml_unix_gmtime(t){
    var
     d = new Date(t * 1000),
     d_num = d.getTime(),
     januaryfirst = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)).getTime(),
     doy = Math.floor((d_num - januaryfirst) / 86400000);
    return [0,
            d.getUTCSeconds(),
            d.getUTCMinutes(),
            d.getUTCHours(),
            d.getUTCDate(),
            d.getUTCMonth(),
            d.getUTCFullYear() - 1900,
            d.getUTCDay(),
            doy,
            false | 0];
   }
   function caml_unix_has_symlink(_unit){return fs_node_supported() ? 1 : 0;}
   function caml_unix_inchannel_of_filedescr(fd){
    var file = caml_unix_lookup_file(fd, "in_channel_of_descr");
    file.check_stream_semantics("in_channel_of_descr");
    return caml_ml_open_descriptor_in(fd);
   }
   function caml_unix_inet_addr_of_string(){return 0;}
   function caml_unix_isatty(fd){
    var file = caml_unix_lookup_file(fd);
    if(! file.isatty) return 0;
    return file.isatty();
   }
   function caml_unix_link(follow, src, dst){
    var src_root = resolve_fs_device(src), dst_root = resolve_fs_device(dst);
    if(! src_root.device.link)
     caml_failwith("caml_unix_link: not implemented");
    if(typeof follow !== "number")
     caml_raise_system_error(1, "ENOSYS", "link");
    if(src_root.device !== dst_root.device)
     caml_raise_system_error(1, "EXDEV", "link");
    return src_root.device.link(src_root.rest, dst_root.rest, true);
   }
   function caml_unix_localtime(t){
    var
     d = new Date(t * 1000),
     d_num = d.getTime(),
     januaryfirst = new Date(d.getFullYear(), 0, 1).getTime(),
     doy = Math.floor((d_num - januaryfirst) / 86400000),
     jan = new Date(d.getFullYear(), 0, 1),
     jul = new Date(d.getFullYear(), 6, 1),
     stdTimezoneOffset =
       Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
    return [0,
            d.getSeconds(),
            d.getMinutes(),
            d.getHours(),
            d.getDate(),
            d.getMonth(),
            d.getFullYear() - 1900,
            d.getDay(),
            doy,
            d.getTimezoneOffset() < stdTimezoneOffset | 0];
   }
   function caml_unix_lseek(fd, len, whence){
    var file = caml_unix_lookup_file(fd, "lseek");
    return file.seek(len, whence, 1);
   }
   function caml_unix_lseek_64(fd, len, whence){
    var file = caml_unix_lookup_file(fd, "lseek");
    return file.seek(caml_int64_to_float(len), whence, 1);
   }
   function caml_unix_lstat(name){
    var root = resolve_fs_device(name);
    if(! root.device.lstat) caml_failwith("caml_unix_lstat: not implemented");
    return root.device.lstat(root.rest, false, true);
   }
   function caml_unix_lstat_64(name){
    var root = resolve_fs_device(name);
    if(! root.device.lstat)
     caml_failwith("caml_unix_lstat_64: not implemented");
    return root.device.lstat(root.rest, true, true);
   }
   function caml_unix_mkdir(name, perm){
    var root = resolve_fs_device(name);
    if(! root.device.mkdir) caml_failwith("caml_unix_mkdir: not implemented");
    return root.device.mkdir(root.rest, perm, true);
   }
   function caml_unix_mktime(tm){
    var
     d = new Date(tm[6] + 1900, tm[5], tm[4], tm[3], tm[2], tm[1]).getTime(),
     t = Math.floor(d / 1000),
     tm2 = caml_unix_localtime(t);
    return [0, t, tm2];
   }
   function caml_unix_open(name, flags, perms){
    var f = {};
    while(flags){
     switch(flags[1]){
       case 0:
        f.rdonly = 1; break;
       case 1:
        f.wronly = 1; break;
       case 2:
        f.rdwr = 1; break;
       case 3:
        f.nonblock = 1; break;
       case 4:
        f.append = 1; break;
       case 5:
        f.create = 1; break;
       case 6:
        f.truncate = 1; break;
       case 7:
        f.excl = 1; break;
       case 8:
        f.noctty = 1; break;
       case 9:
        f.dsync = 1; break;
       case 10:
        f.sync = 1; break;
     }
     flags = flags[2];
    }
    var
     root = resolve_fs_device(name),
     file = root.device.open(root.rest, f, perms, true),
     idx = caml_sys_fds.length,
     chanid = new MlChanid(idx);
    caml_sys_fds[idx] = {file: file, chanid: chanid};
    return idx | 0;
   }
   function caml_unix_outchannel_of_filedescr(fd){
    var file = caml_unix_lookup_file(fd, "out_channel_of_descr");
    file.check_stream_semantics("out_channel_of_descr");
    return caml_ml_open_descriptor_out(fd);
   }
   function caml_unix_read(fd, buf, pos, len){
    var file = caml_unix_lookup_file(fd, "read");
    return file.read(caml_uint8_array_of_bytes(buf), pos, len, 1);
   }
   function caml_unix_read_bigarray(fd, buf, pos, len){
    var
     a = caml_ba_to_typed_array(buf),
     file = caml_unix_lookup_file(fd, "read");
    return file.read(a, pos, len, 1);
   }
   function caml_unix_readlink(name){
    var root = resolve_fs_device(name);
    if(! root.device.readlink)
     caml_failwith("caml_unix_readlink: not implemented");
    return root.device.readlink(root.rest, true);
   }
   function caml_unix_rename(o, n){
    var o_root = resolve_fs_device(o), n_root = resolve_fs_device(n);
    if(o_root.device !== n_root.device)
     caml_raise_system_error(1, "EXDEV", "rename");
    if(! o_root.device.rename)
     caml_failwith("caml_sys_rename: not implemented");
    o_root.device.rename(o_root.rest, n_root.rest, true);
   }
   function caml_unix_rewinddir(dir_handle){
    caml_unix_closedir(dir_handle);
    var new_dir_handle = caml_unix_opendir(dir_handle.path);
    dir_handle.pointer = new_dir_handle.pointer;
    return 0;
   }
   function caml_unix_rmdir(name){
    var root = resolve_fs_device(name);
    if(! root.device.rmdir) caml_failwith("caml_unix_rmdir: not implemented");
    return root.device.rmdir(root.rest, true);
   }
   function caml_unix_single_write(fd, buf, pos, len){
    var file = caml_unix_lookup_file(fd, "write");
    if(len === 0) return 0;
    return file.write(caml_uint8_array_of_bytes(buf), pos, len, 1);
   }
   function caml_unix_startup(){}
   function caml_unix_stat(name){
    var root = resolve_fs_device(name);
    if(! root.device.stat) caml_failwith("caml_unix_stat: not implemented");
    return root.device.stat(root.rest, false, true);
   }
   function caml_unix_stat_64(name){
    var root = resolve_fs_device(name);
    if(! root.device.stat)
     caml_failwith("caml_unix_stat_64: not implemented");
    return root.device.stat(root.rest, true, true);
   }
   function caml_unix_symlink(to_dir, src, dst){
    var dst_root = resolve_fs_device(dst);
    if(! dst_root.device.symlink)
     caml_failwith("caml_unix_symlink: not implemented");
    return dst_root.device.symlink
            (to_dir, caml_jsstring_of_string(src), dst_root.rest, true);
   }
   function caml_unix_time(){return Math.floor(caml_unix_gettimeofday());}
   function caml_unix_times(){
    if(globalThis.process?.cpuUsage){
     var t = globalThis.process.cpuUsage();
     return [0, t.user / 1e6, t.system / 1e6, 0, 0];
    }
    else if(globalThis.performance?.now)
     return [0, globalThis.performance.now() / 1000, 0, 0, 0];
    else
     caml_failwith("caml_unix_times: not implemented");
   }
   function caml_unix_truncate(name, len){
    var root = resolve_fs_device(name);
    if(! root.device.truncate)
     caml_failwith("caml_unix_truncate: not implemented");
    root.device.truncate(root.rest, len, true);
    return 0;
   }
   function caml_unix_truncate_64(name, len){
    var root = resolve_fs_device(name);
    if(! root.device.truncate)
     caml_failwith("caml_unix_truncate_64: not implemented");
    root.device.truncate(root.rest, caml_int64_to_float(len), true);
    return 0;
   }
   function caml_unix_unlink(name){
    var root = resolve_fs_device(name);
    if(! root.device.unlink)
     caml_failwith("caml_unix_unlink: not implemented");
    root.device.unlink(root.rest, true);
    return 0;
   }
   function caml_unix_utimes(name, atime, mtime){
    var root = resolve_fs_device(name);
    if(! root.device.utimes)
     caml_failwith("caml_unix_utimes: not implemented");
    root.device.utimes(root.rest, atime, mtime, true);
    return 0;
   }
   function caml_unix_write(fd, buf, pos, len){
    var
     file = caml_unix_lookup_file(fd, "write"),
     a = caml_uint8_array_of_bytes(buf),
     written = 0;
    while(len > 0){
     var n = file.write(a, pos, len, 1);
     written += n;
     pos += n;
     len -= n;
    }
    return written;
   }
   function caml_unix_write_bigarray(fd, buf, pos, len){
    var
     a = caml_ba_to_typed_array(buf),
     file = caml_unix_lookup_file(fd, "write"),
     written = 0;
    while(len > 0){
     var n = file.write(a, pos, len, 1);
     written += n;
     pos += n;
     len -= n;
    }
    return written;
   }
   function caml_unmount(name){
    var
     path = caml_make_path(name),
     name = caml_trailing_slash(path.join("/")),
     idx = - 1;
    for(var i = 0; i < jsoo_mount_point.length; i++)
     if(jsoo_mount_point[i].path === name) idx = i;
    if(idx > - 1) jsoo_mount_point.splice(idx, 1);
    return 0;
   }
   function caml_update_dummy(x, y){
    if(y.fun){x.fun = y.fun; return 0;}
    if(typeof y === "function"){x.fun = y; return 0;}
    var i = y.length;
    while(i--) x[i] = y[i];
    return 0;
   }
   function caml_weak_set(x, i, v){
    if(v === 0) caml_ephe_unset_key(x, i); else caml_ephe_set_key(x, i, v[1]);
    return 0;
   }
   function caml_wrap_exception(e){
    {
     if(Array.isArray(e)) return e;
     var exn;
     if
      (globalThis.RangeError && e instanceof globalThis.RangeError
       && e.message
       && e.message.match(/maximum call stack/i))
      exn = caml_global_data.Stack_overflow;
     else if
      (globalThis.InternalError && e instanceof globalThis.InternalError
       && e.message
       && e.message.match(/too much recursion/i))
      exn = caml_global_data.Stack_overflow;
     else if(e instanceof globalThis.Error && caml_named_value("jsError"))
      exn = [0, caml_named_value("jsError"), e];
     else
      exn = [0, caml_global_data.Failure, caml_string_of_jsstring(String(e))];
     if(e instanceof globalThis.Error) exn.js_error = e;
     return exn;
    }
   }
   function caml_xdg_defaults(_unit){return 0;}
   function caml_xmlhttprequest_create(_unit){
    if(typeof XMLHttpRequest === "undefined")
     caml_failwith("XMLHttpRequest is not available");
    try{return new XMLHttpRequest();}
    catch{caml_failwith("Failed to create XMLHttpRequest");}
   }
   function caml_zstd_initialize(_unit){
    caml_decompress_input = zstd_decompress;
    return 1;
   }
   function compare_digits_nat(nat1, ofs1, nat2, ofs2){
    if(nat1.data[ofs1] > nat2.data[ofs2]) return 1;
    if(nat1.data[ofs1] < nat2.data[ofs2]) return - 1;
    return 0;
   }
   function compare_nat(nat1, ofs1, len1, nat2, ofs2, len2){
    var
     a = num_digits_nat(nat1, ofs1, len1),
     b = num_digits_nat(nat2, ofs2, len2);
    if(a > b) return 1;
    if(a < b) return - 1;
    for(var i = len1 - 1; i >= 0; i--){
     if(nat1.data[ofs1 + i] >>> 0 > nat2.data[ofs2 + i] >>> 0) return 1;
     if(nat1.data[ofs1 + i] >>> 0 < nat2.data[ofs2 + i] >>> 0) return - 1;
    }
    return 0;
   }
   function complement_nat(nat, ofs, len){
    for(var i = 0; i < len; i++)
     nat.data[ofs + i] = (- 1 >>> 0) - (nat.data[ofs + i] >>> 0);
   }
   function create_nat(size){
    var arr = new MlNat(size);
    for(var i = 0; i < size; i++) arr.data[i] = - 1;
    return arr;
   }
   function decr_nat(nat, ofs, len, carry_in){
    var borrow = carry_in === 1 ? 0 : 1;
    for(var i = 0; i < len; i++){
     var x = (nat.data[ofs + i] >>> 0) - borrow;
     nat.data[ofs + i] = x;
     if(x >= 0){borrow = 0; break;} else borrow = 1;
    }
    return borrow === 1 ? 0 : 1;
   }
   function deserialize_nat(reader, sz){
    var len = reader.read32s(), nat = new MlNat(len);
    for(var i = 0; i < len; i++) nat.data[i] = reader.read32s();
    sz[0] = len * 4;
    return nat;
   }
   function div_helper(a, b, c){
    var
     x = a * 65536 + (b >>> 16),
     y = Math.floor(x / c) * 65536,
     z = x % c * 65536,
     w = z + (b & 0x0000ffff);
    return [y + Math.floor(w / c), w % c];
   }
   function div_digit_nat(natq, ofsq, natr, ofsr, nat1, ofs1, len, nat2, ofs2){
    var rem = nat1.data[ofs1 + len - 1] >>> 0;
    for(var i = len - 2; i >= 0; i--){
     var
      x = div_helper(rem, nat1.data[ofs1 + i] >>> 0, nat2.data[ofs2] >>> 0);
     natq.data[ofsq + i] = x[0];
     rem = x[1];
    }
    natr.data[ofsr] = rem;
    return 0;
   }
   function num_leading_zero_bits_in_digit(nat, ofs){
    var a = nat.data[ofs], b = 0;
    if(a & 0xffff0000){b += 16; a >>>= 16;}
    if(a & 0xff00){b += 8; a >>>= 8;}
    if(a & 0xf0){b += 4; a >>>= 4;}
    if(a & 12){b += 2; a >>>= 2;}
    if(a & 2){b += 1; a >>>= 1;}
    if(a & 1) b += 1;
    return 32 - b;
   }
   function shift_left_nat(nat1, ofs1, len1, nat2, ofs2, nbits){
    if(nbits === 0){nat2.data[ofs2] = 0; return 0;}
    var wrap = 0;
    for(var i = 0; i < len1; i++){
     var a = nat1.data[ofs1 + i] >>> 0;
     nat1.data[ofs1 + i] = a << nbits | wrap;
     wrap = a >>> 32 - nbits;
    }
    nat2.data[ofs2] = wrap;
    return 0;
   }
   function shift_right_nat(nat1, ofs1, len1, nat2, ofs2, nbits){
    if(nbits === 0){nat2.data[ofs2] = 0; return 0;}
    var wrap = 0;
    for(var i = len1 - 1; i >= 0; i--){
     var a = nat1.data[ofs1 + i] >>> 0;
     nat1.data[ofs1 + i] = a >>> nbits | wrap;
     wrap = a << 32 - nbits;
    }
    nat2.data[ofs2] = wrap;
    return 0;
   }
   function set_to_zero_nat(nat, ofs, len){
    for(var i = 0; i < len; i++) nat.data[ofs + i] = 0;
    return 0;
   }
   function nat_of_array(l){return new MlNat(l);}
   function mult_digit_nat(nat1, ofs1, len1, nat2, ofs2, len2, nat3, ofs3){
    var carry = 0, a = nat3.data[ofs3] >>> 0;
    for(var i = 0; i < len2; i++){
     var
      x1 =
        (nat1.data[ofs1 + i] >>> 0)
        + (nat2.data[ofs2 + i] >>> 0) * (a & 0x0000ffff)
        + carry,
      x2 = (nat2.data[ofs2 + i] >>> 0) * (a >>> 16);
     carry = Math.floor(x2 / 65536);
     var x3 = x1 + x2 % 65536 * 65536;
     nat1.data[ofs1 + i] = x3;
     carry += Math.floor(x3 / 4294967296);
    }
    return len2 < len1 && carry
            ? add_nat
              (nat1, ofs1 + len2, len1 - len2, nat_of_array([carry]), 0, 1, 0)
            : carry;
   }
   function sub_nat(nat1, ofs1, len1, nat2, ofs2, len2, carry_in){
    var borrow = carry_in === 1 ? 0 : 1;
    for(var i = 0; i < len2; i++){
     var
      x = (nat1.data[ofs1 + i] >>> 0) - (nat2.data[ofs2 + i] >>> 0) - borrow;
     nat1.data[ofs1 + i] = x;
     if(x >= 0) borrow = 0; else borrow = 1;
    }
    return decr_nat(nat1, ofs1 + len2, len1 - len2, borrow === 1 ? 0 : 1);
   }
   function div_nat(nat1, ofs1, len1, nat2, ofs2, len2){
    if(len2 === 1){
     div_digit_nat(nat1, ofs1 + 1, nat1, ofs1, nat1, ofs1, len1, nat2, ofs2);
     return 0;
    }
    var s = num_leading_zero_bits_in_digit(nat2, ofs2 + len2 - 1);
    shift_left_nat(nat2, ofs2, len2, nat_of_array([0]), 0, s);
    shift_left_nat(nat1, ofs1, len1, nat_of_array([0]), 0, s);
    var d = (nat2.data[ofs2 + len2 - 1] >>> 0) + 1, a = create_nat(len2 + 1);
    for(var i = len1 - 1; i >= len2; i--){
     var
      quo =
        d === 4294967296
         ? nat1.data[ofs1 + i] >>> 0
         : div_helper
            (nat1.data[ofs1 + i] >>> 0, nat1.data[ofs1 + i - 1] >>> 0, d)
           [0];
     set_to_zero_nat(a, 0, len2 + 1);
     mult_digit_nat(a, 0, len2 + 1, nat2, ofs2, len2, nat_of_array([quo]), 0);
     sub_nat(nat1, ofs1 + i - len2, len2 + 1, a, 0, len2 + 1, 1);
     while
     (nat1.data[ofs1 + i] !== 0
      || compare_nat(nat1, ofs1 + i - len2, len2, nat2, ofs2, len2) >= 0){
      quo = quo + 1;
      sub_nat(nat1, ofs1 + i - len2, len2 + 1, nat2, ofs2, len2, 1);
     }
     nat1.data[ofs1 + i] = quo;
    }
    shift_right_nat(nat1, ofs1, len2, nat_of_array([0]), 0, s);
    shift_right_nat(nat2, ofs2, len2, nat_of_array([0]), 0, s);
    return 0;
   }
   function serialize_nat(writer, nat, sz){
    var len = nat.data.length;
    writer.write(32, len);
    for(var i = 0; i < len; i++) writer.write(32, nat.data[i]);
    sz[0] = len * 4;
    sz[1] = len * 8;
   }
   function initialize_nat(){
    caml_custom_ops._nat =
     {deserialize: deserialize_nat,
      serialize: serialize_nat,
      hash: caml_hash_nat};
   }
   function is_digit_int(nat, ofs){if(nat.data[ofs] >= 0) return 1; return 0;}
   function is_digit_normalized(_nat, _ofs){return 1;}
   function is_digit_odd(nat, ofs){if(nat.data[ofs] & 1) return 1; return 0;}
   function is_digit_zero(nat, ofs){
    if(nat.data[ofs] === 0) return 1;
    return 0;
   }
   function jsoo_create_file_extern(name, content){
    if(globalThis.jsoo_create_file)
     globalThis.jsoo_create_file(name, content);
    else{
     if(! globalThis.jsoo_fs_tmp) globalThis.jsoo_fs_tmp = [];
     globalThis.jsoo_fs_tmp.push({name: name, content: content});
    }
    return 0;
   }
   function jsoo_effect_not_supported(){
    caml_failwith("Effect handlers are not supported");
   }
   function land_digit_nat(nat1, ofs1, nat2, ofs2){nat1.data[ofs1] &= nat2.data[ofs2]; return 0;
   }
   function length_nat(x){return x.data.length;}
   function lor_digit_nat(nat1, ofs1, nat2, ofs2){nat1.data[ofs1] |= nat2.data[ofs2]; return 0;
   }
   function lxor_digit_nat(nat1, ofs1, nat2, ofs2){nat1.data[ofs1] ^= nat2.data[ofs2]; return 0;
   }
   function mult_nat(nat1, ofs1, len1, nat2, ofs2, len2, nat3, ofs3, len3){
    var carry = 0;
    for(var i = 0; i < len3; i++)
     carry +=
      mult_digit_nat
       (nat1, ofs1 + i, len1 - i, nat2, ofs2, len2, nat3, ofs3 + i);
    return carry;
   }
   function nth_digit_nat(nat, ofs){return nat.data[ofs];}
   function nth_digit_nat_native(nat, ofs){return nat.data[ofs];}
   var
    re_match =
      function(){
        var
         re_word_letters =
           [0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0xff,
            0x03,
            0xfe,
            0xff,
            0xff,
            0x87,
            0xfe,
            0xff,
            0xff,
            0x07,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0xff,
            0xff,
            0x7f,
            0xff,
            0xff,
            0xff,
            0x7f,
            0xff],
         opcodes =
           {CHAR: 0,
            CHARNORM: 1,
            STRING: 2,
            STRINGNORM: 3,
            CHARCLASS: 4,
            BOL: 5,
            EOL: 6,
            WORDBOUNDARY: 7,
            BEGGROUP: 8,
            ENDGROUP: 9,
            REFGROUP: 10,
            ACCEPT: 11,
            SIMPLEOPT: 12,
            SIMPLESTAR: 13,
            SIMPLEPLUS: 14,
            GOTO: 15,
            PUSHBACK: 16,
            SETMARK: 17,
            CHECKPROGRESS: 18};
        function is_word_letter(c){
         return re_word_letters[c >> 3] >> (c & 7) & 1;
        }
        function in_bitset(s, i){
         return caml_string_get(s, i >> 3) >> (i & 7) & 1;
        }
        function re_match_impl(re, s, pos, partial){
         var
          prog = caml_js_from_array(re[1]),
          cpool = caml_js_from_array(re[2]),
          normtable = caml_jsbytes_of_string(re[3]),
          numgroups = re[4] | 0,
          numregisters = re[5] | 0,
          s = caml_uint8_array_of_string(s),
          pc = 0,
          quit = false,
          stack = [],
          groups = new Array(numgroups),
          re_register = new Array(numregisters);
         for(var i = 0; i < groups.length; i++)
          groups[i] = {start: - 1, end: - 1};
         groups[0].start = pos;
         function backtrack(){
          while(stack.length){
           var item = stack.pop();
           if(item.undo)
            item.undo.obj[item.undo.prop] = item.undo.value;
           else if(item.pos){pc = item.pos.pc; pos = item.pos.txt; return;}
          }
          quit = true;
         }
         function push(item){stack.push(item);}
         function accept(){
          groups[0].end = pos;
          var result = new Array(1 + groups.length * 2);
          result[0] = 0;
          for(var i = 0; i < groups.length; i++){
           var g = groups[i];
           if(g.start < 0 || g.end < 0) g.start = g.end = - 1;
           result[2 * i + 1] = g.start;
           result[2 * i + 1 + 1] = g.end;
          }
          return result;
         }
         function prefix_match(){
          if(partial) return accept(); else backtrack();
         }
         while(! quit){
          var
           op = prog[pc] & 0xff,
           sarg = prog[pc] >> 8,
           uarg = sarg & 0xff,
           c = s[pos],
           group;
          pc++;
          switch(op){
            case opcodes.CHAR:
             if(pos === s.length){prefix_match(); break;}
             if(c === uarg) pos++; else backtrack();
             break;
            case opcodes.CHARNORM:
             if(pos === s.length){prefix_match(); break;}
             if(normtable.charCodeAt(c) === uarg) pos++; else backtrack();
             break;
            case opcodes.STRING:
             for
             (var arg = caml_jsbytes_of_string(cpool[uarg]), i = 0;
              i < arg.length;
              i++){
              if(pos === s.length){prefix_match(); break;}
              if(c === arg.charCodeAt(i))
               c = s[++pos];
              else{backtrack(); break;}
             }
             break;
            case opcodes.STRINGNORM:
             for
             (var arg = caml_jsbytes_of_string(cpool[uarg]), i = 0;
              i < arg.length;
              i++){
              if(pos === s.length){prefix_match(); break;}
              if(normtable.charCodeAt(c) === arg.charCodeAt(i))
               c = s[++pos];
              else{backtrack(); break;}
             }
             break;
            case opcodes.CHARCLASS:
             if(pos === s.length){prefix_match(); break;}
             if(in_bitset(cpool[uarg], c)) pos++; else backtrack();
             break;
            case opcodes.BOL:
             if(pos > 0 && s[pos - 1] !== 10) backtrack(); break;
            case opcodes.EOL:
             if(pos < s.length && s[pos] !== 10) backtrack(); break;
            case opcodes.WORDBOUNDARY:
             if(pos === 0){
              if(pos === s.length){prefix_match(); break;}
              if(is_word_letter(s[0])) break;
              backtrack();
             }
             else if(pos === s.length){
              if(is_word_letter(s[pos - 1])) break;
              backtrack();
             }
             else{
              if(is_word_letter(s[pos - 1]) !== is_word_letter(s[pos])) break;
              backtrack();
             }
             break;
            case opcodes.BEGGROUP:
             group = groups[uarg];
             push({undo: {obj: group, prop: "start", value: group.start}});
             group.start = pos;
             break;
            case opcodes.ENDGROUP:
             group = groups[uarg];
             push({undo: {obj: group, prop: "end", value: group.end}});
             group.end = pos;
             break;
            case opcodes.REFGROUP:
             group = groups[uarg];
             if(group.start < 0 || group.end < 0){backtrack(); break;}
             for(var i = group.start; i < group.end; i++){
              if(pos === s.length){prefix_match(); break;}
              if(s[i] !== s[pos]){backtrack(); break;}
              pos++;
             }
             break;
            case opcodes.SIMPLEOPT:
             if(in_bitset(cpool[uarg], c)) pos++; break;
            case opcodes.SIMPLESTAR:
             while(in_bitset(cpool[uarg], c)) c = s[++pos]; break;
            case opcodes.SIMPLEPLUS:
             if(pos === s.length){prefix_match(); break;}
             if(in_bitset(cpool[uarg], c))
              do c = s[++pos];while(in_bitset(cpool[uarg], c));
             else
              backtrack();
             break;
            case opcodes.ACCEPT: return accept();
            case opcodes.GOTO:
             pc = pc + sarg; break;
            case opcodes.PUSHBACK:
             push({pos: {pc: pc + sarg, txt: pos}}); break;
            case opcodes.SETMARK:
             push
              ({undo: {obj: re_register, prop: uarg, value: re_register[uarg]}});
             re_register[uarg] = pos;
             break;
            case opcodes.CHECKPROGRESS:
             if(re_register[uarg] === pos) backtrack(); break;
            default: throw new Error("Invalid bytecode");
          }
         }
         return 0;
        }
        return re_match_impl;
       }
       ();
   function re_partial_match(re, s, pos){
    if(pos < 0 || pos > caml_ml_string_length(s))
     caml_invalid_argument("Str.partial_match");
    var res = re_match(re, s, pos, 1);
    return res ? res : [0];
   }
   function re_replacement_text(repl, groups, orig){
    var
     repl = caml_jsbytes_of_string(repl),
     len = repl.length,
     orig = caml_jsbytes_of_string(orig),
     res = "",
     n = 0,
     cur,
     start,
     end,
     c;
    while(n < len){
     cur = repl.charAt(n++);
     if(cur !== "\\")
      res += cur;
     else{
      if(n === len) caml_failwith("Str.replace: illegal backslash sequence");
      cur = repl.charAt(n++);
      switch(cur){
        case "\\":
         res += cur; break;
        case "0":
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
         c = + cur;
         if(c * 2 >= groups.length - 1)
          caml_failwith("Str.replace: reference to unmatched group");
         start = caml_array_get(groups, c * 2);
         end = caml_array_get(groups, c * 2 + 1);
         if(start === - 1)
          caml_failwith("Str.replace: reference to unmatched group");
         res += orig.slice(start, end);
         break;
        default: res += "\\" + cur;
      }
     }
    }
    return caml_string_of_jsbytes(res);
   }
   function re_search_backward(re, s, pos){
    if(pos < 0 || pos > caml_ml_string_length(s))
     caml_invalid_argument("Str.search_backward");
    var startchars = re[6] | 0;
    if(startchars >= 0){
     startchars = re[2][startchars + 1];
     var len = caml_ml_string_length(s);
     do{
      while
      (pos > 0 && pos < len
       && caml_string_get(startchars, caml_string_get(s, pos)) === 0)
       pos--;
      var res = re_match(re, s, pos, 0);
      if(res) return res;
      pos--;
     }
     while
      (pos >= 0);
    }
    else
     do{var res = re_match(re, s, pos, 0); if(res) return res; pos--;}
     while
      (pos >= 0);
    return [0];
   }
   function re_search_forward(re, s, pos){
    if(pos < 0 || pos > caml_ml_string_length(s))
     caml_invalid_argument("Str.search_forward");
    var startchars = re[6] | 0, len = caml_ml_string_length(s);
    if(startchars >= 0){
     startchars = re[2][startchars + 1];
     do{
      while
      (pos < len && caml_string_get(startchars, caml_string_get(s, pos)) === 0)
       pos++;
      var res = re_match(re, s, pos, 0);
      if(res) return res;
      pos++;
     }
     while
      (pos <= len);
    }
    else
     do{var res = re_match(re, s, pos, 0); if(res) return res; pos++;}
     while
      (pos <= len);
    return [0];
   }
   function re_string_match(re, s, pos){
    if(pos < 0 || pos > caml_ml_string_length(s))
     caml_invalid_argument("Str.string_match");
    var res = re_match(re, s, pos, 0);
    return res ? res : [0];
   }
   function set_digit_nat(nat, ofs, digit){nat.data[ofs] = digit; return 0;}
   function set_digit_nat_native(nat, ofs, digit){nat.data[ofs] = digit; return 0;
   }
   function square_nat(nat1, ofs1, len1, nat2, ofs2, len2){
    var carry = 0;
    carry += add_nat(nat1, ofs1, len1, nat1, ofs1, len1, 0);
    carry += mult_nat(nat1, ofs1, len1, nat2, ofs2, len2, nat2, ofs2, len2);
    return carry;
   }
   function unix_error_message(err){
    const errno = typeof err === "number" ? err : - err[1];
    return caml_string_of_jsstring(caml_strerror(errno));
   }
   function caml_setup_uncaught_exception_handler(){
    var process = globalThis.process;
    if(process?.on)
     process.on
      ("uncaughtException",
       function(err, origin){
        caml_fatal_uncaught_exception(err);
        process.exit(2);
       });
    else if(globalThis.addEventListener)
     globalThis.addEventListener
      ("error",
       function(event){
        if(event.error) caml_fatal_uncaught_exception(event.error);
       });
   }
   caml_setup_uncaught_exception_handler();
   globalThis.jsoo_runtime =
    {caml_blake2_string: caml_blake2_string,
     caml_blake2_update: caml_blake2_update,
     caml_blake2_final: caml_blake2_final,
     caml_blake2_create: caml_blake2_create,
     blake2b: blake2b,
     caml_runtime_events_read_poll: caml_runtime_events_read_poll,
     caml_runtime_events_free_cursor: caml_runtime_events_free_cursor,
     caml_runtime_events_create_cursor: caml_runtime_events_create_cursor,
     caml_ml_runtime_events_resume: caml_ml_runtime_events_resume,
     caml_ml_runtime_events_are_active: caml_ml_runtime_events_are_active,
     caml_ml_runtime_events_pause: caml_ml_runtime_events_pause,
     caml_ml_runtime_events_start: caml_ml_runtime_events_start,
     caml_runtime_events_user_resolve: caml_runtime_events_user_resolve,
     caml_runtime_events_user_write: caml_runtime_events_user_write,
     caml_runtime_events_user_register: caml_runtime_events_user_register,
     caml_custom_event_index: caml_custom_event_index,
     caml_zstd_initialize: caml_zstd_initialize,
     caml_decompress_input: caml_decompress_input,
     zstd_decompress: zstd_decompress,
     jsoo_effect_not_supported: jsoo_effect_not_supported,
     caml_ml_condition_signal: caml_ml_condition_signal,
     caml_ml_condition_broadcast: caml_ml_condition_broadcast,
     caml_ml_condition_wait: caml_ml_condition_wait,
     caml_ml_condition_new: caml_ml_condition_new,
     caml_get_continuation_callstack: caml_get_continuation_callstack,
     caml_continuation_use_and_update_handler_noexc:
     caml_continuation_use_and_update_handler_noexc,
     caml_continuation_use_noexc: caml_continuation_use_noexc,
     caml_alloc_stack: caml_alloc_stack,
     caml_ml_mutex_unlock: caml_ml_mutex_unlock,
     caml_ml_mutex_try_lock: caml_ml_mutex_try_lock,
     caml_ml_mutex_lock: caml_ml_mutex_lock,
     caml_ml_mutex_new: caml_ml_mutex_new,
     MlMutex: MlMutex,
     caml_lxm_next: caml_lxm_next,
     caml_lxm_daba: caml_lxm_daba,
     caml_lxm_M: caml_lxm_M,
     caml_ml_domain_cpu_relax: caml_ml_domain_cpu_relax,
     caml_ml_domain_id: caml_ml_domain_id,
     caml_domain_spawn: caml_domain_spawn,
     caml_domain_id: caml_domain_id,
     caml_recommended_domain_count: caml_recommended_domain_count,
     caml_atomic_make_contended: caml_atomic_make_contended,
     caml_atomic_exchange: caml_atomic_exchange,
     caml_atomic_fetch_add: caml_atomic_fetch_add,
     caml_atomic_cas: caml_atomic_cas,
     caml_atomic_load: caml_atomic_load,
     caml_domain_dls_get: caml_domain_dls_get,
     caml_domain_dls_compare_and_set: caml_domain_dls_compare_and_set,
     caml_domain_dls_set: caml_domain_dls_set,
     caml_domain_dls: caml_domain_dls,
     caml_ephe_check_data: caml_ephe_check_data,
     caml_ephe_unset_data: caml_ephe_unset_data,
     caml_ephe_set_data_opt: caml_ephe_set_data_opt,
     caml_ephe_set_data: caml_ephe_set_data,
     caml_ephe_get_data_copy: caml_ephe_get_data_copy,
     caml_ephe_get_data: caml_ephe_get_data,
     caml_ephe_blit_data: caml_ephe_blit_data,
     caml_ephe_blit_key: caml_ephe_blit_key,
     caml_ephe_check_key: caml_ephe_check_key,
     caml_ephe_get_key_copy: caml_ephe_get_key_copy,
     caml_ephe_get_key: caml_ephe_get_key,
     caml_weak_set: caml_weak_set,
     caml_weak_create: caml_weak_create,
     caml_ephe_create: caml_ephe_create,
     caml_ephe_unset_key: caml_ephe_unset_key,
     caml_ephe_set_key: caml_ephe_set_key,
     caml_ephe_none: caml_ephe_none,
     caml_ephe_data_offset: caml_ephe_data_offset,
     caml_ephe_key_offset: caml_ephe_key_offset,
     caml_raise_system_error: caml_raise_system_error,
     caml_unix_inet_addr_of_string: caml_unix_inet_addr_of_string,
     caml_unix_findclose: caml_unix_findclose,
     caml_unix_findnext: caml_unix_findnext,
     caml_unix_findfirst: caml_unix_findfirst,
     caml_unix_rewinddir: caml_unix_rewinddir,
     caml_unix_closedir: caml_unix_closedir,
     caml_unix_readdir: caml_unix_readdir,
     caml_unix_opendir: caml_unix_opendir,
     caml_unix_has_symlink: caml_unix_has_symlink,
     caml_unix_getpwnam: caml_unix_getpwnam,
     caml_unix_getegid: caml_unix_getegid,
     caml_unix_getgid: caml_unix_getgid,
     caml_unix_geteuid: caml_unix_geteuid,
     caml_unix_getuid: caml_unix_getuid,
     caml_unix_outchannel_of_filedescr: caml_unix_outchannel_of_filedescr,
     caml_unix_inchannel_of_filedescr: caml_unix_inchannel_of_filedescr,
     caml_unix_close: caml_unix_close,
     caml_unix_ftruncate_64: caml_unix_ftruncate_64,
     caml_unix_ftruncate: caml_unix_ftruncate,
     caml_unix_lseek_64: caml_unix_lseek_64,
     caml_unix_lseek: caml_unix_lseek,
     caml_unix_read_bigarray: caml_unix_read_bigarray,
     caml_unix_read: caml_unix_read,
     caml_unix_write_bigarray: caml_unix_write_bigarray,
     caml_unix_single_write: caml_unix_single_write,
     caml_unix_write: caml_unix_write,
     caml_unix_fsync: caml_unix_fsync,
     caml_unix_fchmod: caml_unix_fchmod,
     caml_unix_fstat_64: caml_unix_fstat_64,
     caml_unix_fstat: caml_unix_fstat,
     caml_unix_lookup_file: caml_unix_lookup_file,
     caml_unix_open: caml_unix_open,
     caml_unix_access: caml_unix_access,
     caml_unix_truncate_64: caml_unix_truncate_64,
     caml_unix_truncate: caml_unix_truncate,
     caml_unix_utimes: caml_unix_utimes,
     caml_unix_unlink: caml_unix_unlink,
     caml_unix_readlink: caml_unix_readlink,
     caml_unix_symlink: caml_unix_symlink,
     caml_unix_link: caml_unix_link,
     caml_unix_rmdir: caml_unix_rmdir,
     caml_unix_mkdir: caml_unix_mkdir,
     caml_unix_rename: caml_unix_rename,
     caml_unix_chmod: caml_unix_chmod,
     caml_unix_lstat_64: caml_unix_lstat_64,
     caml_unix_lstat: caml_unix_lstat,
     caml_unix_stat_64: caml_unix_stat_64,
     caml_unix_stat: caml_unix_stat,
     caml_unix_chdir: caml_unix_chdir,
     unix_error_message: unix_error_message,
     caml_strerror: caml_strerror,
     make_unix_err_args: make_unix_err_args,
     unix_error: unix_error,
     caml_unix_isatty: caml_unix_isatty,
     caml_unix_filedescr_of_fd: caml_unix_filedescr_of_fd,
     caml_unix_cleanup: caml_unix_cleanup,
     caml_unix_startup: caml_unix_startup,
     caml_unix_mktime: caml_unix_mktime,
     caml_unix_localtime: caml_unix_localtime,
     caml_unix_gmtime: caml_unix_gmtime,
     caml_unix_times: caml_unix_times,
     caml_unix_time: caml_unix_time,
     caml_unix_gettimeofday: caml_unix_gettimeofday,
     re_replacement_text: re_replacement_text,
     re_partial_match: re_partial_match,
     re_string_match: re_string_match,
     re_search_backward: re_search_backward,
     re_search_forward: re_search_forward,
     re_match: re_match,
     caml_io_buffer_size: caml_io_buffer_size,
     caml_sys_is_regular_file: caml_sys_is_regular_file,
     caml_xdg_defaults: caml_xdg_defaults,
     caml_sys_const_naked_pointers_checked:
     caml_sys_const_naked_pointers_checked,
     caml_ml_runtime_warnings_enabled: caml_ml_runtime_warnings_enabled,
     caml_ml_enable_runtime_warnings: caml_ml_enable_runtime_warnings,
     caml_runtime_warnings: caml_runtime_warnings,
     caml_install_signal_handler: caml_install_signal_handler,
     caml_runtime_parameters: caml_runtime_parameters,
     caml_runtime_variant: caml_runtime_variant,
     caml_sys_isatty: caml_sys_isatty,
     caml_sys_get_config: caml_sys_get_config,
     os_type: os_type,
     caml_sys_const_backend_type: caml_sys_const_backend_type,
     caml_sys_const_ostype_cygwin: caml_sys_const_ostype_cygwin,
     caml_sys_const_ostype_win32: caml_sys_const_ostype_win32,
     caml_sys_const_ostype_unix: caml_sys_const_ostype_unix,
     caml_sys_const_max_wosize: caml_sys_const_max_wosize,
     caml_sys_const_int_size: caml_sys_const_int_size,
     caml_sys_const_word_size: caml_sys_const_word_size,
     caml_sys_const_big_endian: caml_sys_const_big_endian,
     caml_sys_random_seed: caml_sys_random_seed,
     caml_sys_time_include_children: caml_sys_time_include_children,
     caml_sys_time: caml_sys_time,
     caml_sys_system_command: caml_sys_system_command,
     caml_sys_executable_name: caml_sys_executable_name,
     caml_sys_modify_argv: caml_sys_modify_argv,
     caml_sys_argv: caml_sys_argv,
     caml_sys_get_argv: caml_sys_get_argv,
     caml_executable_name: caml_executable_name,
     caml_argv: caml_argv,
     caml_sys_unsafe_getenv: caml_sys_unsafe_getenv,
     caml_sys_getenv: caml_sys_getenv,
     jsoo_sys_getenv: jsoo_sys_getenv,
     caml_set_static_env: caml_set_static_env,
     jsoo_static_env: jsoo_static_env,
     caml_fatal_uncaught_exception: caml_fatal_uncaught_exception,
     caml_format_exception: caml_format_exception,
     caml_is_special_exception: caml_is_special_exception,
     caml_sys_exit: caml_sys_exit,
     caml_raise_sys_error: caml_raise_sys_error,
     caml_maybe_print_stats: caml_maybe_print_stats,
     caml_is_printable: caml_is_printable,
     caml_get_global_data: caml_get_global_data,
     caml_register_global: caml_register_global,
     jsoo_toplevel_reloc: jsoo_toplevel_reloc,
     caml_build_symbols: caml_build_symbols,
     caml_global_data: caml_global_data,
     caml_named_value: caml_named_value,
     caml_register_named_value: caml_register_named_value,
     caml_named_values: caml_named_values,
     caml_call_gen: caml_call_gen,
     caml_set_parser_trace: caml_set_parser_trace,
     caml_parse_engine: caml_parse_engine,
     caml_parser_trace: caml_parser_trace,
     caml_custom_identifier: caml_custom_identifier,
     caml_is_continuation_tag: caml_is_continuation_tag,
     caml_lazy_read_result: caml_lazy_read_result,
     caml_lazy_reset_to_lazy: caml_lazy_reset_to_lazy,
     caml_lazy_update_to_forward: caml_lazy_update_to_forward,
     caml_lazy_update_to_forcing: caml_lazy_update_to_forcing,
     caml_obj_update_tag: caml_obj_update_tag,
     caml_obj_add_offset: caml_obj_add_offset,
     caml_obj_reachable_words: caml_obj_reachable_words,
     caml_obj_set_raw_field: caml_obj_set_raw_field,
     caml_obj_raw_field: caml_obj_raw_field,
     caml_fresh_oo_id: caml_fresh_oo_id,
     caml_set_oo_id: caml_set_oo_id,
     caml_oo_last_id: caml_oo_last_id,
     caml_get_public_method: caml_get_public_method,
     caml_get_cached_method: caml_get_cached_method,
     caml_oo_cache_id: caml_oo_cache_id,
     caml_method_cache: caml_method_cache,
     caml_lazy_make_forward: caml_lazy_make_forward,
     caml_obj_is_shared: caml_obj_is_shared,
     caml_obj_compare_and_swap: caml_obj_compare_and_swap,
     caml_obj_dup: caml_obj_dup,
     caml_obj_with_tag: caml_obj_with_tag,
     caml_obj_block: caml_obj_block,
     caml_obj_tag: caml_obj_tag,
     caml_alloc_dummy_infix: caml_alloc_dummy_infix,
     caml_update_dummy: caml_update_dummy,
     deserialize_nat: deserialize_nat,
     serialize_nat: serialize_nat,
     lxor_digit_nat: lxor_digit_nat,
     lor_digit_nat: lor_digit_nat,
     land_digit_nat: land_digit_nat,
     compare_nat: compare_nat,
     compare_digits_nat: compare_digits_nat,
     shift_right_nat: shift_right_nat,
     div_nat: div_nat,
     div_digit_nat: div_digit_nat,
     div_helper: div_helper,
     shift_left_nat: shift_left_nat,
     square_nat: square_nat,
     mult_nat: mult_nat,
     mult_digit_nat: mult_digit_nat,
     sub_nat: sub_nat,
     decr_nat: decr_nat,
     complement_nat: complement_nat,
     add_nat: add_nat,
     incr_nat: incr_nat,
     is_digit_odd: is_digit_odd,
     is_digit_normalized: is_digit_normalized,
     is_digit_zero: is_digit_zero,
     is_digit_int: is_digit_int,
     num_leading_zero_bits_in_digit: num_leading_zero_bits_in_digit,
     num_digits_nat: num_digits_nat,
     nth_digit_nat_native: nth_digit_nat_native,
     set_digit_nat_native: set_digit_nat_native,
     nth_digit_nat: nth_digit_nat,
     set_digit_nat: set_digit_nat,
     blit_nat: blit_nat,
     set_to_zero_nat: set_to_zero_nat,
     create_nat: create_nat,
     nat_of_array: nat_of_array,
     length_nat: length_nat,
     caml_hash_nat: caml_hash_nat,
     MlNat: MlNat,
     initialize_nat: initialize_nat,
     caml_new_string: caml_new_string,
     caml_array_of_bytes: caml_array_of_bytes,
     caml_array_of_string: caml_array_of_string,
     caml_js_to_string: caml_js_to_string,
     caml_to_js_string: caml_to_js_string,
     caml_js_from_string: caml_js_from_string,
     caml_js_to_byte_string: caml_js_to_byte_string,
     caml_is_ml_string: caml_is_ml_string,
     caml_ml_bytes_content: caml_ml_bytes_content,
     caml_is_ml_bytes: caml_is_ml_bytes,
     caml_bytes_of_jsbytes: caml_bytes_of_jsbytes,
     caml_string_of_jsstring: caml_string_of_jsstring,
     caml_jsstring_of_string: caml_jsstring_of_string,
     jsoo_text_decoder_buff: jsoo_text_decoder_buff,
     caml_jsbytes_of_string: caml_jsbytes_of_string,
     caml_string_of_jsbytes: caml_string_of_jsbytes,
     caml_bytes_of_string: caml_bytes_of_string,
     caml_string_of_bytes: caml_string_of_bytes,
     caml_string_lessthan: caml_string_lessthan,
     caml_string_lessequal: caml_string_lessequal,
     caml_string_equal: caml_string_equal,
     caml_string_compare: caml_string_compare,
     caml_ml_string_length: caml_ml_string_length,
     caml_string_unsafe_get: caml_string_unsafe_get,
     caml_string_concat: caml_string_concat,
     caml_ml_bytes_length: caml_ml_bytes_length,
     caml_blit_string: caml_blit_string,
     caml_blit_bytes: caml_blit_bytes,
     caml_fill_bytes: caml_fill_bytes,
     caml_bytes_greaterthan: caml_bytes_greaterthan,
     caml_string_greaterthan: caml_string_greaterthan,
     caml_bytes_greaterequal: caml_bytes_greaterequal,
     caml_string_greaterequal: caml_string_greaterequal,
     caml_bytes_lessthan: caml_bytes_lessthan,
     caml_bytes_lessequal: caml_bytes_lessequal,
     caml_bytes_notequal: caml_bytes_notequal,
     caml_string_notequal: caml_string_notequal,
     caml_bytes_equal: caml_bytes_equal,
     caml_bytes_compare: caml_bytes_compare,
     caml_bytes_of_uint8_array: caml_bytes_of_uint8_array,
     caml_bytes_of_array: caml_bytes_of_array,
     caml_string_of_uint8_array: caml_string_of_uint8_array,
     caml_string_of_array: caml_string_of_array,
     caml_create_bytes: caml_create_bytes,
     caml_create_string: caml_create_string,
     caml_uint8_array_of_string: caml_uint8_array_of_string,
     caml_uint8_array_of_bytes: caml_uint8_array_of_bytes,
     caml_convert_bytes_to_array: caml_convert_bytes_to_array,
     caml_convert_string_to_bytes: caml_convert_string_to_bytes,
     MlBytes: MlBytes,
     caml_bytes_of_utf16_jsstring: caml_bytes_of_utf16_jsstring,
     jsoo_text_decoder: jsoo_text_decoder,
     jsoo_text_encoder: jsoo_text_encoder,
     caml_bytes_set: caml_bytes_set,
     caml_bytes_set64: caml_bytes_set64,
     caml_bytes_set32: caml_bytes_set32,
     caml_bytes_set16: caml_bytes_set16,
     caml_string_set: caml_string_set,
     caml_bytes_get: caml_bytes_get,
     caml_bytes_get64: caml_bytes_get64,
     caml_string_get64: caml_string_get64,
     caml_bytes_get32: caml_bytes_get32,
     caml_string_get32: caml_string_get32,
     caml_bytes_get16: caml_bytes_get16,
     caml_string_get16: caml_string_get16,
     caml_string_get: caml_string_get,
     caml_bytes_bound_error: caml_bytes_bound_error,
     caml_string_bound_error: caml_string_bound_error,
     caml_bytes_unsafe_set: caml_bytes_unsafe_set,
     caml_bytes_unsafe_get: caml_bytes_unsafe_get,
     jsoo_is_ascii: jsoo_is_ascii,
     caml_sub_uint8_array_to_jsbytes: caml_sub_uint8_array_to_jsbytes,
     caml_subarray_to_jsbytes: caml_subarray_to_jsbytes,
     caml_str_repeat: caml_str_repeat,
     caml_md5_bytes: caml_md5_bytes,
     caml_MD5Final: caml_MD5Final,
     caml_MD5Update: caml_MD5Update,
     caml_MD5Init: caml_MD5Init,
     caml_MD5Transform: caml_MD5Transform,
     caml_md5_string: caml_md5_string,
     caml_md5_chan: caml_md5_chan,
     caml_output_value_to_buffer: caml_output_value_to_buffer,
     caml_output_value_to_bytes: caml_output_value_to_bytes,
     caml_output_value_to_string: caml_output_value_to_string,
     caml_output_val: caml_output_val,
     MlObjectTable: MlObjectTable,
     caml_marshal_data_size: caml_marshal_data_size,
     caml_marshal_header_size: caml_marshal_header_size,
     caml_input_value_from_reader: caml_input_value_from_reader,
     caml_custom_ops: caml_custom_ops,
     caml_nativeint_unmarshal: caml_nativeint_unmarshal,
     caml_int32_unmarshal: caml_int32_unmarshal,
     caml_int64_marshal: caml_int64_marshal,
     caml_int64_unmarshal: caml_int64_unmarshal,
     caml_input_value_from_bytes: caml_input_value_from_bytes,
     caml_float_of_bytes: caml_float_of_bytes,
     JsStringReader: JsStringReader,
     UInt8ArrayReader: UInt8ArrayReader,
     caml_marshal_constants: caml_marshal_constants,
     caml_new_lex_engine: caml_new_lex_engine,
     caml_lex_engine: caml_lex_engine,
     caml_lex_array: caml_lex_array,
     caml_js_error_of_exception: caml_js_error_of_exception,
     caml_xmlhttprequest_create: caml_xmlhttprequest_create,
     caml_js_get_console: caml_js_get_console,
     caml_js_html_entities: caml_js_html_entities,
     caml_js_html_escape: caml_js_html_escape,
     caml_js_object: caml_js_object,
     caml_pure_js_expr: caml_pure_js_expr,
     caml_js_expr: caml_js_expr,
     caml_js_eval_string: caml_js_eval_string,
     caml_js_strict_equals: caml_js_strict_equals,
     caml_js_equals: caml_js_equals,
     caml_js_function_arity: caml_js_function_arity,
     caml_js_wrap_meth_callback_unsafe: caml_js_wrap_meth_callback_unsafe,
     caml_js_wrap_meth_callback_strict: caml_js_wrap_meth_callback_strict,
     caml_js_wrap_meth_callback_arguments:
     caml_js_wrap_meth_callback_arguments,
     caml_js_wrap_meth_callback: caml_js_wrap_meth_callback,
     caml_js_wrap_callback_unsafe: caml_js_wrap_callback_unsafe,
     caml_js_wrap_callback_strict: caml_js_wrap_callback_strict,
     caml_js_wrap_callback_arguments: caml_js_wrap_callback_arguments,
     caml_js_wrap_callback: caml_js_wrap_callback,
     caml_ojs_new_arr: caml_ojs_new_arr,
     caml_js_new: caml_js_new,
     caml_js_meth_call: caml_js_meth_call,
     caml_js_fun_call: caml_js_fun_call,
     caml_js_call: caml_js_call,
     caml_js_var: caml_js_var,
     caml_list_to_js_array: caml_list_to_js_array,
     caml_list_of_js_array: caml_list_of_js_array,
     caml_js_to_array: caml_js_to_array,
     caml_js_from_array: caml_js_from_array,
     caml_js_to_int32: caml_js_to_int32,
     caml_js_to_float: caml_js_to_float,
     caml_js_from_float: caml_js_from_float,
     caml_js_to_bool: caml_js_to_bool,
     caml_js_from_bool: caml_js_from_bool,
     caml_throw_js_exception: caml_throw_js_exception,
     caml_js_error_option_of_exception: caml_js_error_option_of_exception,
     caml_exn_with_js_backtrace: caml_exn_with_js_backtrace,
     caml_maybe_attach_backtrace: caml_maybe_attach_backtrace,
     caml_wrap_exception: caml_wrap_exception,
     caml_jsoo_flags_effects: caml_jsoo_flags_effects,
     caml_jsoo_flags_use_js_string: caml_jsoo_flags_use_js_string,
     caml_is_js: caml_is_js,
     caml_callback: caml_callback,
     caml_trampoline_return: caml_trampoline_return,
     caml_trampoline: caml_trampoline,
     caml_js_typeof: caml_js_typeof,
     caml_js_instanceof: caml_js_instanceof,
     caml_js_delete: caml_js_delete,
     caml_js_get: caml_js_get,
     caml_js_set: caml_js_set,
     caml_js_pure_expr: caml_js_pure_expr,
     caml_ml_set_buffered: caml_ml_set_buffered,
     caml_ml_is_buffered: caml_ml_is_buffered,
     caml_ml_output_int: caml_ml_output_int,
     caml_ml_pos_out_64: caml_ml_pos_out_64,
     caml_ml_pos_out: caml_ml_pos_out,
     caml_pos_out: caml_pos_out,
     caml_ml_seek_out_64: caml_ml_seek_out_64,
     caml_ml_seek_out: caml_ml_seek_out,
     caml_seek_out: caml_seek_out,
     caml_output_value: caml_output_value,
     caml_ml_output_char: caml_ml_output_char,
     caml_ml_output: caml_ml_output,
     caml_ml_output_bigarray: caml_ml_output_bigarray,
     caml_ml_output_bytes: caml_ml_output_bytes,
     caml_ml_output_ta: caml_ml_output_ta,
     caml_ml_flush: caml_ml_flush,
     caml_ml_input_scan_line: caml_ml_input_scan_line,
     caml_ml_pos_in_64: caml_ml_pos_in_64,
     caml_ml_pos_in: caml_ml_pos_in,
     caml_pos_in: caml_pos_in,
     caml_ml_seek_in_64: caml_ml_seek_in_64,
     caml_ml_seek_in: caml_ml_seek_in,
     caml_seek_in: caml_seek_in,
     caml_ml_input_int: caml_ml_input_int,
     caml_ml_input_char: caml_ml_input_char,
     caml_input_value_to_outside_heap: caml_input_value_to_outside_heap,
     caml_input_value: caml_input_value,
     caml_ml_input_block: caml_ml_input_block,
     caml_ml_input_bigarray: caml_ml_input_bigarray,
     caml_ml_input: caml_ml_input,
     caml_refill: caml_refill,
     caml_ml_set_channel_refill: caml_ml_set_channel_refill,
     caml_ml_set_channel_output: caml_ml_set_channel_output,
     caml_ml_channel_size_64: caml_ml_channel_size_64,
     caml_ml_channel_size: caml_ml_channel_size,
     caml_ml_close_channel: caml_ml_close_channel,
     caml_ml_is_binary_mode: caml_ml_is_binary_mode,
     caml_ml_set_binary_mode: caml_ml_set_binary_mode,
     caml_channel_descriptor: caml_channel_descriptor,
     caml_ml_open_descriptor_out_with_flags:
     caml_ml_open_descriptor_out_with_flags,
     caml_ml_open_descriptor_in_with_flags:
     caml_ml_open_descriptor_in_with_flags,
     caml_ml_open_descriptor_in: caml_ml_open_descriptor_in,
     caml_ml_open_descriptor_out: caml_ml_open_descriptor_out,
     caml_ml_out_channels_list: caml_ml_out_channels_list,
     caml_ml_channel_restore: caml_ml_channel_restore,
     caml_ml_channel_redirect: caml_ml_channel_redirect,
     caml_ml_channel_get: caml_ml_channel_get,
     caml_ml_channels: caml_ml_channels,
     caml_ml_set_channel_name: caml_ml_set_channel_name,
     caml_sys_open: caml_sys_open,
     MlChanid: MlChanid,
     caml_sys_close: caml_sys_close,
     caml_sys_fds: caml_sys_fds,
     caml_int64_bswap: caml_int64_bswap,
     caml_int32_bswap: caml_int32_bswap,
     caml_bswap16: caml_bswap16,
     caml_mod: caml_mod,
     caml_div: caml_div,
     caml_mul: caml_mul,
     caml_int_of_string: caml_int_of_string,
     caml_parse_digit: caml_parse_digit,
     caml_parse_sign_and_base: caml_parse_sign_and_base,
     caml_format_int: caml_format_int,
     caml_int64_hash: caml_int64_hash,
     caml_int64_to_bytes: caml_int64_to_bytes,
     caml_int64_of_bytes: caml_int64_of_bytes,
     caml_int64_hi32: caml_int64_hi32,
     caml_int64_lo32: caml_int64_lo32,
     caml_int64_create_lo_hi: caml_int64_create_lo_hi,
     caml_int64_create_lo_mi_hi: caml_int64_create_lo_mi_hi,
     caml_int64_of_string: caml_int64_of_string,
     caml_int64_format: caml_int64_format,
     caml_int64_of_float: caml_int64_of_float,
     caml_int64_to_float: caml_int64_to_float,
     caml_int64_to_int32: caml_int64_to_int32,
     caml_int64_of_int32: caml_int64_of_int32,
     caml_int64_mod: caml_int64_mod,
     caml_int64_div: caml_int64_div,
     caml_int64_shift_right: caml_int64_shift_right,
     caml_int64_shift_right_unsigned: caml_int64_shift_right_unsigned,
     caml_int64_shift_left: caml_int64_shift_left,
     caml_int64_xor: caml_int64_xor,
     caml_int64_or: caml_int64_or,
     caml_int64_and: caml_int64_and,
     caml_int64_is_negative: caml_int64_is_negative,
     caml_int64_is_zero: caml_int64_is_zero,
     caml_int64_mul: caml_int64_mul,
     caml_int64_sub: caml_int64_sub,
     caml_int64_add: caml_int64_add,
     caml_int64_neg: caml_int64_neg,
     caml_int64_compare: caml_int64_compare,
     caml_int64_ult: caml_int64_ult,
     MlInt64: MlInt64,
     caml_int64_offset: caml_int64_offset,
     caml_float_of_string: caml_float_of_string,
     caml_format_float: caml_format_float,
     caml_fma_float: caml_fma_float,
     caml_erfc_float: caml_erfc_float,
     caml_erf_float: caml_erf_float,
     caml_cbrt_float: caml_cbrt_float,
     caml_round_float: caml_round_float,
     caml_atanh_float: caml_atanh_float,
     caml_tanh_float: caml_tanh_float,
     caml_asinh_float: caml_asinh_float,
     caml_sinh_float: caml_sinh_float,
     caml_acosh_float: caml_acosh_float,
     caml_cosh_float: caml_cosh_float,
     caml_log10_float: caml_log10_float,
     caml_hypot_float: caml_hypot_float,
     caml_log2_float: caml_log2_float,
     caml_log1p_float: caml_log1p_float,
     caml_exp2_float: caml_exp2_float,
     caml_expm1_float: caml_expm1_float,
     caml_signbit_float: caml_signbit_float,
     caml_copysign_float: caml_copysign_float,
     caml_float_compare: caml_float_compare,
     caml_frexp_float: caml_frexp_float,
     caml_ldexp_float: caml_ldexp_float,
     caml_modf_float: caml_modf_float,
     caml_classify_float: caml_classify_float,
     caml_int32_float_of_bits: caml_int32_float_of_bits,
     caml_trunc_float: caml_trunc_float,
     caml_nextafter_float: caml_nextafter_float,
     caml_int64_float_of_bits: caml_int64_float_of_bits,
     caml_hexstring_of_float: caml_hexstring_of_float,
     caml_int32_bits_of_float: caml_int32_bits_of_float,
     caml_int64_bits_of_float: caml_int64_bits_of_float,
     jsoo_dataview: jsoo_dataview,
     caml_string_hash: caml_string_hash,
     caml_hash: caml_hash,
     caml_hash_mix_string: caml_hash_mix_string,
     caml_hash_mix_bytes: caml_hash_mix_bytes,
     caml_hash_mix_bytes_arr: caml_hash_mix_bytes_arr,
     caml_hash_mix_jsbytes: caml_hash_mix_jsbytes,
     caml_hash_mix_int64: caml_hash_mix_int64,
     caml_hash_mix_float: caml_hash_mix_float,
     caml_hash_mix_final: caml_hash_mix_final,
     caml_hash_mix_int: caml_hash_mix_int,
     caml_gr_close_subwindow: caml_gr_close_subwindow,
     caml_gr_open_subwindow: caml_gr_open_subwindow,
     caml_gr_window_id: caml_gr_window_id,
     caml_gr_display_mode: caml_gr_display_mode,
     caml_gr_remember_mode: caml_gr_remember_mode,
     caml_gr_synchronize: caml_gr_synchronize,
     caml_gr_wait_event: caml_gr_wait_event,
     caml_gr_sigio_signal: caml_gr_sigio_signal,
     caml_gr_sigio_handler: caml_gr_sigio_handler,
     caml_gr_blit_image: caml_gr_blit_image,
     caml_gr_create_image: caml_gr_create_image,
     caml_gr_draw_image: caml_gr_draw_image,
     caml_gr_dump_image: caml_gr_dump_image,
     caml_gr_make_image: caml_gr_make_image,
     caml_gr_text_size: caml_gr_text_size,
     caml_gr_set_text_size: caml_gr_set_text_size,
     caml_gr_set_font: caml_gr_set_font,
     caml_gr_draw_string: caml_gr_draw_string,
     caml_gr_draw_char: caml_gr_draw_char,
     caml_gr_draw_str: caml_gr_draw_str,
     caml_gr_fill_arc: caml_gr_fill_arc,
     caml_gr_fill_poly: caml_gr_fill_poly,
     caml_gr_fill_rect: caml_gr_fill_rect,
     caml_gr_set_line_width: caml_gr_set_line_width,
     caml_gr_draw_arc: caml_gr_draw_arc,
     caml_gr_arc_aux: caml_gr_arc_aux,
     caml_gr_draw_rect: caml_gr_draw_rect,
     caml_gr_lineto: caml_gr_lineto,
     caml_gr_current_y: caml_gr_current_y,
     caml_gr_current_x: caml_gr_current_x,
     caml_gr_moveto: caml_gr_moveto,
     caml_gr_point_color: caml_gr_point_color,
     caml_gr_plot: caml_gr_plot,
     caml_gr_set_color: caml_gr_set_color,
     caml_gr_size_y: caml_gr_size_y,
     caml_gr_size_x: caml_gr_size_x,
     caml_gr_clear_graph: caml_gr_clear_graph,
     caml_gr_resize_window: caml_gr_resize_window,
     caml_gr_set_window_title: caml_gr_set_window_title,
     caml_gr_close_graph: caml_gr_close_graph,
     caml_gr_doc_of_state: caml_gr_doc_of_state,
     caml_gr_state_create: caml_gr_state_create,
     caml_gr_state_init: caml_gr_state_init,
     caml_gr_open_graph: caml_gr_open_graph,
     caml_gr_state_set: caml_gr_state_set,
     caml_gr_state_get: caml_gr_state_get,
     caml_gr_state: caml_gr_state,
     caml_get_minor_free: caml_get_minor_free,
     caml_gc_minor_words: caml_gc_minor_words,
     caml_gc_major_slice: caml_gc_major_slice,
     caml_memprof_discard: caml_memprof_discard,
     caml_memprof_stop: caml_memprof_stop,
     caml_memprof_start: caml_memprof_start,
     caml_final_release: caml_final_release,
     caml_final_register_called_without_value:
     caml_final_register_called_without_value,
     caml_final_register: caml_final_register,
     caml_gc_get: caml_gc_get,
     caml_gc_set: caml_gc_set,
     caml_gc_stat: caml_gc_stat,
     caml_gc_quick_stat: caml_gc_quick_stat,
     caml_gc_counters: caml_gc_counters,
     caml_gc_compaction: caml_gc_compaction,
     caml_gc_full_major: caml_gc_full_major,
     caml_gc_major: caml_gc_major,
     caml_gc_minor: caml_gc_minor,
     caml_raise_nodejs_error: caml_raise_nodejs_error,
     caml_sys_open_for_node: caml_sys_open_for_node,
     MlNodeFd: MlNodeFd,
     ocaml_stats_from_node_stats: ocaml_stats_from_node_stats,
     MlNodeDevice: MlNodeDevice,
     fs_node_supported: fs_node_supported,
     jsoo_is_win32: jsoo_is_win32,
     MlFakeFd: MlFakeFd,
     MlFakeFd_out: MlFakeFd_out,
     MlFakeFile: MlFakeFile,
     MlFakeDevice: MlFakeDevice,
     caml_read_file_content: caml_read_file_content,
     jsoo_create_file: jsoo_create_file,
     caml_create_file: caml_create_file,
     caml_fs_init: caml_fs_init,
     jsoo_create_file_extern: jsoo_create_file_extern,
     caml_ba_map_file_bytecode: caml_ba_map_file_bytecode,
     caml_ba_map_file: caml_ba_map_file,
     caml_sys_rmdir: caml_sys_rmdir,
     caml_sys_mkdir: caml_sys_mkdir,
     caml_sys_rename: caml_sys_rename,
     caml_sys_is_directory: caml_sys_is_directory,
     caml_sys_remove: caml_sys_remove,
     caml_sys_read_directory: caml_sys_read_directory,
     caml_sys_file_exists: caml_sys_file_exists,
     caml_raise_no_such_file: caml_raise_no_such_file,
     caml_sys_chdir: caml_sys_chdir,
     caml_sys_getcwd: caml_sys_getcwd,
     caml_unmount: caml_unmount,
     caml_mount_autoload: caml_mount_autoload,
     resolve_fs_device: resolve_fs_device,
     caml_list_mount_point: caml_list_mount_point,
     jsoo_mount_point: jsoo_mount_point,
     caml_make_path: caml_make_path,
     path_is_absolute: path_is_absolute,
     MlFile: MlFile,
     caml_root: caml_root,
     caml_get_root: caml_get_root,
     caml_current_dir: caml_current_dir,
     caml_trailing_slash: caml_trailing_slash,
     caml_finish_formatting: caml_finish_formatting,
     caml_parse_format: caml_parse_format,
     caml_array_bound_error: caml_array_bound_error,
     caml_raise_not_found: caml_raise_not_found,
     caml_raise_zero_divide: caml_raise_zero_divide,
     caml_raise_end_of_file: caml_raise_end_of_file,
     caml_invalid_argument: caml_invalid_argument,
     caml_failwith: caml_failwith,
     caml_raise_with_string: caml_raise_with_string,
     caml_raise_with_args: caml_raise_with_args,
     caml_raise_with_arg: caml_raise_with_arg,
     caml_raise_constant: caml_raise_constant,
     caml_lessthan: caml_lessthan,
     caml_lessequal: caml_lessequal,
     caml_greaterthan: caml_greaterthan,
     caml_greaterequal: caml_greaterequal,
     caml_notequal: caml_notequal,
     caml_equal: caml_equal,
     caml_int_compare: caml_int_compare,
     caml_compare: caml_compare,
     caml_compare_val: caml_compare_val,
     caml_compare_val_number_custom: caml_compare_val_number_custom,
     caml_compare_val_get_custom: caml_compare_val_get_custom,
     caml_compare_val_tag: caml_compare_val_tag,
     caml_bigstring_blit_ba_to_bytes: caml_bigstring_blit_ba_to_bytes,
     caml_bigstring_blit_bytes_to_ba: caml_bigstring_blit_bytes_to_ba,
     caml_bigstring_blit_string_to_ba: caml_bigstring_blit_string_to_ba,
     caml_bigstring_blit_ba_to_ba: caml_bigstring_blit_ba_to_ba,
     caml_bigstring_memcmp: caml_bigstring_memcmp,
     bigstring_of_typed_array: bigstring_of_typed_array,
     bigstring_of_array_buffer: bigstring_of_array_buffer,
     bigstring_to_typed_array: bigstring_to_typed_array,
     bigstring_to_array_buffer: bigstring_to_array_buffer,
     caml_hash_mix_bigstring: caml_hash_mix_bigstring,
     caml_ba_from_typed_array: caml_ba_from_typed_array,
     caml_ba_kind_of_typed_array: caml_ba_kind_of_typed_array,
     caml_ba_to_typed_array: caml_ba_to_typed_array,
     caml_hash_mix_float32: caml_hash_mix_float32,
     caml_hash_mix_float16: caml_hash_mix_float16,
     caml_ba_hash: caml_ba_hash,
     caml_ba_create_from: caml_ba_create_from,
     caml_ba_deserialize: caml_ba_deserialize,
     caml_ba_serialize: caml_ba_serialize,
     caml_ba_reshape: caml_ba_reshape,
     caml_ba_slice: caml_ba_slice,
     caml_ba_sub: caml_ba_sub,
     caml_ba_blit: caml_ba_blit,
     caml_ba_fill: caml_ba_fill,
     caml_ba_set_3: caml_ba_set_3,
     caml_ba_set_2: caml_ba_set_2,
     caml_ba_set_1: caml_ba_set_1,
     caml_ba_uint8_set64: caml_ba_uint8_set64,
     caml_ba_uint8_set32: caml_ba_uint8_set32,
     caml_ba_uint8_set16: caml_ba_uint8_set16,
     caml_ba_set_generic: caml_ba_set_generic,
     caml_ba_get_3: caml_ba_get_3,
     caml_ba_get_2: caml_ba_get_2,
     caml_ba_get_1: caml_ba_get_1,
     caml_ba_uint8_get64: caml_ba_uint8_get64,
     caml_ba_uint8_get32: caml_ba_uint8_get32,
     caml_ba_uint8_get16: caml_ba_uint8_get16,
     caml_ba_get_generic: caml_ba_get_generic,
     caml_ba_dim_3: caml_ba_dim_3,
     caml_ba_dim_2: caml_ba_dim_2,
     caml_ba_dim_1: caml_ba_dim_1,
     caml_ba_dim: caml_ba_dim,
     caml_ba_num_dims: caml_ba_num_dims,
     caml_ba_layout: caml_ba_layout,
     caml_ba_kind: caml_ba_kind,
     caml_ba_change_layout: caml_ba_change_layout,
     caml_ba_create: caml_ba_create,
     caml_ba_create_unsafe: caml_ba_create_unsafe,
     caml_ba_compare: caml_ba_compare,
     Ml_Bigarray_c_1_1: Ml_Bigarray_c_1_1,
     Ml_Bigarray: Ml_Bigarray,
     caml_ba_custom_name: caml_ba_custom_name,
     caml_ba_create_buffer: caml_ba_create_buffer,
     caml_ba_get_size_per_element: caml_ba_get_size_per_element,
     caml_packFloat16: caml_packFloat16,
     caml_unpackFloat16: caml_unpackFloat16,
     caml_ba_get_size: caml_ba_get_size,
     caml_ba_init: caml_ba_init,
     caml_convert_raw_backtrace_slot: caml_convert_raw_backtrace_slot,
     caml_get_current_callstack: caml_get_current_callstack,
     caml_restore_raw_backtrace: caml_restore_raw_backtrace,
     caml_raw_backtrace_slot: caml_raw_backtrace_slot,
     caml_raw_backtrace_next_slot: caml_raw_backtrace_next_slot,
     caml_raw_backtrace_length: caml_raw_backtrace_length,
     caml_convert_raw_backtrace: caml_convert_raw_backtrace,
     caml_record_backtrace: caml_record_backtrace,
     caml_get_exception_raw_backtrace: caml_get_exception_raw_backtrace,
     caml_get_exception_backtrace: caml_get_exception_backtrace,
     caml_backtrace_status: caml_backtrace_status,
     caml_ml_debug_info_status: caml_ml_debug_info_status,
     caml_record_backtrace_runtime_flag: caml_record_backtrace_runtime_flag,
     caml_record_backtrace_env_flag: caml_record_backtrace_env_flag,
     caml_floatarray_create: caml_floatarray_create,
     caml_make_float_vect: caml_make_float_vect,
     caml_make_vect: caml_make_vect,
     caml_array_make: caml_array_make,
     caml_check_bound: caml_check_bound,
     caml_array_fill: caml_array_fill,
     caml_array_get: caml_array_get,
     caml_array_set: caml_array_set,
     caml_floatarray_blit: caml_floatarray_blit,
     caml_array_blit: caml_array_blit,
     caml_array_concat: caml_array_concat,
     caml_array_append: caml_array_append,
     caml_array_sub: caml_array_sub};
   caml_fs_init();
   var cst_Out_of_memory = "Out_of_memory";
   caml_register_global(0, [248, cst_Out_of_memory, -1], cst_Out_of_memory);
   var cst_Sys_error = "Sys_error";
   caml_register_global(1, [248, cst_Sys_error, -2], cst_Sys_error);
   var cst_Failure = "Failure";
   caml_register_global(2, [248, cst_Failure, -3], cst_Failure);
   var cst_Invalid_argument = "Invalid_argument";
   caml_register_global
    (3, [248, cst_Invalid_argument, -4], cst_Invalid_argument);
   var cst_End_of_file = "End_of_file";
   caml_register_global(4, [248, cst_End_of_file, -5], cst_End_of_file);
   var cst_Division_by_zero = "Division_by_zero";
   caml_register_global
    (5, [248, cst_Division_by_zero, -6], cst_Division_by_zero);
   var cst_Not_found = "Not_found";
   caml_register_global(6, [248, cst_Not_found, -7], cst_Not_found);
   var cst_Match_failure = "Match_failure";
   caml_register_global(7, [248, cst_Match_failure, -8], cst_Match_failure);
   var cst_Stack_overflow = "Stack_overflow";
   caml_register_global(8, [248, cst_Stack_overflow, -9], cst_Stack_overflow);
   var cst_Sys_blocked_io = "Sys_blocked_io";
   caml_register_global(9, [248, cst_Sys_blocked_io, -10], cst_Sys_blocked_io);
   var cst_Assert_failure = "Assert_failure";
   caml_register_global
    (10, [248, cst_Assert_failure, -11], cst_Assert_failure);
   var cst_Undefined_recursive_module = "Undefined_recursive_module";
   caml_register_global
    (11,
     [248, cst_Undefined_recursive_module, -12],
     cst_Undefined_recursive_module);
   return;
  }
  (globalThis));

(function(a){"use strict";var
i=a.jsoo_runtime,c=i.caml_get_global_data(),eo="caml_unix_stat_64",en="unix_lseek",l="caml_unix_inchannel_of_filedescr",el="caml_unix_stat",ek="caml_unix_write_bigarray",f6="caml_nativeint_format",bo="caml_int64_of_nativeint",ej="caml_unix_closedir",bn="caml_unix_getgrnam",cK="caml_unix_truncate",cJ="caml_unix_getcwd",f2="caml_unix_readlink",f3="caml_floatarray_set",bl="caml_fill_bytes",bk="unix_error_message",cH="win_inchannel_of_filedescr",bj="caml_unix_time",cE="caml_unix_write",ee="unix_lstat",fY="unix_open",ec="unix_rename",fX="caml_unix_chmod",bf="unix_access",bd="caml_unix_lseek",be="unix_fsync",eb="caml_unix_findnext",bb="caml_weak_get_copy",h="caml_array_set",ea="caml_unix_opendir",fU="caml_unix_lookup_file",a$="caml_unix_getegid",fT="caml_unix_getgid",cA="caml_js_from_nativeint",a6="caml_unix_gmtime",a7="caml_signbit_float",fR="caml_unix_close",fQ="caml_js_from_int32",fP="caml_int64_to_int",cv="caml_check_bound_gen",p="caml_format_int",d4="unix_link",cr="unix_mkdir",a3="unix_rewinddir",a4="unix_read",dZ="caml_unix_unlink",a0="unix_getgid",dX="caml_unix_error_message",fL="caml_unix_findclose",aU="caml_unix_lseek_64",fJ="caml_array_get_float",cm="win_outchannel_of_filedescr",dU="caml_unix_fstat",ck="caml_unix_geteuid",dS="unix_lstat_64",aS="unix_inchannel_of_filedescr",cf="unix_getpwnam",cg="unix_geteuid",aR="caml_unix_getuid",dQ="caml_unix_utimes",fD="caml_unix_getpwuid",fE="unix_getpwuid",o="caml_check_bound",fC="unix_ftruncate_64",aO="unix_isatty",cd="caml_unix_times",dO="caml_unix_exit",fB="unix_exit",aL="caml_unix_single_write",cc="caml_ephe_blit_key",dM="caml_nativeint_of_string",aK="unix_write",dJ="caml_unix_ftruncate_64",dK="unix_close",fy="caml_js_to_int32",k="caml_sys_getcwd",dI="caml_unix_readdir",b_="win_findclose",aD="%int_mul",dG="caml_int32_format",fs="caml_weak_blit",dE="caml_unix_localtime",dF="unix_times",fr="caml_array_set_addr",dD="caml_unix_inet_addr_of_string",fq="unix_ftruncate",dC="caml_weak_check",fp="caml_unix_symlink",aA="unix_outchannel_of_filedescr",ax="caml_unix_has_symlink",dz="unix_mktime",s="caml_int64_to_int32",b6="unix_fstat",fl="caml_unix_link",aw="caml_unix_fchmod",b3="unix_symlink",av="unix_localtime",fj="unix_chdir",au="unix_getgrgid",as="caml_int32_compare",ar="caml_unix_mkdir",fg="win_startup",ff="caml_int32_bswap",aq="caml_weak_get",fd="unix_readlink",ao="caml_unix_rmdir",e="caml_array_get",am="caml_unix_lstat_64",al="unix_inet_addr_of_string",bW="caml_unix_gettimeofday",r="caml_unix_outchannel_of_filedescr",bT="unix_stat",ds="caml_unix_chdir",aj="unix_closedir",ak="win_cleanup",bS="caml_nativeint_bswap",ag="caml_unix_mktime",ah="caml_ephe_get_key",ai="%int_mod",bR="unix_stat_64",dn="unix_getegid",dp="caml_unix_access",dl="caml_unix_isatty",af="caml_int32_mul",dk="caml_nativeint_compare",q="caml_int64_of_int32",ad="caml_unix_fsync",e_="win_findnext",$="caml_nativeint_mul",e9="unix_single_write",_="caml_int32_mod",n="caml_js_from_float",dg="unix_truncate_64",df="caml_ephe_check_key",e7="unix_opendir",bP="caml_array_set_float",e5="caml_ephe_get_key_copy",W="unix_getuid",d="caml_mul",V="caml_fill_string",g="caml_div",da="caml_int64_of_int",e2="caml_unix_read_bigarray",U="unix_getgrnam",eZ="win_findfirst",eY="caml_unix_startup",bM="caml_unix_filedescr_of_fd",eX="caml_unix_ftruncate",f="caml_mod",c$="caml_check_bound_float",bK="unix_utimes",bL="caml_unix_getgrgid",eV="caml_int64_to_nativeint",bJ="unix_time",eU="unix_fstat_64",P="caml_unix_fstat_64",c8="unix_truncate",bH="unix_gmtime",bG="caml_unix_cleanup",eR="unix_getcwd",eQ="unix_readdir",j="caml_sys_exit",L="caml_channel_descriptor",bC="unix_lseek_64",t="caml_int_compare",J="caml_array_get_addr",eI="unix_chmod",eJ="caml_unix_lstat",eH="caml_js_to_nativeint",I="caml_int32_div",c1="caml_unix_findfirst",H="caml_unix_truncate_64",G="caml_unix_rewinddir",F="unix_has_symlink",m="caml_int_of_string",eE="caml_unix_rename",bA="win_filedescr_of_channel",E="unix_gettimeofday",eD="win_handle_fd",b="caml_unix_getpwnam",cV="caml_int32_of_string",eB="caml_nativeint_mod",x="unix_rmdir",cR="caml_unix_read",cS="unix_read_bigarray",eu="caml_floatarray_get",w="unix_unlink",bu="caml_unix_open",er="caml_signbit",v="unix_fchmod",bs="caml_nativeint_div",eq="%int_div";c.aliases=i.caml_list_of_js_array([[0,cv,o],[0,fP,s],[0,eq,g],[0,fQ,n],[0,eZ,c1],[0,bs,g],[0,v,aw],[0,U,b],[0,aA,r],[0,da,q],[0,cA,n],[0,er,a7],[0,dC,df],[0,V,bl],[0,w,dZ],[0,fq,eX],[0,eu,e],[0,fr,h],[0,W,aR],[0,cS,e2],[0,x,ao],[0,dF,cd],[0,fs,cc],[0,dG,p],[0,fU,ek],[0,bP,h],[0,aD,d],[0,e7,ea],[0,b_,fL],[0,cV,m],[0,eB,f],[0,dg,H],[0,_,f],[0,bb,e5],[0,$,d],[0,e9,aL],[0,dK,fR],[0,be,ad],[0,aK,cE],[0,dM,m],[0,bf,dp],[0,eD,bM],[0,e_,eb],[0,E,bW],[0,bA,L],[0,fB,j],[0,dk,t],[0,af,d],[0,dO,j],[0,F,ax],[0,ec,eE],[0,aO,dl],[0,fC,dJ],[0,dn,a$],[0,ee,eJ],[0,fY,bu],[0,I,g],[0,fE,b],[0,fD,b],[0,bR,eo],[0,eH,fy],[0,ai,f],[0,bS,ff],[0,cg,ck],[0,cf,b],[0,ak,bG],[0,aj,ej],[0,cH,l],[0,eI,fX],[0,bT,el],[0,J,e],[0,aS,l],[0,al,dD],[0,dS,am],[0,f3,h],[0,cJ,k],[0,cm,r],[0,fJ,e],[0,fd,f2],[0,aq,ah],[0,bn,b],[0,bC,aU],[0,fg,eY],[0,eQ,dI],[0,a0,fT],[0,dX,bk],[0,as,t],[0,eR,k],[0,bH,a6],[0,bo,q],[0,au,b],[0,c8,cK],[0,fj,ds],[0,av,dE],[0,f6,p],[0,eU,P],[0,b3,fp],[0,bJ,bj],[0,eV,s],[0,a4,cR],[0,a3,G],[0,cr,ar],[0,bL,b],[0,d4,fl],[0,bK,dQ],[0,c$,o],[0,b6,dU],[0,en,bd],[0,dz,ag]]);c.prim_count=952;var
em=133,bq=102,bp="Re__Hash_set",cM="Stdlib__Type",cN=114,f5="Stdlib__Buffer",eh="Js_of_ocaml__Dom_svg",ei="Stdlib__Out_channel",f4="Match_failure",cL=165,eg=157,bm="Stdlib__Gc",ef="Sx_rsa",f0="Re__Compile",f1="Stdlib__Unit",cI="Re__Posix_class",fZ=136,cG="Jsoo_runtime__Runtime_version",cF="Stdlib__Map",bi="Sx_vm",ed="Stdlib__Parsing",bh="Stdlib__Effect",cD=108,bg="Stdlib__String",fW="Re_pcre",bc="Stdlib__BytesLabels",fV=160,ba=162,d$="Stdlib__Condition",cC=148,d_="Stdlib__Filename",a_="Stdlib__In_channel",d8="Not_found",d9="Re__Fmt",cB=154,d7=164,a9=163,a8="CamlinternalLazy",fS="Sx_vm_ref",cz="Division_by_zero",cy="Js_of_ocaml__Effect_js",cx="Re__Glob",d5=159,d6="Re__Parse_buffer",a5=117,cw=104,fO="Js_of_ocaml__",cu="Stdlib__Either",ct=109,cs="Js_of_ocaml__MutationObserver",d3="Erlang_ext",cq="Js_of_ocaml__Json",d2="Stdlib__Callback",d1=155,a2="Stdlib__Lexing",cp="Undefined_recursive_module",d0="Stdlib__Printf",fN=111,a1="Stdlib__Bool",co="UnixLabels",dY="Stdlib__Int",fM=153,dW="Stdlib__MoreLabels",aX=103,aY="Sx_render",aZ=127,dV="Sys_error",aW=100,aV="Sx_ed25519",cn="Js_of_ocaml__Dom_events",fK="Stdlib__Digest",dT=101,cl=151,aT="Sx_compiler",cj="Js_of_ocaml__PerformanceObserver",fI="Re__View",ci="Stdlib__Queue",dR="Sx_vm_extensions",fH=110,ch="Stdlib__Set",fG="Stdlib__Stack",fF="Js_of_ocaml__File",dP="Stdlib__Complex",aQ="Re__Dyn",aP="Jsoo_runtime__",ce="Re__Import",dN="Jsoo_runtime",fA=130,aM="Js_of_ocaml__WebSockets",aN="Stdlib__Nativeint",fz=128,cb="Sx_cid",dL=167,aJ=113,ca=146,fx=156,b$="Re__Dense_map",dH="Sys_blocked_io",aH=168,aI="Stdlib__Random",fw="Js_of_ocaml__ResizeObserver",fv="Sx_runtime",aG=135,b9=144,fu="Js_of_ocaml",aE=106,aF="Stdlib__Marshal",aC="Js_of_ocaml__Console",ft=140,b8="Sx_primitives",b7="Stdlib__Ephemeron",aB="CamlinternalMod",dB="Re__Color_map",az="Js_of_ocaml__Js",ay="Js_of_ocaml__Url",fo="Stdlib__Fun",fn="Stdlib__Char",dA=125,fm="Re__Category",b4=138,b5=116,fk=126,dy="Sx_vm_extension",at="Re__Ast",dx="Dune__exe__Sx_browser",dw=150,fi="CamlinternalFormatBasics",dv="Stdlib__Weak",b2=105,du="Stdlib__Format",fh="Stdlib__StdLabels",dt="Stdlib__Int64",fe="Re__Search",b1="Js_of_ocaml__Dom_html",ap="Stdlib__ArrayLabels",b0=129,fc="Re__Cset",an="Sx_sha2",bZ="Stdlib__Bigarray",bX=137,bY="Re__Core",bU=132,bV="Re__Emacs",dr="Re__Automata",dq="Re__Pmark",dm="Js_of_ocaml__IntersectionObserver",ae=115,dj=131,e$="Stdlib",fa="Stdlib__StringLabels",fb=122,ac="Stdlib__Atomic",ab="Sx_cst",di="Re__",aa="Stdlib__ListLabels",dh="Stdlib__Seq",bQ=158,e8="Js_of_ocaml__CSS",Z=134,de="Js_of_ocaml__XmlHttpRequest",e6="Re__Bit_vector",Y="Stdlib__Uchar",X=152,dd="Stdlib__Arg",dc="Js_of_ocaml__Form",db="Stdlib__Scanf",e4=112,e3="Re__Slice",e1="Js_of_ocaml__Intl",e0="Sx_sha3",bO=107,bN="Stdlib__Printexc",T="Js_of_ocaml__Sys_js",eW="Js_of_ocaml__Import",S="Re",R="Sx_cbor",c9="Js_of_ocaml__Geolocation",c_=147,eT="Re__Perl",Q="Js_of_ocaml__Worker",bI="Stdlib__Dynarray",eS="Assert_failure",O="Re__Pcre",N=141,bE=118,bF=121,bD=120,c7="Stdlib__Array",M="Js_of_ocaml__EventSource",c6="Stdlib__Obj",eP="Stdlib__Hashtbl",eN="Stdlib__Domain",eO="Stdlib__Option",eM=124,eL="Std_exit",eK=149,c5="Re__Group",K=166,c4="Sx_ref",bB=145,c2="Invalid_argument",c3="Stack_overflow",c0="End_of_file",cZ="Js_of_ocaml__WebGL",eG="Sx_types",eF="Failure",D="Js_of_ocaml__Jstable",cY="Test_ext",eC="Stdlib__Lazy",bz="Stdlib__Semaphore",cX="Out_of_memory",C="Js_of_ocaml__Lib_version",B="Js_of_ocaml__Regexp",cW="Js_of_ocaml__Dom",A="Stdlib__Bytes",by="Stdlib__Sys",eA=143,ez="CamlinternalOO",bx="Re__Posix",cT="Stdlib__Int32",cU="Sx_persist_store",ey="Stdlib__Oo",bw=123,y="Re__Replace",z="Unix",ev="Re__Mark_infos",ew="Stdlib__Mutex",ex=119,bv="Stdlib__List",cQ=139,et=161,bt="Sx_parser",es="Stdlib__Float",br=142,cP="CamlinternalFormat",u="Re__Str",ep="Js_of_ocaml__Typed_array",cO="Stdlib__Result";c.symbols=[0,[0,co,fN],[0,z,fH],[0,cp,11],[0,cY,aZ],[0,dV,10],[0,dH,9],[0,fS,fz],[0,dR,fk],[0,dy,dA],[0,bi,eM],[0,eG,e4],[0,e0,bD],[0,an,cN],[0,fv,fb],[0,ef,ex],[0,aY,b0],[0,c4,bw],[0,b8,bF],[0,cU,fA],[0,bt,bE],[0,aV,a5],[0,ab,b5],[0,aT,dj],[0,cb,ae],[0,R,aJ],[0,dv,62],[0,f1,31],[0,Y,26],[0,cM,17],[0,by,15],[0,fa,75],[0,bg,30],[0,fh,77],[0,fG,42],[0,ch,40],[0,dh,21],[0,bz,47],[0,db,64],[0,cO,23],[0,aI,60],[0,ci,43],[0,d0,50],[0,bN,53],[0,ed,39],[0,ei,57],[0,eO,22],[0,ey,67],[0,c6,16],[0,aN,37],[0,ew,45],[0,dW,76],[0,aF,32],[0,cF,41],[0,aa,73],[0,bv,27],[0,a2,38],[0,eC,20],[0,dt,36],[0,cT,35],[0,dY,28],[0,a_,56],[0,eP,61],[0,bm,55],[0,fo,54],[0,du,63],[0,es,34],[0,d_,70],[0,b7,69],[0,cu,14],[0,bh,78],[0,bI,51],[0,eN,48],[0,fK,58],[0,d$,46],[0,dP,71],[0,fn,25],[0,d2,65],[0,bc,74],[0,A,29],[0,f5,44],[0,a1,24],[0,bZ,59],[0,ac,18],[0,ap,72],[0,c7,33],[0,dd,52],[0,e$,13],[0,eL,aH],[0,c3,8],[0,fW,ct],[0,fI,93],[0,u,dT],[0,e3,95],[0,fe,97],[0,y,bq],[0,cI,cw],[0,bx,bO],[0,dq,89],[0,eT,b2],[0,O,aE],[0,d6,99],[0,ev,88],[0,ce,85],[0,bp,87],[0,c5,94],[0,cx,aX],[0,d9,80],[0,bV,aW],[0,aQ,82],[0,b$,84],[0,fc,86],[0,bY,98],[0,f0,96],[0,dB,91],[0,fm,83],[0,e6,81],[0,dr,90],[0,at,92],[0,di,79],[0,S,cD],[0,cX,7],[0,d8,6],[0,f4,5],[0,cG,Z],[0,aP,em],[0,dN,aG],[0,de,b9],[0,Q,bB],[0,aM,ca],[0,cZ,c_],[0,ay,eK],[0,ep,ft],[0,T,cl],[0,fw,X],[0,B,cC],[0,cj,fM],[0,cs,cB],[0,C,dw],[0,D,d1],[0,cq,fx],[0,az,b4],[0,e1,cL],[0,dm,d7],[0,eW,bX],[0,c9,a9],[0,dc,eA],[0,fF,N],[0,M,ba],[0,cy,et],[0,eh,fV],[0,b1,br],[0,cn,d5],[0,cW,cQ],[0,aC,bQ],[0,e8,eg],[0,fO,fZ],[0,fu,K],[0,c2,4],[0,eF,3],[0,d3,bU],[0,c0,2],[0,dx,dL],[0,cz,1],[0,ez,66],[0,aB,68],[0,a8,19],[0,fi,12],[0,cP,49],[0,eS,0]];c.sections=[0,[0,169,[0,[0,[0,[0,[0,[0,[0,0,[0,eS],0,[0,0,[0,cP],49,0,1],2],[0,fi],12,0,3],[0,a8],19,[0,[0,[0,0,[0,aB],68,0,1],[0,ez],66,0,2],[0,cz],1,[0,[0,0,[0,dx],dL,0,1],[0,c0],2,[0,0,[0,d3],bU,0,1],2],3],4],[0,eF],3,[0,[0,[0,0,[0,c2],4,[0,0,[0,fu],K,0,1],2],[0,fO],fZ,[0,0,[0,e8],eg,[0,0,[0,aC],bQ,0,1],2],3],[0,cW],cQ,[0,[0,[0,0,[0,cn],d5,0,1],[0,b1],br,0,2],[0,eh],fV,[0,[0,0,[0,cy],et,[0,0,[0,M],ba,0,1],2],[0,fF],N,[0,0,[0,dc],eA,[0,0,[0,c9],a9,0,1],2],3],4],5],6],[0,eW],bX,[0,[0,[0,[0,[0,[0,0,[0,dm],d7,[0,0,[0,e1],cL,0,1],2],[0,az],b4,[0,[0,0,[0,cq],fx,0,1],[0,D],d1,0,2],3],[0,C],dw,[0,[0,0,[0,cs],cB,0,1],[0,cj],fM,0,2],4],[0,B],cC,[0,[0,0,[0,fw],X,0,1],[0,T],cl,0,2],5],[0,ep],ft,[0,[0,[0,[0,0,[0,ay],eK,0,1],[0,cZ],c_,0,2],[0,aM],ca,0,3],[0,Q],bB,[0,0,[0,de],b9,0,1],4],6],[0,dN],aG,[0,[0,[0,0,[0,aP],em,[0,0,[0,cG],Z,0,1],2],[0,f4],5,[0,0,[0,d8],6,0,1],3],[0,cX],7,[0,[0,0,[0,S],cD,0,1],[0,di],79,[0,[0,0,[0,at],92,0,1],[0,dr],90,0,2],3],4],7],8],[0,e6],81,[0,[0,[0,[0,[0,0,[0,fm],83,0,1],[0,dB],91,[0,0,[0,f0],96,[0,0,[0,bY],98,0,1],2],3],[0,fc],86,[0,0,[0,b$],84,0,1],4],[0,aQ],82,[0,[0,[0,0,[0,bV],aW,0,1],[0,d9],80,[0,[0,[0,0,[0,cx],aX,0,1],[0,c5],94,0,2],[0,bp],87,0,3],4],[0,ce],85,[0,[0,[0,0,[0,ev],88,0,1],[0,d6],99,[0,[0,0,[0,O],aE,0,1],[0,eT],b2,0,2],3],[0,dq],89,[0,[0,[0,[0,0,[0,bx],bO,0,1],[0,cI],cw,0,2],[0,y],bq,[0,0,[0,fe],97,0,1],3],[0,e3],95,[0,[0,0,[0,u],dT,0,1],[0,fI],93,[0,[0,0,[0,fW],ct,0,1],[0,c3],8,[0,0,[0,eL],aH,0,1],2],3],4],5],6],7],[0,e$],13,[0,[0,[0,[0,0,[0,dd],52,0,1],[0,c7],33,[0,0,[0,ap],72,0,1],2],[0,ac],18,[0,0,[0,bZ],59,0,1],3],[0,a1],24,[0,[0,[0,0,[0,f5],44,0,1],[0,A],29,[0,[0,0,[0,bc],74,0,1],[0,d2],65,0,2],3],[0,fn],25,[0,[0,0,[0,dP],71,0,1],[0,d$],46,[0,[0,0,[0,fK],58,0,1],[0,eN],48,[0,0,[0,bI],51,[0,0,[0,bh],78,0,1],2],3],4],5],6],8],9],[0,cu],14,[0,[0,[0,[0,[0,[0,0,[0,b7],69,[0,0,[0,d_],70,0,1],2],[0,es],34,[0,0,[0,du],63,0,1],3],[0,fo],54,[0,0,[0,bm],55,[0,[0,0,[0,eP],61,0,1],[0,a_],56,0,2],3],4],[0,dY],28,[0,0,[0,cT],35,[0,0,[0,dt],36,0,1],2],5],[0,eC],20,[0,[0,[0,0,[0,a2],38,0,1],[0,bv],27,[0,[0,0,[0,aa],73,0,1],[0,cF],41,0,2],3],[0,aF],32,[0,[0,[0,0,[0,dW],76,0,1],[0,ew],45,0,2],[0,aN],37,0,3],4],6],[0,c6],16,[0,[0,[0,[0,[0,[0,0,[0,ey],67,0,1],[0,eO],22,[0,0,[0,ei],57,0,1],2],[0,ed],39,[0,[0,0,[0,bN],53,0,1],[0,d0],50,0,2],3],[0,ci],43,[0,[0,0,[0,aI],60,0,1],[0,cO],23,[0,[0,0,[0,db],64,0,1],[0,bz],47,0,2],3],4],[0,dh],21,[0,[0,0,[0,ch],40,[0,0,[0,fG],42,[0,0,[0,fh],77,0,1],2],3],[0,bg],30,[0,0,[0,fa],75,0,1],4],5],[0,by],15,[0,[0,[0,[0,[0,0,[0,cM],17,0,1],[0,Y],26,[0,0,[0,f1],31,0,1],2],[0,dv],62,[0,[0,0,[0,R],aJ,0,1],[0,cb],ae,[0,0,[0,aT],dj,0,1],2],3],[0,ab],b5,[0,[0,[0,0,[0,aV],a5,0,1],[0,bt],bE,[0,0,[0,cU],fA,0,1],2],[0,b8],bF,[0,[0,0,[0,c4],bw,[0,0,[0,aY],b0,0,1],2],[0,ef],ex,[0,0,[0,fv],fb,0,1],3],4],5],[0,an],cN,[0,[0,[0,0,[0,e0],bD,0,1],[0,eG],e4,[0,[0,0,[0,bi],eM,0,1],[0,dy],dA,[0,0,[0,dR],fk,[0,0,[0,fS],fz,0,1],2],3],4],[0,dH],9,[0,[0,0,[0,dV],10,[0,0,[0,cY],aZ,0,1],2],[0,cp],11,[0,0,[0,z],fH,[0,0,[0,co],fN,0,1],2],3],5],6],7],8],10]],0,i.caml_list_of_js_array(["%caml_format_int_special","%direct_int_div","%direct_int_mod","%direct_int_mul","%direct_obj_tag","%int_add","%int_and","%int_asr",eq,"%int_lsl","%int_lsr",ai,aD,"%int_neg","%int_or","%int_sub","%int_xor","JsStringReader","MlBytes","MlChanid","MlFakeDevice","MlFakeFd","MlFakeFd_out","MlFakeFile","MlFile","MlInt64","MlMutex","MlNat","MlNodeDevice","MlNodeFd","MlObjectTable","Ml_Bigarray","Ml_Bigarray_c_1_1","UInt8ArrayReader","add_nat","bigstring_of_array_buffer","bigstring_of_typed_array","bigstring_to_array_buffer","bigstring_to_typed_array","blake2b","blit_nat","caml_MD5Final","caml_MD5Init","caml_MD5Transform","caml_MD5Update","caml_abs_float","caml_acos_float","caml_acosh_float","caml_add_float","caml_alloc_dummy","caml_alloc_dummy_float","caml_alloc_dummy_infix","caml_alloc_stack","caml_argv","caml_array_append","caml_array_blit","caml_array_bound_error","caml_array_concat","caml_array_fill",e,J,fJ,"caml_array_make","caml_array_of_bytes","caml_array_of_string",h,fr,bP,"caml_array_sub","caml_array_unsafe_get","caml_array_unsafe_get_float","caml_array_unsafe_set","caml_array_unsafe_set_addr","caml_array_unsafe_set_float","caml_asin_float","caml_asinh_float","caml_atan2_float","caml_atan_float","caml_atanh_float","caml_atomic_cas","caml_atomic_exchange","caml_atomic_fetch_add","caml_atomic_load","caml_atomic_make_contended","caml_ba_blit","caml_ba_change_layout","caml_ba_compare","caml_ba_create","caml_ba_create_buffer","caml_ba_create_from","caml_ba_create_unsafe","caml_ba_custom_name","caml_ba_deserialize","caml_ba_dim","caml_ba_dim_1","caml_ba_dim_2","caml_ba_dim_3","caml_ba_fill","caml_ba_from_typed_array","caml_ba_get_1","caml_ba_get_2","caml_ba_get_3","caml_ba_get_generic","caml_ba_get_size","caml_ba_get_size_per_element","caml_ba_hash","caml_ba_init","caml_ba_kind","caml_ba_kind_of_typed_array","caml_ba_layout","caml_ba_map_file","caml_ba_map_file_bytecode","caml_ba_num_dims","caml_ba_reshape","caml_ba_serialize","caml_ba_set_1","caml_ba_set_2","caml_ba_set_3","caml_ba_set_generic","caml_ba_slice","caml_ba_sub","caml_ba_to_typed_array","caml_ba_uint8_get16","caml_ba_uint8_get32","caml_ba_uint8_get64","caml_ba_uint8_set16","caml_ba_uint8_set32","caml_ba_uint8_set64","caml_backtrace_status","caml_bigstring_blit_ba_to_ba","caml_bigstring_blit_ba_to_bytes","caml_bigstring_blit_bytes_to_ba","caml_bigstring_blit_string_to_ba","caml_bigstring_memcmp","caml_blake2_create","caml_blake2_final","caml_blake2_string","caml_blake2_update","caml_blit_bytes","caml_blit_string","caml_bswap16","caml_build_symbols","caml_bytes_bound_error","caml_bytes_compare","caml_bytes_equal","caml_bytes_get","caml_bytes_get16","caml_bytes_get32","caml_bytes_get64","caml_bytes_greaterequal","caml_bytes_greaterthan","caml_bytes_lessequal","caml_bytes_lessthan","caml_bytes_notequal","caml_bytes_of_array","caml_bytes_of_jsbytes","caml_bytes_of_string","caml_bytes_of_uint8_array","caml_bytes_of_utf16_jsstring","caml_bytes_set","caml_bytes_set16","caml_bytes_set32","caml_bytes_set64","caml_bytes_unsafe_get","caml_bytes_unsafe_set","caml_call_gen","caml_callback","caml_cbrt_float","caml_ceil_float",L,o,c$,cv,"caml_classify_float","caml_compare","caml_compare_val","caml_compare_val_get_custom","caml_compare_val_number_custom","caml_compare_val_tag","caml_continuation_use_and_update_handler_noexc","caml_continuation_use_noexc","caml_convert_bytes_to_array","caml_convert_raw_backtrace","caml_convert_raw_backtrace_slot","caml_convert_string_to_bytes","caml_copysign_float","caml_cos_float","caml_cosh_float","caml_create_bytes","caml_create_file","caml_create_string","caml_current_dir","caml_custom_event_index","caml_custom_identifier","caml_custom_ops","caml_decompress_input",g,"caml_div_float","caml_domain_dls","caml_domain_dls_compare_and_set","caml_domain_dls_get","caml_domain_dls_set","caml_domain_id","caml_domain_spawn","caml_ephe_blit_data",cc,"caml_ephe_check_data",df,"caml_ephe_create","caml_ephe_data_offset","caml_ephe_get_data","caml_ephe_get_data_copy",ah,e5,"caml_ephe_key_offset","caml_ephe_none","caml_ephe_set_data","caml_ephe_set_data_opt","caml_ephe_set_key","caml_ephe_unset_data","caml_ephe_unset_key","caml_eq_float","caml_equal","caml_erf_float","caml_erfc_float","caml_executable_name","caml_exn_with_js_backtrace","caml_exp2_float","caml_exp_float","caml_expm1_float","caml_failwith","caml_fatal_uncaught_exception",bl,V,"caml_final_register","caml_final_register_called_without_value","caml_final_release","caml_finish_formatting","caml_float_compare","caml_float_of_bytes","caml_float_of_int","caml_float_of_string","caml_floatarray_blit","caml_floatarray_create",eu,f3,"caml_floatarray_unsafe_get","caml_floatarray_unsafe_set","caml_floor_float","caml_fma_float","caml_fmod_float","caml_format_exception","caml_format_float",p,"caml_fresh_oo_id","caml_frexp_float","caml_fs_init","caml_gc_compaction","caml_gc_counters","caml_gc_full_major","caml_gc_get","caml_gc_major","caml_gc_major_slice","caml_gc_minor","caml_gc_minor_words","caml_gc_quick_stat","caml_gc_set","caml_gc_stat","caml_ge_float","caml_get_cached_method","caml_get_continuation_callstack","caml_get_current_callstack","caml_get_exception_backtrace","caml_get_exception_raw_backtrace","caml_get_global_data","caml_get_minor_free","caml_get_public_method","caml_get_root","caml_global_data","caml_gr_arc_aux","caml_gr_blit_image","caml_gr_clear_graph","caml_gr_close_graph","caml_gr_close_subwindow","caml_gr_create_image","caml_gr_current_x","caml_gr_current_y","caml_gr_display_mode","caml_gr_doc_of_state","caml_gr_draw_arc","caml_gr_draw_char","caml_gr_draw_image","caml_gr_draw_rect","caml_gr_draw_str","caml_gr_draw_string","caml_gr_dump_image","caml_gr_fill_arc","caml_gr_fill_poly","caml_gr_fill_rect","caml_gr_lineto","caml_gr_make_image","caml_gr_moveto","caml_gr_open_graph","caml_gr_open_subwindow","caml_gr_plot","caml_gr_point_color","caml_gr_remember_mode","caml_gr_resize_window","caml_gr_set_color","caml_gr_set_font","caml_gr_set_line_width","caml_gr_set_text_size","caml_gr_set_window_title","caml_gr_sigio_handler","caml_gr_sigio_signal","caml_gr_size_x","caml_gr_size_y","caml_gr_state","caml_gr_state_create","caml_gr_state_get","caml_gr_state_init","caml_gr_state_set","caml_gr_synchronize","caml_gr_text_size","caml_gr_wait_event","caml_gr_window_id","caml_greaterequal","caml_greaterthan","caml_gt_float","caml_hash","caml_hash_mix_bigstring","caml_hash_mix_bytes","caml_hash_mix_bytes_arr","caml_hash_mix_final","caml_hash_mix_float","caml_hash_mix_float16","caml_hash_mix_float32","caml_hash_mix_int","caml_hash_mix_int64","caml_hash_mix_jsbytes","caml_hash_mix_string","caml_hash_nat","caml_hexstring_of_float","caml_hypot_float","caml_input_value","caml_input_value_from_bytes","caml_input_value_from_reader","caml_input_value_to_outside_heap","caml_install_signal_handler","caml_int32_add","caml_int32_and","caml_int32_bits_of_float",ff,as,I,"caml_int32_float_of_bits",dG,_,af,"caml_int32_neg","caml_int32_of_float","caml_int32_of_int",cV,"caml_int32_or","caml_int32_shift_left","caml_int32_shift_right","caml_int32_shift_right_unsigned","caml_int32_sub","caml_int32_to_float","caml_int32_to_int","caml_int32_unmarshal","caml_int32_xor","caml_int64_add","caml_int64_and","caml_int64_bits_of_float","caml_int64_bswap","caml_int64_compare","caml_int64_create_lo_hi","caml_int64_create_lo_mi_hi","caml_int64_div","caml_int64_float_of_bits","caml_int64_format","caml_int64_hash","caml_int64_hi32","caml_int64_is_negative","caml_int64_is_zero","caml_int64_lo32","caml_int64_marshal","caml_int64_mod","caml_int64_mul","caml_int64_neg","caml_int64_of_bytes","caml_int64_of_float",da,q,bo,"caml_int64_of_string","caml_int64_offset","caml_int64_or","caml_int64_shift_left","caml_int64_shift_right","caml_int64_shift_right_unsigned","caml_int64_sub","caml_int64_to_bytes","caml_int64_to_float",fP,s,eV,"caml_int64_ult","caml_int64_unmarshal","caml_int64_xor",t,"caml_int_of_float",m,"caml_invalid_argument","caml_io_buffer_size","caml_is_continuation_tag","caml_is_js","caml_is_ml_bytes","caml_is_ml_string","caml_is_printable","caml_is_special_exception","caml_js_call","caml_js_delete","caml_js_equals","caml_js_error_of_exception","caml_js_error_option_of_exception","caml_js_eval_string","caml_js_expr","caml_js_from_array","caml_js_from_bool",n,fQ,cA,"caml_js_from_string","caml_js_fun_call","caml_js_function_arity","caml_js_get","caml_js_get_console","caml_js_html_entities","caml_js_html_escape","caml_js_instanceof","caml_js_meth_call","caml_js_new","caml_js_object","caml_js_pure_expr","caml_js_set","caml_js_strict_equals","caml_js_to_array","caml_js_to_bool","caml_js_to_byte_string","caml_js_to_float",fy,eH,"caml_js_to_string","caml_js_typeof","caml_js_var","caml_js_wrap_callback","caml_js_wrap_callback_arguments","caml_js_wrap_callback_strict","caml_js_wrap_callback_unsafe","caml_js_wrap_meth_callback","caml_js_wrap_meth_callback_arguments","caml_js_wrap_meth_callback_strict","caml_js_wrap_meth_callback_unsafe","caml_jsbytes_of_string","caml_jsoo_flags_effects","caml_jsoo_flags_use_js_string","caml_jsstring_of_string","caml_lazy_make_forward","caml_lazy_read_result","caml_lazy_reset_to_lazy","caml_lazy_update_to_forcing","caml_lazy_update_to_forward","caml_ldexp_float","caml_le_float","caml_lessequal","caml_lessthan","caml_lex_array","caml_lex_engine","caml_list_mount_point","caml_list_of_js_array","caml_list_to_js_array","caml_log10_float","caml_log1p_float","caml_log2_float","caml_log_float","caml_lt_float","caml_lxm_M","caml_lxm_daba","caml_lxm_next","caml_make_float_vect","caml_make_path","caml_make_vect","caml_marshal_constants","caml_marshal_data_size","caml_marshal_header_size","caml_maybe_attach_backtrace","caml_maybe_print_stats","caml_md5_bytes","caml_md5_chan","caml_md5_string","caml_memprof_discard","caml_memprof_start","caml_memprof_stop","caml_method_cache","caml_ml_bytes_content","caml_ml_bytes_length","caml_ml_channel_get","caml_ml_channel_redirect","caml_ml_channel_restore","caml_ml_channel_size","caml_ml_channel_size_64","caml_ml_channels","caml_ml_close_channel","caml_ml_condition_broadcast","caml_ml_condition_new","caml_ml_condition_signal","caml_ml_condition_wait","caml_ml_debug_info_status","caml_ml_domain_cpu_relax","caml_ml_domain_id","caml_ml_enable_runtime_warnings","caml_ml_flush","caml_ml_input","caml_ml_input_bigarray","caml_ml_input_block","caml_ml_input_char","caml_ml_input_int","caml_ml_input_scan_line","caml_ml_is_binary_mode","caml_ml_is_buffered","caml_ml_mutex_lock","caml_ml_mutex_new","caml_ml_mutex_try_lock","caml_ml_mutex_unlock","caml_ml_open_descriptor_in","caml_ml_open_descriptor_in_with_flags","caml_ml_open_descriptor_out","caml_ml_open_descriptor_out_with_flags","caml_ml_out_channels_list","caml_ml_output","caml_ml_output_bigarray","caml_ml_output_bytes","caml_ml_output_char","caml_ml_output_int","caml_ml_output_ta","caml_ml_pos_in","caml_ml_pos_in_64","caml_ml_pos_out","caml_ml_pos_out_64","caml_ml_runtime_events_are_active","caml_ml_runtime_events_pause","caml_ml_runtime_events_resume","caml_ml_runtime_events_start","caml_ml_runtime_warnings_enabled","caml_ml_seek_in","caml_ml_seek_in_64","caml_ml_seek_out","caml_ml_seek_out_64","caml_ml_set_binary_mode","caml_ml_set_buffered","caml_ml_set_channel_name","caml_ml_set_channel_output","caml_ml_set_channel_refill","caml_ml_string_length",f,"caml_modf_float","caml_mount_autoload",d,"caml_mul_float","caml_named_value","caml_named_values","caml_nativeint_add","caml_nativeint_and",bS,dk,bs,f6,eB,$,"caml_nativeint_neg","caml_nativeint_of_float","caml_nativeint_of_int","caml_nativeint_of_int32",dM,"caml_nativeint_or","caml_nativeint_shift_left","caml_nativeint_shift_right","caml_nativeint_shift_right_unsigned","caml_nativeint_sub","caml_nativeint_to_float","caml_nativeint_to_int","caml_nativeint_to_int32","caml_nativeint_unmarshal","caml_nativeint_xor","caml_neg_float","caml_neq_float","caml_new_lex_engine","caml_new_string","caml_nextafter_float","caml_notequal","caml_obj_add_offset","caml_obj_block","caml_obj_compare_and_swap","caml_obj_dup","caml_obj_is_shared","caml_obj_raw_field","caml_obj_reachable_words","caml_obj_set_raw_field","caml_obj_tag","caml_obj_update_tag","caml_obj_with_tag","caml_ojs_new_arr","caml_oo_cache_id","caml_oo_last_id","caml_output_val","caml_output_value","caml_output_value_to_buffer","caml_output_value_to_bytes","caml_output_value_to_string","caml_packFloat16","caml_parse_digit","caml_parse_engine","caml_parse_format","caml_parse_sign_and_base","caml_parser_trace","caml_pos_in","caml_pos_out","caml_power_float","caml_pure_js_expr","caml_raise_constant","caml_raise_end_of_file","caml_raise_no_such_file","caml_raise_nodejs_error","caml_raise_not_found","caml_raise_sys_error","caml_raise_system_error","caml_raise_with_arg","caml_raise_with_args","caml_raise_with_string","caml_raise_zero_divide","caml_raw_backtrace_length","caml_raw_backtrace_next_slot","caml_raw_backtrace_slot","caml_read_file_content","caml_recommended_domain_count","caml_record_backtrace","caml_record_backtrace_env_flag","caml_record_backtrace_runtime_flag","caml_refill","caml_register_global","caml_register_named_value","caml_restore_raw_backtrace","caml_root","caml_round_float","caml_runtime_events_create_cursor","caml_runtime_events_free_cursor","caml_runtime_events_read_poll","caml_runtime_events_user_register","caml_runtime_events_user_resolve","caml_runtime_events_user_write","caml_runtime_parameters","caml_runtime_variant","caml_runtime_warnings","caml_seek_in","caml_seek_out","caml_set_oo_id","caml_set_parser_trace","caml_set_static_env",er,a7,"caml_sin_float","caml_sinh_float","caml_sqrt_float","caml_str_repeat","caml_strerror","caml_string_bound_error","caml_string_compare","caml_string_concat","caml_string_equal","caml_string_get","caml_string_get16","caml_string_get32","caml_string_get64","caml_string_greaterequal","caml_string_greaterthan","caml_string_hash","caml_string_lessequal","caml_string_lessthan","caml_string_notequal","caml_string_of_array","caml_string_of_bytes","caml_string_of_jsbytes","caml_string_of_jsstring","caml_string_of_uint8_array","caml_string_set","caml_string_unsafe_get","caml_sub_float","caml_sub_uint8_array_to_jsbytes","caml_subarray_to_jsbytes","caml_sys_argv","caml_sys_chdir","caml_sys_close","caml_sys_const_backend_type","caml_sys_const_big_endian","caml_sys_const_int_size","caml_sys_const_max_wosize","caml_sys_const_naked_pointers_checked","caml_sys_const_ostype_cygwin","caml_sys_const_ostype_unix","caml_sys_const_ostype_win32","caml_sys_const_word_size","caml_sys_executable_name",j,"caml_sys_fds","caml_sys_file_exists","caml_sys_get_argv","caml_sys_get_config",k,"caml_sys_getenv","caml_sys_is_directory","caml_sys_is_regular_file","caml_sys_isatty","caml_sys_mkdir","caml_sys_modify_argv","caml_sys_open","caml_sys_open_for_node","caml_sys_random_seed","caml_sys_read_directory","caml_sys_remove","caml_sys_rename","caml_sys_rmdir","caml_sys_system_command","caml_sys_time","caml_sys_time_include_children","caml_sys_unsafe_getenv","caml_tan_float","caml_tanh_float","caml_throw_js_exception","caml_to_js_string","caml_trailing_slash","caml_trampoline","caml_trampoline_return","caml_trunc_float","caml_uint8_array_of_bytes","caml_uint8_array_of_string",dp,ds,fX,bG,fR,ej,dX,dO,aw,bM,fL,c1,eb,dU,P,ad,eX,dJ,cJ,a$,ck,fT,bL,bn,b,fD,bW,aR,a6,ax,l,dD,dl,fl,dE,fU,bd,aU,eJ,am,ar,ag,bu,ea,r,cR,e2,dI,f2,eE,G,ao,aL,eY,el,eo,fp,bj,cd,cK,H,dZ,dQ,cE,ek,"caml_unmount","caml_unpackFloat16","caml_update_dummy",fs,dC,"caml_weak_create",aq,bb,"caml_weak_set","caml_wrap_exception","caml_xdg_defaults","caml_xmlhttprequest_create","caml_zstd_initialize","compare_digits_nat","compare_nat","complement_nat","create_nat","decr_nat","deserialize_nat","div_digit_nat","div_helper","div_nat","fs_node_supported","incr_nat","initialize_nat","is_digit_int","is_digit_normalized","is_digit_odd","is_digit_zero","jsoo_create_file","jsoo_create_file_extern","jsoo_dataview","jsoo_effect_not_supported","jsoo_is_ascii","jsoo_is_win32","jsoo_mount_point","jsoo_static_env","jsoo_sys_getenv","jsoo_text_decoder","jsoo_text_decoder_buff","jsoo_text_encoder","jsoo_toplevel_reloc","land_digit_nat","length_nat","lor_digit_nat","lxor_digit_nat","make_unix_err_args","mult_digit_nat","mult_nat","nat_of_array","nth_digit_nat","nth_digit_nat_native","num_digits_nat","num_leading_zero_bits_in_digit","ocaml_stats_from_node_stats","os_type","path_is_absolute","re_match","re_partial_match","re_replacement_text","re_search_backward","re_search_forward","re_string_match","resolve_fs_device","serialize_nat","set_digit_nat","set_digit_nat_native","set_to_zero_nat","shift_left_nat","shift_right_nat","square_nat","sub_nat",bf,fj,eI,dK,aj,"unix_error",bk,fB,v,b6,eU,be,fq,fC,eR,dn,cg,a0,au,U,cf,fE,E,W,bH,F,aS,al,aO,d4,av,en,bC,ee,dS,cr,dz,fY,e7,aA,a4,cS,eQ,fd,ec,a3,x,e9,bT,bR,b3,bJ,dF,c8,dg,w,bK,aK,ak,bA,b_,eZ,e_,eD,cH,cm,fg,"zstd_decompress"]),0];return}(globalThis));

//# 4 "../.js/default/stdlib/stdlib.cma.js"
//# shape: CamlinternalFormatBasics:[F(2),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   function erase_rel(param){
    if(typeof param === "number") return 0;
    switch(param[0]){
      case 0:
       var rest = param[1]; return [0, erase_rel(rest)];
      case 1:
       var rest$0 = param[1]; return [1, erase_rel(rest$0)];
      case 2:
       var rest$1 = param[1]; return [2, erase_rel(rest$1)];
      case 3:
       var rest$2 = param[1]; return [3, erase_rel(rest$2)];
      case 4:
       var rest$3 = param[1]; return [4, erase_rel(rest$3)];
      case 5:
       var rest$4 = param[1]; return [5, erase_rel(rest$4)];
      case 6:
       var rest$5 = param[1]; return [6, erase_rel(rest$5)];
      case 7:
       var rest$6 = param[1]; return [7, erase_rel(rest$6)];
      case 8:
       var rest$7 = param[2], ty = param[1];
       return [8, ty, erase_rel(rest$7)];
      case 9:
       var rest$8 = param[3], ty1 = param[1];
       return [9, ty1, ty1, erase_rel(rest$8)];
      case 10:
       var rest$9 = param[1]; return [10, erase_rel(rest$9)];
      case 11:
       var rest$10 = param[1]; return [11, erase_rel(rest$10)];
      case 12:
       var rest$11 = param[1]; return [12, erase_rel(rest$11)];
      case 13:
       var rest$12 = param[1]; return [13, erase_rel(rest$12)];
      default: var rest$13 = param[1]; return [14, erase_rel(rest$13)];
    }
   }
   function concat_fmtty(fmtty1, fmtty2){
    if(typeof fmtty1 === "number") return fmtty2;
    switch(fmtty1[0]){
      case 0:
       var rest = fmtty1[1]; return [0, concat_fmtty(rest, fmtty2)];
      case 1:
       var rest$0 = fmtty1[1]; return [1, concat_fmtty(rest$0, fmtty2)];
      case 2:
       var rest$1 = fmtty1[1]; return [2, concat_fmtty(rest$1, fmtty2)];
      case 3:
       var rest$2 = fmtty1[1]; return [3, concat_fmtty(rest$2, fmtty2)];
      case 4:
       var rest$3 = fmtty1[1]; return [4, concat_fmtty(rest$3, fmtty2)];
      case 5:
       var rest$4 = fmtty1[1]; return [5, concat_fmtty(rest$4, fmtty2)];
      case 6:
       var rest$5 = fmtty1[1]; return [6, concat_fmtty(rest$5, fmtty2)];
      case 7:
       var rest$6 = fmtty1[1]; return [7, concat_fmtty(rest$6, fmtty2)];
      case 8:
       var rest$7 = fmtty1[2], ty = fmtty1[1];
       return [8, ty, concat_fmtty(rest$7, fmtty2)];
      case 9:
       var rest$8 = fmtty1[3], ty2 = fmtty1[2], ty1 = fmtty1[1];
       return [9, ty1, ty2, concat_fmtty(rest$8, fmtty2)];
      case 10:
       var rest$9 = fmtty1[1]; return [10, concat_fmtty(rest$9, fmtty2)];
      case 11:
       var rest$10 = fmtty1[1]; return [11, concat_fmtty(rest$10, fmtty2)];
      case 12:
       var rest$11 = fmtty1[1]; return [12, concat_fmtty(rest$11, fmtty2)];
      case 13:
       var rest$12 = fmtty1[1]; return [13, concat_fmtty(rest$12, fmtty2)];
      default:
       var rest$13 = fmtty1[1]; return [14, concat_fmtty(rest$13, fmtty2)];
    }
   }
   function concat_fmt(fmt1, fmt2){
    if(typeof fmt1 === "number") return fmt2;
    switch(fmt1[0]){
      case 0:
       var rest = fmt1[1]; return [0, concat_fmt(rest, fmt2)];
      case 1:
       var rest$0 = fmt1[1]; return [1, concat_fmt(rest$0, fmt2)];
      case 2:
       var rest$1 = fmt1[2], pad = fmt1[1];
       return [2, pad, concat_fmt(rest$1, fmt2)];
      case 3:
       var rest$2 = fmt1[2], pad$0 = fmt1[1];
       return [3, pad$0, concat_fmt(rest$2, fmt2)];
      case 4:
       var rest$3 = fmt1[4], prec = fmt1[3], pad$1 = fmt1[2], iconv = fmt1[1];
       return [4, iconv, pad$1, prec, concat_fmt(rest$3, fmt2)];
      case 5:
       var
        rest$4 = fmt1[4],
        prec$0 = fmt1[3],
        pad$2 = fmt1[2],
        iconv$0 = fmt1[1];
       return [5, iconv$0, pad$2, prec$0, concat_fmt(rest$4, fmt2)];
      case 6:
       var
        rest$5 = fmt1[4],
        prec$1 = fmt1[3],
        pad$3 = fmt1[2],
        iconv$1 = fmt1[1];
       return [6, iconv$1, pad$3, prec$1, concat_fmt(rest$5, fmt2)];
      case 7:
       var
        rest$6 = fmt1[4],
        prec$2 = fmt1[3],
        pad$4 = fmt1[2],
        iconv$2 = fmt1[1];
       return [7, iconv$2, pad$4, prec$2, concat_fmt(rest$6, fmt2)];
      case 8:
       var
        rest$7 = fmt1[4],
        prec$3 = fmt1[3],
        pad$5 = fmt1[2],
        fconv = fmt1[1];
       return [8, fconv, pad$5, prec$3, concat_fmt(rest$7, fmt2)];
      case 9:
       var rest$8 = fmt1[2], pad$6 = fmt1[1];
       return [9, pad$6, concat_fmt(rest$8, fmt2)];
      case 10:
       var rest$9 = fmt1[1]; return [10, concat_fmt(rest$9, fmt2)];
      case 11:
       var rest$10 = fmt1[2], str = fmt1[1];
       return [11, str, concat_fmt(rest$10, fmt2)];
      case 12:
       var rest$11 = fmt1[2], chr = fmt1[1];
       return [12, chr, concat_fmt(rest$11, fmt2)];
      case 13:
       var rest$12 = fmt1[3], fmtty = fmt1[2], pad$7 = fmt1[1];
       return [13, pad$7, fmtty, concat_fmt(rest$12, fmt2)];
      case 14:
       var rest$13 = fmt1[3], fmtty$0 = fmt1[2], pad$8 = fmt1[1];
       return [14, pad$8, fmtty$0, concat_fmt(rest$13, fmt2)];
      case 15:
       var rest$14 = fmt1[1]; return [15, concat_fmt(rest$14, fmt2)];
      case 16:
       var rest$15 = fmt1[1]; return [16, concat_fmt(rest$15, fmt2)];
      case 17:
       var rest$16 = fmt1[2], fmting_lit = fmt1[1];
       return [17, fmting_lit, concat_fmt(rest$16, fmt2)];
      case 18:
       var rest$17 = fmt1[2], fmting_gen = fmt1[1];
       return [18, fmting_gen, concat_fmt(rest$17, fmt2)];
      case 19:
       var rest$18 = fmt1[1]; return [19, concat_fmt(rest$18, fmt2)];
      case 20:
       var rest$19 = fmt1[3], char_set = fmt1[2], width_opt = fmt1[1];
       return [20, width_opt, char_set, concat_fmt(rest$19, fmt2)];
      case 21:
       var rest$20 = fmt1[2], counter = fmt1[1];
       return [21, counter, concat_fmt(rest$20, fmt2)];
      case 22:
       var rest$21 = fmt1[1]; return [22, concat_fmt(rest$21, fmt2)];
      case 23:
       var rest$22 = fmt1[2], ign = fmt1[1];
       return [23, ign, concat_fmt(rest$22, fmt2)];
      default:
       var rest$23 = fmt1[3], f = fmt1[2], arity = fmt1[1];
       return [24, arity, f, concat_fmt(rest$23, fmt2)];
    }
   }
   runtime.caml_register_global
    (0, [0, concat_fmtty, erase_rel, concat_fmt], "CamlinternalFormatBasics");
   return;
  }
  (globalThis));

//# 179 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib:[F(1),F(1),N,N,N,N,N,N,N,N,N,N,N,N,N,F(2),F(2),F(1)*,N,N,F(1)*,N,N,N,N,N,N,F(2)*,F(1),F(1)*,F(1)*,F(1),F(1)*,F(1),F(1),F(1),F(2),N,N,N,F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(1),F(2),F(2),F(2),F(4),F(4),F(2),F(2),F(2),F(2),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(3),F(1),F(1),F(4),F(4),F(2),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(2),N,F(1)*,F(2),F(1),F(1),F(1),F(4),F(1),N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_atomic_cas = runtime.caml_atomic_cas,
    caml_atomic_load = runtime.caml_atomic_load,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_float_of_string = runtime.caml_float_of_string,
    caml_int_of_string = runtime.caml_int_of_string,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length,
    caml_ml_channel_size = runtime.caml_ml_channel_size,
    caml_ml_channel_size_64 = runtime.caml_ml_channel_size_64,
    caml_ml_close_channel = runtime.caml_ml_close_channel,
    caml_ml_flush = runtime.caml_ml_flush,
    caml_ml_input = runtime.caml_ml_input,
    caml_ml_input_char = runtime.caml_ml_input_char,
    caml_ml_open_descriptor_in = runtime.caml_ml_open_descriptor_in,
    caml_ml_open_descriptor_out = runtime.caml_ml_open_descriptor_out,
    caml_ml_output = runtime.caml_ml_output,
    caml_ml_output_bytes = runtime.caml_ml_output_bytes,
    caml_ml_output_char = runtime.caml_ml_output_char,
    caml_ml_set_binary_mode = runtime.caml_ml_set_binary_mode,
    caml_ml_set_channel_name = runtime.caml_ml_set_channel_name,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_concat = runtime.caml_string_concat,
    caml_string_of_bytes = runtime.caml_string_of_bytes,
    caml_sys_open = runtime.caml_sys_open,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    CamlinternalFormatBasics = global_data.CamlinternalFormatBasics,
    Invalid_argument = global_data.Invalid_argument,
    Failure = global_data.Failure,
    Match_failure = global_data.Match_failure,
    Assert_failure = global_data.Assert_failure,
    Not_found = global_data.Not_found,
    Out_of_memory = global_data.Out_of_memory,
    Stack_overflow = global_data.Stack_overflow,
    Sys_error = global_data.Sys_error,
    End_of_file = global_data.End_of_file,
    Division_by_zero = global_data.Division_by_zero,
    Sys_blocked_io = global_data.Sys_blocked_io,
    Undefined_recursive_module = global_data.Undefined_recursive_module;
   function failwith(s){
    throw caml_maybe_attach_backtrace([0, Failure, s], 1);
   }
   function invalid_arg(s){
    throw caml_maybe_attach_backtrace([0, Invalid_argument, s], 1);
   }
   var Exit = [248, "Stdlib.Exit", runtime.caml_fresh_oo_id(0)];
   function min(x, y){return runtime.caml_lessequal(x, y) ? x : y;}
   function max(x, y){return runtime.caml_greaterequal(x, y) ? x : y;}
   function abs(x){return 0 <= x ? x : - x | 0;}
   function lnot(x){return x ^ -1;}
   function char_of_int(n){
    if(0 <= n && 255 >= n) return n;
    return invalid_arg("char_of_int");
   }
   var cst_false = "false", cst_true = "true";
   function string_of_bool(b){return b ? cst_true : cst_false;}
   function bool_of_string(param){
    return param !== cst_false
            ? param !== cst_true ? invalid_arg("bool_of_string") : 1
            : 0;
   }
   var a = [0, 1], b = [0, 0];
   function bool_of_string_opt(param){
    return param !== cst_false ? param !== cst_true ? 0 : a : b;
   }
   function string_of_int(n){return "" + n;}
   function int_of_string_opt(s){
    try{var a = [0, caml_int_of_string(s)]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Failure) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function valid_float_lexem(s1){
    var l = caml_ml_string_length(s1), i = 0;
    for(;;){
     if(l <= i) return s1 + ".";
     var match = runtime.caml_string_get(s1, i);
     a:
     {
      if(48 <= match){if(58 <= match) break a;} else if(45 !== match) break a;
      var i$0 = i + 1 | 0;
      i = i$0;
      continue;
     }
     return s1;
    }
   }
   function string_of_float(f){
    return valid_float_lexem(runtime.caml_format_float("%.12g", f));
   }
   function float_of_string_opt(s){
    try{var a = [0, caml_float_of_string(s)]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Failure) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function symbol(l1, l2){
    if(! l1) return l2;
    var match = l1[2], h1 = l1[1];
    if(! match) return [0, h1, l2];
    var match$0 = match[2], h2 = match[1];
    if(! match$0) return [0, h1, [0, h2, l2]];
    var
     tl = match$0[2],
     h3 = match$0[1],
     block = [0, h3, 24029],
     dst = block,
     offset = 1,
     l1$0 = tl;
    for(;;){
     if(l1$0){
      var match$1 = l1$0[2], h1$0 = l1$0[1];
      if(match$1){
       var match$2 = match$1[2], h2$0 = match$1[1];
       if(match$2){
        var tl$0 = match$2[2], h3$0 = match$2[1], dst$0 = [0, h3$0, 24029];
        dst[offset + 1] = [0, h1$0, [0, h2$0, dst$0]];
        dst = dst$0;
        offset = 1;
        l1$0 = tl$0;
        continue;
       }
       dst[offset + 1] = [0, h1$0, [0, h2$0, l2]];
      }
      else
       dst[offset + 1] = [0, h1$0, l2];
     }
     else
      dst[offset + 1] = l2;
     return [0, h1, [0, h2, block]];
    }
   }
   var
    stdin = caml_ml_open_descriptor_in(0),
    stdout = caml_ml_open_descriptor_out(1),
    stderr = caml_ml_open_descriptor_out(2);
   function open_out_gen(mode, perm, name){
    var c = caml_ml_open_descriptor_out(caml_sys_open(name, mode, perm));
    caml_ml_set_channel_name(c, name);
    return c;
   }
   var c = [0, 1, [0, 3, [0, 4, [0, 7, 0]]]];
   function open_out(name){return open_out_gen(c, 438, name);}
   var d = [0, 1, [0, 3, [0, 4, [0, 6, 0]]]];
   function open_out_bin(name){return open_out_gen(d, 438, name);}
   function flush_all(param){
    var param$0 = runtime.caml_ml_out_channels_list(0);
    for(;;){
     if(! param$0) return 0;
     var l = param$0[2], a = param$0[1];
     try{caml_ml_flush(a); param$0 = l;}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn[1] !== Sys_error) throw caml_maybe_attach_backtrace(exn, 0);
      param$0 = l;
     }
    }
   }
   function output_bytes(oc, s){
    return caml_ml_output_bytes(oc, s, 0, caml_ml_bytes_length(s));
   }
   function output_string(oc, s){
    return caml_ml_output(oc, s, 0, caml_ml_string_length(s));
   }
   function output(oc, s, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs)
     return caml_ml_output_bytes(oc, s, ofs, len);
    return invalid_arg("output");
   }
   function output_substring(oc, s, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_string_length(s) - len | 0) >= ofs)
     return caml_ml_output(oc, s, ofs, len);
    return invalid_arg("output_substring");
   }
   function output_value(chan, v){
    return runtime.caml_output_value(chan, v, 0);
   }
   function close_out(oc){
    caml_ml_flush(oc);
    return caml_ml_close_channel(oc);
   }
   function close_out_noerr(oc){
    try{caml_ml_flush(oc);}catch(exn){}
    try{var a = caml_ml_close_channel(oc); return a;}catch(exn){return 0;}
   }
   function open_in_gen(mode, perm, name){
    var c = caml_ml_open_descriptor_in(caml_sys_open(name, mode, perm));
    caml_ml_set_channel_name(c, name);
    return c;
   }
   var e = [0, 0, [0, 7, 0]];
   function open_in(name){return open_in_gen(e, 0, name);}
   var f = [0, 0, [0, 6, 0]];
   function open_in_bin(name){return open_in_gen(f, 0, name);}
   function input(ic, s, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs)
     return caml_ml_input(ic, s, ofs, len);
    return invalid_arg("input");
   }
   function unsafe_really_input(ic, s, ofs$1, len$1){
    var ofs = ofs$1, len = len$1;
    for(;;){
     if(0 >= len) return 0;
     var r = caml_ml_input(ic, s, ofs, len);
     if(0 === r) throw caml_maybe_attach_backtrace(End_of_file, 1);
     var len$0 = len - r | 0, ofs$0 = ofs + r | 0;
     ofs = ofs$0;
     len = len$0;
    }
   }
   function really_input(ic, s, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs)
     return unsafe_really_input(ic, s, ofs, len);
    return invalid_arg("really_input");
   }
   function really_input_string(ic, len){
    var s = caml_create_bytes(len);
    really_input(ic, s, 0, len);
    return caml_string_of_bytes(s);
   }
   function input_line(chan){
    function build_result(buf, pos$1, param$0){
     var pos = pos$1, param = param$0;
     for(;;){
      if(! param) return buf;
      var tl = param[2], hd = param[1], len = caml_ml_bytes_length(hd);
      runtime.caml_blit_bytes(hd, 0, buf, pos - len | 0, len);
      var pos$0 = pos - len | 0;
      pos = pos$0;
      param = tl;
     }
    }
    var accu = 0, len = 0;
    for(;;){
     var n = runtime.caml_ml_input_scan_line(chan);
     if(0 === n){
      if(! accu) throw caml_maybe_attach_backtrace(End_of_file, 1);
      var a = build_result(caml_create_bytes(len), len, accu);
     }
     else{
      if(0 >= n){
       var beg = caml_create_bytes(- n | 0);
       caml_ml_input(chan, beg, 0, - n | 0);
       var len$1 = len - n | 0, accu$0 = [0, beg, accu];
       accu = accu$0;
       len = len$1;
       continue;
      }
      var res = caml_create_bytes(n - 1 | 0);
      caml_ml_input(chan, res, 0, n - 1 | 0);
      caml_ml_input_char(chan);
      if(accu)
       var
        len$0 = (len + n | 0) - 1 | 0,
        a = build_result(caml_create_bytes(len$0), len$0, [0, res, accu]);
      else
       var a = res;
     }
     return caml_string_of_bytes(a);
    }
   }
   function close_in_noerr(ic){
    try{var a = caml_ml_close_channel(ic); return a;}catch(exn){return 0;}
   }
   function print_char(c){return caml_ml_output_char(stdout, c);}
   function print_string(s){return output_string(stdout, s);}
   function print_bytes(s){return output_bytes(stdout, s);}
   function print_int(i){return output_string(stdout, "" + i);}
   function print_float(f){return output_string(stdout, string_of_float(f));}
   function print_endline(s){
    output_string(stdout, s);
    caml_ml_output_char(stdout, 10);
    return caml_ml_flush(stdout);
   }
   function print_newline(param){
    caml_ml_output_char(stdout, 10);
    return caml_ml_flush(stdout);
   }
   function prerr_char(c){return caml_ml_output_char(stderr, c);}
   function prerr_string(s){return output_string(stderr, s);}
   function prerr_bytes(s){return output_bytes(stderr, s);}
   function prerr_int(i){return output_string(stderr, "" + i);}
   function prerr_float(f){return output_string(stderr, string_of_float(f));}
   function prerr_endline(s){
    output_string(stderr, s);
    caml_ml_output_char(stderr, 10);
    return caml_ml_flush(stderr);
   }
   function prerr_newline(param){
    caml_ml_output_char(stderr, 10);
    return caml_ml_flush(stderr);
   }
   function read_line(param){caml_ml_flush(stdout); return input_line(stdin);}
   function read_int(param){return caml_int_of_string(read_line(0));}
   function read_int_opt(param){return int_of_string_opt(read_line(0));}
   function read_float(param){return caml_float_of_string(read_line(0));}
   function read_float_opt(param){return float_of_string_opt(read_line(0));}
   function string_of_format(param){var str = param[2]; return str;}
   function symbol$0(a, param){
    var
     str2 = param[2],
     fmt2 = param[1],
     str1 = a[2],
     fmt1 = a[1],
     s2 = "%," + str2;
    return [0, CamlinternalFormatBasics[3].call(null, fmt1, fmt2), str1 + s2];
   }
   var exit_function = [0, flush_all];
   function at_exit(f){
    for(;;){
     var old_exit = caml_atomic_load(exit_function);
     let f_yet_to_run = [0, 1], old_exit$0 = old_exit;
     var
      new_exit =
        function(param){
         if(caml_atomic_cas(f_yet_to_run, 1, 0)) caml_call1(f, 0);
         return caml_call1(old_exit$0, 0);
        },
      success = caml_atomic_cas(exit_function, old_exit, new_exit),
      a = 1 - success;
     if(! a) return a;
    }
   }
   var do_domain_local_at_exit = [0, function(param){return 0;}];
   function do_at_exit(param){
    caml_call1(do_domain_local_at_exit[1], 0);
    return caml_call1(caml_atomic_load(exit_function), 0);
   }
   function exit(retcode){
    do_at_exit(0);
    return runtime.caml_sys_exit(retcode);
   }
   runtime.caml_register_named_value("Pervasives.do_at_exit", do_at_exit);
   var
    Stdlib =
      [0,
       invalid_arg,
       failwith,
       Exit,
       Match_failure,
       Assert_failure,
       Invalid_argument,
       Failure,
       Not_found,
       Out_of_memory,
       Stack_overflow,
       Sys_error,
       End_of_file,
       Division_by_zero,
       Sys_blocked_io,
       Undefined_recursive_module,
       min,
       max,
       abs,
       2147483647,
       -2147483648,
       lnot,
       Infinity,
       -Infinity,
       NaN,
       1.7976931348623157e+308,
       2.2250738585072014e-308,
       2.220446049250313e-16,
       caml_string_concat,
       char_of_int,
       string_of_bool,
       bool_of_string_opt,
       bool_of_string,
       string_of_int,
       int_of_string_opt,
       string_of_float,
       float_of_string_opt,
       symbol,
       stdin,
       stdout,
       stderr,
       print_char,
       print_string,
       print_bytes,
       print_int,
       print_float,
       print_endline,
       print_newline,
       prerr_char,
       prerr_string,
       prerr_bytes,
       prerr_int,
       prerr_float,
       prerr_endline,
       prerr_newline,
       read_line,
       read_int_opt,
       read_int,
       read_float_opt,
       read_float,
       open_out,
       open_out_bin,
       open_out_gen,
       caml_ml_flush,
       flush_all,
       caml_ml_output_char,
       output_string,
       output_bytes,
       output,
       output_substring,
       caml_ml_output_char,
       runtime.caml_ml_output_int,
       output_value,
       runtime.caml_ml_seek_out,
       runtime.caml_ml_pos_out,
       caml_ml_channel_size,
       close_out,
       close_out_noerr,
       caml_ml_set_binary_mode,
       open_in,
       open_in_bin,
       open_in_gen,
       caml_ml_input_char,
       input_line,
       input,
       really_input,
       really_input_string,
       caml_ml_input_char,
       runtime.caml_ml_input_int,
       runtime.caml_input_value,
       runtime.caml_ml_seek_in,
       runtime.caml_ml_pos_in,
       caml_ml_channel_size,
       caml_ml_close_channel,
       close_in_noerr,
       caml_ml_set_binary_mode,
       [0,
        runtime.caml_ml_seek_out_64,
        runtime.caml_ml_pos_out_64,
        caml_ml_channel_size_64,
        runtime.caml_ml_seek_in_64,
        runtime.caml_ml_pos_in_64,
        caml_ml_channel_size_64],
       string_of_format,
       symbol$0,
       exit,
       at_exit,
       valid_float_lexem,
       unsafe_really_input,
       do_at_exit,
       do_domain_local_at_exit];
   runtime.caml_register_global(45, Stdlib, "Stdlib");
   return;
  }
  (globalThis));

//# 743 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Sys:[N,F(1),N,N,[N],N,N,N,N,N,N,N,N,N,F(2)*,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(1)*,N,N,N,F(1),F(1),[F(2)*]]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception,
    Stdlib = runtime.caml_get_global_data().Stdlib,
    executable_name = runtime.caml_sys_executable_name(0),
    os_type = runtime.caml_sys_get_config(0)[1],
    unix = runtime.caml_sys_const_ostype_unix(0),
    win32 = runtime.caml_sys_const_ostype_win32(0),
    cygwin = runtime.caml_sys_const_ostype_cygwin(0),
    max_array_length = runtime.caml_sys_const_max_wosize(0),
    max_floatarray_length = max_array_length / 2 | 0,
    max_string_length = (4 * max_array_length | 0) - 1 | 0;
   function getenv_opt(s){
    try{var a = [0, runtime.caml_sys_getenv(s)]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[8]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function set_signal(sig_num, sig_beh){return 0;}
   var Break = [248, "Stdlib.Sys.Break", runtime.caml_fresh_oo_id(0)];
   function catch_break(on){return on ? 0 : 0;}
   function Make(Immediate, Non_immediate){return [0, 1];}
   var
    Stdlib_Sys =
      [0,
       executable_name,
       getenv_opt,
       [0, 0],
       os_type,
       [0, "js_of_ocaml"],
       unix,
       win32,
       cygwin,
       32,
       32,
       0,
       max_string_length,
       max_array_length,
       max_floatarray_length,
       set_signal,
       -1,
       -2,
       -3,
       -4,
       -5,
       -6,
       -7,
       -8,
       -9,
       -10,
       -11,
       -12,
       -13,
       -14,
       -15,
       -16,
       -17,
       -18,
       -19,
       -20,
       -21,
       -22,
       -23,
       -24,
       -25,
       -26,
       -27,
       -28,
       Break,
       catch_break,
       "5.2.0",
       0,
       [0, 5, 2, 0, 0],
       runtime.caml_ml_enable_runtime_warnings,
       runtime.caml_ml_runtime_warnings_enabled,
       [0, Make]];
   runtime.caml_register_global(4, Stdlib_Sys, "Stdlib__Sys");
   return;
  }
  (globalThis));

//# 833 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Obj:[F(1)*,F(2),F(3),N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,[F(1),F(1)*,F(1)*],N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_obj_tag = runtime.caml_obj_tag,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Sys = global_data.Stdlib__Sys;
   function is_block(a){return 1 - (typeof a === "number");}
   function double_field(x, i){return caml_check_bound(x, i)[i + 1];}
   function set_double_field(x, i, v){
    caml_check_bound(x, i)[i + 1] = v;
    return 0;
   }
   function of_val(x){
    var
     slot =
       is_block(x)
        ? caml_obj_tag(x) !== 248 ? 1 <= x.length - 1 ? x[1] : x : x
        : x,
     cst_Obj_extension_constructor = "Obj.extension_constructor";
    a:
    {
     if(is_block(slot) && caml_obj_tag(slot) === 248){var name = slot[1]; break a;}
     var name = Stdlib[1].call(null, cst_Obj_extension_constructor);
    }
    return caml_obj_tag(name) === 252
            ? slot
            : Stdlib[1].call(null, cst_Obj_extension_constructor);
   }
   function name(slot){return slot[1];}
   function id(slot){return slot[2];}
   var max_ephe_length = Stdlib_Sys[13] - 2 | 0;
   function create(l){
    var a = 0 <= l, b = a ? l <= max_ephe_length : a;
    if(1 - b) Stdlib[1].call(null, "Obj.Ephemeron.create");
    return runtime.caml_ephe_create(l);
   }
   function length(x){return x.length - 3 | 0;}
   function raise_if_invalid_offset(e, o, msg){
    var a = 0 <= o, c = a ? o < length(e) : a, b = 1 - c;
    return b ? Stdlib[1].call(null, msg) : b;
   }
   function get_key(e, o){
    raise_if_invalid_offset(e, o, "Obj.Ephemeron.get_key");
    return runtime.caml_ephe_get_key(e, o);
   }
   function get_key_copy(e, o){
    raise_if_invalid_offset(e, o, "Obj.Ephemeron.get_key_copy");
    return runtime.caml_ephe_get_key_copy(e, o);
   }
   function set_key(e, o, x){
    raise_if_invalid_offset(e, o, "Obj.Ephemeron.set_key");
    return runtime.caml_ephe_set_key(e, o, x);
   }
   function unset_key(e, o){
    raise_if_invalid_offset(e, o, "Obj.Ephemeron.unset_key");
    return runtime.caml_ephe_unset_key(e, o);
   }
   function check_key(e, o){
    raise_if_invalid_offset(e, o, "Obj.Ephemeron.check_key");
    return runtime.caml_ephe_check_key(e, o);
   }
   function blit_key(e1, o1, e2, o2, l){
    if
     (0 <= l
      &&
       0 <= o1
       && (length(e1) - l | 0) >= o1 && 0 <= o2 && (length(e2) - l | 0) >= o2){
     var
      a = 0 !== l ? 1 : 0,
      b = a ? runtime.caml_ephe_blit_key(e1, o1, e2, o2, l) : a;
     return b;
    }
    return Stdlib[1].call(null, "Obj.Ephemeron.blit_key");
   }
   var
    Stdlib_Obj =
      [0,
       is_block,
       double_field,
       set_double_field,
       0,
       243,
       244,
       245,
       246,
       247,
       248,
       249,
       250,
       251,
       251,
       252,
       253,
       254,
       255,
       1000,
       1001,
       1002,
       [0, of_val, name, id],
       [0,
        create,
        length,
        get_key,
        get_key_copy,
        set_key,
        unset_key,
        check_key,
        blit_key,
        runtime.caml_ephe_get_data,
        runtime.caml_ephe_get_data_copy,
        runtime.caml_ephe_set_data,
        runtime.caml_ephe_unset_data,
        runtime.caml_ephe_check_data,
        runtime.caml_ephe_blit_data,
        max_ephe_length]];
   runtime.caml_register_global(11, Stdlib_Obj, "Stdlib__Obj");
   return;
  }
  (globalThis));

//# 984 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Atomic:[F(1)*,F(1),F(1),F(2),F(2),F(3),F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_atomic_exchange = runtime.caml_atomic_exchange,
    caml_atomic_fetch_add = runtime.caml_atomic_fetch_add;
   function set(r, x){caml_atomic_exchange(r, x); return 0;}
   function incr(r){caml_atomic_fetch_add(r, 1); return 0;}
   function decr(r){caml_atomic_fetch_add(r, -1); return 0;}
   var
    Stdlib_Atomic =
      [0,
       function(a){return [0, a];},
       runtime.caml_atomic_make_contended,
       runtime.caml_atomic_load,
       set,
       caml_atomic_exchange,
       runtime.caml_atomic_cas,
       caml_atomic_fetch_add,
       incr,
       decr];
   runtime.caml_register_global(0, Stdlib_Atomic, "Stdlib__Atomic");
   return;
  }
  (globalThis));

//# 1014 "../.js/default/stdlib/stdlib.cma.js"
//# shape: CamlinternalLazy:[N,F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_lazy_update_to_forward = runtime.caml_lazy_update_to_forward,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    Stdlib_Obj = runtime.caml_get_global_data().Stdlib__Obj,
    Undefined =
      [248, "CamlinternalLazy.Undefined", runtime.caml_fresh_oo_id(0)];
   function force_gen_lazy_block(only_val, blk){
    if(0 !== runtime.caml_lazy_update_to_forcing(blk))
     throw caml_maybe_attach_backtrace(Undefined, 1);
    if(only_val){
     var closure$0 = blk[1];
     blk[1] = 0;
     var result$0 = caml_call1(closure$0, 0);
     blk[1] = result$0;
     caml_lazy_update_to_forward(blk);
     return result$0;
    }
    var closure = blk[1];
    blk[1] = 0;
    try{
     var result = caml_call1(closure, 0);
     blk[1] = result;
     caml_lazy_update_to_forward(blk);
     return result;
    }
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     blk[1] = function(param){throw caml_maybe_attach_backtrace(e, 0);};
     runtime.caml_lazy_reset_to_lazy(blk);
     throw caml_maybe_attach_backtrace(e, 0);
    }
   }
   function force_lazy_block(blk){return force_gen_lazy_block(0, blk);}
   function force_gen(only_val, lzv){
    var t = runtime.caml_obj_tag(lzv);
    if(t === Stdlib_Obj[12]) return lzv[1];
    if(t === Stdlib_Obj[6]) throw caml_maybe_attach_backtrace(Undefined, 1);
    return t !== Stdlib_Obj[8] ? lzv : force_gen_lazy_block(only_val, lzv);
   }
   runtime.caml_register_global
    (2, [0, Undefined, force_lazy_block, force_gen], "CamlinternalLazy");
   return;
  }
  (globalThis));

//# 1073 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Lazy:[N,F(2)*,F(1),F(1),F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime, caml_obj_tag = runtime.caml_obj_tag;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    CamlinternalLazy = global_data.CamlinternalLazy,
    Stdlib_Obj = global_data.Stdlib__Obj,
    Undefined = CamlinternalLazy[1];
   function force_val(l){return CamlinternalLazy[3].call(null, 1, l);}
   function from_fun(f){
    var x = runtime.caml_obj_block(Stdlib_Obj[8], 1);
    x[1] = f;
    return x;
   }
   function from_val(v){
    var t = caml_obj_tag(v);
    if
     (t !== Stdlib_Obj[12]
      && t !== Stdlib_Obj[8] && t !== Stdlib_Obj[6] && t !== Stdlib_Obj[16])
     return v;
    return runtime.caml_lazy_make_forward(v);
   }
   function is_val(l){
    var a = Stdlib_Obj[8];
    return caml_obj_tag(l) !== a ? 1 : 0;
   }
   function map(f, x){
    return [246,
            function(param){
             var a = caml_obj_tag(x);
             a:
             if(250 === a)
              var b = x[1];
             else{
              if(246 !== a && 244 !== a){var b = x; break a;}
              var b = CamlinternalLazy[2].call(null, x);
             }
             return caml_call1(f, b);
            }];
   }
   function map_val(f, x){
    if(! is_val(x))
     return [246,
             function(param){
              var a = caml_obj_tag(x);
              a:
              if(250 === a)
               var b = x[1];
              else{
               if(246 !== a && 244 !== a){var b = x; break a;}
               var b = CamlinternalLazy[2].call(null, x);
              }
              return caml_call1(f, b);
             }];
    var a = caml_obj_tag(x);
    a:
    if(250 === a)
     var b = x[1];
    else{
     if(246 !== a && 244 !== a){var b = x; break a;}
     var b = CamlinternalLazy[2].call(null, x);
    }
    return from_val(caml_call1(f, b));
   }
   runtime.caml_register_global
    (2,
     [0, Undefined, map, is_val, from_val, map_val, from_fun, force_val],
     "Stdlib__Lazy");
   return;
  }
  (globalThis));

//# 1154 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Seq:[F(1),F(1),F(1),F(2),F(3),F(2),F(3),F(2),F(2),F(2),F(2),F(2),F(2),F(3),F(4),F(3),F(3),F(3),F(3),F(1)*,F(2)*,F(3)*,F(2),F(3),F(2)*,F(2),F(2),F(2)*->F(1)*,F(3),F(2)*->F(1),F(3),F(3),F(3)*->F(1)*,F(2),F(2),F(3),F(3),F(3),F(1)->F(1),N,F(1)*->F(1),F(2),F(3),F(2),F(3),F(3),F(3),F(4),F(3),F(4),F(2)*,F(3)*->F(1),F(1)*,F(1)*,F(2)*,F(2)*,F(1)*->F(1),F(1)*->F(1),F(2)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Assert_failure = global_data.Assert_failure,
    Stdlib_Atomic = global_data.Stdlib__Atomic,
    CamlinternalLazy = global_data.CamlinternalLazy,
    Stdlib = global_data.Stdlib,
    Stdlib_Lazy = global_data.Stdlib__Lazy;
   function empty(param){return 0;}
   function return$(x, param){return [0, x, empty];}
   function cons(x, next, param){return [0, x, next];}
   function append(seq1, seq2, param){
    var match = caml_call1(seq1, 0);
    if(! match) return caml_call1(seq2, 0);
    var next = match[2], x = match[1];
    return [0, x, function(a){return append(next, seq2, a);}];
   }
   function map(f, seq, param){
    var match = caml_call1(seq, 0);
    if(! match) return 0;
    var next = match[2], x = match[1];
    return [0, caml_call1(f, x), function(a){return map(f, next, a);}];
   }
   function filter_map(f, seq$0, param){
    var seq = seq$0;
    for(;;){
     var match = caml_call1(seq, 0);
     if(! match) return 0;
     var next = match[2], x = match[1], match$0 = caml_call1(f, x);
     if(match$0) break;
     seq = next;
    }
    var y = match$0[1];
    return [0, y, function(a){return filter_map(f, next, a);}];
   }
   function filter(f, seq$0, param){
    var seq = seq$0;
    for(;;){
     var match = caml_call1(seq, 0);
     if(! match) return 0;
     var next = match[2], x = match[1];
     if(caml_call1(f, x)) break;
     seq = next;
    }
    return [0, x, function(a){return filter(f, next, a);}];
   }
   function concat(seq, param){
    var match = caml_call1(seq, 0);
    if(! match) return 0;
    var next = match[2], x = match[1];
    return append(x, function(a){return concat(next, a);}, 0);
   }
   function flat_map(f, seq, param){
    var match = caml_call1(seq, 0);
    if(! match) return 0;
    var next = match[2], x = match[1];
    return append
            (caml_call1(f, x), function(a){return flat_map(f, next, a);}, 0);
   }
   function fold_left(f, acc$1, seq$0){
    var acc = acc$1, seq = seq$0;
    for(;;){
     var match = caml_call1(seq, 0);
     if(! match) return acc;
     var next = match[2], x = match[1], acc$0 = caml_call2(f, acc, x);
     acc = acc$0;
     seq = next;
    }
   }
   function iter(f, seq$0){
    var seq = seq$0;
    for(;;){
     var match = caml_call1(seq, 0);
     if(! match) return 0;
     var next = match[2], x = match[1];
     caml_call1(f, x);
     seq = next;
    }
   }
   function unfold(f, u, param){
    var match = caml_call1(f, u);
    if(! match) return 0;
    var match$0 = match[1], u$0 = match$0[2], x = match$0[1];
    return [0, x, function(a){return unfold(f, u$0, a);}];
   }
   function is_empty(xs){return caml_call1(xs, 0) ? 0 : 1;}
   function uncons(xs){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1];
    return [0, [0, x, xs$0]];
   }
   function length(xs$1){
    var accu = 0, xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return accu;
     var xs$0 = match[2], accu$0 = accu + 1 | 0;
     accu = accu$0;
     xs = xs$0;
    }
   }
   function iteri(f, xs$1){
    var i = 0, xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1];
     caml_call2(f, i, x);
     var i$0 = i + 1 | 0;
     i = i$0;
     xs = xs$0;
    }
   }
   function fold_lefti(f, accu$1, xs$1){
    var accu = accu$1, i = 0, xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return accu;
     var
      xs$0 = match[2],
      x = match[1],
      accu$0 = caml_call3(f, accu, i, x),
      i$0 = i + 1 | 0;
     accu = accu$0;
     i = i$0;
     xs = xs$0;
    }
   }
   function for_all(p, xs$1){
    var xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 1;
     var xs$0 = match[2], x = match[1], a = caml_call1(p, x);
     if(! a) return a;
     xs = xs$0;
    }
   }
   function exists(p, xs$1){
    var xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1], a = caml_call1(p, x);
     if(a) return a;
     xs = xs$0;
    }
   }
   function find(p, xs$1){
    var xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1];
     if(caml_call1(p, x)) return [0, x];
     xs = xs$0;
    }
   }
   function find_index(p, xs){
    var i = 0, xs$0 = xs;
    for(;;){
     var match = caml_call1(xs$0, 0);
     if(! match) return 0;
     var xs$1 = match[2], x = match[1];
     if(caml_call1(p, x)) return [0, i];
     var i$0 = i + 1 | 0;
     i = i$0;
     xs$0 = xs$1;
    }
   }
   function find_map(f, xs$1){
    var xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1], result = caml_call1(f, x);
     if(result) return result;
     xs = xs$0;
    }
   }
   function find_mapi(f, xs){
    var i = 0, xs$0 = xs;
    for(;;){
     var match = caml_call1(xs$0, 0);
     if(! match) return 0;
     var xs$1 = match[2], x = match[1], result = caml_call2(f, i, x);
     if(result) return result;
     var i$0 = i + 1 | 0;
     i = i$0;
     xs$0 = xs$1;
    }
   }
   function iter2(f, xs$1, ys$1){
    var xs = xs$1, ys = ys$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0);
     if(! match$0) return 0;
     var ys$0 = match$0[2], y = match$0[1];
     caml_call2(f, x, y);
     xs = xs$0;
     ys = ys$0;
    }
   }
   function fold_left2(f, accu$1, xs$1, ys$1){
    var accu = accu$1, xs = xs$1, ys = ys$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return accu;
     var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0);
     if(! match$0) return accu;
     var
      ys$0 = match$0[2],
      y = match$0[1],
      accu$0 = caml_call3(f, accu, x, y);
     accu = accu$0;
     xs = xs$0;
     ys = ys$0;
    }
   }
   function for_all2(f, xs$1, ys$1){
    var xs = xs$1, ys = ys$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 1;
     var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0);
     if(! match$0) return 1;
     var ys$0 = match$0[2], y = match$0[1], a = caml_call2(f, x, y);
     if(! a) return a;
     xs = xs$0;
     ys = ys$0;
    }
   }
   function exists2(f, xs$1, ys$1){
    var xs = xs$1, ys = ys$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0);
     if(! match$0) return 0;
     var ys$0 = match$0[2], y = match$0[1], a = caml_call2(f, x, y);
     if(a) return a;
     xs = xs$0;
     ys = ys$0;
    }
   }
   function equal(eq, xs$1, ys$1){
    var xs = xs$1, ys = ys$1;
    for(;;){
     var match = caml_call1(xs, 0), match$0 = caml_call1(ys, 0);
     if(match){
      if(match$0){
       var
        ys$0 = match$0[2],
        y = match$0[1],
        xs$0 = match[2],
        x = match[1],
        a = caml_call2(eq, x, y);
       if(! a) return a;
       xs = xs$0;
       ys = ys$0;
       continue;
      }
     }
     else if(! match$0) return 1;
     return 0;
    }
   }
   function compare(cmp, xs$1, ys$1){
    var xs = xs$1, ys = ys$1;
    for(;;){
     var match = caml_call1(xs, 0), match$0 = caml_call1(ys, 0);
     if(! match) return match$0 ? -1 : 0;
     var xs$0 = match[2], x = match[1];
     if(! match$0) return 1;
     var ys$0 = match$0[2], y = match$0[1], c = caml_call2(cmp, x, y);
     if(0 !== c) return c;
     xs = xs$0;
     ys = ys$0;
    }
   }
   function init_aux(f, i, j, param){
    if(i >= j) return 0;
    var a = i + 1 | 0;
    return [0, caml_call1(f, i), function(b){return init_aux(f, a, j, b);}];
   }
   function init(n, f){
    if(0 > n) return Stdlib[1].call(null, "Seq.init");
    return function(a){return init_aux(f, 0, n, a);};
   }
   function repeat(x, param){
    return [0, x, function(a){return repeat(x, a);}];
   }
   function forever(f, param){
    return [0, caml_call1(f, 0), function(a){return forever(f, a);}];
   }
   function cycle_nonempty(xs, param){
    return append(xs, function(a){return cycle_nonempty(xs, a);}, 0);
   }
   function cycle(xs, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1];
    function a(a){return cycle_nonempty(xs, a);}
    return [0, x, function(b){return append(xs$0, a, b);}];
   }
   function iterate1(f, x, param){
    var y = caml_call1(f, x);
    return [0, y, function(a){return iterate1(f, y, a);}];
   }
   function iterate(f, x){
    function next(a){return iterate1(f, x, a);}
    return function(param){return [0, x, next];};
   }
   function mapi_aux(f, i, xs, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1], a = i + 1 | 0;
    return [0,
            caml_call2(f, i, x),
            function(b){return mapi_aux(f, a, xs$0, b);}];
   }
   function mapi(f, xs){return function(a){return mapi_aux(f, 0, xs, a);};}
   function tail_scan(f, s, xs, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1], s$0 = caml_call2(f, s, x);
    return [0, s$0, function(a){return tail_scan(f, s$0, xs$0, a);}];
   }
   function scan(f, s, xs){
    function next(a){return tail_scan(f, s, xs, a);}
    return function(param){return [0, s, next];};
   }
   function take_aux(n, xs){
    return 0 === n
            ? empty
            : function
             (param){
              var match = caml_call1(xs, 0);
              if(! match) return 0;
              var xs$0 = match[2], x = match[1];
              return [0, x, take_aux(n - 1 | 0, xs$0)];
             };
   }
   function take(n, xs){
    if(n < 0) Stdlib[1].call(null, "Seq.take");
    return take_aux(n, xs);
   }
   function drop(n, xs){
    return 0 <= n
            ? 0
              === n
              ? xs
              : function
               (param){
                var n$0 = n, xs$0 = xs;
                for(;;){
                 var match = caml_call1(xs$0, 0);
                 if(! match) return 0;
                 var xs$1 = match[2], n$1 = n$0 - 1 | 0;
                 if(0 === n$1) return caml_call1(xs$1, 0);
                 n$0 = n$1;
                 xs$0 = xs$1;
                }
               }
            : Stdlib[1].call(null, "Seq.drop");
   }
   function take_while(p, xs, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1];
    return caml_call1(p, x)
            ? [0, x, function(a){return take_while(p, xs$0, a);}]
            : 0;
   }
   function drop_while(p, xs$1, param){
    var xs = xs$1;
    for(;;){
     var node = caml_call1(xs, 0);
     if(! node) return 0;
     var xs$0 = node[2], x = node[1];
     if(! caml_call1(p, x)) return node;
     xs = xs$0;
    }
   }
   function group(eq, xs, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1], a = caml_call1(eq, x);
    function b(b){return drop_while(a, xs$0, b);}
    var c = caml_call1(eq, x);
    function next(a){return take_while(c, xs$0, a);}
    return [0,
            function(param){return [0, x, next];},
            function(a){return group(eq, b, a);}];
   }
   var
    Forced_twice =
      [248, "Stdlib.Seq.Forced_twice", runtime.caml_fresh_oo_id(0)],
    to_lazy = Stdlib_Lazy[6];
   function failure(param){
    throw caml_maybe_attach_backtrace(Forced_twice, 1);
   }
   function memoize(xs){
    function s$0(param){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1];
     return [0, x, memoize(xs$0)];
    }
    var s = to_lazy(s$0);
    return function(param){
     var a = runtime.caml_obj_tag(s);
     if(250 === a) return s[1];
     if(246 !== a && 244 !== a) return s;
     return CamlinternalLazy[2].call(null, s);};
   }
   function once(xs){
    function f(param){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1];
     return [0, x, once(xs$0)];
    }
    var action = Stdlib_Atomic[1].call(null, f);
    return function(param){
     var f = Stdlib_Atomic[5].call(null, action, failure);
     return caml_call1(f, 0);};
   }
   function zip(xs, ys, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0);
    if(! match$0) return 0;
    var ys$0 = match$0[2], y = match$0[1];
    return [0, [0, x, y], function(a){return zip(xs$0, ys$0, a);}];
   }
   function map2(f, xs, ys, param){
    var match = caml_call1(xs, 0);
    if(! match) return 0;
    var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0);
    if(! match$0) return 0;
    var ys$0 = match$0[2], y = match$0[1];
    return [0,
            caml_call2(f, x, y),
            function(a){return map2(f, xs$0, ys$0, a);}];
   }
   function interleave(xs, ys, param){
    var match = caml_call1(xs, 0);
    if(! match) return caml_call1(ys, 0);
    var xs$0 = match[2], x = match[1];
    return [0, x, function(a){return interleave(ys, xs$0, a);}];
   }
   function sorted_merge1(cmp, x, xs, y, ys){
    return 0 < caml_call2(cmp, x, y)
            ? [0,
              y,
              function(param){
               var match = caml_call1(ys, 0);
               if(! match) return [0, x, xs];
               var ys$0 = match[2], y = match[1];
               return sorted_merge1(cmp, x, xs, y, ys$0);
              }]
            : [0,
              x,
              function(param){
               var match = caml_call1(xs, 0);
               if(! match) return [0, y, ys];
               var xs$0 = match[2], x = match[1];
               return sorted_merge1(cmp, x, xs$0, y, ys);
              }];
   }
   function sorted_merge(cmp, xs, ys, param){
    var match = caml_call1(xs, 0), match$0 = caml_call1(ys, 0);
    if(match){
     if(match$0){
      var ys$0 = match$0[2], y = match$0[1], xs$0 = match[2], x = match[1];
      return sorted_merge1(cmp, x, xs$0, y, ys$0);
     }
     var c = match;
    }
    else{if(! match$0) return 0; var c = match$0;}
    return c;
   }
   function map_fst(xys, param){
    var match = caml_call1(xys, 0);
    if(! match) return 0;
    var xys$0 = match[2], x = match[1][1];
    return [0, x, function(a){return map_fst(xys$0, a);}];
   }
   function map_snd(xys, param){
    var match = caml_call1(xys, 0);
    if(! match) return 0;
    var xys$0 = match[2], y = match[1][2];
    return [0, y, function(a){return map_snd(xys$0, a);}];
   }
   function unzip(xys){
    return [0,
            function(a){return map_fst(xys, a);},
            function(a){return map_snd(xys, a);}];
   }
   function filter_map_find_left_map(f, xs$1, param){
    var xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1], match$0 = caml_call1(f, x);
     if(0 === match$0[0]) break;
     xs = xs$0;
    }
    var y = match$0[1];
    return [0, y, function(a){return filter_map_find_left_map(f, xs$0, a);}];
   }
   function filter_map_find_right_map(f, xs$1, param){
    var xs = xs$1;
    for(;;){
     var match = caml_call1(xs, 0);
     if(! match) return 0;
     var xs$0 = match[2], x = match[1], match$0 = caml_call1(f, x);
     if(0 !== match$0[0]) break;
     xs = xs$0;
    }
    var z = match$0[1];
    return [0, z, function(a){return filter_map_find_right_map(f, xs$0, a);}];
   }
   function partition_map(f, xs){
    return [0,
            function(a){return filter_map_find_left_map(f, xs, a);},
            function(a){return filter_map_find_right_map(f, xs, a);}];
   }
   function partition(p, xs){
    function a(x){return 1 - caml_call1(p, x);}
    return [0,
            function(a){return filter(p, xs, a);},
            function(b){return filter(a, xs, b);}];
   }
   function peel(xss){
    return unzip(function(a){return filter_map(uncons, xss, a);});
   }
   var b = [0, "seq.ml", 616, 4];
   function transpose(xss, param){
    var match = peel(xss), tails = match[2], heads = match[1];
    if(! is_empty(heads))
     return [0, heads, function(a){return transpose(tails, a);}];
    if(is_empty(tails)) return 0;
    throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
   }
   function a(remainders, xss, param){
    var match = caml_call1(xss, 0);
    if(! match) return transpose(remainders, 0);
    var xss$0 = match[2], xs = match[1], match$0 = caml_call1(xs, 0);
    if(match$0){
     var
      xs$0 = match$0[2],
      x = match$0[1],
      match$1 = peel(remainders),
      tails = match$1[2],
      heads = match$1[1],
      b = function(param){return [0, xs$0, tails];};
     return [0,
             function(param){return [0, x, heads];},
             function(c){return a(b, xss$0, c);}];
    }
    var
     match$2 = peel(remainders),
     tails$0 = match$2[2],
     heads$0 = match$2[1];
    return [0, heads$0, function(b){return a(tails$0, xss$0, b);}];
   }
   function map_product(f, xs, ys){
    function c(x){
     function a(y){return caml_call2(f, x, y);}
     return function(b){return map(a, ys, b);};
    }
    function xss(a){return map(c, xs, a);}
    function b(b){return a(empty, xss, b);}
    return function(a){return concat(b, a);};
   }
   function product(xs, ys){
    return map_product(function(x, y){return [0, x, y];}, xs, ys);
   }
   function of_dispenser(it){
    function c(param){
     var match = caml_call1(it, 0);
     if(! match) return 0;
     var x = match[1];
     return [0, x, c];
    }
    return c;
   }
   function to_dispenser(xs){
    var s = [0, xs];
    return function(param){
     var match = caml_call1(s[1], 0);
     if(! match) return 0;
     var xs = match[2], x = match[1];
     s[1] = xs;
     return [0, x];};
   }
   function ints(i, param){
    var a = i + 1 | 0;
    return [0, i, function(b){return ints(a, b);}];
   }
   runtime.caml_register_global
    (10,
     [0,
      is_empty,
      uncons,
      length,
      iter,
      fold_left,
      iteri,
      fold_lefti,
      for_all,
      exists,
      find,
      find_index,
      find_map,
      find_mapi,
      iter2,
      fold_left2,
      for_all2,
      exists2,
      equal,
      compare,
      empty,
      return$,
      cons,
      init,
      unfold,
      repeat,
      forever,
      cycle,
      iterate,
      map,
      mapi,
      filter,
      filter_map,
      scan,
      take,
      drop,
      take_while,
      drop_while,
      group,
      memoize,
      Forced_twice,
      once,
      transpose,
      append,
      concat,
      flat_map,
      flat_map,
      zip,
      map2,
      interleave,
      sorted_merge,
      product,
      map_product,
      unzip,
      unzip,
      partition_map,
      partition,
      of_dispenser,
      to_dispenser,
      ints],
     "Stdlib__Seq");
   return;
  }
  (globalThis));

//# 1849 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Option:[N,F(1)*,F(2)*,F(1),F(2),F(1)*,F(2),F(3),F(2),F(1)*,F(1)*,F(3),F(3),F(2)*,F(1)*,F(1)*->F(1)*]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib = global_data.Stdlib;
   function some(v){return [0, v];}
   function value(o, default$){
    if(! o) return default$;
    var v = o[1];
    return v;
   }
   function get(param){
    if(! param) return Stdlib[1].call(null, "option is None");
    var v = param[1];
    return v;
   }
   function bind(o, f){
    if(! o) return 0;
    var v = o[1];
    return caml_call1(f, v);
   }
   function join(param){if(! param) return 0; var o = param[1]; return o;}
   function map(f, o){
    if(! o) return 0;
    var v = o[1];
    return [0, caml_call1(f, v)];
   }
   function fold(none, some, param){
    if(! param) return none;
    var v = param[1];
    return caml_call1(some, v);
   }
   function iter(f, param){
    if(! param) return 0;
    var v = param[1];
    return caml_call1(f, v);
   }
   function is_none(param){return param ? 0 : 1;}
   function is_some(param){return param ? 1 : 0;}
   function equal(eq, o0, o1){
    if(o0){
     if(o1){var v1 = o1[1], v0 = o0[1]; return caml_call2(eq, v0, v1);}
    }
    else if(! o1) return 1;
    return 0;
   }
   function compare(cmp, o0, o1){
    if(! o0) return o1 ? -1 : 0;
    var v0 = o0[1];
    if(! o1) return 1;
    var v1 = o1[1];
    return caml_call2(cmp, v0, v1);
   }
   function to_result(none, param){
    if(! param) return [1, none];
    var v = param[1];
    return [0, v];
   }
   function to_list(param){
    if(! param) return 0;
    var v = param[1];
    return [0, v, 0];
   }
   function to_seq(param){
    if(! param) return Stdlib_Seq[20];
    var v = param[1], a = Stdlib_Seq[21];
    return function(b){return a(v, b);};
   }
   runtime.caml_register_global
    (3,
     [0,
      0,
      some,
      value,
      get,
      bind,
      join,
      map,
      fold,
      iter,
      is_none,
      is_some,
      equal,
      compare,
      to_result,
      to_list,
      to_seq],
     "Stdlib__Option");
   return;
  }
  (globalThis));

//# 2121 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Char:[F(1),F(1),F(1)*,F(1)*,F(2)*,F(2)*,F(2)*,F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_hash = runtime.caml_hash,
    caml_string_of_bytes = runtime.caml_string_of_bytes,
    Stdlib = runtime.caml_get_global_data().Stdlib;
   function chr(n){
    if(0 <= n && 255 >= n) return n;
    return Stdlib[1].call(null, "Char.chr");
   }
   function escaped(c){
    a:
    {
     if(40 <= c){
      if(92 === c) return "\\\\";
      if(127 <= c) break a;
     }
     else{
      if(32 > c){
       if(14 <= c) break a;
       switch(c){
         case 8:
          return "\\b";
         case 9:
          return "\\t";
         case 10:
          return "\\n";
         case 13:
          return "\\r";
         default: break a;
       }
      }
      if(39 <= c) return "\\'";
     }
     var s$0 = caml_create_bytes(1);
     caml_bytes_unsafe_set(s$0, 0, c);
     return caml_string_of_bytes(s$0);
    }
    var s = caml_create_bytes(4);
    caml_bytes_unsafe_set(s, 0, 92);
    caml_bytes_unsafe_set(s, 1, 48 + (c / 100 | 0) | 0);
    caml_bytes_unsafe_set(s, 2, 48 + ((c / 10 | 0) % 10 | 0) | 0);
    caml_bytes_unsafe_set(s, 3, 48 + (c % 10 | 0) | 0);
    return caml_string_of_bytes(s);
   }
   function lowercase_ascii(c){return 25 < c - 65 >>> 0 ? c : c + 32 | 0;}
   function uppercase_ascii(c){return 25 < c - 97 >>> 0 ? c : c - 32 | 0;}
   function compare(c1, c2){return c1 - c2 | 0;}
   function equal(c1, c2){return 0 === (c1 - c2 | 0) ? 1 : 0;}
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function hash(x){return caml_hash(10, 100, 0, x);}
   runtime.caml_register_global
    (8,
     [0,
      chr,
      escaped,
      lowercase_ascii,
      uppercase_ascii,
      compare,
      equal,
      seeded_hash,
      hash],
     "Stdlib__Char");
   return;
  }
  (globalThis));

//# 2195 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Uchar:[N,N,N,N,F(1),F(1),F(1)*,F(1),F(1)*,F(1)*,F(1)*,F(1)*,F(1),F(1)*,F(2)*,F(2)*,F(1)*,F(1)*,F(1)*,F(1)*,F(2)*,F(1)*,F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_format_int = runtime.caml_format_int,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    global_data = runtime.caml_get_global_data(),
    Assert_failure = global_data.Assert_failure,
    Stdlib = global_data.Stdlib;
   function succ(u){
    return u === 55295
            ? 57344
            : u
              === 1114111
              ? Stdlib[1].call(null, "U+10FFFF has no successor")
              : u + 1 | 0;
   }
   function pred(u){
    return u === 57344
            ? 55295
            : u
              === 0
              ? Stdlib[1].call(null, "U+0000 has no predecessor")
              : u - 1 | 0;
   }
   function is_valid(i){
    var a = 0 <= i ? 1 : 0, b = a ? i <= 55295 ? 1 : 0 : a;
    if(b)
     var c = b;
    else
     var d = 57344 <= i ? 1 : 0, c = d ? i <= 1114111 ? 1 : 0 : d;
    return c;
   }
   function of_int(i){
    if(is_valid(i)) return i;
    var
     a =
       Stdlib[28].call
        (null, caml_format_int("%X", i), " is not an Unicode scalar value");
    return Stdlib[1].call(null, a);
   }
   function is_char(u){return u < 256 ? 1 : 0;}
   function of_char(c){return c;}
   function to_char(u){
    if(255 >= u) return u;
    var
     a =
       Stdlib[28].call
        (null, caml_format_int("%04X", u), " is not a latin1 character"),
     b = Stdlib[28].call(null, "U+", a);
    return Stdlib[1].call(null, b);
   }
   function unsafe_to_char(a){return a;}
   function equal(b, a){return b === a ? 1 : 0;}
   var compare = runtime.caml_int_compare;
   function hash(a){return a;}
   function utf_decode_is_valid(d){return 1 === (d >>> 27 | 0) ? 1 : 0;}
   function utf_decode_length(d){return (d >>> 24 | 0) & 7;}
   function utf_decode_uchar(d){return d & 16777215;}
   function utf_decode(n, u){return (8 | n) << 24 | u;}
   function utf_decode_invalid(n){return n << 24 | 65533;}
   var
    cst_uchar_ml = "uchar.ml",
    a = [0, cst_uchar_ml, 85, 7],
    b = [0, cst_uchar_ml, 80, 18];
   function utf_8_byte_length(u){
    if(0 > u) throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
    if(127 >= u) return 1;
    if(2047 >= u) return 2;
    if(65535 >= u) return 3;
    if(1114111 < u)
     throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
    return 4;
   }
   var c = [0, cst_uchar_ml, 91, 7], d = [0, cst_uchar_ml, 88, 18];
   function utf_16_byte_length(u){
    if(0 > u) throw caml_maybe_attach_backtrace([0, Assert_failure, d], 1);
    if(65535 >= u) return 2;
    if(1114111 < u)
     throw caml_maybe_attach_backtrace([0, Assert_failure, c], 1);
    return 4;
   }
   var
    Stdlib_Uchar =
      [0,
       0,
       1114111,
       65279,
       65533,
       succ,
       pred,
       is_valid,
       of_int,
       function(a){return a;},
       function(a){return a;},
       is_char,
       of_char,
       to_char,
       unsafe_to_char,
       equal,
       compare,
       hash,
       utf_decode_is_valid,
       utf_decode_uchar,
       utf_decode_length,
       utf_decode,
       utf_decode_invalid,
       utf_8_byte_length,
       utf_16_byte_length];
   runtime.caml_register_global(13, Stdlib_Uchar, "Stdlib__Uchar");
   return;
  }
  (globalThis));

//# 2313 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__List:[F(1),F(2),F(2),F(1)*,F(2)*,F(1),F(1),F(2),F(2),F(1),F(2),F(2),F(2),F(1),F(1),F(3),F(3),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(3),F(3),F(3),F(3),F(3),F(3),F(4),F(4),F(2),F(2),F(3),F(3),F(2),F(2),F(2),F(2),F(1)*->F(1),F(2),F(1)*->F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(3),F(1)*->F(1)*,F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_compare = runtime.caml_compare,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var Stdlib = runtime.caml_get_global_data().Stdlib;
   function length(l$0){
    var len = 0, param = l$0;
    for(;;){
     if(! param) return len;
     var l = param[2], len$0 = len + 1 | 0;
     len = len$0;
     param = l;
    }
   }
   function cons(a, l){return [0, a, l];}
   function hd(param){
    if(! param) return Stdlib[2].call(null, "hd");
    var a = param[1];
    return a;
   }
   function tl(param){
    if(! param) return Stdlib[2].call(null, "tl");
    var l = param[2];
    return l;
   }
   var cst_List_nth = "List.nth";
   function nth(l, n){
    if(0 > n) return Stdlib[1].call(null, cst_List_nth);
    var l$0 = l, n$0 = n;
    for(;;){
     if(! l$0) return Stdlib[2].call(null, "nth");
     var l$1 = l$0[2], a = l$0[1];
     if(0 === n$0) return a;
     var n$1 = n$0 - 1 | 0;
     l$0 = l$1;
     n$0 = n$1;
    }
   }
   function nth_opt(l, n){
    if(0 > n) return Stdlib[1].call(null, cst_List_nth);
    var l$0 = l, n$0 = n;
    for(;;){
     if(! l$0) return 0;
     var l$1 = l$0[2], a = l$0[1];
     if(0 === n$0) return [0, a];
     var n$1 = n$0 - 1 | 0;
     l$0 = l$1;
     n$0 = n$1;
    }
   }
   var append = Stdlib[37];
   function rev_append(l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(! l1) return l2;
     var l1$0 = l1[2], a = l1[1], l2$0 = [0, a, l2];
     l1 = l1$0;
     l2 = l2$0;
    }
   }
   function rev(l){return rev_append(l, 0);}
   function init(len, f){
    if(0 > len) return Stdlib[1].call(null, "List.init");
    var last = len - 1 | 0;
    if(last < 0) return 0;
    var i$1 = 0;
    if(0 === last) return [0, caml_call1(f, i$1), 0];
    var
     r1 = caml_call1(f, i$1),
     r2 = caml_call1(f, 1),
     block = [0, r2, 24029],
     dst = block,
     offset = 1,
     i = 2;
    for(;;){
     if(last < i)
      dst[offset + 1] = 0;
     else{
      if(i !== last){
       var
        r1$0 = caml_call1(f, i),
        r2$0 = caml_call1(f, i + 1 | 0),
        dst$0 = [0, r2$0, 24029];
       dst[offset + 1] = [0, r1$0, dst$0];
       var i$0 = i + 2 | 0;
       dst = dst$0;
       offset = 1;
       i = i$0;
       continue;
      }
      dst[offset + 1] = [0, caml_call1(f, i), 0];
     }
     return [0, r1, block];
    }
   }
   function flatten(param){
    if(! param) return 0;
    var r = param[2], l = param[1], a = flatten(r);
    return Stdlib[37].call(null, l, a);
   }
   function map(f, param){
    if(! param) return 0;
    var match = param[2], a1 = param[1];
    if(! match){var r1$0 = caml_call1(f, a1); return [0, r1$0, 0];}
    var
     l = match[2],
     a2 = match[1],
     r1 = caml_call1(f, a1),
     r2 = caml_call1(f, a2),
     block = [0, r2, 24029],
     dst = block,
     offset = 1,
     param$0 = l;
    for(;;){
     if(param$0){
      var match$0 = param$0[2], a1$0 = param$0[1];
      if(match$0){
       var
        l$0 = match$0[2],
        a2$0 = match$0[1],
        r1$1 = caml_call1(f, a1$0),
        r2$0 = caml_call1(f, a2$0),
        dst$0 = [0, r2$0, 24029];
       dst[offset + 1] = [0, r1$1, dst$0];
       dst = dst$0;
       offset = 1;
       param$0 = l$0;
       continue;
      }
      var r1$2 = caml_call1(f, a1$0);
      dst[offset + 1] = [0, r1$2, 0];
     }
     else
      dst[offset + 1] = 0;
     return [0, r1, block];
    }
   }
   function mapi(f, l$1){
    if(! l$1) return 0;
    var match = l$1[2], a1 = l$1[1], i$1 = 0;
    if(! match){var r1$0 = caml_call2(f, i$1, a1); return [0, r1$0, 0];}
    var
     l = match[2],
     a2 = match[1],
     r1 = caml_call2(f, i$1, a1),
     r2 = caml_call2(f, 1, a2),
     block = [0, r2, 24029],
     dst = block,
     offset = 1,
     i = 2,
     param = l;
    for(;;){
     if(param){
      var match$0 = param[2], a1$0 = param[1];
      if(match$0){
       var
        l$0 = match$0[2],
        a2$0 = match$0[1],
        r1$1 = caml_call2(f, i, a1$0),
        r2$0 = caml_call2(f, i + 1 | 0, a2$0),
        dst$0 = [0, r2$0, 24029];
       dst[offset + 1] = [0, r1$1, dst$0];
       var i$0 = i + 2 | 0;
       dst = dst$0;
       offset = 1;
       i = i$0;
       param = l$0;
       continue;
      }
      var r1$2 = caml_call2(f, i, a1$0);
      dst[offset + 1] = [0, r1$2, 0];
     }
     else
      dst[offset + 1] = 0;
     return [0, r1, block];
    }
   }
   function rev_map(f, l){
    var accu = 0, param = l;
    for(;;){
     if(! param) return accu;
     var l$0 = param[2], a = param[1], accu$0 = [0, caml_call1(f, a), accu];
     accu = accu$0;
     param = l$0;
    }
   }
   function iter(f, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1];
     caml_call1(f, a);
     param = l;
    }
   }
   function iteri(f, l$0){
    var i = 0, param = l$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1];
     caml_call2(f, i, a);
     var i$0 = i + 1 | 0;
     i = i$0;
     param = l;
    }
   }
   function fold_left(f, accu$1, l$1){
    var accu = accu$1, l = l$1;
    for(;;){
     if(! l) return accu;
     var l$0 = l[2], a = l[1], accu$0 = caml_call2(f, accu, a);
     accu = accu$0;
     l = l$0;
    }
   }
   function fold_right(f, l, accu){
    if(! l) return accu;
    var l$0 = l[2], a = l[1];
    return caml_call2(f, a, fold_right(f, l$0, accu));
   }
   function map2(f, l1, l2){
    var cst_List_map2 = "List.map2";
    if(l1){
     var a = l1[2], a1 = l1[1];
     if(a){
      if(l2){
       var match = l2[2];
       if(match){
        var
         l2$0 = match[2],
         b2 = match[1],
         b1 = l2[1],
         l1$0 = a[2],
         a2 = a[1],
         r1 = caml_call2(f, a1, b1),
         r2 = caml_call2(f, a2, b2),
         block = [0, r2, 24029],
         dst = block,
         offset = 1,
         l1$1 = l1$0,
         l2$1 = l2$0;
        for(;;){
         a:
         {
          if(l1$1){
           var b = l1$1[2], a1$0 = l1$1[1];
           if(b){
            if(l2$1){
             var match$0 = l2$1[2];
             if(match$0){
              var
               l2$2 = match$0[2],
               b2$0 = match$0[1],
               b1$1 = l2$1[1],
               l1$2 = b[2],
               a2$0 = b[1],
               r1$1 = caml_call2(f, a1$0, b1$1),
               r2$0 = caml_call2(f, a2$0, b2$0),
               dst$0 = [0, r2$0, 24029];
              dst[offset + 1] = [0, r1$1, dst$0];
              dst = dst$0;
              offset = 1;
              l1$1 = l1$2;
              l2$1 = l2$2;
              continue;
             }
            }
           }
           else if(l2$1 && ! l2$1[2]){
            var b1$2 = l2$1[1], r1$2 = caml_call2(f, a1$0, b1$2);
            dst[offset + 1] = [0, r1$2, 0];
            break a;
           }
          }
          else if(! l2$1){dst[offset + 1] = 0; break a;}
          dst[offset + 1] = Stdlib[1].call(null, cst_List_map2);
         }
         return [0, r1, block];
        }
       }
      }
     }
     else if(l2 && ! l2[2]){
      var b1$0 = l2[1], r1$0 = caml_call2(f, a1, b1$0);
      return [0, r1$0, 0];
     }
    }
    else if(! l2) return 0;
    return Stdlib[1].call(null, cst_List_map2);
   }
   function rev_map2(f, l1, l2){
    var accu = 0, l1$0 = l1, l2$0 = l2;
    for(;;){
     if(l1$0){
      if(l2$0){
       var
        l2$1 = l2$0[2],
        a2 = l2$0[1],
        l1$1 = l1$0[2],
        a1 = l1$0[1],
        accu$0 = [0, caml_call2(f, a1, a2), accu];
       accu = accu$0;
       l1$0 = l1$1;
       l2$0 = l2$1;
       continue;
      }
     }
     else if(! l2$0) return accu;
     return Stdlib[1].call(null, "List.rev_map2");
    }
   }
   function iter2(f, l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(l1){
      if(l2){
       var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1];
       caml_call2(f, a1, a2);
       l1 = l1$0;
       l2 = l2$0;
       continue;
      }
     }
     else if(! l2) return 0;
     return Stdlib[1].call(null, "List.iter2");
    }
   }
   function fold_left2(f, accu$1, l1$1, l2$1){
    var accu = accu$1, l1 = l1$1, l2 = l2$1;
    for(;;){
     if(l1){
      if(l2){
       var
        l2$0 = l2[2],
        a2 = l2[1],
        l1$0 = l1[2],
        a1 = l1[1],
        accu$0 = caml_call3(f, accu, a1, a2);
       accu = accu$0;
       l1 = l1$0;
       l2 = l2$0;
       continue;
      }
     }
     else if(! l2) return accu;
     return Stdlib[1].call(null, "List.fold_left2");
    }
   }
   function fold_right2(f, l1, l2, accu){
    if(l1){
     if(l2){
      var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1];
      return caml_call3(f, a1, a2, fold_right2(f, l1$0, l2$0, accu));
     }
    }
    else if(! l2) return accu;
    return Stdlib[1].call(null, "List.fold_right2");
   }
   function for_all(p, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 1;
     var l = param[2], a = param[1], b = caml_call1(p, a);
     if(! b) return b;
     param = l;
    }
   }
   function exists(p, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1], b = caml_call1(p, a);
     if(b) return b;
     param = l;
    }
   }
   function for_all2(p, l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(l1){
      if(l2){
       var
        l2$0 = l2[2],
        a2 = l2[1],
        l1$0 = l1[2],
        a1 = l1[1],
        a = caml_call2(p, a1, a2);
       if(! a) return a;
       l1 = l1$0;
       l2 = l2$0;
       continue;
      }
     }
     else if(! l2) return 1;
     return Stdlib[1].call(null, "List.for_all2");
    }
   }
   function exists2(p, l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(l1){
      if(l2){
       var
        l2$0 = l2[2],
        a2 = l2[1],
        l1$0 = l1[2],
        a1 = l1[1],
        a = caml_call2(p, a1, a2);
       if(a) return a;
       l1 = l1$0;
       l2 = l2$0;
       continue;
      }
     }
     else if(! l2) return 0;
     return Stdlib[1].call(null, "List.exists2");
    }
   }
   function mem(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1], b = 0 === caml_compare(a, x) ? 1 : 0;
     if(b) return b;
     param = l;
    }
   }
   function memq(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1], b = a === x ? 1 : 0;
     if(b) return b;
     param = l;
    }
   }
   function assoc(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var l = param[2], match = param[1], b = match[2], a = match[1];
     if(0 === caml_compare(a, x)) return b;
     param = l;
    }
   }
   function assoc_opt(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], match = param[1], b = match[2], a = match[1];
     if(0 === caml_compare(a, x)) return [0, b];
     param = l;
    }
   }
   function assq(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var l = param[2], match = param[1], b = match[2], a = match[1];
     if(a === x) return b;
     param = l;
    }
   }
   function assq_opt(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], match = param[1], b = match[2], a = match[1];
     if(a === x) return [0, b];
     param = l;
    }
   }
   function mem_assoc(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1][1], b = 0 === caml_compare(a, x) ? 1 : 0;
     if(b) return b;
     param = l;
    }
   }
   function mem_assq(x, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], a = param[1][1], b = a === x ? 1 : 0;
     if(b) return b;
     param = l;
    }
   }
   function remove_assoc(x, param){
    if(! param) return 0;
    var l = param[2], pair = param[1], a = pair[1];
    return 0 === caml_compare(a, x) ? l : [0, pair, remove_assoc(x, l)];
   }
   function remove_assq(x, param){
    if(! param) return 0;
    var l = param[2], pair = param[1], a = pair[1];
    return a === x ? l : [0, pair, remove_assq(x, l)];
   }
   function find(p, param$0){
    var param = param$0;
    for(;;){
     if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var l = param[2], x = param[1];
     if(caml_call1(p, x)) return x;
     param = l;
    }
   }
   function find_opt(p, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], x = param[1];
     if(caml_call1(p, x)) return [0, x];
     param = l;
    }
   }
   function find_index(p){
    return function(param$0){
     var i = 0, param = param$0;
     for(;;){
      if(! param) return 0;
      var l = param[2], a = param[1];
      if(caml_call1(p, a)) return [0, i];
      var i$0 = i + 1 | 0;
      i = i$0;
      param = l;
     }};
   }
   function find_map(f, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var l = param[2], x = param[1], result = caml_call1(f, x);
     if(result) return result;
     param = l;
    }
   }
   function find_mapi(f){
    return function(param$0){
     var i = 0, param = param$0;
     for(;;){
      if(! param) return 0;
      var l = param[2], x = param[1], result = caml_call2(f, i, x);
      if(result) return result;
      var i$0 = i + 1 | 0;
      i = i$0;
      param = l;
     }};
   }
   function find_all(p, param$1){
    var param = param$1;
    for(;;){
     if(! param) return 0;
     var l = param[2], x = param[1];
     if(caml_call1(p, x)) break;
     param = l;
    }
    var block = [0, x, 24029], dst = block, offset = 1, param$0 = l;
    for(;;){
     if(! param$0){dst[offset + 1] = 0; return block;}
     var l$0 = param$0[2], x$0 = param$0[1];
     if(caml_call1(p, x$0)){
      var dst$0 = [0, x$0, 24029];
      dst[offset + 1] = dst$0;
      dst = dst$0;
      offset = 1;
      param$0 = l$0;
     }
     else
      param$0 = l$0;
    }
   }
   function filteri(p, l$1){
    var i = 0, param = l$1;
    for(;;){
     if(! param) return 0;
     var l = param[2], x = param[1], i$0 = i + 1 | 0;
     if(caml_call2(p, i, x)) break;
     i = i$0;
     param = l;
    }
    var
     block = [0, x, 24029],
     dst = block,
     offset = 1,
     i$1 = i$0,
     param$0 = l;
    for(;;){
     if(! param$0){dst[offset + 1] = 0; return block;}
     var l$0 = param$0[2], x$0 = param$0[1], i$2 = i$1 + 1 | 0;
     if(caml_call2(p, i$1, x$0)){
      var dst$0 = [0, x$0, 24029];
      dst[offset + 1] = dst$0;
      dst = dst$0;
      offset = 1;
      i$1 = i$2;
      param$0 = l$0;
     }
     else{i$1 = i$2; param$0 = l$0;}
    }
   }
   function filter_map(f, param$1){
    var param = param$1;
    for(;;){
     if(! param) return 0;
     var l = param[2], x = param[1], match = caml_call1(f, x);
     if(match) break;
     param = l;
    }
    var
     v = match[1],
     block = [0, v, 24029],
     dst = block,
     offset = 1,
     param$0 = l;
    for(;;){
     if(! param$0){dst[offset + 1] = 0; return block;}
     var l$0 = param$0[2], x$0 = param$0[1], match$0 = caml_call1(f, x$0);
     if(match$0){
      var v$0 = match$0[1], dst$0 = [0, v$0, 24029];
      dst[offset + 1] = dst$0;
      dst = dst$0;
      offset = 1;
      param$0 = l$0;
     }
     else
      param$0 = l$0;
    }
   }
   function concat_map(f, param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var xs = param[2], x = param[1], ys = caml_call1(f, x);
     if(ys) break;
     param = xs;
    }
    var
     ys$1 = ys[2],
     y = ys[1],
     xs$1 = xs,
     ys$4 = ys$1,
     offset$0 = 1,
     block = [0, y, 24029],
     dst$1 = block;
    for(;;){
     var dst = dst$1, offset = offset$0, ys$2 = ys$4;
     for(;;){
      if(! ys$2){
       if(xs$1){
        var xs$0 = xs$1[2], x$0 = xs$1[1], ys$0 = caml_call1(f, x$0);
        xs$1 = xs$0;
        ys$4 = ys$0;
        offset$0 = offset;
        dst$1 = dst;
        break;
       }
       dst[offset + 1] = 0;
       return block;
      }
      var ys$3 = ys$2[2], y$0 = ys$2[1], dst$0 = [0, y$0, 24029];
      dst[offset + 1] = dst$0;
      dst = dst$0;
      offset = 1;
      ys$2 = ys$3;
     }
    }
   }
   function fold_left_map(f, accu, l){
    var accu$0 = accu, l_accu = 0, param = l;
    for(;;){
     if(! param) return [0, accu$0, rev(l_accu)];
     var
      l$0 = param[2],
      x = param[1],
      match = caml_call2(f, accu$0, x),
      x$0 = match[2],
      accu$1 = match[1],
      l_accu$0 = [0, x$0, l_accu];
     accu$0 = accu$1;
     l_accu = l_accu$0;
     param = l$0;
    }
   }
   function partition(p, l){
    var yes = 0, no = 0, param = l;
    for(;;){
     if(! param){var a = rev(no); return [0, rev(yes), a];}
     var l$0 = param[2], x = param[1];
     if(caml_call1(p, x)){
      var yes$0 = [0, x, yes];
      yes = yes$0;
      param = l$0;
     }
     else{var no$0 = [0, x, no]; no = no$0; param = l$0;}
    }
   }
   function partition_map(p, l){
    var left = 0, right = 0, param = l;
    for(;;){
     if(! param){var a = rev(right); return [0, rev(left), a];}
     var l$0 = param[2], x = param[1], match = caml_call1(p, x);
     if(0 === match[0]){
      var v = match[1], left$0 = [0, v, left];
      left = left$0;
      param = l$0;
     }
     else{
      var v$0 = match[1], right$0 = [0, v$0, right];
      right = right$0;
      param = l$0;
     }
    }
   }
   var a = [0, 0, 0];
   function split(param){
    if(! param) return a;
    var
     l = param[2],
     match = param[1],
     y = match[2],
     x = match[1],
     match$0 = split(l),
     ry = match$0[2],
     rx = match$0[1];
    return [0, [0, x, rx], [0, y, ry]];
   }
   function combine(l1, l2){
    if(l1){
     if(l2){
      var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1];
      return [0, [0, a1, a2], combine(l1$0, l2$0)];
     }
    }
    else if(! l2) return 0;
    return Stdlib[1].call(null, "List.combine");
   }
   function merge(cmp, l1, l2){
    if(! l1) return l2;
    if(! l2) return l1;
    var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1];
    return 0 < caml_call2(cmp, h1, h2)
            ? [0, h2, merge(cmp, l1, t2)]
            : [0, h1, merge(cmp, t1, l2)];
   }
   function stable_sort(cmp, l){
    function sort(n, l){
     if(2 === n){
      if(l){
       var match = l[2];
       if(match){
        var
         tl = match[2],
         x2 = match[1],
         x1 = l[1],
         s =
           0 < caml_call2(cmp, x1, x2)
            ? [0, x2, [0, x1, 0]]
            : [0, x1, [0, x2, 0]];
        return [0, s, tl];
       }
      }
     }
     else if(3 === n && l){
      var a = l[2];
      if(a){
       var match$2 = a[2];
       if(match$2){
        var
         tl$1 = match$2[2],
         x3 = match$2[1],
         x2$0 = a[1],
         x1$0 = l[1],
         s$0 =
           0 < caml_call2(cmp, x1$0, x2$0)
            ? 0
              < caml_call2(cmp, x1$0, x3)
              ? 0
                < caml_call2(cmp, x2$0, x3)
                ? [0, x3, [0, x2$0, [0, x1$0, 0]]]
                : [0, x2$0, [0, x3, [0, x1$0, 0]]]
              : [0, x2$0, [0, x1$0, [0, x3, 0]]]
            : 0
              < caml_call2(cmp, x2$0, x3)
              ? 0
                < caml_call2(cmp, x1$0, x3)
                ? [0, x3, [0, x1$0, [0, x2$0, 0]]]
                : [0, x1$0, [0, x3, [0, x2$0, 0]]]
              : [0, x1$0, [0, x2$0, [0, x3, 0]]];
        return [0, s$0, tl$1];
       }
      }
     }
     var
      n1 = n >> 1,
      n2 = n - n1 | 0,
      match$0 = rev_sort(n1, l),
      l2$0 = match$0[2],
      s1 = match$0[1],
      match$1 = rev_sort(n2, l2$0),
      tl$0 = match$1[2],
      s2 = match$1[1],
      l1 = s1,
      l2 = s2,
      accu = 0;
     for(;;){
      if(l1){
       if(l2){
        var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1];
        if(0 < caml_call2(cmp, h1, h2)){
         var accu$0 = [0, h1, accu];
         l1 = t1;
         accu = accu$0;
         continue;
        }
        var accu$1 = [0, h2, accu];
        l2 = t2;
        accu = accu$1;
        continue;
       }
       var b = rev_append(l1, accu);
      }
      else
       var b = rev_append(l2, accu);
      return [0, b, tl$0];
     }
    }
    function rev_sort(n, l){
     if(2 === n){
      if(l){
       var match = l[2];
       if(match){
        var
         tl = match[2],
         x2 = match[1],
         x1 = l[1],
         s =
           0 < caml_call2(cmp, x1, x2)
            ? [0, x1, [0, x2, 0]]
            : [0, x2, [0, x1, 0]];
        return [0, s, tl];
       }
      }
     }
     else if(3 === n && l){
      var a = l[2];
      if(a){
       var match$2 = a[2];
       if(match$2){
        var
         tl$1 = match$2[2],
         x3 = match$2[1],
         x2$0 = a[1],
         x1$0 = l[1],
         s$0 =
           0 < caml_call2(cmp, x1$0, x2$0)
            ? 0
              < caml_call2(cmp, x2$0, x3)
              ? [0, x1$0, [0, x2$0, [0, x3, 0]]]
              : 0
                < caml_call2(cmp, x1$0, x3)
                ? [0, x1$0, [0, x3, [0, x2$0, 0]]]
                : [0, x3, [0, x1$0, [0, x2$0, 0]]]
            : 0
              < caml_call2(cmp, x1$0, x3)
              ? [0, x2$0, [0, x1$0, [0, x3, 0]]]
              : 0
                < caml_call2(cmp, x2$0, x3)
                ? [0, x2$0, [0, x3, [0, x1$0, 0]]]
                : [0, x3, [0, x2$0, [0, x1$0, 0]]];
        return [0, s$0, tl$1];
       }
      }
     }
     var
      n1 = n >> 1,
      n2 = n - n1 | 0,
      match$0 = sort(n1, l),
      l2$0 = match$0[2],
      s1 = match$0[1],
      match$1 = sort(n2, l2$0),
      tl$0 = match$1[2],
      s2 = match$1[1],
      l1 = s1,
      l2 = s2,
      accu = 0;
     for(;;){
      if(l1){
       if(l2){
        var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1];
        if(0 < caml_call2(cmp, h1, h2)){
         var accu$0 = [0, h2, accu];
         l2 = t2;
         accu = accu$0;
         continue;
        }
        var accu$1 = [0, h1, accu];
        l1 = t1;
        accu = accu$1;
        continue;
       }
       var b = rev_append(l1, accu);
      }
      else
       var b = rev_append(l2, accu);
      return [0, b, tl$0];
     }
    }
    var len = length(l);
    return 2 <= len ? sort(len, l)[1] : l;
   }
   function sort_uniq(cmp, l){
    function sort(n, l){
     if(2 === n){
      if(l){
       var match = l[2];
       if(match){
        var
         tl = match[2],
         x2 = match[1],
         x1 = l[1],
         c$0 = caml_call2(cmp, x1, x2),
         s =
           0 === c$0
            ? [0, x1, 0]
            : 0 <= c$0 ? [0, x2, [0, x1, 0]] : [0, x1, [0, x2, 0]];
        return [0, s, tl];
       }
      }
     }
     else if(3 === n && l){
      var a = l[2];
      if(a){
       var match$2 = a[2];
       if(match$2){
        var
         tl$1 = match$2[2],
         x3 = match$2[1],
         x2$0 = a[1],
         x1$0 = l[1],
         c$1 = caml_call2(cmp, x1$0, x2$0);
        if(0 === c$1)
         var
          c$2 = caml_call2(cmp, x2$0, x3),
          s$0 =
            0 === c$2
             ? [0, x2$0, 0]
             : 0 <= c$2 ? [0, x3, [0, x2$0, 0]] : [0, x2$0, [0, x3, 0]];
        else if(0 <= c$1){
         var c$3 = caml_call2(cmp, x1$0, x3);
         if(0 === c$3)
          var s$0 = [0, x2$0, [0, x1$0, 0]];
         else if(0 <= c$3)
          var
           c$4 = caml_call2(cmp, x2$0, x3),
           s$0 =
             0 === c$4
              ? [0, x2$0, [0, x1$0, 0]]
              : 0
                <= c$4
                ? [0, x3, [0, x2$0, [0, x1$0, 0]]]
                : [0, x2$0, [0, x3, [0, x1$0, 0]]];
         else
          var s$0 = [0, x2$0, [0, x1$0, [0, x3, 0]]];
        }
        else{
         var c$5 = caml_call2(cmp, x2$0, x3);
         if(0 === c$5)
          var s$0 = [0, x1$0, [0, x2$0, 0]];
         else if(0 <= c$5)
          var
           c$6 = caml_call2(cmp, x1$0, x3),
           s$0 =
             0 === c$6
              ? [0, x1$0, [0, x2$0, 0]]
              : 0
                <= c$6
                ? [0, x3, [0, x1$0, [0, x2$0, 0]]]
                : [0, x1$0, [0, x3, [0, x2$0, 0]]];
         else
          var s$0 = [0, x1$0, [0, x2$0, [0, x3, 0]]];
        }
        return [0, s$0, tl$1];
       }
      }
     }
     var
      n1 = n >> 1,
      n2 = n - n1 | 0,
      match$0 = rev_sort(n1, l),
      l2$0 = match$0[2],
      s1 = match$0[1],
      match$1 = rev_sort(n2, l2$0),
      tl$0 = match$1[2],
      s2 = match$1[1],
      l1 = s1,
      l2 = s2,
      accu = 0;
     for(;;){
      if(l1){
       if(l2){
        var
         t2 = l2[2],
         h2 = l2[1],
         t1 = l1[2],
         h1 = l1[1],
         c = caml_call2(cmp, h1, h2);
        if(0 === c){
         var accu$0 = [0, h1, accu];
         l1 = t1;
         l2 = t2;
         accu = accu$0;
         continue;
        }
        if(0 < c){
         var accu$1 = [0, h1, accu];
         l1 = t1;
         accu = accu$1;
         continue;
        }
        var accu$2 = [0, h2, accu];
        l2 = t2;
        accu = accu$2;
        continue;
       }
       var b = rev_append(l1, accu);
      }
      else
       var b = rev_append(l2, accu);
      return [0, b, tl$0];
     }
    }
    function rev_sort(n, l){
     if(2 === n){
      if(l){
       var match = l[2];
       if(match){
        var
         tl = match[2],
         x2 = match[1],
         x1 = l[1],
         c$0 = caml_call2(cmp, x1, x2),
         s =
           0 === c$0
            ? [0, x1, 0]
            : 0 < c$0 ? [0, x1, [0, x2, 0]] : [0, x2, [0, x1, 0]];
        return [0, s, tl];
       }
      }
     }
     else if(3 === n && l){
      var a = l[2];
      if(a){
       var match$2 = a[2];
       if(match$2){
        var
         tl$1 = match$2[2],
         x3 = match$2[1],
         x2$0 = a[1],
         x1$0 = l[1],
         c$1 = caml_call2(cmp, x1$0, x2$0);
        if(0 === c$1)
         var
          c$2 = caml_call2(cmp, x2$0, x3),
          s$0 =
            0 === c$2
             ? [0, x2$0, 0]
             : 0 < c$2 ? [0, x2$0, [0, x3, 0]] : [0, x3, [0, x2$0, 0]];
        else if(0 < c$1){
         var c$3 = caml_call2(cmp, x2$0, x3);
         if(0 === c$3)
          var s$0 = [0, x1$0, [0, x2$0, 0]];
         else if(0 < c$3)
          var s$0 = [0, x1$0, [0, x2$0, [0, x3, 0]]];
         else
          var
           c$4 = caml_call2(cmp, x1$0, x3),
           s$0 =
             0 === c$4
              ? [0, x1$0, [0, x2$0, 0]]
              : 0
                < c$4
                ? [0, x1$0, [0, x3, [0, x2$0, 0]]]
                : [0, x3, [0, x1$0, [0, x2$0, 0]]];
        }
        else{
         var c$5 = caml_call2(cmp, x1$0, x3);
         if(0 === c$5)
          var s$0 = [0, x2$0, [0, x1$0, 0]];
         else if(0 < c$5)
          var s$0 = [0, x2$0, [0, x1$0, [0, x3, 0]]];
         else
          var
           c$6 = caml_call2(cmp, x2$0, x3),
           s$0 =
             0 === c$6
              ? [0, x2$0, [0, x1$0, 0]]
              : 0
                < c$6
                ? [0, x2$0, [0, x3, [0, x1$0, 0]]]
                : [0, x3, [0, x2$0, [0, x1$0, 0]]];
        }
        return [0, s$0, tl$1];
       }
      }
     }
     var
      n1 = n >> 1,
      n2 = n - n1 | 0,
      match$0 = sort(n1, l),
      l2$0 = match$0[2],
      s1 = match$0[1],
      match$1 = sort(n2, l2$0),
      tl$0 = match$1[2],
      s2 = match$1[1],
      l1 = s1,
      l2 = s2,
      accu = 0;
     for(;;){
      if(l1){
       if(l2){
        var
         t2 = l2[2],
         h2 = l2[1],
         t1 = l1[2],
         h1 = l1[1],
         c = caml_call2(cmp, h1, h2);
        if(0 === c){
         var accu$0 = [0, h1, accu];
         l1 = t1;
         l2 = t2;
         accu = accu$0;
         continue;
        }
        if(0 <= c){
         var accu$1 = [0, h2, accu];
         l2 = t2;
         accu = accu$1;
         continue;
        }
        var accu$2 = [0, h1, accu];
        l1 = t1;
        accu = accu$2;
        continue;
       }
       var b = rev_append(l1, accu);
      }
      else
       var b = rev_append(l2, accu);
      return [0, b, tl$0];
     }
    }
    var len = length(l);
    return 2 <= len ? sort(len, l)[1] : l;
   }
   function compare_lengths(l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(! l1) return l2 ? -1 : 0;
     if(! l2) return 1;
     var l2$0 = l2[2], l1$0 = l1[2];
     l1 = l1$0;
     l2 = l2$0;
    }
   }
   function compare_length_with(l$1, n$1){
    var l = l$1, n = n$1;
    for(;;){
     if(! l) return 0 === n ? 0 : 0 < n ? -1 : 1;
     var l$0 = l[2];
     if(0 >= n) return 1;
     var n$0 = n - 1 | 0;
     l = l$0;
     n = n$0;
    }
   }
   function is_empty(param){return param ? 0 : 1;}
   function equal(eq, l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(l1){
      if(l2){
       var
        l2$0 = l2[2],
        a2 = l2[1],
        l1$0 = l1[2],
        a1 = l1[1],
        a = caml_call2(eq, a1, a2);
       if(! a) return a;
       l1 = l1$0;
       l2 = l2$0;
       continue;
      }
     }
     else if(! l2) return 1;
     return 0;
    }
   }
   function compare(cmp, l1$1, l2$1){
    var l1 = l1$1, l2 = l2$1;
    for(;;){
     if(! l1) return l2 ? -1 : 0;
     var l1$0 = l1[2], a1 = l1[1];
     if(! l2) return 1;
     var l2$0 = l2[2], a2 = l2[1], c = caml_call2(cmp, a1, a2);
     if(0 !== c) return c;
     l1 = l1$0;
     l2 = l2$0;
    }
   }
   function to_seq(l){
    function aux(l, param){
     if(! l) return 0;
     var tail = l[2], x = l[1];
     return [0, x, function(a){return aux(tail, a);}];
    }
    return function(a){return aux(l, a);};
   }
   function of_seq(seq){
    var match = caml_call1(seq, 0);
    if(! match) return 0;
    var seq$0 = match[2], x1 = match[1], match$0 = caml_call1(seq$0, 0);
    if(! match$0) return [0, x1, 0];
    var
     seq$1 = match$0[2],
     x2 = match$0[1],
     block = [0, x2, 24029],
     dst = block,
     offset = 1,
     seq$2 = seq$1;
    for(;;){
     var match$1 = caml_call1(seq$2, 0);
     if(match$1){
      var
       seq$3 = match$1[2],
       x1$0 = match$1[1],
       match$2 = caml_call1(seq$3, 0);
      if(match$2){
       var seq$4 = match$2[2], x2$0 = match$2[1], dst$0 = [0, x2$0, 24029];
       dst[offset + 1] = [0, x1$0, dst$0];
       dst = dst$0;
       offset = 1;
       seq$2 = seq$4;
       continue;
      }
      dst[offset + 1] = [0, x1$0, 0];
     }
     else
      dst[offset + 1] = 0;
     return [0, x1, block];
    }
   }
   runtime.caml_register_global
    (17,
     [0,
      length,
      compare_lengths,
      compare_length_with,
      is_empty,
      cons,
      hd,
      tl,
      nth,
      nth_opt,
      rev,
      init,
      append,
      rev_append,
      flatten,
      flatten,
      equal,
      compare,
      iter,
      iteri,
      map,
      mapi,
      rev_map,
      filter_map,
      concat_map,
      fold_left_map,
      fold_left,
      fold_right,
      iter2,
      map2,
      rev_map2,
      fold_left2,
      fold_right2,
      for_all,
      exists,
      for_all2,
      exists2,
      mem,
      memq,
      find,
      find_opt,
      find_index,
      find_map,
      find_mapi,
      find_all,
      find_all,
      filteri,
      partition,
      partition_map,
      assoc,
      assoc_opt,
      assq,
      assq_opt,
      mem_assoc,
      mem_assq,
      remove_assoc,
      remove_assq,
      split,
      combine,
      stable_sort,
      stable_sort,
      stable_sort,
      sort_uniq,
      merge,
      to_seq,
      of_seq],
     "Stdlib__List");
   return;
  }
  (globalThis));

//# 3660 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Int:[N,N,N,F(1)*,N,N,F(1)*,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*,F(2)*,F(1)*]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime, caml_hash = runtime.caml_hash;
   function abs(x){return 0 <= x ? x : - x | 0;}
   function lognot(x){return x ^ -1;}
   function equal(b, a){return b === a ? 1 : 0;}
   var compare = runtime.caml_int_compare;
   function min(x, y){return x <= y ? x : y;}
   function max(x, y){return y <= x ? x : y;}
   function to_string(x){return "" + x;}
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function hash(x){return caml_hash(10, 100, 0, x);}
   runtime.caml_register_global
    (1,
     [0,
      0,
      1,
      -1,
      abs,
      2147483647,
      -2147483648,
      lognot,
      equal,
      compare,
      min,
      max,
      to_string,
      seeded_hash,
      hash],
     "Stdlib__Int");
   return;
  }
  (globalThis));

//# 3698 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Bytes:[F(2),F(2),N,F(1),F(1),F(1),F(3),F(3),F(3),F(4),F(5),F(5),F(2),F(2),F(2),F(2),F(2),F(2),F(3),F(3),F(2),F(2),F(1),F(1),F(2),F(2),F(2),F(2),F(3),F(3),F(3),F(3),F(2),F(3),F(3),F(1),F(1),F(1),F(1),F(2)*,F(2)*,F(2),F(2),F(1),F(1)*,F(2),F(1)*->F(1),F(1)*->F(1),F(1),F(2),F(3),F(1),F(2),F(3),F(1),F(2),F(3),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_blit_bytes = runtime.caml_blit_bytes,
    caml_bswap16 = runtime.caml_bswap16,
    caml_bytes_get = runtime.caml_bytes_get,
    caml_bytes_get16 = runtime.caml_bytes_get16,
    caml_bytes_get32 = runtime.caml_bytes_get32,
    caml_bytes_get64 = runtime.caml_bytes_get64,
    caml_bytes_of_string = runtime.caml_bytes_of_string,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_bytes_set16 = runtime.caml_bytes_set16,
    caml_bytes_set32 = runtime.caml_bytes_set32,
    caml_bytes_set64 = runtime.caml_bytes_set64,
    caml_bytes_unsafe_get = runtime.caml_bytes_unsafe_get,
    caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_fill_bytes = runtime.caml_fill_bytes,
    caml_int32_bswap = runtime.caml_int32_bswap,
    caml_int64_bswap = runtime.caml_int64_bswap,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length,
    caml_string_of_bytes = runtime.caml_string_of_bytes,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Uchar = global_data.Stdlib__Uchar,
    Assert_failure = global_data.Assert_failure,
    Stdlib_Sys = global_data.Stdlib__Sys,
    Stdlib_Int = global_data.Stdlib__Int,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_Char = global_data.Stdlib__Char;
   function make(n, c){
    var s = caml_create_bytes(n);
    caml_fill_bytes(s, 0, n, c);
    return s;
   }
   function init(n, f){
    var s = caml_create_bytes(n), a = n - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_bytes_unsafe_set(s, i, caml_call1(f, i));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return s;
   }
   var empty = caml_create_bytes(0);
   function copy(s){
    var len = caml_ml_bytes_length(s), r = caml_create_bytes(len);
    caml_blit_bytes(s, 0, r, 0, len);
    return r;
   }
   function to_string(b){return caml_string_of_bytes(copy(b));}
   function of_string(s){return copy(caml_bytes_of_string(s));}
   function sub(s, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs){
     var r = caml_create_bytes(len);
     caml_blit_bytes(s, ofs, r, 0, len);
     return r;
    }
    return Stdlib[1].call(null, "String.sub / Bytes.sub");
   }
   function sub_string(b, ofs, len){
    return caml_string_of_bytes(sub(b, ofs, len));
   }
   function symbol(a, b){
    var c = a + b | 0, d = b < 0, match = c < 0;
    a:
    {
     if(a < 0){if(! d || match) break a;} else if(d || ! match) break a;
     return Stdlib[1].call(null, "Bytes.extend");
    }
    return c;
   }
   function extend(s, left, right){
    var
     len = symbol(symbol(caml_ml_bytes_length(s), left), right),
     r = caml_create_bytes(len);
    if(0 <= left)
     var dstoff = left, srcoff = 0;
    else
     var dstoff = 0, srcoff = - left | 0;
    var
     cpylen =
       Stdlib_Int[10].call
        (null, caml_ml_bytes_length(s) - srcoff | 0, len - dstoff | 0);
    if(0 < cpylen) caml_blit_bytes(s, srcoff, r, dstoff, cpylen);
    return r;
   }
   function fill(s, ofs, len, c){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs)
     return caml_fill_bytes(s, ofs, len, c);
    return Stdlib[1].call(null, "String.fill / Bytes.fill");
   }
   function blit(s1, ofs1, s2, ofs2, len){
    if
     (0 <= len
      &&
       0 <= ofs1
       &&
        (caml_ml_bytes_length(s1) - len | 0) >= ofs1
        && 0 <= ofs2 && (caml_ml_bytes_length(s2) - len | 0) >= ofs2)
     return caml_blit_bytes(s1, ofs1, s2, ofs2, len);
    return Stdlib[1].call(null, "Bytes.blit");
   }
   function blit_string(s1, ofs1, s2, ofs2, len){
    if
     (0 <= len
      &&
       0 <= ofs1
       &&
        (runtime.caml_ml_string_length(s1) - len | 0) >= ofs1
        && 0 <= ofs2 && (caml_ml_bytes_length(s2) - len | 0) >= ofs2)
     return runtime.caml_blit_string(s1, ofs1, s2, ofs2, len);
    return Stdlib[1].call(null, "String.blit / Bytes.blit_string");
   }
   function iter(f, a){
    var b = caml_ml_bytes_length(a) - 1 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      caml_call1(f, caml_bytes_unsafe_get(a, i));
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function iteri(f, a){
    var b = caml_ml_bytes_length(a) - 1 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      caml_call2(f, i, caml_bytes_unsafe_get(a, i));
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function concat(sep, l){
    if(! l) return empty;
    var seplen = caml_ml_bytes_length(sep);
    a:
    {
     var acc = 0, param = l, pos$1 = 0;
     for(;;){
      if(! param){var a = acc; break a;}
      var hd = param[1];
      if(! param[2]) break;
      var
       tl = param[2],
       x = (caml_ml_bytes_length(hd) + seplen | 0) + acc | 0;
      if(acc <= x){
       acc = x;
       param = tl;
      }
      else{acc = Stdlib[1].call(null, "Bytes.concat"); param = tl;}
     }
     var a = caml_ml_bytes_length(hd) + acc | 0;
    }
    var dst = caml_create_bytes(a), pos = pos$1, param$0 = l;
    for(;;){
     if(! param$0) return dst;
     var hd$0 = param$0[1];
     if(! param$0[2]){
      caml_blit_bytes(hd$0, 0, dst, pos, caml_ml_bytes_length(hd$0));
      return dst;
     }
     var tl$0 = param$0[2];
     caml_blit_bytes(hd$0, 0, dst, pos, caml_ml_bytes_length(hd$0));
     caml_blit_bytes
      (sep, 0, dst, pos + caml_ml_bytes_length(hd$0) | 0, seplen);
     var pos$0 = (pos + caml_ml_bytes_length(hd$0) | 0) + seplen | 0;
     pos = pos$0;
     param$0 = tl$0;
    }
   }
   function cat(s1, s2){
    var
     l1 = caml_ml_bytes_length(s1),
     l2 = caml_ml_bytes_length(s2),
     r = caml_create_bytes(l1 + l2 | 0);
    caml_blit_bytes(s1, 0, r, 0, l1);
    caml_blit_bytes(s2, 0, r, l1, l2);
    return r;
   }
   function is_space(param){
    var a = param - 9 | 0;
    a:
    {
     if(4 < a >>> 0){if(23 !== a) break a;} else if(2 === a) break a;
     return 1;
    }
    return 0;
   }
   function trim(s){
    var len = caml_ml_bytes_length(s), i = 0;
    for(;;){
     if(i >= len) break;
     if(! is_space(caml_bytes_unsafe_get(s, i))) break;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
    var j = len - 1 | 0;
    for(;;){
     if(i <= j && is_space(caml_bytes_unsafe_get(s, j))){var j$0 = j - 1 | 0; j = j$0; continue;}
     return i <= j ? sub(s, i, (j - i | 0) + 1 | 0) : empty;
    }
   }
   function unsafe_escape(s){
    var e = caml_ml_bytes_length(s) - 1 | 0, d = 0;
    if(e < 0)
     var n$0 = d;
    else{
     var n = d, i$0 = 0;
     for(;;){
      var match = caml_bytes_unsafe_get(s, i$0);
      a:
      {
       b:
       {
        c:
        {
         if(32 <= match){
          var a = match - 34 | 0;
          if(58 < a >>> 0){
           if(93 <= a) break c;
          }
          else if(56 < a - 1 >>> 0) break b;
          var b = 1;
          break a;
         }
         if(11 <= match){
          if(13 === match) break b;
         }
         else if(8 <= match) break b;
        }
        var b = 4;
        break a;
       }
       var b = 2;
      }
      var g = n + b | 0, j = i$0 + 1 | 0;
      if(e === i$0){var n$0 = g; break;}
      n = g;
      i$0 = j;
     }
    }
    if(n$0 === caml_ml_bytes_length(s)) return s;
    var s$0 = caml_create_bytes(n$0), f = caml_ml_bytes_length(s) - 1 | 0;
    if(f >= 0){
     var n$1 = 0, i = 0;
     for(;;){
      var c = caml_bytes_unsafe_get(s, i);
      a:
      {
       b:
       {
        c:
        {
         if(35 <= c){
          if(92 !== c){if(127 <= c) break b; break c;}
         }
         else{
          if(32 > c){
           if(14 <= c) break b;
           switch(c){
             case 8:
              caml_bytes_unsafe_set(s$0, n$1, 92);
              var n$2 = n$1 + 1 | 0;
              caml_bytes_unsafe_set(s$0, n$2, 98);
              var n$10 = n$2;
              break a;
             case 9:
              caml_bytes_unsafe_set(s$0, n$1, 92);
              var n$3 = n$1 + 1 | 0;
              caml_bytes_unsafe_set(s$0, n$3, 116);
              var n$10 = n$3;
              break a;
             case 10:
              caml_bytes_unsafe_set(s$0, n$1, 92);
              var n$4 = n$1 + 1 | 0;
              caml_bytes_unsafe_set(s$0, n$4, 110);
              var n$10 = n$4;
              break a;
             case 13:
              caml_bytes_unsafe_set(s$0, n$1, 92);
              var n$5 = n$1 + 1 | 0;
              caml_bytes_unsafe_set(s$0, n$5, 114);
              var n$10 = n$5;
              break a;
             default: break b;
           }
          }
          if(34 > c) break c;
         }
         caml_bytes_unsafe_set(s$0, n$1, 92);
         var n$9 = n$1 + 1 | 0;
         caml_bytes_unsafe_set(s$0, n$9, c);
         var n$10 = n$9;
         break a;
        }
        caml_bytes_unsafe_set(s$0, n$1, c);
        var n$10 = n$1;
        break a;
       }
       caml_bytes_unsafe_set(s$0, n$1, 92);
       var n$6 = n$1 + 1 | 0;
       caml_bytes_unsafe_set(s$0, n$6, 48 + (c / 100 | 0) | 0);
       var n$7 = n$6 + 1 | 0;
       caml_bytes_unsafe_set(s$0, n$7, 48 + ((c / 10 | 0) % 10 | 0) | 0);
       var n$8 = n$7 + 1 | 0;
       caml_bytes_unsafe_set(s$0, n$8, 48 + (c % 10 | 0) | 0);
       var n$10 = n$8;
      }
      var n$11 = n$10 + 1 | 0, h = i + 1 | 0;
      if(f === i) break;
      n$1 = n$11;
      i = h;
     }
    }
    return s$0;
   }
   function escaped(b){var b$0 = copy(b); return unsafe_escape(b$0);}
   function map(f, s){
    var l = caml_ml_bytes_length(s);
    if(0 === l) return s;
    var r = caml_create_bytes(l), a = l - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_bytes_unsafe_set(r, i, caml_call1(f, caml_bytes_unsafe_get(s, i)));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return r;
   }
   function mapi(f, s){
    var l = caml_ml_bytes_length(s);
    if(0 === l) return s;
    var r = caml_create_bytes(l), a = l - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_bytes_unsafe_set
       (r, i, caml_call2(f, i, caml_bytes_unsafe_get(s, i)));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return r;
   }
   function fold_left(f, x, a){
    var b = caml_ml_bytes_length(a) - 1 | 0;
    if(b < 0)
     var r$0 = x;
    else{
     var r = x, i = 0;
     for(;;){
      var c = caml_call2(f, r, caml_bytes_unsafe_get(a, i)), d = i + 1 | 0;
      if(b === i){var r$0 = c; break;}
      r = c;
      i = d;
     }
    }
    return r$0;
   }
   function fold_right(f, a, x){
    var b = caml_ml_bytes_length(a) - 1 | 0;
    if(b < 0)
     var r$0 = x;
    else{
     var r = x, i = b;
     for(;;){
      var c = caml_call2(f, caml_bytes_unsafe_get(a, i), r), d = i - 1 | 0;
      if(0 === i){var r$0 = c; break;}
      r = c;
      i = d;
     }
    }
    return r$0;
   }
   function exists(p, s){
    var n = caml_ml_bytes_length(s), i = 0;
    for(;;){
     if(i === n) return 0;
     if(caml_call1(p, caml_bytes_unsafe_get(s, i))) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function for_all(p, s){
    var n = caml_ml_bytes_length(s), i = 0;
    for(;;){
     if(i === n) return 1;
     if(! caml_call1(p, caml_bytes_unsafe_get(s, i))) return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function uppercase_ascii(s){return map(Stdlib_Char[4], s);}
   function lowercase_ascii(s){return map(Stdlib_Char[3], s);}
   function apply1(f, s){
    if(0 === caml_ml_bytes_length(s)) return s;
    var r = copy(s);
    caml_bytes_unsafe_set(r, 0, caml_call1(f, caml_bytes_unsafe_get(s, 0)));
    return r;
   }
   function capitalize_ascii(s){return apply1(Stdlib_Char[4], s);}
   function uncapitalize_ascii(s){return apply1(Stdlib_Char[3], s);}
   function starts_with(prefix, s){
    var
     len_s = caml_ml_bytes_length(s),
     len_pre = caml_ml_bytes_length(prefix),
     a = len_pre <= len_s ? 1 : 0;
    if(! a) return a;
    var i = 0;
    for(;;){
     if(i === len_pre) return 1;
     if(caml_bytes_unsafe_get(s, i) !== caml_bytes_unsafe_get(prefix, i))
      return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function ends_with(suffix, s){
    var
     len_s = caml_ml_bytes_length(s),
     len_suf = caml_ml_bytes_length(suffix),
     diff = len_s - len_suf | 0,
     a = 0 <= diff ? 1 : 0;
    if(! a) return a;
    var i = 0;
    for(;;){
     if(i === len_suf) return 1;
     if
      (caml_bytes_unsafe_get(s, diff + i | 0)
       !== caml_bytes_unsafe_get(suffix, i))
      return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function index_rec(s, lim, i$1, c){
    var i = i$1;
    for(;;){
     if(lim <= i) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     if(caml_bytes_unsafe_get(s, i) === c) return i;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function index(s, c){return index_rec(s, caml_ml_bytes_length(s), 0, c);}
   function index_rec_opt(s, lim, i$1, c){
    var i = i$1;
    for(;;){
     if(lim <= i) return 0;
     if(caml_bytes_unsafe_get(s, i) === c) return [0, i];
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function index_opt(s, c){
    return index_rec_opt(s, caml_ml_bytes_length(s), 0, c);
   }
   function index_from(s, i, c){
    var l = caml_ml_bytes_length(s);
    if(0 <= i && l >= i) return index_rec(s, l, i, c);
    return Stdlib[1].call(null, "String.index_from / Bytes.index_from");
   }
   function index_from_opt(s, i, c){
    var l = caml_ml_bytes_length(s);
    if(0 <= i && l >= i) return index_rec_opt(s, l, i, c);
    return Stdlib[1].call
            (null, "String.index_from_opt / Bytes.index_from_opt");
   }
   function rindex_rec(s, i$1, c){
    var i = i$1;
    for(;;){
     if(0 > i) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     if(caml_bytes_unsafe_get(s, i) === c) return i;
     var i$0 = i - 1 | 0;
     i = i$0;
    }
   }
   function rindex(s, c){
    return rindex_rec(s, caml_ml_bytes_length(s) - 1 | 0, c);
   }
   function rindex_from(s, i, c){
    if(-1 <= i && caml_ml_bytes_length(s) > i) return rindex_rec(s, i, c);
    return Stdlib[1].call(null, "String.rindex_from / Bytes.rindex_from");
   }
   function rindex_rec_opt(s, i$1, c){
    var i = i$1;
    for(;;){
     if(0 > i) return 0;
     if(caml_bytes_unsafe_get(s, i) === c) return [0, i];
     var i$0 = i - 1 | 0;
     i = i$0;
    }
   }
   function rindex_opt(s, c){
    return rindex_rec_opt(s, caml_ml_bytes_length(s) - 1 | 0, c);
   }
   function rindex_from_opt(s, i, c){
    if(-1 <= i && caml_ml_bytes_length(s) > i) return rindex_rec_opt(s, i, c);
    return Stdlib[1].call
            (null, "String.rindex_from_opt / Bytes.rindex_from_opt");
   }
   function contains_from(s, i, c){
    var l = caml_ml_bytes_length(s);
    if(0 <= i && l >= i)
     try{index_rec(s, l, i, c); return 1;}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn === Stdlib[8]) return 0;
      throw caml_maybe_attach_backtrace(exn, 0);
     }
    return Stdlib[1].call(null, "String.contains_from / Bytes.contains_from");
   }
   function contains(s, c){return contains_from(s, 0, c);}
   function rcontains_from(s, i, c){
    if(0 <= i && caml_ml_bytes_length(s) > i)
     try{rindex_rec(s, i, c); return 1;}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn === Stdlib[8]) return 0;
      throw caml_maybe_attach_backtrace(exn, 0);
     }
    return Stdlib[1].call
            (null, "String.rcontains_from / Bytes.rcontains_from");
   }
   var compare = runtime.caml_bytes_compare;
   function split_on_char(sep, s){
    var
     b = caml_ml_bytes_length(s),
     c = caml_ml_bytes_length(s) - 1 | 0,
     a = 0;
    if(c < 0)
     var j$1 = b, r$1 = a;
    else{
     var j = b, r = a, i = c;
     for(;;){
      if(caml_bytes_unsafe_get(s, i) === sep)
       var j$0 = i, r$0 = [0, sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), r];
      else
       var j$0 = j, r$0 = r;
      var d = i - 1 | 0;
      if(0 === i){var j$1 = j$0, r$1 = r$0; break;}
      j = j$0;
      r = r$0;
      i = d;
     }
    }
    return [0, sub(s, 0, j$1), r$1];
   }
   function to_seq(s){
    function aux(i, param){
     if(i === caml_ml_bytes_length(s)) return 0;
     var x = caml_bytes_get(s, i), a = i + 1 | 0;
     return [0, x, function(b){return aux(a, b);}];
    }
    return function(a){return aux(0, a);};
   }
   function to_seqi(s){
    function aux(i, param){
     if(i === caml_ml_bytes_length(s)) return 0;
     var x = caml_bytes_get(s, i), a = i + 1 | 0;
     return [0, [0, i, x], function(b){return aux(a, b);}];
    }
    return function(a){return aux(0, a);};
   }
   function of_seq(i){
    var buf = [0, make(256, 0)], n = [0, 0];
    Stdlib_Seq[4].call
     (null,
      function(c){
       if(n[1] === caml_ml_bytes_length(buf[1])){
        var
         new_len =
           Stdlib_Int[10].call
            (null, 2 * caml_ml_bytes_length(buf[1]) | 0, Stdlib_Sys[12]);
        if(caml_ml_bytes_length(buf[1]) === new_len)
         Stdlib[2].call(null, "Bytes.of_seq: cannot grow bytes");
        var new_buf = make(new_len, 0);
        blit(buf[1], 0, new_buf, 0, n[1]);
        buf[1] = new_buf;
       }
       caml_bytes_set(buf[1], n[1], c);
       n[1]++;
       return 0;
      },
      i);
    return sub(buf[1], 0, n[1]);
   }
   function unsafe_get_uint16_le(b, i){
    return Stdlib_Sys[11]
            ? caml_bswap16(caml_bytes_get16(b, i))
            : caml_bytes_get16(b, i);
   }
   function unsafe_get_uint16_be(b, i){
    return Stdlib_Sys[11]
            ? caml_bytes_get16(b, i)
            : caml_bswap16(caml_bytes_get16(b, i));
   }
   function get_int8(b, i){
    var a = Stdlib_Sys[10] - 8 | 0, c = Stdlib_Sys[10] - 8 | 0;
    return caml_bytes_get(b, i) << c >> a;
   }
   function get_uint16_le(b, i){
    return Stdlib_Sys[11]
            ? caml_bswap16(caml_bytes_get16(b, i))
            : caml_bytes_get16(b, i);
   }
   function get_uint16_be(b, i){
    return Stdlib_Sys[11]
            ? caml_bytes_get16(b, i)
            : caml_bswap16(caml_bytes_get16(b, i));
   }
   function get_int16_ne(b, i){
    var a = Stdlib_Sys[10] - 16 | 0, c = Stdlib_Sys[10] - 16 | 0;
    return caml_bytes_get16(b, i) << c >> a;
   }
   function get_int16_le(b, i){
    var a = Stdlib_Sys[10] - 16 | 0, c = Stdlib_Sys[10] - 16 | 0;
    return get_uint16_le(b, i) << c >> a;
   }
   function get_int16_be(b, i){
    var a = Stdlib_Sys[10] - 16 | 0, c = Stdlib_Sys[10] - 16 | 0;
    return get_uint16_be(b, i) << c >> a;
   }
   function get_int32_le(b, i){
    return Stdlib_Sys[11]
            ? caml_int32_bswap(caml_bytes_get32(b, i))
            : caml_bytes_get32(b, i);
   }
   function get_int32_be(b, i){
    return Stdlib_Sys[11]
            ? caml_bytes_get32(b, i)
            : caml_int32_bswap(caml_bytes_get32(b, i));
   }
   function get_int64_le(b, i){
    return Stdlib_Sys[11]
            ? caml_int64_bswap(caml_bytes_get64(b, i))
            : caml_bytes_get64(b, i);
   }
   function get_int64_be(b, i){
    return Stdlib_Sys[11]
            ? caml_bytes_get64(b, i)
            : caml_int64_bswap(caml_bytes_get64(b, i));
   }
   function unsafe_set_uint16_le(b, i, x){
    if(Stdlib_Sys[11]){caml_bytes_set16(b, i, caml_bswap16(x)); return;}
    caml_bytes_set16(b, i, x);
   }
   function unsafe_set_uint16_be(b, i, x){
    if(Stdlib_Sys[11]){caml_bytes_set16(b, i, x); return;}
    caml_bytes_set16(b, i, caml_bswap16(x));
   }
   function set_int16_le(b, i, x){
    return Stdlib_Sys[11]
            ? caml_bytes_set16(b, i, caml_bswap16(x))
            : caml_bytes_set16(b, i, x);
   }
   function set_int16_be(b, i, x){
    return Stdlib_Sys[11]
            ? caml_bytes_set16(b, i, x)
            : caml_bytes_set16(b, i, caml_bswap16(x));
   }
   function set_int32_le(b, i, x){
    return Stdlib_Sys[11]
            ? caml_bytes_set32(b, i, caml_int32_bswap(x))
            : caml_bytes_set32(b, i, x);
   }
   function set_int32_be(b, i, x){
    return Stdlib_Sys[11]
            ? caml_bytes_set32(b, i, x)
            : caml_bytes_set32(b, i, caml_int32_bswap(x));
   }
   function set_int64_le(b, i, x){
    return Stdlib_Sys[11]
            ? caml_bytes_set64(b, i, caml_int64_bswap(x))
            : caml_bytes_set64(b, i, x);
   }
   function set_int64_be(b, i, x){
    return Stdlib_Sys[11]
            ? caml_bytes_set64(b, i, x)
            : caml_bytes_set64(b, i, caml_int64_bswap(x));
   }
   var dec_invalid = Stdlib_Uchar[22];
   function dec_ret(n, u){
    var a = Stdlib_Uchar[9].call(null, u);
    return Stdlib_Uchar[21].call(null, n, a);
   }
   function not_in_x80_to_xBF(b){return 2 !== (b >>> 6 | 0) ? 1 : 0;}
   function not_in_xA0_to_xBF(b){return 5 !== (b >>> 5 | 0) ? 1 : 0;}
   function not_in_x80_to_x9F(b){return 4 !== (b >>> 5 | 0) ? 1 : 0;}
   function not_in_x90_to_xBF(b){
    var a = b < 144 ? 1 : 0, c = a || (191 < b ? 1 : 0);
    return c;
   }
   function not_in_x80_to_x8F(b){return 8 !== (b >>> 4 | 0) ? 1 : 0;}
   function utf_8_uchar_3(b0, b1, b2){
    return (b0 & 15) << 12 | (b1 & 63) << 6 | b2 & 63;
   }
   function utf_8_uchar_4(b0, b1, b2, b3){
    return (b0 & 7) << 18 | (b1 & 63) << 12 | (b2 & 63) << 6 | b3 & 63;
   }
   function get_utf_8_uchar(b, i){
    var b0 = caml_bytes_get(b, i), max = caml_ml_bytes_length(b) - 1 | 0;
    a:
    {
     if(224 <= b0){
      if(237 <= b0){
       if(245 <= b0) break a;
       switch(b0 - 237 | 0){
         case 0:
          var i$0 = i + 1 | 0;
          if(max < i$0) return dec_invalid(1);
          var b1$4 = caml_bytes_unsafe_get(b, i$0);
          if(not_in_x80_to_x9F(b1$4)) return dec_invalid(1);
          var i$1 = i$0 + 1 | 0;
          if(max < i$1) return dec_invalid(2);
          var b2$3 = caml_bytes_unsafe_get(b, i$1);
          return not_in_x80_to_xBF(b2$3)
                  ? dec_invalid(2)
                  : dec_ret(3, utf_8_uchar_3(b0, b1$4, b2$3));
         case 3:
          var i$4 = i + 1 | 0;
          if(max < i$4) return dec_invalid(1);
          var b1$2 = caml_bytes_unsafe_get(b, i$4);
          if(not_in_x90_to_xBF(b1$2)) return dec_invalid(1);
          var i$5 = i$4 + 1 | 0;
          if(max < i$5) return dec_invalid(2);
          var b2$1 = caml_bytes_unsafe_get(b, i$5);
          if(not_in_x80_to_xBF(b2$1)) return dec_invalid(2);
          var i$6 = i$5 + 1 | 0;
          if(max < i$6) return dec_invalid(3);
          var b3$1 = caml_bytes_unsafe_get(b, i$6);
          return not_in_x80_to_xBF(b3$1)
                  ? dec_invalid(3)
                  : dec_ret(4, utf_8_uchar_4(b0, b1$2, b2$1, b3$1));
         case 7:
          var i$10 = i + 1 | 0;
          if(max < i$10) return dec_invalid(1);
          var b1$0 = caml_bytes_unsafe_get(b, i$10);
          if(not_in_x80_to_x8F(b1$0)) return dec_invalid(1);
          var i$11 = i$10 + 1 | 0;
          if(max < i$11) return dec_invalid(2);
          var b2 = caml_bytes_unsafe_get(b, i$11);
          if(not_in_x80_to_xBF(b2)) return dec_invalid(2);
          var i$12 = i$11 + 1 | 0;
          if(max < i$12) return dec_invalid(3);
          var b3 = caml_bytes_unsafe_get(b, i$12);
          return not_in_x80_to_xBF(b3)
                  ? dec_invalid(3)
                  : dec_ret(4, utf_8_uchar_4(b0, b1$0, b2, b3));
         case 1:
         case 2: break;
         default:
          var i$7 = i + 1 | 0;
          if(max < i$7) return dec_invalid(1);
          var b1$1 = caml_bytes_unsafe_get(b, i$7);
          if(not_in_x80_to_xBF(b1$1)) return dec_invalid(1);
          var i$8 = i$7 + 1 | 0;
          if(max < i$8) return dec_invalid(2);
          var b2$0 = caml_bytes_unsafe_get(b, i$8);
          if(not_in_x80_to_xBF(b2$0)) return dec_invalid(2);
          var i$9 = i$8 + 1 | 0;
          if(max < i$9) return dec_invalid(3);
          var b3$0 = caml_bytes_unsafe_get(b, i$9);
          return not_in_x80_to_xBF(b3$0)
                  ? dec_invalid(3)
                  : dec_ret(4, utf_8_uchar_4(b0, b1$1, b2$0, b3$0));
       }
      }
      else if(225 > b0){
       var i$13 = i + 1 | 0;
       if(max < i$13) return dec_invalid(1);
       var b1$5 = caml_bytes_unsafe_get(b, i$13);
       if(not_in_xA0_to_xBF(b1$5)) return dec_invalid(1);
       var i$14 = i$13 + 1 | 0;
       if(max < i$14) return dec_invalid(2);
       var b2$4 = caml_bytes_unsafe_get(b, i$14);
       return not_in_x80_to_xBF(b2$4)
               ? dec_invalid(2)
               : dec_ret(3, utf_8_uchar_3(b0, b1$5, b2$4));
      }
      var i$2 = i + 1 | 0;
      if(max < i$2) return dec_invalid(1);
      var b1$3 = caml_bytes_unsafe_get(b, i$2);
      if(not_in_x80_to_xBF(b1$3)) return dec_invalid(1);
      var i$3 = i$2 + 1 | 0;
      if(max < i$3) return dec_invalid(2);
      var b2$2 = caml_bytes_unsafe_get(b, i$3);
      return not_in_x80_to_xBF(b2$2)
              ? dec_invalid(2)
              : dec_ret(3, utf_8_uchar_3(b0, b1$3, b2$2));
     }
     if(128 > b0) return dec_ret(1, b0);
     if(194 <= b0){
      var i$15 = i + 1 | 0;
      if(max < i$15) return dec_invalid(1);
      var b1 = caml_bytes_unsafe_get(b, i$15);
      return not_in_x80_to_xBF(b1)
              ? dec_invalid(1)
              : dec_ret(2, (b0 & 31) << 6 | b1 & 63);
     }
    }
    return dec_invalid(1);
   }
   var
    cst_bytes_ml = "bytes.ml",
    a = [0, cst_bytes_ml, 679, 9],
    b = [0, cst_bytes_ml, 654, 20];
   function set_utf_8_uchar(b$0, i, u){
    function set(c, b, a){caml_bytes_unsafe_set(c, b, a);}
    var
     max = caml_ml_bytes_length(b$0) - 1 | 0,
     u$0 = Stdlib_Uchar[10].call(null, u);
    if(0 > u$0) throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
    if(127 >= u$0){caml_bytes_set(b$0, i, u$0); return 1;}
    if(2047 >= u$0){
     var last$1 = i + 1 | 0;
     return max < last$1
             ? 0
             : (caml_bytes_set
                (b$0, i, 192 | u$0 >>> 6 | 0),
               set(b$0, last$1, 128 | u$0 & 63),
               2);
    }
    if(65535 >= u$0){
     var last$0 = i + 2 | 0;
     return max < last$0
             ? 0
             : (caml_bytes_set
                (b$0, i, 224 | u$0 >>> 12 | 0),
               set(b$0, i + 1 | 0, 128 | (u$0 >>> 6 | 0) & 63),
               set(b$0, last$0, 128 | u$0 & 63),
               3);
    }
    if(1114111 < u$0)
     throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
    var last = i + 3 | 0;
    return max < last
            ? 0
            : (caml_bytes_set
               (b$0, i, 240 | u$0 >>> 18 | 0),
              set(b$0, i + 1 | 0, 128 | (u$0 >>> 12 | 0) & 63),
              set(b$0, i + 2 | 0, 128 | (u$0 >>> 6 | 0) & 63),
              set(b$0, last, 128 | u$0 & 63),
              4);
   }
   function is_valid_utf_8(b){
    var max = caml_ml_bytes_length(b) - 1 | 0, i = 0;
    for(;;){
     if(max < i) return 1;
     var match = caml_bytes_unsafe_get(b, i);
     a:
     {
      if(224 <= match){
       if(237 <= match){
        if(245 <= match) break a;
        switch(match - 237 | 0){
          case 0:
           var last = i + 2 | 0;
           if
            (max >= last
             &&
              !
              not_in_x80_to_x9F(caml_bytes_unsafe_get(b, i + 1 | 0))
              && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last))){var i$0 = last + 1 | 0; i = i$0; continue;}
           return 0;
          case 3:
           var last$1 = i + 3 | 0;
           if
            (max >= last$1
             &&
              !
              not_in_x90_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0))
              &&
               !
               not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0))
               && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$1))){var i$2 = last$1 + 1 | 0; i = i$2; continue;}
           return 0;
          case 7:
           var last$3 = i + 3 | 0;
           if
            (max >= last$3
             &&
              !
              not_in_x80_to_x8F(caml_bytes_unsafe_get(b, i + 1 | 0))
              &&
               !
               not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0))
               && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$3))){var i$4 = last$3 + 1 | 0; i = i$4; continue;}
           return 0;
          case 1:
          case 2: break;
          default:
           var last$2 = i + 3 | 0;
           if
            (max >= last$2
             &&
              !
              not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0))
              &&
               !
               not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0))
               && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$2))){var i$3 = last$2 + 1 | 0; i = i$3; continue;}
           return 0;
        }
       }
       else if(225 > match){
        var last$4 = i + 2 | 0;
        if
         (max >= last$4
          &&
           !
           not_in_xA0_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0))
           && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$4))){var i$5 = last$4 + 1 | 0; i = i$5; continue;}
        return 0;
       }
       var last$0 = i + 2 | 0;
       if
        (max >= last$0
         &&
          !
          not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0))
          && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$0))){var i$1 = last$0 + 1 | 0; i = i$1; continue;}
       return 0;
      }
      if(128 > match){var i$7 = i + 1 | 0; i = i$7; continue;}
      if(194 <= match){
       var last$5 = i + 1 | 0;
       if
        (max >= last$5
         && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$5))){var i$6 = last$5 + 1 | 0; i = i$6; continue;}
       return 0;
      }
     }
     return 0;
    }
   }
   var cst_index_out_of_bounds = "index out of bounds";
   function get_utf_16be_uchar(b, i){
    var max = caml_ml_bytes_length(b) - 1 | 0;
    if(0 <= i && max >= i){
     if(i === max) return dec_invalid(1);
     var hi = unsafe_get_uint16_be(b, i);
     if(55296 <= hi && 57343 >= hi){
      if(56319 < hi) return dec_invalid(2);
      var last = i + 3 | 0;
      if(max < last) return dec_invalid((max - i | 0) + 1 | 0);
      var lo = unsafe_get_uint16_be(b, i + 2 | 0);
      if(56320 <= lo && 57343 >= lo){
       var u = ((hi & 1023) << 10 | lo & 1023) + 65536 | 0;
       return dec_ret(4, u);
      }
      return dec_invalid(2);
     }
     return dec_ret(2, hi);
    }
    return Stdlib[1].call(null, cst_index_out_of_bounds);
   }
   var c = [0, cst_bytes_ml, 777, 9], d = [0, cst_bytes_ml, 766, 20];
   function set_utf_16be_uchar(b, i, u){
    var max = caml_ml_bytes_length(b) - 1 | 0;
    if(0 <= i && max >= i){
     var u$0 = Stdlib_Uchar[10].call(null, u);
     if(0 > u$0) throw caml_maybe_attach_backtrace([0, Assert_failure, d], 1);
     if(65535 >= u$0){
      var last$0 = i + 1 | 0;
      return max < last$0 ? 0 : (unsafe_set_uint16_be(b, i, u$0), 2);
     }
     if(1114111 < u$0)
      throw caml_maybe_attach_backtrace([0, Assert_failure, c], 1);
     var last = i + 3 | 0;
     if(max < last) return 0;
     var
      u$1 = u$0 - 65536 | 0,
      hi = 55296 | u$1 >>> 10 | 0,
      lo = 56320 | u$1 & 1023;
     unsafe_set_uint16_be(b, i, hi);
     unsafe_set_uint16_be(b, i + 2 | 0, lo);
     return 4;
    }
    return Stdlib[1].call(null, cst_index_out_of_bounds);
   }
   function is_valid_utf_16be(b){
    var max = caml_ml_bytes_length(b) - 1 | 0, i = 0;
    for(;;){
     if(max < i) return 1;
     if(i === max) return 0;
     var u = unsafe_get_uint16_be(b, i);
     if(55296 <= u && 57343 >= u){
      if(56319 < u) return 0;
      var last = i + 3 | 0;
      if(max < last) return 0;
      var u$0 = unsafe_get_uint16_be(b, i + 2 | 0);
      if(56320 <= u$0 && 57343 >= u$0){
       var i$1 = i + 4 | 0;
       i = i$1;
       continue;
      }
      return 0;
     }
     var i$0 = i + 2 | 0;
     i = i$0;
    }
   }
   function get_utf_16le_uchar(b, i){
    var max = caml_ml_bytes_length(b) - 1 | 0;
    if(0 <= i && max >= i){
     if(i === max) return dec_invalid(1);
     var hi = unsafe_get_uint16_le(b, i);
     if(55296 <= hi && 57343 >= hi){
      if(56319 < hi) return dec_invalid(2);
      var last = i + 3 | 0;
      if(max < last) return dec_invalid((max - i | 0) + 1 | 0);
      var lo = unsafe_get_uint16_le(b, i + 2 | 0);
      if(56320 <= lo && 57343 >= lo){
       var u = ((hi & 1023) << 10 | lo & 1023) + 65536 | 0;
       return dec_ret(4, u);
      }
      return dec_invalid(2);
     }
     return dec_ret(2, hi);
    }
    return Stdlib[1].call(null, cst_index_out_of_bounds);
   }
   var e = [0, cst_bytes_ml, 831, 9], f = [0, cst_bytes_ml, 820, 20];
   function set_utf_16le_uchar(b, i, u){
    var max = caml_ml_bytes_length(b) - 1 | 0;
    if(0 <= i && max >= i){
     var u$0 = Stdlib_Uchar[10].call(null, u);
     if(0 > u$0) throw caml_maybe_attach_backtrace([0, Assert_failure, f], 1);
     if(65535 >= u$0){
      var last$0 = i + 1 | 0;
      return max < last$0 ? 0 : (unsafe_set_uint16_le(b, i, u$0), 2);
     }
     if(1114111 < u$0)
      throw caml_maybe_attach_backtrace([0, Assert_failure, e], 1);
     var last = i + 3 | 0;
     if(max < last) return 0;
     var
      u$1 = u$0 - 65536 | 0,
      hi = 55296 | u$1 >>> 10 | 0,
      lo = 56320 | u$1 & 1023;
     unsafe_set_uint16_le(b, i, hi);
     unsafe_set_uint16_le(b, i + 2 | 0, lo);
     return 4;
    }
    return Stdlib[1].call(null, cst_index_out_of_bounds);
   }
   function is_valid_utf_16le(b){
    var max = caml_ml_bytes_length(b) - 1 | 0, i = 0;
    for(;;){
     if(max < i) return 1;
     if(i === max) return 0;
     var u = unsafe_get_uint16_le(b, i);
     if(55296 <= u && 57343 >= u){
      if(56319 < u) return 0;
      var last = i + 3 | 0;
      if(max < last) return 0;
      var u$0 = unsafe_get_uint16_le(b, i + 2 | 0);
      if(56320 <= u$0 && 57343 >= u$0){
       var i$1 = i + 4 | 0;
       i = i$1;
       continue;
      }
      return 0;
     }
     var i$0 = i + 2 | 0;
     i = i$0;
    }
   }
   var
    Stdlib_Bytes =
      [0,
       make,
       init,
       empty,
       copy,
       of_string,
       to_string,
       sub,
       sub_string,
       extend,
       fill,
       blit,
       blit_string,
       concat,
       cat,
       iter,
       iteri,
       map,
       mapi,
       fold_left,
       fold_right,
       for_all,
       exists,
       trim,
       escaped,
       index,
       index_opt,
       rindex,
       rindex_opt,
       index_from,
       index_from_opt,
       rindex_from,
       rindex_from_opt,
       contains,
       contains_from,
       rcontains_from,
       uppercase_ascii,
       lowercase_ascii,
       capitalize_ascii,
       uncapitalize_ascii,
       compare,
       runtime.caml_bytes_equal,
       starts_with,
       ends_with,
       caml_string_of_bytes,
       caml_bytes_of_string,
       split_on_char,
       to_seq,
       to_seqi,
       of_seq,
       get_utf_8_uchar,
       set_utf_8_uchar,
       is_valid_utf_8,
       get_utf_16be_uchar,
       set_utf_16be_uchar,
       is_valid_utf_16be,
       get_utf_16le_uchar,
       set_utf_16le_uchar,
       is_valid_utf_16le,
       caml_bytes_get,
       get_int8,
       caml_bytes_get16,
       get_uint16_be,
       get_uint16_le,
       get_int16_ne,
       get_int16_be,
       get_int16_le,
       caml_bytes_get32,
       get_int32_be,
       get_int32_le,
       caml_bytes_get64,
       get_int64_be,
       get_int64_le,
       caml_bytes_set,
       caml_bytes_set,
       caml_bytes_set16,
       set_int16_be,
       set_int16_le,
       caml_bytes_set16,
       set_int16_be,
       set_int16_le,
       caml_bytes_set32,
       set_int32_be,
       set_int32_le,
       caml_bytes_set64,
       set_int64_be,
       set_int64_le,
       unsafe_escape];
   runtime.caml_register_global(30, Stdlib_Bytes, "Stdlib__Bytes");
   return;
  }
  (globalThis));

//# 4897 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__String:[F(2),F(2),N,F(1),F(1),F(5),F(2),F(2)*,F(2)*,F(2)*,F(2),F(2),F(3),F(3),F(2),F(3),F(2),F(2),F(2),F(3),F(3),F(2),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(3),F(3),F(3),F(2),F(2),F(2),F(2),F(1)*,F(1)*,F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_blit_string = runtime.caml_blit_string,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_equal = runtime.caml_string_equal,
    caml_string_hash = runtime.caml_string_hash,
    caml_string_unsafe_get = runtime.caml_string_unsafe_get,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    bts = Stdlib_Bytes[44],
    bos = Stdlib_Bytes[45];
   function make(n, c){return bts(Stdlib_Bytes[1].call(null, n, c));}
   function init(n, f){return bts(Stdlib_Bytes[2].call(null, n, f));}
   var of_bytes = Stdlib_Bytes[6], to_bytes = Stdlib_Bytes[5];
   function sub(s, ofs, len){
    var a = bos(s);
    return bts(Stdlib_Bytes[7].call(null, a, ofs, len));
   }
   var blit = Stdlib_Bytes[12], cst = "";
   function concat(sep, l){
    if(! l) return cst;
    var seplen = caml_ml_string_length(sep);
    a:
    {
     var acc = 0, param = l, pos$1 = 0;
     for(;;){
      if(! param){var a = acc; break a;}
      var hd = param[1];
      if(! param[2]) break;
      var
       tl = param[2],
       x = (caml_ml_string_length(hd) + seplen | 0) + acc | 0;
      if(acc <= x){
       acc = x;
       param = tl;
      }
      else{acc = Stdlib[1].call(null, "String.concat"); param = tl;}
     }
     var a = caml_ml_string_length(hd) + acc | 0;
    }
    var dst = runtime.caml_create_bytes(a), pos = pos$1, param$0 = l;
    for(;;){
     if(param$0){
      var hd$0 = param$0[1];
      if(param$0[2]){
       var tl$0 = param$0[2];
       caml_blit_string(hd$0, 0, dst, pos, caml_ml_string_length(hd$0));
       caml_blit_string
        (sep, 0, dst, pos + caml_ml_string_length(hd$0) | 0, seplen);
       var pos$0 = (pos + caml_ml_string_length(hd$0) | 0) + seplen | 0;
       pos = pos$0;
       param$0 = tl$0;
       continue;
      }
      caml_blit_string(hd$0, 0, dst, pos, caml_ml_string_length(hd$0));
     }
     return bts(dst);
    }
   }
   var cat = Stdlib[28];
   function iter(f, s){
    var a = caml_ml_string_length(s) - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_call1(f, caml_string_unsafe_get(s, i));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return 0;
   }
   function iteri(f, s){
    var a = caml_ml_string_length(s) - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_call2(f, i, caml_string_unsafe_get(s, i));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return 0;
   }
   function map(f, s){
    var a = bos(s);
    return bts(Stdlib_Bytes[17].call(null, f, a));
   }
   function mapi(f, s){
    var a = bos(s);
    return bts(Stdlib_Bytes[18].call(null, f, a));
   }
   function fold_right(f, x, a){
    var b = bos(x);
    return Stdlib_Bytes[20].call(null, f, b, a);
   }
   function fold_left(f, a, x){
    var b = bos(x);
    return Stdlib_Bytes[19].call(null, f, a, b);
   }
   function exists(f, s){
    var a = bos(s);
    return Stdlib_Bytes[22].call(null, f, a);
   }
   function for_all(f, s){
    var a = bos(s);
    return Stdlib_Bytes[21].call(null, f, a);
   }
   function is_space(param){
    var a = param - 9 | 0;
    a:
    {
     if(4 < a >>> 0){if(23 !== a) break a;} else if(2 === a) break a;
     return 1;
    }
    return 0;
   }
   function trim(s){
    if(s === cst) return s;
    if
     (!
      is_space(caml_string_unsafe_get(s, 0))
      &&
       !
       is_space(caml_string_unsafe_get(s, caml_ml_string_length(s) - 1 | 0)))
     return s;
    var a = bos(s);
    return bts(Stdlib_Bytes[23].call(null, a));
   }
   function escaped(s){
    var b = bos(s);
    return bts(Stdlib_Bytes[87].call(null, b));
   }
   function index_rec(s, lim, i$1, c){
    var i = i$1;
    for(;;){
     if(lim <= i) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     if(caml_string_unsafe_get(s, i) === c) return i;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function index(s, c){return index_rec(s, caml_ml_string_length(s), 0, c);}
   function index_rec_opt(s, lim, i$1, c){
    var i = i$1;
    for(;;){
     if(lim <= i) return 0;
     if(caml_string_unsafe_get(s, i) === c) return [0, i];
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function index_opt(s, c){
    return index_rec_opt(s, caml_ml_string_length(s), 0, c);
   }
   function index_from(s, i, c){
    var l = caml_ml_string_length(s);
    if(0 <= i && l >= i) return index_rec(s, l, i, c);
    return Stdlib[1].call(null, "String.index_from / Bytes.index_from");
   }
   function index_from_opt(s, i, c){
    var l = caml_ml_string_length(s);
    if(0 <= i && l >= i) return index_rec_opt(s, l, i, c);
    return Stdlib[1].call
            (null, "String.index_from_opt / Bytes.index_from_opt");
   }
   function rindex_rec(s, i$1, c){
    var i = i$1;
    for(;;){
     if(0 > i) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     if(caml_string_unsafe_get(s, i) === c) return i;
     var i$0 = i - 1 | 0;
     i = i$0;
    }
   }
   function rindex(s, c){
    return rindex_rec(s, caml_ml_string_length(s) - 1 | 0, c);
   }
   function rindex_from(s, i, c){
    if(-1 <= i && caml_ml_string_length(s) > i) return rindex_rec(s, i, c);
    return Stdlib[1].call(null, "String.rindex_from / Bytes.rindex_from");
   }
   function rindex_rec_opt(s, i$1, c){
    var i = i$1;
    for(;;){
     if(0 > i) return 0;
     if(caml_string_unsafe_get(s, i) === c) return [0, i];
     var i$0 = i - 1 | 0;
     i = i$0;
    }
   }
   function rindex_opt(s, c){
    return rindex_rec_opt(s, caml_ml_string_length(s) - 1 | 0, c);
   }
   function rindex_from_opt(s, i, c){
    if(-1 <= i && caml_ml_string_length(s) > i)
     return rindex_rec_opt(s, i, c);
    return Stdlib[1].call
            (null, "String.rindex_from_opt / Bytes.rindex_from_opt");
   }
   function contains_from(s, i, c){
    var l = caml_ml_string_length(s);
    if(0 <= i && l >= i)
     try{index_rec(s, l, i, c); return 1;}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn === Stdlib[8]) return 0;
      throw caml_maybe_attach_backtrace(exn, 0);
     }
    return Stdlib[1].call(null, "String.contains_from / Bytes.contains_from");
   }
   function contains(s, c){return contains_from(s, 0, c);}
   function rcontains_from(s, i, c){
    if(0 <= i && caml_ml_string_length(s) > i)
     try{rindex_rec(s, i, c); return 1;}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn === Stdlib[8]) return 0;
      throw caml_maybe_attach_backtrace(exn, 0);
     }
    return Stdlib[1].call
            (null, "String.rcontains_from / Bytes.rcontains_from");
   }
   function uppercase_ascii(s){
    var a = bos(s);
    return bts(Stdlib_Bytes[36].call(null, a));
   }
   function lowercase_ascii(s){
    var a = bos(s);
    return bts(Stdlib_Bytes[37].call(null, a));
   }
   function capitalize_ascii(s){
    var a = bos(s);
    return bts(Stdlib_Bytes[38].call(null, a));
   }
   function uncapitalize_ascii(s){
    var a = bos(s);
    return bts(Stdlib_Bytes[39].call(null, a));
   }
   function starts_with(prefix, s){
    var
     len_s = caml_ml_string_length(s),
     len_pre = caml_ml_string_length(prefix),
     a = len_pre <= len_s ? 1 : 0;
    if(! a) return a;
    var i = 0;
    for(;;){
     if(i === len_pre) return 1;
     if(caml_string_unsafe_get(s, i) !== caml_string_unsafe_get(prefix, i))
      return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function ends_with(suffix, s){
    var
     len_s = caml_ml_string_length(s),
     len_suf = caml_ml_string_length(suffix),
     diff = len_s - len_suf | 0,
     a = 0 <= diff ? 1 : 0;
    if(! a) return a;
    var i = 0;
    for(;;){
     if(i === len_suf) return 1;
     if
      (caml_string_unsafe_get(s, diff + i | 0)
       !== caml_string_unsafe_get(suffix, i))
      return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function hash(x){return caml_string_hash(0, x);}
   function split_on_char(sep, s){
    var
     b = caml_ml_string_length(s),
     c = caml_ml_string_length(s) - 1 | 0,
     a = 0;
    if(c < 0)
     var j$1 = b, r$1 = a;
    else{
     var j = b, r = a, i = c;
     for(;;){
      if(caml_string_unsafe_get(s, i) === sep)
       var j$0 = i, r$0 = [0, sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), r];
      else
       var j$0 = j, r$0 = r;
      var d = i - 1 | 0;
      if(0 === i){var j$1 = j$0, r$1 = r$0; break;}
      j = j$0;
      r = r$0;
      i = d;
     }
    }
    return [0, sub(s, 0, j$1), r$1];
   }
   var compare = runtime.caml_string_compare;
   function to_seq(s){var a = bos(s); return Stdlib_Bytes[47].call(null, a);}
   function to_seqi(s){var a = bos(s); return Stdlib_Bytes[48].call(null, a);}
   function of_seq(g){return bts(Stdlib_Bytes[49].call(null, g));}
   function get_utf_8_uchar(s, i){
    var a = bos(s);
    return Stdlib_Bytes[50].call(null, a, i);
   }
   function is_valid_utf_8(s){
    var a = bos(s);
    return Stdlib_Bytes[52].call(null, a);
   }
   function get_utf_16be_uchar(s, i){
    var a = bos(s);
    return Stdlib_Bytes[53].call(null, a, i);
   }
   function is_valid_utf_16be(s){
    var a = bos(s);
    return Stdlib_Bytes[55].call(null, a);
   }
   function get_utf_16le_uchar(s, i){
    var a = bos(s);
    return Stdlib_Bytes[56].call(null, a, i);
   }
   function is_valid_utf_16le(s){
    var a = bos(s);
    return Stdlib_Bytes[58].call(null, a);
   }
   function get_int8(s, i){
    var a = bos(s);
    return Stdlib_Bytes[60].call(null, a, i);
   }
   function get_uint16_le(s, i){
    var a = bos(s);
    return Stdlib_Bytes[63].call(null, a, i);
   }
   function get_uint16_be(s, i){
    var a = bos(s);
    return Stdlib_Bytes[62].call(null, a, i);
   }
   function get_int16_ne(s, i){
    var a = bos(s);
    return Stdlib_Bytes[64].call(null, a, i);
   }
   function get_int16_le(s, i){
    var a = bos(s);
    return Stdlib_Bytes[66].call(null, a, i);
   }
   function get_int16_be(s, i){
    var a = bos(s);
    return Stdlib_Bytes[65].call(null, a, i);
   }
   function get_int32_le(s, i){
    var a = bos(s);
    return Stdlib_Bytes[69].call(null, a, i);
   }
   function get_int32_be(s, i){
    var a = bos(s);
    return Stdlib_Bytes[68].call(null, a, i);
   }
   function get_int64_le(s, i){
    var a = bos(s);
    return Stdlib_Bytes[72].call(null, a, i);
   }
   function get_int64_be(s, i){
    var a = bos(s);
    return Stdlib_Bytes[71].call(null, a, i);
   }
   var
    Stdlib_String =
      [0,
       make,
       init,
       cst,
       of_bytes,
       to_bytes,
       blit,
       concat,
       cat,
       caml_string_equal,
       compare,
       starts_with,
       ends_with,
       contains_from,
       rcontains_from,
       contains,
       sub,
       split_on_char,
       map,
       mapi,
       fold_left,
       fold_right,
       for_all,
       exists,
       trim,
       escaped,
       uppercase_ascii,
       lowercase_ascii,
       capitalize_ascii,
       uncapitalize_ascii,
       iter,
       iteri,
       index_from,
       index_from_opt,
       rindex_from,
       rindex_from_opt,
       index,
       index_opt,
       rindex,
       rindex_opt,
       to_seq,
       to_seqi,
       of_seq,
       get_utf_8_uchar,
       is_valid_utf_8,
       get_utf_16be_uchar,
       is_valid_utf_16be,
       get_utf_16le_uchar,
       is_valid_utf_16le,
       runtime.caml_string_get,
       get_int8,
       runtime.caml_string_get16,
       get_uint16_be,
       get_uint16_le,
       get_int16_ne,
       get_int16_be,
       get_int16_le,
       runtime.caml_string_get32,
       hash,
       caml_string_hash,
       get_int32_be,
       get_int32_le,
       runtime.caml_string_get64,
       get_int64_be,
       get_int64_le];
   runtime.caml_register_global(12, Stdlib_String, "Stdlib__String");
   return;
  }
  (globalThis));

//# 5423 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Array:[F(2),F(3),F(3),F(2)*,F(1)*,F(3),F(1)*,F(4),F(5),F(1),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(3),F(3),F(3),F(3),F(3),F(2),F(2),F(3),F(3),F(2),F(2),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(1)*->F(1)*,F(1)*->F(1)*,F(1),[]]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_array_sub = runtime.caml_array_sub,
    caml_check_bound = runtime.caml_check_bound,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Seq = global_data.Stdlib__Seq,
    Assert_failure = global_data.Assert_failure,
    Stdlib = global_data.Stdlib;
   function init(l, f){
    if(0 === l) return [0];
    if(0 > l) return Stdlib[1].call(null, "Array.init");
    var res = caml_make_vect(l, caml_call1(f, 0)), a = l - 1 | 0;
    if(a >= 1){
     var i = 1;
     for(;;){
      res[i + 1] = caml_call1(f, i);
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return res;
   }
   function make_matrix(sx, sy, init){
    if(sy < 0) Stdlib[1].call(null, "Array.make_matrix");
    var res = caml_make_vect(sx, [0]);
    if(0 < sy){
     var a = sx - 1 | 0;
     if(a >= 0){
      var x = 0;
      for(;;){
       res[x + 1] = caml_make_vect(sy, init);
       var b = x + 1 | 0;
       if(a === x) break;
       x = b;
      }
     }
    }
    return res;
   }
   function init_matrix(sx, sy, f){
    if(sy < 0) Stdlib[1].call(null, "Array.init_matrix");
    var res = caml_make_vect(sx, [0]);
    if(0 < sy){
     var a = sx - 1 | 0;
     if(a >= 0){
      var x = 0;
      for(;;){
       var row = caml_make_vect(sy, caml_call2(f, x, 0)), b = sy - 1 | 0;
       if(b >= 1){
        var y = 1;
        for(;;){
         row[y + 1] = caml_call2(f, x, y);
         var d = y + 1 | 0;
         if(b === y) break;
         y = d;
        }
       }
       res[x + 1] = row;
       var c = x + 1 | 0;
       if(a === x) break;
       x = c;
      }
     }
    }
    return res;
   }
   function copy(a){
    var l = a.length - 1;
    return 0 === l ? [0] : caml_array_sub(a, 0, l);
   }
   function append(a1, a2){
    var l1 = a1.length - 1;
    return 0 === l1
            ? copy(a2)
            : 0
              === a2.length - 1
              ? caml_array_sub(a1, 0, l1)
              : runtime.caml_array_append(a1, a2);
   }
   function sub(a, ofs, len){
    if(0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs)
     return caml_array_sub(a, ofs, len);
    return Stdlib[1].call(null, "Array.sub");
   }
   function fill(a, ofs, len, v){
    if(0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs)
     return runtime.caml_array_fill(a, ofs, len, v);
    return Stdlib[1].call(null, "Array.fill");
   }
   function blit(a1, ofs1, a2, ofs2, len){
    if
     (0 <= len
      &&
       0 <= ofs1
       &&
        (a1.length - 1 - len | 0) >= ofs1
        && 0 <= ofs2 && (a2.length - 1 - len | 0) >= ofs2)
     return runtime.caml_array_blit(a1, ofs1, a2, ofs2, len);
    return Stdlib[1].call(null, "Array.blit");
   }
   function iter(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function iter2(f, a, b){
    if(a.length - 1 !== b.length - 1)
     return Stdlib[1].call
             (null, "Array.iter2: arrays must have the same length");
    var c = a.length - 2 | 0;
    if(c >= 0){
     var i = 0;
     for(;;){
      caml_call2(f, a[i + 1], b[i + 1]);
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return 0;
   }
   function map(f, a){
    var l = a.length - 1;
    if(0 === l) return [0];
    var r = caml_make_vect(l, caml_call1(f, a[1])), b = l - 1 | 0;
    if(b >= 1){
     var i = 1;
     for(;;){
      r[i + 1] = caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return r;
   }
   function map_inplace(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      a[i + 1] = caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function mapi_inplace(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      a[i + 1] = caml_call2(f, i, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function map2(f, a, b){
    var la = a.length - 1, lb = b.length - 1;
    if(la !== lb)
     return Stdlib[1].call
             (null, "Array.map2: arrays must have the same length");
    if(0 === la) return [0];
    var r = caml_make_vect(la, caml_call2(f, a[1], b[1])), c = la - 1 | 0;
    if(c >= 1){
     var i = 1;
     for(;;){
      r[i + 1] = caml_call2(f, a[i + 1], b[i + 1]);
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return r;
   }
   function iteri(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      caml_call2(f, i, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function mapi(f, a){
    var l = a.length - 1;
    if(0 === l) return [0];
    var r = caml_make_vect(l, caml_call2(f, 0, a[1])), b = l - 1 | 0;
    if(b >= 1){
     var i = 1;
     for(;;){
      r[i + 1] = caml_call2(f, i, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return r;
   }
   function to_list(a){
    var i$1 = a.length - 2 | 0, i = i$1, res = 0;
    for(;;){
     if(0 > i) return res;
     var res$0 = [0, a[i + 1], res], i$0 = i - 1 | 0;
     i = i$0;
     res = res$0;
    }
   }
   function list_length(accu$1, param$0){
    var accu = accu$1, param = param$0;
    for(;;){
     if(! param) return accu;
     var t = param[2], accu$0 = accu + 1 | 0;
     accu = accu$0;
     param = t;
    }
   }
   function of_list(l){
    if(! l) return [0];
    var
     tl = l[2],
     hd = l[1],
     a = caml_make_vect(list_length(0, l), hd),
     i = 1,
     param = tl;
    for(;;){
     if(! param) return a;
     var tl$0 = param[2], hd$0 = param[1];
     a[i + 1] = hd$0;
     var i$0 = i + 1 | 0;
     i = i$0;
     param = tl$0;
    }
   }
   function fold_left(f, x, a){
    var b = a.length - 2 | 0;
    if(b < 0)
     var r$0 = x;
    else{
     var r = x, i = 0;
     for(;;){
      var c = caml_call2(f, r, a[i + 1]), d = i + 1 | 0;
      if(b === i){var r$0 = c; break;}
      r = c;
      i = d;
     }
    }
    return r$0;
   }
   function fold_left_map(f, acc, input_array){
    var len = input_array.length - 1;
    if(0 === len) return [0, acc, [0]];
    var
     match = caml_call2(f, acc, input_array[1]),
     elt = match[2],
     acc$0 = match[1],
     output_array = caml_make_vect(len, elt),
     a = len - 1 | 0;
    if(a < 1)
     var acc$3 = acc$0;
    else{
     var acc$2 = acc$0, i = 1;
     for(;;){
      var
       match$0 = caml_call2(f, acc$2, input_array[i + 1]),
       elt$0 = match$0[2],
       acc$1 = match$0[1];
      output_array[i + 1] = elt$0;
      var b = i + 1 | 0;
      if(a === i){var acc$3 = acc$1; break;}
      acc$2 = acc$1;
      i = b;
     }
    }
    return [0, acc$3, output_array];
   }
   function fold_right(f, a, x){
    var b = a.length - 2 | 0;
    if(b < 0)
     var r$0 = x;
    else{
     var r = x, i = b;
     for(;;){
      var c = caml_call2(f, a[i + 1], r), d = i - 1 | 0;
      if(0 === i){var r$0 = c; break;}
      r = c;
      i = d;
     }
    }
    return r$0;
   }
   function exists(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(caml_call1(p, a[i + 1])) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function for_all(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 1;
     if(! caml_call1(p, a[i + 1])) return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function for_all2(p, l1, l2){
    var n1 = l1.length - 1, n2 = l2.length - 1;
    if(n1 !== n2) return Stdlib[1].call(null, "Array.for_all2");
    var i = 0;
    for(;;){
     if(i === n1) return 1;
     if(! caml_call2(p, l1[i + 1], l2[i + 1])) return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function exists2(p, l1, l2){
    var n1 = l1.length - 1, n2 = l2.length - 1;
    if(n1 !== n2) return Stdlib[1].call(null, "Array.exists2");
    var i = 0;
    for(;;){
     if(i === n1) return 0;
     if(caml_call2(p, l1[i + 1], l2[i + 1])) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function mem(x, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(0 === runtime.caml_compare(a[i + 1], x)) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function memq(x, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(x === a[i + 1]) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_opt(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     var x = a[i + 1];
     if(caml_call1(p, x)) return [0, x];
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_index(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(caml_call1(p, a[i + 1])) return [0, i];
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_map(f, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     var r = caml_call1(f, a[i + 1]);
     if(r) return r;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_mapi(f, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     var r = caml_call2(f, i, a[i + 1]);
     if(r) return r;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function split(x){
    if(runtime.caml_equal(x, [0])) return [0, [0], [0]];
    var
     match = x[1],
     b0 = match[2],
     a0 = match[1],
     n = x.length - 1,
     a = caml_make_vect(n, a0),
     b = caml_make_vect(n, b0),
     c = n - 1 | 0;
    if(c >= 1){
     var i = 1;
     for(;;){
      var match$0 = x[i + 1], bi = match$0[2], ai = match$0[1];
      a[i + 1] = ai;
      b[i + 1] = bi;
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return [0, a, b];
   }
   function combine(a, b){
    var na = a.length - 1, nb = b.length - 1;
    if(na !== nb) Stdlib[1].call(null, "Array.combine");
    if(0 === na) return [0];
    var x = caml_make_vect(na, [0, a[1], b[1]]), c = na - 1 | 0;
    if(c >= 1){
     var i = 1;
     for(;;){
      x[i + 1] = [0, a[i + 1], b[i + 1]];
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return x;
   }
   var
    Bottom = [248, "Stdlib.Array.Bottom", runtime.caml_fresh_oo_id(0)],
    a = [0, "array.ml", 369, 4];
   function sort(cmp, a$0){
    function maxson(l, i){
     var i31 = ((i + i | 0) + i | 0) + 1 | 0;
     if((i31 + 2 | 0) < l){
      var
       a = i31 + 1 | 0,
       d = caml_check_bound(a$0, a)[a + 1],
       x =
         caml_call2(cmp, caml_check_bound(a$0, i31)[i31 + 1], d) < 0
          ? i31 + 1 | 0
          : i31,
       b = i31 + 2 | 0,
       e = caml_check_bound(a$0, b)[b + 1],
       x$0 =
         caml_call2(cmp, caml_check_bound(a$0, x)[x + 1], e) < 0
          ? i31 + 2 | 0
          : x;
      return x$0;
     }
     if((i31 + 1 | 0) < l){
      var c = i31 + 1 | 0, f = caml_check_bound(a$0, c)[c + 1];
      if(0 > caml_call2(cmp, caml_check_bound(a$0, i31)[i31 + 1], f))
       return i31 + 1 | 0;
     }
     if(i31 < l) return i31;
     throw caml_maybe_attach_backtrace([0, Bottom, i], 1);
    }
    var l = a$0.length - 1, b = ((l + 1 | 0) / 3 | 0) - 1 | 0;
    if(b >= 0){
     var i$5 = b;
     for(;;){
      var e$1 = caml_check_bound(a$0, i$5)[i$5 + 1];
      try{
       var i = i$5;
       for(;;){
        var j = maxson(l, i);
        if(0 >= caml_call2(cmp, caml_check_bound(a$0, j)[j + 1], e$1)){caml_check_bound(a$0, i)[i + 1] = e$1; break;}
        var g = caml_check_bound(a$0, j)[j + 1];
        caml_check_bound(a$0, i)[i + 1] = g;
        i = j;
       }
      }
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn[1] !== Bottom) throw caml_maybe_attach_backtrace(exn, 0);
       var i$0 = exn[2];
       caml_check_bound(a$0, i$0)[i$0 + 1] = e$1;
      }
      var n = i$5 - 1 | 0;
      if(0 === i$5) break;
      i$5 = n;
     }
    }
    var c = l - 1 | 0;
    if(c >= 2){
     var i$4 = c;
     a:
     for(;;){
      var e$0 = caml_check_bound(a$0, i$4)[i$4 + 1];
      a$0[i$4 + 1] = caml_check_bound(a$0, 0)[1];
      try{
       var i$1 = 0;
       for(;;){
        var j$0 = maxson(i$4, i$1), h = caml_check_bound(a$0, j$0)[j$0 + 1];
        caml_check_bound(a$0, i$1)[i$1 + 1] = h;
        i$1 = j$0;
       }
      }
      catch(exn){
       var exn$0 = caml_wrap_exception(exn);
       if(exn$0[1] !== Bottom) throw caml_maybe_attach_backtrace(exn$0, 0);
       var i$2 = exn$0[2], i$3 = i$2;
       for(;;){
        var father = (i$3 - 1 | 0) / 3 | 0;
        if(i$3 === father)
         throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
        if
         (0 <= caml_call2(cmp, caml_check_bound(a$0, father)[father + 1], e$0))
         caml_check_bound(a$0, i$3)[i$3 + 1] = e$0;
        else{
         var k = caml_check_bound(a$0, father)[father + 1];
         caml_check_bound(a$0, i$3)[i$3 + 1] = k;
         if(0 < father){i$3 = father; continue;}
         caml_check_bound(a$0, 0)[1] = e$0;
        }
        var m = i$4 - 1 | 0;
        if(2 === i$4) break a;
        i$4 = m;
        break;
       }
      }
     }
    }
    var d = 1 < l ? 1 : 0;
    if(d){
     var e = caml_check_bound(a$0, 1)[2];
     a$0[2] = caml_check_bound(a$0, 0)[1];
     a$0[1] = e;
     var f = 0;
    }
    else
     var f = d;
    return f;
   }
   function stable_sort(cmp, a){
    function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){
     var
      src1r = src1ofs + src1len | 0,
      src2r = src2ofs + src2len | 0,
      s2$1 = caml_check_bound(src2, src2ofs)[src2ofs + 1],
      s1$1 = caml_check_bound(a, src1ofs)[src1ofs + 1],
      i1 = src1ofs,
      s1 = s1$1,
      i2 = src2ofs,
      s2 = s2$1,
      d = dstofs;
     for(;;)
      if(0 < caml_call2(cmp, s1, s2)){
       caml_check_bound(dst, d)[d + 1] = s2;
       var i2$0 = i2 + 1 | 0;
       if(i2$0 >= src2r) return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0);
       var d$0 = d + 1 | 0, s2$0 = caml_check_bound(src2, i2$0)[i2$0 + 1];
       i2 = i2$0;
       s2 = s2$0;
       d = d$0;
      }
      else{
       caml_check_bound(dst, d)[d + 1] = s1;
       var i1$0 = i1 + 1 | 0;
       if(i1$0 >= src1r)
        return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0);
       var d$1 = d + 1 | 0, s1$0 = caml_check_bound(a, i1$0)[i1$0 + 1];
       i1 = i1$0;
       s1 = s1$0;
       d = d$1;
      }
    }
    function isortto(srcofs, dst, dstofs, len){
     var b = len - 1 | 0;
     if(b >= 0){
      var i = 0;
      a:
      for(;;){
       var
        c = srcofs + i | 0,
        e = caml_check_bound(a, c)[c + 1],
        j = (dstofs + i | 0) - 1 | 0;
       for(;;){
        if
         (dstofs <= j
          && 0 < caml_call2(cmp, caml_check_bound(dst, j)[j + 1], e)){
         var d = j + 1 | 0, g = caml_check_bound(dst, j)[j + 1];
         caml_check_bound(dst, d)[d + 1] = g;
         var j$0 = j - 1 | 0;
         j = j$0;
         continue;
        }
        var f = j + 1 | 0;
        caml_check_bound(dst, f)[f + 1] = e;
        var h = i + 1 | 0;
        if(b === i) break a;
        i = h;
        break;
       }
      }
     }
     return 0;
    }
    function sortto(srcofs, dst, dstofs, len){
     if(len <= 5) return isortto(srcofs, dst, dstofs, len);
     var l1 = len / 2 | 0, l2 = len - l1 | 0;
     sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2);
     sortto(srcofs, a, srcofs + l2 | 0, l1);
     return merge(srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs);
    }
    var l = a.length - 1;
    if(l <= 5) return isortto(0, a, 0, l);
    var
     l1 = l / 2 | 0,
     l2 = l - l1 | 0,
     t = caml_make_vect(l2, caml_check_bound(a, 0)[1]);
    sortto(l1, t, 0, l2);
    sortto(0, a, l2, l1);
    return merge(l2, l1, t, 0, l2, a, 0);
   }
   function shuffle(rand, a){
    var b = a.length - 2 | 0;
    if(b >= 1){
     var i = b;
     for(;;){
      var j = caml_call1(rand, i + 1 | 0), v = a[i + 1];
      a[i + 1] = caml_check_bound(a, j)[j + 1];
      a[j + 1] = v;
      var c = i - 1 | 0;
      if(1 === i) break;
      i = c;
     }
    }
    return 0;
   }
   function to_seq(a){
    function aux(i, param){
     if(i >= a.length - 1) return 0;
     var x = a[i + 1], b = i + 1 | 0;
     return [0, x, function(a){return aux(b, a);}];
    }
    return function(a){return aux(0, a);};
   }
   function to_seqi(a){
    function aux(i, param){
     if(i >= a.length - 1) return 0;
     var x = a[i + 1], b = i + 1 | 0;
     return [0, [0, i, x], function(a){return aux(b, a);}];
    }
    return function(a){return aux(0, a);};
   }
   function of_seq(i$2){
    var
     l =
       Stdlib_Seq[5].call(null, function(acc, x){return [0, x, acc];}, 0, i$2);
    if(! l) return [0];
    var
     tl = l[2],
     hd = l[1],
     len = list_length(0, l),
     a = caml_make_vect(len, hd),
     i$1 = len - 2 | 0,
     i = i$1,
     param = tl;
    for(;;){
     if(! param) return a;
     var tl$0 = param[2], hd$0 = param[1];
     a[i + 1] = hd$0;
     var i$0 = i - 1 | 0;
     i = i$0;
     param = tl$0;
    }
   }
   var
    Stdlib_Array =
      [0,
       init,
       make_matrix,
       init_matrix,
       append,
       runtime.caml_array_concat,
       sub,
       copy,
       fill,
       blit,
       to_list,
       of_list,
       iter,
       iteri,
       map,
       map_inplace,
       mapi,
       mapi_inplace,
       fold_left,
       fold_left_map,
       fold_right,
       iter2,
       map2,
       for_all,
       exists,
       for_all2,
       exists2,
       mem,
       memq,
       find_opt,
       find_index,
       find_map,
       find_mapi,
       split,
       combine,
       sort,
       stable_sort,
       stable_sort,
       shuffle,
       to_seq,
       to_seqi,
       of_seq,
       [0]];
   runtime.caml_register_global(16, Stdlib_Array, "Stdlib__Array");
   return;
  }
  (globalThis));

//# 6179 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Float:[N,N,N,F(1)*,F(1)*,N,N,N,N,N,N,N,N,N,F(1)*,F(1)*,F(1)*,F(1)*,F(1),F(1),F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*,N,N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_float_compare = runtime.caml_float_compare,
    caml_floatarray_blit = runtime.caml_floatarray_blit,
    caml_floatarray_create = runtime.caml_floatarray_create,
    caml_hash = runtime.caml_hash,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_nextafter_float = runtime.caml_nextafter_float,
    caml_signbit_float = runtime.caml_signbit_float,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_List = global_data.Stdlib__List,
    Assert_failure = global_data.Assert_failure,
    Stdlib = global_data.Stdlib,
    infinity = Stdlib[22],
    neg_infinity = Stdlib[23],
    nan = Stdlib[24];
   function is_finite(x){return x - x === 0. ? 1 : 0;}
   function is_infinite(x){return 1. / x === 0. ? 1 : 0;}
   function is_nan(x){return x !== x ? 1 : 0;}
   var
    max_float = Stdlib[25],
    min_float = Stdlib[26],
    epsilon = Stdlib[27],
    of_string_opt = Stdlib[36],
    to_string = Stdlib[35];
   function is_integer(x){
    var a = x === runtime.caml_trunc_float(x) ? 1 : 0;
    return a ? is_finite(x) : a;
   }
   function succ(x){return caml_nextafter_float(x, infinity);}
   function pred(x){return caml_nextafter_float(x, neg_infinity);}
   function equal(x, y){return 0 === caml_float_compare(x, y) ? 1 : 0;}
   function min(x, y){
    a:
    if(! (x < y)){
     if(! caml_signbit_float(y) && caml_signbit_float(x)) break a;
     return x !== x ? x : y;
    }
    return y !== y ? y : x;
   }
   function max(x, y){
    a:
    if(! (x < y)){
     if(! caml_signbit_float(y) && caml_signbit_float(x)) break a;
     return y !== y ? y : x;
    }
    return x !== x ? x : y;
   }
   function min_max(x, y){
    if(x === x && y === y){
     a:
     if(! (x < y)){
      if(! caml_signbit_float(y) && caml_signbit_float(x)) break a;
      return [0, y, x];
     }
     return [0, x, y];
    }
    return [0, nan, nan];
   }
   function min_num(x, y){
    a:
    if(! (x < y)){
     if(! caml_signbit_float(y) && caml_signbit_float(x)) break a;
     return y !== y ? x : y;
    }
    return x !== x ? y : x;
   }
   function max_num(x, y){
    a:
    if(! (x < y)){
     if(! caml_signbit_float(y) && caml_signbit_float(x)) break a;
     return x !== x ? y : x;
    }
    return y !== y ? x : y;
   }
   function min_max_num(x, y){
    if(x !== x) return [0, y, y];
    if(y !== y) return [0, x, x];
    a:
    if(! (x < y)){
     if(! caml_signbit_float(y) && caml_signbit_float(x)) break a;
     return [0, y, x];
    }
    return [0, x, y];
   }
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function hash(x){return caml_hash(10, 100, 0, x);}
   function unsafe_fill(a, ofs, len, v){
    var b = (ofs + len | 0) - 1 | 0;
    if(b >= ofs){
     var i = ofs;
     for(;;){a[i + 1] = v; var c = i + 1 | 0; if(b === i) break; i = c;}
    }
    return 0;
   }
   function check(a, ofs, len, msg){
    var c = ofs < 0 ? 1 : 0;
    if(c)
     var b = c;
    else{
     var d = len < 0 ? 1 : 0;
     if(d)
      var b = d;
     else
      var
       e = (ofs + len | 0) < 0 ? 1 : 0,
       b = e || (a.length - 1 < (ofs + len | 0) ? 1 : 0);
    }
    return b ? Stdlib[1].call(null, msg) : b;
   }
   function make(n, v){
    var result = caml_floatarray_create(n);
    unsafe_fill(result, 0, n, v);
    return result;
   }
   function init(l, f){
    if(0 > l) return Stdlib[1].call(null, "Float.Array.init");
    var res = caml_floatarray_create(l), a = l - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      res[i + 1] = caml_call1(f, i);
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return res;
   }
   function make_matrix(sx, sy, v){
    if(sy < 0) Stdlib[1].call(null, "Float.Array.make_matrix");
    var res = caml_make_vect(sx, caml_floatarray_create(0));
    if(0 < sy){
     var a = sx - 1 | 0;
     if(a >= 0){
      var x = 0;
      for(;;){
       res[x + 1] = make(sy, v);
       var b = x + 1 | 0;
       if(a === x) break;
       x = b;
      }
     }
    }
    return res;
   }
   function init_matrix(sx, sy, f){
    if(sy < 0) Stdlib[1].call(null, "Float.Array.init_matrix");
    var res = caml_make_vect(sx, caml_floatarray_create(0));
    if(0 < sy){
     var a = sx - 1 | 0;
     if(a >= 0){
      var x = 0;
      for(;;){
       var row = caml_floatarray_create(sy), b = sy - 1 | 0;
       if(b >= 0){
        var y = 0;
        for(;;){
         row[y + 1] = caml_call2(f, x, y);
         var d = y + 1 | 0;
         if(b === y) break;
         y = d;
        }
       }
       res[x + 1] = row;
       var c = x + 1 | 0;
       if(a === x) break;
       x = c;
      }
     }
    }
    return res;
   }
   function append(a1, a2){
    var
     l1 = a1.length - 1,
     l2 = a2.length - 1,
     result = caml_floatarray_create(l1 + l2 | 0);
    caml_floatarray_blit(a1, 0, result, 0, l1);
    caml_floatarray_blit(a2, 0, result, l1, l2);
    return result;
   }
   var cst_float_ml = "float.ml", a = [0, cst_float_ml, 254, 14];
   function concat(l){
    var acc = 0, param = l;
    for(;;){
     if(! param) break;
     var tl = param[2], hd = param[1], x = hd.length - 1 + acc | 0;
     if(acc <= x){
      acc = x;
      param = tl;
     }
     else{acc = Stdlib[1].call(null, "Float.Array.concat"); param = tl;}
    }
    var result = caml_floatarray_create(acc), l$0 = l, i = 0;
    for(;;){
     if(! l$0){
      if(i === acc) return result;
      throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
     }
     var tl$0 = l$0[2], hd$0 = l$0[1], hlen = hd$0.length - 1;
     caml_floatarray_blit(hd$0, 0, result, i, hlen);
     var i$0 = i + hlen | 0;
     l$0 = tl$0;
     i = i$0;
    }
   }
   function sub(a, ofs, len){
    check(a, ofs, len, "Float.Array.sub");
    var result = caml_floatarray_create(len);
    caml_floatarray_blit(a, ofs, result, 0, len);
    return result;
   }
   function copy(a){
    var l = a.length - 1, result = caml_floatarray_create(l);
    caml_floatarray_blit(a, 0, result, 0, l);
    return result;
   }
   function fill(a, ofs, len, v){
    check(a, ofs, len, "Float.Array.fill");
    return unsafe_fill(a, ofs, len, v);
   }
   function blit(src, sofs, dst, dofs, len){
    var cst_Float_array_blit = "Float.array.blit";
    check(src, sofs, len, cst_Float_array_blit);
    check(dst, dofs, len, cst_Float_array_blit);
    return caml_floatarray_blit(src, sofs, dst, dofs, len);
   }
   function to_list(a){
    return Stdlib_List[11].call
            (null, a.length - 1, function(b){return a[b + 1];});
   }
   function of_list(l){
    var
     result = caml_floatarray_create(Stdlib_List[1].call(null, l)),
     i = 0,
     l$0 = l;
    for(;;){
     if(! l$0) return result;
     var t = l$0[2], h = l$0[1];
     result[i + 1] = h;
     var i$0 = i + 1 | 0;
     i = i$0;
     l$0 = t;
    }
   }
   function iter(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function iter2(f, a, b){
    if(a.length - 1 !== b.length - 1)
     return Stdlib[1].call
             (null, "Float.Array.iter2: arrays must have the same length");
    var c = a.length - 2 | 0;
    if(c >= 0){
     var i = 0;
     for(;;){
      caml_call2(f, a[i + 1], b[i + 1]);
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return 0;
   }
   function map(f, a){
    var l = a.length - 1, r = caml_floatarray_create(l), b = l - 1 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      r[i + 1] = caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return r;
   }
   function map_inplace(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      a[i + 1] = caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function map2(f, a, b){
    var la = a.length - 1, lb = b.length - 1;
    if(la !== lb)
     return Stdlib[1].call
             (null, "Float.Array.map2: arrays must have the same length");
    var r = caml_floatarray_create(la), c = la - 1 | 0;
    if(c >= 0){
     var i = 0;
     for(;;){
      r[i + 1] = caml_call2(f, a[i + 1], b[i + 1]);
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return r;
   }
   function iteri(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      caml_call2(f, i, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function mapi(f, a){
    var l = a.length - 1, r = caml_floatarray_create(l), b = l - 1 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      r[i + 1] = caml_call2(f, i, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return r;
   }
   function mapi_inplace(f, a){
    var b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      a[i + 1] = caml_call2(f, i, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function fold_left(f, x, a){
    var b = a.length - 2 | 0;
    if(b < 0)
     var r$0 = x;
    else{
     var r = x, i = 0;
     for(;;){
      var c = caml_call2(f, r, a[i + 1]), d = i + 1 | 0;
      if(b === i){var r$0 = c; break;}
      r = c;
      i = d;
     }
    }
    return r$0;
   }
   function fold_right(f, a, x){
    var b = a.length - 2 | 0;
    if(b < 0)
     var r$0 = x;
    else{
     var r = x, i = b;
     for(;;){
      var c = caml_call2(f, a[i + 1], r), d = i - 1 | 0;
      if(0 === i){var r$0 = c; break;}
      r = c;
      i = d;
     }
    }
    return r$0;
   }
   function exists(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(caml_call1(p, a[i + 1])) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function for_all(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 1;
     if(! caml_call1(p, a[i + 1])) return 0;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function mem(x, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(0 === caml_float_compare(a[i + 1], x)) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function mem_ieee(x, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(x === a[i + 1]) return 1;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_opt(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     var x = a[i + 1];
     if(caml_call1(p, x)) return [0, x];
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_index(p, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     if(caml_call1(p, a[i + 1])) return [0, i];
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_map(f, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     var r = caml_call1(f, a[i + 1]);
     if(r) return r;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   function find_mapi(f, a){
    var n = a.length - 1, i = 0;
    for(;;){
     if(i === n) return 0;
     var r = caml_call2(f, i, a[i + 1]);
     if(r) return r;
     var i$0 = i + 1 | 0;
     i = i$0;
    }
   }
   var
    Bottom = [248, "Stdlib.Float.Array.Bottom", runtime.caml_fresh_oo_id(0)],
    b = [0, cst_float_ml, 484, 6];
   function sort(cmp, a){
    function maxson(l, i){
     var i31 = ((i + i | 0) + i | 0) + 1 | 0;
     if((i31 + 2 | 0) < l){
      var
       b = i31 + 1 | 0,
       e = caml_check_bound(a, b)[b + 1],
       x =
         caml_call2(cmp, caml_check_bound(a, i31)[i31 + 1], e) < 0
          ? i31 + 1 | 0
          : i31,
       c = i31 + 2 | 0,
       f = caml_check_bound(a, c)[c + 1],
       x$0 =
         caml_call2(cmp, caml_check_bound(a, x)[x + 1], f) < 0
          ? i31 + 2 | 0
          : x;
      return x$0;
     }
     if((i31 + 1 | 0) < l){
      var d = i31 + 1 | 0, g = caml_check_bound(a, d)[d + 1];
      if(0 > caml_call2(cmp, caml_check_bound(a, i31)[i31 + 1], g))
       return i31 + 1 | 0;
     }
     if(i31 < l) return i31;
     throw caml_maybe_attach_backtrace([0, Bottom, i], 1);
    }
    var l = a.length - 1, c = ((l + 1 | 0) / 3 | 0) - 1 | 0;
    if(c >= 0){
     var i$5 = c;
     for(;;){
      var e$1 = caml_check_bound(a, i$5)[i$5 + 1];
      try{
       var i = i$5;
       for(;;){
        var j = maxson(l, i);
        if(0 >= caml_call2(cmp, caml_check_bound(a, j)[j + 1], e$1)){caml_check_bound(a, i)[i + 1] = e$1; break;}
        var h = caml_check_bound(a, j)[j + 1];
        caml_check_bound(a, i)[i + 1] = h;
        i = j;
       }
      }
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn[1] !== Bottom) throw caml_maybe_attach_backtrace(exn, 0);
       var i$0 = exn[2];
       caml_check_bound(a, i$0)[i$0 + 1] = e$1;
      }
      var o = i$5 - 1 | 0;
      if(0 === i$5) break;
      i$5 = o;
     }
    }
    var d = l - 1 | 0;
    if(d >= 2){
     var i$4 = d;
     a:
     for(;;){
      var e$0 = caml_check_bound(a, i$4)[i$4 + 1];
      a[i$4 + 1] = caml_check_bound(a, 0)[1];
      try{
       var i$1 = 0;
       for(;;){
        var j$0 = maxson(i$4, i$1), k = caml_check_bound(a, j$0)[j$0 + 1];
        caml_check_bound(a, i$1)[i$1 + 1] = k;
        i$1 = j$0;
       }
      }
      catch(exn){
       var exn$0 = caml_wrap_exception(exn);
       if(exn$0[1] !== Bottom) throw caml_maybe_attach_backtrace(exn$0, 0);
       var i$2 = exn$0[2], i$3 = i$2;
       for(;;){
        var father = (i$3 - 1 | 0) / 3 | 0;
        if(i$3 === father)
         throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
        if(0 <= caml_call2(cmp, caml_check_bound(a, father)[father + 1], e$0))
         caml_check_bound(a, i$3)[i$3 + 1] = e$0;
        else{
         var m = caml_check_bound(a, father)[father + 1];
         caml_check_bound(a, i$3)[i$3 + 1] = m;
         if(0 < father){i$3 = father; continue;}
         caml_check_bound(a, 0)[1] = e$0;
        }
        var n = i$4 - 1 | 0;
        if(2 === i$4) break a;
        i$4 = n;
        break;
       }
      }
     }
    }
    var f = 1 < l ? 1 : 0;
    if(f){
     var e = caml_check_bound(a, 1)[2];
     a[2] = caml_check_bound(a, 0)[1];
     a[1] = e;
     var g = 0;
    }
    else
     var g = f;
    return g;
   }
   function stable_sort(cmp, a){
    function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){
     var
      src1r = src1ofs + src1len | 0,
      src2r = src2ofs + src2len | 0,
      s2$1 = caml_check_bound(src2, src2ofs)[src2ofs + 1],
      s1$1 = caml_check_bound(a, src1ofs)[src1ofs + 1],
      i1 = src1ofs,
      s1 = s1$1,
      i2 = src2ofs,
      s2 = s2$1,
      d = dstofs;
     for(;;)
      if(0 < caml_call2(cmp, s1, s2)){
       caml_check_bound(dst, d)[d + 1] = s2;
       var i2$0 = i2 + 1 | 0;
       if(i2$0 >= src2r) return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0);
       var d$0 = d + 1 | 0, s2$0 = caml_check_bound(src2, i2$0)[i2$0 + 1];
       i2 = i2$0;
       s2 = s2$0;
       d = d$0;
      }
      else{
       caml_check_bound(dst, d)[d + 1] = s1;
       var i1$0 = i1 + 1 | 0;
       if(i1$0 >= src1r)
        return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0);
       var d$1 = d + 1 | 0, s1$0 = caml_check_bound(a, i1$0)[i1$0 + 1];
       i1 = i1$0;
       s1 = s1$0;
       d = d$1;
      }
    }
    function isortto(srcofs, dst, dstofs, len){
     var b = len - 1 | 0;
     if(b >= 0){
      var i = 0;
      a:
      for(;;){
       var
        c = srcofs + i | 0,
        e = caml_check_bound(a, c)[c + 1],
        j = (dstofs + i | 0) - 1 | 0;
       for(;;){
        if
         (dstofs <= j
          && 0 < caml_call2(cmp, caml_check_bound(dst, j)[j + 1], e)){
         var d = j + 1 | 0, g = caml_check_bound(dst, j)[j + 1];
         caml_check_bound(dst, d)[d + 1] = g;
         var j$0 = j - 1 | 0;
         j = j$0;
         continue;
        }
        var f = j + 1 | 0;
        caml_check_bound(dst, f)[f + 1] = e;
        var h = i + 1 | 0;
        if(b === i) break a;
        i = h;
        break;
       }
      }
     }
     return 0;
    }
    function sortto(srcofs, dst, dstofs, len){
     if(len <= 5) return isortto(srcofs, dst, dstofs, len);
     var l1 = len / 2 | 0, l2 = len - l1 | 0;
     sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2);
     sortto(srcofs, a, srcofs + l2 | 0, l1);
     return merge(srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs);
    }
    var l = a.length - 1;
    if(l <= 5) return isortto(0, a, 0, l);
    var l1 = l / 2 | 0, l2 = l - l1 | 0, t = caml_floatarray_create(l2);
    sortto(l1, t, 0, l2);
    sortto(0, a, l2, l1);
    return merge(l2, l1, t, 0, l2, a, 0);
   }
   function shuffle(rand, a){
    var b = a.length - 2 | 0;
    if(b >= 1){
     var i = b;
     for(;;){
      var j = caml_call1(rand, i + 1 | 0), v = a[i + 1];
      a[i + 1] = caml_check_bound(a, j)[j + 1];
      a[j + 1] = v;
      var c = i - 1 | 0;
      if(1 === i) break;
      i = c;
     }
    }
    return 0;
   }
   function to_seq(a){
    function aux(i, param){
     if(i >= a.length - 1) return 0;
     var x = a[i + 1], b = i + 1 | 0;
     return [0, x, function(a){return aux(b, a);}];
    }
    return function(a){return aux(0, a);};
   }
   function to_seqi(a){
    function aux(i, param){
     if(i >= a.length - 1) return 0;
     var x = a[i + 1], b = i + 1 | 0;
     return [0, [0, i, x], function(a){return aux(b, a);}];
    }
    return function(a){return aux(0, a);};
   }
   function of_seq(i$2){
    var
     l =
       Stdlib_Seq[5].call(null, function(acc, x){return [0, x, acc];}, 0, i$2),
     len = Stdlib_List[1].call(null, l),
     a = caml_floatarray_create(len),
     i$1 = len - 1 | 0,
     i = i$1,
     param = l;
    for(;;){
     if(! param) return a;
     var tl = param[2], hd = param[1];
     a[i + 1] = hd;
     var i$0 = i - 1 | 0;
     i = i$0;
     param = tl;
    }
   }
   function map_to_array(f, a){
    var l = a.length - 1;
    if(0 === l) return [0];
    var r = caml_make_vect(l, caml_call1(f, a[1])), b = l - 1 | 0;
    if(b >= 1){
     var i = 1;
     for(;;){
      r[i + 1] = caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return r;
   }
   function map_from_array(f, a){
    var l = a.length - 1, r = caml_floatarray_create(l), b = l - 1 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      r[i + 1] = caml_call1(f, a[i + 1]);
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return r;
   }
   var
    Stdlib_Float =
      [0,
       0.,
       1.,
       -1.,
       succ,
       pred,
       infinity,
       neg_infinity,
       nan,
       NaN,
       nan,
       3.141592653589793,
       max_float,
       min_float,
       epsilon,
       is_finite,
       is_infinite,
       is_nan,
       is_integer,
       of_string_opt,
       to_string,
       caml_float_compare,
       equal,
       min,
       max,
       min_max,
       min_num,
       max_num,
       min_max_num,
       seeded_hash,
       hash,
       [0,
        function(a){return a.length - 1;},
        function(b, a){return caml_check_bound(b, a)[a + 1];},
        function(c, a, b){caml_check_bound(c, a)[a + 1] = b; return 0;},
        make,
        caml_floatarray_create,
        init,
        make_matrix,
        init_matrix,
        append,
        concat,
        sub,
        copy,
        fill,
        blit,
        to_list,
        of_list,
        iter,
        iteri,
        map,
        map_inplace,
        mapi,
        mapi_inplace,
        fold_left,
        fold_right,
        iter2,
        map2,
        for_all,
        exists,
        mem,
        mem_ieee,
        find_opt,
        find_index,
        find_map,
        find_mapi,
        sort,
        stable_sort,
        stable_sort,
        shuffle,
        to_seq,
        to_seqi,
        of_seq,
        map_to_array,
        map_from_array],
       [0,
        function(a){return a.length - 1;},
        function(b, a){return caml_check_bound(b, a)[a + 1];},
        function(c, a, b){caml_check_bound(c, a)[a + 1] = b; return 0;},
        make,
        caml_floatarray_create,
        init,
        make_matrix,
        init_matrix,
        append,
        concat,
        sub,
        copy,
        fill,
        blit,
        to_list,
        of_list,
        iter,
        iteri,
        map,
        map_inplace,
        mapi,
        mapi_inplace,
        fold_left,
        fold_right,
        iter2,
        map2,
        for_all,
        exists,
        mem,
        mem_ieee,
        find_opt,
        find_index,
        find_map,
        find_mapi,
        sort,
        stable_sort,
        stable_sort,
        shuffle,
        to_seq,
        to_seqi,
        of_seq,
        map_to_array,
        map_from_array]];
   runtime.caml_register_global(25, Stdlib_Float, "Stdlib__Float");
   return;
  }
  (globalThis));

//# 7049 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Int32:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1),N,N,F(1)*,F(1),F(1),F(1)*,F(2)*,F(2)*,F(2),F(2),F(2),F(2)*,F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_greaterequal = runtime.caml_greaterequal,
    caml_hash = runtime.caml_hash,
    caml_int_compare = runtime.caml_int_compare,
    caml_lessequal = runtime.caml_lessequal,
    caml_lessthan = runtime.caml_lessthan,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_mul = runtime.caml_mul,
    caml_wrap_exception = runtime.caml_wrap_exception,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Sys = global_data.Stdlib__Sys,
    Assert_failure = global_data.Assert_failure;
   function succ(n){return n + 1 | 0;}
   function pred(n){return n - 1 | 0;}
   function abs(n){return caml_greaterequal(n, 0) ? n : - n | 0;}
   function lognot(n){return n ^ -1;}
   var match = Stdlib_Sys[9];
   if(32 === match)
    var
     max_int = Stdlib[19],
     unsigned_to_int =
       function(n){
        if(caml_greaterequal(n, 0) && caml_lessequal(n, max_int))
         return [0, n];
        return 0;
       };
   else{
    if(64 !== match)
     throw caml_maybe_attach_backtrace
            ([0, Assert_failure, [0, "int32.ml", 69, 6]], 1);
    var unsigned_to_int = function(n){return [0, n & -1];};
   }
   function to_string(n){return runtime.caml_format_int("%d", n);}
   function of_string_opt(s){
    try{var a = [0, runtime.caml_int_of_string(s)]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Stdlib[7]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   var equal = runtime.caml_equal;
   function unsigned_compare(n, m){
    var y = m + 2147483648 | 0, x = n + 2147483648 | 0;
    return caml_int_compare(x, y);
   }
   function unsigned_lt(n, m){
    return caml_lessthan(n + 2147483648 | 0, m + 2147483648 | 0);
   }
   function min(x, y){return caml_lessequal(x, y) ? x : y;}
   function max(x, y){return caml_greaterequal(x, y) ? x : y;}
   var zero = 0, one = 1;
   function unsigned_div(n, d){
    if(caml_lessthan(d, 0)) return unsigned_lt(n, d) ? zero : one;
    var q = runtime.caml_div(n >>> 1 | 0, d) << 1, r = n - caml_mul(q, d) | 0;
    return unsigned_lt(r, d) ? q : q + 1 | 0;
   }
   function unsigned_rem(n, d){
    return n - caml_mul(unsigned_div(n, d), d) | 0;
   }
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function hash(x){return caml_hash(10, 100, 0, x);}
   var
    Stdlib_Int32 =
      [0,
       zero,
       one,
       -1,
       unsigned_div,
       unsigned_rem,
       succ,
       pred,
       abs,
       2147483647,
       -2147483648,
       lognot,
       unsigned_to_int,
       of_string_opt,
       to_string,
       caml_int_compare,
       unsigned_compare,
       equal,
       min,
       max,
       seeded_hash,
       hash];
   runtime.caml_register_global(15, Stdlib_Int32, "Stdlib__Int32");
   return;
  }
  (globalThis));

//# 7148 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Int64:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1),N,N,F(1)*,F(1),F(1),F(1)*,F(2)*,F(2)*,F(2),F(2),F(2),F(2)*,F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_greaterequal = runtime.caml_greaterequal,
    caml_hash = runtime.caml_hash,
    caml_int64_add = runtime.caml_int64_add,
    caml_int64_compare = runtime.caml_int64_compare,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_int64_mul = runtime.caml_int64_mul,
    caml_int64_sub = runtime.caml_int64_sub,
    caml_lessequal = runtime.caml_lessequal,
    caml_lessthan = runtime.caml_lessthan,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception,
    a = caml_int64_create_lo_mi_hi(1, 0, 0),
    zero = caml_int64_create_lo_mi_hi(0, 0, 0),
    one = caml_int64_create_lo_mi_hi(1, 0, 0),
    minus_one = caml_int64_create_lo_mi_hi(16777215, 16777215, 65535),
    min_int = caml_int64_create_lo_mi_hi(0, 0, 32768),
    max_int = caml_int64_create_lo_mi_hi(16777215, 16777215, 32767),
    Stdlib = runtime.caml_get_global_data().Stdlib,
    b = caml_int64_create_lo_mi_hi(1, 0, 0),
    c = caml_int64_create_lo_mi_hi(0, 0, 0),
    d = caml_int64_create_lo_mi_hi(16777215, 16777215, 65535);
   function succ(n){return caml_int64_add(n, a);}
   function pred(n){return caml_int64_sub(n, b);}
   function abs(n){
    return caml_greaterequal(n, c) ? n : runtime.caml_int64_neg(n);
   }
   function lognot(n){return runtime.caml_int64_xor(n, d);}
   var
    max_int$0 = runtime.caml_int64_of_int32(Stdlib[19]),
    e = caml_int64_create_lo_mi_hi(0, 0, 0);
   function unsigned_to_int(n){
    if(caml_greaterequal(n, e) && caml_lessequal(n, max_int$0))
     return [0, runtime.caml_int64_to_int32(n)];
    return 0;
   }
   function to_string(n){return runtime.caml_int64_format("%d", n);}
   function of_string_opt(s){
    try{var a = [0, runtime.caml_int64_of_string(s)]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Stdlib[7]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function compare(x, y){return caml_int64_compare(x, y);}
   var equal = runtime.caml_equal;
   function unsigned_compare(n, m){
    var y = caml_int64_sub(m, min_int), x = caml_int64_sub(n, min_int);
    return caml_int64_compare(x, y);
   }
   function unsigned_lt(n, m){
    return caml_lessthan
            (caml_int64_sub(n, min_int), caml_int64_sub(m, min_int));
   }
   function min(x, y){return caml_lessequal(x, y) ? x : y;}
   function max(x, y){return caml_greaterequal(x, y) ? x : y;}
   function unsigned_div(n, d){
    if(caml_lessthan(d, zero)) return unsigned_lt(n, d) ? zero : one;
    var
     q =
       runtime.caml_int64_shift_left
        (runtime.caml_int64_div
          (runtime.caml_int64_shift_right_unsigned(n, 1), d),
         1),
     r = caml_int64_sub(n, caml_int64_mul(q, d));
    return unsigned_lt(r, d) ? q : caml_int64_add(q, a);
   }
   function unsigned_rem(n, d){
    return caml_int64_sub(n, caml_int64_mul(unsigned_div(n, d), d));
   }
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function hash(x){return caml_hash(10, 100, 0, x);}
   runtime.caml_register_global
    (12,
     [0,
      zero,
      one,
      minus_one,
      unsigned_div,
      unsigned_rem,
      succ,
      pred,
      abs,
      max_int,
      min_int,
      lognot,
      unsigned_to_int,
      of_string_opt,
      to_string,
      compare,
      unsigned_compare,
      equal,
      min,
      max,
      seeded_hash,
      hash],
     "Stdlib__Int64");
   return;
  }
  (globalThis));

//# 7257 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Nativeint:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1),N,N,N,F(1)*,F(1),F(1),F(1)*,F(2)*,F(2)*,F(2)*,F(2),F(2),F(2)*,F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_greaterequal = runtime.caml_greaterequal,
    caml_hash = runtime.caml_hash,
    caml_int_compare = runtime.caml_int_compare,
    caml_lessequal = runtime.caml_lessequal,
    caml_lessthan = runtime.caml_lessthan,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_mul = runtime.caml_mul,
    caml_wrap_exception = runtime.caml_wrap_exception,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Sys = global_data.Stdlib__Sys;
   function succ(n){return n + 1 | 0;}
   function pred(n){return n - 1 | 0;}
   function abs(n){return caml_greaterequal(n, 0) ? n : - n | 0;}
   var
    size = Stdlib_Sys[9],
    min_int = 1 << (size - 1 | 0),
    max_int = min_int - 1 | 0;
   function lognot(n){return n ^ -1;}
   var max_int$0 = Stdlib[19];
   function unsigned_to_int(n){
    if(caml_greaterequal(n, 0) && caml_lessequal(n, max_int$0)) return [0, n];
    return 0;
   }
   function to_string(n){return runtime.caml_format_int("%d", n);}
   function of_string_opt(s){
    try{var a = [0, runtime.caml_int_of_string(s)]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Stdlib[7]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function equal(x, y){return 0 === caml_int_compare(x, y) ? 1 : 0;}
   function unsigned_compare(n, m){
    var y = m - min_int | 0, x = n - min_int | 0;
    return caml_int_compare(x, y);
   }
   function unsigned_lt(n, m){
    return caml_lessthan(n - min_int | 0, m - min_int | 0);
   }
   function min(x, y){return caml_lessequal(x, y) ? x : y;}
   function max(x, y){return caml_greaterequal(x, y) ? x : y;}
   var zero = 0, one = 1;
   function unsigned_div(n, d){
    if(caml_lessthan(d, 0)) return unsigned_lt(n, d) ? zero : one;
    var q = runtime.caml_div(n >>> 1 | 0, d) << 1, r = n - caml_mul(q, d) | 0;
    return unsigned_lt(r, d) ? q : q + 1 | 0;
   }
   function unsigned_rem(n, d){
    return n - caml_mul(unsigned_div(n, d), d) | 0;
   }
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function hash(x){return caml_hash(10, 100, 0, x);}
   runtime.caml_register_global
    (13,
     [0,
      zero,
      one,
      -1,
      unsigned_div,
      unsigned_rem,
      succ,
      pred,
      abs,
      size,
      max_int,
      min_int,
      lognot,
      unsigned_to_int,
      of_string_opt,
      to_string,
      caml_int_compare,
      unsigned_compare,
      equal,
      min,
      max,
      seeded_hash,
      hash],
     "Stdlib__Nativeint");
   return;
  }
  (globalThis));

//# 7778 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Set:[F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_List = global_data.Stdlib__List,
    Assert_failure = global_data.Assert_failure,
    a = [0, 0, 0, 0],
    b = [0, 0, 0],
    c = [0, "set.ml", 571, 18],
    Stdlib_Set =
      [0,
       function(Ord){
        function height(param){
         if(! param) return 0;
         var h = param[4];
         return h;
        }
        function create(l, v, r){
         if(l) var h = l[4], hl = h; else var hl = 0;
         if(r) var h$0 = r[4], hr = h$0; else var hr = 0;
         var a = hr <= hl ? hl + 1 | 0 : hr + 1 | 0;
         return [0, l, v, r, a];
        }
        function bal(l, v, r){
         if(l) var h = l[4], hl = h; else var hl = 0;
         if(r) var h$0 = r[4], hr = h$0; else var hr = 0;
         var cst_Set_bal = "Set.bal";
         if((hr + 2 | 0) < hl){
          if(! l) return Stdlib[1].call(null, cst_Set_bal);
          var lr = l[3], lv = l[2], ll = l[1], a = height(lr);
          if(a <= height(ll)) return create(ll, lv, create(lr, v, r));
          if(! lr) return Stdlib[1].call(null, cst_Set_bal);
          var lrr = lr[3], lrv = lr[2], lrl = lr[1], b = create(lrr, v, r);
          return create(create(ll, lv, lrl), lrv, b);
         }
         if((hl + 2 | 0) >= hr){
          var e = hr <= hl ? hl + 1 | 0 : hr + 1 | 0;
          return [0, l, v, r, e];
         }
         if(! r) return Stdlib[1].call(null, cst_Set_bal);
         var rr = r[3], rv = r[2], rl = r[1], c = height(rl);
         if(c <= height(rr)) return create(create(l, v, rl), rv, rr);
         if(! rl) return Stdlib[1].call(null, cst_Set_bal);
         var rlr = rl[3], rlv = rl[2], rll = rl[1], d = create(rlr, rv, rr);
         return create(create(l, v, rll), rlv, d);
        }
        function add(x, t){
         if(! t) return [0, 0, x, 0, 1];
         var r = t[3], v = t[2], l = t[1], c = caml_call2(Ord[1], x, v);
         if(0 === c) return t;
         if(0 <= c){var rr = add(x, r); return r === rr ? t : bal(l, v, rr);}
         var ll = add(x, l);
         return l === ll ? t : bal(ll, v, r);
        }
        function singleton(x){return [0, 0, x, 0, 1];}
        function add_min_element(x, param){
         if(! param) return singleton(x);
         var r = param[3], v = param[2], l = param[1];
         return bal(add_min_element(x, l), v, r);
        }
        function add_max_element(x, param){
         if(! param) return singleton(x);
         var r = param[3], v = param[2], l = param[1];
         return bal(l, v, add_max_element(x, r));
        }
        function join(l, v, r){
         if(! l) return add_min_element(v, r);
         if(! r) return add_max_element(v, l);
         var
          rh = r[4],
          rr = r[3],
          rv = r[2],
          rl = r[1],
          lh = l[4],
          lr = l[3],
          lv = l[2],
          ll = l[1];
         return (rh + 2 | 0) < lh
                 ? bal(ll, lv, join(lr, v, r))
                 : (lh
                   + 2
                   | 0)
                   < rh
                   ? bal(join(l, v, rl), rv, rr)
                   : create(l, v, r);
        }
        function min_elt(param$0){
         var param = param$0;
         for(;;){
          if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var l = param[1];
          if(! l){var v = param[2]; return v;}
          param = l;
         }
        }
        function min_elt_opt(param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var l = param[1];
          if(! l){var v = param[2]; return [0, v];}
          param = l;
         }
        }
        function max_elt(param$0){
         var param = param$0;
         for(;;){
          if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          if(! param[3]){var v = param[2]; return v;}
          var r = param[3];
          param = r;
         }
        }
        function max_elt_opt(param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          if(! param[3]){var v = param[2]; return [0, v];}
          var r = param[3];
          param = r;
         }
        }
        function remove_min_elt(param){
         if(! param) return Stdlib[1].call(null, "Set.remove_min_elt");
         var l = param[1];
         if(l){
          var r = param[3], v = param[2];
          return bal(remove_min_elt(l), v, r);
         }
         var r$0 = param[3];
         return r$0;
        }
        function concat(t1, t2){
         if(! t1) return t2;
         if(! t2) return t1;
         var a = remove_min_elt(t2);
         return join(t1, min_elt(t2), a);
        }
        function split(x, param){
         if(! param) return a;
         var
          r = param[3],
          v = param[2],
          l = param[1],
          c = caml_call2(Ord[1], x, v);
         if(0 === c) return [0, l, 1, r];
         if(0 <= c){
          var
           match = split(x, r),
           rr = match[3],
           pres = match[2],
           lr = match[1];
          return [0, join(l, v, lr), pres, rr];
         }
         var
          match$0 = split(x, l),
          rl = match$0[3],
          pres$0 = match$0[2],
          ll = match$0[1];
         return [0, ll, pres$0, join(rl, v, r)];
        }
        function is_empty(param){return param ? 0 : 1;}
        function mem(x, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var
           r = param[3],
           v = param[2],
           l = param[1],
           c = caml_call2(Ord[1], x, v),
           a = 0 === c ? 1 : 0;
          if(a) return a;
          param = 0 <= c ? r : l;
         }
        }
        function remove(x, t){
         if(! t) return 0;
         var t2 = t[3], v = t[2], t1 = t[1], c = caml_call2(Ord[1], x, v);
         if(0 === c){
          if(! t1) return t2;
          if(! t2) return t1;
          var a = remove_min_elt(t2);
          return bal(t1, min_elt(t2), a);
         }
         if(0 <= c){
          var rr = remove(x, t2);
          return t2 === rr ? t : bal(t1, v, rr);
         }
         var ll = remove(x, t1);
         return t1 === ll ? t : bal(ll, v, t2);
        }
        function union(s1, s2){
         if(! s1) return s2;
         if(! s2) return s1;
         var
          h2 = s2[4],
          r2 = s2[3],
          v2 = s2[2],
          l2 = s2[1],
          h1 = s1[4],
          r1 = s1[3],
          v1 = s1[2],
          l1 = s1[1];
         if(h2 <= h1){
          if(1 === h2) return add(v2, s1);
          var
           match = split(v1, s2),
           r2$0 = match[3],
           l2$0 = match[1],
           a = union(r1, r2$0);
          return join(union(l1, l2$0), v1, a);
         }
         if(1 === h1) return add(v1, s2);
         var
          match$0 = split(v2, s1),
          r1$0 = match$0[3],
          l1$0 = match$0[1],
          b = union(r1$0, r2);
         return join(union(l1$0, l2), v2, b);
        }
        function inter(s1, s2){
         if(! s1) return 0;
         if(! s2) return 0;
         var r1 = s1[3], v1 = s1[2], l1 = s1[1], a = split(v1, s2), l2 = a[1];
         if(a[2]){
          var r2 = a[3], b = inter(r1, r2);
          return join(inter(l1, l2), v1, b);
         }
         var r2$0 = a[3], c = inter(r1, r2$0);
         return concat(inter(l1, l2), c);
        }
        function split_bis(x, param){
         if(! param) return [0, 0, function(param){return 0;}];
         var
          r = param[3],
          v = param[2],
          l = param[1],
          c = caml_call2(Ord[1], x, v);
         if(0 === c) return 0;
         if(0 <= c){
          var match = split_bis(x, r);
          if(! match) return 0;
          var rr = match[2], lr = match[1];
          return [0, join(l, v, lr), rr];
         }
         var match$0 = split_bis(x, l);
         if(! match$0) return 0;
         var rl = match$0[2], ll = match$0[1];
         return [0, ll, function(param){return join(rl(0), v, r);}];
        }
        function disjoint(s1$0, s2$1){
         var s1 = s1$0, s2 = s2$1;
         for(;;){
          if(s1 && s2){
           var r1 = s1[3], v1 = s1[2], l1 = s1[1];
           if(s1 === s2) return 0;
           var match = split_bis(v1, s2);
           if(! match) return 0;
           var r2 = match[2], l2 = match[1], a = disjoint(l1, l2);
           if(! a) return a;
           var s2$0 = r2(0);
           s1 = r1;
           s2 = s2$0;
           continue;
          }
          return 1;
         }
        }
        function diff(s1, s2){
         if(! s1) return 0;
         if(! s2) return s1;
         var r1 = s1[3], v1 = s1[2], l1 = s1[1], a = split(v1, s2), l2 = a[1];
         if(a[2]){
          var r2 = a[3], b = diff(r1, r2);
          return concat(diff(l1, l2), b);
         }
         var r2$0 = a[3], c = diff(r1, r2$0);
         return join(diff(l1, l2), v1, c);
        }
        function cons_enum(s$0, e$1){
         var s = s$0, e = e$1;
         for(;;){
          if(! s) return e;
          var r = s[3], v = s[2], l = s[1], e$0 = [0, v, r, e];
          s = l;
          e = e$0;
         }
        }
        function compare(s1, s2){
         var
          e2$2 = cons_enum(s2, 0),
          e1$2 = cons_enum(s1, 0),
          e1 = e1$2,
          e2 = e2$2;
         for(;;){
          if(! e1) return e2 ? -1 : 0;
          if(! e2) return 1;
          var
           e2$0 = e2[3],
           r2 = e2[2],
           v2 = e2[1],
           e1$0 = e1[3],
           r1 = e1[2],
           v1 = e1[1],
           c = caml_call2(Ord[1], v1, v2);
          if(0 !== c) return c;
          var e2$1 = cons_enum(r2, e2$0), e1$1 = cons_enum(r1, e1$0);
          e1 = e1$1;
          e2 = e2$1;
         }
        }
        function equal(s1, s2){return 0 === compare(s1, s2) ? 1 : 0;}
        function subset(s1$0, s2$0){
         var s1 = s1$0, s2 = s2$0;
         for(;;){
          if(! s1) return 1;
          if(! s2) return 0;
          var
           r2 = s2[3],
           v2 = s2[2],
           l2 = s2[1],
           r1 = s1[3],
           v1 = s1[2],
           l1 = s1[1],
           c = caml_call2(Ord[1], v1, v2);
          if(0 === c){
           var a = subset(l1, l2);
           if(! a) return a;
           s1 = r1;
           s2 = r2;
          }
          else if(0 <= c){
           var b = subset([0, 0, v1, r1, 0], r2);
           if(! b) return b;
           s1 = l1;
          }
          else{
           var d = subset([0, l1, v1, 0, 0], l2);
           if(! d) return d;
           s1 = r1;
          }
         }
        }
        function iter(f, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var r = param[3], v = param[2], l = param[1];
          iter(f, l);
          caml_call1(f, v);
          param = r;
         }
        }
        function fold(f, s$0, accu$1){
         var s = s$0, accu = accu$1;
         for(;;){
          if(! s) return accu;
          var
           r = s[3],
           v = s[2],
           l = s[1],
           accu$0 = caml_call2(f, v, fold(f, l, accu));
          s = r;
          accu = accu$0;
         }
        }
        function for_all(p, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 1;
          var r = param[3], v = param[2], l = param[1], a = caml_call1(p, v);
          if(a){
           var b = for_all(p, l);
           if(b){param = r; continue;}
           var c = b;
          }
          else
           var c = a;
          return c;
         }
        }
        function exists(p, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var r = param[3], v = param[2], l = param[1], a = caml_call1(p, v);
          if(a)
           var b = a;
          else{var c = exists(p, l); if(! c){param = r; continue;} var b = c;}
          return b;
         }
        }
        function filter(p, t){
         if(! t) return 0;
         var
          r = t[3],
          v = t[2],
          l = t[1],
          l$0 = filter(p, l),
          pv = caml_call1(p, v),
          r$0 = filter(p, r);
         if(! pv) return concat(l$0, r$0);
         if(l === l$0 && r === r$0) return t;
         return join(l$0, v, r$0);
        }
        function partition(p, param){
         if(! param) return b;
         var
          r = param[3],
          v = param[2],
          l = param[1],
          match = partition(p, l),
          lf = match[2],
          lt = match[1],
          pv = caml_call1(p, v),
          match$0 = partition(p, r),
          rf = match$0[2],
          rt = match$0[1];
         if(pv){var a = concat(lf, rf); return [0, join(lt, v, rt), a];}
         var c = join(lf, v, rf);
         return [0, concat(lt, rt), c];
        }
        function cardinal(param){
         if(! param) return 0;
         var r = param[3], l = param[1], a = cardinal(r);
         return (cardinal(l) + 1 | 0) + a | 0;
        }
        function elements_aux(accu$1, param$0){
         var accu = accu$1, param = param$0;
         for(;;){
          if(! param) return accu;
          var
           r = param[3],
           v = param[2],
           l = param[1],
           accu$0 = [0, v, elements_aux(accu, r)];
          accu = accu$0;
          param = l;
         }
        }
        function elements(s){return elements_aux(0, s);}
        function find(x, param$0){
         var param = param$0;
         for(;;){
          if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var
           r = param[3],
           v = param[2],
           l = param[1],
           c = caml_call2(Ord[1], x, v);
          if(0 === c) return v;
          param = 0 <= c ? r : l;
         }
        }
        function find_first(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var r$0 = param$0[3], v0$1 = param$0[2], l$0 = param$0[1];
          if(caml_call1(f, v0$1)){var v0 = v0$1, param = l$0; break;}
          param$0 = r$0;
         }
         for(;;){
          if(! param) return v0;
          var r = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){v0 = v0$0; param = l;} else param = r;
         }
        }
        function find_first_opt(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) return 0;
          var r$0 = param$0[3], v0$1 = param$0[2], l$0 = param$0[1];
          if(caml_call1(f, v0$1)){var v0 = v0$1, param = l$0; break;}
          param$0 = r$0;
         }
         for(;;){
          if(! param) return [0, v0];
          var r = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){v0 = v0$0; param = l;} else param = r;
         }
        }
        function find_last(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var r$0 = param$0[3], v0$1 = param$0[2], l$0 = param$0[1];
          if(caml_call1(f, v0$1)){var v0 = v0$1, param = r$0; break;}
          param$0 = l$0;
         }
         for(;;){
          if(! param) return v0;
          var r = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){v0 = v0$0; param = r;} else param = l;
         }
        }
        function find_last_opt(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) return 0;
          var r$0 = param$0[3], v0$1 = param$0[2], l$0 = param$0[1];
          if(caml_call1(f, v0$1)){var v0 = v0$1, param = r$0; break;}
          param$0 = l$0;
         }
         for(;;){
          if(! param) return [0, v0];
          var r = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){v0 = v0$0; param = r;} else param = l;
         }
        }
        function find_opt(x, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var
           r = param[3],
           v = param[2],
           l = param[1],
           c = caml_call2(Ord[1], x, v);
          if(0 === c) return [0, v];
          param = 0 <= c ? r : l;
         }
        }
        function try_join(l, v, r){
         a:
         {
          if(0 !== l){
           var b = max_elt(l);
           if(0 <= caml_call2(Ord[1], b, v)) break a;
          }
          if(0 !== r){
           var a = min_elt(r);
           if(0 <= caml_call2(Ord[1], v, a)) break a;
          }
          return join(l, v, r);
         }
         return union(l, add(v, r));
        }
        function map(f, t){
         if(! t) return 0;
         var
          r = t[3],
          v = t[2],
          l = t[1],
          l$0 = map(f, l),
          v$0 = caml_call1(f, v),
          r$0 = map(f, r);
         if(l === l$0 && v === v$0 && r === r$0) return t;
         return try_join(l$0, v$0, r$0);
        }
        function filter_map(f, t){
         if(! t) return 0;
         var
          r = t[3],
          v = t[2],
          l = t[1],
          t1 = filter_map(f, l),
          v$0 = caml_call1(f, v),
          t2 = filter_map(f, r);
         if(v$0){
          var v$1 = v$0[1];
          if(l === t1 && v === v$1 && r === t2) return t;
          return try_join(t1, v$1, t2);
         }
         if(! t1) return t2;
         if(! t2) return t1;
         var a = remove_min_elt(t2);
         return try_join(t1, min_elt(t2), a);
        }
        var empty = 0;
        function of_list(l){
         if(! l) return empty;
         var match = l[2], x0 = l[1];
         if(! match) return singleton(x0);
         var match$0 = match[2], x1 = match[1];
         if(! match$0) return add(x1, singleton(x0));
         var match$1 = match$0[2], x2 = match$0[1];
         if(! match$1) return add(x2, add(x1, singleton(x0)));
         var match$2 = match$1[2], x3 = match$1[1];
         if(! match$2) return add(x3, add(x2, add(x1, singleton(x0))));
         if(match$2[2]){
          var
           l$0 = Stdlib_List[62].call(null, Ord[1], l),
           sub =
             function(n, l){
              if(3 >= n >>> 0)
               switch(n){
                 case 0:
                  return [0, 0, l];
                 case 1:
                  if(l){
                   var l$3 = l[2], x0 = l[1];
                   return [0, [0, 0, x0, 0, 1], l$3];
                  }
                  break;
                 case 2:
                  if(l){
                   var match$1 = l[2];
                   if(match$1){
                    var l$4 = match$1[2], x1 = match$1[1], x0$0 = l[1];
                    return [0, [0, [0, 0, x0$0, 0, 1], x1, 0, 2], l$4];
                   }
                  }
                  break;
                 default:
                  if(l){
                   var a = l[2];
                   if(a){
                    var match$2 = a[2];
                    if(match$2){
                     var
                      l$5 = match$2[2],
                      x2 = match$2[1],
                      x1$0 = a[1],
                      x0$1 = l[1];
                     return [0,
                             [0, [0, 0, x0$1, 0, 1], x1$0, [0, 0, x2, 0, 1], 2],
                             l$5];
                    }
                   }
                  }
               }
              var
               nl = n / 2 | 0,
               match = sub(nl, l),
               l$0 = match[2],
               left = match[1];
              if(! l$0)
               throw caml_maybe_attach_backtrace([0, Assert_failure, c], 1);
              var
               l$1 = l$0[2],
               mid = l$0[1],
               match$0 = sub((n - nl | 0) - 1 | 0, l$1),
               l$2 = match$0[2],
               right = match$0[1];
              return [0, create(left, mid, right), l$2];
             };
          return sub(Stdlib_List[1].call(null, l$0), l$0)[1];
         }
         var x4 = match$2[1];
         return add(x4, add(x3, add(x2, add(x1, singleton(x0)))));
        }
        function add_seq(i, m){
         return Stdlib_Seq[5].call
                 (null, function(s, x){return add(x, s);}, m, i);
        }
        function of_seq(i){return add_seq(i, empty);}
        function seq_of_enum(c, param){
         if(! c) return 0;
         var rest = c[3], t = c[2], x = c[1], a = cons_enum(t, rest);
         return [0, x, function(b){return seq_of_enum(a, b);}];
        }
        function to_seq(c){
         var a = cons_enum(c, 0);
         return function(b){return seq_of_enum(a, b);};
        }
        function snoc_enum(s$0, e$1){
         var s = s$0, e = e$1;
         for(;;){
          if(! s) return e;
          var r = s[3], v = s[2], l = s[1], e$0 = [0, v, l, e];
          s = r;
          e = e$0;
         }
        }
        function rev_seq_of_enum(c, param){
         if(! c) return 0;
         var rest = c[3], t = c[2], x = c[1], a = snoc_enum(t, rest);
         return [0, x, function(b){return rev_seq_of_enum(a, b);}];
        }
        function to_rev_seq(c){
         var a = snoc_enum(c, 0);
         return function(b){return rev_seq_of_enum(a, b);};
        }
        function to_seq_from(low, s){
         a:
         {
          var s$0 = s, c = 0;
          for(;;){
           if(! s$0){var a = c; break a;}
           var
            r = s$0[3],
            v = s$0[2],
            l = s$0[1],
            n = caml_call2(Ord[1], v, low);
           if(0 === n) break;
           if(0 <= n){var c$0 = [0, v, r, c]; s$0 = l; c = c$0;} else s$0 = r;
          }
          var a = [0, v, r, c];
         }
         return function(b){return seq_of_enum(a, b);};
        }
        return [0,
                empty,
                add,
                singleton,
                remove,
                union,
                inter,
                disjoint,
                diff,
                cardinal,
                elements,
                min_elt,
                min_elt_opt,
                max_elt,
                max_elt_opt,
                min_elt,
                min_elt_opt,
                find,
                find_opt,
                find_first,
                find_first_opt,
                find_last,
                find_last_opt,
                iter,
                fold,
                map,
                filter,
                filter_map,
                partition,
                split,
                is_empty,
                mem,
                equal,
                compare,
                subset,
                for_all,
                exists,
                elements,
                of_list,
                to_seq_from,
                to_seq,
                to_rev_seq,
                add_seq,
                of_seq];
       }];
   runtime.caml_register_global(12, Stdlib_Set, "Stdlib__Set");
   return;
  }
  (globalThis));

//# 8540 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Map:[F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Assert_failure = global_data.Assert_failure,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_List = global_data.Stdlib__List,
    a = [0, 0, 0, 0],
    b = [0, "map.ml", 408, 10],
    c = [0, 0, 0],
    Stdlib_Map =
      [0,
       function(Ord){
        function height(param){
         if(! param) return 0;
         var h = param[5];
         return h;
        }
        function create(l, x, d, r){
         var
          hl = height(l),
          hr = height(r),
          a = hr <= hl ? hl + 1 | 0 : hr + 1 | 0;
         return [0, l, x, d, r, a];
        }
        function singleton(x, d){return [0, 0, x, d, 0, 1];}
        function bal(l, x, d, r){
         if(l) var h = l[5], hl = h; else var hl = 0;
         if(r) var h$0 = r[5], hr = h$0; else var hr = 0;
         var cst_Map_bal = "Map.bal";
         if((hr + 2 | 0) < hl){
          if(! l) return Stdlib[1].call(null, cst_Map_bal);
          var lr = l[4], ld = l[3], lv = l[2], ll = l[1], a = height(lr);
          if(a <= height(ll)) return create(ll, lv, ld, create(lr, x, d, r));
          if(! lr) return Stdlib[1].call(null, cst_Map_bal);
          var
           lrr = lr[4],
           lrd = lr[3],
           lrv = lr[2],
           lrl = lr[1],
           b = create(lrr, x, d, r);
          return create(create(ll, lv, ld, lrl), lrv, lrd, b);
         }
         if((hl + 2 | 0) >= hr){
          var f = hr <= hl ? hl + 1 | 0 : hr + 1 | 0;
          return [0, l, x, d, r, f];
         }
         if(! r) return Stdlib[1].call(null, cst_Map_bal);
         var rr = r[4], rd = r[3], rv = r[2], rl = r[1], c = height(rl);
         if(c <= height(rr)) return create(create(l, x, d, rl), rv, rd, rr);
         if(! rl) return Stdlib[1].call(null, cst_Map_bal);
         var
          rlr = rl[4],
          rld = rl[3],
          rlv = rl[2],
          rll = rl[1],
          e = create(rlr, rv, rd, rr);
         return create(create(l, x, d, rll), rlv, rld, e);
        }
        function is_empty(param){return param ? 0 : 1;}
        function add(x, data, m){
         if(! m) return [0, 0, x, data, 0, 1];
         var
          h = m[5],
          r = m[4],
          d = m[3],
          v = m[2],
          l = m[1],
          c = caml_call2(Ord[1], x, v);
         if(0 === c) return d === data ? m : [0, l, x, data, r, h];
         if(0 <= c){
          var rr = add(x, data, r);
          return r === rr ? m : bal(l, v, d, rr);
         }
         var ll = add(x, data, l);
         return l === ll ? m : bal(ll, v, d, r);
        }
        function find(x, param$0){
         var param = param$0;
         for(;;){
          if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var
           r = param[4],
           d = param[3],
           v = param[2],
           l = param[1],
           c = caml_call2(Ord[1], x, v);
          if(0 === c) return d;
          param = 0 <= c ? r : l;
         }
        }
        function find_first(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var
           r$0 = param$0[4],
           d0$1 = param$0[3],
           v0$1 = param$0[2],
           l$0 = param$0[1];
          if(caml_call1(f, v0$1)){
           var v0 = v0$1, d0 = d0$1, param = l$0;
           break;
          }
          param$0 = r$0;
         }
         for(;;){
          if(! param) return [0, v0, d0];
          var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){
           v0 = v0$0;
           d0 = d0$0;
           param = l;
          }
          else
           param = r;
         }
        }
        function find_first_opt(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) return 0;
          var
           r$0 = param$0[4],
           d0$1 = param$0[3],
           v0$1 = param$0[2],
           l$0 = param$0[1];
          if(caml_call1(f, v0$1)){
           var v0 = v0$1, d0 = d0$1, param = l$0;
           break;
          }
          param$0 = r$0;
         }
         for(;;){
          if(! param) return [0, [0, v0, d0]];
          var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){
           v0 = v0$0;
           d0 = d0$0;
           param = l;
          }
          else
           param = r;
         }
        }
        function find_last(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var
           r$0 = param$0[4],
           d0$1 = param$0[3],
           v0$1 = param$0[2],
           l$0 = param$0[1];
          if(caml_call1(f, v0$1)){
           var v0 = v0$1, d0 = d0$1, param = r$0;
           break;
          }
          param$0 = l$0;
         }
         for(;;){
          if(! param) return [0, v0, d0];
          var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){
           v0 = v0$0;
           d0 = d0$0;
           param = r;
          }
          else
           param = l;
         }
        }
        function find_last_opt(f, param$1){
         var param$0 = param$1;
         for(;;){
          if(! param$0) return 0;
          var
           r$0 = param$0[4],
           d0$1 = param$0[3],
           v0$1 = param$0[2],
           l$0 = param$0[1];
          if(caml_call1(f, v0$1)){
           var v0 = v0$1, d0 = d0$1, param = r$0;
           break;
          }
          param$0 = l$0;
         }
         for(;;){
          if(! param) return [0, [0, v0, d0]];
          var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1];
          if(caml_call1(f, v0$0)){
           v0 = v0$0;
           d0 = d0$0;
           param = r;
          }
          else
           param = l;
         }
        }
        function find_opt(x, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var
           r = param[4],
           d = param[3],
           v = param[2],
           l = param[1],
           c = caml_call2(Ord[1], x, v);
          if(0 === c) return [0, d];
          param = 0 <= c ? r : l;
         }
        }
        function mem(x, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var
           r = param[4],
           v = param[2],
           l = param[1],
           c = caml_call2(Ord[1], x, v),
           a = 0 === c ? 1 : 0;
          if(a) return a;
          param = 0 <= c ? r : l;
         }
        }
        function min_binding(param$0){
         var param = param$0;
         for(;;){
          if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          var l = param[1];
          if(! l){var d = param[3], v = param[2]; return [0, v, d];}
          param = l;
         }
        }
        function min_binding_opt(param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var l = param[1];
          if(! l){var d = param[3], v = param[2]; return [0, [0, v, d]];}
          param = l;
         }
        }
        function max_binding(param$0){
         var param = param$0;
         for(;;){
          if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          if(! param[4]){var d = param[3], v = param[2]; return [0, v, d];}
          var r = param[4];
          param = r;
         }
        }
        function max_binding_opt(param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          if(! param[4]){
           var d = param[3], v = param[2];
           return [0, [0, v, d]];
          }
          var r = param[4];
          param = r;
         }
        }
        function remove_min_binding(param){
         if(! param) return Stdlib[1].call(null, "Map.remove_min_elt");
         var l = param[1];
         if(l){
          var r = param[4], d = param[3], v = param[2];
          return bal(remove_min_binding(l), v, d, r);
         }
         var r$0 = param[4];
         return r$0;
        }
        function d(t1, t2){
         if(! t1) return t2;
         if(! t2) return t1;
         var match = min_binding(t2), d = match[2], x = match[1];
         return bal(t1, x, d, remove_min_binding(t2));
        }
        function remove(x, m){
         if(! m) return 0;
         var
          r = m[4],
          d$0 = m[3],
          v = m[2],
          l = m[1],
          c = caml_call2(Ord[1], x, v);
         if(0 === c) return d(l, r);
         if(0 <= c){
          var rr = remove(x, r);
          return r === rr ? m : bal(l, v, d$0, rr);
         }
         var ll = remove(x, l);
         return l === ll ? m : bal(ll, v, d$0, r);
        }
        function update(x, f, m){
         if(! m){
          var match$0 = caml_call1(f, 0);
          if(! match$0) return 0;
          var data$0 = match$0[1];
          return [0, 0, x, data$0, 0, 1];
         }
         var
          h = m[5],
          r = m[4],
          d$0 = m[3],
          v = m[2],
          l = m[1],
          c = caml_call2(Ord[1], x, v);
         if(0 === c){
          var match = caml_call1(f, [0, d$0]);
          if(! match) return d(l, r);
          var data = match[1];
          return d$0 === data ? m : [0, l, x, data, r, h];
         }
         if(0 <= c){
          var rr = update(x, f, r);
          return r === rr ? m : bal(l, v, d$0, rr);
         }
         var ll = update(x, f, l);
         return l === ll ? m : bal(ll, v, d$0, r);
        }
        function add_to_list(x, data, m){
         function add(param){
          if(! param) return [0, [0, data, 0]];
          var l = param[1];
          return [0, [0, data, l]];
         }
         return update(x, add, m);
        }
        function iter(f, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var r = param[4], d = param[3], v = param[2], l = param[1];
          iter(f, l);
          caml_call2(f, v, d);
          param = r;
         }
        }
        function map(f, param){
         if(! param) return 0;
         var
          h = param[5],
          r = param[4],
          d = param[3],
          v = param[2],
          l = param[1],
          l$0 = map(f, l),
          d$0 = caml_call1(f, d),
          r$0 = map(f, r);
         return [0, l$0, v, d$0, r$0, h];
        }
        function mapi(f, param){
         if(! param) return 0;
         var
          h = param[5],
          r = param[4],
          d = param[3],
          v = param[2],
          l = param[1],
          l$0 = mapi(f, l),
          d$0 = caml_call2(f, v, d),
          r$0 = mapi(f, r);
         return [0, l$0, v, d$0, r$0, h];
        }
        function fold(f, m$0, accu$1){
         var m = m$0, accu = accu$1;
         for(;;){
          if(! m) return accu;
          var
           r = m[4],
           d = m[3],
           v = m[2],
           l = m[1],
           accu$0 = caml_call3(f, v, d, fold(f, l, accu));
          m = r;
          accu = accu$0;
         }
        }
        function for_all(p, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 1;
          var
           r = param[4],
           d = param[3],
           v = param[2],
           l = param[1],
           a = caml_call2(p, v, d);
          if(a){
           var b = for_all(p, l);
           if(b){param = r; continue;}
           var c = b;
          }
          else
           var c = a;
          return c;
         }
        }
        function exists(p, param$0){
         var param = param$0;
         for(;;){
          if(! param) return 0;
          var
           r = param[4],
           d = param[3],
           v = param[2],
           l = param[1],
           a = caml_call2(p, v, d);
          if(a)
           var b = a;
          else{var c = exists(p, l); if(! c){param = r; continue;} var b = c;}
          return b;
         }
        }
        function add_min_binding(k, x, param){
         if(! param) return singleton(k, x);
         var r = param[4], d = param[3], v = param[2], l = param[1];
         return bal(add_min_binding(k, x, l), v, d, r);
        }
        function add_max_binding(k, x, param){
         if(! param) return singleton(k, x);
         var r = param[4], d = param[3], v = param[2], l = param[1];
         return bal(l, v, d, add_max_binding(k, x, r));
        }
        function join(l, v, d, r){
         if(! l) return add_min_binding(v, d, r);
         if(! r) return add_max_binding(v, d, l);
         var
          rh = r[5],
          rr = r[4],
          rd = r[3],
          rv = r[2],
          rl = r[1],
          lh = l[5],
          lr = l[4],
          ld = l[3],
          lv = l[2],
          ll = l[1];
         return (rh + 2 | 0) < lh
                 ? bal(ll, lv, ld, join(lr, v, d, r))
                 : (lh
                   + 2
                   | 0)
                   < rh
                   ? bal(join(l, v, d, rl), rv, rd, rr)
                   : create(l, v, d, r);
        }
        function concat(t1, t2){
         if(! t1) return t2;
         if(! t2) return t1;
         var match = min_binding(t2), d = match[2], x = match[1];
         return join(t1, x, d, remove_min_binding(t2));
        }
        function concat_or_join(t1, v, d, t2){
         if(! d) return concat(t1, t2);
         var d$0 = d[1];
         return join(t1, v, d$0, t2);
        }
        function split(x, param){
         if(! param) return a;
         var
          r = param[4],
          d = param[3],
          v = param[2],
          l = param[1],
          c = caml_call2(Ord[1], x, v);
         if(0 === c) return [0, l, [0, d], r];
         if(0 <= c){
          var
           match = split(x, r),
           rr = match[3],
           pres = match[2],
           lr = match[1];
          return [0, join(l, v, d, lr), pres, rr];
         }
         var
          match$0 = split(x, l),
          rl = match$0[3],
          pres$0 = match$0[2],
          ll = match$0[1];
         return [0, ll, pres$0, join(rl, v, d, r)];
        }
        function merge(f, s1, s2){
         if(s1){
          var h1 = s1[5], r1 = s1[4], d1 = s1[3], v1 = s1[2], l1 = s1[1];
          if(height(s2) <= h1){
           var
            match = split(v1, s2),
            r2 = match[3],
            d2 = match[2],
            l2 = match[1],
            a = merge(f, r1, r2),
            c = caml_call3(f, v1, [0, d1], d2);
           return concat_or_join(merge(f, l1, l2), v1, c, a);
          }
         }
         else if(! s2) return 0;
         if(! s2)
          throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
         var
          r2$0 = s2[4],
          d2$0 = s2[3],
          v2 = s2[2],
          l2$0 = s2[1],
          match$0 = split(v2, s1),
          r1$0 = match$0[3],
          d1$0 = match$0[2],
          l1$0 = match$0[1],
          d = merge(f, r1$0, r2$0),
          e = caml_call3(f, v2, d1$0, [0, d2$0]);
         return concat_or_join(merge(f, l1$0, l2$0), v2, e, d);
        }
        function union(f, s1, s2){
         if(s1){
          if(s2){
           var
            h2 = s2[5],
            r2 = s2[4],
            d2 = s2[3],
            v2 = s2[2],
            l2 = s2[1],
            h1 = s1[5],
            r1 = s1[4],
            d1 = s1[3],
            v1 = s1[2],
            l1 = s1[1];
           if(h2 <= h1){
            var
             match = split(v1, s2),
             r2$0 = match[3],
             d2$0 = match[2],
             l2$0 = match[1],
             l = union(f, l1, l2$0),
             r = union(f, r1, r2$0);
            if(! d2$0) return join(l, v1, d1, r);
            var d2$1 = d2$0[1];
            return concat_or_join(l, v1, caml_call3(f, v1, d1, d2$1), r);
           }
           var
            match$0 = split(v2, s1),
            r1$0 = match$0[3],
            d1$0 = match$0[2],
            l1$0 = match$0[1],
            l$0 = union(f, l1$0, l2),
            r$0 = union(f, r1$0, r2);
           if(! d1$0) return join(l$0, v2, d2, r$0);
           var d1$1 = d1$0[1];
           return concat_or_join(l$0, v2, caml_call3(f, v2, d1$1, d2), r$0);
          }
          var s = s1;
         }
         else
          var s = s2;
         return s;
        }
        function filter(p, m){
         if(! m) return 0;
         var
          r = m[4],
          d = m[3],
          v = m[2],
          l = m[1],
          l$0 = filter(p, l),
          pvd = caml_call2(p, v, d),
          r$0 = filter(p, r);
         if(! pvd) return concat(l$0, r$0);
         if(l === l$0 && r === r$0) return m;
         return join(l$0, v, d, r$0);
        }
        function filter_map(f, param){
         if(! param) return 0;
         var
          r = param[4],
          d = param[3],
          v = param[2],
          l = param[1],
          l$0 = filter_map(f, l),
          fvd = caml_call2(f, v, d),
          r$0 = filter_map(f, r);
         if(! fvd) return concat(l$0, r$0);
         var d$0 = fvd[1];
         return join(l$0, v, d$0, r$0);
        }
        function partition(p, param){
         if(! param) return c;
         var
          r = param[4],
          d = param[3],
          v = param[2],
          l = param[1],
          match = partition(p, l),
          lf = match[2],
          lt = match[1],
          pvd = caml_call2(p, v, d),
          match$0 = partition(p, r),
          rf = match$0[2],
          rt = match$0[1];
         if(pvd){var a = concat(lf, rf); return [0, join(lt, v, d, rt), a];}
         var b = join(lf, v, d, rf);
         return [0, concat(lt, rt), b];
        }
        function cons_enum(m$0, e$1){
         var m = m$0, e = e$1;
         for(;;){
          if(! m) return e;
          var r = m[4], d = m[3], v = m[2], l = m[1], e$0 = [0, v, d, r, e];
          m = l;
          e = e$0;
         }
        }
        function compare(cmp, m1, m2){
         var
          e2$2 = cons_enum(m2, 0),
          e1$2 = cons_enum(m1, 0),
          e1 = e1$2,
          e2 = e2$2;
         for(;;){
          if(! e1) return e2 ? -1 : 0;
          if(! e2) return 1;
          var
           e2$0 = e2[4],
           r2 = e2[3],
           d2 = e2[2],
           v2 = e2[1],
           e1$0 = e1[4],
           r1 = e1[3],
           d1 = e1[2],
           v1 = e1[1],
           c = caml_call2(Ord[1], v1, v2);
          if(0 !== c) return c;
          var c$0 = caml_call2(cmp, d1, d2);
          if(0 !== c$0) return c$0;
          var e2$1 = cons_enum(r2, e2$0), e1$1 = cons_enum(r1, e1$0);
          e1 = e1$1;
          e2 = e2$1;
         }
        }
        function equal(cmp, m1, m2){
         var
          e2$2 = cons_enum(m2, 0),
          e1$2 = cons_enum(m1, 0),
          e1 = e1$2,
          e2 = e2$2;
         for(;;){
          if(! e1) return e2 ? 0 : 1;
          if(! e2) return 0;
          var
           e2$0 = e2[4],
           r2 = e2[3],
           d2 = e2[2],
           v2 = e2[1],
           e1$0 = e1[4],
           r1 = e1[3],
           d1 = e1[2],
           v1 = e1[1],
           a = 0 === caml_call2(Ord[1], v1, v2) ? 1 : 0;
          if(a){
           var b = caml_call2(cmp, d1, d2);
           if(b){
            var e2$1 = cons_enum(r2, e2$0), e1$1 = cons_enum(r1, e1$0);
            e1 = e1$1;
            e2 = e2$1;
            continue;
           }
           var c = b;
          }
          else
           var c = a;
          return c;
         }
        }
        function cardinal(param){
         if(! param) return 0;
         var r = param[4], l = param[1], a = cardinal(r);
         return (cardinal(l) + 1 | 0) + a | 0;
        }
        function bindings_aux(accu$1, param$0){
         var accu = accu$1, param = param$0;
         for(;;){
          if(! param) return accu;
          var
           r = param[4],
           d = param[3],
           v = param[2],
           l = param[1],
           accu$0 = [0, [0, v, d], bindings_aux(accu, r)];
          accu = accu$0;
          param = l;
         }
        }
        function bindings(s){return bindings_aux(0, s);}
        var empty = 0;
        function of_list(bs){
         return Stdlib_List[26].call
                 (null,
                  function(m, param){
                   var v = param[2], k = param[1];
                   return add(k, v, m);
                  },
                  empty,
                  bs);
        }
        function add_seq(i, m){
         return Stdlib_Seq[5].call
                 (null,
                  function(m, param){
                   var v = param[2], k = param[1];
                   return add(k, v, m);
                  },
                  m,
                  i);
        }
        function of_seq(i){return add_seq(i, empty);}
        function seq_of_enum(c, param){
         if(! c) return 0;
         var
          rest = c[4],
          t = c[3],
          v = c[2],
          k = c[1],
          a = cons_enum(t, rest);
         return [0, [0, k, v], function(b){return seq_of_enum(a, b);}];
        }
        function to_seq(m){
         var a = cons_enum(m, 0);
         return function(b){return seq_of_enum(a, b);};
        }
        function snoc_enum(s$0, e$1){
         var s = s$0, e = e$1;
         for(;;){
          if(! s) return e;
          var r = s[4], d = s[3], v = s[2], l = s[1], e$0 = [0, v, d, l, e];
          s = r;
          e = e$0;
         }
        }
        function rev_seq_of_enum(c, param){
         if(! c) return 0;
         var
          rest = c[4],
          t = c[3],
          v = c[2],
          k = c[1],
          a = snoc_enum(t, rest);
         return [0, [0, k, v], function(b){return rev_seq_of_enum(a, b);}];
        }
        function to_rev_seq(c){
         var a = snoc_enum(c, 0);
         return function(b){return rev_seq_of_enum(a, b);};
        }
        function to_seq_from(low, m){
         a:
         {
          var m$0 = m, c = 0;
          for(;;){
           if(! m$0){var a = c; break a;}
           var
            r = m$0[4],
            d = m$0[3],
            v = m$0[2],
            l = m$0[1],
            n = caml_call2(Ord[1], v, low);
           if(0 === n) break;
           if(0 <= n){
            var c$0 = [0, v, d, r, c];
            m$0 = l;
            c = c$0;
           }
           else
            m$0 = r;
          }
          var a = [0, v, d, r, c];
         }
         return function(b){return seq_of_enum(a, b);};
        }
        return [0,
                empty,
                add,
                add_to_list,
                update,
                singleton,
                remove,
                merge,
                union,
                cardinal,
                bindings,
                min_binding,
                min_binding_opt,
                max_binding,
                max_binding_opt,
                min_binding,
                min_binding_opt,
                find,
                find_opt,
                find_first,
                find_first_opt,
                find_last,
                find_last_opt,
                iter,
                fold,
                map,
                mapi,
                filter,
                filter_map,
                partition,
                split,
                is_empty,
                mem,
                equal,
                compare,
                for_all,
                exists,
                bindings,
                of_list,
                to_seq,
                to_rev_seq,
                to_seq_from,
                add_seq,
                of_seq];
       }];
   runtime.caml_register_global(12, Stdlib_Map, "Stdlib__Map");
   return;
  }
  (globalThis));

//# 9393 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Stack:[N,F(1)*,F(2),F(1),F(1),F(1),F(1),F(1)*,F(1),F(1)*,F(1)*,F(1)*,F(2),F(3),F(1)*,F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    global_data = runtime.caml_get_global_data(),
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_List = global_data.Stdlib__List,
    Empty = [248, "Stdlib.Stack.Empty", runtime.caml_fresh_oo_id(0)];
   function create(param){return [0, 0, 0];}
   function clear(s){s[1] = 0; s[2] = 0; return 0;}
   function copy(s){return [0, s[1], s[2]];}
   function push(x, s){s[1] = [0, x, s[1]]; s[2] = s[2] + 1 | 0; return 0;}
   function pop(s){
    var match = s[1];
    if(! match) throw caml_maybe_attach_backtrace(Empty, 1);
    var tl = match[2], hd = match[1];
    s[1] = tl;
    s[2] = s[2] - 1 | 0;
    return hd;
   }
   function pop_opt(s){
    var match = s[1];
    if(! match) return 0;
    var tl = match[2], hd = match[1];
    s[1] = tl;
    s[2] = s[2] - 1 | 0;
    return [0, hd];
   }
   function drop(s){
    var match = s[1];
    if(! match) throw caml_maybe_attach_backtrace(Empty, 1);
    var tl = match[2];
    s[1] = tl;
    s[2] = s[2] - 1 | 0;
    return 0;
   }
   function top(s){
    var match = s[1];
    if(! match) throw caml_maybe_attach_backtrace(Empty, 1);
    var hd = match[1];
    return hd;
   }
   function top_opt(s){
    var match = s[1];
    if(! match) return 0;
    var hd = match[1];
    return [0, hd];
   }
   function is_empty(s){return 0 === s[1] ? 1 : 0;}
   function length(s){return s[2];}
   function iter(f, s){return Stdlib_List[18].call(null, f, s[1]);}
   function fold(f, acc, s){return Stdlib_List[26].call(null, f, acc, s[1]);}
   function to_seq(s){return Stdlib_List[64].call(null, s[1]);}
   function add_seq(q, i){
    return Stdlib_Seq[4].call(null, function(x){return push(x, q);}, i);
   }
   function of_seq(g){var s = create(0); add_seq(s, g); return s;}
   runtime.caml_register_global
    (3,
     [0,
      Empty,
      create,
      push,
      pop,
      pop_opt,
      drop,
      top,
      top_opt,
      clear,
      copy,
      is_empty,
      length,
      iter,
      fold,
      to_seq,
      add_seq,
      of_seq],
     "Stdlib__Stack");
   return;
  }
  (globalThis));

//# 9480 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Queue:[N,F(1)*,F(2),F(2),F(1),F(1),F(1),F(1),F(1)*,F(1),F(1),F(1),F(1)*,F(1)*,F(2),F(3),F(2),F(1)*->F(1)*,F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    Stdlib_Seq = runtime.caml_get_global_data().Stdlib__Seq,
    Empty = [248, "Stdlib.Queue.Empty", runtime.caml_fresh_oo_id(0)];
   function create(param){return [0, 0, 0, 0];}
   function clear(q){q[1] = 0; q[2] = 0; q[3] = 0; return 0;}
   function add(x, q){
    var cell = [0, x, 0], match = q[3];
    return match
            ? (q[1] = q[1] + 1 | 0, match[2] = cell, q[3] = cell, 0)
            : (q[1] = 1, q[2] = cell, q[3] = cell, 0);
   }
   function peek(q){
    var match = q[2];
    if(! match) throw caml_maybe_attach_backtrace(Empty, 1);
    var content = match[1];
    return content;
   }
   function peek_opt(q){
    var match = q[2];
    if(! match) return 0;
    var content = match[1];
    return [0, content];
   }
   function take(q){
    var match = q[2];
    if(! match) throw caml_maybe_attach_backtrace(Empty, 1);
    var content = match[1];
    if(match[2]){
     var next = match[2];
     q[1] = q[1] - 1 | 0;
     q[2] = next;
     return content;
    }
    clear(q);
    return content;
   }
   function take_opt(q){
    var match = q[2];
    if(! match) return 0;
    var content = match[1];
    if(match[2]){
     var next = match[2];
     q[1] = q[1] - 1 | 0;
     q[2] = next;
     return [0, content];
    }
    clear(q);
    return [0, content];
   }
   function copy(q){
    var cell$0 = q[2], q_res = [0, q[1], 0, 0], prev = 0, cell = cell$0;
    for(;;){
     if(! cell){q_res[3] = prev; return q_res;}
     var content = cell[1], next = cell[2], prev$0 = [0, content, 0];
     if(prev){
      prev[2] = prev$0;
      prev = prev$0;
      cell = next;
     }
     else{q_res[2] = prev$0; prev = prev$0; cell = next;}
    }
   }
   function is_empty(q){return 0 === q[1] ? 1 : 0;}
   function length(q){return q[1];}
   function iter(f, q){
    var cell$0 = q[2], cell = cell$0;
    for(;;){
     if(! cell) return 0;
     var content = cell[1], next = cell[2];
     caml_call1(f, content);
     cell = next;
    }
   }
   function fold(f, accu$1, q){
    var cell$0 = q[2], accu = accu$1, cell = cell$0;
    for(;;){
     if(! cell) return accu;
     var
      content = cell[1],
      next = cell[2],
      accu$0 = caml_call2(f, accu, content);
     accu = accu$0;
     cell = next;
    }
   }
   function transfer(q1, q2){
    var a = 0 < q1[1] ? 1 : 0;
    if(! a) return a;
    var match = q2[3];
    return match
            ? (q2
               [1]
              = q2[1] + q1[1] | 0,
              match[2] = q1[2],
              q2[3] = q1[3],
              clear(q1))
            : (q2[1] = q1[1], q2[2] = q1[2], q2[3] = q1[3], clear(q1));
   }
   function to_seq(q){
    function aux(c, param){
     if(! c) return 0;
     var x = c[1], next = c[2];
     return [0, x, function(a){return aux(next, a);}];
    }
    var a = q[2];
    return function(b){return aux(a, b);};
   }
   function add_seq(q, i){
    return Stdlib_Seq[4].call(null, function(x){return add(x, q);}, i);
   }
   function of_seq(g){var q = create(0); add_seq(q, g); return q;}
   runtime.caml_register_global
    (2,
     [0,
      Empty,
      create,
      add,
      add,
      take,
      take_opt,
      take,
      peek,
      peek_opt,
      peek,
      clear,
      copy,
      is_empty,
      length,
      iter,
      fold,
      transfer,
      to_seq,
      add_seq,
      of_seq],
     "Stdlib__Queue");
   return;
  }
  (globalThis));

//# 9638 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Buffer:[F(1)*,F(1),F(1),F(3),F(5),F(2),F(1)*,F(1),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(4),F(4),F(3),F(2),F(3),F(1)*->F(1),F(1)*->F(1),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_blit_string = runtime.caml_blit_string,
    caml_bswap16 = runtime.caml_bswap16,
    caml_bytes_get = runtime.caml_bytes_get,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_bytes_set16 = runtime.caml_bytes_set16,
    caml_bytes_set32 = runtime.caml_bytes_set32,
    caml_bytes_set64 = runtime.caml_bytes_set64,
    caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_int32_bswap = runtime.caml_int32_bswap,
    caml_int64_bswap = runtime.caml_int64_bswap,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Sys = global_data.Stdlib__Sys,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib = global_data.Stdlib,
    Stdlib_String = global_data.Stdlib__String,
    Assert_failure = global_data.Assert_failure,
    dummy = 0;
   function create(n){
    var
     n$0 = 1 <= n ? n : 1,
     n$1 = Stdlib_Sys[12] < n$0 ? Stdlib_Sys[12] : n$0,
     s = caml_create_bytes(n$1);
    return [0, [0, s, n$1], 0, s];
   }
   function contents(b){return Stdlib_Bytes[8].call(null, b[1][1], 0, b[2]);}
   function to_bytes(b){return Stdlib_Bytes[7].call(null, b[1][1], 0, b[2]);}
   function sub(b, ofs, len){
    if(0 <= ofs && 0 <= len && (b[2] - len | 0) >= ofs)
     return Stdlib_Bytes[8].call(null, b[1][1], ofs, len);
    return Stdlib[1].call(null, "Buffer.sub");
   }
   function blit(src, srcoff, dst, dstoff, len){
    if
     (0 <= len
      &&
       0 <= srcoff
       &&
        (src[2] - len | 0) >= srcoff
        && 0 <= dstoff && (caml_ml_bytes_length(dst) - len | 0) >= dstoff)
     return Stdlib_Bytes[11].call(null, src[1][1], srcoff, dst, dstoff, len);
    return Stdlib[1].call(null, "Buffer.blit");
   }
   function nth(b, ofs){
    var position = b[2], match = b[1], length = match[2], buffer = match[1];
    if(0 <= ofs && position > ofs && length >= position)
     return runtime.caml_bytes_unsafe_get(buffer, ofs);
    return Stdlib[1].call(null, "Buffer.nth");
   }
   function length(b){return b[2];}
   function clear(b){b[2] = 0; return 0;}
   function reset(b){
    b[2] = 0;
    var inner = [0, b[3], caml_ml_bytes_length(b[3])];
    b[1] = inner;
    return 0;
   }
   function resize(b, more){
    var old_pos = b[2], old_len = b[1][2], new_len = old_len;
    for(;;){
     if(new_len >= (old_pos + more | 0)) break;
     new_len = 2 * new_len | 0;
    }
    var
     new_len$0 =
       Stdlib_Sys[12] < new_len
        ? (old_pos
          + more
          | 0)
          <= Stdlib_Sys[12]
          ? Stdlib_Sys[12]
          : (Stdlib[2].call(null, "Buffer.add: cannot grow buffer"), new_len)
        : new_len,
     new_buffer = caml_create_bytes(new_len$0);
    Stdlib_Bytes[11].call(null, b[1][1], 0, new_buffer, 0, b[2]);
    b[1] = [0, new_buffer, new_len$0];
   }
   function add_char(b, c){
    var pos = b[2], match = b[1], length = match[2], buffer = match[1];
    if(length <= pos){
     resize(b, 1);
     caml_bytes_set(b[1][1], b[2], c);
    }
    else
     caml_bytes_unsafe_set(buffer, pos, c);
    b[2] = pos + 1 | 0;
    return 0;
   }
   function add_utf_8_uchar(b, u){
    for(;;){
     var pos = b[2], uchar_utf_8_byte_length_max = 4;
     if(b[1][2] <= pos) resize(b, uchar_utf_8_byte_length_max);
     var n = Stdlib_Bytes[51].call(null, b[1][1], pos, u);
     if(0 !== n){b[2] = pos + n | 0; return 0;}
     resize(b, uchar_utf_8_byte_length_max);
    }
   }
   var uchar_utf_16_byte_length_max = 4;
   function add_utf_16be_uchar(b, u){
    for(;;){
     var pos = b[2];
     if(b[1][2] <= pos) resize(b, uchar_utf_16_byte_length_max);
     var n = Stdlib_Bytes[54].call(null, b[1][1], pos, u);
     if(0 !== n){b[2] = pos + n | 0; return 0;}
     resize(b, uchar_utf_16_byte_length_max);
    }
   }
   function add_utf_16le_uchar(b, u){
    for(;;){
     var pos = b[2];
     if(b[1][2] <= pos) resize(b, uchar_utf_16_byte_length_max);
     var n = Stdlib_Bytes[57].call(null, b[1][1], pos, u);
     if(0 !== n){b[2] = pos + n | 0; return 0;}
     resize(b, uchar_utf_16_byte_length_max);
    }
   }
   function add_substring(b, s, offset, len){
    var a = offset < 0;
    if(a)
     var c = a;
    else
     var d = len < 0, c = d || (caml_ml_string_length(s) - len | 0) < offset;
    if(c) Stdlib[1].call(null, "Buffer.add_substring/add_subbytes");
    var
     position = b[2],
     match = b[1],
     length = match[2],
     buffer = match[1],
     new_position = position + len | 0;
    if(length < new_position){
     resize(b, len);
     Stdlib_Bytes[12].call(null, s, offset, b[1][1], b[2], len);
    }
    else
     caml_blit_string(s, offset, buffer, position, len);
    b[2] = new_position;
    return 0;
   }
   function add_subbytes(b, s, offset, len){
    return add_substring(b, Stdlib_Bytes[44].call(null, s), offset, len);
   }
   function add_string(b, s){
    var
     len = caml_ml_string_length(s),
     position = b[2],
     match = b[1],
     length = match[2],
     buffer = match[1],
     new_position = position + len | 0;
    if(length < new_position){
     resize(b, len);
     Stdlib_Bytes[12].call(null, s, 0, b[1][1], b[2], len);
    }
    else
     caml_blit_string(s, 0, buffer, position, len);
    b[2] = new_position;
    return 0;
   }
   function add_bytes(b, s){
    return add_string(b, Stdlib_Bytes[44].call(null, s));
   }
   function add_buffer(b, bs){return add_subbytes(b, bs[1][1], 0, bs[2]);}
   function add_channel(b, ic, to_read$1){
    var a = to_read$1 < 0, c = a || Stdlib_Sys[12] < to_read$1;
    if(c) Stdlib[1].call(null, "Buffer.add_channel");
    if(b[1][2] < (b[2] + to_read$1 | 0)) resize(b, to_read$1);
    var
     ofs$1 = b[2],
     buf = b[1][1],
     already_read = 0,
     ofs = ofs$1,
     to_read = to_read$1;
    for(;;){
     if(0 !== to_read){
      var r = Stdlib[84].call(null, ic, buf, ofs, to_read);
      if(0 !== r){
       var
        already_read$0 = already_read + r | 0,
        ofs$0 = ofs + r | 0,
        to_read$0 = to_read - r | 0;
       already_read = already_read$0;
       ofs = ofs$0;
       to_read = to_read$0;
       continue;
      }
     }
     b[2] = b[2] + already_read | 0;
     if(already_read < to_read$1)
      throw caml_maybe_attach_backtrace(Stdlib[12], 1);
     return 0;
    }
   }
   function output_buffer(oc, b){
    return Stdlib[68].call(null, oc, b[1][1], 0, b[2]);
   }
   var a = [0, "buffer.ml", 220, 9];
   function add_substitute(b, f, s){
    var lim$1 = caml_ml_string_length(s), previous = 32, i$4 = 0;
    for(;;){
     if(i$4 >= lim$1){
      var c = 92 === previous ? 1 : 0;
      return c ? add_char(b, previous) : c;
     }
     var previous$0 = caml_string_get(s, i$4);
     if(36 === previous$0)
      if(92 === previous){
       add_char(b, previous$0);
       var i$5 = i$4 + 1 | 0;
       previous = 32;
       i$4 = i$5;
      }
      else{
       var start = i$4 + 1 | 0;
       try{
        if(lim$1 <= start) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
        var opening = caml_string_get(s, start);
        a:
        {
         if(40 !== opening && 123 !== opening){
          var lim$0 = caml_ml_string_length(s), i$2 = start;
          for(;;){
           b:
           {
            if(lim$0 > i$2){
             var match = caml_string_get(s, i$2);
             if(91 <= match){
              if(97 <= match){
               if(123 <= match){var stop$0 = i$2; break b;}
              }
              else if(95 !== match){var stop$0 = i$2; break b;}
             }
             else
              if(58 <= match){
               if(65 > match){var stop$0 = i$2; break b;}
              }
              else if(48 > match){var stop$0 = i$2; break b;}
             var i$3 = i$2 + 1 | 0;
             i$2 = i$3;
             continue;
            }
            var stop$0 = lim$0;
           }
           if(stop$0 === start)
            throw caml_maybe_attach_backtrace(Stdlib[8], 1);
           var
            val =
              [0,
               Stdlib_String[16].call(null, s, start, stop$0 - start | 0),
               stop$0];
           break a;
          }
         }
         var new_start = start + 1 | 0;
         if(40 === opening)
          var closing = 41;
         else{
          if(123 !== opening)
           throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
          var closing = 125;
         }
         var lim = caml_ml_string_length(s), k = 0, stop = new_start;
         for(;;){
          if(lim <= stop) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          if(caml_string_get(s, stop) === opening){
           var i = stop + 1 | 0, k$0 = k + 1 | 0;
           k = k$0;
           stop = i;
          }
          else if(caml_string_get(s, stop) === closing){
           if(0 === k){
            var
             val =
               [0,
                Stdlib_String[16].call
                 (null, s, new_start, (stop - start | 0) - 1 | 0),
                stop + 1 | 0];
            break;
           }
           var i$0 = stop + 1 | 0, k$1 = k - 1 | 0;
           k = k$1;
           stop = i$0;
          }
          else{var i$1 = stop + 1 | 0; stop = i$1;}
         }
        }
       }
       catch(exn$0){
        var exn = caml_wrap_exception(exn$0);
        if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
        add_char(b, 36);
        previous = 32;
        i$4 = start;
        continue;
       }
       var next_i = val[2], ident = val[1];
       add_string(b, caml_call1(f, ident));
       previous = 32;
       i$4 = next_i;
      }
     else{
      if(92 === previous) add_char(b, previous);
      if(92 !== previous$0) add_char(b, previous$0);
      var i$6 = i$4 + 1 | 0;
      previous = previous$0;
      i$4 = i$6;
     }
    }
   }
   function truncate(b, len){
    if(0 <= len && b[2] >= len){b[2] = len; return 0;}
    return Stdlib[1].call(null, "Buffer.truncate");
   }
   function to_seq(b){
    function aux(i, param){
     if(b[2] <= i) return 0;
     var x = caml_bytes_get(b[1][1], i), a = i + 1 | 0;
     return [0, x, function(b){return aux(a, b);}];
    }
    return function(a){return aux(0, a);};
   }
   function to_seqi(b){
    function aux(i, param){
     if(b[2] <= i) return 0;
     var x = caml_bytes_get(b[1][1], i), a = i + 1 | 0;
     return [0, [0, i, x], function(b){return aux(a, b);}];
    }
    return function(a){return aux(0, a);};
   }
   function add_seq(b, seq){
    return Stdlib_Seq[4].call(null, function(a){return add_char(b, a);}, seq);
   }
   function of_seq(i){var b = create(32); add_seq(b, i); return b;}
   function add_int8(b, x){
    var
     position = b[2],
     match = b[1],
     length = match[2],
     buffer = match[1],
     new_position = position + 1 | 0;
    if(length < new_position){
     resize(b, 1);
     caml_bytes_set(b[1][1], b[2], x);
    }
    else
     caml_bytes_unsafe_set(buffer, position, x);
    b[2] = new_position;
    return 0;
   }
   function add_int16_ne(b, x){
    var
     position = b[2],
     match = b[1],
     length = match[2],
     buffer = match[1],
     new_position = position + 2 | 0;
    if(length < new_position){
     resize(b, 2);
     caml_bytes_set16(b[1][1], b[2], x);
    }
    else
     caml_bytes_set16(buffer, position, x);
    b[2] = new_position;
    return 0;
   }
   function add_int32_ne(b, x){
    var
     position = b[2],
     match = b[1],
     length = match[2],
     buffer = match[1],
     new_position = position + 4 | 0;
    if(length < new_position){
     resize(b, 4);
     caml_bytes_set32(b[1][1], b[2], x);
    }
    else
     caml_bytes_set32(buffer, position, x);
    b[2] = new_position;
    return 0;
   }
   function add_int64_ne(b, x){
    var
     position = b[2],
     match = b[1],
     length = match[2],
     buffer = match[1],
     new_position = position + 8 | 0;
    if(length < new_position){
     resize(b, 8);
     caml_bytes_set64(b[1][1], b[2], x);
    }
    else
     caml_bytes_set64(buffer, position, x);
    b[2] = new_position;
    return 0;
   }
   function add_int16_le(b, x){
    var a = Stdlib_Sys[11] ? caml_bswap16(x) : x;
    return add_int16_ne(b, a);
   }
   function add_int16_be(b, x){
    var x$0 = Stdlib_Sys[11] ? x : caml_bswap16(x);
    return add_int16_ne(b, x$0);
   }
   function add_int32_le(b, x){
    var a = Stdlib_Sys[11] ? caml_int32_bswap(x) : x;
    return add_int32_ne(b, a);
   }
   function add_int32_be(b, x){
    var x$0 = Stdlib_Sys[11] ? x : caml_int32_bswap(x);
    return add_int32_ne(b, x$0);
   }
   function add_int64_le(b, x){
    var a = Stdlib_Sys[11] ? caml_int64_bswap(x) : x;
    return add_int64_ne(b, a);
   }
   function add_int64_be(b, x){
    var x$0 = Stdlib_Sys[11] ? x : caml_int64_bswap(x);
    return add_int64_ne(b, x$0);
   }
   runtime.caml_register_global
    (14,
     [0,
      create,
      contents,
      to_bytes,
      sub,
      blit,
      nth,
      length,
      clear,
      reset,
      output_buffer,
      truncate,
      add_char,
      add_utf_8_uchar,
      add_utf_16le_uchar,
      add_utf_16be_uchar,
      add_string,
      add_bytes,
      add_substring,
      add_subbytes,
      add_substitute,
      add_buffer,
      add_channel,
      to_seq,
      to_seqi,
      add_seq,
      of_seq,
      add_int8,
      add_int8,
      add_int16_ne,
      add_int16_be,
      add_int16_le,
      add_int16_ne,
      add_int16_be,
      add_int16_le,
      add_int32_ne,
      add_int32_be,
      add_int32_le,
      add_int64_ne,
      add_int64_be,
      add_int64_le],
     "Stdlib__Buffer");
   return;
  }
  (globalThis));

//# 10125 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Mutex:[F(1),F(1),F(1),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_mutex_lock = runtime.caml_ml_mutex_lock,
    caml_ml_mutex_unlock = runtime.caml_ml_mutex_unlock,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function protect(m, f){
    caml_ml_mutex_lock(m);
    try{var x = caml_call1(f, 0);}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     caml_ml_mutex_unlock(m);
     throw caml_maybe_attach_backtrace(e, 0);
    }
    caml_ml_mutex_unlock(m);
    return x;
   }
   var
    Stdlib_Mutex =
      [0,
       runtime.caml_ml_mutex_new,
       caml_ml_mutex_lock,
       runtime.caml_ml_mutex_try_lock,
       caml_ml_mutex_unlock,
       protect];
   runtime.caml_register_global(0, Stdlib_Mutex, "Stdlib__Mutex");
   return;
  }
  (globalThis));

//# 10165 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Condition:[F(1),F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    Stdlib_Condition =
      [0,
       runtime.caml_ml_condition_new,
       runtime.caml_ml_condition_wait,
       runtime.caml_ml_condition_signal,
       runtime.caml_ml_condition_broadcast];
   runtime.caml_register_global(0, Stdlib_Condition, "Stdlib__Condition");
   return;
  }
  (globalThis));

//# 10264 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Domain:[F(1),F(1),F(1)*,F(1),F(1),F(1),F(1),F(1),F(1),N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_domain_dls_get = runtime.caml_domain_dls_get,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_domain_id = runtime.caml_ml_domain_id,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Stdlib_Condition = global_data.Stdlib__Condition,
    Stdlib_Mutex = global_data.Stdlib__Mutex,
    Stdlib_Atomic = global_data.Stdlib__Atomic,
    Stdlib = global_data.Stdlib,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_List = global_data.Stdlib__List,
    Assert_failure = global_data.Assert_failure;
   function cpu_relax(param){return runtime.caml_ml_domain_cpu_relax(0);}
   var none = [0, 0];
   function create_dls(param){
    var st = caml_make_vect(8, none);
    runtime.caml_domain_dls_set(st);
   }
   create_dls(0);
   var
    key_counter = Stdlib_Atomic[1].call(null, 0),
    parent_keys = Stdlib_Atomic[1].call(null, 0);
   function new_key(split_from_parent, init_orphan){
    var
     idx = Stdlib_Atomic[7].call(null, key_counter, 1),
     k = [0, idx, init_orphan];
    if(split_from_parent){
     var split = split_from_parent[1], ki = [0, k, split];
     for(;;){
      var l = Stdlib_Atomic[3].call(null, parent_keys);
      if(! (1 - Stdlib_Atomic[6].call(null, parent_keys, l, [0, ki, l])))
       break;
     }
    }
    return k;
   }
   function maybe_grow(idx){
    for(;;){
     var st = caml_domain_dls_get(0), sz = st.length - 1;
     if(idx < sz) return st;
     var new_sz = sz;
     for(;;){
      if(idx < new_sz){
       var new_st = caml_make_vect(new_sz, none);
       Stdlib_Array[9].call(null, st, 0, new_st, 0, sz);
       if(runtime.caml_domain_dls_compare_and_set(st, new_st)) return new_st;
       break;
      }
      var s = 2 * new_sz | 0;
      new_sz = s;
     }
    }
   }
   function set(param, x){
    var idx = param[1], st = maybe_grow(idx);
    caml_check_bound(st, idx)[idx + 1] = x;
    return 0;
   }
   var a = [0, "domain.ml", 184, 13];
   function get(param){
    var
     init = param[2],
     idx = param[1],
     st = maybe_grow(idx),
     oldval = caml_check_bound(st, idx)[idx + 1];
    if(oldval !== none) return oldval;
    var
     new_obj = caml_call1(init, 0),
     st$0 = caml_domain_dls_get(0),
     curval = caml_check_bound(st$0, idx)[idx + 1],
     b = curval === oldval ? (st$0[idx + 1] = new_obj, 1) : 0;
    if(b) return new_obj;
    var updated_obj = caml_check_bound(st$0, idx)[idx + 1];
    if(updated_obj !== none) return updated_obj;
    throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
   }
   function set_initial_keys(l){
    return Stdlib_List[18].call
            (null,
             function(param){
              var v = param[2], k = param[1];
              return set(k, v);
             },
             l);
   }
   function get_id(param){var domain = param[1]; return domain;}
   function self(param){return caml_ml_domain_id(0);}
   function is_main_domain(param){return 0 === caml_ml_domain_id(0) ? 1 : 0;}
   var
    first_domain_spawned = Stdlib_Atomic[1].call(null, 0),
    first_spawn_function = [0, function(param){}];
   function before_first_spawn(f){
    if(Stdlib_Atomic[3].call(null, first_domain_spawned))
     throw caml_maybe_attach_backtrace
            ([0, Stdlib[6], "first domain already spawned"], 1);
    var old_f = first_spawn_function[1];
    function new_f(param){caml_call1(old_f, 0); return caml_call1(f, 0);}
    first_spawn_function[1] = new_f;
    return 0;
   }
   var
    at_exit_key =
      new_key(0, function(param){return function(param){return 0;};});
   function at_exit(f){
    var old_exit = get(at_exit_key);
    function new_exit(param){
     caml_call1(f, 0);
     return caml_call1(old_exit, 0);
    }
    return set(at_exit_key, new_exit);
   }
   function do_at_exit(param){
    var f = get(at_exit_key);
    return caml_call1(f, 0);
   }
   Stdlib[104][1] = do_at_exit;
   function spawn(f){
    if(1 - Stdlib_Atomic[3].call(null, first_domain_spawned)){
     Stdlib_Atomic[4].call(null, first_domain_spawned, 1);
     caml_call1(first_spawn_function[1], 0);
     first_spawn_function[1] = function(param){return 0;};
    }
    var
     a = Stdlib_Atomic[3].call(null, parent_keys),
     pk =
       Stdlib_List[20].call
        (null,
         function(param){
          var split = param[2], k = param[1];
          return [0, k, caml_call1(split, get(k))];
         },
         a),
     b = Stdlib_Condition[1].call(null, 0),
     term_sync = [0, 0, Stdlib_Mutex[1].call(null, 0), b];
    function body(param){
     try{create_dls(0); set_initial_keys(pk); var res = caml_call1(f, 0);}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      try{do_at_exit(0);}catch(exn){}
      throw caml_maybe_attach_backtrace(exn, 0);
     }
     do_at_exit(0);
     return res;
    }
    var domain = runtime.caml_domain_spawn(body, term_sync);
    return [0, domain, term_sync];
   }
   function join(param){
    var term_sync = param[2];
    function loop(param){
     for(;;){
      var match = term_sync[1];
      if(match){var res = match[1]; return res;}
      Stdlib_Condition[2].call(null, term_sync[3], term_sync[2]);
     }
    }
    var match = Stdlib_Mutex[5].call(null, term_sync[2], loop);
    if(0 === match[0]){var x = match[1]; return x;}
    var ex = match[1];
    throw caml_maybe_attach_backtrace(ex, 1);
   }
   var recommended_domain_count = runtime.caml_recommended_domain_count;
   runtime.caml_register_global
    (9,
     [0,
      spawn,
      join,
      get_id,
      self,
      before_first_spawn,
      at_exit,
      cpu_relax,
      is_main_domain,
      recommended_domain_count,
      [0, new_key, get, set]],
     "Stdlib__Domain");
   return;
  }
  (globalThis));

//# 10461 "../.js/default/stdlib/stdlib.cma.js"
//# shape: CamlinternalFormat:[F(2),F(1),F(1),F(2),F(1),F(2)*,F(3),F(3),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(1)*,F(1),F(1),F(1),F(1),F(1),F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_blit_string = runtime.caml_blit_string,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_format_float = runtime.caml_format_float,
    caml_format_int = runtime.caml_format_int,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_notequal = runtime.caml_notequal,
    caml_string_get = runtime.caml_string_get,
    caml_string_unsafe_get = runtime.caml_string_unsafe_get,
    caml_trampoline = runtime.caml_trampoline,
    caml_trampoline_return = runtime.caml_trampoline_return,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   function caml_call5(f, a0, a1, a2, a3, a4){
    return (f.l >= 0 ? f.l : f.l = f.length) === 5
            ? f(a0, a1, a2, a3, a4)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Assert_failure = global_data.Assert_failure,
    CamlinternalFormatBasics = global_data.CamlinternalFormatBasics,
    Stdlib = global_data.Stdlib,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Sys = global_data.Stdlib__Sys,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Int = global_data.Stdlib__Int;
   function create_char_set(param){return Stdlib_Bytes[1].call(null, 32, 0);}
   function add_in_char_set(char_set, c){
    var
     str_ind = c >>> 3 | 0,
     mask = 1 << (c & 7),
     a = runtime.caml_bytes_get(char_set, str_ind) | mask;
    return caml_bytes_set(char_set, str_ind, Stdlib[29].call(null, a));
   }
   function freeze_char_set(char_set){
    return Stdlib_Bytes[6].call(null, char_set);
   }
   function rev_char_set(char_set){
    var char_set$0 = create_char_set(0), i = 0;
    for(;;){
     var a = caml_string_get(char_set, i) ^ 255;
     caml_bytes_set(char_set$0, i, Stdlib[29].call(null, a));
     var b = i + 1 | 0;
     if(31 === i) return Stdlib_Bytes[44].call(null, char_set$0);
     i = b;
    }
   }
   function is_in_char_set(char_set, c){
    var str_ind = c >>> 3 | 0, mask = 1 << (c & 7);
    return 0 !== (caml_string_get(char_set, str_ind) & mask) ? 1 : 0;
   }
   function pad_of_pad_opt(pad_opt){
    if(! pad_opt) return 0;
    var width = pad_opt[1];
    return [0, 1, width];
   }
   var a = [0, 0, 0];
   function param_format_of_ignored_format(ign, fmt){
    if(typeof ign === "number")
     switch(ign){
       case 0:
        return [0, [0, fmt]];
       case 1:
        return [0, [1, fmt]];
       case 2:
        return [0, [19, fmt]];
       default: return [0, [22, fmt]];
     }
    switch(ign[0]){
      case 0:
       var pad_opt = ign[1]; return [0, [2, pad_of_pad_opt(pad_opt), fmt]];
      case 1:
       var pad_opt$0 = ign[1];
       return [0, [3, pad_of_pad_opt(pad_opt$0), fmt]];
      case 2:
       var pad_opt$1 = ign[2], iconv = ign[1];
       return [0, [4, iconv, pad_of_pad_opt(pad_opt$1), 0, fmt]];
      case 3:
       var pad_opt$2 = ign[2], iconv$0 = ign[1];
       return [0, [5, iconv$0, pad_of_pad_opt(pad_opt$2), 0, fmt]];
      case 4:
       var pad_opt$3 = ign[2], iconv$1 = ign[1];
       return [0, [6, iconv$1, pad_of_pad_opt(pad_opt$3), 0, fmt]];
      case 5:
       var pad_opt$4 = ign[2], iconv$2 = ign[1];
       return [0, [7, iconv$2, pad_of_pad_opt(pad_opt$4), 0, fmt]];
      case 6:
       var prec_opt = ign[2], pad_opt$5 = ign[1];
       if(prec_opt) var ndec = prec_opt[1], b = [0, ndec]; else var b = 0;
       return [0, [8, a, pad_of_pad_opt(pad_opt$5), b, fmt]];
      case 7:
       var pad_opt$6 = ign[1];
       return [0, [9, pad_of_pad_opt(pad_opt$6), fmt]];
      case 8:
       var fmtty = ign[2], pad_opt$7 = ign[1];
       return [0, [13, pad_opt$7, fmtty, fmt]];
      case 9:
       var fmtty$0 = ign[2], pad_opt$8 = ign[1];
       return [0, [14, pad_opt$8, fmtty$0, fmt]];
      case 10:
       var char_set = ign[2], width_opt = ign[1];
       return [0, [20, width_opt, char_set, fmt]];
      default: var counter = ign[1]; return [0, [21, counter, fmt]];
    }
   }
   function default_float_precision(fconv){return 5 === fconv[2] ? 12 : -6;}
   function buffer_create(init_size){
    return [0, 0, caml_create_bytes(init_size)];
   }
   function buffer_check_size(buf, overhead){
    var
     len = runtime.caml_ml_bytes_length(buf[2]),
     min_len = buf[1] + overhead | 0;
    if(len < min_len){
     var
      new_len = Stdlib_Int[11].call(null, len * 2 | 0, min_len),
      new_str = caml_create_bytes(new_len);
     Stdlib_Bytes[11].call(null, buf[2], 0, new_str, 0, len);
     buf[2] = new_str;
    }
   }
   function buffer_add_char(buf, c){
    buffer_check_size(buf, 1);
    caml_bytes_set(buf[2], buf[1], c);
    buf[1] = buf[1] + 1 | 0;
   }
   function buffer_add_string(buf, s){
    var str_len = caml_ml_string_length(s);
    buffer_check_size(buf, str_len);
    Stdlib_String[6].call(null, s, 0, buf[2], buf[1], str_len);
    buf[1] = buf[1] + str_len | 0;
   }
   function buffer_contents(buf){
    return Stdlib_Bytes[8].call(null, buf[2], 0, buf[1]);
   }
   function char_of_iconv(iconv){
    switch(iconv){
      case 6:
      case 7:
       return 120;
      case 8:
      case 9:
       return 88;
      case 10:
      case 11:
       return 111;
      case 12:
      case 15:
       return 117;
      case 0:
      case 1:
      case 2:
      case 13:
       return 100;
      default: return 105;
    }
   }
   function char_of_fconv(opt, fconv){
    var cF = opt ? opt[1] : 70;
    switch(fconv[2]){
      case 0:
       return 102;
      case 1:
       return 101;
      case 2:
       return 69;
      case 3:
       return 103;
      case 4:
       return 71;
      case 5:
       return cF;
      case 6:
       return 104;
      case 7:
       return 72;
      default: return 70;
    }
   }
   function bprint_char_set(buf, char_set){
    function print_char(buf, i){
     var c = Stdlib[29].call(null, i);
     return 37 === c
             ? (buffer_add_char(buf, 37), buffer_add_char(buf, 37))
             : 64
               === c
               ? (buffer_add_char(buf, 37), buffer_add_char(buf, 64))
               : buffer_add_char(buf, c);
    }
    buffer_add_char(buf, 91);
    var
     set =
       is_in_char_set(char_set, 0)
        ? (buffer_add_char(buf, 94), rev_char_set(char_set))
        : char_set;
    function is_alone(c){
     var
      after = Stdlib_Char[1].call(null, c + 1 | 0),
      before = Stdlib_Char[1].call(null, c - 1 | 0),
      a = is_in_char_set(set, c);
     if(a)
      var
       b = is_in_char_set(set, before),
       e = b ? is_in_char_set(set, after) : b,
       d = 1 - e;
     else
      var d = a;
     return d;
    }
    if(is_alone(93)) buffer_add_char(buf, 93);
    var i = 1;
    a:
    for(;;){
     b:
     if(i < 256){
      if(! is_in_char_set(set, Stdlib[29].call(null, i))){var i$0 = i + 1 | 0; i = i$0; continue;}
      var switcher = Stdlib[29].call(null, i) - 45 | 0;
      if(48 < switcher >>> 0){
       if(210 <= switcher){print_char(buf, 255); break b;}
      }
      else if(46 < switcher - 1 >>> 0){
       var i$2 = i + 1 | 0;
       i = i$2;
       continue;
      }
      var i$1 = i + 1 | 0;
      if(! is_in_char_set(set, Stdlib[29].call(null, i$1))){
       print_char(buf, i$1 - 1 | 0);
       var i$6 = i$1 + 1 | 0;
       i = i$6;
       continue;
      }
      var switcher$0 = Stdlib[29].call(null, i$1) - 45 | 0;
      if(48 < switcher$0 >>> 0){
       if(210 <= switcher$0){
        print_char(buf, 254);
        print_char(buf, 255);
        break b;
       }
      }
      else if
       (46 < switcher$0 - 1 >>> 0
        && ! is_in_char_set(set, Stdlib[29].call(null, i$1 + 1 | 0))){
       print_char(buf, i$1 - 1 | 0);
       var i$5 = i$1 + 1 | 0;
       i = i$5;
       continue;
      }
      if(! is_in_char_set(set, Stdlib[29].call(null, i$1 + 1 | 0))){
       print_char(buf, i$1 - 1 | 0);
       print_char(buf, i$1);
       var i$4 = i$1 + 2 | 0;
       i = i$4;
       continue;
      }
      var j = i$1 + 2 | 0, i$3 = i$1 - 1 | 0, j$0 = j;
      for(;;){
       if(256 !== j$0 && is_in_char_set(set, Stdlib[29].call(null, j$0))){var j$1 = j$0 + 1 | 0; j$0 = j$1; continue;}
       print_char(buf, i$3);
       print_char(buf, 45);
       print_char(buf, j$0 - 1 | 0);
       if(j$0 >= 256) break;
       var i$7 = j$0 + 1 | 0;
       i = i$7;
       continue a;
      }
     }
     if(is_alone(45)) buffer_add_char(buf, 45);
     return buffer_add_char(buf, 93);
    }
   }
   function bprint_padty(buf, padty){
    switch(padty){
      case 0:
       return buffer_add_char(buf, 45);
      case 1:
       return;
      default: return buffer_add_char(buf, 48);
    }
   }
   function bprint_ignored_flag(buf, ign_flag){
    return ign_flag ? buffer_add_char(buf, 95) : ign_flag;
   }
   function bprint_pad_opt(buf, pad_opt){
    if(! pad_opt) return;
    var width = pad_opt[1];
    return buffer_add_string(buf, Stdlib_Int[12].call(null, width));
   }
   function bprint_padding(buf, pad){
    if(typeof pad === "number") return;
    if(0 === pad[0]){
     var n = pad[2], padty = pad[1];
     bprint_padty(buf, padty);
     return buffer_add_string(buf, Stdlib_Int[12].call(null, n));
    }
    var padty$0 = pad[1];
    bprint_padty(buf, padty$0);
    return buffer_add_char(buf, 42);
   }
   function bprint_precision(buf, prec){
    if(typeof prec !== "number"){
     var n = prec[1];
     buffer_add_char(buf, 46);
     return buffer_add_string(buf, Stdlib_Int[12].call(null, n));
    }
    if(prec) return buffer_add_string(buf, ".*");
   }
   function bprint_iconv_flag(buf, iconv){
    switch(iconv){
      case 1:
      case 4:
       return buffer_add_char(buf, 43);
      case 2:
      case 5:
       return buffer_add_char(buf, 32);
      case 7:
      case 9:
      case 11:
      case 13:
      case 14:
      case 15:
       return buffer_add_char(buf, 35);
      default: return;
    }
   }
   function bprint_altint_fmt(buf, ign_flag, iconv, pad, prec, c){
    buffer_add_char(buf, 37);
    bprint_ignored_flag(buf, ign_flag);
    bprint_iconv_flag(buf, iconv);
    bprint_padding(buf, pad);
    bprint_precision(buf, prec);
    buffer_add_char(buf, c);
    return buffer_add_char(buf, char_of_iconv(iconv));
   }
   function bprint_fconv_flag(buf, fconv){
    switch(fconv[1]){
      case 1:
       buffer_add_char(buf, 43); break;
      case 2:
       buffer_add_char(buf, 32); break;
    }
    if(8 <= fconv[2]) return buffer_add_char(buf, 35);
   }
   function string_of_formatting_lit(formatting_lit){
    if(typeof formatting_lit === "number")
     switch(formatting_lit){
       case 0:
        return "@]";
       case 1:
        return "@}";
       case 2:
        return "@?";
       case 3:
        return "@\n";
       case 4:
        return "@.";
       case 5:
        return "@@";
       default: return "@%";
     }
    if(2 === formatting_lit[0]){
     var c = formatting_lit[1], a = Stdlib_String[1].call(null, 1, c);
     return Stdlib[28].call(null, "@", a);
    }
    var str = formatting_lit[1];
    return str;
   }
   function bprint_char_literal(buf, chr){
    return 37 === chr
            ? buffer_add_string(buf, "%%")
            : buffer_add_char(buf, chr);
   }
   function bprint_string_literal(buf, str){
    var a = caml_ml_string_length(str) - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      bprint_char_literal(buf, caml_string_get(str, i));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
   }
   var cst_Li = "%Li", cst_i = "%i", cst_li = "%li", cst_ni = "%ni";
   function bprint_fmtty(buf, fmtty$15){
    var fmtty = fmtty$15;
    for(;;){
     if(typeof fmtty === "number") return;
     switch(fmtty[0]){
       case 0:
        var fmtty$0 = fmtty[1];
        buffer_add_string(buf, "%c");
        fmtty = fmtty$0;
        break;
       case 1:
        var fmtty$1 = fmtty[1];
        buffer_add_string(buf, "%s");
        fmtty = fmtty$1;
        break;
       case 2:
        var fmtty$2 = fmtty[1];
        buffer_add_string(buf, cst_i);
        fmtty = fmtty$2;
        break;
       case 3:
        var fmtty$3 = fmtty[1];
        buffer_add_string(buf, cst_li);
        fmtty = fmtty$3;
        break;
       case 4:
        var fmtty$4 = fmtty[1];
        buffer_add_string(buf, cst_ni);
        fmtty = fmtty$4;
        break;
       case 5:
        var fmtty$5 = fmtty[1];
        buffer_add_string(buf, cst_Li);
        fmtty = fmtty$5;
        break;
       case 6:
        var fmtty$6 = fmtty[1];
        buffer_add_string(buf, "%f");
        fmtty = fmtty$6;
        break;
       case 7:
        var fmtty$7 = fmtty[1];
        buffer_add_string(buf, "%B");
        fmtty = fmtty$7;
        break;
       case 8:
        var fmtty$8 = fmtty[2], sub_fmtty = fmtty[1];
        buffer_add_string(buf, "%{");
        bprint_fmtty(buf, sub_fmtty);
        buffer_add_string(buf, "%}");
        fmtty = fmtty$8;
        break;
       case 9:
        var fmtty$9 = fmtty[3], sub_fmtty$0 = fmtty[1];
        buffer_add_string(buf, "%(");
        bprint_fmtty(buf, sub_fmtty$0);
        buffer_add_string(buf, "%)");
        fmtty = fmtty$9;
        break;
       case 10:
        var fmtty$10 = fmtty[1];
        buffer_add_string(buf, "%a");
        fmtty = fmtty$10;
        break;
       case 11:
        var fmtty$11 = fmtty[1];
        buffer_add_string(buf, "%t");
        fmtty = fmtty$11;
        break;
       case 12:
        var fmtty$12 = fmtty[1];
        buffer_add_string(buf, "%?");
        fmtty = fmtty$12;
        break;
       case 13:
        var fmtty$13 = fmtty[1];
        buffer_add_string(buf, "%r");
        fmtty = fmtty$13;
        break;
       default:
        var fmtty$14 = fmtty[1];
        buffer_add_string(buf, "%_r");
        fmtty = fmtty$14;
     }
    }
   }
   function int_of_custom_arity(param){
    if(! param) return 0;
    var x = param[1];
    return 1 + int_of_custom_arity(x) | 0;
   }
   var cst$0 = "@[", cst = "@{";
   function string_of_fmt(fmt){
    var buf = buffer_create(16);
    function fmtiter(fmt$1, ign_flag$0){
     var fmt = fmt$1, ign_flag = ign_flag$0;
     for(;;){
      if(typeof fmt === "number") return;
      switch(fmt[0]){
        case 0:
         var rest = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         buffer_add_char(buf, 99);
         fmt = rest;
         ign_flag = 0;
         break;
        case 1:
         var rest$0 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         buffer_add_char(buf, 67);
         fmt = rest$0;
         ign_flag = 0;
         break;
        case 2:
         var rest$1 = fmt[2], pad = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_padding(buf, pad);
         buffer_add_char(buf, 115);
         fmt = rest$1;
         ign_flag = 0;
         break;
        case 3:
         var rest$2 = fmt[2], pad$0 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_padding(buf, pad$0);
         buffer_add_char(buf, 83);
         fmt = rest$2;
         ign_flag = 0;
         break;
        case 4:
         var rest$3 = fmt[4], prec = fmt[3], pad$1 = fmt[2], iconv = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_iconv_flag(buf, iconv);
         bprint_padding(buf, pad$1);
         bprint_precision(buf, prec);
         buffer_add_char(buf, char_of_iconv(iconv));
         fmt = rest$3;
         ign_flag = 0;
         break;
        case 5:
         var
          rest$4 = fmt[4],
          prec$0 = fmt[3],
          pad$2 = fmt[2],
          iconv$0 = fmt[1];
         bprint_altint_fmt(buf, ign_flag, iconv$0, pad$2, prec$0, 108);
         fmt = rest$4;
         ign_flag = 0;
         break;
        case 6:
         var
          rest$5 = fmt[4],
          prec$1 = fmt[3],
          pad$3 = fmt[2],
          iconv$1 = fmt[1];
         bprint_altint_fmt(buf, ign_flag, iconv$1, pad$3, prec$1, 110);
         fmt = rest$5;
         ign_flag = 0;
         break;
        case 7:
         var
          rest$6 = fmt[4],
          prec$2 = fmt[3],
          pad$4 = fmt[2],
          iconv$2 = fmt[1];
         bprint_altint_fmt(buf, ign_flag, iconv$2, pad$4, prec$2, 76);
         fmt = rest$6;
         ign_flag = 0;
         break;
        case 8:
         var rest$7 = fmt[4], prec$3 = fmt[3], pad$5 = fmt[2], fconv = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_fconv_flag(buf, fconv);
         bprint_padding(buf, pad$5);
         bprint_precision(buf, prec$3);
         buffer_add_char(buf, char_of_fconv(0, fconv));
         fmt = rest$7;
         ign_flag = 0;
         break;
        case 9:
         var rest$8 = fmt[2], pad$6 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_padding(buf, pad$6);
         buffer_add_char(buf, 66);
         fmt = rest$8;
         ign_flag = 0;
         break;
        case 10:
         var rest$9 = fmt[1];
         buffer_add_string(buf, "%!");
         fmt = rest$9;
         break;
        case 11:
         var rest$10 = fmt[2], str = fmt[1];
         bprint_string_literal(buf, str);
         fmt = rest$10;
         break;
        case 12:
         var rest$11 = fmt[2], chr = fmt[1];
         bprint_char_literal(buf, chr);
         fmt = rest$11;
         break;
        case 13:
         var rest$12 = fmt[3], fmtty = fmt[2], pad_opt = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_pad_opt(buf, pad_opt);
         buffer_add_char(buf, 123);
         bprint_fmtty(buf, fmtty);
         buffer_add_char(buf, 37);
         buffer_add_char(buf, 125);
         fmt = rest$12;
         ign_flag = 0;
         break;
        case 14:
         var rest$13 = fmt[3], fmtty$0 = fmt[2], pad_opt$0 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_pad_opt(buf, pad_opt$0);
         buffer_add_char(buf, 40);
         bprint_fmtty(buf, fmtty$0);
         buffer_add_char(buf, 37);
         buffer_add_char(buf, 41);
         fmt = rest$13;
         ign_flag = 0;
         break;
        case 15:
         var rest$14 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         buffer_add_char(buf, 97);
         fmt = rest$14;
         ign_flag = 0;
         break;
        case 16:
         var rest$15 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         buffer_add_char(buf, 116);
         fmt = rest$15;
         ign_flag = 0;
         break;
        case 17:
         var rest$16 = fmt[2], fmting_lit = fmt[1];
         bprint_string_literal(buf, string_of_formatting_lit(fmting_lit));
         fmt = rest$16;
         break;
        case 18:
         var rest$17 = fmt[2], fmting_gen = fmt[1];
         if(0 === fmting_gen[0]){
          var str$0 = fmting_gen[1][2];
          buffer_add_string(buf, cst);
          buffer_add_string(buf, str$0);
          fmt = rest$17;
         }
         else{
          var str$1 = fmting_gen[1][2];
          buffer_add_string(buf, cst$0);
          buffer_add_string(buf, str$1);
          fmt = rest$17;
         }
         break;
        case 19:
         var rest$18 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         buffer_add_char(buf, 114);
         fmt = rest$18;
         ign_flag = 0;
         break;
        case 20:
         var rest$19 = fmt[3], char_set = fmt[2], width_opt = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_pad_opt(buf, width_opt);
         bprint_char_set(buf, char_set);
         fmt = rest$19;
         ign_flag = 0;
         break;
        case 21:
         var rest$20 = fmt[2], counter = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         switch(counter){
           case 0:
            var a = 108; break;
           case 1:
            var a = 110; break;
           default: var a = 78;
         }
         buffer_add_char(buf, a);
         fmt = rest$20;
         ign_flag = 0;
         break;
        case 22:
         var rest$21 = fmt[1];
         buffer_add_char(buf, 37);
         bprint_ignored_flag(buf, ign_flag);
         bprint_string_literal(buf, "0c");
         fmt = rest$21;
         ign_flag = 0;
         break;
        case 23:
         var
          rest$22 = fmt[2],
          ign = fmt[1],
          fmt$0 = param_format_of_ignored_format(ign, rest$22)[1];
         fmt = fmt$0;
         ign_flag = 1;
         break;
        default:
         var rest$23 = fmt[3], arity = fmt[1], b = int_of_custom_arity(arity);
         if(b >= 1){
          var i = 1;
          for(;;){
           buffer_add_char(buf, 37);
           bprint_ignored_flag(buf, ign_flag);
           buffer_add_char(buf, 63);
           var c = i + 1 | 0;
           if(b === i) break;
           i = c;
          }
         }
         fmt = rest$23;
         ign_flag = 0;
      }
     }
    }
    fmtiter(fmt, 0);
    return buffer_contents(buf);
   }
   function symm(param){
    if(typeof param === "number") return 0;
    switch(param[0]){
      case 0:
       var rest = param[1]; return [0, symm(rest)];
      case 1:
       var rest$0 = param[1]; return [1, symm(rest$0)];
      case 2:
       var rest$1 = param[1]; return [2, symm(rest$1)];
      case 3:
       var rest$2 = param[1]; return [3, symm(rest$2)];
      case 4:
       var rest$3 = param[1]; return [4, symm(rest$3)];
      case 5:
       var rest$4 = param[1]; return [5, symm(rest$4)];
      case 6:
       var rest$5 = param[1]; return [6, symm(rest$5)];
      case 7:
       var rest$6 = param[1]; return [7, symm(rest$6)];
      case 8:
       var rest$7 = param[2], ty = param[1]; return [8, ty, symm(rest$7)];
      case 9:
       var rest$8 = param[3], ty2 = param[2], ty1 = param[1];
       return [9, ty2, ty1, symm(rest$8)];
      case 10:
       var rest$9 = param[1]; return [10, symm(rest$9)];
      case 11:
       var rest$10 = param[1]; return [11, symm(rest$10)];
      case 12:
       var rest$11 = param[1]; return [12, symm(rest$11)];
      case 13:
       var rest$12 = param[1]; return [13, symm(rest$12)];
      default: var rest$13 = param[1]; return [14, symm(rest$13)];
    }
   }
   function fmtty_rel_det(param){
    if(typeof param === "number")
     return [0, , function(param){}, , function(param){}];
    switch(param[0]){
      case 0:
       var
        rest = param[1],
        match = fmtty_rel_det(rest),
        de = match[4],
        af = match[2];
       return [0, , function(param){af(0);}, , de];
      case 1:
       var
        rest$0 = param[1],
        match$0 = fmtty_rel_det(rest$0),
        de$0 = match$0[4],
        af$0 = match$0[2];
       return [0, , function(param){af$0(0);}, , de$0];
      case 2:
       var
        rest$1 = param[1],
        match$1 = fmtty_rel_det(rest$1),
        de$1 = match$1[4],
        af$1 = match$1[2];
       return [0, , function(param){af$1(0);}, , de$1];
      case 3:
       var
        rest$2 = param[1],
        match$2 = fmtty_rel_det(rest$2),
        de$2 = match$2[4],
        af$2 = match$2[2];
       return [0, , function(param){af$2(0);}, , de$2];
      case 4:
       var
        rest$3 = param[1],
        match$3 = fmtty_rel_det(rest$3),
        de$3 = match$3[4],
        af$3 = match$3[2];
       return [0, , function(param){af$3(0);}, , de$3];
      case 5:
       var
        rest$4 = param[1],
        match$4 = fmtty_rel_det(rest$4),
        de$4 = match$4[4],
        af$4 = match$4[2];
       return [0, , function(param){af$4(0);}, , de$4];
      case 6:
       var
        rest$5 = param[1],
        match$5 = fmtty_rel_det(rest$5),
        de$5 = match$5[4],
        af$5 = match$5[2];
       return [0, , function(param){af$5(0);}, , de$5];
      case 7:
       var
        rest$6 = param[1],
        match$6 = fmtty_rel_det(rest$6),
        de$6 = match$6[4],
        af$6 = match$6[2];
       return [0, , function(param){af$6(0);}, , de$6];
      case 8:
       var
        rest$7 = param[2],
        match$7 = fmtty_rel_det(rest$7),
        de$7 = match$7[4],
        af$7 = match$7[2];
       return [0, , function(param){af$7(0);}, , de$7];
      case 9:
       var
        rest$8 = param[3],
        ty2 = param[2],
        ty1 = param[1],
        match$8 = fmtty_rel_det(rest$8),
        de$8 = match$8[4],
        af$8 = match$8[2],
        ty = trans(symm(ty1), ty2),
        match$9 = fmtty_rel_det(ty),
        jd = match$9[4],
        ga = match$9[2];
       return [0,
               ,
               function(param){ga(0); af$8(0);},
               ,
               function(param){jd(0); de$8(0);}];
      case 10:
       var
        rest$9 = param[1],
        match$10 = fmtty_rel_det(rest$9),
        de$9 = match$10[4],
        af$9 = match$10[2];
       return [0, , function(param){af$9(0);}, , de$9];
      case 11:
       var
        rest$10 = param[1],
        match$11 = fmtty_rel_det(rest$10),
        de$10 = match$11[4],
        af$10 = match$11[2];
       return [0, , function(param){af$10(0);}, , de$10];
      case 12:
       var
        rest$11 = param[1],
        match$12 = fmtty_rel_det(rest$11),
        de$11 = match$12[4],
        af$11 = match$12[2];
       return [0, , function(param){af$11(0);}, , de$11];
      case 13:
       var
        rest$12 = param[1],
        match$13 = fmtty_rel_det(rest$12),
        de$12 = match$13[4],
        af$12 = match$13[2];
       return [0, , function(param){af$12(0);}, , function(param){de$12(0);}];
      default:
       var
        rest$13 = param[1],
        match$14 = fmtty_rel_det(rest$13),
        de$13 = match$14[4],
        af$13 = match$14[2];
       return [0, , function(param){af$13(0);}, , function(param){de$13(0);}];
    }
   }
   var
    cst_camlinternalFormat_ml = "camlinternalFormat.ml",
    b = [0, cst_camlinternalFormat_ml, 850, 23],
    c = [0, cst_camlinternalFormat_ml, 837, 26],
    d = [0, cst_camlinternalFormat_ml, 847, 28],
    e = [0, cst_camlinternalFormat_ml, 815, 21],
    f = [0, cst_camlinternalFormat_ml, 819, 21],
    g = [0, cst_camlinternalFormat_ml, 823, 19],
    h = [0, cst_camlinternalFormat_ml, 827, 22],
    i = [0, cst_camlinternalFormat_ml, 832, 30],
    j = [0, cst_camlinternalFormat_ml, 851, 23],
    k = [0, cst_camlinternalFormat_ml, 836, 26],
    l = [0, cst_camlinternalFormat_ml, 846, 28],
    m = [0, cst_camlinternalFormat_ml, 814, 21],
    n = [0, cst_camlinternalFormat_ml, 818, 21],
    o = [0, cst_camlinternalFormat_ml, 822, 19],
    p = [0, cst_camlinternalFormat_ml, 826, 22],
    q = [0, cst_camlinternalFormat_ml, 831, 30];
   function trans(ty1, ty2){
    a:
    {
     b:
     {
      c:
      {
       d:
       {
        e:
        {
         f:
         {
          g:
          {
           if(typeof ty1 !== "number"){
            switch(ty1[0]){
              case 0:
               var rest1 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 0:
                   var rest2 = ty2[1]; return [0, trans(rest1, rest2)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 1:
               var rest1$0 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 1:
                   var rest2$0 = ty2[1]; return [1, trans(rest1$0, rest2$0)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 2:
               var rest1$1 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 2:
                   var rest2$1 = ty2[1]; return [2, trans(rest1$1, rest2$1)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 3:
               var rest1$2 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 3:
                   var rest2$2 = ty2[1]; return [3, trans(rest1$2, rest2$2)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 4:
               var rest1$3 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 4:
                   var rest2$3 = ty2[1]; return [4, trans(rest1$3, rest2$3)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 5:
               var rest1$4 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 5:
                   var rest2$4 = ty2[1]; return [5, trans(rest1$4, rest2$4)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 6:
               var rest1$5 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 6:
                   var rest2$5 = ty2[1]; return [6, trans(rest1$5, rest2$5)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 7:
               var rest1$6 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 7:
                   var rest2$6 = ty2[1]; return [7, trans(rest1$6, rest2$6)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                  case 9:
                   break g;
                }
               break;
              case 8:
               var rest1$7 = ty1[2], ty1$0 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 8:
                   var
                    rest2$7 = ty2[2],
                    ty2$0 = ty2[1],
                    a = trans(rest1$7, rest2$7);
                   return [8, trans(ty1$0, ty2$0), a];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                }
               throw caml_maybe_attach_backtrace([0, Assert_failure, k], 1);
              case 9:
               var rest1$8 = ty1[3], ty12 = ty1[2], ty11 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 9:
                   var
                    rest2$8 = ty2[3],
                    ty22 = ty2[2],
                    ty21 = ty2[1],
                    ty = trans(symm(ty12), ty21),
                    match = fmtty_rel_det(ty),
                    f4 = match[4],
                    f2 = match[2];
                   f2(0);
                   f4(0);
                   return [9, ty11, ty22, trans(rest1$8, rest2$8)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                  case 14:
                   break e;
                  case 8:
                   break f;
                }
               throw caml_maybe_attach_backtrace([0, Assert_failure, l], 1);
              case 10:
               var rest1$9 = ty1[1];
               if(typeof ty2 !== "number" && 10 === ty2[0]){
                var rest2$9 = ty2[1];
                return [10, trans(rest1$9, rest2$9)];
               }
               throw caml_maybe_attach_backtrace([0, Assert_failure, m], 1);
              case 11:
               var rest1$10 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 11:
                   var rest2$10 = ty2[1];
                   return [11, trans(rest1$10, rest2$10)];
                  case 10:
                   break a;
                }
               throw caml_maybe_attach_backtrace([0, Assert_failure, n], 1);
              case 12:
               var rest1$11 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 12:
                   var rest2$11 = ty2[1];
                   return [12, trans(rest1$11, rest2$11)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                }
               throw caml_maybe_attach_backtrace([0, Assert_failure, o], 1);
              case 13:
               var rest1$12 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 13:
                   var rest2$12 = ty2[1];
                   return [13, trans(rest1$12, rest2$12)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                }
               throw caml_maybe_attach_backtrace([0, Assert_failure, p], 1);
              default:
               var rest1$13 = ty1[1];
               if(typeof ty2 !== "number")
                switch(ty2[0]){
                  case 14:
                   var rest2$13 = ty2[1];
                   return [14, trans(rest1$13, rest2$13)];
                  case 10:
                   break a;
                  case 11:
                   break b;
                  case 12:
                   break c;
                  case 13:
                   break d;
                }
               throw caml_maybe_attach_backtrace([0, Assert_failure, q], 1);
            }
            throw caml_maybe_attach_backtrace([0, Assert_failure, j], 1);
           }
           if(typeof ty2 === "number") return 0;
           switch(ty2[0]){
             case 10:
              break a;
             case 11:
              break b;
             case 12:
              break c;
             case 13:
              break d;
             case 14:
              break e;
             case 8:
              break f;
             case 9: break;
             default:
              throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
           }
          }
          throw caml_maybe_attach_backtrace([0, Assert_failure, d], 1);
         }
         throw caml_maybe_attach_backtrace([0, Assert_failure, c], 1);
        }
        throw caml_maybe_attach_backtrace([0, Assert_failure, i], 1);
       }
       throw caml_maybe_attach_backtrace([0, Assert_failure, h], 1);
      }
      throw caml_maybe_attach_backtrace([0, Assert_failure, g], 1);
     }
     throw caml_maybe_attach_backtrace([0, Assert_failure, f], 1);
    }
    throw caml_maybe_attach_backtrace([0, Assert_failure, e], 1);
   }
   function fmtty_of_fmt(fmtty$4){
    var fmtty = fmtty$4;
    for(;;){
     if(typeof fmtty === "number") return 0;
     switch(fmtty[0]){
       case 4:
        var
         rest$1 = fmtty[4],
         prec = fmtty[3],
         pad$0 = fmtty[2],
         ty_rest = fmtty_of_fmt(rest$1),
         prec_ty = fmtty_of_precision_fmtty(prec, [2, ty_rest]);
        return fmtty_of_padding_fmtty(pad$0, prec_ty);
       case 5:
        var
         rest$2 = fmtty[4],
         prec$0 = fmtty[3],
         pad$1 = fmtty[2],
         ty_rest$0 = fmtty_of_fmt(rest$2),
         prec_ty$0 = fmtty_of_precision_fmtty(prec$0, [3, ty_rest$0]);
        return fmtty_of_padding_fmtty(pad$1, prec_ty$0);
       case 6:
        var
         rest$3 = fmtty[4],
         prec$1 = fmtty[3],
         pad$2 = fmtty[2],
         ty_rest$1 = fmtty_of_fmt(rest$3),
         prec_ty$1 = fmtty_of_precision_fmtty(prec$1, [4, ty_rest$1]);
        return fmtty_of_padding_fmtty(pad$2, prec_ty$1);
       case 7:
        var
         rest$4 = fmtty[4],
         prec$2 = fmtty[3],
         pad$3 = fmtty[2],
         ty_rest$2 = fmtty_of_fmt(rest$4),
         prec_ty$2 = fmtty_of_precision_fmtty(prec$2, [5, ty_rest$2]);
        return fmtty_of_padding_fmtty(pad$3, prec_ty$2);
       case 8:
        var
         rest$5 = fmtty[4],
         prec$3 = fmtty[3],
         pad$4 = fmtty[2],
         ty_rest$3 = fmtty_of_fmt(rest$5),
         prec_ty$3 = fmtty_of_precision_fmtty(prec$3, [6, ty_rest$3]);
        return fmtty_of_padding_fmtty(pad$4, prec_ty$3);
       case 9:
        var rest$6 = fmtty[2], pad$5 = fmtty[1];
        return fmtty_of_padding_fmtty(pad$5, [7, fmtty_of_fmt(rest$6)]);
       case 10:
        var fmtty$0 = fmtty[1]; fmtty = fmtty$0; break;
       case 13:
        var rest$7 = fmtty[3], ty = fmtty[2];
        return [8, ty, fmtty_of_fmt(rest$7)];
       case 14:
        var rest$8 = fmtty[3], ty$0 = fmtty[2];
        return [9, ty$0, ty$0, fmtty_of_fmt(rest$8)];
       case 15:
        var rest$9 = fmtty[1]; return [10, fmtty_of_fmt(rest$9)];
       case 16:
        var rest$10 = fmtty[1]; return [11, fmtty_of_fmt(rest$10)];
       case 18:
        var
         rest$11 = fmtty[2],
         formatting_gen = fmtty[1],
         b = fmtty_of_fmt(rest$11);
        if(0 === formatting_gen[0])
         var fmt = formatting_gen[1][1], a = fmtty_of_fmt(fmt);
        else
         var fmt$0 = formatting_gen[1][1], a = fmtty_of_fmt(fmt$0);
        return CamlinternalFormatBasics[1].call(null, a, b);
       case 19:
        var rest$12 = fmtty[1]; return [13, fmtty_of_fmt(rest$12)];
       case 20:
        var rest$13 = fmtty[3]; return [1, fmtty_of_fmt(rest$13)];
       case 21:
        var rest$14 = fmtty[2]; return [2, fmtty_of_fmt(rest$14)];
       case 23:
        var fmtty$2 = fmtty[2], ign = fmtty[1];
        if(typeof ign === "number"){
         if(2 === ign) return [14, fmtty_of_fmt(fmtty$2)];
         fmtty = fmtty$2;
        }
        else{
         if(9 === ign[0]){
          var fmtty$3 = ign[2], c = fmtty_of_fmt(fmtty$2);
          return CamlinternalFormatBasics[1].call(null, fmtty$3, c);
         }
         fmtty = fmtty$2;
        }
        break;
       case 24:
        var rest$15 = fmtty[3], arity = fmtty[1];
        return fmtty_of_custom(arity, fmtty_of_fmt(rest$15));
       case 2:
       case 3:
        var rest$0 = fmtty[2], pad = fmtty[1];
        return fmtty_of_padding_fmtty(pad, [1, fmtty_of_fmt(rest$0)]);
       case 0:
       case 1:
       case 22:
        var rest = fmtty[1]; return [0, fmtty_of_fmt(rest)];
       default: var fmtty$1 = fmtty[2]; fmtty = fmtty$1;
     }
    }
   }
   function fmtty_of_custom(arity, fmtty){
    if(! arity) return fmtty;
    var arity$0 = arity[1];
    return [12, fmtty_of_custom(arity$0, fmtty)];
   }
   function fmtty_of_padding_fmtty(pad, fmtty){
    return typeof pad === "number" ? fmtty : 0 === pad[0] ? fmtty : [2, fmtty];
   }
   function fmtty_of_precision_fmtty(prec, fmtty){
    return typeof prec === "number" ? prec ? [2, fmtty] : fmtty : fmtty;
   }
   var
    Type_mismatch =
      [248, "CamlinternalFormat.Type_mismatch", runtime.caml_fresh_oo_id(0)];
   function type_padding(pad, fmtty){
    if(typeof pad === "number") return [0, 0, fmtty];
    if(0 === pad[0]){
     var w = pad[2], padty = pad[1];
     return [0, [0, padty, w], fmtty];
    }
    if(typeof fmtty !== "number" && 2 === fmtty[0]){
     var rest = fmtty[1], padty$0 = pad[1];
     return [0, [1, padty$0], rest];
    }
    throw caml_maybe_attach_backtrace(Type_mismatch, 1);
   }
   function type_padprec(pad, prec, fmtty){
    var match = type_padding(pad, fmtty);
    if(typeof prec !== "number"){
     var rest$1 = match[2], pad$2 = match[1], p = prec[1];
     return [0, pad$2, [0, p], rest$1];
    }
    if(! prec){
     var rest$0 = match[2], pad$1 = match[1];
     return [0, pad$1, 0, rest$0];
    }
    var match$0 = match[2];
    if(typeof match$0 !== "number" && 2 === match$0[0]){
     var rest = match$0[1], pad$0 = match[1];
     return [0, pad$0, 1, rest];
    }
    throw caml_maybe_attach_backtrace(Type_mismatch, 1);
   }
   function type_format(fmt, fmtty){
    var a = type_format_gen(fmt, fmtty);
    if(typeof a[2] !== "number")
     throw caml_maybe_attach_backtrace(Type_mismatch, 1);
    var fmt$0 = a[1];
    return fmt$0;
   }
   function type_format_gen(fmt, fmtty0){
    if(typeof fmt === "number") return [0, 0, fmtty0];
    switch(fmt[0]){
      case 0:
       if(typeof fmtty0 !== "number" && 0 === fmtty0[0]){
        var
         fmtty_rest = fmtty0[1],
         fmt_rest = fmt[1],
         match = type_format_gen(fmt_rest, fmtty_rest),
         fmtty = match[2],
         fmt$0 = match[1];
        return [0, [0, fmt$0], fmtty];
       }
       break;
      case 1:
       if(typeof fmtty0 !== "number" && 0 === fmtty0[0]){
        var
         fmtty_rest$0 = fmtty0[1],
         fmt_rest$0 = fmt[1],
         match$0 = type_format_gen(fmt_rest$0, fmtty_rest$0),
         fmtty$0 = match$0[2],
         fmt$1 = match$0[1];
        return [0, [1, fmt$1], fmtty$0];
       }
       break;
      case 2:
       var
        fmt_rest$1 = fmt[2],
        pad = fmt[1],
        match$1 = type_padding(pad, fmtty0),
        pad$0 = match$1[1],
        match$2 = match$1[2];
       if(typeof match$2 !== "number" && 1 === match$2[0]){
        var
         fmtty_rest$1 = match$2[1],
         match$3 = type_format_gen(fmt_rest$1, fmtty_rest$1),
         fmtty$1 = match$3[2],
         fmt$2 = match$3[1];
        return [0, [2, pad$0, fmt$2], fmtty$1];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 3:
       var
        fmt_rest$2 = fmt[2],
        pad$1 = fmt[1],
        match$4 = type_padding(pad$1, fmtty0),
        pad$2 = match$4[1],
        match$5 = match$4[2];
       if(typeof match$5 !== "number" && 1 === match$5[0]){
        var
         fmtty_rest$2 = match$5[1],
         match$6 = type_format_gen(fmt_rest$2, fmtty_rest$2),
         fmtty$2 = match$6[2],
         fmt$3 = match$6[1];
        return [0, [3, pad$2, fmt$3], fmtty$2];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 4:
       var
        fmt_rest$3 = fmt[4],
        prec = fmt[3],
        pad$3 = fmt[2],
        iconv = fmt[1],
        match$7 = type_padprec(pad$3, prec, fmtty0),
        pad$4 = match$7[1],
        match$8 = match$7[3];
       if(typeof match$8 !== "number" && 2 === match$8[0]){
        var
         fmtty_rest$3 = match$8[1],
         prec$0 = match$7[2],
         match$9 = type_format_gen(fmt_rest$3, fmtty_rest$3),
         fmtty$3 = match$9[2],
         fmt$4 = match$9[1];
        return [0, [4, iconv, pad$4, prec$0, fmt$4], fmtty$3];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 5:
       var
        fmt_rest$4 = fmt[4],
        prec$1 = fmt[3],
        pad$5 = fmt[2],
        iconv$0 = fmt[1],
        match$10 = type_padprec(pad$5, prec$1, fmtty0),
        pad$6 = match$10[1],
        match$11 = match$10[3];
       if(typeof match$11 !== "number" && 3 === match$11[0]){
        var
         fmtty_rest$4 = match$11[1],
         prec$2 = match$10[2],
         match$12 = type_format_gen(fmt_rest$4, fmtty_rest$4),
         fmtty$4 = match$12[2],
         fmt$5 = match$12[1];
        return [0, [5, iconv$0, pad$6, prec$2, fmt$5], fmtty$4];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 6:
       var
        fmt_rest$5 = fmt[4],
        prec$3 = fmt[3],
        pad$7 = fmt[2],
        iconv$1 = fmt[1],
        match$13 = type_padprec(pad$7, prec$3, fmtty0),
        pad$8 = match$13[1],
        match$14 = match$13[3];
       if(typeof match$14 !== "number" && 4 === match$14[0]){
        var
         fmtty_rest$5 = match$14[1],
         prec$4 = match$13[2],
         match$15 = type_format_gen(fmt_rest$5, fmtty_rest$5),
         fmtty$5 = match$15[2],
         fmt$6 = match$15[1];
        return [0, [6, iconv$1, pad$8, prec$4, fmt$6], fmtty$5];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 7:
       var
        fmt_rest$6 = fmt[4],
        prec$5 = fmt[3],
        pad$9 = fmt[2],
        iconv$2 = fmt[1],
        match$16 = type_padprec(pad$9, prec$5, fmtty0),
        pad$10 = match$16[1],
        match$17 = match$16[3];
       if(typeof match$17 !== "number" && 5 === match$17[0]){
        var
         fmtty_rest$6 = match$17[1],
         prec$6 = match$16[2],
         match$18 = type_format_gen(fmt_rest$6, fmtty_rest$6),
         fmtty$6 = match$18[2],
         fmt$7 = match$18[1];
        return [0, [7, iconv$2, pad$10, prec$6, fmt$7], fmtty$6];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 8:
       var
        fmt_rest$7 = fmt[4],
        prec$7 = fmt[3],
        pad$11 = fmt[2],
        fconv = fmt[1],
        match$19 = type_padprec(pad$11, prec$7, fmtty0),
        pad$12 = match$19[1],
        match$20 = match$19[3];
       if(typeof match$20 !== "number" && 6 === match$20[0]){
        var
         fmtty_rest$7 = match$20[1],
         prec$8 = match$19[2],
         match$21 = type_format_gen(fmt_rest$7, fmtty_rest$7),
         fmtty$7 = match$21[2],
         fmt$8 = match$21[1];
        return [0, [8, fconv, pad$12, prec$8, fmt$8], fmtty$7];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 9:
       var
        fmt_rest$8 = fmt[2],
        pad$13 = fmt[1],
        match$22 = type_padding(pad$13, fmtty0),
        pad$14 = match$22[1],
        match$23 = match$22[2];
       if(typeof match$23 !== "number" && 7 === match$23[0]){
        var
         fmtty_rest$8 = match$23[1],
         match$24 = type_format_gen(fmt_rest$8, fmtty_rest$8),
         fmtty$8 = match$24[2],
         fmt$9 = match$24[1];
        return [0, [9, pad$14, fmt$9], fmtty$8];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
      case 10:
       var
        fmt_rest$9 = fmt[1],
        match$25 = type_format_gen(fmt_rest$9, fmtty0),
        fmtty$9 = match$25[2],
        fmt$10 = match$25[1];
       return [0, [10, fmt$10], fmtty$9];
      case 11:
       var
        fmt_rest$10 = fmt[2],
        str = fmt[1],
        match$26 = type_format_gen(fmt_rest$10, fmtty0),
        fmtty$10 = match$26[2],
        fmt$11 = match$26[1];
       return [0, [11, str, fmt$11], fmtty$10];
      case 12:
       var
        fmt_rest$11 = fmt[2],
        chr = fmt[1],
        match$27 = type_format_gen(fmt_rest$11, fmtty0),
        fmtty$11 = match$27[2],
        fmt$12 = match$27[1];
       return [0, [12, chr, fmt$12], fmtty$11];
      case 13:
       if(typeof fmtty0 !== "number" && 8 === fmtty0[0]){
        var
         fmtty_rest$9 = fmtty0[2],
         sub_fmtty = fmtty0[1],
         fmt_rest$12 = fmt[3],
         sub_fmtty$0 = fmt[2],
         pad_opt = fmt[1];
        if(caml_notequal([0, sub_fmtty$0], [0, sub_fmtty]))
         throw caml_maybe_attach_backtrace(Type_mismatch, 1);
        var
         match$28 = type_format_gen(fmt_rest$12, fmtty_rest$9),
         fmtty$12 = match$28[2],
         fmt$13 = match$28[1];
        return [0, [13, pad_opt, sub_fmtty, fmt$13], fmtty$12];
       }
       break;
      case 14:
       if(typeof fmtty0 !== "number" && 9 === fmtty0[0]){
        var
         fmtty_rest$10 = fmtty0[3],
         sub_fmtty1 = fmtty0[1],
         fmt_rest$13 = fmt[3],
         sub_fmtty$1 = fmt[2],
         pad_opt$0 = fmt[1],
         b = [0, CamlinternalFormatBasics[2].call(null, sub_fmtty1)];
        if
         (caml_notequal
           ([0, CamlinternalFormatBasics[2].call(null, sub_fmtty$1)], b))
         throw caml_maybe_attach_backtrace(Type_mismatch, 1);
        var
         match$29 =
           type_format_gen
            (fmt_rest$13,
             CamlinternalFormatBasics[2].call(null, fmtty_rest$10)),
         fmtty$13 = match$29[2],
         fmt$14 = match$29[1];
        return [0, [14, pad_opt$0, sub_fmtty1, fmt$14], fmtty$13];
       }
       break;
      case 15:
       if(typeof fmtty0 !== "number" && 10 === fmtty0[0]){
        var
         fmtty_rest$11 = fmtty0[1],
         fmt_rest$14 = fmt[1],
         match$30 = type_format_gen(fmt_rest$14, fmtty_rest$11),
         fmtty$14 = match$30[2],
         fmt$15 = match$30[1];
        return [0, [15, fmt$15], fmtty$14];
       }
       break;
      case 16:
       if(typeof fmtty0 !== "number" && 11 === fmtty0[0]){
        var
         fmtty_rest$12 = fmtty0[1],
         fmt_rest$15 = fmt[1],
         match$31 = type_format_gen(fmt_rest$15, fmtty_rest$12),
         fmtty$15 = match$31[2],
         fmt$16 = match$31[1];
        return [0, [16, fmt$16], fmtty$15];
       }
       break;
      case 17:
       var
        fmt_rest$16 = fmt[2],
        formatting_lit = fmt[1],
        match$32 = type_format_gen(fmt_rest$16, fmtty0),
        fmtty$16 = match$32[2],
        fmt$17 = match$32[1];
       return [0, [17, formatting_lit, fmt$17], fmtty$16];
      case 18:
       var fmt_rest$17 = fmt[2], formatting_gen = fmt[1];
       if(0 === formatting_gen[0]){
        var
         match$36 = formatting_gen[1],
         str$0 = match$36[2],
         fmt1 = match$36[1],
         match$37 = type_format_gen(fmt1, fmtty0),
         fmtty2 = match$37[2],
         fmt2 = match$37[1],
         match$38 = type_format_gen(fmt_rest$17, fmtty2),
         fmtty3 = match$38[2],
         fmt3 = match$38[1];
        return [0, [18, [0, [0, fmt2, str$0]], fmt3], fmtty3];
       }
       var
        match$39 = formatting_gen[1],
        str$1 = match$39[2],
        fmt1$0 = match$39[1],
        match$40 = type_format_gen(fmt1$0, fmtty0),
        fmtty2$0 = match$40[2],
        fmt2$0 = match$40[1],
        match$41 = type_format_gen(fmt_rest$17, fmtty2$0),
        fmtty3$0 = match$41[2],
        fmt3$0 = match$41[1];
       return [0, [18, [1, [0, fmt2$0, str$1]], fmt3$0], fmtty3$0];
      case 19:
       if(typeof fmtty0 !== "number" && 13 === fmtty0[0]){
        var
         fmtty_rest$13 = fmtty0[1],
         fmt_rest$18 = fmt[1],
         match$33 = type_format_gen(fmt_rest$18, fmtty_rest$13),
         fmtty$17 = match$33[2],
         fmt$18 = match$33[1];
        return [0, [19, fmt$18], fmtty$17];
       }
       break;
      case 20:
       if(typeof fmtty0 !== "number" && 1 === fmtty0[0]){
        var
         fmtty_rest$14 = fmtty0[1],
         fmt_rest$19 = fmt[3],
         char_set = fmt[2],
         width_opt = fmt[1],
         match$34 = type_format_gen(fmt_rest$19, fmtty_rest$14),
         fmtty$18 = match$34[2],
         fmt$19 = match$34[1];
        return [0, [20, width_opt, char_set, fmt$19], fmtty$18];
       }
       break;
      case 21:
       if(typeof fmtty0 !== "number" && 2 === fmtty0[0]){
        var
         fmtty_rest$15 = fmtty0[1],
         fmt_rest$20 = fmt[2],
         counter = fmt[1],
         match$35 = type_format_gen(fmt_rest$20, fmtty_rest$15),
         fmtty$19 = match$35[2],
         fmt$20 = match$35[1];
        return [0, [21, counter, fmt$20], fmtty$19];
       }
       break;
      case 23:
       var rest = fmt[2], ign = fmt[1];
       if(typeof ign !== "number")
        switch(ign[0]){
          case 8:
           var sub_fmtty$2 = ign[2], pad_opt$1 = ign[1];
           return type_ignored_param_one
                   ([8, pad_opt$1, sub_fmtty$2], rest, fmtty0);
          case 9:
           var
            sub_fmtty$3 = ign[2],
            pad_opt$2 = ign[1],
            a = type_ignored_format_substituti(sub_fmtty$3, rest, fmtty0),
            match$43 = a[2],
            fmtty$21 = match$43[2],
            fmt$22 = match$43[1],
            sub_fmtty$4 = a[1];
           return [0, [23, [9, pad_opt$2, sub_fmtty$4], fmt$22], fmtty$21];
          default: return type_ignored_param_one(ign, rest, fmtty0);
        }
       if(2 !== ign) return type_ignored_param_one(ign, rest, fmtty0);
       if(typeof fmtty0 !== "number" && 14 === fmtty0[0]){
        var
         fmtty_rest$16 = fmtty0[1],
         match$42 = type_format_gen(rest, fmtty_rest$16),
         fmtty$20 = match$42[2],
         fmt$21 = match$42[1];
        return [0, [23, 2, fmt$21], fmtty$20];
       }
       throw caml_maybe_attach_backtrace(Type_mismatch, 1);
    }
    throw caml_maybe_attach_backtrace(Type_mismatch, 1);
   }
   function type_ignored_param_one(ign, fmt, fmtty){
    var
     match = type_format_gen(fmt, fmtty),
     fmtty$0 = match[2],
     fmt$0 = match[1];
    return [0, [23, ign, fmt$0], fmtty$0];
   }
   function type_ignored_format_substituti(sub_fmtty, fmt, fmtty){
    if(typeof sub_fmtty === "number")
     return [0, 0, type_format_gen(fmt, fmtty)];
    switch(sub_fmtty[0]){
      case 0:
       if(typeof fmtty !== "number" && 0 === fmtty[0]){
        var
         fmtty_rest = fmtty[1],
         sub_fmtty_rest = sub_fmtty[1],
         match =
           type_ignored_format_substituti(sub_fmtty_rest, fmt, fmtty_rest),
         fmt$0 = match[2],
         sub_fmtty_rest$0 = match[1];
        return [0, [0, sub_fmtty_rest$0], fmt$0];
       }
       break;
      case 1:
       if(typeof fmtty !== "number" && 1 === fmtty[0]){
        var
         fmtty_rest$0 = fmtty[1],
         sub_fmtty_rest$1 = sub_fmtty[1],
         match$0 =
           type_ignored_format_substituti(sub_fmtty_rest$1, fmt, fmtty_rest$0),
         fmt$1 = match$0[2],
         sub_fmtty_rest$2 = match$0[1];
        return [0, [1, sub_fmtty_rest$2], fmt$1];
       }
       break;
      case 2:
       if(typeof fmtty !== "number" && 2 === fmtty[0]){
        var
         fmtty_rest$1 = fmtty[1],
         sub_fmtty_rest$3 = sub_fmtty[1],
         match$1 =
           type_ignored_format_substituti(sub_fmtty_rest$3, fmt, fmtty_rest$1),
         fmt$2 = match$1[2],
         sub_fmtty_rest$4 = match$1[1];
        return [0, [2, sub_fmtty_rest$4], fmt$2];
       }
       break;
      case 3:
       if(typeof fmtty !== "number" && 3 === fmtty[0]){
        var
         fmtty_rest$2 = fmtty[1],
         sub_fmtty_rest$5 = sub_fmtty[1],
         match$2 =
           type_ignored_format_substituti(sub_fmtty_rest$5, fmt, fmtty_rest$2),
         fmt$3 = match$2[2],
         sub_fmtty_rest$6 = match$2[1];
        return [0, [3, sub_fmtty_rest$6], fmt$3];
       }
       break;
      case 4:
       if(typeof fmtty !== "number" && 4 === fmtty[0]){
        var
         fmtty_rest$3 = fmtty[1],
         sub_fmtty_rest$7 = sub_fmtty[1],
         match$3 =
           type_ignored_format_substituti(sub_fmtty_rest$7, fmt, fmtty_rest$3),
         fmt$4 = match$3[2],
         sub_fmtty_rest$8 = match$3[1];
        return [0, [4, sub_fmtty_rest$8], fmt$4];
       }
       break;
      case 5:
       if(typeof fmtty !== "number" && 5 === fmtty[0]){
        var
         fmtty_rest$4 = fmtty[1],
         sub_fmtty_rest$9 = sub_fmtty[1],
         match$4 =
           type_ignored_format_substituti(sub_fmtty_rest$9, fmt, fmtty_rest$4),
         fmt$5 = match$4[2],
         sub_fmtty_rest$10 = match$4[1];
        return [0, [5, sub_fmtty_rest$10], fmt$5];
       }
       break;
      case 6:
       if(typeof fmtty !== "number" && 6 === fmtty[0]){
        var
         fmtty_rest$5 = fmtty[1],
         sub_fmtty_rest$11 = sub_fmtty[1],
         match$5 =
           type_ignored_format_substituti
            (sub_fmtty_rest$11, fmt, fmtty_rest$5),
         fmt$6 = match$5[2],
         sub_fmtty_rest$12 = match$5[1];
        return [0, [6, sub_fmtty_rest$12], fmt$6];
       }
       break;
      case 7:
       if(typeof fmtty !== "number" && 7 === fmtty[0]){
        var
         fmtty_rest$6 = fmtty[1],
         sub_fmtty_rest$13 = sub_fmtty[1],
         match$6 =
           type_ignored_format_substituti
            (sub_fmtty_rest$13, fmt, fmtty_rest$6),
         fmt$7 = match$6[2],
         sub_fmtty_rest$14 = match$6[1];
        return [0, [7, sub_fmtty_rest$14], fmt$7];
       }
       break;
      case 8:
       if(typeof fmtty !== "number" && 8 === fmtty[0]){
        var
         fmtty_rest$7 = fmtty[2],
         sub2_fmtty = fmtty[1],
         sub_fmtty_rest$15 = sub_fmtty[2],
         sub2_fmtty$0 = sub_fmtty[1];
        if(caml_notequal([0, sub2_fmtty$0], [0, sub2_fmtty]))
         throw caml_maybe_attach_backtrace(Type_mismatch, 1);
        var
         match$7 =
           type_ignored_format_substituti
            (sub_fmtty_rest$15, fmt, fmtty_rest$7),
         fmt$8 = match$7[2],
         sub_fmtty_rest$16 = match$7[1];
        return [0, [8, sub2_fmtty, sub_fmtty_rest$16], fmt$8];
       }
       break;
      case 9:
       if(typeof fmtty !== "number" && 9 === fmtty[0]){
        var
         fmtty_rest$8 = fmtty[3],
         sub2_fmtty$1 = fmtty[2],
         sub1_fmtty = fmtty[1],
         sub_fmtty_rest$17 = sub_fmtty[3],
         sub2_fmtty$2 = sub_fmtty[2],
         sub1_fmtty$0 = sub_fmtty[1],
         a = [0, CamlinternalFormatBasics[2].call(null, sub1_fmtty)];
        if
         (caml_notequal
           ([0, CamlinternalFormatBasics[2].call(null, sub1_fmtty$0)], a))
         throw caml_maybe_attach_backtrace(Type_mismatch, 1);
        var b = [0, CamlinternalFormatBasics[2].call(null, sub2_fmtty$1)];
        if
         (caml_notequal
           ([0, CamlinternalFormatBasics[2].call(null, sub2_fmtty$2)], b))
         throw caml_maybe_attach_backtrace(Type_mismatch, 1);
        var
         sub_fmtty$0 = trans(symm(sub1_fmtty), sub2_fmtty$1),
         match$8 = fmtty_rel_det(sub_fmtty$0),
         f4 = match$8[4],
         f2 = match$8[2];
        f2(0);
        f4(0);
        var
         match$9 =
           type_ignored_format_substituti
            (CamlinternalFormatBasics[2].call(null, sub_fmtty_rest$17),
             fmt,
             fmtty_rest$8),
         fmt$9 = match$9[2],
         sub_fmtty_rest$18 = match$9[1];
        return [0,
                [9, sub1_fmtty, sub2_fmtty$1, symm(sub_fmtty_rest$18)],
                fmt$9];
       }
       break;
      case 10:
       if(typeof fmtty !== "number" && 10 === fmtty[0]){
        var
         fmtty_rest$9 = fmtty[1],
         sub_fmtty_rest$19 = sub_fmtty[1],
         match$10 =
           type_ignored_format_substituti
            (sub_fmtty_rest$19, fmt, fmtty_rest$9),
         fmt$10 = match$10[2],
         sub_fmtty_rest$20 = match$10[1];
        return [0, [10, sub_fmtty_rest$20], fmt$10];
       }
       break;
      case 11:
       if(typeof fmtty !== "number" && 11 === fmtty[0]){
        var
         fmtty_rest$10 = fmtty[1],
         sub_fmtty_rest$21 = sub_fmtty[1],
         match$11 =
           type_ignored_format_substituti
            (sub_fmtty_rest$21, fmt, fmtty_rest$10),
         fmt$11 = match$11[2],
         sub_fmtty_rest$22 = match$11[1];
        return [0, [11, sub_fmtty_rest$22], fmt$11];
       }
       break;
      case 13:
       if(typeof fmtty !== "number" && 13 === fmtty[0]){
        var
         fmtty_rest$11 = fmtty[1],
         sub_fmtty_rest$23 = sub_fmtty[1],
         match$12 =
           type_ignored_format_substituti
            (sub_fmtty_rest$23, fmt, fmtty_rest$11),
         fmt$12 = match$12[2],
         sub_fmtty_rest$24 = match$12[1];
        return [0, [13, sub_fmtty_rest$24], fmt$12];
       }
       break;
      case 14:
       if(typeof fmtty !== "number" && 14 === fmtty[0]){
        var
         fmtty_rest$12 = fmtty[1],
         sub_fmtty_rest$25 = sub_fmtty[1],
         match$13 =
           type_ignored_format_substituti
            (sub_fmtty_rest$25, fmt, fmtty_rest$12),
         fmt$13 = match$13[2],
         sub_fmtty_rest$26 = match$13[1];
        return [0, [14, sub_fmtty_rest$26], fmt$13];
       }
       break;
    }
    throw caml_maybe_attach_backtrace(Type_mismatch, 1);
   }
   function recast(fmt, fmtty){
    var a = symm(fmtty);
    return type_format(fmt, CamlinternalFormatBasics[2].call(null, a));
   }
   function fix_padding(padty, width, str){
    var
     len = caml_ml_string_length(str),
     padty$0 = 0 <= width ? padty : 0,
     width$0 = Stdlib[18].call(null, width);
    if(width$0 <= len) return str;
    var
     a = 2 === padty$0 ? 48 : 32,
     res = Stdlib_Bytes[1].call(null, width$0, a);
    switch(padty$0){
      case 0:
       Stdlib_String[6].call(null, str, 0, res, 0, len); break;
      case 1:
       Stdlib_String[6].call(null, str, 0, res, width$0 - len | 0, len);
       break;
      default:
       a:
       if(0 < len){
        if
         (43 !== caml_string_get(str, 0)
          && 45 !== caml_string_get(str, 0) && 32 !== caml_string_get(str, 0))
         break a;
        caml_bytes_set(res, 0, caml_string_get(str, 0));
        Stdlib_String[6].call
         (null, str, 1, res, (width$0 - len | 0) + 1 | 0, len - 1 | 0);
        break;
       }
       a:
       if(1 < len && 48 === caml_string_get(str, 0)){
        if(120 !== caml_string_get(str, 1) && 88 !== caml_string_get(str, 1))
         break a;
        caml_bytes_set(res, 1, caml_string_get(str, 1));
        Stdlib_String[6].call
         (null, str, 2, res, (width$0 - len | 0) + 2 | 0, len - 2 | 0);
        break;
       }
       Stdlib_String[6].call(null, str, 0, res, width$0 - len | 0, len);
    }
    return Stdlib_Bytes[44].call(null, res);
   }
   function fix_int_precision(prec, str){
    var
     prec$0 = Stdlib[18].call(null, prec),
     len = caml_ml_string_length(str),
     c = caml_string_get(str, 0);
    a:
    {
     b:
     {
      if(58 > c){
       if(32 !== c){
        if(43 > c) break a;
        switch(c - 43 | 0){
          case 5:
           if(len >= (prec$0 + 2 | 0)) break b;
           if(1 >= len) break b;
           if
            (120 !== caml_string_get(str, 1) && 88 !== caml_string_get(str, 1))
            break b;
           var res$1 = Stdlib_Bytes[1].call(null, prec$0 + 2 | 0, 48);
           caml_bytes_set(res$1, 1, caml_string_get(str, 1));
           Stdlib_String[6].call
            (null, str, 2, res$1, (prec$0 - len | 0) + 4 | 0, len - 2 | 0);
           return Stdlib_Bytes[44].call(null, res$1);
          case 0:
          case 2: break;
          case 1:
          case 3:
          case 4:
           break a;
          default: break b;
        }
       }
       if(len >= (prec$0 + 1 | 0)) break a;
       var res$0 = Stdlib_Bytes[1].call(null, prec$0 + 1 | 0, 48);
       caml_bytes_set(res$0, 0, c);
       Stdlib_String[6].call
        (null, str, 1, res$0, (prec$0 - len | 0) + 2 | 0, len - 1 | 0);
       return Stdlib_Bytes[44].call(null, res$0);
      }
      if(71 <= c){if(5 < c - 97 >>> 0) break a;} else if(65 > c) break a;
     }
     if(len < prec$0){
      var res = Stdlib_Bytes[1].call(null, prec$0, 48);
      Stdlib_String[6].call(null, str, 0, res, prec$0 - len | 0, len);
      return Stdlib_Bytes[44].call(null, res);
     }
    }
    return str;
   }
   function string_to_caml_string(str){
    var
     str$0 = Stdlib_String[25].call(null, str),
     l = caml_ml_string_length(str$0),
     res = Stdlib_Bytes[1].call(null, l + 2 | 0, 34);
    caml_blit_string(str$0, 0, res, 1, l);
    return Stdlib_Bytes[44].call(null, res);
   }
   var r = [0, 103];
   function format_of_fconv(fconv, prec){
    var
     prec$0 = Stdlib[18].call(null, prec),
     symb = char_of_fconv(r, fconv),
     buf = buffer_create(16);
    buffer_add_char(buf, 37);
    bprint_fconv_flag(buf, fconv);
    buffer_add_char(buf, 46);
    buffer_add_string(buf, Stdlib_Int[12].call(null, prec$0));
    buffer_add_char(buf, symb);
    return buffer_contents(buf);
   }
   function transform_int_alt(iconv, s){
    if(13 > iconv) return s;
    var b = caml_ml_string_length(s) - 1 | 0, a = 0;
    if(b < 0)
     var n$2 = a;
    else{
     var n = a, i$0 = 0;
     for(;;){
      if(9 < caml_string_unsafe_get(s, i$0) - 48 >>> 0)
       var n$1 = n;
      else
       var n$0 = n + 1 | 0, n$1 = n$0;
      var g = i$0 + 1 | 0;
      if(b === i$0){var n$2 = n$1; break;}
      n = n$1;
      i$0 = g;
     }
    }
    var
     buf =
       caml_create_bytes
        (caml_ml_string_length(s) + ((n$2 - 1 | 0) / 3 | 0) | 0),
     pos = [0, 0];
    function put(c){caml_bytes_set(buf, pos[1], c); pos[1]++;}
    var
     d = caml_ml_string_length(s) - 1 | 0,
     e = ((n$2 - 1 | 0) % 3 | 0) + 1 | 0;
    if(d >= 0){
     var left = e, i = 0;
     for(;;){
      var c = caml_string_unsafe_get(s, i);
      if(9 < c - 48 >>> 0){
       put(c);
       var left$2 = left;
      }
      else{
       var left$0 = 0 === left ? (put(95), 3) : left, left$1 = left$0 - 1 | 0;
       put(c);
       var left$2 = left$1;
      }
      var f = i + 1 | 0;
      if(d === i) break;
      left = left$2;
      i = f;
     }
    }
    return Stdlib_Bytes[44].call(null, buf);
   }
   var cst_u = "%u";
   function convert_int(iconv, n){
    switch(iconv){
      case 1:
       var a = "%+d"; break;
      case 2:
       var a = "% d"; break;
      case 4:
       var a = "%+i"; break;
      case 5:
       var a = "% i"; break;
      case 6:
       var a = "%x"; break;
      case 7:
       var a = "%#x"; break;
      case 8:
       var a = "%X"; break;
      case 9:
       var a = "%#X"; break;
      case 10:
       var a = "%o"; break;
      case 11:
       var a = "%#o"; break;
      case 0:
      case 13:
       var a = "%d"; break;
      case 3:
      case 14:
       var a = cst_i; break;
      default: var a = cst_u;
    }
    return transform_int_alt(iconv, caml_format_int(a, n));
   }
   function convert_int32(iconv, n){
    switch(iconv){
      case 1:
       var a = "%+ld"; break;
      case 2:
       var a = "% ld"; break;
      case 4:
       var a = "%+li"; break;
      case 5:
       var a = "% li"; break;
      case 6:
       var a = "%lx"; break;
      case 7:
       var a = "%#lx"; break;
      case 8:
       var a = "%lX"; break;
      case 9:
       var a = "%#lX"; break;
      case 10:
       var a = "%lo"; break;
      case 11:
       var a = "%#lo"; break;
      case 0:
      case 13:
       var a = "%ld"; break;
      case 3:
      case 14:
       var a = cst_li; break;
      default: var a = "%lu";
    }
    return transform_int_alt(iconv, caml_format_int(a, n));
   }
   function convert_nativeint(iconv, n){
    switch(iconv){
      case 1:
       var a = "%+nd"; break;
      case 2:
       var a = "% nd"; break;
      case 4:
       var a = "%+ni"; break;
      case 5:
       var a = "% ni"; break;
      case 6:
       var a = "%nx"; break;
      case 7:
       var a = "%#nx"; break;
      case 8:
       var a = "%nX"; break;
      case 9:
       var a = "%#nX"; break;
      case 10:
       var a = "%no"; break;
      case 11:
       var a = "%#no"; break;
      case 0:
      case 13:
       var a = "%nd"; break;
      case 3:
      case 14:
       var a = cst_ni; break;
      default: var a = "%nu";
    }
    return transform_int_alt(iconv, caml_format_int(a, n));
   }
   function convert_int64(iconv, n){
    switch(iconv){
      case 1:
       var a = "%+Ld"; break;
      case 2:
       var a = "% Ld"; break;
      case 4:
       var a = "%+Li"; break;
      case 5:
       var a = "% Li"; break;
      case 6:
       var a = "%Lx"; break;
      case 7:
       var a = "%#Lx"; break;
      case 8:
       var a = "%LX"; break;
      case 9:
       var a = "%#LX"; break;
      case 10:
       var a = "%Lo"; break;
      case 11:
       var a = "%#Lo"; break;
      case 0:
      case 13:
       var a = "%Ld"; break;
      case 3:
      case 14:
       var a = cst_Li; break;
      default: var a = "%Lu";
    }
    return transform_int_alt(iconv, runtime.caml_int64_format(a, n));
   }
   function convert_float(fconv, prec, x){
    function hex(param){
     switch(fconv[1]){
       case 0:
        var sign = 45; break;
       case 1:
        var sign = 43; break;
       default: var sign = 32;
     }
     return runtime.caml_hexstring_of_float(x, prec, sign);
    }
    function caml_special_val(str){
     var match = runtime.caml_classify_float(x);
     return 3 === match
             ? x < 0. ? "neg_infinity" : "infinity"
             : 4 <= match ? "nan" : str;
    }
    switch(fconv[2]){
      case 5:
       var
        str = caml_format_float(format_of_fconv(fconv, prec), x),
        len = caml_ml_string_length(str),
        i = 0;
       for(;;){
        a:
        {
         if(i !== len){
          var a = caml_string_get(str, i) - 46 | 0;
          b:
          {
           if(23 < a >>> 0){
            if(55 !== a) break b;
           }
           else if(21 >= a - 1 >>> 0) break b;
           var b = 1;
           break a;
          }
          var i$0 = i + 1 | 0;
          i = i$0;
          continue;
         }
         var b = 0;
        }
        var c = b ? str : Stdlib[28].call(null, str, ".");
        return caml_special_val(c);
       }
      case 6:
       return hex(0);
      case 7:
       var d = hex(0); return Stdlib_String[26].call(null, d);
      case 8:
       return caml_special_val(hex(0));
      default: return caml_format_float(format_of_fconv(fconv, prec), x);
    }
   }
   function string_of_fmtty(fmtty){
    var buf = buffer_create(16);
    bprint_fmtty(buf, fmtty);
    return buffer_contents(buf);
   }
   var s = [0, cst_camlinternalFormat_ml, 1558, 4];
   function make_printf$0(counter, k$2, acc$4, fmt$2){
    a:
    {
     b:
     {
      c:
      {
       d:
       {
        e:
        {
         f:
         {
          g:
          {
           h:
           {
            i:
            {
             j:
             {
              var k = k$2, acc = acc$4, fmt = fmt$2;
              k:
              for(;;){
               if(typeof fmt === "number") return caml_call1(k, acc);
               switch(fmt[0]){
                 case 0:
                  break a;
                 case 1:
                  break b;
                 case 2:
                  break c;
                 case 3:
                  var rest$2 = fmt[2], pad$0 = fmt[1];
                  return make_padding
                          (k, acc, rest$2, pad$0, string_to_caml_string);
                 case 4:
                  var
                   rest$3 = fmt[4],
                   prec = fmt[3],
                   pad$1 = fmt[2],
                   iconv = fmt[1];
                  return make_int_padding_precision
                          (k, acc, rest$3, pad$1, prec, convert_int, iconv);
                 case 5:
                  var
                   rest$4 = fmt[4],
                   prec$0 = fmt[3],
                   pad$2 = fmt[2],
                   iconv$0 = fmt[1];
                  return make_int_padding_precision
                          (k, acc, rest$4, pad$2, prec$0, convert_int32, iconv$0);
                 case 6:
                  var
                   rest$5 = fmt[4],
                   prec$1 = fmt[3],
                   pad$3 = fmt[2],
                   iconv$1 = fmt[1];
                  return make_int_padding_precision
                          (k, acc, rest$5, pad$3, prec$1, convert_nativeint, iconv$1);
                 case 7:
                  var
                   rest$6 = fmt[4],
                   prec$2 = fmt[3],
                   pad$4 = fmt[2],
                   iconv$2 = fmt[1];
                  return make_int_padding_precision
                          (k, acc, rest$6, pad$4, prec$2, convert_int64, iconv$2);
                 case 8:
                  break d;
                 case 9:
                  var rest$8 = fmt[2], pad$6 = fmt[1];
                  return make_padding(k, acc, rest$8, pad$6, Stdlib[30]);
                 case 10:
                  var rest$9 = fmt[1], acc$0 = [7, acc];
                  acc = acc$0;
                  fmt = rest$9;
                  break;
                 case 11:
                  var rest$10 = fmt[2], str = fmt[1], acc$1 = [2, acc, str];
                  acc = acc$1;
                  fmt = rest$10;
                  break;
                 case 12:
                  var rest$11 = fmt[2], chr = fmt[1], acc$2 = [3, acc, chr];
                  acc = acc$2;
                  fmt = rest$11;
                  break;
                 case 13:
                  break e;
                 case 14:
                  break f;
                 case 15:
                  break g;
                 case 16:
                  break h;
                 case 17:
                  var
                   rest$16 = fmt[2],
                   fmting_lit = fmt[1],
                   acc$3 = [0, acc, fmting_lit];
                  acc = acc$3;
                  fmt = rest$16;
                  break;
                 case 18:
                  var a = fmt[1];
                  if(0 === a[0]){
                   var rest$17 = fmt[2], fmt$0 = a[1][1];
                   let acc$0 = acc, k$1 = k, rest = rest$17;
                   var
                    k$0 =
                      function(kacc){
                       return make_printf(k$1, [1, acc$0, [0, kacc]], rest);
                      };
                   k = k$0;
                   acc = 0;
                   fmt = fmt$0;
                  }
                  else{
                   var rest$18 = fmt[2], fmt$1 = a[1][1];
                   let acc$0 = acc, k$0 = k, rest = rest$18;
                   var
                    k$1 =
                      function(kacc){
                       return make_printf(k$0, [1, acc$0, [1, kacc]], rest);
                      };
                   k = k$1;
                   acc = 0;
                   fmt = fmt$1;
                  }
                  break;
                 case 19:
                  throw caml_maybe_attach_backtrace([0, Assert_failure, s], 1);
                 case 20:
                  break i;
                 case 21:
                  break j;
                 case 22:
                  break k;
                 case 23:
                  var rest$22 = fmt[2], ign = fmt[1];
                  return counter < 50
                          ? make_ignored_param$0
                            (counter + 1 | 0, k, acc, ign, rest$22)
                          : caml_trampoline_return
                            (make_ignored_param$0, [0, k, acc, ign, rest$22]);
                 default:
                  var
                   rest$23 = fmt[3],
                   f = fmt[2],
                   arity = fmt[1],
                   b = caml_call1(f, 0);
                  return counter < 50
                          ? make_custom$0(counter + 1 | 0, k, acc, rest$23, arity, b)
                          : caml_trampoline_return
                            (make_custom$0, [0, k, acc, rest$23, arity, b]);
               }
              }
              var rest$21 = fmt[1];
              return function(c){
               var new_acc = [5, acc, c];
               return make_printf(k, new_acc, rest$21);};
             }
             var rest$20 = fmt[2];
             return function(n){
              var new_acc = [4, acc, caml_format_int(cst_u, n)];
              return make_printf(k, new_acc, rest$20);};
            }
            var
             rest$19 = fmt[3],
             new_acc = [8, acc, "Printf: bad conversion %["];
            return function(param){return make_printf(k, new_acc, rest$19);};
           }
           var rest$15 = fmt[1];
           return function(f){return make_printf(k, [6, acc, f], rest$15);};
          }
          var rest$14 = fmt[1];
          return function(f, x){
           return make_printf
                   (k,
                    [6, acc, function(o){return caml_call2(f, o, x);}],
                    rest$14);};
         }
         var rest$13 = fmt[3], fmtty = fmt[2];
         return function(param){
          var fmt = param[1], a = recast(fmt, fmtty);
          return make_printf
                  (k, acc, CamlinternalFormatBasics[3].call(null, a, rest$13));};
        }
        var
         rest$12 = fmt[3],
         sub_fmtty = fmt[2],
         ty = string_of_fmtty(sub_fmtty);
        return function(str){return make_printf(k, [4, acc, ty], rest$12);};
       }
       var rest$7 = fmt[4], prec$3 = fmt[3], pad$5 = fmt[2], fconv = fmt[1];
       if(typeof pad$5 === "number"){
        if(typeof prec$3 === "number")
         return prec$3
                 ? function
                  (p, x){
                   var str = convert_float(fconv, p, x);
                   return make_printf(k, [4, acc, str], rest$7);
                  }
                 : function
                  (x){
                   var
                    str =
                      convert_float(fconv, default_float_precision(fconv), x);
                   return make_printf(k, [4, acc, str], rest$7);
                  };
        var p = prec$3[1];
        return function(x){
         var str = convert_float(fconv, p, x);
         return make_printf(k, [4, acc, str], rest$7);};
       }
       if(0 === pad$5[0]){
        var w = pad$5[2], padty = pad$5[1];
        if(typeof prec$3 === "number")
         return prec$3
                 ? function
                  (p, x){
                   var str = fix_padding(padty, w, convert_float(fconv, p, x));
                   return make_printf(k, [4, acc, str], rest$7);
                  }
                 : function
                  (x){
                   var
                    str =
                      convert_float(fconv, default_float_precision(fconv), x),
                    str$0 = fix_padding(padty, w, str);
                   return make_printf(k, [4, acc, str$0], rest$7);
                  };
        var p$0 = prec$3[1];
        return function(x){
         var str = fix_padding(padty, w, convert_float(fconv, p$0, x));
         return make_printf(k, [4, acc, str], rest$7);};
       }
       var padty$0 = pad$5[1];
       if(typeof prec$3 === "number")
        return prec$3
                ? function
                 (w, p, x){
                  var
                   str = fix_padding(padty$0, w, convert_float(fconv, p, x));
                  return make_printf(k, [4, acc, str], rest$7);
                 }
                : function
                 (w, x){
                  var
                   str =
                     convert_float(fconv, default_float_precision(fconv), x),
                   str$0 = fix_padding(padty$0, w, str);
                  return make_printf(k, [4, acc, str$0], rest$7);
                 };
       var p$1 = prec$3[1];
       return function(w, x){
        var str = fix_padding(padty$0, w, convert_float(fconv, p$1, x));
        return make_printf(k, [4, acc, str], rest$7);};
      }
      var rest$1 = fmt[2], pad = fmt[1];
      return make_padding(k, acc, rest$1, pad, function(str){return str;});
     }
     var rest$0 = fmt[1];
     return function(c){
      var
       str = Stdlib_Char[2].call(null, c),
       l = caml_ml_string_length(str),
       res = Stdlib_Bytes[1].call(null, l + 2 | 0, 39);
      caml_blit_string(str, 0, res, 1, l);
      var new_acc = [4, acc, Stdlib_Bytes[44].call(null, res)];
      return make_printf(k, new_acc, rest$0);};
    }
    var rest = fmt[1];
    return function(c){
     var new_acc = [5, acc, c];
     return make_printf(k, new_acc, rest);};
   }
   function make_printf(k, acc, fmt){
    return caml_trampoline(make_printf$0(0, k, acc, fmt));
   }
   var t = [0, cst_camlinternalFormat_ml, 1626, 39];
   function make_ignored_param$0(counter, k, acc, ign, fmt){
    if(typeof ign === "number"){
     if(2 === ign)
      throw caml_maybe_attach_backtrace([0, Assert_failure, t], 1);
     return counter < 50
             ? make_invalid_arg(counter + 1 | 0, k, acc, fmt)
             : caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]);
    }
    if(9 !== ign[0])
     return counter < 50
             ? make_invalid_arg(counter + 1 | 0, k, acc, fmt)
             : caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]);
    var fmtty = ign[2];
    return counter < 50
            ? make_from_fmtty$0(counter + 1 | 0, k, acc, fmtty, fmt)
            : caml_trampoline_return
              (make_from_fmtty$0, [0, k, acc, fmtty, fmt]);
   }
   function make_ignored_param(k, acc, ign, fmt){
    return caml_trampoline(make_ignored_param$0(0, k, acc, ign, fmt));
   }
   var
    u = [0, cst_camlinternalFormat_ml, 1649, 31],
    v = [0, cst_camlinternalFormat_ml, 1650, 31];
   function make_from_fmtty$0(counter, k, acc, fmtty, fmt){
    if(typeof fmtty === "number")
     return counter < 50
             ? make_invalid_arg(counter + 1 | 0, k, acc, fmt)
             : caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]);
    switch(fmtty[0]){
      case 0:
       var rest = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest, fmt);};
      case 1:
       var rest$0 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$0, fmt);};
      case 2:
       var rest$1 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$1, fmt);};
      case 3:
       var rest$2 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$2, fmt);};
      case 4:
       var rest$3 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$3, fmt);};
      case 5:
       var rest$4 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$4, fmt);};
      case 6:
       var rest$5 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$5, fmt);};
      case 7:
       var rest$6 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$6, fmt);};
      case 8:
       var rest$7 = fmtty[2];
       return function(param){return make_from_fmtty(k, acc, rest$7, fmt);};
      case 9:
       var
        rest$8 = fmtty[3],
        ty2 = fmtty[2],
        ty1 = fmtty[1],
        ty = trans(symm(ty1), ty2);
       return function(param){
        return make_from_fmtty
                (k,
                 acc,
                 CamlinternalFormatBasics[1].call(null, ty, rest$8),
                 fmt);};
      case 10:
       var rest$9 = fmtty[1];
       return function(a, param){
        return make_from_fmtty(k, acc, rest$9, fmt);};
      case 11:
       var rest$10 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$10, fmt);};
      case 12:
       var rest$11 = fmtty[1];
       return function(param){return make_from_fmtty(k, acc, rest$11, fmt);};
      case 13:
       throw caml_maybe_attach_backtrace([0, Assert_failure, u], 1);
      default: throw caml_maybe_attach_backtrace([0, Assert_failure, v], 1);
    }
   }
   function make_from_fmtty(k, acc, fmtty, fmt){
    return caml_trampoline(make_from_fmtty$0(0, k, acc, fmtty, fmt));
   }
   function make_invalid_arg(counter, k, acc, fmt){
    var a = [8, acc, "Printf: bad conversion %_"];
    return counter < 50
            ? make_printf$0(counter + 1 | 0, k, a, fmt)
            : caml_trampoline_return(make_printf$0, [0, k, a, fmt]);
   }
   function make_padding(k, acc, fmt, pad, trans){
    if(typeof pad === "number")
     return function(x){
      var new_acc = [4, acc, caml_call1(trans, x)];
      return make_printf(k, new_acc, fmt);};
    if(0 === pad[0]){
     var width = pad[2], padty = pad[1];
     return function(x){
      var new_acc = [4, acc, fix_padding(padty, width, caml_call1(trans, x))];
      return make_printf(k, new_acc, fmt);};
    }
    var padty$0 = pad[1];
    return function(w, x){
     var new_acc = [4, acc, fix_padding(padty$0, w, caml_call1(trans, x))];
     return make_printf(k, new_acc, fmt);};
   }
   function make_int_padding_precision(k, acc, fmt, pad, prec, trans, iconv){
    if(typeof pad === "number"){
     if(typeof prec === "number")
      return prec
              ? function
               (p, x){
                var str = fix_int_precision(p, caml_call2(trans, iconv, x));
                return make_printf(k, [4, acc, str], fmt);
               }
              : function
               (x){
                var str = caml_call2(trans, iconv, x);
                return make_printf(k, [4, acc, str], fmt);
               };
     var p = prec[1];
     return function(x){
      var str = fix_int_precision(p, caml_call2(trans, iconv, x));
      return make_printf(k, [4, acc, str], fmt);};
    }
    if(0 === pad[0]){
     var w = pad[2], padty = pad[1];
     if(typeof prec === "number")
      return prec
              ? function
               (p, x){
                var
                 str =
                   fix_padding
                    (padty,
                     w,
                     fix_int_precision(p, caml_call2(trans, iconv, x)));
                return make_printf(k, [4, acc, str], fmt);
               }
              : function
               (x){
                var str = fix_padding(padty, w, caml_call2(trans, iconv, x));
                return make_printf(k, [4, acc, str], fmt);
               };
     var p$0 = prec[1];
     return function(x){
      var
       str =
         fix_padding
          (padty, w, fix_int_precision(p$0, caml_call2(trans, iconv, x)));
      return make_printf(k, [4, acc, str], fmt);};
    }
    var padty$0 = pad[1];
    if(typeof prec === "number")
     return prec
             ? function
              (w, p, x){
               var
                str =
                  fix_padding
                   (padty$0,
                    w,
                    fix_int_precision(p, caml_call2(trans, iconv, x)));
               return make_printf(k, [4, acc, str], fmt);
              }
             : function
              (w, x){
               var str = fix_padding(padty$0, w, caml_call2(trans, iconv, x));
               return make_printf(k, [4, acc, str], fmt);
              };
    var p$1 = prec[1];
    return function(w, x){
     var
      str =
        fix_padding
         (padty$0, w, fix_int_precision(p$1, caml_call2(trans, iconv, x)));
     return make_printf(k, [4, acc, str], fmt);};
   }
   function make_custom$0(counter, k, acc, rest, arity, f){
    if(arity){
     var arity$0 = arity[1];
     return function(x){
      return make_custom(k, acc, rest, arity$0, caml_call1(f, x));};
    }
    var a = [4, acc, f];
    return counter < 50
            ? make_printf$0(counter + 1 | 0, k, a, rest)
            : caml_trampoline_return(make_printf$0, [0, k, a, rest]);
   }
   function make_custom(k, acc, rest, arity, f){
    return caml_trampoline(make_custom$0(0, k, acc, rest, arity, f));
   }
   var w = [0, cst_camlinternalFormat_ml, 1830, 8];
   function make_iprintf$0(counter, k$2, o, fmt$2){
    a:
    {
     b:
     {
      c:
      {
       d:
       {
        e:
        {
         f:
         {
          g:
          {
           h:
           {
            i:
            {
             var k = k$2, fmt = fmt$2;
             j:
             for(;;){
              if(typeof fmt === "number") return caml_call1(k, o);
              switch(fmt[0]){
                case 2:
                 break b;
                case 3:
                 break c;
                case 9:
                 break e;
                case 10:
                 var rest$10 = fmt[1]; fmt = rest$10; break;
                case 14:
                 break g;
                case 15:
                 break h;
                case 18:
                 var a = fmt[1];
                 if(0 === a[0]){
                  var rest$15 = fmt[2], fmt$0 = a[1][1];
                  let k$1 = k, rest = rest$15;
                  var
                   k$0 = function(koc){return make_iprintf(k$1, koc, rest);};
                  k = k$0;
                  fmt = fmt$0;
                 }
                 else{
                  var rest$16 = fmt[2], fmt$1 = a[1][1];
                  let k$0 = k, rest = rest$16;
                  var
                   k$1 = function(koc){return make_iprintf(k$0, koc, rest);};
                  k = k$1;
                  fmt = fmt$1;
                 }
                 break;
                case 19:
                 throw caml_maybe_attach_backtrace([0, Assert_failure, w], 1);
                case 21:
                 break i;
                case 23:
                 break j;
                case 24:
                 var rest$19 = fmt[3], arity = fmt[1];
                 return counter < 50
                         ? fn_of_custom_arity$0
                           (counter + 1 | 0, k, o, rest$19, arity)
                         : caml_trampoline_return
                           (fn_of_custom_arity$0, [0, k, o, rest$19, arity]);
                case 13:
                case 20:
                 break f;
                case 11:
                case 12:
                case 17:
                 var rest$11 = fmt[2]; fmt = rest$11; break;
                case 0:
                case 1:
                case 16:
                case 22:
                 break a;
                default: break d;
              }
             }
             var rest$18 = fmt[2], ign = fmt[1];
             return make_ignored_param
                     (function(param){return caml_call1(k, o);}, 0, ign, rest$18);
            }
            var rest$17 = fmt[2], x$15 = make_iprintf(k, o, rest$17);
            return function(param){return x$15;};
           }
           var
            rest$14 = fmt[1],
            x$13 = make_iprintf(k, o, rest$14),
            x$14 = function(param){return x$13;};
           return function(param){return x$14;};
          }
          var rest$13 = fmt[3], fmtty = fmt[2];
          return function(param){
           var fmt = param[1], a = recast(fmt, fmtty);
           return make_iprintf
                   (k, o, CamlinternalFormatBasics[3].call(null, a, rest$13));};
         }
         var rest$12 = fmt[3], x$12 = make_iprintf(k, o, rest$12);
         return function(param){return x$12;};
        }
        var match$1 = fmt[1];
        if(typeof match$1 === "number"){
         var rest$7 = fmt[2], x$8 = make_iprintf(k, o, rest$7);
         return function(param){return x$8;};
        }
        if(0 === match$1[0]){
         var rest$8 = fmt[2], x$9 = make_iprintf(k, o, rest$8);
         return function(param){return x$9;};
        }
        var
         rest$9 = fmt[2],
         x$10 = make_iprintf(k, o, rest$9),
         x$11 = function(param){return x$10;};
        return function(param){return x$11;};
       }
       var rest$6 = fmt[4], prec = fmt[3], pad = fmt[2];
       if(typeof pad === "number"){
        if(typeof prec !== "number"){
         var x$19 = make_iprintf(k, o, rest$6);
         return function(param){return x$19;};
        }
        if(prec){
         var
          x$16 = make_iprintf(k, o, rest$6),
          x$17 = function(param){return x$16;};
         return function(param){return x$17;};
        }
        var x$18 = make_iprintf(k, o, rest$6);
        return function(param){return x$18;};
       }
       if(0 === pad[0]){
        if(typeof prec !== "number"){
         var x$23 = make_iprintf(k, o, rest$6);
         return function(param){return x$23;};
        }
        if(prec){
         var
          x$20 = make_iprintf(k, o, rest$6),
          x$21 = function(param){return x$20;};
         return function(param){return x$21;};
        }
        var x$22 = make_iprintf(k, o, rest$6);
        return function(param){return x$22;};
       }
       if(typeof prec !== "number"){
        var
         x$29 = make_iprintf(k, o, rest$6),
         x$30 = function(param){return x$29;};
        return function(param){return x$30;};
       }
       if(prec){
        var
         x$24 = make_iprintf(k, o, rest$6),
         x$25 = function(param){return x$24;},
         x$26 = function(param){return x$25;};
        return function(param){return x$26;};
       }
       var
        x$27 = make_iprintf(k, o, rest$6),
        x$28 = function(param){return x$27;};
       return function(param){return x$28;};
      }
      var match$0 = fmt[1];
      if(typeof match$0 === "number"){
       var rest$3 = fmt[2], x$4 = make_iprintf(k, o, rest$3);
       return function(param){return x$4;};
      }
      if(0 === match$0[0]){
       var rest$4 = fmt[2], x$5 = make_iprintf(k, o, rest$4);
       return function(param){return x$5;};
      }
      var
       rest$5 = fmt[2],
       x$6 = make_iprintf(k, o, rest$5),
       x$7 = function(param){return x$6;};
      return function(param){return x$7;};
     }
     var match = fmt[1];
     if(typeof match === "number"){
      var rest$0 = fmt[2], x$0 = make_iprintf(k, o, rest$0);
      return function(param){return x$0;};
     }
     if(0 === match[0]){
      var rest$1 = fmt[2], x$1 = make_iprintf(k, o, rest$1);
      return function(param){return x$1;};
     }
     var
      rest$2 = fmt[2],
      x$2 = make_iprintf(k, o, rest$2),
      x$3 = function(param){return x$2;};
     return function(param){return x$3;};
    }
    var rest = fmt[1], x = make_iprintf(k, o, rest);
    return function(param){return x;};
   }
   function make_iprintf(k, o, fmt){
    return caml_trampoline(make_iprintf$0(0, k, o, fmt));
   }
   function fn_of_custom_arity$0(counter, k, o, fmt, param){
    if(! param)
     return counter < 50
             ? make_iprintf$0(counter + 1 | 0, k, o, fmt)
             : caml_trampoline_return(make_iprintf$0, [0, k, o, fmt]);
    var arity = param[1], x = fn_of_custom_arity(k, o, fmt, arity);
    return function(param){return x;};
   }
   function fn_of_custom_arity(k, o, fmt, param){
    return caml_trampoline(fn_of_custom_arity$0(0, k, o, fmt, param));
   }
   function output_acc(o, acc$2){
    var acc = acc$2;
    for(;;){
     if(typeof acc === "number") return 0;
     switch(acc[0]){
       case 0:
        var
         fmting_lit = acc[2],
         p = acc[1],
         s = string_of_formatting_lit(fmting_lit);
        output_acc(o, p);
        return Stdlib[66].call(null, o, s);
       case 1:
        var match = acc[2], p$0 = acc[1];
        if(0 === match[0]){
         var acc$0 = match[1];
         output_acc(o, p$0);
         Stdlib[66].call(null, o, cst);
         acc = acc$0;
        }
        else{
         var acc$1 = match[1];
         output_acc(o, p$0);
         Stdlib[66].call(null, o, cst$0);
         acc = acc$1;
        }
        break;
       case 6:
        var f = acc[2], p$3 = acc[1];
        output_acc(o, p$3);
        return caml_call1(f, o);
       case 7:
        var p$4 = acc[1]; output_acc(o, p$4); return Stdlib[63].call(null, o);
       case 8:
        var msg = acc[2], p$5 = acc[1];
        output_acc(o, p$5);
        return Stdlib[1].call(null, msg);
       case 2:
       case 4:
        var s$0 = acc[2], p$1 = acc[1];
        output_acc(o, p$1);
        return Stdlib[66].call(null, o, s$0);
       default:
        var c = acc[2], p$2 = acc[1];
        output_acc(o, p$2);
        return Stdlib[65].call(null, o, c);
     }
    }
   }
   function bufput_acc(b, acc$3){
    var acc = acc$3;
    for(;;){
     if(typeof acc === "number") return 0;
     switch(acc[0]){
       case 0:
        var
         fmting_lit = acc[2],
         p = acc[1],
         s = string_of_formatting_lit(fmting_lit);
        bufput_acc(b, p);
        return Stdlib_Buffer[16].call(null, b, s);
       case 1:
        var match = acc[2], p$0 = acc[1];
        if(0 === match[0]){
         var acc$0 = match[1];
         bufput_acc(b, p$0);
         Stdlib_Buffer[16].call(null, b, cst);
         acc = acc$0;
        }
        else{
         var acc$1 = match[1];
         bufput_acc(b, p$0);
         Stdlib_Buffer[16].call(null, b, cst$0);
         acc = acc$1;
        }
        break;
       case 6:
        var f = acc[2], p$3 = acc[1];
        bufput_acc(b, p$3);
        return caml_call1(f, b);
       case 7:
        var acc$2 = acc[1]; acc = acc$2; break;
       case 8:
        var msg = acc[2], p$4 = acc[1];
        bufput_acc(b, p$4);
        return Stdlib[1].call(null, msg);
       case 2:
       case 4:
        var s$0 = acc[2], p$1 = acc[1];
        bufput_acc(b, p$1);
        return Stdlib_Buffer[16].call(null, b, s$0);
       default:
        var c = acc[2], p$2 = acc[1];
        bufput_acc(b, p$2);
        return Stdlib_Buffer[12].call(null, b, c);
     }
    }
   }
   function strput_acc(b, acc$3){
    var acc = acc$3;
    for(;;){
     if(typeof acc === "number") return 0;
     switch(acc[0]){
       case 0:
        var
         fmting_lit = acc[2],
         p = acc[1],
         s = string_of_formatting_lit(fmting_lit);
        strput_acc(b, p);
        return Stdlib_Buffer[16].call(null, b, s);
       case 1:
        var match = acc[2], p$0 = acc[1];
        if(0 === match[0]){
         var acc$0 = match[1];
         strput_acc(b, p$0);
         Stdlib_Buffer[16].call(null, b, cst);
         acc = acc$0;
        }
        else{
         var acc$1 = match[1];
         strput_acc(b, p$0);
         Stdlib_Buffer[16].call(null, b, cst$0);
         acc = acc$1;
        }
        break;
       case 6:
        var f = acc[2], p$3 = acc[1];
        strput_acc(b, p$3);
        var a = caml_call1(f, 0);
        return Stdlib_Buffer[16].call(null, b, a);
       case 7:
        var acc$2 = acc[1]; acc = acc$2; break;
       case 8:
        var msg = acc[2], p$4 = acc[1];
        strput_acc(b, p$4);
        return Stdlib[1].call(null, msg);
       case 2:
       case 4:
        var s$0 = acc[2], p$1 = acc[1];
        strput_acc(b, p$1);
        return Stdlib_Buffer[16].call(null, b, s$0);
       default:
        var c = acc[2], p$2 = acc[1];
        strput_acc(b, p$2);
        return Stdlib_Buffer[12].call(null, b, c);
     }
    }
   }
   function failwith_message(param){
    var fmt = param[1], buf = Stdlib_Buffer[1].call(null, 256);
    function k(acc){
     strput_acc(buf, acc);
     var a = Stdlib_Buffer[2].call(null, buf);
     return Stdlib[2].call(null, a);
    }
    return make_printf(k, 0, fmt);
   }
   var
    cst$1 = "",
    x = [0, 0, 4],
    y =
      [0,
       [11, "invalid box description ", [3, 0, 0]],
       "invalid box description %S"];
   function open_box_of_string(str){
    if(str === cst$1) return x;
    var len = caml_ml_string_length(str);
    function invalid_box(param){return caml_call1(failwith_message(y), str);}
    function parse_spaces(i$1){
     var i = i$1;
     for(;;){
      if(i === len) return i;
      var match = caml_string_get(str, i);
      if(9 !== match && 32 !== match) return i;
      var i$0 = i + 1 | 0;
      i = i$0;
     }
    }
    var wstart = parse_spaces(0), wend = wstart;
    for(;;){
     if(wend === len) break;
     if(25 < caml_string_get(str, wend) - 97 >>> 0) break;
     var j = wend + 1 | 0;
     wend = j;
    }
    var
     box_name = Stdlib_String[16].call(null, str, wstart, wend - wstart | 0),
     nstart = parse_spaces(wend),
     nend = nstart;
    for(;;){
     if(nend === len) break;
     var match = caml_string_get(str, nend);
     if(48 <= match){if(58 <= match) break;} else if(45 !== match) break;
     var j$0 = nend + 1 | 0;
     nend = j$0;
    }
    if(nstart === nend)
     var indent = 0;
    else
     try{
      var
       a =
         runtime.caml_int_of_string
          (Stdlib_String[16].call(null, str, nstart, nend - nstart | 0)),
       indent = a;
     }
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(exn, 0);
      var indent = invalid_box(0);
     }
    var exp_end = parse_spaces(nend);
    if(exp_end !== len) invalid_box(0);
    a:
    {
     if(box_name !== cst$1 && box_name !== "b"){
      if(box_name === "h"){var box_type = 0; break a;}
      if(box_name === "hov"){var box_type = 3; break a;}
      if(box_name === "hv"){var box_type = 2; break a;}
      if(box_name !== "v"){var box_type = invalid_box(0); break a;}
      var box_type = 1;
      break a;
     }
     var box_type = 4;
    }
    return [0, indent, box_type];
   }
   function make_padding_fmt_ebb(pad, fmt){
    if(typeof pad === "number") return [0, 0, fmt];
    if(0 === pad[0]){var w = pad[2], s = pad[1]; return [0, [0, s, w], fmt];}
    var s$0 = pad[1];
    return [0, [1, s$0], fmt];
   }
   function make_padprec_fmt_ebb(pad, prec, fmt){
    if(typeof prec === "number")
     var match = prec ? [0, 1] : [0, 0];
    else
     var p = prec[1], match = [0, [0, p]];
    var prec$0 = match[1];
    if(typeof pad === "number") return [0, 0, prec$0, fmt];
    if(0 === pad[0]){
     var w = pad[2], s = pad[1];
     return [0, [0, s, w], prec$0, fmt];
    }
    var s$0 = pad[1];
    return [0, [1, s$0], prec$0, fmt];
   }
   var
    cst$2 = ", ",
    cst_at_character_number = ": at character number ",
    cst_invalid_format = "invalid format ",
    sub_format = [0, 0, cst$1],
    formatting_lit = [0, "@;", 1, 0],
    z =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11, cst_at_character_number, [4, 0, 0, 0, [11, cst$2, [2, 0, 0]]]]]],
       "invalid format %S: at character number %d, %s"],
    A =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          cst_at_character_number,
          [4, 0, 0, 0, [11, ", '", [0, [11, "' without ", [2, 0, 0]]]]]]]],
       "invalid format %S: at character number %d, '%c' without %s"],
    B =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          cst_at_character_number,
          [4, 0, 0, 0, [11, cst$2, [2, 0, [11, " expected, read ", [1, 0]]]]]]]],
       "invalid format %S: at character number %d, %s expected, read %C"],
    C =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          cst_at_character_number,
          [4, 0, 0, 0, [11, ", duplicate flag ", [1, 0]]]]]],
       "invalid format %S: at character number %d, duplicate flag %C"],
    D = [0, 1, 0],
    E = [0, 0],
    F = [1, 0],
    G = [1, 1],
    H = [1, 1],
    I = [1, 1],
    J =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          cst_at_character_number,
          [4,
           0,
           0,
           0,
           [11, ', invalid conversion "', [12, 37, [0, [12, 34, 0]]]]]]]],
       'invalid format %S: at character number %d, invalid conversion "%%%c"'],
    K = [0, 0],
    L = [0, 0],
    M =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          cst_at_character_number,
          [4,
           0,
           0,
           0,
           [11,
            ", flag ",
            [1,
             [11,
              " is only allowed after the '",
              [12, 37, [11, "', before padding and precision", 0]]]]]]]]],
       "invalid format %S: at character number %d, flag %C is only allowed after the '%%', before padding and precision"],
    N = [0, [12, 64, 0]],
    O = [0, "@ ", 1, 0],
    P = [0, "@,", 0, 0],
    Q = [2, 60],
    R =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          ": '",
          [12,
           37,
           [11,
            "' alone is not accepted in character sets, use ",
            [12,
             37,
             [12,
              37,
              [11, " instead at position ", [4, 0, 0, 0, [12, 46, 0]]]]]]]]]],
       "invalid format %S: '%%' alone is not accepted in character sets, use %%%% instead at position %d."],
    S =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          ": integer ",
          [4, 0, 0, 0, [11, " is greater than the limit ", [4, 0, 0, 0, 0]]]]]],
       "invalid format %S: integer %d is greater than the limit %d"],
    T = [0, cst_camlinternalFormat_ml, 2837, 11],
    U =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          ': unclosed sub-format, expected "',
          [12, 37, [0, [11, '" at character number ', [4, 0, 0, 0, 0]]]]]]],
       'invalid format %S: unclosed sub-format, expected "%%%c" at character number %d'],
    V = [0, cst_camlinternalFormat_ml, 2899, 34],
    W = [0, cst_camlinternalFormat_ml, 2935, 28],
    X = [0, cst_camlinternalFormat_ml, 2957, 11],
    Y =
      [0,
       [11,
        cst_invalid_format,
        [3,
         0,
         [11,
          cst_at_character_number,
          [4,
           0,
           0,
           0,
           [11,
            cst$2,
            [2,
             0,
             [11,
              " is incompatible with '",
              [0, [11, "' in sub-format ", [3, 0, 0]]]]]]]]]],
       "invalid format %S: at character number %d, %s is incompatible with '%c' in sub-format %S"];
   function fmt_ebb_of_string(legacy_behavior, str){
    if(legacy_behavior)
     var flag = legacy_behavior[1], legacy_behavior$0 = flag;
    else
     var legacy_behavior$0 = 1;
    function invalid_format_message(str_ind, msg){
     return caml_call3(failwith_message(z), str, str_ind, msg);
    }
    function invalid_format_without(str_ind, c, s){
     return caml_call4(failwith_message(A), str, str_ind, c, s);
    }
    function expected_character(str_ind, expected, read){
     return caml_call4(failwith_message(B), str, str_ind, expected, read);
    }
    var cst_unexpected_end_of_format = "unexpected end of format";
    function parse(lit_start, end_ind){
     var str_ind = lit_start;
     for(;;){
      if(str_ind === end_ind) return add_literal(lit_start, str_ind, 0);
      var match = caml_string_get(str, str_ind);
      if(37 === match) break;
      if(64 === match){
       var fmt_rest$0 = parse_after_at(str_ind + 1 | 0, end_ind)[1];
       return add_literal(lit_start, str_ind, fmt_rest$0);
      }
      var str_ind$0 = str_ind + 1 | 0;
      str_ind = str_ind$0;
     }
     var str_ind$1 = str_ind + 1 | 0;
     if(str_ind$1 === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     var
      match$0 =
        95 === caml_string_get(str, str_ind$1)
         ? parse_flags(str_ind, str_ind$1 + 1 | 0, end_ind, 1)
         : parse_flags(str_ind, str_ind$1, end_ind, 0),
      fmt_rest = match$0[1];
     return add_literal(lit_start, str_ind, fmt_rest);
    }
    var cst_0 = "0";
    function parse_flags(pct_ind, str_ind, end_ind, ign){
     function set_flag(str_ind, flag){
      var a = flag[1], b = a ? 1 - legacy_behavior$0 : a;
      if(b){
       var c = caml_string_get(str, str_ind);
       caml_call3(failwith_message(C), str, str_ind, c);
      }
      flag[1] = 1;
     }
     var
      str_ind$0 = str_ind,
      zero = [0, 0],
      minus = [0, 0],
      plus = [0, 0],
      space = [0, 0],
      hash = [0, 0];
     a:
     for(;;){
      if(str_ind$0 === end_ind)
       invalid_format_message(end_ind, cst_unexpected_end_of_format);
      var switcher = caml_string_get(str, str_ind$0) - 32 | 0;
      if(16 < switcher >>> 0) break;
      switch(switcher){
        case 0:
         set_flag(str_ind$0, space);
         var str_ind$1 = str_ind$0 + 1 | 0;
         str_ind$0 = str_ind$1;
         break;
        case 3:
         set_flag(str_ind$0, hash);
         var str_ind$2 = str_ind$0 + 1 | 0;
         str_ind$0 = str_ind$2;
         break;
        case 11:
         set_flag(str_ind$0, plus);
         var str_ind$3 = str_ind$0 + 1 | 0;
         str_ind$0 = str_ind$3;
         break;
        case 13:
         set_flag(str_ind$0, minus);
         var str_ind$4 = str_ind$0 + 1 | 0;
         str_ind$0 = str_ind$4;
         break;
        case 16:
         set_flag(str_ind$0, zero);
         var str_ind$5 = str_ind$0 + 1 | 0;
         str_ind$0 = str_ind$5;
         break;
        default: break a;
      }
     }
     var
      space$0 = space[1],
      hash$0 = hash[1],
      plus$0 = plus[1],
      minus$0 = minus[1],
      zero$0 = zero[1];
     if(str_ind$0 === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     var
      padty =
        zero$0
         ? minus$0
           ? legacy_behavior$0
             ? 0
             : incompatible_flag(pct_ind, str_ind$0, 45, cst_0)
           : 2
         : minus$0 ? 0 : 1,
      match = caml_string_get(str, str_ind$0);
     if(48 <= match){
      if(58 > match){
       var
        match$0 = parse_positive(str_ind$0, end_ind, 0),
        width = match$0[2],
        new_ind = match$0[1];
       return parse_after_padding
               (pct_ind,
                new_ind,
                end_ind,
                minus$0,
                plus$0,
                hash$0,
                space$0,
                ign,
                [0, padty, width]);
      }
     }
     else if(42 === match)
      return parse_after_padding
              (pct_ind,
               str_ind$0 + 1 | 0,
               end_ind,
               minus$0,
               plus$0,
               hash$0,
               space$0,
               ign,
               [1, padty]);
     switch(padty){
       case 0:
        if(1 - legacy_behavior$0)
         invalid_format_without(str_ind$0 - 1 | 0, 45, "padding");
        return parse_after_padding
                (pct_ind,
                 str_ind$0,
                 end_ind,
                 minus$0,
                 plus$0,
                 hash$0,
                 space$0,
                 ign,
                 0);
       case 1:
        return parse_after_padding
                (pct_ind,
                 str_ind$0,
                 end_ind,
                 minus$0,
                 plus$0,
                 hash$0,
                 space$0,
                 ign,
                 0);
       default:
        return parse_after_padding
                (pct_ind,
                 str_ind$0,
                 end_ind,
                 minus$0,
                 plus$0,
                 hash$0,
                 space$0,
                 ign,
                 D);
     }
    }
    var cst_precision = "precision";
    function parse_after_padding
    (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad){
     if(str_ind === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     var symb = caml_string_get(str, str_ind);
     if(46 !== symb)
      return parse_conversion
              (pct_ind,
               str_ind + 1 | 0,
               end_ind,
               plus,
               hash,
               space,
               ign,
               pad,
               0,
               pad,
               symb);
     var str_ind$0 = str_ind + 1 | 0;
     if(str_ind$0 === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     function parse_literal(minus, str_ind){
      var
       match = parse_positive(str_ind, end_ind, 0),
       prec = match[2],
       new_ind = match[1];
      return parse_after_precision
              (pct_ind,
               new_ind,
               end_ind,
               minus,
               plus,
               hash,
               space,
               ign,
               pad,
               [0, prec]);
     }
     var symb$0 = caml_string_get(str, str_ind$0);
     if(48 <= symb$0){
      if(58 > symb$0) return parse_literal(minus, str_ind$0);
     }
     else if(42 <= symb$0)
      switch(symb$0 - 42 | 0){
        case 0:
         return parse_after_precision
                 (pct_ind,
                  str_ind$0 + 1 | 0,
                  end_ind,
                  minus,
                  plus,
                  hash,
                  space,
                  ign,
                  pad,
                  1);
        case 1:
        case 3:
         if(legacy_behavior$0){
          var
           a = str_ind$0 + 1 | 0,
           minus$0 = minus || (45 === symb$0 ? 1 : 0);
          return parse_literal(minus$0, a);
         }
         break;
      }
     return legacy_behavior$0
             ? parse_after_precision
               (pct_ind,
                str_ind$0,
                end_ind,
                minus,
                plus,
                hash,
                space,
                ign,
                pad,
                E)
             : invalid_format_without(str_ind$0 - 1 | 0, 46, cst_precision);
    }
    function parse_after_precision
    (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad, prec){
     if(str_ind === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     function parse_conv(padprec){
      return parse_conversion
              (pct_ind,
               str_ind + 1 | 0,
               end_ind,
               plus,
               hash,
               space,
               ign,
               pad,
               prec,
               padprec,
               caml_string_get(str, str_ind));
     }
     if(typeof pad !== "number") return parse_conv(pad);
     if(typeof prec === "number" && ! prec) return parse_conv(0);
     if(minus){
      if(typeof prec === "number") return parse_conv(F);
      var n = prec[1];
      return parse_conv([0, 0, n]);
     }
     if(typeof prec === "number") return parse_conv(G);
     var n$0 = prec[1];
     return parse_conv([0, 1, n$0]);
    }
    var cst$1 = "' '", cst$0 = "'#'", cst = "'+'";
    function parse_conversion
    (pct_ind,
     str_ind,
     end_ind,
     plus,
     hash,
     space,
     ign,
     pad,
     prec,
     padprec,
     symb){
     var plus_used = [0, 0];
     function get_plus(param){plus_used[1] = 1; return plus;}
     var hash_used = [0, 0];
     function get_hash(param){hash_used[1] = 1; return hash;}
     var space_used = [0, 0];
     function get_space(param){space_used[1] = 1; return space;}
     var ign_used = [0, 0];
     function get_ign(param){ign_used[1] = 1; return ign;}
     var pad_used = [0, 0];
     function get_pad(param){pad_used[1] = 1; return pad;}
     var prec_used = [0, 0];
     function get_prec(param){prec_used[1] = 1; return prec;}
     function get_padprec(param){pad_used[1] = 1; return padprec;}
     function get_int_pad(param){
      var pad = get_pad(0), match = get_prec(0);
      if(typeof match === "number" && ! match) return pad;
      if(typeof pad === "number") return 0;
      if(0 !== pad[0])
       return 2 <= pad[1]
               ? legacy_behavior$0
                 ? H
                 : incompatible_flag(pct_ind, str_ind, 48, cst_precision)
               : pad;
      if(2 > pad[1]) return pad;
      var n = pad[2];
      return legacy_behavior$0
              ? [0, 1, n]
              : incompatible_flag(pct_ind, str_ind, 48, cst_precision);
     }
     function check_no_0(symb, pad){
      if(typeof pad === "number") return pad;
      if(0 !== pad[0])
       return 2 <= pad[1]
               ? legacy_behavior$0
                 ? I
                 : incompatible_flag(pct_ind, str_ind, symb, cst_0)
               : pad;
      if(2 > pad[1]) return pad;
      var width = pad[2];
      return legacy_behavior$0
              ? [0, 1, width]
              : incompatible_flag(pct_ind, str_ind, symb, cst_0);
     }
     var cst$2 = "'*'";
     function opt_of_pad(c, pad){
      if(typeof pad === "number") return 0;
      if(0 === pad[0])
       switch(pad[1]){
         case 0:
          var width = pad[2];
          return legacy_behavior$0
                  ? [0, width]
                  : incompatible_flag(pct_ind, str_ind, c, "'-'");
         case 1:
          var width$0 = pad[2]; return [0, width$0];
         default:
          var width$1 = pad[2];
          return legacy_behavior$0
                  ? [0, width$1]
                  : incompatible_flag(pct_ind, str_ind, c, "'0'");
       }
      return incompatible_flag(pct_ind, str_ind, c, cst$2);
     }
     function get_pad_opt(c){return opt_of_pad(c, get_pad(0));}
     function get_padprec_opt(c){return opt_of_pad(c, get_padprec(0));}
     a:
     {
      if(124 > symb)
       switch(symb){
         case 33:
          var
           fmt_rest$5 = parse(str_ind, end_ind)[1],
           fmt_result = [0, [10, fmt_rest$5]];
          break a;
         case 40:
          var
           sub_end = search_subformat_end(str_ind, end_ind, 41),
           fmt_rest$7 = parse(sub_end + 2 | 0, end_ind)[1],
           sub_fmt = parse(str_ind, sub_end)[1],
           sub_fmtty = fmtty_of_fmt(sub_fmt);
          if(get_ign(0)){
           var
            ignored$2 = [9, get_pad_opt(95), sub_fmtty],
            fmt_result = [0, [23, ignored$2, fmt_rest$7]];
           break a;
          }
          var fmt_result = [0, [14, get_pad_opt(40), sub_fmtty, fmt_rest$7]];
          break a;
         case 44:
          var fmt_result = parse(str_ind, end_ind); break a;
         case 67:
          var fmt_rest$10 = parse(str_ind, end_ind)[1];
          if(get_ign(0)){var fmt_result = [0, [23, 1, fmt_rest$10]]; break a;}
          var fmt_result = [0, [1, fmt_rest$10]];
          break a;
         case 78:
          var fmt_rest$14 = parse(str_ind, end_ind)[1], counter$0 = 2;
          if(get_ign(0)){
           var fmt_result = [0, [23, [11, counter$0], fmt_rest$14]];
           break a;
          }
          var fmt_result = [0, [21, counter$0, fmt_rest$14]];
          break a;
         case 83:
          var
           pad$6 = check_no_0(symb, get_padprec(0)),
           fmt_rest$15 = parse(str_ind, end_ind)[1];
          if(get_ign(0)){
           var
            ignored$6 = [1, get_padprec_opt(95)],
            fmt_result = [0, [23, ignored$6, fmt_rest$15]];
           break a;
          }
          var
           match$5 = make_padding_fmt_ebb(pad$6, fmt_rest$15),
           fmt_rest$16 = match$5[2],
           pad$7 = match$5[1],
           fmt_result = [0, [3, pad$7, fmt_rest$16]];
          break a;
         case 91:
          var
           match$7 = parse_char_set(str_ind, end_ind),
           char_set = match$7[2],
           next_ind = match$7[1],
           fmt_rest$19 = parse(next_ind, end_ind)[1];
          if(get_ign(0)){
           var
            ignored$8 = [10, get_pad_opt(95), char_set],
            fmt_result = [0, [23, ignored$8, fmt_rest$19]];
           break a;
          }
          var fmt_result = [0, [20, get_pad_opt(91), char_set, fmt_rest$19]];
          break a;
         case 97:
          var
           fmt_rest$20 = parse(str_ind, end_ind)[1],
           fmt_result = [0, [15, fmt_rest$20]];
          break a;
         case 99:
          var
           char_format =
             function(fmt_rest){
              return get_ign(0) ? [0, [23, 0, fmt_rest]] : [0, [0, fmt_rest]];
             },
           fmt_rest$21 = parse(str_ind, end_ind)[1],
           match$8 = get_pad_opt(99);
          if(! match$8){var fmt_result = char_format(fmt_rest$21); break a;}
          var n = match$8[1];
          if(0 === n){
           if(get_ign(0)){
            var fmt_result = [0, [23, 3, fmt_rest$21]];
            break a;
           }
           var fmt_result = [0, [22, fmt_rest$21]];
           break a;
          }
          if(legacy_behavior$0){
           var fmt_result = char_format(fmt_rest$21);
           break a;
          }
          var
           fmt_result =
             invalid_format_message
              (str_ind, "non-zero widths are unsupported for %c conversions");
          break a;
         case 114:
          var fmt_rest$22 = parse(str_ind, end_ind)[1];
          if(get_ign(0)){var fmt_result = [0, [23, 2, fmt_rest$22]]; break a;}
          var fmt_result = [0, [19, fmt_rest$22]];
          break a;
         case 115:
          var
           pad$9 = check_no_0(symb, get_padprec(0)),
           fmt_rest$23 = parse(str_ind, end_ind)[1];
          if(get_ign(0)){
           var
            ignored$9 = [0, get_padprec_opt(95)],
            fmt_result = [0, [23, ignored$9, fmt_rest$23]];
           break a;
          }
          var
           match$9 = make_padding_fmt_ebb(pad$9, fmt_rest$23),
           fmt_rest$24 = match$9[2],
           pad$10 = match$9[1],
           fmt_result = [0, [2, pad$10, fmt_rest$24]];
          break a;
         case 116:
          var
           fmt_rest$25 = parse(str_ind, end_ind)[1],
           fmt_result = [0, [16, fmt_rest$25]];
          break a;
         case 123:
          var
           sub_end$0 = search_subformat_end(str_ind, end_ind, 125),
           sub_fmt$0 = parse(str_ind, sub_end$0)[1],
           fmt_rest$26 = parse(sub_end$0 + 2 | 0, end_ind)[1],
           sub_fmtty$0 = fmtty_of_fmt(sub_fmt$0);
          if(get_ign(0)){
           var
            ignored$10 = [8, get_pad_opt(95), sub_fmtty$0],
            fmt_result = [0, [23, ignored$10, fmt_rest$26]];
           break a;
          }
          var
           fmt_result = [0, [13, get_pad_opt(123), sub_fmtty$0, fmt_rest$26]];
          break a;
         case 66:
         case 98:
          var
           pad$3 = check_no_0(symb, get_padprec(0)),
           fmt_rest$8 = parse(str_ind, end_ind)[1];
          if(get_ign(0)){
           var
            ignored$3 = [7, get_padprec_opt(95)],
            fmt_result = [0, [23, ignored$3, fmt_rest$8]];
           break a;
          }
          var
           match$3 = make_padding_fmt_ebb(pad$3, fmt_rest$8),
           fmt_rest$9 = match$3[2],
           pad$4 = match$3[1],
           fmt_result = [0, [9, pad$4, fmt_rest$9]];
          break a;
         case 37:
         case 64:
          var
           fmt_rest$6 = parse(str_ind, end_ind)[1],
           fmt_result = [0, [12, symb, fmt_rest$6]];
          break a;
         case 76:
         case 108:
         case 110:
          if(str_ind !== end_ind){
           var symb$0 = caml_string_get(str, str_ind), i = symb$0 - 88 | 0;
           b:
           {
            if(32 >= i >>> 0)
             switch(i){
               case 0:
               case 12:
               case 17:
               case 23:
               case 29:
               case 32:
                var h = 1; break b;
             }
            var h = 0;
           }
           if(h) break;
          }
          var fmt_rest$13 = parse(str_ind, end_ind)[1];
          b:
          {
           if(108 <= symb){
            if(111 > symb)
             switch(symb - 108 | 0){
               case 0:
                var counter = 0; break b;
               case 2:
                var counter = 1; break b;
             }
           }
           else if(76 === symb){var counter = 2; break b;}
           throw caml_maybe_attach_backtrace([0, Assert_failure, V], 1);
          }
          if(get_ign(0)){
           var
            ignored$5 = [11, counter],
            fmt_result = [0, [23, ignored$5, fmt_rest$13]];
           break a;
          }
          var fmt_result = [0, [21, counter, fmt_rest$13]];
          break a;
         case 32:
         case 35:
         case 43:
         case 45:
         case 95:
          var
           fmt_result = caml_call3(failwith_message(M), str, pct_ind, symb);
          break a;
         case 88:
         case 100:
         case 105:
         case 111:
         case 117:
         case 120:
          var
           A = get_space(0),
           B = get_hash(0),
           iconv$2 =
             compute_int_conv(pct_ind, str_ind, get_plus(0), B, A, symb),
           fmt_rest$17 = parse(str_ind, end_ind)[1];
          if(get_ign(0)){
           var
            ignored$7 = [2, iconv$2, get_pad_opt(95)],
            fmt_result = [0, [23, ignored$7, fmt_rest$17]];
           break a;
          }
          var
           C = get_prec(0),
           match$6 = make_padprec_fmt_ebb(get_int_pad(0), C, fmt_rest$17),
           fmt_rest$18 = match$6[3],
           prec$4 = match$6[2],
           pad$8 = match$6[1],
           fmt_result = [0, [4, iconv$2, pad$8, prec$4, fmt_rest$18]];
          break a;
         case 69:
         case 70:
         case 71:
         case 72:
         case 101:
         case 102:
         case 103:
         case 104:
          var
           space$1 = get_space(0),
           hash$1 = get_hash(0),
           plus$2 = get_plus(0),
           flag =
             plus$2
              ? space$1
                ? legacy_behavior$0
                  ? 1
                  : incompatible_flag(pct_ind, str_ind, 32, cst)
                : 1
              : space$1 ? 2 : 0;
          b:
          {
           if(73 <= symb){
            var switcher = symb - 101 | 0;
            if(3 >= switcher >>> 0)
             switch(switcher){
               case 0:
                var kind = 1; break b;
               case 1:
                var kind = 0; break b;
               case 2:
                var kind = 3; break b;
               default: var kind = 6; break b;
             }
           }
           else if(69 <= symb)
            switch(symb - 69 | 0){
              case 0:
               var kind = 2; break b;
              case 2:
               var kind = 4; break b;
              case 3:
               var kind = 7; break b;
            }
           if(hash$1){
            if(70 === symb){var kind = 8; break b;}
           }
           else if(70 === symb){var kind = 5; break b;}
           throw caml_maybe_attach_backtrace([0, Assert_failure, X], 1);
          }
          var
           fconv = [0, flag, kind],
           fmt_rest$11 = parse(str_ind, end_ind)[1];
          if(! get_ign(0)){
           var
            z = get_prec(0),
            match$4 = make_padprec_fmt_ebb(get_pad(0), z, fmt_rest$11),
            fmt_rest$12 = match$4[3],
            prec$3 = match$4[2],
            pad$5 = match$4[1],
            fmt_result = [0, [8, fconv, pad$5, prec$3, fmt_rest$12]];
           break a;
          }
          var match = get_prec(0);
          if(typeof match === "number")
           var g = match ? incompatible_flag(pct_ind, str_ind, 95, cst$2) : 0;
          else
           var ndec = match[1], g = [0, ndec];
          var
           ignored$4 = [6, get_pad_opt(95), g],
           fmt_result = [0, [23, ignored$4, fmt_rest$11]];
          break a;
       }
      if(108 <= symb){
       if(111 > symb)
        switch(symb - 108 | 0){
          case 0:
           var
            m = caml_string_get(str, str_ind),
            o = get_space(0),
            p = get_hash(0),
            iconv =
              compute_int_conv(pct_ind, str_ind + 1 | 0, get_plus(0), p, o, m),
            fmt_rest = parse(str_ind + 1 | 0, end_ind)[1];
           if(get_ign(0)){
            var
             ignored = [3, iconv, get_pad_opt(95)],
             fmt_result = [0, [23, ignored, fmt_rest]];
            break a;
           }
           var
            q = get_prec(0),
            match$0 = make_padprec_fmt_ebb(get_int_pad(0), q, fmt_rest),
            fmt_rest$0 = match$0[3],
            prec$0 = match$0[2],
            pad$0 = match$0[1],
            fmt_result = [0, [5, iconv, pad$0, prec$0, fmt_rest$0]];
           break a;
          case 2:
           var
            r = caml_string_get(str, str_ind),
            s = get_space(0),
            t = get_hash(0),
            iconv$0 =
              compute_int_conv(pct_ind, str_ind + 1 | 0, get_plus(0), t, s, r),
            fmt_rest$1 = parse(str_ind + 1 | 0, end_ind)[1];
           if(get_ign(0)){
            var
             ignored$0 = [4, iconv$0, get_pad_opt(95)],
             fmt_result = [0, [23, ignored$0, fmt_rest$1]];
            break a;
           }
           var
            u = get_prec(0),
            match$1 = make_padprec_fmt_ebb(get_int_pad(0), u, fmt_rest$1),
            fmt_rest$2 = match$1[3],
            prec$1 = match$1[2],
            pad$1 = match$1[1],
            fmt_result = [0, [6, iconv$0, pad$1, prec$1, fmt_rest$2]];
           break a;
        }
      }
      else if(76 === symb){
       var
        v = caml_string_get(str, str_ind),
        w = get_space(0),
        x = get_hash(0),
        iconv$1 =
          compute_int_conv(pct_ind, str_ind + 1 | 0, get_plus(0), x, w, v),
        fmt_rest$3 = parse(str_ind + 1 | 0, end_ind)[1];
       if(get_ign(0)){
        var
         ignored$1 = [5, iconv$1, get_pad_opt(95)],
         fmt_result = [0, [23, ignored$1, fmt_rest$3]];
        break a;
       }
       var
        y = get_prec(0),
        match$2 = make_padprec_fmt_ebb(get_int_pad(0), y, fmt_rest$3),
        fmt_rest$4 = match$2[3],
        prec$2 = match$2[2],
        pad$2 = match$2[1],
        fmt_result = [0, [7, iconv$1, pad$2, prec$2, fmt_rest$4]];
       break a;
      }
      var
       fmt_result =
         caml_call3(failwith_message(J), str, str_ind - 1 | 0, symb);
     }
     if(1 - legacy_behavior$0){
      var a = 1 - plus_used[1], plus$0 = a ? plus : a;
      if(plus$0) incompatible_flag(pct_ind, str_ind, symb, cst);
      var b = 1 - hash_used[1], hash$0 = b ? hash : b;
      if(hash$0) incompatible_flag(pct_ind, str_ind, symb, cst$0);
      var c = 1 - space_used[1], space$0 = c ? space : c;
      if(space$0) incompatible_flag(pct_ind, str_ind, symb, cst$1);
      var d = 1 - pad_used[1], j = d ? caml_notequal([0, pad], K) : d;
      if(j) incompatible_flag(pct_ind, str_ind, symb, "`padding'");
      var e = 1 - prec_used[1], k = e ? caml_notequal([0, prec], L) : e;
      if(k){
       var l = ign ? 95 : symb;
       incompatible_flag(pct_ind, str_ind, l, "`precision'");
      }
      var plus$1 = ign ? plus : ign;
      if(plus$1) incompatible_flag(pct_ind, str_ind, 95, cst);
     }
     var f = 1 - ign_used[1], ign$0 = f ? ign : f;
     a:
     if(ign$0){
      b:
      {
       if(38 <= symb){
        if(44 !== symb && 64 !== symb) break b;
       }
       else if(33 !== symb && 37 > symb) break b;
       if(legacy_behavior$0) break a;
      }
      incompatible_flag(pct_ind, str_ind, symb, "'_'");
     }
     return fmt_result;
    }
    function parse_after_at(str_ind, end_ind){
     if(str_ind === end_ind) return N;
     var c = caml_string_get(str, str_ind);
     if(65 <= c){
      if(94 <= c){
       var switcher = c - 123 | 0;
       if(2 >= switcher >>> 0)
        switch(switcher){
          case 0:
           return parse_tag(1, str_ind + 1 | 0, end_ind);
          case 2:
           var fmt_rest$0 = parse(str_ind + 1 | 0, end_ind)[1];
           return [0, [17, 1, fmt_rest$0]];
        }
      }
      else if(91 <= c)
       switch(c - 91 | 0){
         case 0:
          return parse_tag(0, str_ind + 1 | 0, end_ind);
         case 2:
          var fmt_rest$1 = parse(str_ind + 1 | 0, end_ind)[1];
          return [0, [17, 0, fmt_rest$1]];
       }
     }
     else{
      if(10 === c){
       var fmt_rest$2 = parse(str_ind + 1 | 0, end_ind)[1];
       return [0, [17, 3, fmt_rest$2]];
      }
      if(32 <= c)
       switch(c - 32 | 0){
         case 0:
          var fmt_rest$3 = parse(str_ind + 1 | 0, end_ind)[1];
          return [0, [17, O, fmt_rest$3]];
         case 5:
          if
           ((str_ind + 1 | 0) < end_ind
            && 37 === caml_string_get(str, str_ind + 1 | 0)){
           var fmt_rest$4 = parse(str_ind + 2 | 0, end_ind)[1];
           return [0, [17, 6, fmt_rest$4]];
          }
          var fmt_rest$5 = parse(str_ind, end_ind)[1];
          return [0, [12, 64, fmt_rest$5]];
         case 12:
          var fmt_rest$6 = parse(str_ind + 1 | 0, end_ind)[1];
          return [0, [17, P, fmt_rest$6]];
         case 14:
          var fmt_rest$7 = parse(str_ind + 1 | 0, end_ind)[1];
          return [0, [17, 4, fmt_rest$7]];
         case 27:
          var str_ind$0 = str_ind + 1 | 0;
          a:
          try{
           var
            b = str_ind$0 === end_ind,
            d = b || 60 !== caml_string_get(str, str_ind$0);
           if(d) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
           var
            str_ind_1 = parse_spaces(str_ind$0 + 1 | 0, end_ind),
            match = caml_string_get(str, str_ind_1);
           b:
           {
            if(48 <= match){
             if(58 <= match) break b;
            }
            else if(45 !== match) break b;
            var
             match$0 = parse_integer(str_ind_1, end_ind),
             width = match$0[2],
             str_ind_2 = match$0[1],
             str_ind_3 = parse_spaces(str_ind_2, end_ind),
             switcher$0 = caml_string_get(str, str_ind_3) - 45 | 0;
            if(12 < switcher$0 >>> 0){
             if(17 === switcher$0){
              var
               s =
                 Stdlib_String[16].call
                  (null,
                   str,
                   str_ind$0 - 2 | 0,
                   (str_ind_3 - str_ind$0 | 0) + 3 | 0),
               e = str_ind_3 + 1 | 0,
               formatting_lit$0 = [0, s, width, 0],
               next_ind = e;
              break a;
             }
            }
            else if(1 < switcher$0 - 1 >>> 0){
             var
              match$1 = parse_integer(str_ind_3, end_ind),
              offset = match$1[2],
              str_ind_4 = match$1[1],
              str_ind_5 = parse_spaces(str_ind_4, end_ind);
             if(62 !== caml_string_get(str, str_ind_5))
              throw caml_maybe_attach_backtrace(Stdlib[8], 1);
             var
              s$0 =
                Stdlib_String[16].call
                 (null,
                  str,
                  str_ind$0 - 2 | 0,
                  (str_ind_5 - str_ind$0 | 0) + 3 | 0),
              f = str_ind_5 + 1 | 0,
              formatting_lit$0 = [0, s$0, width, offset],
              next_ind = f;
             break a;
            }
            throw caml_maybe_attach_backtrace(Stdlib[8], 1);
           }
           throw caml_maybe_attach_backtrace(Stdlib[8], 1);
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn === Stdlib[8])
            var formatting_lit$0 = formatting_lit, next_ind = str_ind$0;
           else{
            if(exn[1] !== Stdlib[7])
             throw caml_maybe_attach_backtrace(exn, 0);
            var formatting_lit$0 = formatting_lit, next_ind = str_ind$0;
           }
          }
          var fmt_rest$10 = parse(next_ind, end_ind)[1];
          return [0, [17, formatting_lit$0, fmt_rest$10]];
         case 28:
          var str_ind$1 = str_ind + 1 | 0;
          try{
           var
            str_ind_1$0 = parse_spaces(str_ind$1, end_ind),
            match$4 = caml_string_get(str, str_ind_1$0);
           a:
           {
            b:
            {
             if(48 <= match$4){
              if(58 <= match$4) break b;
             }
             else if(45 !== match$4) break b;
             var
              match$5 = parse_integer(str_ind_1$0, end_ind),
              size = match$5[2],
              str_ind_2$0 = match$5[1],
              str_ind_3$0 = parse_spaces(str_ind_2$0, end_ind);
             if(62 !== caml_string_get(str, str_ind_3$0))
              throw caml_maybe_attach_backtrace(Stdlib[8], 1);
             var
              s$1 =
                Stdlib_String[16].call
                 (null,
                  str,
                  str_ind$1 - 2 | 0,
                  (str_ind_3$0 - str_ind$1 | 0) + 3 | 0),
              a = [0, [0, str_ind_3$0 + 1 | 0, [1, s$1, size]]];
             break a;
            }
            var a = 0;
           }
           var match$2 = a;
          }
          catch(exn){
           var exn$0 = caml_wrap_exception(exn);
           if(exn$0 !== Stdlib[8] && exn$0[1] !== Stdlib[7])
            throw caml_maybe_attach_backtrace(exn$0, 0);
           var match$2 = 0;
          }
          if(match$2){
           var
            match$3 = match$2[1],
            formatting_lit$1 = match$3[2],
            next_ind$0 = match$3[1],
            fmt_rest$11 = parse(next_ind$0, end_ind)[1];
           return [0, [17, formatting_lit$1, fmt_rest$11]];
          }
          var fmt_rest$12 = parse(str_ind$1, end_ind)[1];
          return [0, [17, Q, fmt_rest$12]];
         case 31:
          var fmt_rest$8 = parse(str_ind + 1 | 0, end_ind)[1];
          return [0, [17, 2, fmt_rest$8]];
         case 32:
          var fmt_rest$9 = parse(str_ind + 1 | 0, end_ind)[1];
          return [0, [17, 5, fmt_rest$9]];
       }
     }
     var fmt_rest = parse(str_ind + 1 | 0, end_ind)[1];
     return [0, [17, [2, c], fmt_rest]];
    }
    function parse_tag(is_open_tag, str_ind, end_ind){
     try{
      if(str_ind === end_ind) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      if(60 !== caml_string_get(str, str_ind))
       throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      var ind = Stdlib_String[32].call(null, str, str_ind + 1 | 0, 62);
      if(end_ind <= ind) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      var
       sub_str =
         Stdlib_String[16].call
          (null, str, str_ind, (ind - str_ind | 0) + 1 | 0),
       fmt_rest$0 = parse(ind + 1 | 0, end_ind)[1],
       sub_fmt = parse(str_ind, ind + 1 | 0)[1],
       sub_format$0 = [0, sub_fmt, sub_str],
       formatting$0 = is_open_tag ? [0, sub_format$0] : [1, sub_format$0];
      return [0, [18, formatting$0, fmt_rest$0]];
     }
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
      var
       fmt_rest = parse(str_ind, end_ind)[1],
       formatting = is_open_tag ? [0, sub_format] : [1, sub_format];
      return [0, [18, formatting, fmt_rest]];
     }
    }
    function parse_char_set(str_ind, end_ind){
     if(str_ind === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     var char_set = create_char_set(0);
     function add_range(c$0, c){
      if(c >= c$0){
       var i = c$0;
       for(;;){
        add_in_char_set(char_set, Stdlib[29].call(null, i));
        var a = i + 1 | 0;
        if(c === i) break;
        i = a;
       }
      }
     }
     function fail_single_percent(str_ind){
      return caml_call2(failwith_message(R), str, str_ind);
     }
     function parse_char_set_content(counter, str_ind$1, end_ind){
      var str_ind = str_ind$1;
      for(;;){
       if(str_ind === end_ind)
        invalid_format_message(end_ind, cst_unexpected_end_of_format);
       var c = caml_string_get(str, str_ind);
       if(45 !== c){
        if(93 === c) return str_ind + 1 | 0;
        var a = str_ind + 1 | 0;
        return counter < 50
                ? parse_char_set_after_char$0(counter + 1 | 0, a, end_ind, c)
                : caml_trampoline_return
                  (parse_char_set_after_char$0, [0, a, end_ind, c]);
       }
       add_in_char_set(char_set, 45);
       var str_ind$0 = str_ind + 1 | 0;
       str_ind = str_ind$0;
      }
     }
     function parse_char_set_after_char$0(counter, str_ind$2, end_ind, c$3){
      var str_ind = str_ind$2, c = c$3;
      for(;;){
       if(str_ind === end_ind)
        invalid_format_message(end_ind, cst_unexpected_end_of_format);
       var c$0 = caml_string_get(str, str_ind);
       a:
       {
        if(46 <= c$0){
         if(64 !== c$0){
          if(93 !== c$0) break a;
          add_in_char_set(char_set, c);
          return str_ind + 1 | 0;
         }
        }
        else if(37 !== c$0){if(45 <= c$0) break; break a;}
        if(37 === c){
         add_in_char_set(char_set, c$0);
         var a = str_ind + 1 | 0;
         return counter < 50
                 ? parse_char_set_content(counter + 1 | 0, a, end_ind)
                 : caml_trampoline_return
                   (parse_char_set_content, [0, a, end_ind]);
        }
       }
       if(37 === c) fail_single_percent(str_ind);
       add_in_char_set(char_set, c);
       var str_ind$0 = str_ind + 1 | 0;
       str_ind = str_ind$0;
       c = c$0;
      }
      var str_ind$1 = str_ind + 1 | 0;
      if(str_ind$1 === end_ind)
       invalid_format_message(end_ind, cst_unexpected_end_of_format);
      var c$1 = caml_string_get(str, str_ind$1);
      if(37 === c$1){
       if((str_ind$1 + 1 | 0) === end_ind)
        invalid_format_message(end_ind, cst_unexpected_end_of_format);
       var c$2 = caml_string_get(str, str_ind$1 + 1 | 0);
       if(37 !== c$2 && 64 !== c$2) return fail_single_percent(str_ind$1);
       add_range(c, c$2);
       var b = str_ind$1 + 2 | 0;
       return counter < 50
               ? parse_char_set_content(counter + 1 | 0, b, end_ind)
               : caml_trampoline_return
                 (parse_char_set_content, [0, b, end_ind]);
      }
      if(93 === c$1){
       add_in_char_set(char_set, c);
       add_in_char_set(char_set, 45);
       return str_ind$1 + 1 | 0;
      }
      add_range(c, c$1);
      var d = str_ind$1 + 1 | 0;
      return counter < 50
              ? parse_char_set_content(counter + 1 | 0, d, end_ind)
              : caml_trampoline_return
                (parse_char_set_content, [0, d, end_ind]);
     }
     function parse_char_set_after_char(str_ind, end_ind, c){
      return caml_trampoline
              (parse_char_set_after_char$0(0, str_ind, end_ind, c));
     }
     if(str_ind === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     if(94 === caml_string_get(str, str_ind))
      var str_ind$0 = str_ind + 1 | 0, reverse = 1, str_ind$1 = str_ind$0;
     else
      var reverse = 0, str_ind$1 = str_ind;
     if(str_ind$1 === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     var
      c = caml_string_get(str, str_ind$1),
      next_ind = parse_char_set_after_char(str_ind$1 + 1 | 0, end_ind, c),
      char_set$0 = freeze_char_set(char_set),
      a = reverse ? rev_char_set(char_set$0) : char_set$0;
     return [0, next_ind, a];
    }
    function parse_spaces(str_ind$1, end_ind){
     var str_ind = str_ind$1;
     for(;;){
      if(str_ind === end_ind)
       invalid_format_message(end_ind, cst_unexpected_end_of_format);
      if(32 !== caml_string_get(str, str_ind)) return str_ind;
      var str_ind$0 = str_ind + 1 | 0;
      str_ind = str_ind$0;
     }
    }
    function parse_positive(str_ind$1, end_ind, acc$0){
     var str_ind = str_ind$1, acc = acc$0;
     for(;;){
      if(str_ind === end_ind)
       invalid_format_message(end_ind, cst_unexpected_end_of_format);
      var c = caml_string_get(str, str_ind);
      if(9 < c - 48 >>> 0) return [0, str_ind, acc];
      var new_acc = (acc * 10 | 0) + (c - 48 | 0) | 0;
      if(Stdlib_Sys[12] < new_acc){
       var a = Stdlib_Sys[12];
       return caml_call3(failwith_message(S), str, new_acc, a);
      }
      var str_ind$0 = str_ind + 1 | 0;
      str_ind = str_ind$0;
      acc = new_acc;
     }
    }
    function parse_integer(str_ind, end_ind){
     if(str_ind === end_ind)
      invalid_format_message(end_ind, cst_unexpected_end_of_format);
     var match = caml_string_get(str, str_ind);
     if(48 <= match){
      if(58 > match) return parse_positive(str_ind, end_ind, 0);
     }
     else if(45 === match){
      if((str_ind + 1 | 0) === end_ind)
       invalid_format_message(end_ind, cst_unexpected_end_of_format);
      var c = caml_string_get(str, str_ind + 1 | 0);
      if(9 < c - 48 >>> 0)
       return expected_character(str_ind + 1 | 0, "digit", c);
      var
       match$0 = parse_positive(str_ind + 1 | 0, end_ind, 0),
       n = match$0[2],
       next_ind = match$0[1];
      return [0, next_ind, - n | 0];
     }
     throw caml_maybe_attach_backtrace([0, Assert_failure, T], 1);
    }
    function add_literal(lit_start, str_ind, fmt){
     var size = str_ind - lit_start | 0;
     return 0 === size
             ? [0, fmt]
             : 1
               === size
               ? [0, [12, caml_string_get(str, lit_start), fmt]]
               : [0,
                 [11, Stdlib_String[16].call(null, str, lit_start, size), fmt]];
    }
    function search_subformat_end(str_ind$7, end_ind, c){
     var str_ind = str_ind$7;
     for(;;){
      if(str_ind === end_ind)
       caml_call3(failwith_message(U), str, c, end_ind);
      if(37 === caml_string_get(str, str_ind)){
       if((str_ind + 1 | 0) === end_ind)
        invalid_format_message(end_ind, cst_unexpected_end_of_format);
       if(caml_string_get(str, str_ind + 1 | 0) === c) return str_ind;
       var match = caml_string_get(str, str_ind + 1 | 0);
       if(95 <= match){
        if(123 <= match){
         if(126 > match)
          switch(match - 123 | 0){
            case 0:
             var
              sub_end = search_subformat_end(str_ind + 2 | 0, end_ind, 125),
              str_ind$1 = sub_end + 2 | 0;
             str_ind = str_ind$1;
             continue;
            case 2:
             return expected_character(str_ind + 1 | 0, "character ')'", 125);
          }
        }
        else if(96 > match){
         if((str_ind + 2 | 0) === end_ind)
          invalid_format_message(end_ind, cst_unexpected_end_of_format);
         var match$0 = caml_string_get(str, str_ind + 2 | 0);
         if(40 === match$0){
          var
           sub_end$0 = search_subformat_end(str_ind + 3 | 0, end_ind, 41),
           str_ind$2 = sub_end$0 + 2 | 0;
          str_ind = str_ind$2;
          continue;
         }
         if(123 === match$0){
          var
           sub_end$1 = search_subformat_end(str_ind + 3 | 0, end_ind, 125),
           str_ind$3 = sub_end$1 + 2 | 0;
          str_ind = str_ind$3;
          continue;
         }
         var str_ind$4 = str_ind + 3 | 0;
         str_ind = str_ind$4;
         continue;
        }
       }
       else{
        if(40 === match){
         var
          sub_end$2 = search_subformat_end(str_ind + 2 | 0, end_ind, 41),
          str_ind$5 = sub_end$2 + 2 | 0;
         str_ind = str_ind$5;
         continue;
        }
        if(41 === match)
         return expected_character(str_ind + 1 | 0, "character '}'", 41);
       }
       var str_ind$0 = str_ind + 2 | 0;
       str_ind = str_ind$0;
      }
      else{var str_ind$6 = str_ind + 1 | 0; str_ind = str_ind$6;}
     }
    }
    function compute_int_conv(pct_ind, str_ind, plus$0, hash$0, space$0, symb){
     var plus = plus$0, hash = hash$0, space = space$0;
     for(;;){
      a:
      {
       if(plus){
        if(! hash){
         if(space) break a;
         if(100 === symb) return 1;
         if(105 === symb) return 4;
         break a;
        }
       }
       else{
        if(! hash){
         if(space){
          if(100 === symb) return 2;
          if(105 === symb) return 5;
          break a;
         }
         var switcher$1 = symb - 88 | 0;
         if(32 < switcher$1 >>> 0) break a;
         switch(switcher$1){
           case 0:
            return 8;
           case 12:
            return 0;
           case 17:
            return 3;
           case 23:
            return 10;
           case 29:
            return 12;
           case 32:
            return 6;
           default: break a;
         }
        }
        if(! space){
         var switcher$0 = symb - 88 | 0;
         if(32 >= switcher$0 >>> 0)
          switch(switcher$0){
            case 0:
             return 9;
            case 12:
             return 13;
            case 17:
             return 14;
            case 23:
             return 11;
            case 29:
             return 15;
            case 32:
             return 7;
          }
        }
       }
       var switcher = symb - 88 | 0;
       if(32 >= switcher >>> 0)
        switch(switcher){
          case 0:
           if(legacy_behavior$0) return 9; break;
          case 23:
           if(legacy_behavior$0) return 11; break;
          case 32:
           if(legacy_behavior$0) return 7; break;
          case 12:
          case 17:
          case 29:
           if(! legacy_behavior$0)
            return incompatible_flag(pct_ind, str_ind, symb, cst$0);
           hash = 0;
           continue;
        }
      }
      if(plus)
       if(space){
        if(! legacy_behavior$0)
         return incompatible_flag(pct_ind, str_ind, 32, cst);
        space = 0;
       }
       else{
        if(! legacy_behavior$0)
         return incompatible_flag(pct_ind, str_ind, symb, cst);
        plus = 0;
       }
      else{
       if(! space)
        throw caml_maybe_attach_backtrace([0, Assert_failure, W], 1);
       if(! legacy_behavior$0)
        return incompatible_flag(pct_ind, str_ind, symb, cst$1);
       space = 0;
      }
     }
    }
    function incompatible_flag(pct_ind, str_ind, symb, option){
     var
      subfmt =
        Stdlib_String[16].call(null, str, pct_ind, str_ind - pct_ind | 0);
     return caml_call5
             (failwith_message(Y), str, pct_ind, option, symb, subfmt);
    }
    return parse(0, caml_ml_string_length(str));
   }
   var
    cst_and = " and ",
    cst_bad_input_format_type_mism =
      "bad input: format type mismatch between ",
    cst_bad_input_format_type_mism$0 =
      "bad input: format type mismatch between %S and %S",
    Z =
      [0,
       [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]],
       cst_bad_input_format_type_mism$0];
   function format_of_string_fmtty(str, fmtty){
    var fmt = fmt_ebb_of_string(0, str)[1];
    try{var b = [0, type_format(fmt, fmtty), str]; return b;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn !== Type_mismatch) throw caml_maybe_attach_backtrace(exn, 0);
     var a = string_of_fmtty(fmtty);
     return caml_call2(failwith_message(Z), str, a);
    }
   }
   var
    _ =
      [0,
       [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]],
       cst_bad_input_format_type_mism$0];
   function format_of_string_format(str, param){
    var
     str$0 = param[2],
     fmt = param[1],
     fmt$0 = fmt_ebb_of_string(0, str)[1];
    try{var a = [0, type_format(fmt$0, fmtty_of_fmt(fmt)), str]; return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Type_mismatch)
      return caml_call2(failwith_message(_), str, str$0);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   runtime.caml_register_global
    (197,
     [0,
      is_in_char_set,
      rev_char_set,
      create_char_set,
      add_in_char_set,
      freeze_char_set,
      param_format_of_ignored_format,
      make_printf,
      make_iprintf,
      output_acc,
      bufput_acc,
      strput_acc,
      type_format,
      fmt_ebb_of_string,
      format_of_string_fmtty,
      format_of_string_format,
      char_of_iconv,
      string_of_formatting_lit,
      string_of_fmtty,
      string_of_fmt,
      open_box_of_string,
      symm,
      trans,
      recast],
     "CamlinternalFormat");
   return;
  }
  (globalThis));

//# 15317 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Printf:[F(2),F(1),F(1),F(1),F(2),F(2),F(2),F(3),F(3),F(2),F(3),F(3),F(2)]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    CamlinternalFormat = global_data.CamlinternalFormat,
    Stdlib = global_data.Stdlib;
   function kfprintf(k, o, param){
    var fmt = param[1];
    return CamlinternalFormat[7].call
            (null,
             function(acc){
              CamlinternalFormat[9].call(null, o, acc);
              return caml_call1(k, o);
             },
             0,
             fmt);
   }
   function kbprintf(k, b, param){
    var fmt = param[1];
    return CamlinternalFormat[7].call
            (null,
             function(acc){
              CamlinternalFormat[10].call(null, b, acc);
              return caml_call1(k, b);
             },
             0,
             fmt);
   }
   function ikfprintf(k, oc, param){
    var fmt = param[1];
    return CamlinternalFormat[8].call(null, k, oc, fmt);
   }
   function fprintf(oc, fmt){
    return kfprintf(function(a){return 0;}, oc, fmt);
   }
   function bprintf(b, fmt){return kbprintf(function(a){return 0;}, b, fmt);}
   function ifprintf(oc, fmt){
    return ikfprintf(function(a){return 0;}, oc, fmt);
   }
   function ibprintf(b, fmt){
    return ikfprintf(function(a){return 0;}, b, fmt);
   }
   function printf(fmt){return fprintf(Stdlib[39], fmt);}
   function eprintf(fmt){return fprintf(Stdlib[40], fmt);}
   function ksprintf(k, param){
    var fmt = param[1];
    function k$0(acc){
     var buf = Stdlib_Buffer[1].call(null, 64);
     CamlinternalFormat[11].call(null, buf, acc);
     return caml_call1(k, Stdlib_Buffer[2].call(null, buf));
    }
    return CamlinternalFormat[7].call(null, k$0, 0, fmt);
   }
   function sprintf(fmt){return ksprintf(function(s){return s;}, fmt);}
   runtime.caml_register_global
    (3,
     [0,
      fprintf,
      printf,
      eprintf,
      sprintf,
      bprintf,
      ifprintf,
      ibprintf,
      kfprintf,
      ikfprintf,
      ksprintf,
      kbprintf,
      ikfprintf,
      ksprintf],
     "Stdlib__Printf");
   return;
  }
  (globalThis));

//# 16793 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Printexc:[F(1),F(1),F(2),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1)*,F(1)*,F(2),F(1),F(2),F(1),F(1),F(1),N,F(1)*,F(2),F(1),F(1),F(1),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_get_exception_raw_backtra = runtime.caml_get_exception_raw_backtrace,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_obj_tag = runtime.caml_obj_tag,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call5(f, a0, a1, a2, a3, a4){
    return (f.l >= 0 ? f.l : f.l = f.length) === 5
            ? f(a0, a1, a2, a3, a4)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]);
   }
   function caml_call7(f, a0, a1, a2, a3, a4, a5, a6){
    return (f.l >= 0 ? f.l : f.l = f.length) === 7
            ? f(a0, a1, a2, a3, a4, a5, a6)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5, a6]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_Atomic = global_data.Stdlib__Atomic,
    Stdlib = global_data.Stdlib,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Obj = global_data.Stdlib__Obj,
    printers = Stdlib_Atomic[1].call(null, 0),
    a = [0, [3, 0, 0], "%S"],
    b = [0, [4, 0, 0, 0, 0], "%d"];
   function field(x, i){
    var f = x[i + 1];
    if(! Stdlib_Obj[1].call(null, f))
     return caml_call1(Stdlib_Printf[4].call(null, b), f);
    var c = Stdlib_Obj[15];
    if(caml_obj_tag(f) === c)
     return caml_call1(Stdlib_Printf[4].call(null, a), f);
    var d = Stdlib_Obj[16];
    return caml_obj_tag(f) === d ? Stdlib[35].call(null, f) : "_";
   }
   var cst = "", c = [0, [11, ", ", [2, 0, [2, 0, 0]]], ", %s%s"];
   function other_fields(x, i){
    if(x.length - 1 <= i) return cst;
    var a = other_fields(x, i + 1 | 0), b = field(x, i);
    return caml_call2(Stdlib_Printf[4].call(null, c), b, a);
   }
   function use_printers(x){
    var param = Stdlib_Atomic[3].call(null, printers);
    for(;;){
     if(! param) return 0;
     var tl = param[2], hd = param[1];
     try{var val = caml_call1(hd, x);}catch(a){param = tl; continue;}
     if(val){var s = val[1]; return [0, s];}
     param = tl;
    }
   }
   var
    d = [0, [12, 40, [2, 0, [2, 0, [12, 41, 0]]]], "(%s%s)"],
    e = [0, [12, 40, [2, 0, [12, 41, 0]]], "(%s)"];
   function string_of_extension_constructo(t){
    if(0 === caml_obj_tag(t)){
     var constructor = t[1][1], match = t.length - 1;
     if(2 < match >>> 0)
      var
       b = other_fields(t, 2),
       c = field(t, 1),
       a = caml_call2(Stdlib_Printf[4].call(null, d), c, b);
     else
      switch(match){
        case 2:
         var
          g = field(t, 1),
          a = caml_call1(Stdlib_Printf[4].call(null, e), g);
         break;
        case 0:
         var a = cst; break;
        default: var a = cst;
      }
     var match$0 = [0, constructor, [0, a]];
    }
    else
     var match$0 = [0, t[1], 0];
    var fields_opt = match$0[2], constructor$0 = match$0[1];
    if(! fields_opt) return constructor$0;
    var f = fields_opt[1];
    return Stdlib[28].call(null, constructor$0, f);
   }
   var
    cst_characters = ", characters ",
    locfmt =
      [0,
       [11,
        'File "',
        [2,
         0,
         [11,
          '", line ',
          [4,
           0,
           0,
           0,
           [11,
            cst_characters,
            [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, [11, ": ", [2, 0, 0]]]]]]]]]],
       'File "%s", line %d, characters %d-%d: %s'];
   function to_string_default(x){
    if(x === Stdlib[9]) return "Out of memory";
    if(x === Stdlib[10]) return "Stack overflow";
    if(x[1] === Stdlib[4]){
     var match = x[2], char = match[3], line = match[2], file = match[1];
     return caml_call5
             (Stdlib_Printf[4].call(null, locfmt),
              file,
              line,
              char,
              char + 5 | 0,
              "Pattern matching failed");
    }
    if(x[1] === Stdlib[5]){
     var
      match$0 = x[2],
      char$0 = match$0[3],
      line$0 = match$0[2],
      file$0 = match$0[1];
     return caml_call5
             (Stdlib_Printf[4].call(null, locfmt),
              file$0,
              line$0,
              char$0,
              char$0 + 6 | 0,
              "Assertion failed");
    }
    if(x[1] !== Stdlib[15]) return string_of_extension_constructo(x);
    var
     match$1 = x[2],
     char$1 = match$1[3],
     line$1 = match$1[2],
     file$1 = match$1[1];
    return caml_call5
            (Stdlib_Printf[4].call(null, locfmt),
             file$1,
             line$1,
             char$1,
             char$1 + 6 | 0,
             "Undefined recursive module");
   }
   function to_string(e){
    var match = use_printers(e);
    if(! match) return to_string_default(e);
    var s = match[1];
    return s;
   }
   var
    cst_Uncaught_exception = "Uncaught exception: ",
    cst_Uncaught_exception_s = "Uncaught exception: %s\n",
    f =
      [0,
       [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]],
       cst_Uncaught_exception_s];
   function print(fct, arg){
    try{var b = caml_call1(fct, arg); return b;}
    catch(x$0){
     var x = caml_wrap_exception(x$0), a = to_string(x);
     caml_call1(Stdlib_Printf[3].call(null, f), a);
     Stdlib[63].call(null, Stdlib[40]);
     throw caml_maybe_attach_backtrace(x, 0);
    }
   }
   var
    g =
      [0,
       [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]],
       cst_Uncaught_exception_s];
   function catch$(fct, arg){
    try{var b = caml_call1(fct, arg); return b;}
    catch(x$0){
     var x = caml_wrap_exception(x$0);
     Stdlib[63].call(null, Stdlib[39]);
     var a = to_string(x);
     caml_call1(Stdlib_Printf[3].call(null, g), a);
     return Stdlib[99].call(null, 2);
    }
   }
   function raw_backtrace_entries(bt){return bt;}
   function convert_raw_backtrace(bt){
    return [0, runtime.caml_convert_raw_backtrace(bt)];
   }
   var
    h = [0, [12, 32, [4, 0, 0, 0, 0]], " %d"],
    i =
      [0,
       [2,
        0,
        [12,
         32,
         [2,
          0,
          [11,
           ' in file "',
           [2,
            0,
            [12,
             34,
             [2,
              0,
              [11,
               ", line",
               [2,
                0,
                [11, cst_characters, [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]]]]]]]]]]]],
       '%s %s in file "%s"%s, line%s, characters %d-%d'],
    j = [0, [11, "s ", [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]]], "s %d-%d"],
    k = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"];
   function format_backtrace_slot(pos, slot){
    function info(is_raise){
     return is_raise
             ? 0 === pos ? "Raised at" : "Re-raised at"
             : 0 === pos ? "Raised by primitive operation at" : "Called from";
    }
    if(0 !== slot[0]){
     if(slot[1]) return 0;
     var n = info(0);
     return [0, caml_call1(Stdlib_Printf[4].call(null, k), n)];
    }
    if(slot[3] === slot[6])
     var a = slot[3], lines = caml_call1(Stdlib_Printf[4].call(null, h), a);
    else
     var
      l = slot[6],
      m = slot[3],
      lines = caml_call2(Stdlib_Printf[4].call(null, j), m, l);
    var
     b = slot[7],
     c = slot[4],
     d = slot[8] ? " (inlined)" : cst,
     e = slot[2],
     f = slot[9],
     g = info(slot[1]);
    return [0,
            caml_call7
             (Stdlib_Printf[4].call(null, i), g, f, e, d, lines, c, b)];
   }
   var
    cst_s = "%s\n",
    cst_Program_not_linked_with_g_ =
      "(Program not linked with -g, cannot print stack backtrace)\n",
    l = [0, [2, 0, [12, 10, 0]], cst_s],
    m =
      [0,
       [11, cst_Program_not_linked_with_g_, 0],
       cst_Program_not_linked_with_g_];
   function print_raw_backtrace(outchan, raw_backtrace){
    var backtrace = convert_raw_backtrace(raw_backtrace);
    if(! backtrace) return Stdlib_Printf[1].call(null, outchan, m);
    var a = backtrace[1], b = a.length - 2 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      var match = format_backtrace_slot(i, caml_check_bound(a, i)[i + 1]);
      if(match){
       var str = match[1];
       caml_call1(Stdlib_Printf[1].call(null, outchan, l), str);
      }
      var c = i + 1 | 0;
      if(b === i) break;
      i = c;
     }
    }
    return 0;
   }
   function print_backtrace(outchan){
    return print_raw_backtrace(outchan, caml_get_exception_raw_backtra(0));
   }
   var n = [0, [2, 0, [12, 10, 0]], cst_s];
   function raw_backtrace_to_string(raw_backtrace){
    var backtrace = convert_raw_backtrace(raw_backtrace);
    if(! backtrace) return cst_Program_not_linked_with_g_;
    var
     a = backtrace[1],
     b = Stdlib_Buffer[1].call(null, 1024),
     c = a.length - 2 | 0;
    if(c >= 0){
     var i = 0;
     for(;;){
      var match = format_backtrace_slot(i, caml_check_bound(a, i)[i + 1]);
      if(match){
       var str = match[1];
       caml_call1(Stdlib_Printf[5].call(null, b, n), str);
      }
      var d = i + 1 | 0;
      if(c === i) break;
      i = d;
     }
    }
    return Stdlib_Buffer[2].call(null, b);
   }
   function backtrace_slot_is_raise(param){
    return 0 === param[0] ? param[1] : param[1];
   }
   function backtrace_slot_is_inline(param){return 0 === param[0] ? param[8] : 0;
   }
   function backtrace_slot_location(param){
    return 0 === param[0]
            ? [0,
              [0, param[2], param[3], param[4], param[5], param[6], param[7]]]
            : 0;
   }
   function backtrace_slot_defname(param){
    if(0 === param[0] && param[9] !== cst) return [0, param[9]];
    return 0;
   }
   function backtrace_slots(raw_backtrace){
    var match = convert_raw_backtrace(raw_backtrace);
    if(! match) return 0;
    var backtrace = match[1], i$1 = backtrace.length - 2 | 0, i = i$1;
    for(;;){
     if(-1 === i)
      var b = 0;
     else{
      var a = 0 === caml_check_bound(backtrace, i)[i + 1][0] ? 1 : 0;
      if(! a){var i$0 = i - 1 | 0; i = i$0; continue;}
      var b = a;
     }
     return b ? [0, backtrace] : 0;
    }
   }
   function backtrace_slots_of_raw_entry(entry){return backtrace_slots([0, entry]);
   }
   function raw_backtrace_length(bt){return bt.length - 1;}
   function get_backtrace(param){
    return raw_backtrace_to_string(caml_get_exception_raw_backtra(0));
   }
   function register_printer(fn){
    for(;;){
     var
      old_printers = Stdlib_Atomic[3].call(null, printers),
      new_printers = [0, fn, old_printers],
      success =
        Stdlib_Atomic[6].call(null, printers, old_printers, new_printers),
      a = 1 - success;
     if(! a) return a;
    }
   }
   function exn_slot(x){return 0 === caml_obj_tag(x) ? x[1] : x;}
   function exn_slot_id(x){var slot = exn_slot(x); return slot[2];}
   function exn_slot_name(x){var slot = exn_slot(x); return slot[1];}
   var
    errors =
      runtime.caml_obj_dup
       ([0,
         cst,
         "(Cannot print locations:\n bytecode executable program file not found)",
         "(Cannot print locations:\n bytecode executable program file appears to be corrupt)",
         "(Cannot print locations:\n bytecode executable program file has wrong magic number)",
         "(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"]),
    cst_Fatal_error_exception = "Fatal error: exception ",
    cst_Fatal_error_exception_s = "Fatal error: exception %s\n",
    o =
      [0,
       [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]],
       cst_Fatal_error_exception_s];
   function default_uncaught_exception_han(exn, raw_backtrace){
    var b = to_string(exn);
    caml_call1(Stdlib_Printf[3].call(null, o), b);
    print_raw_backtrace(Stdlib[40], raw_backtrace);
    var status = runtime.caml_ml_debug_info_status(0);
    if(status < 0){
     var
      a = Stdlib[18].call(null, status),
      c = caml_check_bound(errors, a)[a + 1];
     Stdlib[53].call(null, c);
    }
    return Stdlib[63].call(null, Stdlib[40]);
   }
   var uncaught_exception_handler = [0, default_uncaught_exception_han];
   function set_uncaught_exception_handler(fn){
    uncaught_exception_handler[1] = fn;
    return 0;
   }
   var
    empty_backtrace = [0],
    p =
      [0,
       [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]],
       cst_Fatal_error_exception_s],
    q =
      [0,
       [11,
        "Fatal error in uncaught exception handler: exception ",
        [2, 0, [12, 10, 0]]],
       "Fatal error in uncaught exception handler: exception %s\n"];
   function handle_uncaught_exception(exn$1, debugger_in_use){
    try{
     try{
      var
       raw_backtrace =
         debugger_in_use ? empty_backtrace : caml_get_exception_raw_backtra(0);
      try{Stdlib[103].call(null, 0);}catch(exn){}
      try{
       var
        e = caml_call2(uncaught_exception_handler[1], exn$1, raw_backtrace),
        a = e;
      }
      catch(exn){
       var
        exn$0 = caml_wrap_exception(exn),
        raw_backtrace$0 = caml_get_exception_raw_backtra(0),
        c = to_string(exn$1);
       caml_call1(Stdlib_Printf[3].call(null, p), c);
       print_raw_backtrace(Stdlib[40], raw_backtrace);
       var d = to_string(exn$0);
       caml_call1(Stdlib_Printf[3].call(null, q), d);
       print_raw_backtrace(Stdlib[40], raw_backtrace$0);
       var a = Stdlib[63].call(null, Stdlib[40]);
      }
      var b = a;
     }
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn !== Stdlib[9]) throw caml_maybe_attach_backtrace(exn, 0);
      var
       b =
         Stdlib[53].call
          (null, "Fatal error: out of memory in uncaught exception handler");
     }
     return b;
    }
    catch(exn){return 0;}
   }
   runtime.caml_register_named_value
    ("Printexc.handle_uncaught_exception", handle_uncaught_exception);
   var
    Stdlib_Printexc =
      [0,
       to_string,
       to_string_default,
       print,
       catch$,
       print_backtrace,
       get_backtrace,
       runtime.caml_record_backtrace,
       runtime.caml_backtrace_status,
       register_printer,
       use_printers,
       raw_backtrace_entries,
       caml_get_exception_raw_backtra,
       print_raw_backtrace,
       raw_backtrace_to_string,
       default_uncaught_exception_han,
       set_uncaught_exception_handler,
       backtrace_slots,
       backtrace_slots_of_raw_entry,
       [0,
        backtrace_slot_is_raise,
        backtrace_slot_is_inline,
        backtrace_slot_location,
        backtrace_slot_defname,
        format_backtrace_slot],
       raw_backtrace_length,
       runtime.caml_raw_backtrace_slot,
       runtime.caml_convert_raw_backtrace_slot,
       runtime.caml_raw_backtrace_next_slot,
       exn_slot_id,
       exn_slot_name,
       string_of_extension_constructo];
   runtime.caml_register_global(43, Stdlib_Printexc, "Stdlib__Printexc");
   return;
  }
  (globalThis));

//# 17276 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Fun:[F(2)*,F(3),F(3),F(2),F(2),N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_restore_raw_backtrace = runtime.caml_restore_raw_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Printexc = global_data.Stdlib__Printexc,
    Stdlib = global_data.Stdlib;
   function const$(c, param){return c;}
   function compose(f, g, x){return caml_call1(f, caml_call1(g, x));}
   function flip(f, x, y){return caml_call2(f, y, x);}
   function negate(p, v){return 1 - caml_call1(p, v);}
   var
    Finally_raised =
      [248, "Stdlib.Fun.Finally_raised", runtime.caml_fresh_oo_id(0)];
   Stdlib_Printexc[9].call
    (null,
     function(param){
      if(param[1] !== Finally_raised) return 0;
      var exn = param[2], a = Stdlib_Printexc[1].call(null, exn);
      return [0, Stdlib[28].call(null, "Fun.Finally_raised: ", a)];
     });
   var dummy = 0;
   function protect(finally$, work){
    function finally_no_exn(param){
     try{caml_call1(finally$, 0); return;}
     catch(e$0){
      var
       e = caml_wrap_exception(e$0),
       bt = Stdlib_Printexc[12].call(null, 0),
       exn = [0, Finally_raised, e];
      caml_restore_raw_backtrace(exn, bt);
      throw caml_maybe_attach_backtrace(exn, 0);
     }
    }
    try{var result = caml_call1(work, 0);}
    catch(work_exn$0){
     var
      work_exn = caml_wrap_exception(work_exn$0),
      work_bt = Stdlib_Printexc[12].call(null, 0);
     finally_no_exn(0);
     caml_restore_raw_backtrace(work_exn, work_bt);
     throw caml_maybe_attach_backtrace(work_exn, 0);
    }
    finally_no_exn(0);
    return result;
   }
   runtime.caml_register_global
    (4,
     [0, const$, compose, flip, negate, protect, Finally_raised],
     "Stdlib__Fun");
   return;
  }
  (globalThis));

//# 17540 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__In_channel:[N,F(1),F(1),F(3),F(2),F(2),F(4),F(1),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(4),F(4),F(4),F(4),F(3),N,N,N,F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_ba_dim_1 = runtime.caml_ba_dim_1,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length,
    caml_ml_input_bigarray = runtime.caml_ml_input_bigarray,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Sys = global_data.Stdlib__Sys,
    Stdlib_Fun = global_data.Stdlib__Fun,
    stdin = Stdlib[38],
    open_bin = Stdlib[80],
    open_text = Stdlib[79],
    open_gen = Stdlib[81];
   function with_open(openfun, s, f){
    var ic = caml_call1(openfun, s);
    return Stdlib_Fun[5].call
            (null,
             function(param){return Stdlib[94].call(null, ic);},
             function(param){return caml_call1(f, ic);});
   }
   function with_open_bin(s, f){return with_open(Stdlib[80], s, f);}
   function with_open_text(s, f){return with_open(Stdlib[79], s, f);}
   function with_open_gen(flags, perm, s, f){
    var a = Stdlib[81];
    return with_open(function(b){return a(flags, perm, b);}, s, f);
   }
   var
    seek = Stdlib[96][4],
    pos = Stdlib[96][5],
    length = Stdlib[96][6],
    close = Stdlib[93],
    close_noerr = Stdlib[94];
   function input_char(ic){
    try{var c = Stdlib[82].call(null, ic);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[12]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, c];
   }
   function input_byte(ic){
    try{var n = Stdlib[87].call(null, ic);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[12]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, n];
   }
   function input_line(ic){
    try{var s = Stdlib[83].call(null, ic);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[12]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, s];
   }
   var input = Stdlib[84];
   function input_bigarray(ic, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ba_dim_1(buf) - len | 0) >= ofs)
     return caml_ml_input_bigarray(ic, buf, ofs, len);
    return Stdlib[1].call(null, "input_bigarray");
   }
   var a = [0, 0];
   function really_input(ic, buf, pos, len){
    try{Stdlib[85].call(null, ic, buf, pos, len); return a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[12]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   var b = [0, 0];
   function really_input_bigarray(ic, buf, ofs$1, len$1){
    if(0 <= ofs$1 && 0 <= len$1 && (caml_ba_dim_1(buf) - len$1 | 0) >= ofs$1){
     var ofs = ofs$1, len = len$1;
     for(;;){
      if(0 >= len) return b;
      var r = caml_ml_input_bigarray(ic, buf, ofs, len);
      if(0 === r) return 0;
      var len$0 = len - r | 0, ofs$0 = ofs + r | 0;
      ofs = ofs$0;
      len = len$0;
     }
    }
    return Stdlib[1].call(null, "really_input_bigarray");
   }
   function really_input_string(ic, len){
    try{var s = Stdlib[86].call(null, ic, len);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[12]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, s];
   }
   function read_upto(ic, buf, ofs, len){
    var ofs$0 = ofs, len$0 = len;
    for(;;){
     if(0 !== len$0){
      var r = Stdlib[84].call(null, ic, buf, ofs$0, len$0);
      if(0 !== r){
       var len$1 = len$0 - r | 0, ofs$1 = ofs$0 + r | 0;
       ofs$0 = ofs$1;
       len$0 = len$1;
       continue;
      }
     }
     return ofs$0 - ofs | 0;
    }
   }
   function ensure(buf, ofs, n){
    var len = caml_ml_bytes_length(buf);
    if((ofs + n | 0) <= len) return buf;
    var new_len$0 = len;
    for(;;){
     if(new_len$0 >= (ofs + n | 0)) break;
     new_len$0 = (2 * new_len$0 | 0) + 1 | 0;
    }
    var
     new_len =
       new_len$0 <= Stdlib_Sys[12]
        ? new_len$0
        : ofs
          < Stdlib_Sys[12]
          ? Stdlib_Sys[12]
          : Stdlib
             [2].call
            (null,
             "In_channel.input_all: channel content is larger than maximum string length"),
     new_buf = caml_create_bytes(new_len);
    Stdlib_Bytes[11].call(null, buf, 0, new_buf, 0, ofs);
    return new_buf;
   }
   function input_all(ic){
    try{
     var
      a = Stdlib[91].call(null, ic),
      b = Stdlib[92].call(null, ic) - a | 0,
      initial_size = b;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
     var initial_size = -1;
    }
    var
     chunk_size = 65536,
     initial_size$0 = 0 <= initial_size ? initial_size : chunk_size,
     initial_size$1 =
       initial_size$0 <= Stdlib_Sys[12] ? initial_size$0 : Stdlib_Sys[12],
     buf = caml_create_bytes(initial_size$1),
     nread = read_upto(ic, buf, 0, initial_size$1);
    if(nread < initial_size$1)
     return Stdlib_Bytes[8].call(null, buf, 0, nread);
    try{var c = Stdlib[82].call(null, ic);}
    catch(exn){
     var exn$0 = caml_wrap_exception(exn);
     if(exn$0 === Stdlib[12]) return Stdlib_Bytes[44].call(null, buf);
     throw caml_maybe_attach_backtrace(exn$0, 0);
    }
    var buf$2 = ensure(buf, nread, 65537);
    runtime.caml_bytes_set(buf$2, nread, c);
    var ofs$1 = nread + 1 | 0, buf$0 = buf$2, ofs = ofs$1;
    for(;;){
     var
      buf$1 = ensure(buf$0, ofs, chunk_size),
      rem = caml_ml_bytes_length(buf$1) - ofs | 0,
      r = read_upto(ic, buf$1, ofs, rem);
     if(r < rem) return Stdlib_Bytes[8].call(null, buf$1, 0, ofs + r | 0);
     var ofs$0 = ofs + rem | 0;
     buf$0 = buf$1;
     ofs = ofs$0;
    }
   }
   function input_lines(ic){
    try{var line = Stdlib[83].call(null, ic);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[12]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    var block = [0, line, 24029], dst = block, offset = 1;
    for(;;){
     try{var line$0 = Stdlib[83].call(null, ic);}
     catch(exn){
      var exn$0 = caml_wrap_exception(exn);
      if(exn$0 !== Stdlib[12]) throw caml_maybe_attach_backtrace(exn$0, 0);
      dst[offset + 1] = 0;
      return block;
     }
     var dst$0 = [0, line$0, 24029];
     dst[offset + 1] = dst$0;
     dst = dst$0;
     offset = 1;
    }
   }
   function fold_lines(f, accu$1, ic){
    var accu = accu$1;
    for(;;){
     try{var line = Stdlib[83].call(null, ic);}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn === Stdlib[12]) return accu;
      throw caml_maybe_attach_backtrace(exn, 0);
     }
     var accu$0 = caml_call2(f, accu, line);
     accu = accu$0;
    }
   }
   var
    set_binary_mode = Stdlib[95],
    Stdlib_In_channel =
      [0,
       stdin,
       open_bin,
       open_text,
       open_gen,
       with_open_bin,
       with_open_text,
       with_open_gen,
       close,
       close_noerr,
       input_char,
       input_byte,
       input_line,
       really_input_string,
       input_all,
       input_lines,
       input,
       input_bigarray,
       really_input,
       really_input_bigarray,
       fold_lines,
       seek,
       pos,
       length,
       set_binary_mode,
       runtime.caml_ml_is_binary_mode,
       runtime.caml_sys_isatty];
   runtime.caml_register_global(9, Stdlib_In_channel, "Stdlib__In_channel");
   return;
  }
  (globalThis));

//# 17897 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Digest:[F(2)*,F(2)*,F(1),F(1),F(3),F(3),F(2),F(1),F(2),F(1),F(1),F(1),F(1),N,N,N,N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_blake2_final = runtime.caml_blake2_final,
    caml_blake2_string = runtime.caml_blake2_string,
    caml_blake2_update = runtime.caml_blake2_update,
    caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_md5_chan = runtime.caml_md5_chan,
    caml_md5_string = runtime.caml_md5_string,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_In_channel = global_data.Stdlib__In_channel,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Int = global_data.Stdlib__Int,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Char = global_data.Stdlib__Char;
   function hex_of_string(d){
    function char_hex(n){
     var a = 10 <= n ? (97 + n | 0) - 10 | 0 : 48 + n | 0;
     return Stdlib_Char[1].call(null, a);
    }
    var
     len = caml_ml_string_length(d),
     result = caml_create_bytes(len * 2 | 0),
     a = len - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var x = caml_string_get(d, i);
      caml_bytes_unsafe_set(result, i * 2 | 0, char_hex(x >>> 4 | 0));
      caml_bytes_unsafe_set(result, (i * 2 | 0) + 1 | 0, char_hex(x & 15));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return Stdlib_Bytes[44].call(null, result);
   }
   var cst_Digest_of_hex = "Digest.of_hex";
   function string_of_hex(s){
    function digit(c){
     if(65 <= c){
      if(97 <= c){
       if(103 > c) return (c - 97 | 0) + 10 | 0;
      }
      else if(71 > c) return (c - 65 | 0) + 10 | 0;
     }
     else if(9 >= c - 48 >>> 0) return c - 48 | 0;
     return Stdlib[1].call(null, cst_Digest_of_hex);
    }
    return Stdlib_String[2].call
            (null,
             caml_ml_string_length(s) / 2 | 0,
             function(i){
              var
               i$0 = 2 * i | 0,
               a = digit(caml_string_get(s, i$0 + 1 | 0)),
               b = (digit(caml_string_get(s, i$0)) << 4) + a | 0;
              return Stdlib_Char[1].call(null, b);
             });
   }
   var
    cst_Digest_substring = "Digest.substring",
    cst_Digest_to_hex = "Digest.to_hex";
   function BLAKE2(X){
    var a = X[1] < 1, b = a || 64 < X[1];
    if(b) Stdlib[1].call(null, "Digest.BLAKE2: wrong hash size");
    var
     hash_length = X[1],
     compare = Stdlib_String[10],
     equal = Stdlib_String[9],
     cst = "";
    function string(str){
     return caml_blake2_string
             (hash_length, cst, str, 0, caml_ml_string_length(str));
    }
    function bytes(b){return string(Stdlib_Bytes[44].call(null, b));}
    function substring(str, ofs, len){
     var a = ofs < 0;
     if(a)
      var b = a;
     else
      var c = len < 0, b = c || (caml_ml_string_length(str) - len | 0) < ofs;
     if(b) Stdlib[1].call(null, cst_Digest_substring);
     return caml_blake2_string(hash_length, cst, str, ofs, len);
    }
    function subbytes(b, ofs, len){
     return substring(Stdlib_Bytes[44].call(null, b), ofs, len);
    }
    function channel(ic, toread){
     var
      buf = caml_create_bytes(4096),
      ctx = runtime.caml_blake2_create(hash_length, cst),
      buf_size = 4096;
     if(0 <= toread){
      var toread$0 = toread;
      for(;;){
       if(0 === toread$0) return caml_blake2_final(ctx, hash_length);
       var
        a = Stdlib_Int[10].call(null, buf_size, toread$0),
        n = Stdlib_In_channel[16].call(null, ic, buf, 0, a);
       if(0 === n) throw caml_maybe_attach_backtrace(Stdlib[12], 1);
       caml_blake2_update(ctx, Stdlib_Bytes[44].call(null, buf), 0, n);
       var toread$1 = toread$0 - n | 0;
       toread$0 = toread$1;
      }
     }
     else
      for(;;){
       var n$0 = Stdlib_In_channel[16].call(null, ic, buf, 0, buf_size);
       if(0 === n$0) return caml_blake2_final(ctx, hash_length);
       caml_blake2_update(ctx, Stdlib_Bytes[44].call(null, buf), 0, n$0);
      }
    }
    function file(filename){
     return Stdlib_In_channel[5].call
             (null, filename, function(ic){return channel(ic, -1);});
    }
    function output(chan, digest){return Stdlib[66].call(null, chan, digest);}
    function input(chan){return Stdlib[86].call(null, chan, hash_length);}
    function to_hex(d){
     if(caml_ml_string_length(d) !== hash_length)
      Stdlib[1].call(null, cst_Digest_to_hex);
     return hex_of_string(d);
    }
    function of_hex(s){
     if(caml_ml_string_length(s) !== (hash_length * 2 | 0))
      Stdlib[1].call(null, cst_Digest_of_hex);
     return string_of_hex(s);
    }
    return [0,
            hash_length,
            compare,
            equal,
            string,
            bytes,
            substring,
            subbytes,
            channel,
            file,
            output,
            input,
            to_hex,
            of_hex];
   }
   var
    BLAKE128 = BLAKE2([0, 16]),
    BLAKE256 = BLAKE2([0, 32]),
    BLAKE512 = BLAKE2([0, 64]),
    compare = Stdlib_String[10],
    equal = Stdlib_String[9];
   function string(str){
    return caml_md5_string(str, 0, caml_ml_string_length(str));
   }
   function bytes(b){return string(Stdlib_Bytes[44].call(null, b));}
   function substring(str, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_string_length(str) - len | 0) >= ofs)
     return caml_md5_string(str, ofs, len);
    return Stdlib[1].call(null, cst_Digest_substring);
   }
   function subbytes(b, ofs, len){
    return substring(Stdlib_Bytes[44].call(null, b), ofs, len);
   }
   function file(filename){
    return Stdlib_In_channel[5].call
            (null, filename, function(ic){return caml_md5_chan(ic, -1);});
   }
   function output(chan, digest){return Stdlib[66].call(null, chan, digest);}
   function input(chan){return Stdlib[86].call(null, chan, 16);}
   function to_hex(d){
    if(16 !== caml_ml_string_length(d))
     Stdlib[1].call(null, cst_Digest_to_hex);
    return hex_of_string(d);
   }
   function of_hex(s){
    if(32 !== caml_ml_string_length(s))
     Stdlib[1].call(null, "Digest.from_hex");
    return string_of_hex(s);
   }
   runtime.caml_register_global
    (17,
     [0,
      compare,
      equal,
      string,
      bytes,
      substring,
      subbytes,
      caml_md5_chan,
      file,
      output,
      input,
      to_hex,
      of_hex,
      of_hex,
      BLAKE128,
      BLAKE256,
      BLAKE512,
      [0,
       16,
       compare,
       equal,
       string,
       bytes,
       substring,
       subbytes,
       caml_md5_chan,
       file,
       output,
       input,
       to_hex,
       of_hex]],
     "Stdlib__Digest");
   return;
  }
  (globalThis));

//# 18123 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Bigarray:[N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(1)*,N,N,N,N,N,N,N,F(1),F(1),F(1),F(1),F(2),F(1),F(2),F(3),F(4)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_ba_change_layout = runtime.caml_ba_change_layout,
    caml_ba_create = runtime.caml_ba_create,
    caml_ba_dim_1 = runtime.caml_ba_dim_1,
    caml_ba_dim_2 = runtime.caml_ba_dim_2,
    caml_ba_kind = runtime.caml_ba_kind,
    caml_ba_num_dims = runtime.caml_ba_num_dims,
    caml_ba_reshape = runtime.caml_ba_reshape,
    caml_ba_set_1 = runtime.caml_ba_set_1,
    caml_ba_set_2 = runtime.caml_ba_set_2,
    caml_ba_set_3 = runtime.caml_ba_set_3,
    caml_ba_set_generic = runtime.caml_ba_set_generic,
    caml_ba_slice = runtime.caml_ba_slice,
    caml_check_bound = runtime.caml_check_bound,
    caml_make_vect = runtime.caml_make_vect,
    caml_mul = runtime.caml_mul;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_Sys = global_data.Stdlib__Sys;
   function kind_size_in_bytes(param){
    switch(param){
      case 11:
       return 16;
      case 0:
      case 6:
       return 4;
      case 8:
      case 9:
       return Stdlib_Sys[9] / 8 | 0;
      case 1:
      case 7:
      case 10:
       return 8;
      case 2:
      case 3:
      case 12:
       return 1;
      default: return 2;
    }
   }
   function cloop(arr, idx, f, col, max){
    if(col === idx.length - 1){
     caml_ba_set_generic(arr, idx, caml_call1(f, idx));
     return;
    }
    var a = caml_check_bound(max, col)[col + 1] - 1 | 0;
    if(a >= 0){
     var j = 0;
     for(;;){
      caml_check_bound(idx, col)[col + 1] = j;
      cloop(arr, idx, f, col + 1 | 0, max);
      var b = j + 1 | 0;
      if(a === j) break;
      j = b;
     }
    }
   }
   function floop(arr, idx, f, col, max){
    if(0 > col){caml_ba_set_generic(arr, idx, caml_call1(f, idx)); return;}
    var a = caml_check_bound(max, col)[col + 1];
    if(a >= 1){
     var j = 1;
     for(;;){
      caml_check_bound(idx, col)[col + 1] = j;
      floop(arr, idx, f, col - 1 | 0, max);
      var b = j + 1 | 0;
      if(a === j) break;
      j = b;
     }
    }
   }
   function init(kind, layout, dims, f){
    var arr = caml_ba_create(kind, layout, dims), dlen = dims.length - 1;
    return layout
            ? (floop
               (arr, caml_make_vect(dlen, 1), f, dlen - 1 | 0, dims),
              arr)
            : (cloop(arr, caml_make_vect(dlen, 0), f, 0, dims), arr);
   }
   function dims(a){
    var n = caml_ba_num_dims(a), d = caml_make_vect(n, 0), b = n - 1 | 0;
    if(b >= 0){
     var i = 0;
     for(;;){
      var c = runtime.caml_ba_dim(a, i);
      caml_check_bound(d, i)[i + 1] = c;
      var e = i + 1 | 0;
      if(b === i) break;
      i = e;
     }
    }
    return d;
   }
   function size_in_bytes(arr){
    var a = dims(arr), b = Stdlib_Array[18].call(null, caml_mul, 1, a);
    return caml_mul(kind_size_in_bytes(caml_ba_kind(arr)), b);
   }
   function create(kind, layout){return caml_ba_create(kind, layout, [0]);}
   function get(arr){return runtime.caml_ba_get_generic(arr, [0]);}
   function set(arr){
    var a = [0];
    return function(b){return caml_ba_set_generic(arr, a, b);};
   }
   function size_in_bytes$0(arr){
    return kind_size_in_bytes(caml_ba_kind(arr));
   }
   function of_value(kind, layout, v){
    var a = create(kind, layout);
    set(a)(v);
    return a;
   }
   function create$0(kind, layout, dim){
    return caml_ba_create(kind, layout, [0, dim]);
   }
   function size_in_bytes$1(arr){
    var a = caml_ba_dim_1(arr);
    return caml_mul(kind_size_in_bytes(caml_ba_kind(arr)), a);
   }
   function slice(a, n){
    return runtime.caml_ba_layout(a)
            ? caml_ba_slice(a, [0, n])
            : caml_ba_slice(a, [0, n]);
   }
   function init$0(kind, layout, dim, f){
    var arr = create$0(kind, layout, dim);
    if(layout){
     if(dim >= 1){
      var i$0 = 1;
      for(;;){
       caml_ba_set_1(arr, i$0, caml_call1(f, i$0));
       var c = i$0 + 1 | 0;
       if(dim === i$0) break;
       i$0 = c;
      }
     }
     return arr;
    }
    var a = dim - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_ba_set_1(arr, i, caml_call1(f, i));
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return arr;
   }
   function of_array(kind, layout, data){
    var
     ba = create$0(kind, layout, data.length - 1),
     ofs = layout ? 1 : 0,
     a = data.length - 2 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      caml_ba_set_1(ba, i + ofs | 0, caml_check_bound(data, i)[i + 1]);
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return ba;
   }
   function create$1(kind, layout, dim1, dim2){
    return caml_ba_create(kind, layout, [0, dim1, dim2]);
   }
   function size_in_bytes$2(arr){
    var a = caml_ba_dim_2(arr), b = caml_ba_dim_1(arr);
    return caml_mul(caml_mul(kind_size_in_bytes(caml_ba_kind(arr)), b), a);
   }
   function slice_left(a, n){return caml_ba_slice(a, [0, n]);}
   function slice_right(a, n){return caml_ba_slice(a, [0, n]);}
   function init$1(kind, layout, dim1, dim2, f){
    var arr = create$1(kind, layout, dim1, dim2);
    if(layout){
     if(dim2 >= 1){
      var j$0 = 1;
      for(;;){
       if(dim1 >= 1){
        var i$0 = 1;
        for(;;){
         caml_ba_set_2(arr, i$0, j$0, caml_call2(f, i$0, j$0));
         var g = i$0 + 1 | 0;
         if(dim1 === i$0) break;
         i$0 = g;
        }
       }
       var e = j$0 + 1 | 0;
       if(dim2 === j$0) break;
       j$0 = e;
      }
     }
     return arr;
    }
    var a = dim1 - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var b = dim2 - 1 | 0;
      if(b >= 0){
       var j = 0;
       for(;;){
        caml_ba_set_2(arr, i, j, caml_call2(f, i, j));
        var d = j + 1 | 0;
        if(b === j) break;
        j = d;
       }
      }
      var c = i + 1 | 0;
      if(a === i) break;
      i = c;
     }
    }
    return arr;
   }
   function of_array$0(kind, layout, data){
    var
     dim1 = data.length - 1,
     dim2 = 0 === dim1 ? 0 : caml_check_bound(data, 0)[1].length - 1,
     ba = create$1(kind, layout, dim1, dim2),
     ofs = layout ? 1 : 0,
     a = dim1 - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var row = caml_check_bound(data, i)[i + 1];
      if(row.length - 1 !== dim2)
       Stdlib[1].call(null, "Bigarray.Array2.of_array: non-rectangular data");
      var b = dim2 - 1 | 0;
      if(b >= 0){
       var j = 0;
       for(;;){
        caml_ba_set_2
         (ba, i + ofs | 0, j + ofs | 0, caml_check_bound(row, j)[j + 1]);
        var d = j + 1 | 0;
        if(b === j) break;
        j = d;
       }
      }
      var c = i + 1 | 0;
      if(a === i) break;
      i = c;
     }
    }
    return ba;
   }
   function create$2(kind, layout, dim1, dim2, dim3){
    return caml_ba_create(kind, layout, [0, dim1, dim2, dim3]);
   }
   function size_in_bytes$3(arr){
    var
     a = runtime.caml_ba_dim_3(arr),
     b = caml_ba_dim_2(arr),
     c = caml_ba_dim_1(arr);
    return caml_mul
            (caml_mul(caml_mul(kind_size_in_bytes(caml_ba_kind(arr)), c), b),
             a);
   }
   function slice_left_1(a, n, m){return caml_ba_slice(a, [0, n, m]);}
   function slice_right_1(a, n, m){return caml_ba_slice(a, [0, n, m]);}
   function slice_left_2(a, n){return caml_ba_slice(a, [0, n]);}
   function slice_right_2(a, n){return caml_ba_slice(a, [0, n]);}
   function init$2(kind, layout, dim1, dim2, dim3, f){
    var arr = create$2(kind, layout, dim1, dim2, dim3);
    if(layout){
     if(dim3 >= 1){
      var k$0 = 1;
      for(;;){
       if(dim2 >= 1){
        var j$0 = 1;
        for(;;){
         if(dim1 >= 1){
          var i$0 = 1;
          for(;;){
           caml_ba_set_3(arr, i$0, j$0, k$0, caml_call3(f, i$0, j$0, k$0));
           var m = i$0 + 1 | 0;
           if(dim1 === i$0) break;
           i$0 = m;
          }
         }
         var l = j$0 + 1 | 0;
         if(dim2 === j$0) break;
         j$0 = l;
        }
       }
       var h = k$0 + 1 | 0;
       if(dim3 === k$0) break;
       k$0 = h;
      }
     }
     return arr;
    }
    var a = dim1 - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var b = dim2 - 1 | 0;
      if(b >= 0){
       var j = 0;
       for(;;){
        var c = dim3 - 1 | 0;
        if(c >= 0){
         var k = 0;
         for(;;){
          caml_ba_set_3(arr, i, j, k, caml_call3(f, i, j, k));
          var g = k + 1 | 0;
          if(c === k) break;
          k = g;
         }
        }
        var e = j + 1 | 0;
        if(b === j) break;
        j = e;
       }
      }
      var d = i + 1 | 0;
      if(a === i) break;
      i = d;
     }
    }
    return arr;
   }
   function of_array$1(kind, layout, data){
    var
     dim1 = data.length - 1,
     dim2 = 0 === dim1 ? 0 : caml_check_bound(data, 0)[1].length - 1,
     dim3 =
       0 === dim2
        ? 0
        : caml_check_bound(caml_check_bound(data, 0)[1], 0)[1].length - 1,
     ba = create$2(kind, layout, dim1, dim2, dim3),
     ofs = layout ? 1 : 0,
     a = dim1 - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var
       row = caml_check_bound(data, i)[i + 1],
       cst_Bigarray_Array3_of_array_n =
         "Bigarray.Array3.of_array: non-cubic data";
      if(row.length - 1 !== dim2)
       Stdlib[1].call(null, cst_Bigarray_Array3_of_array_n);
      var b = dim2 - 1 | 0;
      if(b >= 0){
       var j = 0;
       for(;;){
        var col = caml_check_bound(row, j)[j + 1];
        if(col.length - 1 !== dim3)
         Stdlib[1].call(null, cst_Bigarray_Array3_of_array_n);
        var c = dim3 - 1 | 0;
        if(c >= 0){
         var k = 0;
         for(;;){
          caml_ba_set_3
           (ba,
            i + ofs | 0,
            j + ofs | 0,
            k + ofs | 0,
            caml_check_bound(col, k)[k + 1]);
          var f = k + 1 | 0;
          if(c === k) break;
          k = f;
         }
        }
        var e = j + 1 | 0;
        if(b === j) break;
        j = e;
       }
      }
      var d = i + 1 | 0;
      if(a === i) break;
      i = d;
     }
    }
    return ba;
   }
   function array0_of_genarray(a){
    return 0 === caml_ba_num_dims(a)
            ? a
            : Stdlib[1].call(null, "Bigarray.array0_of_genarray");
   }
   function array1_of_genarray(a){
    return 1 === caml_ba_num_dims(a)
            ? a
            : Stdlib[1].call(null, "Bigarray.array1_of_genarray");
   }
   function array2_of_genarray(a){
    return 2 === caml_ba_num_dims(a)
            ? a
            : Stdlib[1].call(null, "Bigarray.array2_of_genarray");
   }
   function array3_of_genarray(a){
    return 3 === caml_ba_num_dims(a)
            ? a
            : Stdlib[1].call(null, "Bigarray.array3_of_genarray");
   }
   function reshape_0(a){return caml_ba_reshape(a, [0]);}
   function reshape_1(a, dim1){return caml_ba_reshape(a, [0, dim1]);}
   function reshape_2(a, dim1, dim2){
    return caml_ba_reshape(a, [0, dim1, dim2]);
   }
   function reshape_3(a, dim1, dim2, dim3){
    return caml_ba_reshape(a, [0, dim1, dim2, dim3]);
   }
   runtime.caml_register_global
    (10,
     [0,
      13,
      0,
      1,
      10,
      11,
      2,
      3,
      4,
      5,
      8,
      6,
      7,
      9,
      12,
      kind_size_in_bytes,
      0,
      1,
      [0, init, dims, size_in_bytes],
      [0,
       create,
       of_value,
       caml_ba_change_layout,
       size_in_bytes$0,
       get,
       set,
       of_value],
      [0,
       create$0,
       init$0,
       caml_ba_change_layout,
       size_in_bytes$1,
       slice,
       of_array],
      [0,
       create$1,
       init$1,
       caml_ba_change_layout,
       size_in_bytes$2,
       slice_left,
       slice_right,
       of_array$0],
      [0,
       create$2,
       init$2,
       caml_ba_change_layout,
       size_in_bytes$3,
       slice_left_1,
       slice_right_1,
       slice_left_2,
       slice_right_2,
       of_array$1],
      array0_of_genarray,
      array1_of_genarray,
      array2_of_genarray,
      array3_of_genarray,
      caml_ba_reshape,
      reshape_0,
      reshape_1,
      reshape_2,
      reshape_3],
     "Stdlib__Bigarray");
   return;
  }
  (globalThis));

//# 18622 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Random:[F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(1),F(1),F(1),F(1),N,F(1),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_ba_blit = runtime.caml_ba_blit,
    caml_ba_set_1 = runtime.caml_ba_set_1,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_greaterthan = runtime.caml_greaterthan,
    caml_int64_add = runtime.caml_int64_add,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_int64_of_int32 = runtime.caml_int64_of_int32,
    caml_int64_shift_right_unsigne = runtime.caml_int64_shift_right_unsigned,
    caml_int64_sub = runtime.caml_int64_sub,
    caml_int64_to_int32 = runtime.caml_int64_to_int32,
    caml_lessequal = runtime.caml_lessequal,
    caml_lessthan = runtime.caml_lessthan,
    caml_lxm_next = runtime.caml_lxm_next,
    caml_mod = runtime.caml_mod,
    caml_notequal = runtime.caml_notequal,
    caml_sys_random_seed = runtime.caml_sys_random_seed;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Domain = global_data.Stdlib__Domain,
    Stdlib_Sys = global_data.Stdlib__Sys,
    Stdlib_Int32 = global_data.Stdlib__Int32,
    Stdlib_Int64 = global_data.Stdlib__Int64,
    Stdlib = global_data.Stdlib,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Digest = global_data.Stdlib__Digest,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Bigarray = global_data.Stdlib__Bigarray,
    Stdlib_Nativeint = global_data.Stdlib__Nativeint,
    a = caml_int64_create_lo_mi_hi(1, 0, 0),
    b = caml_int64_create_lo_mi_hi(0, 0, 0),
    c = caml_int64_create_lo_mi_hi(0, 0, 0),
    d = caml_int64_create_lo_mi_hi(2, 0, 0),
    e = caml_int64_create_lo_mi_hi(1, 0, 0);
   function create(param){return caml_call3(Stdlib_Bigarray[20][1], 7, 0, 4);}
   function set(s, i1, i2, i3, i4){
    caml_ba_set_1(s, 0, runtime.caml_int64_or(i1, a));
    caml_ba_set_1(s, 1, i2);
    var i3$0 = caml_notequal(i3, b) ? i3 : e;
    caml_ba_set_1(s, 2, i3$0);
    var i4$0 = caml_notequal(i4, c) ? i4 : d;
    return caml_ba_set_1(s, 3, i4$0);
   }
   function mk(i1, i2, i3, i4){
    var s = create(0);
    set(s, i1, i2, i3, i4);
    return s;
   }
   var serialization_prefix = "lxm1:";
   function to_binary_string(s){
    var buf = caml_create_bytes(37);
    Stdlib_Bytes[12].call(null, serialization_prefix, 0, buf, 0, 5);
    var i = 0;
    for(;;){
     var a = runtime.caml_ba_get_1(s, i);
     Stdlib_Bytes[86].call(null, buf, 5 + (i * 8 | 0) | 0, a);
     var b = i + 1 | 0;
     if(3 === i) return Stdlib_Bytes[44].call(null, buf);
     i = b;
    }
   }
   function of_binary_string(buf){
    var
     a = runtime.caml_ml_string_length(buf) !== 37,
     b = a || 1 - Stdlib_String[11].call(null, serialization_prefix, buf);
    if(b){
     var
      c =
        Stdlib[28].call
         (null,
          "Random.State.of_binary_string: expected a format compatible with OCaml ",
          Stdlib_Sys[46]);
     Stdlib[2].call(null, c);
    }
    var
     i1 = Stdlib_String[64].call(null, buf, 5),
     i2 = Stdlib_String[64].call(null, buf, 13),
     i3 = Stdlib_String[64].call(null, buf, 21),
     i4 = Stdlib_String[64].call(null, buf, 29);
    return mk(i1, i2, i3, i4);
   }
   function copy(src){
    var dst = create(0);
    caml_ba_blit(src, dst);
    return dst;
   }
   function reinit(s, seed){
    var
     n = seed.length - 1,
     b = caml_create_bytes((n * 8 | 0) + 1 | 0),
     a = n - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var f = caml_int64_of_int32(runtime.caml_check_bound(seed, i)[i + 1]);
      Stdlib_Bytes[86].call(null, b, i * 8 | 0, f);
      var g = i + 1 | 0;
      if(a === i) break;
      i = g;
     }
    }
    caml_bytes_set(b, n * 8 | 0, 1);
    var d1 = Stdlib_Digest[4].call(null, b);
    caml_bytes_set(b, n * 8 | 0, 2);
    var
     d2 = Stdlib_Digest[4].call(null, b),
     c = Stdlib_String[64].call(null, d2, 8),
     d = Stdlib_String[64].call(null, d2, 0),
     e = Stdlib_String[64].call(null, d1, 8);
    return set(s, Stdlib_String[64].call(null, d1, 0), e, d, c);
   }
   function make(seed){var s = create(0); reinit(s, seed); return s;}
   function make_self_init(param){return make(caml_sys_random_seed(0));}
   function bits(s){
    return caml_int64_to_int32(caml_lxm_next(s)) & 1073741823;
   }
   function int_aux(s, n, mask){
    for(;;){
     var r = caml_int64_to_int32(caml_lxm_next(s)) & mask, v = caml_mod(r, n);
     if(((mask - n | 0) + 1 | 0) >= (r - v | 0)) return v;
    }
   }
   var max_int31 = 1073741823;
   function int(s, bound){
    if(1073741823 >= bound && 0 < bound) return int_aux(s, bound, max_int31);
    return Stdlib[1].call(null, "Random.int");
   }
   var max_int32 = 2147483647;
   function full_int(s, bound){
    if(0 >= bound) return Stdlib[1].call(null, "Random.full_int");
    var
     a =
       bound <= 1073741823
        ? max_int31
        : bound <= 2147483647 ? max_int32 : Stdlib[19];
    return int_aux(s, bound, a);
   }
   function int_in_range_aux(s, min, max, mask, nbits){
    var span = (max - min | 0) + 1 | 0;
    if(span <= mask && 0 < span) return min + int_aux(s, span, mask) | 0;
    for(;;){
     var
      drop = Stdlib_Sys[10] - nbits | 0,
      r = caml_int64_to_int32(caml_lxm_next(s)) << drop >> drop;
     if(r >= min && max >= r) return r;
    }
   }
   function int_in_range(s, min, max){
    if(max < min) Stdlib[1].call(null, "Random.int_in_range");
    if(-1073741824 <= min && max <= 1073741823)
     return int_in_range_aux(s, min, max, max_int31, 31);
    if(-2147483648 <= min && max <= 2147483647)
     return int_in_range_aux(s, min, max, max_int32, 32);
    return int_in_range_aux(s, min, max, Stdlib[19], Stdlib_Sys[10]);
   }
   function bits32(s){return caml_int64_to_int32(caml_lxm_next(s));}
   function int32aux(s, n){
    for(;;){
     var r = bits32(s) >>> 1 | 0, v = caml_mod(r, n);
     if(! caml_greaterthan(r - v | 0, (Stdlib_Int32[9] - n | 0) + 1 | 0))
      return v;
    }
   }
   function int32(s, bound){
    return caml_lessequal(bound, 0)
            ? Stdlib[1].call(null, "Random.int32")
            : int32aux(s, bound);
   }
   function int32_in_range(s, min, max){
    if(caml_greaterthan(min, max))
     return Stdlib[1].call(null, "Random.int32_in_range");
    var span = Stdlib_Int32[6].call(null, max - min | 0);
    if(! caml_lessequal(span, Stdlib_Int32[1]))
     return min + int32aux(s, span) | 0;
    for(;;){
     var r = caml_int64_to_int32(caml_lxm_next(s));
     if(! caml_lessthan(r, min) && ! caml_greaterthan(r, max)) return r;
    }
   }
   var
    f = caml_int64_create_lo_mi_hi(1, 0, 0),
    g = caml_int64_create_lo_mi_hi(0, 0, 0);
   function int64aux(s, n){
    for(;;){
     var
      r = caml_int64_shift_right_unsigne(caml_lxm_next(s), 1),
      v = runtime.caml_int64_mod(r, n);
     if
      (!
       caml_greaterthan
        (caml_int64_sub(r, v),
         caml_int64_add(caml_int64_sub(Stdlib_Int64[9], n), f)))
      return v;
    }
   }
   function int64(s, bound){
    return caml_lessequal(bound, g)
            ? Stdlib[1].call(null, "Random.int64")
            : int64aux(s, bound);
   }
   function int64_in_range(s, min, max){
    if(caml_greaterthan(min, max))
     return Stdlib[1].call(null, "Random.int64_in_range");
    var span = Stdlib_Int64[6].call(null, caml_int64_sub(max, min));
    if(! caml_lessequal(span, Stdlib_Int64[1]))
     return caml_int64_add(min, int64aux(s, span));
    for(;;){
     var r = caml_lxm_next(s);
     if(! caml_lessthan(r, min) && ! caml_greaterthan(r, max)) return r;
    }
   }
   var
    j = caml_int64_create_lo_mi_hi(14371852, 15349651, 22696),
    k = caml_int64_create_lo_mi_hi(12230193, 11438743, 35013),
    l = caml_int64_create_lo_mi_hi(1424933, 15549263, 2083),
    m = caml_int64_create_lo_mi_hi(9492471, 4696708, 43520),
    h = caml_int64_create_lo_mi_hi(0, 0, 0),
    i = caml_int64_create_lo_mi_hi(0, 0, 0),
    nativebits =
      32 === Stdlib_Nativeint[9]
       ? function(s){return bits32(s);}
       : function(s){return caml_int64_to_int32(caml_lxm_next(s));},
    nativeint =
      32 === Stdlib_Nativeint[9]
       ? function(s, bound){return int32(s, bound);}
       : function
        (s, bound){
         return caml_int64_to_int32(int64(s, caml_int64_of_int32(bound)));
        },
    nativeint_in_range =
      32 === Stdlib_Nativeint[9]
       ? function(s, min, max){return int32_in_range(s, min, max);}
       : function
        (s, min, max){
         return caml_int64_to_int32
                 (int64_in_range
                   (s, caml_int64_of_int32(min), caml_int64_of_int32(max)));
        };
   function float(s, bound){
    for(;;){
     var b = caml_lxm_next(s), n = caml_int64_shift_right_unsigne(b, 11);
     if(caml_notequal(n, h))
      return runtime.caml_int64_to_float(n) * 1.1102230246251565e-16 * bound;
    }
   }
   function bool(s){return caml_lessthan(caml_lxm_next(s), i);}
   function split(s){
    var
     i1 = caml_lxm_next(s),
     i2 = caml_lxm_next(s),
     i3 = caml_lxm_next(s),
     i4 = caml_lxm_next(s);
    return mk(i1, i2, i3, i4);
   }
   function mk_default(param){return mk(m, l, k, j);}
   var random_key = caml_call2(Stdlib_Domain[10][1], [0, split], mk_default);
   function bits$0(param){
    return bits(caml_call1(Stdlib_Domain[10][2], random_key));
   }
   function int$0(bound){
    return int(caml_call1(Stdlib_Domain[10][2], random_key), bound);
   }
   function full_int$0(bound){
    return full_int(caml_call1(Stdlib_Domain[10][2], random_key), bound);
   }
   function int_in_range$0(min, max){
    return int_in_range
            (caml_call1(Stdlib_Domain[10][2], random_key), min, max);
   }
   function int32$0(bound){
    return int32(caml_call1(Stdlib_Domain[10][2], random_key), bound);
   }
   function int32_in_range$0(min, max){
    return int32_in_range
            (caml_call1(Stdlib_Domain[10][2], random_key), min, max);
   }
   function nativeint$0(bound){
    return nativeint(caml_call1(Stdlib_Domain[10][2], random_key), bound);
   }
   function nativeint_in_range$0(min, max){
    return nativeint_in_range
            (caml_call1(Stdlib_Domain[10][2], random_key), min, max);
   }
   function int64$0(bound){
    return int64(caml_call1(Stdlib_Domain[10][2], random_key), bound);
   }
   function int64_in_range$0(min, max){
    return int64_in_range
            (caml_call1(Stdlib_Domain[10][2], random_key), min, max);
   }
   function float$0(scale){
    return float(caml_call1(Stdlib_Domain[10][2], random_key), scale);
   }
   function bool$0(param){
    return bool(caml_call1(Stdlib_Domain[10][2], random_key));
   }
   function bits32$0(param){
    return bits32(caml_call1(Stdlib_Domain[10][2], random_key));
   }
   function bits64(param){
    var s = caml_call1(Stdlib_Domain[10][2], random_key);
    return caml_lxm_next(s);
   }
   function nativebits$0(param){
    return nativebits(caml_call1(Stdlib_Domain[10][2], random_key));
   }
   function full_init(seed){
    return reinit(caml_call1(Stdlib_Domain[10][2], random_key), seed);
   }
   function init(seed){return full_init([0, seed]);}
   function self_init(param){return full_init(caml_sys_random_seed(0));}
   function split$0(param){
    return split(caml_call1(Stdlib_Domain[10][2], random_key));
   }
   function get_state(param){
    return copy(caml_call1(Stdlib_Domain[10][2], random_key));
   }
   function set_state(src){
    var dst = caml_call1(Stdlib_Domain[10][2], random_key);
    return caml_ba_blit(src, dst);
   }
   runtime.caml_register_global
    (35,
     [0,
      init,
      full_init,
      self_init,
      bits$0,
      int$0,
      full_int$0,
      int_in_range$0,
      int32$0,
      int32_in_range$0,
      nativeint$0,
      nativeint_in_range$0,
      int64$0,
      int64_in_range$0,
      float$0,
      bool$0,
      bits32$0,
      bits64,
      nativebits$0,
      [0,
       make,
       make_self_init,
       copy,
       bits,
       int,
       full_int,
       int_in_range,
       int32,
       int32_in_range,
       nativeint,
       nativeint_in_range,
       int64,
       int64_in_range,
       float,
       bool,
       bits32,
       caml_lxm_next,
       nativebits,
       split,
       to_binary_string,
       of_binary_string],
      get_state,
      set_state,
      split$0],
     "Stdlib__Random");
   return;
  }
  (globalThis));

//# 19017 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Hashtbl:[F(2),F(1),F(1),F(1),F(3),F(2),F(2),F(2),F(2),F(2),F(3),F(2),F(2),F(3),F(1)*,F(1),F(1),F(2),F(1),F(1)*->F(1),F(1)*->F(1),F(1)*->F(1),F(2),F(2),F(1),F(1)*,F(1)*,F(1)*,F(2)*,F(3)*,F(4)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_compare = runtime.caml_compare,
    caml_hash = runtime.caml_hash,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_sys_getenv = runtime.caml_sys_getenv,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Sys = global_data.Stdlib__Sys,
    Stdlib = global_data.Stdlib,
    Stdlib_Atomic = global_data.Stdlib__Atomic,
    Stdlib_Domain = global_data.Stdlib__Domain,
    Stdlib_Random = global_data.Stdlib__Random,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_Int = global_data.Stdlib__Int,
    Stdlib_Array = global_data.Stdlib__Array;
   global_data.Assert_failure;
   var Stdlib_String = global_data.Stdlib__String;
   function ongoing_traversal(h){
    var a = h.length - 1 < 4 ? 1 : 0, b = a || (h[4] < 0 ? 1 : 0);
    return b;
   }
   function flip_ongoing_traversal(h){h[4] = - h[4] | 0; return 0;}
   try{var c = caml_sys_getenv("OCAMLRUNPARAM"), params = c;}
   catch(exn$1){
    var exn = caml_wrap_exception(exn$1);
    if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
    try{var b = caml_sys_getenv("CAMLRUNPARAM"), params = b;}
    catch(exn){
     var exn$0 = caml_wrap_exception(exn);
     if(exn$0 !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn$0, 0);
     var params = "";
    }
   }
   var
    randomized_default = Stdlib_String[15].call(null, params, 82),
    randomized = Stdlib_Atomic[1].call(null, randomized_default);
   function randomize(param){
    return Stdlib_Atomic[4].call(null, randomized, 1);
   }
   function is_randomized(param){
    return Stdlib_Atomic[3].call(null, randomized);
   }
   var prng_key = caml_call2(Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]);
   function power_2_above(x$1, n){
    var x = x$1;
    for(;;){
     if(n <= x) return x;
     if(Stdlib_Sys[13] < (x * 2 | 0)) return x;
     var x$0 = x * 2 | 0;
     x = x$0;
    }
   }
   function create(opt, initial_size){
    var
     random = opt ? opt[1] : Stdlib_Atomic[3].call(null, randomized),
     s = power_2_above(16, initial_size);
    if(random)
     var
      a = caml_call1(Stdlib_Domain[10][2], prng_key),
      seed = caml_call1(Stdlib_Random[19][4], a);
    else
     var seed = 0;
    return [0, 0, caml_make_vect(s, 0), seed, s];
   }
   function clear(h){
    var a = 0 < h[1] ? 1 : 0;
    return a
            ? (h
               [1]
              = 0,
              Stdlib_Array[8].call(null, h[2], 0, h[2].length - 1, 0))
            : a;
   }
   function reset(h){
    var len = h[2].length - 1;
    if(4 <= h.length - 1 && len !== Stdlib[18].call(null, h[4])){
     h[1] = 0;
     h[2] = caml_make_vect(Stdlib[18].call(null, h[4]), 0);
     return 0;
    }
    return clear(h);
   }
   function copy_bucketlist(param){
    if(! param) return 0;
    var
     key = param[1],
     data = param[2],
     next = param[3],
     prec$1 = [0, key, data, next],
     prec = prec$1,
     param$0 = next;
    for(;;){
     if(! param$0) return prec$1;
     var
      key$0 = param$0[1],
      data$0 = param$0[2],
      next$0 = param$0[3],
      prec$0 = [0, key$0, data$0, next$0];
     prec[3] = prec$0;
     prec = prec$0;
     param$0 = next$0;
    }
   }
   function copy(h){
    var
     a = h[4],
     b = h[3],
     c = Stdlib_Array[14].call(null, copy_bucketlist, h[2]);
    return [0, h[1], c, b, a];
   }
   function length(h){return h[1];}
   function insert_all_buckets(indexfun, inplace, odata, ndata){
    var
     nsize = ndata.length - 1,
     ndata_tail = caml_make_vect(nsize, 0),
     a = odata.length - 2 | 0;
    if(a >= 0){
     var i$0 = 0;
     a:
     for(;;){
      var cell$1 = caml_check_bound(odata, i$0)[i$0 + 1], cell = cell$1;
      for(;;){
       if(! cell){var e = i$0 + 1 | 0; if(a === i$0) break a; i$0 = e; break;}
       var
        key = cell[1],
        data = cell[2],
        next = cell[3],
        cell$0 = inplace ? cell : [0, key, data, 0],
        nidx = caml_call1(indexfun, key),
        match = caml_check_bound(ndata_tail, nidx)[nidx + 1];
       if(match)
        match[3] = cell$0;
       else
        caml_check_bound(ndata, nidx)[nidx + 1] = cell$0;
       caml_check_bound(ndata_tail, nidx)[nidx + 1] = cell$0;
       cell = next;
      }
     }
    }
    if(inplace){
     var b = nsize - 1 | 0;
     if(b >= 0){
      var i = 0;
      for(;;){
       var match$0 = caml_check_bound(ndata_tail, i)[i + 1];
       if(match$0) match$0[3] = 0;
       var d = i + 1 | 0;
       if(b === i) break;
       i = d;
      }
     }
     var c = 0;
    }
    else
     var c = inplace;
    return c;
   }
   function resize(indexfun, h){
    var
     odata = h[2],
     osize = odata.length - 1,
     nsize = osize * 2 | 0,
     a = nsize < Stdlib_Sys[13] ? 1 : 0;
    if(! a) return a;
    var ndata = caml_make_vect(nsize, 0), inplace = 1 - ongoing_traversal(h);
    h[2] = ndata;
    return insert_all_buckets(caml_call1(indexfun, h), inplace, odata, ndata);
   }
   function iter(f, h){
    var old_trav = ongoing_traversal(h);
    if(1 - old_trav) flip_ongoing_traversal(h);
    try{
     var d = h[2], a = d.length - 2 | 0;
     if(a >= 0){
      var i = 0;
      a:
      for(;;){
       var param = caml_check_bound(d, i)[i + 1];
       for(;;){
        if(! param){var e = i + 1 | 0; if(a === i) break a; i = e; break;}
        var key = param[1], data = param[2], next = param[3];
        caml_call2(f, key, data);
        param = next;
       }
      }
     }
     var b = 1 - old_trav, c = b ? flip_ongoing_traversal(h) : b;
     return c;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(old_trav) throw caml_maybe_attach_backtrace(exn, 0);
     flip_ongoing_traversal(h);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function filter_map_inplace(f, h){
    var d = h[2], old_trav = ongoing_traversal(h);
    if(1 - old_trav) flip_ongoing_traversal(h);
    try{
     var a = d.length - 2 | 0;
     if(a >= 0){
      var i = 0;
      a:
      for(;;){
       var slot$0 = caml_check_bound(h[2], i)[i + 1], prec = 0, slot = slot$0;
       for(;;){
        if(! slot){
         if(prec) prec[3] = 0; else caml_check_bound(h[2], i)[i + 1] = 0;
         var e = i + 1 | 0;
         if(a === i) break a;
         i = e;
         break;
        }
        var
         key = slot[1],
         data = slot[2],
         next = slot[3],
         match = caml_call2(f, key, data);
        if(match){
         var data$0 = match[1];
         if(prec)
          prec[3] = slot;
         else
          caml_check_bound(h[2], i)[i + 1] = slot;
         slot[2] = data$0;
         prec = slot;
         slot = next;
        }
        else{h[1] = h[1] - 1 | 0; slot = next;}
       }
      }
     }
     var b = 1 - old_trav, c = b ? flip_ongoing_traversal(h) : b;
     return c;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(old_trav) throw caml_maybe_attach_backtrace(exn, 0);
     flip_ongoing_traversal(h);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function fold(f, h, init){
    var old_trav = ongoing_traversal(h);
    if(1 - old_trav) flip_ongoing_traversal(h);
    try{
     var d = h[2], a = d.length - 2 | 0;
     if(a < 0)
      var accu$2 = init;
     else{
      var accu$1 = init, i = 0;
      a:
      for(;;){
       var b$0 = caml_check_bound(d, i)[i + 1], b = b$0, accu = accu$1;
       for(;;){
        if(! b){
         var c = i + 1 | 0;
         if(a !== i){accu$1 = accu; i = c; break;}
         var accu$2 = accu;
         break a;
        }
        var
         key = b[1],
         data = b[2],
         next = b[3],
         accu$0 = caml_call3(f, key, data, accu);
        b = next;
        accu = accu$0;
       }
      }
     }
     if(1 - old_trav) flip_ongoing_traversal(h);
     return accu$2;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(old_trav) throw caml_maybe_attach_backtrace(exn, 0);
     flip_ongoing_traversal(h);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function bucket_length(accu$1, param$0){
    var accu = accu$1, param = param$0;
    for(;;){
     if(! param) return accu;
     var next = param[3], accu$0 = accu + 1 | 0;
     accu = accu$0;
     param = next;
    }
   }
   function stats(h){
    var
     mbl =
       Stdlib_Array[18].call
        (null,
         function(m, b){
          var a = bucket_length(0, b);
          return Stdlib_Int[11].call(null, m, a);
         },
         0,
         h[2]),
     histo = caml_make_vect(mbl + 1 | 0, 0);
    Stdlib_Array[12].call
     (null,
      function(b){
       var l = bucket_length(0, b);
       histo[l + 1] = caml_check_bound(histo, l)[l + 1] + 1 | 0;
       return 0;
      },
      h[2]);
    return [0, h[1], h[2].length - 1, mbl, histo];
   }
   function to_seq(tbl){
    var tbl_data = tbl[2];
    function aux(i$1, buck$1, param){
     var i = i$1, buck = buck$1;
     for(;;){
      if(buck) break;
      if(i === tbl_data.length - 1) return 0;
      var buck$0 = caml_check_bound(tbl_data, i)[i + 1], i$0 = i + 1 | 0;
      i = i$0;
      buck = buck$0;
     }
     var key = buck[1], data = buck[2], next = buck[3];
     return [0, [0, key, data], function(a){return aux(i, next, a);}];
    }
    return function(a){return aux(0, 0, a);};
   }
   function to_seq_keys(m){
    var a = to_seq(m);
    function b(a){return a[1];}
    var c = Stdlib_Seq[29];
    return function(d){return c(b, a, d);};
   }
   function to_seq_values(m){
    var a = to_seq(m);
    function b(a){return a[2];}
    var c = Stdlib_Seq[29];
    return function(d){return c(b, a, d);};
   }
   function MakeSeeded(H){
    function key_index(h, key){
     var a = h[2].length - 2 | 0;
     return caml_call2(H[2], h[3], key) & a;
    }
    function add(h, key, data){
     var
      i = key_index(h, key),
      bucket = [0, key, data, caml_check_bound(h[2], i)[i + 1]];
     caml_check_bound(h[2], i)[i + 1] = bucket;
     h[1] = h[1] + 1 | 0;
     var a = h[2].length - 1 << 1 < h[1] ? 1 : 0;
     return a ? resize(key_index, h) : a;
    }
    function remove(h, key){
     var
      i = key_index(h, key),
      prec$1 = caml_check_bound(h[2], i)[i + 1],
      prec$0 = 0,
      prec = prec$1;
     for(;;){
      if(! prec) return 0;
      var k = prec[1], next = prec[3];
      if(caml_call2(H[1], k, key)){
       h[1] = h[1] - 1 | 0;
       return prec$0
               ? (prec$0[3] = next, 0)
               : (caml_check_bound(h[2], i)[i + 1] = next, 0);
      }
      prec$0 = prec;
      prec = next;
     }
    }
    function find(h, key){
     var a = key_index(h, key), match = caml_check_bound(h[2], a)[a + 1];
     if(! match) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var k1 = match[1], d1 = match[2], next1 = match[3];
     if(caml_call2(H[1], key, k1)) return d1;
     if(! next1) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var k2 = next1[1], d2 = next1[2], next2 = next1[3];
     if(caml_call2(H[1], key, k2)) return d2;
     if(! next2) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var k3 = next2[1], d3 = next2[2], next3 = next2[3];
     if(caml_call2(H[1], key, k3)) return d3;
     var param = next3;
     for(;;){
      if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      var k = param[1], data = param[2], next = param[3];
      if(caml_call2(H[1], key, k)) return data;
      param = next;
     }
    }
    function find_opt(h, key){
     var a = key_index(h, key), match = caml_check_bound(h[2], a)[a + 1];
     if(! match) return 0;
     var k1 = match[1], d1 = match[2], next1 = match[3];
     if(caml_call2(H[1], key, k1)) return [0, d1];
     if(! next1) return 0;
     var k2 = next1[1], d2 = next1[2], next2 = next1[3];
     if(caml_call2(H[1], key, k2)) return [0, d2];
     if(! next2) return 0;
     var k3 = next2[1], d3 = next2[2], next3 = next2[3];
     if(caml_call2(H[1], key, k3)) return [0, d3];
     var param = next3;
     for(;;){
      if(! param) return 0;
      var k = param[1], data = param[2], next = param[3];
      if(caml_call2(H[1], key, k)) return [0, data];
      param = next;
     }
    }
    function find_all(h, key){
     var a = key_index(h, key), param = caml_check_bound(h[2], a)[a + 1];
     for(;;){
      if(! param) return 0;
      var k = param[1], d = param[2], next = param[3];
      if(caml_call2(H[1], k, key)) break;
      param = next;
     }
     var block = [0, d, 24029], dst = block, offset = 1, param$0 = next;
     for(;;){
      if(! param$0){dst[offset + 1] = 0; return block;}
      var k$0 = param$0[1], d$0 = param$0[2], next$0 = param$0[3];
      if(caml_call2(H[1], k$0, key)){
       var dst$0 = [0, d$0, 24029];
       dst[offset + 1] = dst$0;
       dst = dst$0;
       offset = 1;
       param$0 = next$0;
      }
      else
       param$0 = next$0;
     }
    }
    function replace(h, key, data){
     var
      i = key_index(h, key),
      l = caml_check_bound(h[2], i)[i + 1],
      param = l;
     for(;;){
      if(param){
       var k = param[1], next = param[3];
       if(! caml_call2(H[1], k, key)){param = next; continue;}
       param[1] = key;
       param[2] = data;
       var a = 0;
      }
      else
       var a = 1;
      if(a){
       caml_check_bound(h[2], i)[i + 1] = [0, key, data, l];
       h[1] = h[1] + 1 | 0;
       var b = h[2].length - 1 << 1 < h[1] ? 1 : 0;
       if(b) return resize(key_index, h);
       var c = b;
      }
      else
       var c = a;
      return c;
     }
    }
    function mem(h, key){
     var b = key_index(h, key), param = caml_check_bound(h[2], b)[b + 1];
     for(;;){
      if(! param) return 0;
      var k = param[1], next = param[3], a = caml_call2(H[1], k, key);
      if(a) return a;
      param = next;
     }
    }
    function add_seq(tbl, i){
     return Stdlib_Seq[4].call
             (null,
              function(param){
               var v = param[2], k = param[1];
               return add(tbl, k, v);
              },
              i);
    }
    function replace_seq(tbl, i){
     return Stdlib_Seq[4].call
             (null,
              function(param){
               var v = param[2], k = param[1];
               return replace(tbl, k, v);
              },
              i);
    }
    function of_seq(i){
     var tbl = create(0, 16);
     replace_seq(tbl, i);
     return tbl;
    }
    return [0,
            create,
            clear,
            reset,
            copy,
            add,
            remove,
            find,
            find_opt,
            find_all,
            replace,
            mem,
            iter,
            filter_map_inplace,
            fold,
            length,
            stats,
            to_seq,
            to_seq_keys,
            to_seq_values,
            add_seq,
            replace_seq,
            of_seq];
   }
   var a = [0, 0];
   function Make(H){
    var equal = H[1];
    function seeded_hash(seed, x){return caml_call1(H[2], x);}
    var
     include = MakeSeeded([0, equal, seeded_hash]),
     b = include[1],
     clear = include[2],
     reset = include[3],
     copy = include[4],
     add = include[5],
     remove = include[6],
     find = include[7],
     find_opt = include[8],
     find_all = include[9],
     replace = include[10],
     mem = include[11],
     iter = include[12],
     filter_map_inplace = include[13],
     fold = include[14],
     length = include[15],
     stats = include[16],
     to_seq = include[17],
     to_seq_keys = include[18],
     to_seq_values = include[19],
     add_seq = include[20],
     replace_seq = include[21];
    function create(sz){return caml_call2(b, a, sz);}
    function of_seq(i){
     var tbl = caml_call2(b, a, 16);
     caml_call2(replace_seq, tbl, i);
     return tbl;
    }
    return [0,
            create,
            clear,
            reset,
            copy,
            add,
            remove,
            find,
            find_opt,
            find_all,
            replace,
            mem,
            iter,
            filter_map_inplace,
            fold,
            length,
            stats,
            to_seq,
            to_seq_keys,
            to_seq_values,
            add_seq,
            replace_seq,
            of_seq];
   }
   function hash(x){return caml_hash(10, 100, 0, x);}
   function hash_param(n1, n2, x){return caml_hash(n1, n2, 0, x);}
   function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);}
   function key_index(h, key){
    return 4 <= h.length - 1
            ? caml_hash(10, 100, h[3], key) & (h[2].length - 2 | 0)
            : Stdlib[1].call(null, "Hashtbl: unsupported hash table format");
   }
   function add(h, key, data){
    var
     i = key_index(h, key),
     bucket = [0, key, data, caml_check_bound(h[2], i)[i + 1]];
    caml_check_bound(h[2], i)[i + 1] = bucket;
    h[1] = h[1] + 1 | 0;
    var a = h[2].length - 1 << 1 < h[1] ? 1 : 0;
    return a ? resize(key_index, h) : a;
   }
   function remove(h, key){
    var
     i = key_index(h, key),
     prec$1 = caml_check_bound(h[2], i)[i + 1],
     prec$0 = 0,
     prec = prec$1;
    for(;;){
     if(! prec) return 0;
     var k = prec[1], next = prec[3];
     if(0 === caml_compare(k, key)){
      h[1] = h[1] - 1 | 0;
      return prec$0
              ? (prec$0[3] = next, 0)
              : (caml_check_bound(h[2], i)[i + 1] = next, 0);
     }
     prec$0 = prec;
     prec = next;
    }
   }
   function find(h, key){
    var a = key_index(h, key), match = caml_check_bound(h[2], a)[a + 1];
    if(! match) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
    var k1 = match[1], d1 = match[2], next1 = match[3];
    if(0 === caml_compare(key, k1)) return d1;
    if(! next1) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
    var k2 = next1[1], d2 = next1[2], next2 = next1[3];
    if(0 === caml_compare(key, k2)) return d2;
    if(! next2) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
    var k3 = next2[1], d3 = next2[2], next3 = next2[3];
    if(0 === caml_compare(key, k3)) return d3;
    var param = next3;
    for(;;){
     if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
     var k = param[1], data = param[2], next = param[3];
     if(0 === caml_compare(key, k)) return data;
     param = next;
    }
   }
   function find_opt(h, key){
    var a = key_index(h, key), match = caml_check_bound(h[2], a)[a + 1];
    if(! match) return 0;
    var k1 = match[1], d1 = match[2], next1 = match[3];
    if(0 === caml_compare(key, k1)) return [0, d1];
    if(! next1) return 0;
    var k2 = next1[1], d2 = next1[2], next2 = next1[3];
    if(0 === caml_compare(key, k2)) return [0, d2];
    if(! next2) return 0;
    var k3 = next2[1], d3 = next2[2], next3 = next2[3];
    if(0 === caml_compare(key, k3)) return [0, d3];
    var param = next3;
    for(;;){
     if(! param) return 0;
     var k = param[1], data = param[2], next = param[3];
     if(0 === caml_compare(key, k)) return [0, data];
     param = next;
    }
   }
   function find_all(h, key){
    var a = key_index(h, key), param = caml_check_bound(h[2], a)[a + 1];
    for(;;){
     if(! param) return 0;
     var k = param[1], data = param[2], next = param[3];
     if(0 === caml_compare(k, key)) break;
     param = next;
    }
    var block = [0, data, 24029], dst = block, offset = 1, param$0 = next;
    for(;;){
     if(! param$0){dst[offset + 1] = 0; return block;}
     var k$0 = param$0[1], data$0 = param$0[2], next$0 = param$0[3];
     if(0 === caml_compare(k$0, key)){
      var dst$0 = [0, data$0, 24029];
      dst[offset + 1] = dst$0;
      dst = dst$0;
      offset = 1;
      param$0 = next$0;
     }
     else
      param$0 = next$0;
    }
   }
   function replace(h, key, data){
    var
     i = key_index(h, key),
     l = caml_check_bound(h[2], i)[i + 1],
     param = l;
    for(;;){
     if(param){
      var k = param[1], next = param[3];
      if(0 !== caml_compare(k, key)){param = next; continue;}
      param[1] = key;
      param[2] = data;
      var a = 0;
     }
     else
      var a = 1;
     if(a){
      caml_check_bound(h[2], i)[i + 1] = [0, key, data, l];
      h[1] = h[1] + 1 | 0;
      var b = h[2].length - 1 << 1 < h[1] ? 1 : 0;
      if(b) return resize(key_index, h);
      var c = b;
     }
     else
      var c = a;
     return c;
    }
   }
   function mem(h, key){
    var b = key_index(h, key), param = caml_check_bound(h[2], b)[b + 1];
    for(;;){
     if(! param) return 0;
     var
      k = param[1],
      next = param[3],
      a = 0 === caml_compare(k, key) ? 1 : 0;
     if(a) return a;
     param = next;
    }
   }
   function add_seq(tbl, i){
    return Stdlib_Seq[4].call
            (null,
             function(param){
              var v = param[2], k = param[1];
              return add(tbl, k, v);
             },
             i);
   }
   function replace_seq(tbl, i){
    return Stdlib_Seq[4].call
            (null,
             function(param){
              var v = param[2], k = param[1];
              return replace(tbl, k, v);
             },
             i);
   }
   function of_seq(i){
    var tbl = create(0, 16);
    replace_seq(tbl, i);
    return tbl;
   }
   function rebuild(opt, h){
    var
     random = opt ? opt[1] : Stdlib_Atomic[3].call(null, randomized),
     s = power_2_above(16, h[2].length - 1);
    if(random)
     var
      a = caml_call1(Stdlib_Domain[10][2], prng_key),
      seed = caml_call1(Stdlib_Random[19][4], a);
    else
     var seed = 4 <= h.length - 1 ? h[3] : 0;
    var
     b = 4 <= h.length - 1 ? h[4] : s,
     h$0 = [0, h[1], caml_make_vect(s, 0), seed, b];
    insert_all_buckets
     (function(a){return key_index(h$0, a);}, 0, h[2], h$0[2]);
    return h$0;
   }
   runtime.caml_register_global
    (16,
     [0,
      create,
      clear,
      reset,
      copy,
      add,
      find,
      find_opt,
      find_all,
      mem,
      remove,
      replace,
      iter,
      filter_map_inplace,
      fold,
      length,
      randomize,
      is_randomized,
      rebuild,
      stats,
      to_seq,
      to_seq_keys,
      to_seq_values,
      add_seq,
      replace_seq,
      of_seq,
      Make,
      MakeSeeded,
      hash,
      seeded_hash,
      hash_param,
      caml_hash],
     "Stdlib__Hashtbl");
   return;
  }
  (globalThis));

//# 20272 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Format:[F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(3),F(2),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2)*,F(2),F(1),F(2),F(1),F(3),F(2),F(3),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),N,F(2),F(1),F(2)*,F(1),F(2),F(1),F(2)*,F(1),F(1)*,F(3),F(2),F(3),F(2),F(2),F(1),F(2)*,F(1),F(2),F(1),F(2)*,F(1),F(2)*,F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(3),F(2),F(2),F(1),F(2)*,F(1),N,F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2)*,F(1),F(2)*,F(1),F(2),F(1),F(3),F(2),F(2)*,F(1),F(2),F(1),F(2)*,F(1),F(2),F(1),F(2)*,F(1),F(1),F(1),N,F(1),N,F(1),F(1),N,F(1),N,F(1),F(1),F(2),F(2),F(1),F(1)*,F(1),F(1),F(1),F(2),F(1),F(5),F(4),F(4),F(4),F(2),F(4),F(4),F(4),F(1)*->F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(3),F(2),F(3),F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Stdlib_Queue = global_data.Stdlib__Queue,
    CamlinternalFormat = global_data.CamlinternalFormat,
    Stdlib = global_data.Stdlib,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Domain = global_data.Stdlib__Domain,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_Stack = global_data.Stdlib__Stack,
    Stdlib_Int = global_data.Stdlib__Int,
    Stdlib_Bytes = global_data.Stdlib__Bytes;
   function id(x){return x;}
   var
    String_tag =
      [248, "Stdlib.Format.String_tag", runtime.caml_fresh_oo_id(0)];
   function pp_enqueue(state, token){
    state[13] = state[13] + token[3] | 0;
    return Stdlib_Queue[3].call(null, token, state[28]);
   }
   function pp_output_string(state, s){
    return caml_call3(state[17], s, 0, caml_ml_string_length(s));
   }
   function pp_output_newline(state){return caml_call1(state[19], 0);}
   function format_pp_text(state, size, text){
    state[9] = state[9] - size | 0;
    pp_output_string(state, text);
    state[11] = 0;
   }
   var cst$0 = "";
   function format_string(state, s){
    var a = s !== cst$0 ? 1 : 0;
    return a ? format_pp_text(state, caml_ml_string_length(s), s) : a;
   }
   function break_new_line(state, param, width){
    var after = param[3], offset = param[2], before = param[1];
    format_string(state, before);
    pp_output_newline(state);
    state[11] = 1;
    var
     indent = (state[6] - width | 0) + offset | 0,
     real_indent = Stdlib_Int[10].call(null, state[8], indent);
    state[10] = real_indent;
    state[9] = state[6] - state[10] | 0;
    var n = state[10];
    caml_call1(state[21], n);
    return format_string(state, after);
   }
   function break_same_line(state, param){
    var after = param[3], width = param[2], before = param[1];
    format_string(state, before);
    state[9] = state[9] - width | 0;
    caml_call1(state[20], width);
    return format_string(state, after);
   }
   var a = [0, cst$0, 0, cst$0];
   function format_pp_token(state, size$0, param){
    if(typeof param === "number")
     switch(param){
       case 0:
        var match$3 = Stdlib_Stack[8].call(null, state[3]);
        if(! match$3) return;
        var
         tabs = match$3[1][1],
         add_tab =
           function(n, ls){
            if(! ls) return [0, n, 0];
            var l = ls[2], x = ls[1];
            return runtime.caml_lessthan(n, x)
                    ? [0, n, ls]
                    : [0, x, add_tab(n, l)];
           };
        tabs[1] = add_tab(state[6] - state[9] | 0, tabs[1]);
        return;
       case 1:
        Stdlib_Stack[5].call(null, state[2]); return;
       case 2:
        Stdlib_Stack[5].call(null, state[3]); return;
       case 3:
        var match$4 = Stdlib_Stack[8].call(null, state[2]);
        if(! match$4) return pp_output_newline(state);
        var width$0 = match$4[1][2];
        return break_new_line(state, a, width$0);
       case 4:
        var b = state[10] !== (state[6] - state[9] | 0) ? 1 : 0;
        if(! b) return b;
        var match$1 = Stdlib_Queue[6].call(null, state[28]);
        if(! match$1) return;
        var match$2 = match$1[1], size = match$2[1], length = match$2[3];
        state[12] = state[12] - length | 0;
        state[9] = state[9] + size | 0;
        return;
       default:
        var match$5 = Stdlib_Stack[5].call(null, state[5]);
        if(! match$5) return;
        var tag_name = match$5[1], marker = caml_call1(state[25], tag_name);
        return pp_output_string(state, marker);
     }
    switch(param[0]){
      case 0:
       var s = param[1]; return format_pp_text(state, size$0, s);
      case 1:
       var
        breaks = param[2],
        fits = param[1],
        off = breaks[2],
        before = breaks[1],
        match$6 = Stdlib_Stack[8].call(null, state[2]);
       if(! match$6) return;
       var
        match$7 = match$6[1],
        width$1 = match$7[2],
        box_type$0 = match$7[1];
       switch(box_type$0){
         case 3:
          return state[9] < (size$0 + caml_ml_string_length(before) | 0)
                  ? break_new_line(state, breaks, width$1)
                  : break_same_line(state, fits);
         case 4:
          return state[11]
                  ? break_same_line(state, fits)
                  : state
                     [9]
                    < (size$0 + caml_ml_string_length(before) | 0)
                    ? break_new_line(state, breaks, width$1)
                    : ((state
                       [6]
                      - width$1
                      | 0)
                      + off
                      | 0)
                      < state[10]
                      ? break_new_line(state, breaks, width$1)
                      : break_same_line(state, fits);
         case 0:
         case 5:
          return break_same_line(state, fits);
         default: return break_new_line(state, breaks, width$1);
       }
      case 2:
       var
        off$0 = param[2],
        n = param[1],
        insertion_point = state[6] - state[9] | 0,
        match$8 = Stdlib_Stack[8].call(null, state[3]);
       if(! match$8) return;
       var tabs$0 = match$8[1][1], match$9 = tabs$0[1];
       if(match$9){
        var first = match$9[1], param$0 = tabs$0[1];
        for(;;){
         if(! param$0){var tab = first; break;}
         var tail = param$0[2], head = param$0[1];
         if(insertion_point <= head){var tab = head; break;}
         param$0 = tail;
        }
       }
       else
        var tab = insertion_point;
       var offset = tab - insertion_point | 0;
       return 0 <= offset
               ? break_same_line(state, [0, cst$0, offset + n | 0, cst$0])
               : break_new_line
                 (state, [0, cst$0, tab + off$0 | 0, cst$0], state[6]);
      case 3:
       var
        ty = param[2],
        off$1 = param[1],
        insertion_point$0 = state[6] - state[9] | 0;
       if(state[8] < insertion_point$0){
        var match = Stdlib_Stack[8].call(null, state[2]);
        if(match){
         var match$0 = match[1], width = match$0[2], box_type = match$0[1];
         if(state[9] < width && 3 >= box_type - 1 >>> 0)
          break_new_line(state, a, width);
        }
        else
         pp_output_newline(state);
       }
       var
        width$2 = state[9] - off$1 | 0,
        box_type$1 = 1 === ty ? 1 : state[9] < size$0 ? ty : 5;
       return Stdlib_Stack[3].call(null, [0, box_type$1, width$2], state[2]);
      case 4:
       var tbox = param[1]; return Stdlib_Stack[3].call(null, tbox, state[3]);
      default:
       var
        tag_name$0 = param[1],
        marker$0 = caml_call1(state[24], tag_name$0);
       pp_output_string(state, marker$0);
       return Stdlib_Stack[3].call(null, tag_name$0, state[5]);
    }
   }
   var pp_infinity = 1000000010;
   function advance_left(state){
    for(;;){
     var match = Stdlib_Queue[9].call(null, state[28]);
     if(! match) return 0;
     var
      match$0 = match[1],
      size = match$0[1],
      length = match$0[3],
      token = match$0[2],
      pending_count = state[13] - state[12] | 0,
      b = 0 <= size ? 1 : 0,
      a = b || (state[9] <= pending_count ? 1 : 0);
     if(! a) return a;
     Stdlib_Queue[5].call(null, state[28]);
     var size$0 = 0 <= size ? size : pp_infinity;
     format_pp_token(state, size$0, token);
     state[12] = length + state[12] | 0;
    }
   }
   function enqueue_advance(state, tok){
    pp_enqueue(state, tok);
    return advance_left(state);
   }
   function enqueue_string_as(state, size, s){
    return enqueue_advance(state, [0, size, [0, s], size]);
   }
   var unknown = -1, b = [0, cst$0];
   function initialize_scan_stack(stack){
    Stdlib_Stack[9].call(null, stack);
    return Stdlib_Stack[3].call(null, [0, -1, [0, unknown, b, 0]], stack);
   }
   function set_size(state, ty){
    var match = Stdlib_Stack[8].call(null, state[1]);
    if(! match) return;
    var
     match$0 = match[1],
     queue_elem = match$0[2],
     left_total = match$0[1],
     size = queue_elem[1];
    if(left_total < state[12]) return initialize_scan_stack(state[1]);
    var match$1 = queue_elem[2];
    if(typeof match$1 !== "number")
     switch(match$1[0]){
       case 3:
        if(1 - ty){
         var x$0 = state[13] + size | 0;
         queue_elem[1] = x$0;
         Stdlib_Stack[5].call(null, state[1]);
        }
        return;
       case 1:
       case 2:
        if(ty){
         var x = state[13] + size | 0;
         queue_elem[1] = x;
         Stdlib_Stack[5].call(null, state[1]);
        }
        return;
     }
   }
   function scan_push(state, b, token){
    pp_enqueue(state, token);
    if(b) set_size(state, 1);
    var elem = [0, state[13], token];
    return Stdlib_Stack[3].call(null, elem, state[1]);
   }
   function pp_open_box_gen(state, indent, br_ty){
    state[14] = state[14] + 1 | 0;
    if(state[14] < state[15]){
     var size = - state[13] | 0, elem = [0, size, [3, indent, br_ty], 0];
     return scan_push(state, 0, elem);
    }
    var a = state[14] === state[15] ? 1 : 0;
    if(! a) return a;
    var s = state[16], x = caml_ml_string_length(s);
    return enqueue_string_as(state, x, s);
   }
   var zero = 0;
   function pp_close_box(state, param){
    var a = 1 < state[14] ? 1 : 0;
    if(a){
     if(state[14] < state[15]){
      pp_enqueue(state, [0, zero, 1, 0]);
      set_size(state, 1);
      set_size(state, 0);
     }
     state[14] = state[14] - 1 | 0;
     var b = 0;
    }
    else
     var b = a;
    return b;
   }
   function pp_open_stag(state, tag_name){
    if(state[22]){
     Stdlib_Stack[3].call(null, tag_name, state[4]);
     caml_call1(state[26], tag_name);
    }
    var a = state[23];
    if(! a) return a;
    var token = [5, tag_name];
    return pp_enqueue(state, [0, zero, token, 0]);
   }
   function pp_close_stag(state, param){
    if(state[23]) pp_enqueue(state, [0, zero, 5, 0]);
    var a = state[22];
    if(a){
     var match = Stdlib_Stack[5].call(null, state[4]);
     if(match){
      var tag_name = match[1];
      return caml_call1(state[27], tag_name);
     }
     var b = 0;
    }
    else
     var b = a;
    return b;
   }
   function pp_set_print_tags(state, b){state[22] = b; return 0;}
   function pp_set_mark_tags(state, b){state[23] = b; return 0;}
   function pp_get_print_tags(state, param){return state[22];}
   function pp_get_mark_tags(state, param){return state[23];}
   function pp_set_tags(state, b){
    pp_set_print_tags(state, b);
    return pp_set_mark_tags(state, b);
   }
   function pp_get_formatter_stag_function(state, param){
    return [0, state[24], state[25], state[26], state[27]];
   }
   function pp_set_formatter_stag_function(state, param){
    var pct = param[4], pot = param[3], mct = param[2], mot = param[1];
    state[24] = mot;
    state[25] = mct;
    state[26] = pot;
    state[27] = pct;
    return 0;
   }
   function pp_rinit(state){
    state[12] = 1;
    state[13] = 1;
    Stdlib_Queue[11].call(null, state[28]);
    initialize_scan_stack(state[1]);
    Stdlib_Stack[9].call(null, state[2]);
    Stdlib_Stack[9].call(null, state[3]);
    Stdlib_Stack[9].call(null, state[4]);
    Stdlib_Stack[9].call(null, state[5]);
    state[10] = 0;
    state[14] = 0;
    state[9] = state[6];
    return pp_open_box_gen(state, 0, 3);
   }
   function pp_flush_queue(state, end_with_newline){
    Stdlib_Stack[13].call
     (null, function(param){return pp_close_stag(state, 0);}, state[4]);
    for(;;){
     if(1 >= state[14]){
      state[13] = pp_infinity;
      advance_left(state);
      if(end_with_newline) pp_output_newline(state);
      return pp_rinit(state);
     }
     pp_close_box(state, 0);
    }
   }
   function pp_print_as_size(state, size, s){
    var a = state[14] < state[15] ? 1 : 0;
    return a ? enqueue_string_as(state, size, s) : a;
   }
   function pp_print_as(state, isize, s){
    return pp_print_as_size(state, isize, s);
   }
   function pp_print_string(state, s){
    var isize = caml_ml_string_length(s);
    return pp_print_as_size(state, isize, s);
   }
   function pp_print_bytes(state, s){
    var
     s$0 = Stdlib_Bytes[6].call(null, s),
     isize = runtime.caml_ml_bytes_length(s);
    return pp_print_as_size(state, isize, s$0);
   }
   function pp_print_int(state, i){
    return pp_print_string(state, Stdlib_Int[12].call(null, i));
   }
   function pp_print_float(state, f){
    return pp_print_string(state, Stdlib[35].call(null, f));
   }
   function pp_print_bool(state, b){
    return pp_print_string(state, Stdlib[30].call(null, b));
   }
   function pp_print_char(state, c){
    var s = Stdlib_String[1].call(null, 1, c);
    return pp_print_as_size(state, 1, s);
   }
   function pp_print_nothing(state, param){return 0;}
   function pp_open_hbox(state, param){return pp_open_box_gen(state, 0, 0);}
   function pp_open_vbox(state, indent){
    return pp_open_box_gen(state, indent, 1);
   }
   function pp_open_hvbox(state, indent){
    return pp_open_box_gen(state, indent, 2);
   }
   function pp_open_hovbox(state, indent){
    return pp_open_box_gen(state, indent, 3);
   }
   function pp_open_box(state, indent){
    return pp_open_box_gen(state, indent, 4);
   }
   function pp_print_newline(state, param){
    pp_flush_queue(state, 1);
    return caml_call1(state[18], 0);
   }
   function pp_print_flush(state, param){
    pp_flush_queue(state, 0);
    return caml_call1(state[18], 0);
   }
   function pp_force_newline(state, param){
    var a = state[14] < state[15] ? 1 : 0;
    return a ? enqueue_advance(state, [0, zero, 3, 0]) : a;
   }
   function pp_print_if_newline(state, param){
    var a = state[14] < state[15] ? 1 : 0;
    return a ? enqueue_advance(state, [0, zero, 4, 0]) : a;
   }
   function pp_print_custom_break(state, fits, breaks){
    var
     after = fits[3],
     width = fits[2],
     before = fits[1],
     a = state[14] < state[15] ? 1 : 0;
    if(! a) return a;
    var
     size = - state[13] | 0,
     token = [1, fits, breaks],
     length =
       (caml_ml_string_length(before) + width | 0)
       + caml_ml_string_length(after)
       | 0;
    return scan_push(state, 1, [0, size, token, length]);
   }
   function pp_print_break(state, width, offset){
    return pp_print_custom_break
            (state, [0, cst$0, width, cst$0], [0, cst$0, offset, cst$0]);
   }
   function pp_print_space(state, param){return pp_print_break(state, 1, 0);}
   function pp_print_cut(state, param){return pp_print_break(state, 0, 0);}
   function pp_open_tbox(state, param){
    state[14] = state[14] + 1 | 0;
    var a = state[14] < state[15] ? 1 : 0;
    if(! a) return a;
    return enqueue_advance(state, [0, zero, [4, [0, [0, 0]]], 0]);
   }
   function pp_close_tbox(state, param){
    var b = 1 < state[14] ? 1 : 0;
    if(b){
     var c = state[14] < state[15] ? 1 : 0;
     if(c){
      enqueue_advance(state, [0, zero, 2, 0]);
      state[14] = state[14] - 1 | 0;
      var a = 0;
     }
     else
      var a = c;
    }
    else
     var a = b;
    return a;
   }
   function pp_print_tbreak(state, width, offset){
    var a = state[14] < state[15] ? 1 : 0;
    if(! a) return a;
    var size = - state[13] | 0, elem = [0, size, [2, width, offset], width];
    return scan_push(state, 1, elem);
   }
   function pp_print_tab(state, param){return pp_print_tbreak(state, 0, 0);}
   function pp_set_tab(state, param){
    var a = state[14] < state[15] ? 1 : 0;
    if(! a) return a;
    return enqueue_advance(state, [0, zero, 0, 0]);
   }
   function pp_set_max_boxes(state, n){
    var a = 1 < n ? 1 : 0, b = a ? (state[15] = n, 0) : a;
    return b;
   }
   function pp_get_max_boxes(state, param){return state[15];}
   function pp_over_max_boxes(state, param){return state[14] === state[15] ? 1 : 0;
   }
   function pp_set_ellipsis_text(state, s){state[16] = s; return 0;}
   function pp_get_ellipsis_text(state, param){return state[16];}
   function pp_limit(n){return n < 1000000010 ? n : 1000000009;}
   function pp_set_max_indent(state, n$0){
    var b = 1 < n$0 ? 1 : 0;
    if(! b) return b;
    var n$1 = state[6] - n$0 | 0, a = 1 <= n$1 ? 1 : 0;
    if(! a) return a;
    var n = pp_limit(n$1);
    state[7] = n;
    state[8] = state[6] - state[7] | 0;
    return pp_rinit(state);
   }
   function pp_get_max_indent(state, param){return state[8];}
   function pp_set_margin(state, n){
    var a = 1 <= n ? 1 : 0;
    if(! a) return a;
    var n$0 = pp_limit(n);
    state[6] = n$0;
    if(state[8] <= state[6])
     var new_max_indent = state[8];
    else
     var
      b = Stdlib_Int[11].call(null, state[6] - state[7] | 0, state[6] / 2 | 0),
      new_max_indent = Stdlib_Int[11].call(null, b, 1);
    return pp_set_max_indent(state, new_max_indent);
   }
   var
    c = [1, "margin <= max_indent"],
    d = [1, "margin >= pp_infinity"],
    e = [0, 0],
    f = [1, "max_indent < 2"];
   function validate_geometry(param){
    var margin = param[2], max_indent = param[1];
    return 2 <= max_indent
            ? margin <= max_indent ? c : 1000000010 <= margin ? d : e
            : f;
   }
   function check_geometry(geometry){
    return 0 === validate_geometry(geometry)[0] ? 1 : 0;
   }
   function pp_get_margin(state, param){return state[6];}
   function pp_set_full_geometry(state, param){
    var margin = param[2], max_indent = param[1];
    pp_set_margin(state, margin);
    pp_set_max_indent(state, max_indent);
    return 0;
   }
   function pp_set_geometry(state, max_indent, margin){
    var
     geometry = [0, max_indent, margin],
     match = validate_geometry(geometry);
    if(0 === match[0]) return pp_set_full_geometry(state, geometry);
    var
     msg = match[1],
     a = Stdlib[28].call(null, "Format.pp_set_geometry: ", msg);
    throw caml_maybe_attach_backtrace([0, Stdlib[6], a], 1);
   }
   function pp_safe_set_geometry(state, max_indent, margin){
    var geometry = [0, max_indent, margin];
    return 0 === validate_geometry(geometry)[0]
            ? pp_set_full_geometry(state, geometry)
            : 0;
   }
   function pp_get_geometry(state, param){return [0, state[8], state[6]];}
   function pp_update_geometry(state, update){
    var geometry = pp_get_geometry(state, 0);
    return pp_set_full_geometry(state, caml_call1(update, geometry));
   }
   function pp_set_formatter_out_functions(state, param){
    var j = param[5], i = param[4], h = param[3], g = param[2], f = param[1];
    state[17] = f;
    state[18] = g;
    state[19] = h;
    state[20] = i;
    state[21] = j;
    return 0;
   }
   function pp_get_formatter_out_functions(state, param){
    return [0, state[17], state[18], state[19], state[20], state[21]];
   }
   function pp_set_formatter_output_functi(state, f, g){state[17] = f; state[18] = g; return 0;
   }
   function pp_get_formatter_output_functi(state, param){return [0, state[17], state[18]];
   }
   function display_newline(state, param){
    return caml_call3(state[17], "\n", 0, 1);
   }
   var blank_line = Stdlib_String[1].call(null, 80, 32);
   function display_blanks(state, n$1){
    var n = n$1;
    for(;;){
     var a = 0 < n ? 1 : 0;
     if(! a) return a;
     if(80 >= n) return caml_call3(state[17], blank_line, 0, n);
     caml_call3(state[17], blank_line, 0, 80);
     var n$0 = n - 80 | 0;
     n = n$0;
    }
   }
   function pp_set_formatter_out_channel(state, oc){
    var a = Stdlib[69];
    state[17] = function(b, c, d){return a(oc, b, c, d);};
    state[18] = function(param){return Stdlib[63].call(null, oc);};
    state[19] = function(a){return display_newline(state, a);};
    state[20] = function(a){return display_blanks(state, a);};
    state[21] = function(a){return display_blanks(state, a);};
    return 0;
   }
   var cst = ">";
   function default_pp_mark_open_tag(param){
    if(param[1] !== String_tag) return cst$0;
    var s = param[2], a = Stdlib[28].call(null, s, cst);
    return Stdlib[28].call(null, "<", a);
   }
   function default_pp_mark_close_tag(param){
    if(param[1] !== String_tag) return cst$0;
    var s = param[2], a = Stdlib[28].call(null, s, cst);
    return Stdlib[28].call(null, "<\/", a);
   }
   function default_pp_print_open_tag(a){return 0;}
   function default_pp_print_close_tag(a){return 0;}
   var g = [3, 0, 3];
   function pp_make_formatter(f, g$0, h, i, j){
    var
     pp_queue = Stdlib_Queue[2].call(null, 0),
     sys_tok = [0, unknown, g, 0];
    Stdlib_Queue[3].call(null, sys_tok, pp_queue);
    var scan_stack = Stdlib_Stack[2].call(null, 0);
    initialize_scan_stack(scan_stack);
    Stdlib_Stack[3].call(null, [0, 1, sys_tok], scan_stack);
    var
     a = Stdlib[19],
     b = Stdlib_Stack[2].call(null, 0),
     c = Stdlib_Stack[2].call(null, 0),
     d = Stdlib_Stack[2].call(null, 0),
     pp_margin = 78;
    return [0,
            scan_stack,
            Stdlib_Stack[2].call(null, 0),
            d,
            c,
            b,
            pp_margin,
            10,
            68,
            pp_margin,
            0,
            1,
            1,
            1,
            1,
            a,
            ".",
            f,
            g$0,
            h,
            i,
            j,
            0,
            0,
            default_pp_mark_open_tag,
            default_pp_mark_close_tag,
            default_pp_print_open_tag,
            default_pp_print_close_tag,
            pp_queue];
   }
   function formatter_of_out_functions(out_funs){
    return pp_make_formatter
            (out_funs[1], out_funs[2], out_funs[3], out_funs[4], out_funs[5]);
   }
   function make_formatter(output, flush){
    var
     ppf =
       pp_make_formatter
        (output,
         flush,
         function(a){return 0;},
         function(a){return 0;},
         function(a){return 0;});
    ppf[19] = function(a){return display_newline(ppf, a);};
    ppf[20] = function(a){return display_blanks(ppf, a);};
    ppf[21] = function(a){return display_blanks(ppf, a);};
    return ppf;
   }
   function formatter_of_out_channel(oc){
    var a = Stdlib[69];
    return make_formatter
            (function(b, c, d){return a(oc, b, c, d);},
             function(param){return Stdlib[63].call(null, oc);});
   }
   function formatter_of_buffer(b){
    var a = Stdlib_Buffer[18];
    return make_formatter
            (function(c, d, e){return a(b, c, d, e);}, function(a){return 0;});
   }
   var pp_buffer_size = 512;
   function pp_make_buffer(param){
    return Stdlib_Buffer[1].call(null, pp_buffer_size);
   }
   var
    stdbuf = pp_make_buffer(0),
    std_formatter = formatter_of_out_channel(Stdlib[39]),
    err_formatter = formatter_of_out_channel(Stdlib[40]),
    str_formatter = formatter_of_buffer(stdbuf),
    stdbuf_key = caml_call2(Stdlib_Domain[10][1], 0, pp_make_buffer);
   caml_call2(Stdlib_Domain[10][3], stdbuf_key, stdbuf);
   var
    str_formatter_key =
      caml_call2
       (Stdlib_Domain[10][1],
        0,
        function(param){
         return formatter_of_buffer
                 (caml_call1(Stdlib_Domain[10][2], stdbuf_key));
        });
   caml_call2(Stdlib_Domain[10][3], str_formatter_key, str_formatter);
   function buffered_out_string(key, str, ofs, len){
    var a = caml_call1(Stdlib_Domain[10][2], key);
    return Stdlib_Buffer[18].call(null, a, str, ofs, len);
   }
   function buffered_out_flush(oc, key, param){
    var
     buf = caml_call1(Stdlib_Domain[10][2], key),
     len = Stdlib_Buffer[7].call(null, buf),
     str = Stdlib_Buffer[2].call(null, buf);
    Stdlib[69].call(null, oc, str, 0, len);
    Stdlib[63].call(null, oc);
    return Stdlib_Buffer[8].call(null, buf);
   }
   var
    std_buf_key =
      caml_call2
       (Stdlib_Domain[10][1],
        0,
        function(param){return Stdlib_Buffer[1].call(null, pp_buffer_size);}),
    err_buf_key =
      caml_call2
       (Stdlib_Domain[10][1],
        0,
        function(param){return Stdlib_Buffer[1].call(null, pp_buffer_size);}),
    std_formatter_key =
      caml_call2
       (Stdlib_Domain[10][1],
        0,
        function(param){
         var
          a = Stdlib[39],
          ppf =
            pp_make_formatter
             (function(a, b, c){
               return buffered_out_string(std_buf_key, a, b, c);
              },
              function(b){return buffered_out_flush(a, std_buf_key, b);},
              function(a){return 0;},
              function(a){return 0;},
              function(a){return 0;});
         ppf[19] = function(a){return display_newline(ppf, a);};
         ppf[20] = function(a){return display_blanks(ppf, a);};
         ppf[21] = function(a){return display_blanks(ppf, a);};
         Stdlib_Domain[6].call
          (null, function(a){return pp_print_flush(ppf, a);});
         return ppf;
        });
   caml_call2(Stdlib_Domain[10][3], std_formatter_key, std_formatter);
   var
    err_formatter_key =
      caml_call2
       (Stdlib_Domain[10][1],
        0,
        function(param){
         var
          a = Stdlib[40],
          ppf =
            pp_make_formatter
             (function(a, b, c){
               return buffered_out_string(err_buf_key, a, b, c);
              },
              function(b){return buffered_out_flush(a, err_buf_key, b);},
              function(a){return 0;},
              function(a){return 0;},
              function(a){return 0;});
         ppf[19] = function(a){return display_newline(ppf, a);};
         ppf[20] = function(a){return display_blanks(ppf, a);};
         ppf[21] = function(a){return display_blanks(ppf, a);};
         Stdlib_Domain[6].call
          (null, function(a){return pp_print_flush(ppf, a);});
         return ppf;
        });
   caml_call2(Stdlib_Domain[10][3], err_formatter_key, err_formatter);
   function get_std_formatter(param){
    return caml_call1(Stdlib_Domain[10][2], std_formatter_key);
   }
   function get_err_formatter(param){
    return caml_call1(Stdlib_Domain[10][2], err_formatter_key);
   }
   function get_str_formatter(param){
    return caml_call1(Stdlib_Domain[10][2], str_formatter_key);
   }
   function get_stdbuf(param){
    return caml_call1(Stdlib_Domain[10][2], stdbuf_key);
   }
   function flush_buffer_formatter(buf, ppf){
    pp_flush_queue(ppf, 0);
    var s = Stdlib_Buffer[2].call(null, buf);
    Stdlib_Buffer[9].call(null, buf);
    return s;
   }
   function flush_str_formatter(param){
    var
     stdbuf = caml_call1(Stdlib_Domain[10][2], stdbuf_key),
     str_formatter = caml_call1(Stdlib_Domain[10][2], str_formatter_key);
    return flush_buffer_formatter(stdbuf, str_formatter);
   }
   function make_synchronized_formatter(output, flush){
    return caml_call2
            (Stdlib_Domain[10][1],
             0,
             function(param){
              var
               buf = Stdlib_Buffer[1].call(null, pp_buffer_size),
               a = Stdlib_Buffer[18];
              function output$0(b, c, d){return a(buf, b, c, d);}
              function flush$0(param){
               var a = Stdlib_Buffer[7].call(null, buf);
               caml_call3(output, Stdlib_Buffer[2].call(null, buf), 0, a);
               Stdlib_Buffer[8].call(null, buf);
               return caml_call1(flush, 0);
              }
              return make_formatter(output$0, flush$0);
             });
   }
   function synchronized_formatter_of_out_(oc){
    var a = Stdlib[69];
    return make_synchronized_formatter
            (function(b, c, d){return a(oc, b, c, d);},
             function(param){return Stdlib[63].call(null, oc);});
   }
   function make_symbolic_output_buffer(param){return [0, 0];}
   function clear_symbolic_output_buffer(sob){sob[1] = 0; return 0;}
   function get_symbolic_output_buffer(sob){
    return Stdlib_List[10].call(null, sob[1]);
   }
   function flush_symbolic_output_buffer(sob){
    var items = get_symbolic_output_buffer(sob);
    clear_symbolic_output_buffer(sob);
    return items;
   }
   function add_symbolic_output_item(sob, item){sob[1] = [0, item, sob[1]]; return 0;
   }
   function formatter_of_symbolic_output_b(sob){
    function f(s, i, n){
     return add_symbolic_output_item
             (sob, [0, Stdlib_String[16].call(null, s, i, n)]);
    }
    function g(param){return add_symbolic_output_item(sob, 0);}
    function h(param){return add_symbolic_output_item(sob, 1);}
    function i(n){return add_symbolic_output_item(sob, [1, n]);}
    function j(n){return add_symbolic_output_item(sob, [2, n]);}
    return pp_make_formatter(f, g, h, i, j);
   }
   function open_hbox(v){
    return pp_open_hbox
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function open_vbox(v){
    return pp_open_vbox
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function open_hvbox(v){
    return pp_open_hvbox
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function open_hovbox(v){
    return pp_open_hovbox
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function open_box(v){
    return pp_open_box(caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function close_box(v){
    return pp_close_box
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function open_stag(v){
    return pp_open_stag
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function close_stag(v){
    return pp_close_stag
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_as(isize, w){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return pp_print_as_size(state, isize, w);
   }
   function print_string(v){
    return pp_print_string
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_bytes(v){
    return pp_print_bytes
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_int(v){
    return pp_print_int
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_float(v){
    return pp_print_float
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_char(v){
    return pp_print_char
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_bool(v){
    return pp_print_bool
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_break(v, w){
    return pp_print_break
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v, w);
   }
   function print_cut(v){
    return pp_print_cut
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_space(v){
    return pp_print_space
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function force_newline(v){
    return pp_force_newline
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_flush(v){
    return pp_print_flush
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_newline(v){
    return pp_print_newline
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_if_newline(v){
    return pp_print_if_newline
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function open_tbox(v){
    return pp_open_tbox
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function close_tbox(v){
    return pp_close_tbox
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_tbreak(v, w){
    return pp_print_tbreak
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v, w);
   }
   function set_tab(v){
    return pp_set_tab(caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function print_tab(v){
    return pp_print_tab
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_margin(v){
    return pp_set_margin
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_margin(v){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return state[6];
   }
   function set_max_indent(v){
    return pp_set_max_indent
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_max_indent(v){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return state[8];
   }
   function set_geometry(max_indent, margin){
    return pp_set_geometry
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key),
             max_indent,
             margin);
   }
   function safe_set_geometry(max_indent, margin){
    return pp_safe_set_geometry
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key),
             max_indent,
             margin);
   }
   function get_geometry(v){
    return pp_get_geometry
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function update_geometry(v){
    return pp_update_geometry
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_max_boxes(v){
    return pp_set_max_boxes
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_max_boxes(v){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return state[15];
   }
   function over_max_boxes(v){
    return pp_over_max_boxes
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_ellipsis_text(v){
    return pp_set_ellipsis_text
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_ellipsis_text(v){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return state[16];
   }
   function set_formatter_out_channel(v){
    return pp_set_formatter_out_channel
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_formatter_out_functions(v){
    return pp_set_formatter_out_functions
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_formatter_out_functions(v){
    return pp_get_formatter_out_functions
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_formatter_output_functions(v, w){
    return pp_set_formatter_output_functi
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v, w);
   }
   function get_formatter_output_functions(v){
    return pp_get_formatter_output_functi
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_formatter_stag_functions(v){
    return pp_set_formatter_stag_function
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_formatter_stag_functions(v){
    return pp_get_formatter_stag_function
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function set_print_tags(v){
    return pp_set_print_tags
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_print_tags(v){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return state[22];
   }
   function set_mark_tags(v){
    return pp_set_mark_tags
            (caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function get_mark_tags(v){
    var state = caml_call1(Stdlib_Domain[10][2], std_formatter_key);
    return state[23];
   }
   function set_tags(v){
    return pp_set_tags(caml_call1(Stdlib_Domain[10][2], std_formatter_key), v);
   }
   function pp_print_iter(opt, iter, pp_v, ppf, v){
    var pp_sep = opt ? opt[1] : pp_print_cut, is_first = [0, 1];
    function pp_v$0(v){
     if(is_first[1]) is_first[1] = 0; else caml_call2(pp_sep, ppf, 0);
     return caml_call2(pp_v, ppf, v);
    }
    return caml_call2(iter, pp_v$0, v);
   }
   function pp_print_list(opt, pp_v, ppf, v){
    var pp_sep = opt ? opt[1] : pp_print_cut;
    return pp_print_iter([0, pp_sep], Stdlib_List[18], pp_v, ppf, v);
   }
   function pp_print_array(opt, pp_v, ppf, v){
    var pp_sep = opt ? opt[1] : pp_print_cut;
    return pp_print_iter([0, pp_sep], Stdlib_Array[12], pp_v, ppf, v);
   }
   function pp_print_seq(opt, pp_v, ppf, seq){
    var pp_sep = opt ? opt[1] : pp_print_cut;
    return pp_print_iter([0, pp_sep], Stdlib_Seq[4], pp_v, ppf, seq);
   }
   function pp_print_text(ppf, s){
    var len = caml_ml_string_length(s), left = [0, 0], right = [0, 0];
    function flush(param){
     pp_print_string
      (ppf, Stdlib_String[16].call(null, s, left[1], right[1] - left[1] | 0));
     right[1]++;
     left[1] = right[1];
     return 0;
    }
    for(;;){
     if(right[1] === len){
      var a = left[1] !== len ? 1 : 0;
      return a ? flush(0) : a;
     }
     var match = runtime.caml_string_get(s, right[1]);
     if(10 === match){
      flush(0);
      pp_force_newline(ppf, 0);
     }
     else if(32 === match){flush(0); pp_print_space(ppf, 0);} else right[1]++;
    }
   }
   function pp_print_option(opt, pp_v, ppf, param){
    var none = opt ? opt[1] : function(a, param){return 0;};
    if(! param) return caml_call2(none, ppf, 0);
    var v = param[1];
    return caml_call2(pp_v, ppf, v);
   }
   function pp_print_result(ok, error, ppf, param){
    if(0 === param[0]){var v = param[1]; return caml_call2(ok, ppf, v);}
    var e = param[1];
    return caml_call2(error, ppf, e);
   }
   function pp_print_either(left, right, ppf, param){
    if(0 === param[0]){var l = param[1]; return caml_call2(left, ppf, l);}
    var r = param[1];
    return caml_call2(right, ppf, r);
   }
   function compute_tag(output, tag_acc){
    var buf = Stdlib_Buffer[1].call(null, 16), ppf = formatter_of_buffer(buf);
    caml_call2(output, ppf, tag_acc);
    pp_print_flush(ppf, 0);
    var len = Stdlib_Buffer[7].call(null, buf);
    return 2 <= len
            ? Stdlib_Buffer[4].call(null, buf, 1, len - 2 | 0)
            : Stdlib_Buffer[2].call(null, buf);
   }
   function output_formatting_lit(ppf, fmting_lit){
    if(typeof fmting_lit === "number")
     switch(fmting_lit){
       case 0:
        return pp_close_box(ppf, 0);
       case 1:
        return pp_close_stag(ppf, 0);
       case 2:
        return pp_print_flush(ppf, 0);
       case 3:
        return pp_force_newline(ppf, 0);
       case 4:
        return pp_print_newline(ppf, 0);
       case 5:
        return pp_print_char(ppf, 64);
       default: return pp_print_char(ppf, 37);
     }
    switch(fmting_lit[0]){
      case 0:
       var offset = fmting_lit[3], width = fmting_lit[2];
       return pp_print_break(ppf, width, offset);
      case 1:
       return 0;
      default:
       var c = fmting_lit[1];
       pp_print_char(ppf, 64);
       return pp_print_char(ppf, c);
    }
   }
   function output_acc(ppf, acc){
    if(typeof acc === "number") return 0;
    a:
    {
     b:
     {
      c:
      {
       switch(acc[0]){
         case 0:
          var f = acc[2], p = acc[1];
          output_acc(ppf, p);
          return output_formatting_lit(ppf, f);
         case 1:
          var match = acc[2], p$0 = acc[1];
          if(0 === match[0]){
           var acc$0 = match[1];
           output_acc(ppf, p$0);
           return pp_open_stag
                   (ppf, [0, String_tag, compute_tag(output_acc, acc$0)]);
          }
          var acc$1 = match[1];
          output_acc(ppf, p$0);
          var
           k = compute_tag(output_acc, acc$1),
           match$0 = CamlinternalFormat[20].call(null, k),
           bty = match$0[2],
           indent = match$0[1];
          return pp_open_box_gen(ppf, indent, bty);
         case 2:
          var a = acc[1];
          if(typeof a !== "number" && 0 === a[0]){
           var g = a[2];
           if(typeof g !== "number" && 1 === g[0]){
            var s$0 = acc[2], size = g[2], p$2 = a[1];
            break a;
           }
          }
          var s = acc[2], p$1 = a;
          break b;
         case 3:
          var b = acc[1];
          if(typeof b !== "number" && 0 === b[0]){
           var h = b[2];
           if(typeof h !== "number" && 1 === h[0]){
            var c$0 = acc[2], size$0 = h[2], p$4 = b[1];
            break c;
           }
          }
          var c = acc[2], p$3 = b;
          break;
         case 4:
          var d = acc[1];
          if(typeof d !== "number" && 0 === d[0]){
           var i = d[2];
           if(typeof i !== "number" && 1 === i[0]){
            var s$0 = acc[2], size = i[2], p$2 = d[1];
            break a;
           }
          }
          var s = acc[2], p$1 = d;
          break b;
         case 5:
          var e = acc[1];
          if(typeof e !== "number" && 0 === e[0]){
           var j = e[2];
           if(typeof j !== "number" && 1 === j[0]){
            var c$0 = acc[2], size$0 = j[2], p$4 = e[1];
            break c;
           }
          }
          var c = acc[2], p$3 = e;
          break;
         case 6:
          var f$0 = acc[2], p$5 = acc[1];
          output_acc(ppf, p$5);
          return caml_call1(f$0, ppf);
         case 7:
          var p$6 = acc[1];
          output_acc(ppf, p$6);
          return pp_print_flush(ppf, 0);
         default:
          var msg = acc[2], p$7 = acc[1];
          output_acc(ppf, p$7);
          return Stdlib[1].call(null, msg);
       }
       output_acc(ppf, p$3);
       return pp_print_char(ppf, c);
      }
      output_acc(ppf, p$4);
      return pp_print_as_size
              (ppf, size$0, Stdlib_String[1].call(null, 1, c$0));
     }
     output_acc(ppf, p$1);
     return pp_print_string(ppf, s);
    }
    output_acc(ppf, p$2);
    return pp_print_as_size(ppf, size, s$0);
   }
   function strput_acc(ppf, acc){
    if(typeof acc === "number") return 0;
    a:
    {
     b:
     {
      c:
      {
       switch(acc[0]){
         case 0:
          var f = acc[2], p = acc[1];
          strput_acc(ppf, p);
          return output_formatting_lit(ppf, f);
         case 1:
          var match = acc[2], p$0 = acc[1];
          if(0 === match[0]){
           var acc$0 = match[1];
           strput_acc(ppf, p$0);
           return pp_open_stag
                   (ppf, [0, String_tag, compute_tag(strput_acc, acc$0)]);
          }
          var acc$1 = match[1];
          strput_acc(ppf, p$0);
          var
           k = compute_tag(strput_acc, acc$1),
           match$0 = CamlinternalFormat[20].call(null, k),
           bty = match$0[2],
           indent = match$0[1];
          return pp_open_box_gen(ppf, indent, bty);
         case 2:
          var a = acc[1];
          if(typeof a !== "number" && 0 === a[0]){
           var g = a[2];
           if(typeof g !== "number" && 1 === g[0]){
            var s$0 = acc[2], size = g[2], p$2 = a[1];
            break a;
           }
          }
          var s = acc[2], p$1 = a;
          break b;
         case 3:
          var b = acc[1];
          if(typeof b !== "number" && 0 === b[0]){
           var h = b[2];
           if(typeof h !== "number" && 1 === h[0]){
            var c$0 = acc[2], size$0 = h[2], p$4 = b[1];
            break c;
           }
          }
          var c = acc[2], p$3 = b;
          break;
         case 4:
          var d = acc[1];
          if(typeof d !== "number" && 0 === d[0]){
           var i = d[2];
           if(typeof i !== "number" && 1 === i[0]){
            var s$0 = acc[2], size = i[2], p$2 = d[1];
            break a;
           }
          }
          var s = acc[2], p$1 = d;
          break b;
         case 5:
          var e = acc[1];
          if(typeof e !== "number" && 0 === e[0]){
           var j = e[2];
           if(typeof j !== "number" && 1 === j[0]){
            var c$0 = acc[2], size$0 = j[2], p$4 = e[1];
            break c;
           }
          }
          var c = acc[2], p$3 = e;
          break;
         case 6:
          var p$5 = acc[1];
          if(typeof p$5 !== "number" && 0 === p$5[0]){
           var match$1 = p$5[2];
           if(typeof match$1 !== "number" && 1 === match$1[0]){
            var f$1 = acc[2], size$1 = match$1[2], p$6 = p$5[1];
            strput_acc(ppf, p$6);
            return pp_print_as_size(ppf, size$1, caml_call1(f$1, 0));
           }
          }
          var f$0 = acc[2];
          strput_acc(ppf, p$5);
          return pp_print_string(ppf, caml_call1(f$0, 0));
         case 7:
          var p$7 = acc[1];
          strput_acc(ppf, p$7);
          return pp_print_flush(ppf, 0);
         default:
          var msg = acc[2], p$8 = acc[1];
          strput_acc(ppf, p$8);
          return Stdlib[1].call(null, msg);
       }
       strput_acc(ppf, p$3);
       return pp_print_char(ppf, c);
      }
      strput_acc(ppf, p$4);
      return pp_print_as_size
              (ppf, size$0, Stdlib_String[1].call(null, 1, c$0));
     }
     strput_acc(ppf, p$1);
     return pp_print_string(ppf, s);
    }
    strput_acc(ppf, p$2);
    return pp_print_as_size(ppf, size, s$0);
   }
   function kfprintf(k, ppf, param){
    var fmt = param[1];
    return CamlinternalFormat[7].call
            (null,
             function(acc){output_acc(ppf, acc); return caml_call1(k, ppf);},
             0,
             fmt);
   }
   function ikfprintf(k, ppf, param){
    var fmt = param[1];
    return CamlinternalFormat[8].call(null, k, ppf, fmt);
   }
   function ifprintf(ppf, param){
    var fmt = param[1];
    return CamlinternalFormat[8].call(null, function(a){return 0;}, 0, fmt);
   }
   function fprintf(ppf){
    function a(a){return 0;}
    return function(b){return kfprintf(a, ppf, b);};
   }
   function printf(param){
    var fmt = param[1];
    return CamlinternalFormat[7].call
            (null,
             function(acc){
              return output_acc
                      (caml_call1(Stdlib_Domain[10][2], std_formatter_key), acc);
             },
             0,
             fmt);
   }
   function eprintf(param){
    var fmt = param[1];
    return CamlinternalFormat[7].call
            (null,
             function(acc){
              return output_acc
                      (caml_call1(Stdlib_Domain[10][2], err_formatter_key), acc);
             },
             0,
             fmt);
   }
   function kdprintf(k, param){
    var fmt = param[1];
    return CamlinternalFormat[7].call
            (null,
             function(acc){
              return caml_call1
                      (k, function(ppf){return output_acc(ppf, acc);});
             },
             0,
             fmt);
   }
   function dprintf(fmt){return kdprintf(function(i){return i;}, fmt);}
   function ksprintf(k, param){
    var fmt = param[1], b = pp_make_buffer(0), ppf = formatter_of_buffer(b);
    function k$0(acc){
     strput_acc(ppf, acc);
     return caml_call1(k, flush_buffer_formatter(b, ppf));
    }
    return CamlinternalFormat[7].call(null, k$0, 0, fmt);
   }
   function sprintf(fmt){return ksprintf(id, fmt);}
   function kasprintf(k, param){
    var fmt = param[1], b = pp_make_buffer(0), ppf = formatter_of_buffer(b);
    function k$0(acc){
     output_acc(ppf, acc);
     return caml_call1(k, flush_buffer_formatter(b, ppf));
    }
    return CamlinternalFormat[7].call(null, k$0, 0, fmt);
   }
   function asprintf(fmt){return kasprintf(id, fmt);}
   function flush_standard_formatters(param){
    pp_print_flush(caml_call1(Stdlib_Domain[10][2], std_formatter_key), 0);
    return pp_print_flush
            (caml_call1(Stdlib_Domain[10][2], err_formatter_key), 0);
   }
   Stdlib[100].call(null, flush_standard_formatters);
   Stdlib_Domain[5].call
    (null,
     function(param){
      flush_standard_formatters(0);
      var
       fs = pp_get_formatter_out_functions(std_formatter, 0),
       a = Stdlib[39];
      pp_set_formatter_out_functions
       (std_formatter,
        [0,
         function(a, b, c){return buffered_out_string(std_buf_key, a, b, c);},
         function(b){return buffered_out_flush(a, std_buf_key, b);},
         fs[3],
         fs[4],
         fs[5]]);
      var
       fs$0 = pp_get_formatter_out_functions(err_formatter, 0),
       b = Stdlib[40];
      return pp_set_formatter_out_functions
              (err_formatter,
               [0,
                function(a, b, c){
                 return buffered_out_string(err_buf_key, a, b, c);
                },
                function(a){return buffered_out_flush(b, err_buf_key, a);},
                fs$0[3],
                fs$0[4],
                fs$0[5]]);
     });
   runtime.caml_register_global
    (38,
     [0,
      pp_open_box,
      open_box,
      pp_close_box,
      close_box,
      pp_open_hbox,
      open_hbox,
      pp_open_vbox,
      open_vbox,
      pp_open_hvbox,
      open_hvbox,
      pp_open_hovbox,
      open_hovbox,
      pp_print_string,
      print_string,
      pp_print_bytes,
      print_bytes,
      pp_print_as,
      print_as,
      pp_print_int,
      print_int,
      pp_print_float,
      print_float,
      pp_print_char,
      print_char,
      pp_print_bool,
      print_bool,
      pp_print_nothing,
      pp_print_space,
      print_space,
      pp_print_cut,
      print_cut,
      pp_print_break,
      print_break,
      pp_print_custom_break,
      pp_force_newline,
      force_newline,
      pp_print_if_newline,
      print_if_newline,
      pp_print_flush,
      print_flush,
      pp_print_newline,
      print_newline,
      pp_infinity,
      pp_set_margin,
      set_margin,
      pp_get_margin,
      get_margin,
      pp_set_max_indent,
      set_max_indent,
      pp_get_max_indent,
      get_max_indent,
      check_geometry,
      pp_set_geometry,
      set_geometry,
      pp_safe_set_geometry,
      safe_set_geometry,
      pp_update_geometry,
      update_geometry,
      pp_get_geometry,
      get_geometry,
      pp_set_max_boxes,
      set_max_boxes,
      pp_get_max_boxes,
      get_max_boxes,
      pp_over_max_boxes,
      over_max_boxes,
      pp_open_tbox,
      open_tbox,
      pp_close_tbox,
      close_tbox,
      pp_set_tab,
      set_tab,
      pp_print_tab,
      print_tab,
      pp_print_tbreak,
      print_tbreak,
      pp_set_ellipsis_text,
      set_ellipsis_text,
      pp_get_ellipsis_text,
      get_ellipsis_text,
      String_tag,
      pp_open_stag,
      open_stag,
      pp_close_stag,
      close_stag,
      pp_set_tags,
      set_tags,
      pp_set_print_tags,
      set_print_tags,
      pp_set_mark_tags,
      set_mark_tags,
      pp_get_print_tags,
      get_print_tags,
      pp_get_mark_tags,
      get_mark_tags,
      pp_set_formatter_out_channel,
      set_formatter_out_channel,
      pp_set_formatter_output_functi,
      set_formatter_output_functions,
      pp_get_formatter_output_functi,
      get_formatter_output_functions,
      pp_set_formatter_out_functions,
      set_formatter_out_functions,
      pp_get_formatter_out_functions,
      get_formatter_out_functions,
      pp_set_formatter_stag_function,
      set_formatter_stag_functions,
      pp_get_formatter_stag_function,
      get_formatter_stag_functions,
      formatter_of_out_channel,
      synchronized_formatter_of_out_,
      std_formatter,
      get_std_formatter,
      err_formatter,
      get_err_formatter,
      formatter_of_buffer,
      stdbuf,
      get_stdbuf,
      str_formatter,
      get_str_formatter,
      flush_str_formatter,
      make_formatter,
      make_synchronized_formatter,
      formatter_of_out_functions,
      make_symbolic_output_buffer,
      clear_symbolic_output_buffer,
      get_symbolic_output_buffer,
      flush_symbolic_output_buffer,
      add_symbolic_output_item,
      formatter_of_symbolic_output_b,
      pp_print_iter,
      pp_print_list,
      pp_print_array,
      pp_print_seq,
      pp_print_text,
      pp_print_option,
      pp_print_result,
      pp_print_either,
      fprintf,
      printf,
      eprintf,
      sprintf,
      asprintf,
      dprintf,
      ifprintf,
      kfprintf,
      kdprintf,
      ikfprintf,
      ksprintf,
      kasprintf],
     "Stdlib__Format");
   return;
  }
  (globalThis));

//# 21918 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Scanf:[N,N,F(2),F(2),F(2),F(2),F(1),F(1),F(3),F(3),F(3),F(3),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_get = runtime.caml_bytes_get,
    caml_int_of_string = runtime.caml_int_of_string,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    caml_trampoline = runtime.caml_trampoline,
    caml_trampoline_return = runtime.caml_trampoline_return,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    CamlinternalFormat = global_data.CamlinternalFormat,
    CamlinternalFormatBasics = global_data.CamlinternalFormatBasics,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib = global_data.Stdlib,
    Assert_failure = global_data.Assert_failure,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_Int = global_data.Stdlib__Int,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    null_char = 0;
   function next_char(ib){
    try{
     var c = caml_call1(ib[7], 0);
     ib[2] = c;
     ib[3] = 1;
     ib[4] = ib[4] + 1 | 0;
     if(10 === c) ib[5] = ib[5] + 1 | 0;
     return c;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn !== Stdlib[12]) throw caml_maybe_attach_backtrace(exn, 0);
     ib[2] = null_char;
     ib[3] = 0;
     ib[1] = 1;
     return null_char;
    }
   }
   function peek_char(ib){return ib[3] ? ib[2] : next_char(ib);}
   function checked_peek_char(ib){
    var c = peek_char(ib);
    if(ib[1]) throw caml_maybe_attach_backtrace(Stdlib[12], 1);
    return c;
   }
   function end_of_input(ib){peek_char(ib); return ib[1];}
   function beginning_of_input(ib){return 0 === ib[4] ? 1 : 0;}
   function name_of_input(ib){
    var match = ib[9];
    if(typeof match === "number")
     return 0 === match ? "unnamed function" : "unnamed character string";
    if(0 === match[0]) return "unnamed Stdlib input channel";
    var fname = match[1];
    return fname;
   }
   function char_count(ib){return ib[3] ? ib[4] - 1 | 0 : ib[4];}
   function invalidate_current_char(ib){ib[3] = 0; return 0;}
   function token_string(ib){
    var token_buffer = ib[8], tok = Stdlib_Buffer[2].call(null, token_buffer);
    Stdlib_Buffer[8].call(null, token_buffer);
    ib[6] = ib[6] + 1 | 0;
    return tok;
   }
   function ignore_char(width, ib){
    var width$0 = width - 1 | 0;
    invalidate_current_char(ib);
    return width$0;
   }
   function store_char(width, ib, c){
    Stdlib_Buffer[12].call(null, ib[8], c);
    return ignore_char(width, ib);
   }
   function create(iname, next){
    return [0,
            0,
            null_char,
            0,
            0,
            0,
            0,
            next,
            Stdlib_Buffer[1].call(null, 1024),
            iname];
   }
   function from_string(s){
    var len = caml_ml_string_length(s), i = [0, 0];
    function next(param){
     if(len <= i[1]) throw caml_maybe_attach_backtrace(Stdlib[12], 1);
     var c = caml_string_get(s, i[1]);
     i[1]++;
     return c;
    }
    return create(1, next);
   }
   function from_function(a){return create(0, a);}
   function scan_close_at_end(ic){
    Stdlib[93].call(null, ic);
    throw caml_maybe_attach_backtrace(Stdlib[12], 1);
   }
   function scan_raise_at_end(ic){
    throw caml_maybe_attach_backtrace(Stdlib[12], 1);
   }
   function from_ic(scan_close_ic, iname, ic){
    var
     buf = runtime.caml_create_bytes(1024),
     i = [0, 0],
     lim = [0, 0],
     eof = [0, 0];
    function next(param){
     if(i[1] < lim[1]){var c = caml_bytes_get(buf, i[1]); i[1]++; return c;}
     if(eof[1]) throw caml_maybe_attach_backtrace(Stdlib[12], 1);
     lim[1] = Stdlib[84].call(null, ic, buf, 0, 1024);
     return 0 === lim[1]
             ? (eof[1] = 1, caml_call1(scan_close_ic, ic))
             : (i[1] = 1, caml_bytes_get(buf, 0));
    }
    return create(iname, next);
   }
   var
    cst$0 = "-",
    stdin = from_ic(scan_raise_at_end, [1, cst$0, Stdlib[38]], Stdlib[38]);
   function open_in_file(open_in, fname){
    if(fname === cst$0) return stdin;
    var ic = caml_call1(open_in, fname);
    return from_ic(scan_close_at_end, [1, fname, ic], ic);
   }
   var a = Stdlib[79];
   function open_in(b){return open_in_file(a, b);}
   var b = Stdlib[80];
   function open_in_bin(a){return open_in_file(b, a);}
   function from_channel(ic){return from_ic(scan_raise_at_end, [0, ic], ic);}
   function close_in(ib){
    var match = ib[9];
    if(typeof match === "number") return 0;
    if(0 === match[0]){var ic = match[1]; return Stdlib[93].call(null, ic);}
    var ic$0 = match[2];
    return Stdlib[93].call(null, ic$0);
   }
   var
    Scan_failure =
      [248, "Stdlib.Scanf.Scan_failure", runtime.caml_fresh_oo_id(0)];
   function bad_input(s){
    throw caml_maybe_attach_backtrace([0, Scan_failure, s], 1);
   }
   var
    c =
      [0,
       [11, "illegal escape character ", [1, 0]],
       "illegal escape character %C"];
   function bad_input_escape(c$0){
    return bad_input(caml_call1(Stdlib_Printf[4].call(null, c), c$0));
   }
   var
    cst_scanning_of = "scanning of ",
    d =
      [0,
       [11,
        cst_scanning_of,
        [2,
         0,
         [11, " failed: the specified length was too short for token", 0]]],
       "scanning of %s failed: the specified length was too short for token"];
   function bad_token_length(message){
    return bad_input(caml_call1(Stdlib_Printf[4].call(null, d), message));
   }
   var
    cst_not_a_valid_float_in_hexad =
      "not a valid float in hexadecimal notation";
   function bad_hex_float(param){
    return bad_input(cst_not_a_valid_float_in_hexad);
   }
   var
    f =
      [0,
       [11, "looking for ", [1, [11, ", found ", [1, 0]]]],
       "looking for %C, found %C"];
   function character_mismatch(c, ci){
    return bad_input(caml_call2(Stdlib_Printf[4].call(null, f), c, ci));
   }
   function check_char(ib, c$0){
    if(10 === c$0){
     var ci = checked_peek_char(ib);
     return 10 === ci
             ? invalidate_current_char(ib)
             : 13
               === ci
               ? (invalidate_current_char(ib), check_this_char(ib, 10))
               : character_mismatch(10, ci);
    }
    if(32 !== c$0) return check_this_char(ib, c$0);
    for(;;){
     var c = peek_char(ib), b = 1 - ib[1];
     if(! b) return b;
     var a = c - 9 | 0;
     a:
     {
      if(4 < a >>> 0){
       if(23 !== a) break a;
      }
      else if(1 >= a - 2 >>> 0) break a;
      invalidate_current_char(ib);
      continue;
     }
     return 0;
    }
   }
   function check_this_char(ib, c){
    var ci = checked_peek_char(ib);
    return ci === c ? invalidate_current_char(ib) : character_mismatch(c, ci);
   }
   function token_char(ib){return caml_string_get(token_string(ib), 0);}
   var
    g =
      [0,
       [11, "invalid boolean '", [2, 0, [12, 39, 0]]],
       "invalid boolean '%s'"];
   function token_bool(ib){
    var s = token_string(ib);
    return s !== "false"
            ? s
              !== "true"
              ? bad_input(caml_call1(Stdlib_Printf[4].call(null, g), s))
              : 1
            : 0;
   }
   var cst_scanf_ml = "scanf.ml", h = [0, cst_scanf_ml, 516, 9];
   function integer_conversion_of_char(param){
    var switcher = param - 88 | 0;
    if(32 >= switcher >>> 0)
     switch(switcher){
       case 10:
        return 0;
       case 12:
        return 1;
       case 17:
        return 2;
       case 23:
        return 3;
       case 29:
        return 4;
       case 0:
       case 32:
        return 5;
     }
    throw caml_maybe_attach_backtrace([0, Assert_failure, h], 1);
   }
   function token_int_literal(conv, ib){
    switch(conv){
      case 0:
       var a = token_string(ib), tok = Stdlib[28].call(null, "0b", a); break;
      case 3:
       var b = token_string(ib), tok = Stdlib[28].call(null, "0o", b); break;
      case 4:
       var c = token_string(ib), tok = Stdlib[28].call(null, "0u", c); break;
      case 5:
       var d = token_string(ib), tok = Stdlib[28].call(null, "0x", d); break;
      default: var tok = token_string(ib);
    }
    var l = caml_ml_string_length(tok);
    if(0 !== l && 43 === caml_string_get(tok, 0))
     return Stdlib_String[16].call(null, tok, 1, l - 1 | 0);
    return tok;
   }
   function token_float(ib){
    return runtime.caml_float_of_string(token_string(ib));
   }
   function scan_decimal_digit_star(width$2, ib){
    var width = width$2;
    for(;;){
     if(0 === width) return width;
     var c = peek_char(ib);
     if(ib[1]) return width;
     if(58 <= c){
      if(95 === c){
       var width$0 = ignore_char(width, ib);
       width = width$0;
       continue;
      }
     }
     else if(48 <= c){
      var width$1 = store_char(width, ib, c);
      width = width$1;
      continue;
     }
     return width;
    }
   }
   var
    cst_character = "character ",
    i =
      [0,
       [11, cst_character, [1, [11, " is not a decimal digit", 0]]],
       "character %C is not a decimal digit"];
   function scan_decimal_digit_plus(width, ib){
    if(0 === width) return bad_token_length("decimal digits");
    var c = checked_peek_char(ib);
    if(9 < c - 48 >>> 0)
     return bad_input(caml_call1(Stdlib_Printf[4].call(null, i), c));
    var width$0 = store_char(width, ib, c);
    return scan_decimal_digit_star(width$0, ib);
   }
   var
    j =
      [0,
       [11,
        cst_character,
        [1, [11, " is not a valid ", [2, 0, [11, " digit", 0]]]]],
       "character %C is not a valid %s digit"];
   function scan_digit_plus(basis, digitp, width$2, ib){
    if(0 === width$2) return bad_token_length("digits");
    var c$0 = checked_peek_char(ib);
    if(! caml_call1(digitp, c$0))
     return bad_input(caml_call2(Stdlib_Printf[4].call(null, j), c$0, basis));
    var width$3 = store_char(width$2, ib, c$0), width = width$3;
    for(;;){
     if(0 === width) return width;
     var c = peek_char(ib);
     if(ib[1]) return width;
     if(caml_call1(digitp, c)){
      var width$0 = store_char(width, ib, c);
      width = width$0;
     }
     else{
      if(95 !== c) return width;
      var width$1 = ignore_char(width, ib);
      width = width$1;
     }
    }
   }
   function is_binary_digit(param){return 1 < param - 48 >>> 0 ? 0 : 1;}
   function is_octal_digit(param){return 7 < param - 48 >>> 0 ? 0 : 1;}
   function is_hexa_digit(param){
    var a = param - 48 | 0;
    a:
    {
     if(22 < a >>> 0){
      if(5 < a - 49 >>> 0) break a;
     }
     else if(6 >= a - 10 >>> 0) break a;
     return 1;
    }
    return 0;
   }
   function scan_sign(width, ib){
    var c = checked_peek_char(ib), switcher = c - 43 | 0;
    if(2 >= switcher >>> 0 && 1 !== switcher) return store_char(width, ib, c);
    return width;
   }
   function scan_optionally_signed_decimal(width, ib){
    var width$0 = scan_sign(width, ib);
    return scan_decimal_digit_plus(width$0, ib);
   }
   var cst_hexadecimal = "hexadecimal";
   function scan_int_conversion(conv, width$1, ib){
    var cst_binary = "binary", cst_octal = "octal";
    switch(conv){
      case 0:
       return scan_digit_plus(cst_binary, is_binary_digit, width$1, ib);
      case 1:
       return scan_optionally_signed_decimal(width$1, ib);
      case 2:
       var width$0 = scan_sign(width$1, ib), c = checked_peek_char(ib);
       if(48 !== c) return scan_decimal_digit_plus(width$0, ib);
       var width = store_char(width$0, ib, c);
       if(0 === width) return width;
       var c$0 = peek_char(ib);
       if(ib[1]) return width;
       a:
       {
        if(99 <= c$0){
         if(111 === c$0)
          return scan_digit_plus
                  (cst_octal, is_octal_digit, store_char(width, ib, c$0), ib);
         if(120 !== c$0) break a;
        }
        else if(88 !== c$0){
         if(98 <= c$0)
          return scan_digit_plus
                  (cst_binary,
                   is_binary_digit,
                   store_char(width, ib, c$0),
                   ib);
         break a;
        }
        return scan_digit_plus
                (cst_hexadecimal,
                 is_hexa_digit,
                 store_char(width, ib, c$0),
                 ib);
       }
       return scan_decimal_digit_star(width, ib);
      case 3:
       return scan_digit_plus(cst_octal, is_octal_digit, width$1, ib);
      case 4:
       return scan_decimal_digit_plus(width$1, ib);
      default:
       return scan_digit_plus(cst_hexadecimal, is_hexa_digit, width$1, ib);
    }
   }
   function scan_fractional_part(width, ib){
    if(0 === width) return width;
    var c = peek_char(ib);
    return ib[1]
            ? width
            : 9
              < c - 48 >>> 0
              ? width
              : scan_decimal_digit_star(store_char(width, ib, c), ib);
   }
   function scan_exponent_part(width, ib){
    if(0 === width) return width;
    var c = peek_char(ib);
    if(ib[1]) return width;
    if(69 !== c && 101 !== c) return width;
    return scan_optionally_signed_decimal(store_char(width, ib, c), ib);
   }
   function scan_float(width$1, precision, ib){
    var
     width = scan_sign(width$1, ib),
     width$0 = scan_decimal_digit_star(width, ib);
    if(0 === width$0) return [0, width$0, precision];
    var c = peek_char(ib);
    if(ib[1]) return [0, width$0, precision];
    if(46 !== c) return [0, scan_exponent_part(width$0, ib), precision];
    var
     width$2 = store_char(width$0, ib, c),
     precision$0 = Stdlib_Int[10].call(null, width$2, precision),
     width$3 =
       width$2 - (precision$0 - scan_fractional_part(precision$0, ib) | 0) | 0;
    return [0, scan_exponent_part(width$3, ib), precision$0];
   }
   function check_case_insensitive_string(width, ib, error, str){
    function lowercase(c){
     return 25 < c - 65 >>> 0
             ? c
             : Stdlib[29].call(null, (c - 65 | 0) + 97 | 0);
    }
    var len = caml_ml_string_length(str), a = len - 1 | 0;
    if(a < 0)
     var width$1 = width;
    else{
     var width$0 = width, i = 0;
     for(;;){
      var c = peek_char(ib), d = lowercase(caml_string_get(str, i));
      if(lowercase(c) !== d) caml_call1(error, 0);
      if(0 === width$0) caml_call1(error, 0);
      var b = store_char(width$0, ib, c), e = i + 1 | 0;
      if(a === i){var width$1 = b; break;}
      width$0 = b;
      i = e;
     }
    }
    return width$1;
   }
   function scan_hex_float(width, precision, ib){
    var b = 0 === width, d = b || end_of_input(ib);
    if(d) bad_input(cst_not_a_valid_float_in_hexad);
    var
     width$0 = scan_sign(width, ib),
     e = 0 === width$0,
     f = e || end_of_input(ib);
    if(f) bad_input(cst_not_a_valid_float_in_hexad);
    var c = peek_char(ib);
    a:
    {
     if(78 <= c){
      var switcher = c - 79 | 0;
      if(30 < switcher >>> 0){
       if(32 <= switcher) break a;
       var
        width$1 = store_char(width$0, ib, c),
        g = 0 === width$1,
        h = g || end_of_input(ib);
       if(h) bad_input(cst_not_a_valid_float_in_hexad);
       return check_case_insensitive_string(width$1, ib, bad_hex_float, "an");
      }
      if(26 !== switcher) break a;
     }
     else{
      if(48 === c){
       var
        width$3 = store_char(width$0, ib, c),
        k = 0 === width$3,
        l = k || end_of_input(ib);
       if(l) bad_input(cst_not_a_valid_float_in_hexad);
       var
        width$4 =
          check_case_insensitive_string(width$3, ib, bad_hex_float, "x");
       if(0 !== width$4 && ! end_of_input(ib)){
        var a = peek_char(ib) - 46 | 0;
        b:
        {
         if(34 < a >>> 0){
          if(66 === a){var width$5 = width$4; break b;}
         }
         else if(32 < a - 1 >>> 0){var width$5 = width$4; break b;}
         var
          width$5 =
            scan_digit_plus(cst_hexadecimal, is_hexa_digit, width$4, ib);
        }
        if(0 !== width$5 && ! end_of_input(ib)){
         var c$0 = peek_char(ib);
         if(46 === c$0){
          var width$6 = store_char(width$5, ib, c$0);
          if(0 === width$6)
           var width$7 = width$6;
          else if(end_of_input(ib))
           var width$7 = width$6;
          else{
           var match = peek_char(ib);
           if(80 === match || 112 === match)
            var width$7 = width$6;
           else
            var
             precision$0 = Stdlib_Int[10].call(null, width$6, precision),
             width$7 =
               width$6
               -
                (precision$0
                -
                 scan_digit_plus
                  (cst_hexadecimal, is_hexa_digit, precision$0, ib)
                | 0)
               | 0;
          }
         }
         else
          var width$7 = width$5;
         if(0 !== width$7 && ! end_of_input(ib)){
          var c$1 = peek_char(ib);
          if(80 !== c$1 && 112 !== c$1) return width$7;
          var
           width$8 = store_char(width$7, ib, c$1),
           m = 0 === width$8,
           n = m || end_of_input(ib);
          if(n) bad_input(cst_not_a_valid_float_in_hexad);
          return scan_optionally_signed_decimal(width$8, ib);
         }
         return width$7;
        }
        return width$5;
       }
       return width$4;
      }
      if(73 !== c) break a;
     }
     var
      width$2 = store_char(width$0, ib, c),
      i = 0 === width$2,
      j = i || end_of_input(ib);
     if(j) bad_input(cst_not_a_valid_float_in_hexad);
     return check_case_insensitive_string
             (width$2, ib, bad_hex_float, "nfinity");
    }
    return bad_input(cst_not_a_valid_float_in_hexad);
   }
   var
    cst_no_dot_or_exponent_part_fo =
      "no dot or exponent part found in float token";
   function scan_caml_float_rest(width, precision, ib){
    var a = 0 === width, b = a || end_of_input(ib);
    if(b) bad_input(cst_no_dot_or_exponent_part_fo);
    var
     width$0 = scan_decimal_digit_star(width, ib),
     d = 0 === width$0,
     e = d || end_of_input(ib);
    if(e) bad_input(cst_no_dot_or_exponent_part_fo);
    var c = peek_char(ib), switcher = c - 69 | 0;
    if(32 < switcher >>> 0){
     if(-23 === switcher){
      var
       width$1 = store_char(width$0, ib, c),
       precision$0 = Stdlib_Int[10].call(null, width$1, precision),
       width_precision = scan_fractional_part(precision$0, ib),
       frac_width = precision$0 - width_precision | 0,
       width$2 = width$1 - frac_width | 0;
      return scan_exponent_part(width$2, ib);
     }
    }
    else if(30 < switcher - 1 >>> 0) return scan_exponent_part(width$0, ib);
    return bad_input(cst_no_dot_or_exponent_part_fo);
   }
   function scan_caml_float(width, precision, ib){
    var a = 0 === width, b = a || end_of_input(ib);
    if(b) bad_input(cst_no_dot_or_exponent_part_fo);
    var
     width$0 = scan_sign(width, ib),
     d = 0 === width$0,
     e = d || end_of_input(ib);
    if(e) bad_input(cst_no_dot_or_exponent_part_fo);
    var c = peek_char(ib);
    if(49 <= c){
     if(58 > c){
      var
       width$1 = store_char(width$0, ib, c),
       f = 0 === width$1,
       g = f || end_of_input(ib);
      if(g) bad_input(cst_no_dot_or_exponent_part_fo);
      return scan_caml_float_rest(width$1, precision, ib);
     }
    }
    else if(48 <= c){
     var
      width$2 = store_char(width$0, ib, c),
      h = 0 === width$2,
      i = h || end_of_input(ib);
     if(i) bad_input(cst_no_dot_or_exponent_part_fo);
     var c$0 = peek_char(ib);
     if(88 !== c$0 && 120 !== c$0)
      return scan_caml_float_rest(width$2, precision, ib);
     var
      width$3 = store_char(width$2, ib, c$0),
      j = 0 === width$3,
      k = j || end_of_input(ib);
     if(k) bad_input(cst_no_dot_or_exponent_part_fo);
     var
      width$7 = scan_digit_plus(cst_hexadecimal, is_hexa_digit, width$3, ib),
      l = 0 === width$7,
      m = l || end_of_input(ib);
     if(m) bad_input(cst_no_dot_or_exponent_part_fo);
     var c$1 = peek_char(ib), switcher = c$1 - 80 | 0;
     a:
     {
      if(32 < switcher >>> 0){
       if(-34 === switcher){
        var width$4 = store_char(width$7, ib, c$1);
        if(0 === width$4){var width$5 = width$4; break a;}
        if(end_of_input(ib)){var width$5 = width$4; break a;}
        var match = peek_char(ib);
        if(80 === match){var width$5 = width$4; break a;}
        if(112 === match){var width$5 = width$4; break a;}
        var
         precision$0 = Stdlib_Int[10].call(null, width$4, precision),
         width$5 =
           width$4
           -
            (precision$0
            - scan_digit_plus(cst_hexadecimal, is_hexa_digit, precision$0, ib)
            | 0)
           | 0;
        break a;
       }
      }
      else if(30 < switcher - 1 >>> 0){var width$5 = width$7; break a;}
      var width$5 = bad_input(cst_no_dot_or_exponent_part_fo);
     }
     if(0 !== width$5 && ! end_of_input(ib)){
      var c$2 = peek_char(ib);
      if(80 !== c$2 && 112 !== c$2) return width$5;
      var
       width$6 = store_char(width$5, ib, c$2),
       n = 0 === width$6,
       o = n || end_of_input(ib);
      if(o) bad_input(cst_not_a_valid_float_in_hexad);
      return scan_optionally_signed_decimal(width$6, ib);
     }
     return width$5;
    }
    return bad_input(cst_no_dot_or_exponent_part_fo);
   }
   function scan_string(stp, width, ib){
    var width$0 = width;
    for(;;){
     if(0 === width$0) return width$0;
     var c = peek_char(ib);
     if(ib[1]) return width$0;
     if(stp){
      var c$0 = stp[1];
      if(c === c$0){invalidate_current_char(ib); return width$0;}
      var width$1 = store_char(width$0, ib, c);
      width$0 = width$1;
     }
     else{
      var a = c - 9 | 0;
      a:
      {
       if(4 < a >>> 0){
        if(23 !== a) break a;
       }
       else if(1 >= a - 2 >>> 0) break a;
       return width$0;
      }
      var width$2 = store_char(width$0, ib, c);
      width$0 = width$2;
     }
    }
   }
   function hexadecimal_value_of_char(c){
    return 97 <= c ? c - 87 | 0 : 65 <= c ? c - 55 | 0 : c - 48 | 0;
   }
   var
    e =
      [0,
       [11,
        cst_scanning_of,
        [2,
         0,
         [11,
          " failed: premature end of file occurred before end of token",
          0]]],
       "scanning of %s failed: premature end of file occurred before end of token"];
   function check_next_char(message, width, ib){
    if(0 === width) return bad_token_length(message);
    var c = peek_char(ib);
    return ib[1]
            ? bad_input(caml_call1(Stdlib_Printf[4].call(null, e), message))
            : c;
   }
   var
    cst_a_Char = "a Char",
    k =
      [0,
       [11, "bad character decimal encoding \\", [0, [0, [0, 0]]]],
       "bad character decimal encoding \\%c%c%c"],
    l =
      [0,
       [11, "bad character hexadecimal encoding \\", [0, [0, 0]]],
       "bad character hexadecimal encoding \\%c%c"];
   function scan_backslash_char(width, ib){
    var c0 = check_next_char(cst_a_Char, width, ib);
    a:
    {
     if(40 <= c0){
      if(58 > c0){
       if(48 > c0) break a;
       var
        get_digit$0 =
          function(param){
           var c = next_char(ib);
           return 9 < c - 48 >>> 0 ? bad_input_escape(c) : c;
          },
        c1$0 = get_digit$0(0),
        c2$0 = get_digit$0(0),
        c =
          ((100 * (c0 - 48 | 0) | 0) + (10 * (c1$0 - 48 | 0) | 0) | 0)
          + (c2$0 - 48 | 0)
          | 0;
       b:
       {
        if(0 <= c && 255 >= c){var d = Stdlib[29].call(null, c); break b;}
        var
         d =
           bad_input
            (caml_call3(Stdlib_Printf[4].call(null, k), c0, c1$0, c2$0));
       }
       return store_char(width - 2 | 0, ib, d);
      }
      var switcher = c0 - 92 | 0;
      if(28 < switcher >>> 0) break a;
      switch(switcher){
        case 28:
         var
          get_digit =
            function(param){
             var c = next_char(ib), a = c - 48 | 0;
             a:
             {
              if(22 < a >>> 0){
               if(5 < a - 49 >>> 0) break a;
              }
              else if(6 >= a - 10 >>> 0) break a;
              return c;
             }
             return bad_input_escape(c);
            },
          c1 = get_digit(0),
          c2 = get_digit(0),
          e = hexadecimal_value_of_char(c2),
          c$0 = (16 * hexadecimal_value_of_char(c1) | 0) + e | 0;
         b:
         {
          if(0 <= c$0 && 255 >= c$0){
           var b = Stdlib[29].call(null, c$0);
           break b;
          }
          var
           b = bad_input(caml_call2(Stdlib_Printf[4].call(null, l), c1, c2));
         }
         return store_char(width - 2 | 0, ib, b);
        case 0:
        case 6:
        case 18:
        case 22:
        case 24: break;
        default: break a;
      }
     }
     else if(34 !== c0 && 39 > c0) break a;
     if(110 <= c0)
      if(117 <= c0)
       var a = c0;
      else
       switch(c0 - 110 | 0){
         case 0:
          var a = 10; break;
         case 4:
          var a = 13; break;
         case 6:
          var a = 9; break;
         default: var a = c0;
       }
     else
      var a = 98 === c0 ? 8 : c0;
     return store_char(width, ib, a);
    }
    return bad_input_escape(c0);
   }
   function scan_caml_string(width, ib){
    var cst_a_String = "a String";
    function find_stop$0(counter, width$5){
     var width = width$5;
     for(;;){
      var c = check_next_char(cst_a_String, width, ib);
      if(34 === c) return ignore_char(width, ib);
      if(92 === c){
       var
        width$0 = ignore_char(width, ib),
        match = check_next_char(cst_a_String, width$0, ib);
       if(10 === match){
        var a = ignore_char(width$0, ib);
        return counter < 50
                ? skip_spaces(counter + 1 | 0, a)
                : caml_trampoline_return(skip_spaces, [0, a]);
       }
       if(13 === match){
        var width$2 = ignore_char(width$0, ib);
        if(10 === check_next_char(cst_a_String, width$2, ib)){
         var b = ignore_char(width$2, ib);
         return counter < 50
                 ? skip_spaces(counter + 1 | 0, b)
                 : caml_trampoline_return(skip_spaces, [0, b]);
        }
        var width$4 = store_char(width$2, ib, 13);
        width = width$4;
       }
       else{var width$3 = scan_backslash_char(width$0, ib); width = width$3;}
      }
      else{var width$1 = store_char(width, ib, c); width = width$1;}
     }
    }
    function find_stop(width){return caml_trampoline(find_stop$0(0, width));}
    function skip_spaces(counter, width$1){
     var width = width$1;
     for(;;){
      if(32 !== check_next_char(cst_a_String, width, ib))
       return counter < 50
               ? find_stop$0(counter + 1 | 0, width)
               : caml_trampoline_return(find_stop$0, [0, width]);
      var width$0 = ignore_char(width, ib);
      width = width$0;
     }
    }
    var c = checked_peek_char(ib);
    return 34 === c
            ? find_stop(ignore_char(width, ib))
            : character_mismatch(34, c);
   }
   function scan_chars_in_char_set(char_set, scan_indic, width, ib){
    function scan_chars(i$1, stp){
     var i = i$1;
     for(;;){
      var c = peek_char(ib), b = 0 < i ? 1 : 0;
      if(b){
       var d = 1 - ib[1];
       if(d)
        var
         e = CamlinternalFormat[1].call(null, char_set, c),
         a = e ? c !== stp ? 1 : 0 : e;
       else
        var a = d;
      }
      else
       var a = b;
      if(! a) return a;
      store_char(Stdlib[19], ib, c);
      var i$0 = i - 1 | 0;
      i = i$0;
     }
    }
    if(! scan_indic) return scan_chars(width, -1);
    var c = scan_indic[1];
    scan_chars(width, c);
    var a = 1 - ib[1];
    if(! a) return a;
    var ci = peek_char(ib);
    return c === ci ? invalidate_current_char(ib) : character_mismatch(c, ci);
   }
   var
    n =
      [0,
       [11,
        "scanf: bad input at char number ",
        [4, 3, 0, 0, [11, ": ", [2, 0, 0]]]],
       "scanf: bad input at char number %i: %s"];
   function scanf_bad_input(ib, x){
    if(x[1] === Scan_failure)
     var s = x[2];
    else{
     if(x[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(x, 1);
     var s = x[2];
    }
    var i = char_count(ib);
    return bad_input(caml_call2(Stdlib_Printf[4].call(null, n), i, s));
   }
   function width_of_pad_opt(pad_opt){
    if(! pad_opt) return Stdlib[19];
    var width = pad_opt[1];
    return width;
   }
   var o = [0, 37, ""];
   function stopper_of_formatting_lit(fmting){
    if(6 === fmting) return o;
    var
     str = CamlinternalFormat[17].call(null, fmting),
     stp = caml_string_get(str, 1),
     sub_str =
       Stdlib_String[16].call
        (null, str, 2, caml_ml_string_length(str) - 2 | 0);
    return [0, stp, sub_str];
   }
   function take_format_readers$0(counter, k, fmt$4){
    a:
    {
     var fmt = fmt$4;
     b:
     for(;;){
      if(typeof fmt === "number") return caml_call1(k, 0);
      switch(fmt[0]){
        case 14:
         var
          rest$3 = fmt[3],
          fmtty = fmt[2],
          c = CamlinternalFormat[21].call(null, fmtty),
          b = CamlinternalFormatBasics[2].call(null, c);
         return counter < 50
                 ? take_fmtty_format_readers$0(counter + 1 | 0, k, b, rest$3)
                 : caml_trampoline_return
                   (take_fmtty_format_readers$0, [0, k, b, rest$3]);
        case 18:
         var a = fmt[1];
         if(0 === a[0]){
          var
           rest$4 = fmt[2],
           fmt$0 = a[1][1],
           fmt$1 = CamlinternalFormatBasics[3].call(null, fmt$0, rest$4);
          fmt = fmt$1;
         }
         else{
          var
           rest$5 = fmt[2],
           fmt$2 = a[1][1],
           fmt$3 = CamlinternalFormatBasics[3].call(null, fmt$2, rest$5);
          fmt = fmt$3;
         }
         break;
        case 19:
         break a;
        case 23:
         var rest$6 = fmt[2], ign = fmt[1];
         if(typeof ign === "number"){
          if(2 === ign) break b;
          fmt = rest$6;
         }
         else{
          if(9 === ign[0]){
           var fmtty$0 = ign[2];
           return counter < 50
                   ? take_fmtty_format_readers$0
                     (counter + 1 | 0, k, fmtty$0, rest$6)
                   : caml_trampoline_return
                     (take_fmtty_format_readers$0, [0, k, fmtty$0, rest$6]);
          }
          fmt = rest$6;
         }
         break;
        case 13:
        case 20:
        case 24:
         var rest$2 = fmt[3]; fmt = rest$2; break;
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
         var rest$1 = fmt[4]; fmt = rest$1; break;
        case 0:
        case 1:
        case 10:
        case 15:
        case 16:
        case 22:
         var rest = fmt[1]; fmt = rest; break;
        default: var rest$0 = fmt[2]; fmt = rest$0;
      }
     }
     return function(reader){
      function new_k(readers_rest){
       return caml_call1(k, [0, reader, readers_rest]);
      }
      return take_format_readers(new_k, rest$6);};
    }
    var fmt_rest = fmt[1];
    return function(reader){
     function new_k(readers_rest){
      return caml_call1(k, [0, reader, readers_rest]);
     }
     return take_format_readers(new_k, fmt_rest);};
   }
   function take_format_readers(k, fmt){
    return caml_trampoline(take_format_readers$0(0, k, fmt));
   }
   function take_fmtty_format_readers$0(counter, k, fmtty$3, fmt){
    a:
    {
     var fmtty = fmtty$3;
     b:
     for(;;){
      if(typeof fmtty === "number")
       return counter < 50
               ? take_format_readers$0(counter + 1 | 0, k, fmt)
               : caml_trampoline_return(take_format_readers$0, [0, k, fmt]);
      switch(fmtty[0]){
        case 8:
         var fmtty$1 = fmtty[2]; fmtty = fmtty$1; break;
        case 9:
         var
          rest = fmtty[3],
          ty2 = fmtty[2],
          ty1 = fmtty[1],
          a = CamlinternalFormat[21].call(null, ty1),
          ty = CamlinternalFormat[22].call(null, a, ty2),
          fmtty$2 = CamlinternalFormatBasics[1].call(null, ty, rest);
         fmtty = fmtty$2;
         break;
        case 13:
         break a;
        case 14:
         break b;
        default: var fmtty$0 = fmtty[1]; fmtty = fmtty$0;
      }
     }
     var fmt_rest$0 = fmtty[1];
     return function(reader){
      function new_k(readers_rest){
       return caml_call1(k, [0, reader, readers_rest]);
      }
      return take_fmtty_format_readers(new_k, fmt_rest$0, fmt);};
    }
    var fmt_rest = fmtty[1];
    return function(reader){
     function new_k(readers_rest){
      return caml_call1(k, [0, reader, readers_rest]);
     }
     return take_fmtty_format_readers(new_k, fmt_rest, fmt);};
   }
   function take_fmtty_format_readers(k, fmtty, fmt){
    return caml_trampoline(take_fmtty_format_readers$0(0, k, fmtty, fmt));
   }
   var
    m =
      [0,
       [11, "the character ", [1, [11, " cannot start a boolean", 0]]],
       "the character %C cannot start a boolean"],
    p = [0, 123],
    q = [0, 91],
    r = [0, cst_scanf_ml, 1414, 13];
   function make_scanf(ib, fmt$13, readers){
    a:
    {
     b:
     {
      c:
      {
       d:
       {
        e:
        {
         f:
         {
          g:
          {
           h:
           {
            i:
            {
             var fmt = fmt$13;
             j:
             for(;;){
              if(typeof fmt === "number") return 0;
              switch(fmt[0]){
                case 0:
                 var rest = fmt[1];
                 store_char(0, ib, checked_peek_char(ib));
                 var c$0 = token_char(ib);
                 return [0, c$0, make_scanf(ib, rest, readers)];
                case 1:
                 break a;
                case 2:
                 break b;
                case 3:
                 break c;
                case 4:
                 break d;
                case 5:
                 break e;
                case 6:
                 break f;
                case 7:
                 break g;
                case 8:
                 switch(fmt[1][2]){
                   case 5:
                   case 8:
                    var rest$11 = fmt[4], prec$4 = fmt[3], pad$6 = fmt[2];
                    return pad_prec_scanf
                            (ib,
                             rest$11,
                             readers,
                             pad$6,
                             prec$4,
                             scan_caml_float,
                             token_float);
                   case 6:
                   case 7:
                    var rest$12 = fmt[4], prec$5 = fmt[3], pad$7 = fmt[2];
                    return pad_prec_scanf
                            (ib,
                             rest$12,
                             readers,
                             pad$7,
                             prec$5,
                             scan_hex_float,
                             token_float);
                   default:
                    var rest$10 = fmt[4], prec$3 = fmt[3], pad$5 = fmt[2];
                    return pad_prec_scanf
                            (ib,
                             rest$10,
                             readers,
                             pad$5,
                             prec$3,
                             scan_float,
                             token_float);
                 }
                case 9:
                 break h;
                case 10:
                 var rest$14 = fmt[1];
                 if(! end_of_input(ib))
                  return bad_input("end of input not found");
                 fmt = rest$14;
                 break;
                case 11:
                 var rest$15 = fmt[2], str$0 = fmt[1];
                 Stdlib_String[30].call
                  (null, function(a){return check_char(ib, a);}, str$0);
                 fmt = rest$15;
                 break;
                case 12:
                 var rest$16 = fmt[2], chr = fmt[1];
                 check_char(ib, chr);
                 fmt = rest$16;
                 break;
                case 13:
                 var rest$17 = fmt[3], fmtty = fmt[2], pad_opt = fmt[1];
                 scan_caml_string(width_of_pad_opt(pad_opt), ib);
                 var s = token_string(ib);
                 try{
                  var
                   e = CamlinternalFormat[14].call(null, s, fmtty),
                   fmt$2 = e;
                 }
                 catch(exn$0){
                  var exn = caml_wrap_exception(exn$0);
                  if(exn[1] !== Stdlib[7])
                   throw caml_maybe_attach_backtrace(exn, 0);
                  var msg = exn[2], fmt$2 = bad_input(msg);
                 }
                 return [0, fmt$2, make_scanf(ib, rest$17, readers)];
                case 14:
                 break i;
                case 15:
                 return Stdlib[1].call(null, 'scanf: bad conversion "%a"');
                case 16:
                 return Stdlib[1].call(null, 'scanf: bad conversion "%t"');
                case 17:
                 var
                  rest$19 = fmt[2],
                  formatting_lit = fmt[1],
                  j = CamlinternalFormat[17].call(null, formatting_lit);
                 Stdlib_String[30].call
                  (null, function(a){return check_char(ib, a);}, j);
                 fmt = rest$19;
                 break;
                case 18:
                 var b = fmt[1];
                 if(0 === b[0]){
                  var rest$20 = fmt[2], fmt$8 = b[1][1];
                  check_char(ib, 64);
                  check_char(ib, 123);
                  var
                   fmt$9 =
                     CamlinternalFormatBasics[3].call(null, fmt$8, rest$20);
                  fmt = fmt$9;
                 }
                 else{
                  var rest$21 = fmt[2], fmt$10 = b[1][1];
                  check_char(ib, 64);
                  check_char(ib, 91);
                  var
                   fmt$11 =
                     CamlinternalFormatBasics[3].call(null, fmt$10, rest$21);
                  fmt = fmt$11;
                 }
                 break;
                case 19:
                 var fmt_rest = fmt[1];
                 if(! readers)
                  return Stdlib[1].call(null, "scanf: missing reader");
                 var
                  readers_rest = readers[2],
                  reader = readers[1],
                  x = caml_call1(reader, ib);
                 return [0, x, make_scanf(ib, fmt_rest, readers_rest)];
                case 20:
                 break j;
                case 21:
                 var rest$24 = fmt[2], counter = fmt[1];
                 switch(counter){
                   case 0:
                    var count = ib[5]; break;
                   case 1:
                    var count = char_count(ib); break;
                   default: var count = ib[6];
                 }
                 return [0, count, make_scanf(ib, rest$24, readers)];
                case 22:
                 var rest$25 = fmt[1], c$2 = checked_peek_char(ib);
                 return [0, c$2, make_scanf(ib, rest$25, readers)];
                case 23:
                 var
                  rest$26 = fmt[2],
                  ign = fmt[1],
                  fmt$12 = CamlinternalFormat[6].call(null, ign, rest$26)[1],
                  match$3 = make_scanf(ib, fmt$12, readers);
                 if(! match$3)
                  throw caml_maybe_attach_backtrace([0, Assert_failure, r], 1);
                 var arg_rest = match$3[2];
                 return arg_rest;
                default:
                 return Stdlib[1].call
                         (null, 'scanf: bad conversion "%?" (custom converter)');
              }
             }
             var width_opt = fmt[1], match$1 = fmt[3];
             if(typeof match$1 !== "number" && 17 === match$1[0]){
              var
               rest$23 = match$1[2],
               fmting_lit$0 = match$1[1],
               char_set$0 = fmt[2],
               match$2 = stopper_of_formatting_lit(fmting_lit$0),
               str$1 = match$2[2],
               stp$0 = match$2[1],
               width$1 = width_of_pad_opt(width_opt);
              scan_chars_in_char_set(char_set$0, [0, stp$0], width$1, ib);
              var s$2 = token_string(ib);
              return [0, s$2, make_scanf(ib, [11, str$1, rest$23], readers)];
             }
             var
              rest$22 = fmt[3],
              char_set = fmt[2],
              width$0 = width_of_pad_opt(width_opt);
             scan_chars_in_char_set(char_set, 0, width$0, ib);
             var s$1 = token_string(ib);
             return [0, s$1, make_scanf(ib, rest$22, readers)];
            }
            var rest$18 = fmt[3], fmtty$0 = fmt[2], pad_opt$0 = fmt[1];
            scan_caml_string(width_of_pad_opt(pad_opt$0), ib);
            var s$0 = token_string(ib);
            try{
             var
              fmt$5 = CamlinternalFormat[13].call(null, 0, s$0)[1],
              fmt$6 = CamlinternalFormat[13].call(null, 0, s$0)[1],
              f = CamlinternalFormat[21].call(null, fmtty$0),
              g = CamlinternalFormatBasics[2].call(null, f),
              fmt$7 = CamlinternalFormat[12].call(null, fmt$6, g),
              h = CamlinternalFormatBasics[2].call(null, fmtty$0),
              i = CamlinternalFormat[12].call(null, fmt$5, h),
              fmt$4 = fmt$7,
              fmt$3 = i;
            }
            catch(exn){
             var exn$0 = caml_wrap_exception(exn);
             if(exn$0[1] !== Stdlib[7])
              throw caml_maybe_attach_backtrace(exn$0, 0);
             var
              msg$0 = exn$0[2],
              d = bad_input(msg$0),
              fmt$4 = d[2],
              fmt$3 = d[1];
            }
            return [0,
                    [0, fmt$3, s$0],
                    make_scanf
                     (ib,
                      CamlinternalFormatBasics[3].call(null, fmt$4, rest$18),
                      readers)];
           }
           var
            rest$13 = fmt[2],
            pad$8 = fmt[1],
            scan$8 =
              function(a, param, ib){
               var
                c = checked_peek_char(ib),
                m$0 =
                  102 === c
                   ? 5
                   : 116
                     === c
                     ? 4
                     : bad_input(caml_call1(Stdlib_Printf[4].call(null, m), c));
               return scan_string(0, m$0, ib);
              };
           return pad_prec_scanf
                   (ib, rest$13, readers, pad$8, 0, scan$8, token_bool);
          }
          var
           rest$9 = fmt[4],
           prec$2 = fmt[3],
           pad$4 = fmt[2],
           iconv$2 = fmt[1],
           conv$2 =
             integer_conversion_of_char
              (CamlinternalFormat[16].call(null, iconv$2)),
           scan$7 =
             function(width, param, ib){
              return scan_int_conversion(conv$2, width, ib);
             };
          return pad_prec_scanf
                  (ib,
                   rest$9,
                   readers,
                   pad$4,
                   prec$2,
                   scan$7,
                   function(ib){
                    return runtime.caml_int64_of_string
                            (token_int_literal(conv$2, ib));
                   });
         }
         var
          rest$8 = fmt[4],
          prec$1 = fmt[3],
          pad$3 = fmt[2],
          iconv$1 = fmt[1],
          conv$1 =
            integer_conversion_of_char
             (CamlinternalFormat[16].call(null, iconv$1)),
          scan$6 =
            function(width, param, ib){
             return scan_int_conversion(conv$1, width, ib);
            };
         return pad_prec_scanf
                 (ib,
                  rest$8,
                  readers,
                  pad$3,
                  prec$1,
                  scan$6,
                  function(ib){
                   return caml_int_of_string(token_int_literal(conv$1, ib));
                  });
        }
        var
         rest$7 = fmt[4],
         prec$0 = fmt[3],
         pad$2 = fmt[2],
         iconv$0 = fmt[1],
         conv$0 =
           integer_conversion_of_char
            (CamlinternalFormat[16].call(null, iconv$0)),
         scan$5 =
           function(width, param, ib){
            return scan_int_conversion(conv$0, width, ib);
           };
        return pad_prec_scanf
                (ib,
                 rest$7,
                 readers,
                 pad$2,
                 prec$0,
                 scan$5,
                 function(ib){
                  return caml_int_of_string(token_int_literal(conv$0, ib));
                 });
       }
       var
        rest$6 = fmt[4],
        prec = fmt[3],
        pad$1 = fmt[2],
        iconv = fmt[1],
        conv =
          integer_conversion_of_char(CamlinternalFormat[16].call(null, iconv)),
        scan$4 =
          function(width, param, ib){
           return scan_int_conversion(conv, width, ib);
          };
       return pad_prec_scanf
               (ib,
                rest$6,
                readers,
                pad$1,
                prec,
                scan$4,
                function(ib){
                 return caml_int_of_string(token_int_literal(conv, ib));
                });
      }
      var
       rest$5 = fmt[2],
       pad$0 = fmt[1],
       scan$3 =
         function(width, param, ib){return scan_caml_string(width, ib);};
      return pad_prec_scanf
              (ib, rest$5, readers, pad$0, 0, scan$3, token_string);
     }
     var pad = fmt[1], match = fmt[2];
     if(typeof match !== "number")
      switch(match[0]){
        case 17:
         var
          rest$2 = match[2],
          fmting_lit = match[1],
          match$0 = stopper_of_formatting_lit(fmting_lit),
          str = match$0[2],
          stp = match$0[1],
          scan$0 =
            function(width, param, ib){
             return scan_string([0, stp], width, ib);
            };
         return pad_prec_scanf
                 (ib,
                  [11, str, rest$2],
                  readers,
                  pad,
                  0,
                  scan$0,
                  token_string);
        case 18:
         var a = match[1];
         if(0 === a[0]){
          var
           rest$3 = match[2],
           fmt$0 = a[1][1],
           scan$1 =
             function(width, param, ib){return scan_string(p, width, ib);};
          return pad_prec_scanf
                  (ib,
                   CamlinternalFormatBasics[3].call(null, fmt$0, rest$3),
                   readers,
                   pad,
                   0,
                   scan$1,
                   token_string);
         }
         var
          rest$4 = match[2],
          fmt$1 = a[1][1],
          scan$2 =
            function(width, param, ib){return scan_string(q, width, ib);};
         return pad_prec_scanf
                 (ib,
                  CamlinternalFormatBasics[3].call(null, fmt$1, rest$4),
                  readers,
                  pad,
                  0,
                  scan$2,
                  token_string);
      }
     var
      rest$1 = fmt[2],
      scan = function(width, param, ib){return scan_string(0, width, ib);};
     return pad_prec_scanf(ib, rest$1, readers, pad, 0, scan, token_string);
    }
    var rest$0 = fmt[1];
    function find_stop(width){
     var c = check_next_char(cst_a_Char, width, ib);
     return 39 === c ? ignore_char(width, ib) : character_mismatch(39, c);
    }
    var c = checked_peek_char(ib);
    if(39 === c){
     var
      width = ignore_char(0, ib),
      c$3 = check_next_char(cst_a_Char, width, ib);
     if(92 === c$3)
      find_stop(scan_backslash_char(ignore_char(width, ib), ib));
     else
      find_stop(store_char(width, ib, c$3));
    }
    else
     character_mismatch(39, c);
    var c$1 = token_char(ib);
    return [0, c$1, make_scanf(ib, rest$0, readers)];
   }
   function pad_prec_scanf(ib, fmt, readers, pad, prec, scan, token){
    var cst_scanf_bad_conversion = 'scanf: bad conversion "%*"';
    if(typeof pad === "number"){
     if(typeof prec !== "number"){
      var p = prec[1];
      caml_call3(scan, Stdlib[19], p, ib);
      var x$0 = caml_call1(token, ib);
      return [0, x$0, make_scanf(ib, fmt, readers)];
     }
     if(prec) return Stdlib[1].call(null, cst_scanf_bad_conversion);
     caml_call3(scan, Stdlib[19], Stdlib[19], ib);
     var x = caml_call1(token, ib);
     return [0, x, make_scanf(ib, fmt, readers)];
    }
    if(0 !== pad[0]) return Stdlib[1].call(null, cst_scanf_bad_conversion);
    if(! pad[1]) return Stdlib[1].call(null, 'scanf: bad conversion "%-"');
    var w = pad[2];
    if(typeof prec !== "number"){
     var p$0 = prec[1];
     caml_call3(scan, w, p$0, ib);
     var x$2 = caml_call1(token, ib);
     return [0, x$2, make_scanf(ib, fmt, readers)];
    }
    if(prec) return Stdlib[1].call(null, cst_scanf_bad_conversion);
    caml_call3(scan, w, Stdlib[19], ib);
    var x$1 = caml_call1(token, ib);
    return [0, x$1, make_scanf(ib, fmt, readers)];
   }
   var cst = '"';
   function kscanf_gen(ib, ef, af, param){
    var str = param[2], fmt = param[1];
    function k(readers, f$1){
     Stdlib_Buffer[9].call(null, ib[8]);
     try{var args$1 = make_scanf(ib, fmt, readers), f = f$1, args = args$1;}
     catch(exc$0){
      var exc = caml_wrap_exception(exc$0);
      if
       (exc[1] !== Scan_failure && exc[1] !== Stdlib[7] && exc !== Stdlib[12]){
       if(exc[1] !== Stdlib[6]) throw caml_maybe_attach_backtrace(exc, 0);
       var
        msg = exc[2],
        a = Stdlib_String[25].call(null, str),
        b = Stdlib[28].call(null, a, cst),
        c = Stdlib[28].call(null, ' in format "', b),
        d = Stdlib[28].call(null, msg, c);
       return Stdlib[1].call(null, d);
      }
      return caml_call2(ef, ib, exc);
     }
     for(;;){
      if(! args) return caml_call1(af, f);
      var args$0 = args[2], x = args[1], f$0 = caml_call1(f, x);
      f = f$0;
      args = args$0;
     }
    }
    return take_format_readers(k, fmt);
   }
   function kscanf(ib, ef, fmt){
    return kscanf_gen(ib, ef, function(x){return x;}, fmt);
   }
   function kscanf_opt(ib, fmt){
    return kscanf_gen
            (ib,
             function(a, param){return 0;},
             function(x){return [0, x];},
             fmt);
   }
   function bscanf(ib, fmt){return kscanf(ib, scanf_bad_input, fmt);}
   function bscanf_opt(ib, fmt){return kscanf_opt(ib, fmt);}
   function ksscanf(s, ef, fmt){return kscanf(from_string(s), ef, fmt);}
   function sscanf(s, fmt){
    return kscanf(from_string(s), scanf_bad_input, fmt);
   }
   function sscanf_opt(s, fmt){return kscanf_opt(from_string(s), fmt);}
   function scanf(fmt){return kscanf(stdin, scanf_bad_input, fmt);}
   function scanf_opt(fmt){return kscanf_opt(stdin, fmt);}
   function bscanf_format(ib, format, f){
    scan_caml_string(Stdlib[19], ib);
    var str = token_string(ib);
    try{var a = CamlinternalFormat[15].call(null, str, format), fmt = a;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg = exn[2], fmt = bad_input(msg);
    }
    return caml_call1(f, fmt);
   }
   function sscanf_format(s, format, f){
    return bscanf_format(from_string(s), format, f);
   }
   function format_from_string(s, fmt){
    var
     a = Stdlib_String[25].call(null, s),
     b = Stdlib[28].call(null, a, cst);
    return sscanf_format
            (Stdlib[28].call(null, cst, b), fmt, function(x){return x;});
   }
   var s = [0, [3, 0, [10, 0]], "%S%!"];
   function unescaped(s$0){
    var a = Stdlib[28].call(null, s$0, cst);
    return caml_call1
            (sscanf(Stdlib[28].call(null, cst, a), s), function(x){return x;});
   }
   runtime.caml_register_global
    (64,
     [0,
      [0,
       stdin,
       open_in,
       open_in_bin,
       close_in,
       open_in,
       open_in_bin,
       from_string,
       from_function,
       from_channel,
       end_of_input,
       beginning_of_input,
       name_of_input],
      Scan_failure,
      bscanf,
      bscanf_opt,
      sscanf,
      sscanf_opt,
      scanf,
      scanf_opt,
      kscanf,
      ksscanf,
      bscanf_format,
      sscanf_format,
      format_from_string,
      unescaped],
     "Stdlib__Scanf");
   return;
  }
  (globalThis));

//# 23582 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Callback:[F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_register_named_value = runtime.caml_register_named_value,
    Stdlib_Obj = runtime.caml_get_global_data().Stdlib__Obj;
   function register_exception(name, exn){
    var
     a = Stdlib_Obj[10],
     slot = runtime.caml_obj_tag(exn) === a ? exn : exn[1];
    return caml_register_named_value(name, slot);
   }
   runtime.caml_register_global
    (1,
     [0, caml_register_named_value, register_exception],
     "Stdlib__Callback");
   return;
  }
  (globalThis));

//# 25380 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__Filename:[N,N,N,F(2),F(1),F(1),F(2),F(2),F(2),F(1),F(1),F(1),F(1),F(1),N,F(3),F(5),F(4),F(1),F(1),F(1),F(5)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_equal = runtime.caml_equal,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    caml_sys_getenv = runtime.caml_sys_getenv,
    caml_trampoline = runtime.caml_trampoline,
    caml_trampoline_return = runtime.caml_trampoline_return,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Domain = global_data.Stdlib__Domain,
    Stdlib_Random = global_data.Stdlib__Random,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Sys = global_data.Stdlib__Sys,
    cst = "";
   function generic_basename(is_dir_sep, current_dir_name, name){
    if(name === cst) return current_dir_name;
    var n$3 = caml_ml_string_length(name) - 1 | 0, n = n$3;
    for(;;){
     if(0 > n) return Stdlib_String[16].call(null, name, 0, 1);
     if(! caml_call2(is_dir_sep, name, n)) break;
     var n$0 = n - 1 | 0;
     n = n$0;
    }
    var p = n + 1 | 0, n$1 = n;
    for(;;){
     if(0 > n$1) return Stdlib_String[16].call(null, name, 0, p);
     if(caml_call2(is_dir_sep, name, n$1))
      return Stdlib_String[16].call
              (null, name, n$1 + 1 | 0, (p - n$1 | 0) - 1 | 0);
     var n$2 = n$1 - 1 | 0;
     n$1 = n$2;
    }
   }
   function generic_dirname(is_dir_sep, current_dir_name, name){
    if(name === cst) return current_dir_name;
    var n$5 = caml_ml_string_length(name) - 1 | 0, n = n$5;
    for(;;){
     if(0 > n) return Stdlib_String[16].call(null, name, 0, 1);
     if(! caml_call2(is_dir_sep, name, n)){var n$1 = n; break;}
     var n$0 = n - 1 | 0;
     n = n$0;
    }
    for(;;){
     if(0 > n$1) return current_dir_name;
     if(caml_call2(is_dir_sep, name, n$1)){var n$3 = n$1; break;}
     var n$2 = n$1 - 1 | 0;
     n$1 = n$2;
    }
    for(;;){
     if(0 > n$3) return Stdlib_String[16].call(null, name, 0, 1);
     if(! caml_call2(is_dir_sep, name, n$3))
      return Stdlib_String[16].call(null, name, 0, n$3 + 1 | 0);
     var n$4 = n$3 - 1 | 0;
     n$3 = n$4;
    }
   }
   function is_dir_sep(s, i){return 47 === caml_string_get(s, i) ? 1 : 0;}
   function is_relative(n){
    var
     a = caml_ml_string_length(n) < 1 ? 1 : 0,
     b = a || (47 !== caml_string_get(n, 0) ? 1 : 0);
    return b;
   }
   var cst$8 = "../", cst$7 = "./";
   function is_implicit(n){
    var b = is_relative(n);
    if(b){
     var
      d = caml_ml_string_length(n) < 2 ? 1 : 0,
      c = d || (Stdlib_String[16].call(null, n, 0, 2) !== cst$7 ? 1 : 0);
     if(c)
      var
       e = caml_ml_string_length(n) < 3 ? 1 : 0,
       a = e || (Stdlib_String[16].call(null, n, 0, 3) !== cst$8 ? 1 : 0);
     else
      var a = c;
    }
    else
     var a = b;
    return a;
   }
   function check_suffix(name, suff){
    return Stdlib_String[12].call(null, suff, name);
   }
   function chop_suffix_opt(suffix, filename){
    var
     len_s = caml_ml_string_length(suffix),
     len_f = caml_ml_string_length(filename);
    if(len_s > len_f) return 0;
    var r = Stdlib_String[16].call(null, filename, len_f - len_s | 0, len_s);
    return r === suffix
            ? [0,
              Stdlib_String[16].call(null, filename, 0, len_f - len_s | 0)]
            : 0;
   }
   var dummy = 0;
   try{var g = caml_sys_getenv("TMPDIR"), temp_dir_name = g;}
   catch(exn$0){
    var exn = caml_wrap_exception(exn$0);
    if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
    var temp_dir_name = "/tmp";
   }
   function quote(s){
    var
     l = caml_ml_string_length(s),
     b = Stdlib_Buffer[1].call(null, l + 20 | 0);
    Stdlib_Buffer[12].call(null, b, 39);
    var a = l - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      if(39 === caml_string_get(s, i))
       Stdlib_Buffer[16].call(null, b, "'\\''");
      else{var d = caml_string_get(s, i); Stdlib_Buffer[12].call(null, b, d);}
      var c = i + 1 | 0;
      if(a === i) break;
      i = c;
     }
    }
    Stdlib_Buffer[12].call(null, b, 39);
    return Stdlib_Buffer[2].call(null, b);
   }
   var
    cst$3 = " ",
    cst_2 = " 2>",
    cst_2_1 = " 2>&1",
    cst$2 = " <",
    cst$1 = " >";
   function quote_command(cmd, stdin, stdout, stderr, args){
    if(stderr){
     var f = stderr[1];
     if(caml_equal(stderr, stdout))
      var a = cst_2_1;
     else
      var k = quote(f), a = Stdlib[28].call(null, cst_2, k);
    }
    else
     var a = cst;
    if(stdout)
     var f$0 = stdout[1], d = quote(f$0), b = Stdlib[28].call(null, cst$1, d);
    else
     var b = cst;
    var e = Stdlib[28].call(null, b, a);
    if(stdin)
     var f$1 = stdin[1], g = quote(f$1), c = Stdlib[28].call(null, cst$2, g);
    else
     var c = cst;
    var
     h = Stdlib[28].call(null, c, e),
     i = Stdlib_List[20].call(null, quote, [0, cmd, args]),
     j = Stdlib_String[7].call(null, cst$3, i);
    return Stdlib[28].call(null, j, h);
   }
   var cst$4 = ".", current_dir_name = cst$4;
   function basename(a){
    return generic_basename(is_dir_sep, current_dir_name, a);
   }
   function dirname(a){
    return generic_dirname(is_dir_sep, current_dir_name, a);
   }
   var
    cst$5 = "..",
    cst$6 = "/",
    cst_dev_null = "/dev/null",
    Unix =
      [0,
       cst_dev_null,
       current_dir_name,
       cst$5,
       cst$6,
       is_dir_sep,
       is_relative,
       is_implicit,
       check_suffix,
       chop_suffix_opt,
       temp_dir_name,
       quote,
       quote_command,
       basename,
       dirname];
   function is_dir_sep$0(s, i){
    var c = caml_string_get(s, i), a = 47 === c ? 1 : 0;
    if(a)
     var b = a;
    else
     var d = 92 === c ? 1 : 0, b = d || (58 === c ? 1 : 0);
    return b;
   }
   function is_relative$0(n){
    var
     d = caml_ml_string_length(n) < 1 ? 1 : 0,
     b = d || (47 !== caml_string_get(n, 0) ? 1 : 0);
    if(b){
     var
      e = caml_ml_string_length(n) < 1 ? 1 : 0,
      c = e || (92 !== caml_string_get(n, 0) ? 1 : 0);
     if(c)
      var
       f = caml_ml_string_length(n) < 2 ? 1 : 0,
       a = f || (58 !== caml_string_get(n, 1) ? 1 : 0);
     else
      var a = c;
    }
    else
     var a = b;
    return a;
   }
   function is_implicit$0(n){
    var b = is_relative$0(n);
    if(b){
     var
      f = caml_ml_string_length(n) < 2 ? 1 : 0,
      c = f || (Stdlib_String[16].call(null, n, 0, 2) !== cst$7 ? 1 : 0);
     if(c){
      var
       g = caml_ml_string_length(n) < 2 ? 1 : 0,
       d = g || (Stdlib_String[16].call(null, n, 0, 2) !== ".\\" ? 1 : 0);
      if(d){
       var
        h = caml_ml_string_length(n) < 3 ? 1 : 0,
        e = h || (Stdlib_String[16].call(null, n, 0, 3) !== cst$8 ? 1 : 0);
       if(e)
        var
         i = caml_ml_string_length(n) < 3 ? 1 : 0,
         a = i || (Stdlib_String[16].call(null, n, 0, 3) !== "..\\" ? 1 : 0);
       else
        var a = e;
      }
      else
       var a = d;
     }
     else
      var a = c;
    }
    else
     var a = b;
    return a;
   }
   function check_suffix$0(name, suff){
    var
     a = caml_ml_string_length(suff) <= caml_ml_string_length(name) ? 1 : 0;
    if(a)
     var
      s =
        Stdlib_String[16].call
         (null,
          name,
          caml_ml_string_length(name) - caml_ml_string_length(suff) | 0,
          caml_ml_string_length(suff)),
      c = Stdlib_String[27].call(null, suff),
      b = Stdlib_String[27].call(null, s) === c ? 1 : 0;
    else
     var b = a;
    return b;
   }
   function chop_suffix_opt$0(suffix, filename){
    var
     len_s = caml_ml_string_length(suffix),
     len_f = caml_ml_string_length(filename);
    if(len_s > len_f) return 0;
    var
     r = Stdlib_String[16].call(null, filename, len_f - len_s | 0, len_s),
     a = Stdlib_String[27].call(null, suffix);
    return Stdlib_String[27].call(null, r) === a
            ? [0,
              Stdlib_String[16].call(null, filename, 0, len_f - len_s | 0)]
            : 0;
   }
   try{var f = caml_sys_getenv("TEMP"), temp_dir_name$0 = f;}
   catch(exn){
    var exn$0 = caml_wrap_exception(exn);
    if(exn$0 !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn$0, 0);
    var temp_dir_name$0 = cst$4;
   }
   function quote$0(s){
    var
     l = caml_ml_string_length(s),
     b = Stdlib_Buffer[1].call(null, l + 20 | 0);
    Stdlib_Buffer[12].call(null, b, 34);
    function loop$0(counter, i$1){
     var i = i$1;
     for(;;){
      if(i === l) return Stdlib_Buffer[12].call(null, b, 34);
      var c = caml_string_get(s, i);
      if(34 === c){
       var a = 0;
       return counter < 50
               ? loop_bs(counter + 1 | 0, a, i)
               : caml_trampoline_return(loop_bs, [0, a, i]);
      }
      if(92 === c){
       var d = 0;
       return counter < 50
               ? loop_bs(counter + 1 | 0, d, i)
               : caml_trampoline_return(loop_bs, [0, d, i]);
      }
      Stdlib_Buffer[12].call(null, b, c);
      var i$0 = i + 1 | 0;
      i = i$0;
     }
    }
    function loop(i){return caml_trampoline(loop$0(0, i));}
    function loop_bs(counter, n$1, i$1){
     var n = n$1, i = i$1;
     for(;;){
      if(i === l){Stdlib_Buffer[12].call(null, b, 34); return add_bs(n);}
      var match = caml_string_get(s, i);
      if(34 === match){
       add_bs((2 * n | 0) + 1 | 0);
       Stdlib_Buffer[12].call(null, b, 34);
       var a = i + 1 | 0;
       return counter < 50
               ? loop$0(counter + 1 | 0, a)
               : caml_trampoline_return(loop$0, [0, a]);
      }
      if(92 !== match){
       add_bs(n);
       return counter < 50
               ? loop$0(counter + 1 | 0, i)
               : caml_trampoline_return(loop$0, [0, i]);
      }
      var i$0 = i + 1 | 0, n$0 = n + 1 | 0;
      n = n$0;
      i = i$0;
     }
    }
    function add_bs(n){
     if(n >= 1){
      var j = 1;
      for(;;){
       Stdlib_Buffer[12].call(null, b, 92);
       var a = j + 1 | 0;
       if(n === j) break;
       j = a;
      }
     }
    }
    loop(0);
    return Stdlib_Buffer[2].call(null, b);
   }
   var cst$0 = '"', a = [0, cst$0, 0];
   function quote_cmd_filename(f){
    if
     (!
      Stdlib_String[23].call
       (null,
        function(param){if(34 !== param && 37 !== param) return 0; return 1;},
        f))
     return Stdlib_String[15].call(null, f, 32)
             ? Stdlib_String[7].call(null, cst, [0, cst$0, [0, f, a]])
             : f;
    var
     b = Stdlib[28].call(null, "Filename.quote_command: bad file name ", f);
    return Stdlib[2].call(null, b);
   }
   var b = [0, cst$0, 0];
   function quote_command$0(cmd, stdin, stdout, stderr, args){
    if(stderr){
     var f = stderr[1];
     if(caml_equal(stderr, stdout))
      var a = cst_2_1;
     else
      var m = quote_cmd_filename(f), a = Stdlib[28].call(null, cst_2, m);
    }
    else
     var a = cst;
    var e = [0, a, b];
    if(stdout)
     var
      f$0 = stdout[1],
      g = quote_cmd_filename(f$0),
      c = Stdlib[28].call(null, cst$1, g);
    else
     var c = cst;
    var h = [0, c, e];
    if(stdin)
     var
      f$1 = stdin[1],
      i = quote_cmd_filename(f$1),
      d = Stdlib[28].call(null, cst$2, i);
    else
     var d = cst;
    var
     j = Stdlib_List[20].call(null, quote$0, args),
     s = Stdlib_String[7].call(null, cst$3, j),
     b$0 = Stdlib_Buffer[1].call(null, caml_ml_string_length(s) + 20 | 0);
    Stdlib_String[30].call
     (null,
      function(c){
       a:
       {
        if(62 <= c){
         var a = c - 63 | 0;
         if(60 < a >>> 0){if(62 <= a) break a;} else if(31 !== a) break a;
        }
        else
         if(42 <= c){
          if(60 !== c) break a;
         }
         else{
          if(33 > c) break a;
          switch(c - 33 | 0){case 2:case 3:case 6: break a;
          }
         }
        Stdlib_Buffer[12].call(null, b$0, 94);
        return Stdlib_Buffer[12].call(null, b$0, c);
       }
       return Stdlib_Buffer[12].call(null, b$0, c);
      },
      s);
    var
     k = [0, cst$3, [0, Stdlib_Buffer[2].call(null, b$0), [0, d, h]]],
     l = [0, cst$0, [0, quote_cmd_filename(cmd), k]];
    return Stdlib_String[7].call(null, cst, l);
   }
   function drive_and_path(s){
    var b = 2 <= caml_ml_string_length(s);
    if(b){
     var param = caml_string_get(s, 0);
     a:
     {
      b:
      {
       if(91 <= param){
        if(25 < param - 97 >>> 0) break b;
       }
       else if(65 > param) break b;
       var a = 1;
       break a;
      }
      var a = 0;
     }
     var c = a ? 58 === caml_string_get(s, 1) : a;
    }
    else
     var c = b;
    if(! c) return [0, cst, s];
    var
     d = Stdlib_String[16].call(null, s, 2, caml_ml_string_length(s) - 2 | 0);
    return [0, Stdlib_String[16].call(null, s, 0, 2), d];
   }
   var current_dir_name$0 = cst$4;
   function dirname$0(s){
    var
     match = drive_and_path(s),
     path = match[2],
     drive = match[1],
     dir = generic_dirname(is_dir_sep$0, current_dir_name$0, path);
    return Stdlib[28].call(null, drive, dir);
   }
   function basename$0(s){
    var path = drive_and_path(s)[2];
    return generic_basename(is_dir_sep$0, current_dir_name$0, path);
   }
   var
    Win32 =
      [0,
       "NUL",
       current_dir_name$0,
       cst$5,
       "\\",
       is_dir_sep$0,
       is_relative$0,
       is_implicit$0,
       check_suffix$0,
       chop_suffix_opt$0,
       temp_dir_name$0,
       quote$0,
       quote_command$0,
       basename$0,
       dirname$0],
    current_dir_name$1 = cst$4;
   function basename$1(a){
    return generic_basename(is_dir_sep$0, current_dir_name$1, a);
   }
   function dirname$1(a){
    return generic_dirname(is_dir_sep$0, current_dir_name$1, a);
   }
   var
    Cygwin =
      [0,
       cst_dev_null,
       current_dir_name$1,
       cst$5,
       cst$6,
       is_dir_sep$0,
       is_relative$0,
       is_implicit$0,
       check_suffix$0,
       chop_suffix_opt$0,
       temp_dir_name,
       quote,
       quote_command,
       basename$1,
       dirname$1],
    match = Stdlib_Sys[4],
    Sysdeps = match !== "Cygwin" ? match !== "Win32" ? Unix : Win32 : Cygwin,
    null$ = Sysdeps[1],
    current_dir_name$2 = Sysdeps[2],
    parent_dir_name = Sysdeps[3],
    dir_sep = Sysdeps[4],
    is_dir_sep$1 = Sysdeps[5],
    is_relative$1 = Sysdeps[6],
    is_implicit$1 = Sysdeps[7],
    check_suffix$1 = Sysdeps[8],
    chop_suffix_opt$1 = Sysdeps[9],
    temp_dir_name$1 = Sysdeps[10],
    quote$1 = Sysdeps[11],
    quote_command$1 = Sysdeps[12],
    basename$2 = Sysdeps[13],
    dirname$2 = Sysdeps[14];
   function concat(dirname, filename){
    var l = caml_ml_string_length(dirname);
    if(0 !== l && ! is_dir_sep$1(dirname, l - 1 | 0)){
     var a = Stdlib[28].call(null, dir_sep, filename);
     return Stdlib[28].call(null, dirname, a);
    }
    return Stdlib[28].call(null, dirname, filename);
   }
   function chop_suffix(name, suff){
    return check_suffix$1(name, suff)
            ? Stdlib_String
               [16].call
              (null,
               name,
               0,
               caml_ml_string_length(name) - caml_ml_string_length(suff) | 0)
            : Stdlib[1].call(null, "Filename.chop_suffix");
   }
   function extension_len(name){
    var i$3 = caml_ml_string_length(name) - 1 | 0, i0 = i$3;
    for(;;){
     if(0 <= i0 && ! is_dir_sep$1(name, i0)){
      if(46 === caml_string_get(name, i0)) break;
      var i$2 = i0 - 1 | 0;
      i0 = i$2;
      continue;
     }
     return 0;
    }
    var i$1 = i0 - 1 | 0, i = i$1;
    for(;;){
     if(0 <= i && ! is_dir_sep$1(name, i)){
      if(46 !== caml_string_get(name, i))
       return caml_ml_string_length(name) - i0 | 0;
      var i$0 = i - 1 | 0;
      i = i$0;
      continue;
     }
     return 0;
    }
   }
   function extension(name){
    var l = extension_len(name);
    return 0 === l
            ? cst
            : Stdlib_String
               [16].call
              (null, name, caml_ml_string_length(name) - l | 0, l);
   }
   function chop_extension(name){
    var l = extension_len(name);
    return 0 === l
            ? Stdlib[1].call(null, "Filename.chop_extension")
            : Stdlib_String
               [16].call
              (null, name, 0, caml_ml_string_length(name) - l | 0);
   }
   function remove_extension(name){
    var l = extension_len(name);
    return 0 === l
            ? name
            : Stdlib_String
               [16].call
              (null, name, 0, caml_ml_string_length(name) - l | 0);
   }
   var
    prng_key = caml_call2(Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]),
    c = [0, [2, 0, [4, 6, [0, 2, 6], 0, [2, 0, 0]]], "%s%06x%s"];
   function temp_file_name(temp_dir, prefix, suffix){
    var
     random_state = caml_call1(Stdlib_Domain[10][2], prng_key),
     rnd = caml_call1(Stdlib_Random[19][4], random_state) & 16777215;
    return concat
            (temp_dir,
             caml_call3(Stdlib_Printf[4].call(null, c), prefix, rnd, suffix));
   }
   var
    current_temp_dir_name =
      caml_call2
       (Stdlib_Domain[10][1],
        [0, function(a){return a;}],
        function(param){return temp_dir_name$1;});
   function set_temp_dir_name(s){
    return caml_call2(Stdlib_Domain[10][3], current_temp_dir_name, s);
   }
   function get_temp_dir_name(param){
    return caml_call1(Stdlib_Domain[10][2], current_temp_dir_name);
   }
   var d = [0, 1, [0, 3, [0, 5, 0]]];
   function temp_file(opt, prefix, suffix){
    var
     temp_dir =
       opt ? opt[1] : caml_call1(Stdlib_Domain[10][2], current_temp_dir_name),
     counter = 0;
    for(;;){
     var name = temp_file_name(temp_dir, prefix, suffix);
     try{
      runtime.caml_sys_close(runtime.caml_sys_open(name, d, 384));
      return name;
     }
     catch(e$0){
      var e = caml_wrap_exception(e$0);
      if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0);
      if(20 <= counter) throw caml_maybe_attach_backtrace(e, 0);
      var counter$0 = counter + 1 | 0;
      counter = counter$0;
     }
    }
   }
   var e = [0, 7, 0];
   function open_temp_file(b, a, opt, prefix, suffix){
    var
     mode = b ? b[1] : e,
     perms = a ? a[1] : 384,
     temp_dir =
       opt ? opt[1] : caml_call1(Stdlib_Domain[10][2], current_temp_dir_name),
     counter = 0;
    for(;;){
     var name = temp_file_name(temp_dir, prefix, suffix);
     try{
      var
       c =
         [0,
          name,
          Stdlib[62].call(null, [0, 1, [0, 3, [0, 5, mode]]], perms, name)];
      return c;
     }
     catch(e){
      var e$0 = caml_wrap_exception(e);
      if(e$0[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e$0, 0);
      if(20 <= counter) throw caml_maybe_attach_backtrace(e$0, 0);
      var counter$0 = counter + 1 | 0;
      counter = counter$0;
     }
    }
   }
   function temp_dir(a, opt, prefix, suffix){
    var
     temp_dir =
       a ? a[1] : caml_call1(Stdlib_Domain[10][2], current_temp_dir_name),
     perms = opt ? opt[1] : 448,
     counter = 0;
    for(;;){
     var name = temp_file_name(temp_dir, prefix, suffix);
     try{runtime.caml_sys_mkdir(name, perms); return name;}
     catch(e$0){
      var e = caml_wrap_exception(e$0);
      if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0);
      if(20 <= counter) throw caml_maybe_attach_backtrace(e, 0);
      var counter$0 = counter + 1 | 0;
      counter = counter$0;
     }
    }
   }
   runtime.caml_register_global
    (66,
     [0,
      current_dir_name$2,
      parent_dir_name,
      dir_sep,
      concat,
      is_relative$1,
      is_implicit$1,
      check_suffix$1,
      chop_suffix,
      chop_suffix_opt$1,
      extension,
      remove_extension,
      chop_extension,
      basename$2,
      dirname$2,
      null$,
      temp_file,
      open_temp_file,
      temp_dir,
      get_temp_dir_name,
      set_temp_dir_name,
      quote$1,
      quote_command$1],
     "Stdlib__Filename");
   return;
  }
  (globalThis));

//# 26283 "../.js/default/stdlib/stdlib.cma.js"
//# shape: Stdlib__ListLabels:[F(1),F(2),F(2),F(1)*,F(2)*,F(1),F(1),F(2),F(2),F(1),F(2),F(2),F(2),F(1),F(1),F(3),F(3),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(3),F(3),F(3),F(3),F(3),F(3),F(4),F(4),F(2),F(2),F(3),F(3),F(2),F(2),F(2),F(2),F(1)*->F(1),F(2),F(1)*->F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(3),F(1)*->F(1)*,F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    Stdlib_List = runtime.caml_get_global_data().Stdlib__List,
    length = Stdlib_List[1],
    compare_lengths = Stdlib_List[2],
    compare_length_with = Stdlib_List[3],
    is_empty = Stdlib_List[4],
    cons = Stdlib_List[5],
    hd = Stdlib_List[6],
    tl = Stdlib_List[7],
    nth = Stdlib_List[8],
    nth_opt = Stdlib_List[9],
    rev = Stdlib_List[10],
    init = Stdlib_List[11],
    append = Stdlib_List[12],
    rev_append = Stdlib_List[13],
    concat = Stdlib_List[14],
    flatten = Stdlib_List[15],
    equal = Stdlib_List[16],
    compare = Stdlib_List[17],
    iter = Stdlib_List[18],
    iteri = Stdlib_List[19],
    map = Stdlib_List[20],
    mapi = Stdlib_List[21],
    rev_map = Stdlib_List[22],
    filter_map = Stdlib_List[23],
    concat_map = Stdlib_List[24],
    fold_left_map = Stdlib_List[25],
    fold_left = Stdlib_List[26],
    fold_right = Stdlib_List[27],
    iter2 = Stdlib_List[28],
    map2 = Stdlib_List[29],
    rev_map2 = Stdlib_List[30],
    fold_left2 = Stdlib_List[31],
    fold_right2 = Stdlib_List[32],
    for_all = Stdlib_List[33],
    exists = Stdlib_List[34],
    for_all2 = Stdlib_List[35],
    exists2 = Stdlib_List[36],
    mem = Stdlib_List[37],
    memq = Stdlib_List[38],
    find = Stdlib_List[39],
    find_opt = Stdlib_List[40],
    find_index = Stdlib_List[41],
    find_map = Stdlib_List[42],
    find_mapi = Stdlib_List[43],
    filter = Stdlib_List[44],
    find_all = Stdlib_List[45],
    filteri = Stdlib_List[46],
    partition = Stdlib_List[47],
    partition_map = Stdlib_List[48],
    assoc = Stdlib_List[49],
    assoc_opt = Stdlib_List[50],
    assq = Stdlib_List[51],
    assq_opt = Stdlib_List[52],
    mem_assoc = Stdlib_List[53],
    mem_assq = Stdlib_List[54],
    remove_assoc = Stdlib_List[55],
    remove_assq = Stdlib_List[56],
    split = Stdlib_List[57],
    combine = Stdlib_List[58],
    sort = Stdlib_List[59],
    stable_sort = Stdlib_List[60],
    fast_sort = Stdlib_List[61],
    sort_uniq = Stdlib_List[62],
    merge = Stdlib_List[63],
    to_seq = Stdlib_List[64],
    of_seq = Stdlib_List[65];
   runtime.caml_register_global
    (1,
     [0,
      length,
      compare_lengths,
      compare_length_with,
      is_empty,
      cons,
      hd,
      tl,
      nth,
      nth_opt,
      rev,
      init,
      append,
      rev_append,
      concat,
      flatten,
      equal,
      compare,
      iter,
      iteri,
      map,
      mapi,
      rev_map,
      filter_map,
      concat_map,
      fold_left_map,
      fold_left,
      fold_right,
      iter2,
      map2,
      rev_map2,
      fold_left2,
      fold_right2,
      for_all,
      exists,
      for_all2,
      exists2,
      mem,
      memq,
      find,
      find_opt,
      find_index,
      find_map,
      find_mapi,
      filter,
      find_all,
      filteri,
      partition,
      partition_map,
      assoc,
      assoc_opt,
      assq,
      assq_opt,
      mem_assoc,
      mem_assq,
      remove_assoc,
      remove_assq,
      split,
      combine,
      sort,
      stable_sort,
      fast_sort,
      sort_uniq,
      merge,
      to_seq,
      of_seq],
     "Stdlib__ListLabels");
   return;
  }
  (globalThis));

//# 16 "../.js/default/re/re.cma.js"
//# shape: Re__Fmt:[F(4),F(2),F(2),F(3),F(2),F(2),F(2),F(4),F(5),F(4),F(2),F(4),F(3),F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Format = global_data.Stdlib__Format,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Array = global_data.Stdlib__Array,
    pp_print_string = Stdlib_Format[13],
    pp_print_int = Stdlib_Format[19],
    pp_print_space = Stdlib_Format[28],
    pp_print_list = Stdlib_Format[132],
    fprintf = Stdlib_Format[139];
   function array(pp_sep, f, fmt, arr){
    return pp_print_list(pp_sep, f, fmt, Stdlib_Array[10].call(null, arr));
   }
   var
    cst_3 = "<3>",
    cst = "@ ",
    a =
      [0,
       [18,
        [1, [0, [11, cst_3, 0], cst_3]],
        [12, 40, [2, 0, [17, [0, cst, 1, 0], [15, [12, 41, [17, 0, 0]]]]]]],
       "@[<3>(%s@ %a)@]"];
   function sexp(fmt, s, pp, x){return caml_call3(fprintf(fmt)(a), s, pp, x);}
   var cst_S = "%S", b = [0, [3, 0, 0], cst_S];
   function bytes(fmt, t){
    var a = Stdlib_Bytes[6].call(null, t);
    return caml_call1(Stdlib_Format[139].call(null, fmt)(b), a);
   }
   function pair(pp1, pp2, fmt, param){
    var v2 = param[2], v1 = param[1];
    caml_call2(pp1, fmt, v1);
    pp_print_space(fmt, 0);
    return caml_call2(pp2, fmt, v2);
   }
   function triple(pp1, pp2, pp3, fmt, param){
    var v3 = param[3], v2 = param[2], v1 = param[1];
    caml_call2(pp1, fmt, v1);
    pp_print_space(fmt, 0);
    caml_call2(pp2, fmt, v2);
    pp_print_space(fmt, 0);
    return caml_call2(pp3, fmt, v3);
   }
   var c = [0, [15, 0], "%a"];
   function opt(f, fmt, x){
    if(! x) return pp_print_string(fmt, "<None>");
    var x$0 = x[1];
    return caml_call2(fprintf(fmt)(c), f, x$0);
   }
   var d = [0, [17, [0, cst, 1, 0], [4, 0, 0, 0, 0]], "@ %d"];
   function optint(fmt, param){
    if(! param) return 0;
    var i = param[1];
    return caml_call1(fprintf(fmt)(d), i);
   }
   var e = [0, [0, 0], "%c"];
   function char(fmt, c){
    return caml_call1(Stdlib_Format[139].call(null, fmt)(e), c);
   }
   var bool = Stdlib_Format[25];
   function lit(s, fmt, param){return pp_print_string(fmt, s);}
   function to_to_string(pp, x){
    var
     b = Stdlib_Buffer[1].call(null, 16),
     fmt = Stdlib_Format[116].call(null, b);
    caml_call2(pp, fmt, x);
    return Stdlib_Buffer[2].call(null, b);
   }
   var f = [0, [3, 0, 0], cst_S];
   function quoted_string(fmt, s){
    return caml_call1(Stdlib_Format[139].call(null, fmt)(f), s);
   }
   runtime.caml_register_global
    (11,
     [0,
      sexp,
      pp_print_string,
      optint,
      opt,
      char,
      bool,
      pp_print_int,
      pair,
      triple,
      pp_print_list,
      bytes,
      array,
      lit,
      to_to_string,
      quoted_string],
     "Re__Fmt");
   return;
  }
  (globalThis));

//# 133 "../.js/default/re/re.cma.js"
//# shape: Re__Bit_vector:[F(1)*,F(3),F(1),F(2),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_unsafe_get = runtime.caml_bytes_unsafe_get;
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Fmt = global_data.Re__Fmt,
    Stdlib_Format = global_data.Stdlib__Format,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib = global_data.Stdlib,
    Stdlib_Char = global_data.Stdlib__Char;
   function length(t){return t[1];}
   function set(v, n, b){
    var a = n < 0, d = a || v[1] <= n;
    if(d) Stdlib[1].call(null, "Bit_vector.set");
    var
     i = n >>> 3 | 0,
     s = v[2],
     c = caml_bytes_unsafe_get(s, i),
     mask = 1 << (n & 7),
     x = b ? c | mask : c & Stdlib[21].call(null, mask),
     s$0 = v[2];
    runtime.caml_bytes_unsafe_set(s$0, i, Stdlib_Char[1].call(null, x));
    return 0;
   }
   function get(v, n){
    var a = n < 0, b = a || v[1] <= n;
    if(b) Stdlib[1].call(null, "Bit_vector.get");
    var i = n >>> 3 | 0, s = v[2];
    return 0 < (caml_bytes_unsafe_get(s, i) & 1 << (n & 7)) ? 1 : 0;
   }
   function reset_zero(t){
    return Stdlib_Bytes[10].call
            (null, t[2], 0, runtime.caml_ml_bytes_length(t[2]), 0);
   }
   function create_zero(len){
    var
     r = len & 7,
     q = len >>> 3 | 0,
     len$0 = 0 === r ? q : q + 1 | 0,
     bits = Stdlib_Bytes[1].call(null, len$0, 0);
    return [0, len, bits];
   }
   var a = [0, [15, [17, 4, [15, [17, 4, 0]]]], "%a@.%a@."];
   function pp(fmt, param){
    var bits = param[2], len = param[1];
    function len$0(fmt, param){
     return Re_Fmt[1].call(null, fmt, "len", Re_Fmt[7], len);
    }
    function bits$0(fmt, param){
     return Re_Fmt[1].call(null, fmt, "bits", Re_Fmt[11], bits);
    }
    return caml_call4
            (Stdlib_Format[139].call(null, fmt)(a), len$0, 0, bits$0, 0);
   }
   runtime.caml_register_global
    (10, [0, length, set, create_zero, get, reset_zero, pp], "Re__Bit_vector");
   return;
  }
  (globalThis));

//# 203 "../.js/default/re/re.cma.js"
//# shape: Re__Dyn:[F(2)*,F(1)*,F(1)*,F(2)*,F(1)*,F(1)*,F(1)*,F(3),F(2)]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function variant(x, y){return [5, x, y];}
   function list(x){return [4, x];}
   function int(x){return [0, x];}
   function pair(x, y){return [1, [0, x, [0, y, 0]]];}
   function record(fields){return [6, fields];}
   function enum$(x){return [2, x];}
   function string(s){return [3, s];}
   function result(ok, err, param){
    if(0 === param[0]){
     var s = param[1], y = [0, caml_call1(ok, s), 0];
     return [5, "Ok", y];
    }
    var e = param[1], y$0 = [0, caml_call1(err, e), 0];
    return [5, "Error", y$0];
   }
   function option(f, param){
    if(! param) return [2, "None"];
    var s = param[1], y = [0, caml_call1(f, s), 0];
    return [5, "Some", y];
   }
   runtime.caml_register_global
    (4,
     [0, variant, list, int, pair, record, enum$, string, result, option],
     "Re__Dyn");
   return;
  }
  (globalThis));

//# 243 "../.js/default/re/re.cma.js"
//# shape: Re__Category:[F(2)*,F(1)*,N,N,N,N,N,N,N,F(1)*,F(2)*,F(2)*,F(2)*,F(2),F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    global_data = runtime.caml_get_global_data(),
    Stdlib_Format = global_data.Stdlib__Format,
    Re_Dyn = global_data.Re__Dyn;
   function equal(x, y){return x === y ? 1 : 0;}
   var compare = runtime.caml_int_compare;
   function to_int(x){return x;}
   var pp = Stdlib_Format[19];
   function intersect(x, y){return 0 !== (x & y) ? 1 : 0;}
   function symbol(x, y){return x | y;}
   var to_dyn = Re_Dyn[3], letter = 2, not_letter = 4;
   function from_char(param){
    a:
    {
     if(170 <= param)
      if(187 <= param){
       var a = param - 192 | 0;
       if(54 < a >>> 0){if(56 > a) break a;} else if(23 === a) break a;
      }
      else{var c = param - 171 | 0; if(14 >= c >>> 0 && 10 !== c) break a;}
     else if(65 <= param){
      var b = param - 91 | 0;
      if(5 < b >>> 0){if(32 <= b) break a;} else if(4 !== b) break a;
     }
     else{
      if(48 > param){if(10 === param) return 12; break a;}
      if(58 <= param) break a;
     }
     return letter;
    }
    return not_letter;
   }
   runtime.caml_register_global
    (2,
     [0,
      symbol,
      from_char,
      -1,
      1,
      letter,
      not_letter,
      8,
      16,
      32,
      to_int,
      equal,
      compare,
      intersect,
      pp,
      to_dyn],
     "Re__Category");
   return;
  }
  (globalThis));

//# 305 "../.js/default/re/re.cma.js"
//# shape: Re__Dense_map:[F(2)->F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    Stdlib_Array = runtime.caml_get_global_data().Stdlib__Array;
   function make(size, f){
    var cache = Stdlib_Array[1].call(null, size, f);
    return function(i){return runtime.caml_check_bound(cache, i)[i + 1];};
   }
   runtime.caml_register_global(1, [0, make], "Re__Dense_map");
   return;
  }
  (globalThis));

//# 323 "../.js/default/re/re.cma.js"
//# shape: Re__Import:[[F(2),F(2)],[F(2)*],F(2)*,N,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,[N,N,N,F(1)*,N,N,F(1)*,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*,F(2)*,F(1)*]]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    global_data = runtime.caml_get_global_data();
   global_data.Stdlib__Hashtbl;
   var
    Stdlib_Int = global_data.Stdlib__Int,
    equal = runtime.caml_equal,
    compare = runtime.caml_compare;
   function equal$0(b, a){return b === a ? 1 : 0;}
   var symbol = Stdlib_Int[8];
   function symbol$0(x, y){return x < y ? 1 : 0;}
   function symbol$1(x, y){return y < x ? 1 : 0;}
   var
    min = Stdlib_Int[10],
    max = Stdlib_Int[11],
    compare$0 = Stdlib_Int[9],
    zero = Stdlib_Int[1],
    one = Stdlib_Int[2],
    minus_one = Stdlib_Int[3],
    abs = Stdlib_Int[4],
    max_int = Stdlib_Int[5],
    min_int = Stdlib_Int[6],
    lognot = Stdlib_Int[7],
    equal$1 = Stdlib_Int[8],
    compare$1 = Stdlib_Int[9],
    min$0 = Stdlib_Int[10],
    max$0 = Stdlib_Int[11],
    to_string = Stdlib_Int[12],
    seeded_hash = Stdlib_Int[13],
    hash = Stdlib_Int[14];
   runtime.caml_register_global
    (3,
     [0,
      [0, equal, compare],
      [0, equal$0],
      symbol,
      [0, 874682015, 0],
      symbol$0,
      symbol$1,
      min,
      max,
      compare$0,
      [0,
       zero,
       one,
       minus_one,
       abs,
       max_int,
       min_int,
       lognot,
       equal$1,
       compare$1,
       min$0,
       max$0,
       to_string,
       seeded_hash,
       hash]],
     "Re__Import");
   return;
  }
  (globalThis));

//# 391 "../.js/default/re/re.cma.js"
//# shape: Re__Cset:[F(2)*,F(1)*,F(1)*,F(1),F(1)*,N,F(2),F(2),F(2),F(1),F(1),F(2),F(2),N,N,F(2),F(2),F(1),N,N,N,N,N,N,F(2),F(1),N,N,N,N,N,N,N,N,N,N,N,N,F(1)*->F(1),F(1)*,F(3),F(1),F(2),N,N,F(1),F(1)*,F(3),F(1),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Import = global_data.Re__Import,
    Stdlib = global_data.Stdlib,
    Assert_failure = global_data.Assert_failure,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Re_Dyn = global_data.Re__Dyn,
    Re_Fmt = global_data.Re__Fmt,
    Stdlib_Format = global_data.Stdlib__Format,
    Stdlib_Char = global_data.Stdlib__Char,
    Re_Dense_map = global_data.Re__Dense_map,
    Stdlib_Map = global_data.Stdlib__Map,
    equal_c = Re_Import[10][8];
   function to_int(x){return x;}
   function of_int(x){return x;}
   function to_char(t){return Stdlib_Char[1].call(null, t);}
   function of_char(c){return c;}
   function compare_pair(a, param){
    var
     y = param[2],
     x = param[1],
     y$0 = a[2],
     x$0 = a[1],
     x$1 = Re_Import[10][9].call(null, x$0, x);
    return 0 === x$1 ? Re_Import[10][9].call(null, y$0, y) : x$1;
   }
   function equal_pair(b, param){
    var
     y = param[2],
     x = param[1],
     y$0 = b[2],
     x$0 = b[1],
     a = Re_Import[10][8].call(null, x$0, x);
    return a ? Re_Import[10][8].call(null, y$0, y) : a;
   }
   function equal(x, y){
    return Stdlib_ListLabels[16].call(null, equal_pair, x, y);
   }
   function compare(x, y){
    return Stdlib_ListLabels[17].call(null, compare_pair, x, y);
   }
   function union(l$3, l$4){
    var l$0 = l$3, l = l$4;
    for(;;){
     if(! l) return l$0;
     if(! l$0) return l;
     var
      r = l[2],
      a = l[1],
      c2 = a[2],
      c1 = a[1],
      r$0 = l$0[2],
      match = l$0[1],
      c2$0 = match[2],
      c1$0 = match[1];
     if(Re_Import[5].call(null, c2$0 + 1 | 0, c1))
      return [0, [0, c1$0, c2$0], union(r$0, l)];
     if(Re_Import[5].call(null, c2 + 1 | 0, c1$0))
      return [0, [0, c1, c2], union(l$0, r)];
     if(Re_Import[5].call(null, c2$0, c2)){
      var l$1 = [0, [0, Re_Import[7].call(null, c1$0, c1), c2], r];
      l$0 = r$0;
      l = l$1;
     }
     else{
      var l$2 = [0, [0, Re_Import[7].call(null, c1$0, c1), c2$0], r$0];
      l$0 = l$2;
      l = r;
     }
    }
   }
   function inter(l$1, l$2){
    var l$0 = l$1, l = l$2;
    for(;;){
     if(! l) return 0;
     if(! l$0) return 0;
     var
      r = l[2],
      a = l[1],
      c2 = a[2],
      c1 = a[1],
      r$0 = l$0[2],
      match = l$0[1],
      c2$0 = match[2],
      c1$0 = match[1];
     if(Re_Import[5].call(null, c2$0, c1))
      l$0 = r$0;
     else{
      if(! Re_Import[5].call(null, c2, c1$0)){
       if(Re_Import[5].call(null, c2$0, c2)){
        var b = inter(r$0, l);
        return [0, [0, Re_Import[8].call(null, c1$0, c1), c2$0], b];
       }
       var c = inter(l$0, r);
       return [0, [0, Re_Import[8].call(null, c1$0, c1), c2], c];
      }
      l = r;
     }
    }
   }
   function diff(l$1, l$2){
    var l$0 = l$1, l = l$2;
    for(;;){
     if(! l) return l$0;
     if(! l$0) return 0;
     var
      r = l[2],
      a = l[1],
      c2 = a[2],
      c1 = a[1],
      r$0 = l$0[2],
      match = l$0[1],
      c2$0 = match[2],
      c1$0 = match[1];
     if(Re_Import[5].call(null, c2$0, c1))
      return [0, [0, c1$0, c2$0], diff(r$0, l)];
     if(Re_Import[5].call(null, c2, c1$0))
      l = r;
     else{
      var
       r$1 =
         Re_Import[5].call(null, c2, c2$0)
          ? [0, [0, c2 + 1 | 0, c2$0], r$0]
          : r$0;
      if(Re_Import[5].call(null, c1$0, c1))
       return [0, [0, c1$0, c1 - 1 | 0], diff(r$1, r)];
      l$0 = r$1;
      l = r;
     }
    }
   }
   function single(c){return [0, [0, c, c], 0];}
   var single$0 = Re_Dense_map[1].call(null, 257, single);
   function csingle(i){return caml_call1(single$0, i);}
   function add(c, l){return union(caml_call1(single$0, c), l);}
   function offset(o, l){
    if(! l) return 0;
    var r = l[2], match = l[1], c2 = match[2], c1 = match[1];
    return [0, [0, c1 + o | 0, c2 + o | 0], offset(o, r)];
   }
   var empty = 0;
   function union_all(ts){
    return Stdlib_ListLabels[26].call(null, union, empty, ts);
   }
   var cany = [0, [0, 0, 255], 0];
   function intersect_all(ts){
    return Stdlib_ListLabels[26].call(null, inter, cany, ts);
   }
   function mem(c, s$0){
    var s = s$0;
    for(;;){
     if(! s) return 0;
     var rem = s[2], match = s[1], c2 = match[2], c1 = match[1];
     if(c <= c2) return c1 <= c ? 1 : 0;
     s = rem;
    }
   }
   function hash_rec(param){
    if(! param) return 0;
    var r = param[2], match = param[1], j = match[2], i = match[1];
    return (i + (13 * j | 0) | 0) + (257 * hash_rec(r) | 0) | 0;
   }
   function hash(l){return hash_rec(l) & 1073741823;}
   var
    a = [0, [4, 0, 0, 0, 0], "%d"],
    b = [0, [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]], "%d-%d"];
   function print_one(ch, param){
    var c2 = param[2], c1 = param[1];
    return Re_Import[10][8].call(null, c1, c2)
            ? caml_call1(Stdlib_Format[139].call(null, ch)(a), c1)
            : caml_call2(Stdlib_Format[139].call(null, ch)(b), c1, c2);
   }
   function pp(ts){
    var
     a = Re_Fmt[13],
     b = [0, function(b, c){return a(", ", b, c);}],
     c = Re_Fmt[10];
    return function(a){return c(b, print_one, ts, a);};
   }
   function to_dyn(t){
    if(t && ! t[2]){
     var match = t[1], y = match[2], x = match[1];
     if(Re_Import[10][8].call(null, x, y)) return Re_Dyn[3].call(null, x);
    }
    var
     a =
       Stdlib_ListLabels[20].call
        (null,
         function(param){
          var
           y = param[2],
           x = param[1],
           a = Re_Dyn[3].call(null, y),
           b = Re_Dyn[3].call(null, x);
          return Re_Dyn[4].call(null, b, a);
         },
         t);
    return Re_Dyn[2].call(null, a);
   }
   function iter(t$0, f){
    var t = t$0;
    for(;;){
     if(! t) return 0;
     var xs = t[2], match = t[1], y = match[2], x = match[1];
     caml_call2(f, x, y);
     t = xs;
    }
   }
   function one_char(param){
    if(param && ! param[2]){
     var match = param[1], j = match[2], i = match[1];
     if(Re_Import[10][8].call(null, i, j)) return [0, i];
    }
    return 0;
   }
   function compare$0(a, param){
    var
     v = param[2],
     j = param[1],
     u = a[2],
     i = a[1],
     c = Re_Import[10][9].call(null, i, j);
    return 0 === c ? compare(u, v) : c;
   }
   var CSetMap = Stdlib_Map[1].call(null, [0, compare$0]);
   function fold_right(t, init, f){
    return Stdlib_ListLabels[27].call
            (null,
             function(param, acc){
              var y = param[2], x = param[1];
              return caml_call3(f, x, y, acc);
             },
             t,
             init);
   }
   function is_empty(param){return param ? 0 : 1;}
   var c = [0, "lib/cset.ml", 182, 9];
   function prepend(s$0, x$0, l){
    var s = s$0;
    for(;;){
     if(! s) return l;
     if(! l) return 0;
     var b = l[1], a = b[1];
     if(a && ! a[2]){
      var
       x = b[2],
       e = a[1],
       d = e[2],
       d$0 = e[1],
       r = s[2],
       match = s[1],
       c$0 = match[2],
       c$1 = match[1];
      if(! Re_Import[5].call(null, c$0, d$0)) break;
      s = r;
      continue;
     }
     throw caml_maybe_attach_backtrace([0, Assert_failure, c], 1);
    }
    var r$0 = l[2];
    if(c$1 > d$0)
     return Re_Import[6].call(null, c$1, d)
             ? [0, [0, [0, [0, d$0, d], 0], x], prepend(s, x$0, r$0)]
             : [0,
               [0, [0, [0, d$0, c$1 - 1 | 0], 0], x],
               prepend(s, x$0, [0, [0, [0, [0, c$1, d], 0], x], r$0])];
    if(Re_Import[5].call(null, c$0, d)){
     var f = prepend(r, x$0, [0, [0, [0, [0, c$0 + 1 | 0, d], 0], x], r$0]);
     return [0, [0, [0, [0, d$0, c$0], 0], Stdlib[37].call(null, x$0, x)], f];
    }
    var g = prepend(s, x$0, r$0);
    return [0, [0, [0, [0, d$0, d], 0], Stdlib[37].call(null, x$0, x)], g];
   }
   function pick(param){
    if(! param) return Stdlib[1].call(null, "Re_cset.pick");
    var x = param[1][1];
    return x;
   }
   function cseq(c$0, c){
    return runtime.caml_lessequal(c$0, c)
            ? [0, [0, c$0, c], 0]
            : [0, [0, c, c$0], 0];
   }
   var
    d = [0, cseq(216, 222), 0],
    e = [0, cseq(192, 214), d],
    upper = union_all([0, cseq(65, 90), e]),
    clower = offset(32, upper),
    cdigit = cseq(48, 57),
    ascii = cseq(0, 127);
   function cadd(c, s){return add(c, s);}
   var
    space = add(32, cseq(9, 13)),
    f = [0, cseq(65, 70), 0],
    xdigit = union_all([0, cdigit, [0, cseq(97, 102), f]]),
    g = union(clower, upper),
    calpha =
      Stdlib_ListLabels[27].call
       (null, cadd, [0, 170, [0, 181, [0, 186, [0, 223, [0, 255, 0]]]]], g),
    calnum = union(calpha, cdigit);
   function case_insens(s){
    var a = [0, offset(-32, inter(s, clower)), 0];
    return union_all([0, s, [0, offset(32, inter(s, upper)), a]]);
   }
   var
    cword = add(95, calnum),
    notnl = diff(cany, caml_call1(single$0, 10)),
    nl = caml_call1(single$0, 10);
   function set(str){
    var a = runtime.caml_ml_string_length(str) - 1 | 0;
    if(a < 0)
     var s$0 = empty;
    else{
     var s = empty, i = 0;
     for(;;){
      var
       i$0 = runtime.caml_string_get(str, i),
       b = union(caml_call1(single$0, i$0), s),
       c = i + 1 | 0;
      if(a === i){var s$0 = b; break;}
      s = b;
      i = c;
     }
    }
    return s$0;
   }
   var
    blank = set("\t "),
    h = [0, cseq(248, 255), 0],
    i = [0, cseq(223, 246), h],
    j = [0, caml_call1(single$0, 181), i],
    lower = union_all([0, cseq(97, 122), j]),
    k = [0, caml_call1(single$0, 186), 0],
    alpha =
      union_all([0, lower, [0, upper, [0, caml_call1(single$0, 170), k]]]),
    alnum = union_all([0, alpha, [0, cdigit, 0]]),
    wordc = union_all([0, alnum, [0, caml_call1(single$0, 95), 0]]),
    l = [0, cseq(127, 159), 0],
    cntrl = union_all([0, cseq(0, 31), l]),
    m = [0, cseq(160, 255), 0],
    graph = union_all([0, cseq(33, 126), m]),
    n = [0, cseq(160, 255), 0],
    print = union_all([0, cseq(32, 126), n]),
    o = [0, caml_call1(single$0, 247), 0],
    p = [0, caml_call1(single$0, 215), o],
    q = [0, cseq(187, 191), p],
    r = [0, cseq(182, 185), q],
    s = [0, cseq(171, 180), r],
    t = [0, cseq(160, 169), s],
    u = [0, cseq(123, 126), t],
    v = [0, cseq(91, 96), u],
    w = [0, cseq(58, 64), v],
    punct = union_all([0, cseq(33, 47), w]);
   runtime.caml_register_global
    (18,
     [0,
      equal_c,
      to_int,
      of_int,
      to_char,
      of_char,
      -1,
      equal,
      iter,
      union,
      union_all,
      intersect_all,
      inter,
      diff,
      empty,
      single$0,
      add,
      mem,
      case_insens,
      cdigit,
      calpha,
      cword,
      notnl,
      ascii,
      nl,
      cseq,
      set,
      blank,
      space,
      xdigit,
      lower,
      upper,
      alpha,
      alnum,
      wordc,
      cntrl,
      graph,
      print,
      punct,
      pp,
      one_char,
      fold_right,
      hash,
      compare,
      CSetMap,
      cany,
      csingle,
      is_empty,
      prepend,
      pick,
      offset,
      to_dyn],
     "Re__Cset");
   return;
  }
  (globalThis));

//# 827 "../.js/default/re/re.cma.js"
//# shape: Re__Hash_set:[F(1)*,F(1),F(2),F(2),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length;
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Fmt = global_data.Re__Fmt,
    Re_Import = global_data.Re__Import,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_Format = global_data.Stdlib__Format,
    Stdlib_Option = global_data.Stdlib__Option,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Assert_failure = global_data.Assert_failure;
   function length(t){return caml_ml_bytes_length(t) / 8 | 0;}
   function unsafe_get(t, i){
    return runtime.caml_int64_to_int32
            (Stdlib_Bytes[70].call(null, t, i * 8 | 0));
   }
   function unsafe_set(t, i, x){
    return Stdlib_Bytes[84].call
            (null, t, i * 8 | 0, runtime.caml_int64_of_int32(x));
   }
   function make_absent(len){
    return Stdlib_Bytes[1].call(null, len * 8 | 0, 255);
   }
   function init(t$0){
    if(Stdlib_Option[10].call(null, t$0[1])){
     var t = runtime.caml_create_bytes(0), a = length(t) - 1 | 0;
     if(a >= 0){
      var i = 0;
      for(;;){
       unsafe_set(t, i, -1);
       var b = i + 1 | 0;
       if(a === i) break;
       i = b;
      }
     }
     t$0[1] = Stdlib_Option[2].call(null, [0, t, 0]);
    }
    return Stdlib_Option[4].call(null, t$0[1]);
   }
   var x = make_absent(1), b = unsafe_get(x, 0), absent = -1;
   if(! Re_Import[3].call(null, b, absent))
    throw caml_maybe_attach_backtrace
           ([0, Assert_failure, [0, "lib/hash_set.ml", 60, 2]], 1);
   function create(param){return [0, 0];}
   function index_of_offset(slots, index, i){
    var i$0 = index + i[1] | 0;
    return slots <= i$0 ? i$0 - slots | 0 : i$0;
   }
   function clear(t){
    var match = t[1];
    if(! match) return 0;
    var t$0 = match[1];
    t$0[2] = 0;
    var t$1 = t$0[1];
    return Stdlib_Bytes[10].call(null, t$1, 0, caml_ml_bytes_length(t$1), 255);
   }
   function a(t, x){
    var
     hash = Re_Import[10][14].call(null, x),
     slots = length(t[1]),
     index = hash & (slots - 1 | 0),
     inserting = 1,
     i = [0, 0];
    for(;;){
     if(! inserting){t[2] = t[2] + 1 | 0; return 0;}
     var idx = index_of_offset(slots, index, i), elem = unsafe_get(t[1], idx);
     if(Re_Import[3].call(null, elem, absent)){unsafe_set(t[1], idx, x); inserting = 0;
     }
     else
      i[1]++;
    }
   }
   function add(t, x){
    var
     t$0 = init(t),
     slots = length(t$0[1]),
     c = Re_Import[3].call(null, slots, 0);
    if(c)
     var b = c;
    else{
     var d = Re_Import[6].call(null, t$0[2], 0);
     if(d)
      var
       f = runtime.caml_div(slots, t$0[2]),
       b = Re_Import[5].call(null, f, 2);
     else
      var b = d;
    }
    if(b){
     var
      old_table = t$0[1],
      slots$0 = length(old_table),
      g = Re_Import[3].call(null, slots$0, 0) ? 1 : slots$0 << 1,
      table = make_absent(g);
     t$0[1] = table;
     var e = slots$0 - 1 | 0;
     if(e >= 0){
      var i = 0;
      for(;;){
       var elem = unsafe_get(old_table, i);
       if(elem !== -1) a(t$0, elem);
       var h = i + 1 | 0;
       if(e === i) break;
       i = h;
      }
     }
    }
    return a(t$0, x);
   }
   function is_empty(t){
    var t$0 = t[1];
    if(Stdlib_Option[10].call(null, t$0)) return 1;
    var t$1 = Stdlib_Option[4].call(null, t$0);
    return Re_Import[3].call(null, t$1[2], 0);
   }
   function mem(t, x){
    var t$0 = t[1];
    if(! Stdlib_Option[10].call(null, t$0)){
     var a = Stdlib_Option[4].call(null, t$0)[2];
     if(! Re_Import[3].call(null, a, 0)){
      var
       t$1 = Stdlib_Option[4].call(null, t$0),
       hash = Re_Import[10][14].call(null, x),
       slots = length(t$1[1]),
       index = hash & (slots - 1 | 0),
       found = 0,
       i = [0, 0];
      for(;;){
       if(! found && Re_Import[5].call(null, i[1], slots)){
        var
         idx = index_of_offset(slots, index, i),
         elem = unsafe_get(t$1[1], idx);
        if(Re_Import[10][8].call(null, elem, x)){found = 1; continue;}
        if(Re_Import[10][8].call(null, elem, absent)){i[1] = slots; continue;}
        i[1]++;
        continue;
       }
       return found;
      }
     }
    }
    return 0;
   }
   var c = [0, [15, [17, 4, [15, [17, 4, 0]]]], "%a@.%a@."];
   function pp(fmt, t){
    var
     match = init(t),
     table = match[1],
     size = match[2],
     a = length(table) - 1 | 0,
     init$0 = 0;
    if(a < 0)
     var init$2 = init$0;
    else{
     var init$1 = init$0, i = 0;
     for(;;){
      var
       i$0 = unsafe_get(table, i),
       b = Re_Import[3].call(null, i$0, absent) ? init$1 : [0, i$0, init$1],
       d = i + 1 | 0;
      if(a === i){var init$2 = b; break;}
      init$1 = b;
      i = d;
     }
    }
    var
     e = Stdlib_ListLabels[10].call(null, init$2),
     table$0 = Stdlib_Array[11].call(null, e);
    function table$1(fmt, param){
     var a = Re_Fmt[7], b = Re_Fmt[12];
     return Re_Fmt[1].call
             (null,
              fmt,
              "table",
              function(c, d){return b(0, a, c, d);},
              table$0);
    }
    function size$0(fmt, param){
     return Re_Fmt[1].call(null, fmt, "size", Re_Fmt[7], size);
    }
    return caml_call4
            (Stdlib_Format[139].call(null, fmt)(c), table$1, 0, size$0, 0);
   }
   runtime.caml_register_global
    (12, [0, create, is_empty, add, mem, clear, pp], "Re__Hash_set");
   return;
  }
  (globalThis));

//# 1030 "../.js/default/re/re.cma.js"
//# shape: Re__Mark_infos:[F(1),F(2),F(2),F(2),[F(1)*,F(1)*],F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound;
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Import = global_data.Re__Import,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels;
   function make(marks){
    var
     len =
       1
       +
        Stdlib_ListLabels[26].call
         (null,
          function(ma, param){
           var i = param[1];
           return Re_Import[8].call(null, ma, i);
          },
          -1,
          marks)
       | 0,
     t = runtime.caml_make_vect(len, -1);
    function set(param){
     var v = param[2], i = param[1];
     caml_check_bound(t, i)[i + 1] = v;
     return 0;
    }
    Stdlib_ListLabels[18].call(null, set, marks);
    return t;
   }
   function test(t, i){
    if(t.length - 1 <= (2 * i | 0)) return 0;
    var a = 2 * i | 0;
    return -1 !== caml_check_bound(t, a)[a + 1] ? 1 : 0;
   }
   function is_present(t){return 0 <= t ? 1 : 0;}
   function get_no_check(t){return t;}
   function start_offset(t, i){
    var start_i = 2 * i | 0;
    return t.length - 1 <= (start_i + 1 | 0)
            ? -1
            : caml_check_bound(t, start_i)[start_i + 1];
   }
   function stop_offset(t, i){
    var stop_i = (2 * i | 0) + 1 | 0;
    return t.length - 1 <= stop_i
            ? -1
            : caml_check_bound(t, stop_i)[stop_i + 1];
   }
   function offset(t, i){
    var start_i = 2 * i | 0, stop_i = start_i + 1 | 0;
    if(t.length - 1 <= stop_i) return 0;
    var start = caml_check_bound(t, start_i)[start_i + 1];
    if(Re_Import[3].call(null, start, -1)) return 0;
    var stop = caml_check_bound(t, stop_i)[stop_i + 1];
    return [0, [0, start, stop]];
   }
   function iteri(t, f){
    var a = ((t.length - 1) / 2 | 0) - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var idx = 2 * i | 0, start = caml_check_bound(t, idx)[idx + 1];
      if(-1 !== start){
       var b = idx + 1 | 0, stop = caml_check_bound(t, b)[b + 1];
       caml_call3(f, i, start, stop);
      }
      var c = i + 1 | 0;
      if(a === i) break;
      i = c;
     }
    }
    return 0;
   }
   runtime.caml_register_global
    (2,
     [0,
      make,
      offset,
      test,
      iteri,
      [0, is_present, get_no_check],
      start_offset,
      stop_offset],
     "Re__Mark_infos");
   return;
  }
  (globalThis));

//# 1130 "../.js/default/re/re.cma.js"
//# shape: Re__Pmark:[F(2)*,F(2)*,F(1),F(2),F(1)*,N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    global_data = runtime.caml_get_global_data();
   global_data.Stdlib__List;
   var
    Stdlib_Atomic = global_data.Stdlib__Atomic,
    Stdlib_Format = global_data.Stdlib__Format,
    Stdlib_Set = global_data.Stdlib__Set,
    Re_Dyn = global_data.Re__Dyn;
   function equal(x, y){return x === y ? 1 : 0;}
   var compare = runtime.caml_int_compare, r = Stdlib_Atomic[1].call(null, 1);
   function gen(param){return Stdlib_Atomic[7].call(null, r, 1);}
   var
    pp = Stdlib_Format[19],
    Set = Stdlib_Set[1].call(null, [0, compare]),
    empty = Set[1],
    add = Set[2],
    singleton = Set[3],
    remove = Set[4],
    union = Set[5],
    inter = Set[6],
    disjoint = Set[7],
    diff = Set[8],
    cardinal = Set[9],
    elements = Set[10],
    min_elt = Set[11],
    min_elt_opt = Set[12],
    max_elt = Set[13],
    max_elt_opt = Set[14],
    choose = Set[15],
    choose_opt = Set[16],
    find = Set[17],
    find_opt = Set[18],
    find_first = Set[19],
    find_first_opt = Set[20],
    find_last = Set[21],
    find_last_opt = Set[22],
    iter = Set[23],
    fold = Set[24],
    map = Set[25],
    filter = Set[26],
    filter_map = Set[27],
    partition = Set[28],
    split = Set[29],
    is_empty = Set[30],
    mem = Set[31],
    equal$0 = Set[32],
    compare$0 = Set[33],
    subset = Set[34],
    for_all = Set[35],
    exists = Set[36],
    to_list = Set[37],
    of_list = Set[38],
    to_seq_from = Set[39],
    to_seq = Set[40],
    to_rev_seq = Set[41],
    add_seq = Set[42],
    of_seq = Set[43],
    to_dyn = Re_Dyn[3];
   runtime.caml_register_global
    (5,
     [0,
      equal,
      compare,
      gen,
      pp,
      to_dyn,
      [0,
       empty,
       add,
       singleton,
       remove,
       union,
       inter,
       disjoint,
       diff,
       cardinal,
       elements,
       min_elt,
       min_elt_opt,
       max_elt,
       max_elt_opt,
       choose,
       choose_opt,
       find,
       find_opt,
       find_first,
       find_first_opt,
       find_last,
       find_last_opt,
       iter,
       fold,
       map,
       filter,
       filter_map,
       partition,
       split,
       is_empty,
       mem,
       equal$0,
       compare$0,
       subset,
       for_all,
       exists,
       of_list,
       to_seq_from,
       to_seq,
       to_rev_seq,
       add_seq,
       of_seq,
       to_list]],
     "Re__Pmark");
   return;
  }
  (globalThis));

//# 1252 "../.js/default/re/re.cma.js"
//# shape: Re__Automata:[N,N,N,F(1)*,F(2),N,F(2),F(1),F(2),F(4),F(1),F(4),F(2),F(2),F(3),F(2),F(2),F(2),N,[],N,N,F(4)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_trampoline = runtime.caml_trampoline,
    caml_trampoline_return = runtime.caml_trampoline_return,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   function caml_call6(f, a0, a1, a2, a3, a4, a5){
    return (f.l >= 0 ? f.l : f.l = f.length) === 6
            ? f(a0, a1, a2, a3, a4, a5)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Cset = global_data.Re__Cset,
    Re_Category = global_data.Re__Category,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Re_Import = global_data.Re__Import,
    Re_Bit_vector = global_data.Re__Bit_vector,
    Stdlib_Atomic = global_data.Stdlib__Atomic,
    Stdlib_Mutex = global_data.Stdlib__Mutex,
    Re_Dyn = global_data.Re__Dyn,
    Stdlib_Format = global_data.Stdlib__Format,
    Re_Fmt = global_data.Re__Fmt,
    Re_Mark_infos = global_data.Re__Mark_infos,
    Assert_failure = global_data.Assert_failure,
    Stdlib = global_data.Stdlib,
    Re_Pmark = global_data.Re__Pmark,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Re_Hash_set = global_data.Re__Hash_set;
   function hash_combine(h, accu){return (accu * 65599 | 0) + h | 0;}
   var equal = Re_Import[10][8], pp = Re_Fmt[7];
   function create(param){return [0, 0];}
   var b = Re_Hash_set[3], c = Re_Hash_set[4];
   function to_string(param){
    return -730718166 === param
            ? "long"
            : 332064784 <= param ? "first" : "short";
   }
   function to_dyn(t){var a = to_string(t); return Re_Dyn[6].call(null, a);}
   var equal$0 = Re_Import[1][1];
   function pp$0(ch, k){
    var a = to_string(k);
    return Stdlib_Format[13].call(null, ch, a);
   }
   function to_string$0(param){
    return 620821490 <= param ? "Non_greedy" : "Greedy";
   }
   function to_dyn$0(t){
    var a = to_string$0(t);
    return Re_Dyn[6].call(null, a);
   }
   function pp$1(fmt, t){
    var a = to_string$0(t);
    return Stdlib_Format[13].call(null, fmt, a);
   }
   var
    equal$1 = Re_Import[10][8],
    compare = Re_Import[10][9],
    pp$2 = Stdlib_Format[19],
    to_dyn$1 = Re_Dyn[3];
   function prev(x){return x - 1 | 0;}
   function next(x){return x + 1 | 0;}
   function next2(x){return x + 2 | 0;}
   function group_count(x){return x / 2 | 0;}
   var to_dyn$2 = Re_Dyn[3];
   function to_int(x){return x;}
   var pp$3 = Stdlib_Format[19], equal$2 = Re_Import[10][8];
   function wrap_sem(sem$0, sem, v){
    var name = to_string(sem);
    if(sem$0){var sem$1 = sem$0[1]; if(equal$0(sem$1, sem)) return v;}
    if(4 !== v[0]) return Re_Dyn[1].call(null, name, [0, v, 0]);
    var v$0 = v[1];
    return Re_Dyn[1].call(null, name, v$0);
   }
   function d(sem, param){
    if(typeof param === "number") return 0;
    switch(param[0]){
      case 0:
       var cs = param[1]; return [0, [0, cs], 0];
      case 2:
       var y = param[3], x = param[2], sem$0 = param[1];
       if(! equal$0(sem, sem$0)) throw Stdlib[8];
       var a = d(sem, y[2]);
       return [0, x[2], a];
      default: throw Stdlib[8];
    }
   }
   var i = [2, "Eps"];
   function dyn_of_def(sem){
    return function(param){
     if(typeof param === "number") return i;
     switch(param[0]){
       case 0:
        var cset = param[1]; return Re_Cset[51].call(null, cset);
       case 1:
        var
         alt = param[1],
         a =
           Stdlib_ListLabels[20].call
            (null, function(a){return to_dyn$3(sem, a);}, alt);
        return Re_Dyn[1].call(null, "Alt", a);
       case 2:
        var
         y = param[3],
         x = param[2],
         sem$0 = param[1],
         b = [0, sem$0],
         to_dyn = function(a){return to_dyn$3(b, a);},
         t = y[2];
        a:
        {
         try{var s = d(sem$0, t);}
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
          var match = 0;
          break a;
         }
         var match = [0, s];
        }
        var cst_Seq = "Seq";
        if(match)
         var
          y$0 = match[1],
          e = dyn_of_def(sem),
          f = Stdlib_ListLabels[20].call(null, e, y$0),
          g = [0, to_dyn(x), f],
          x$0 = Re_Dyn[1].call(null, cst_Seq, g);
        else
         var
          h = [0, to_dyn(y), 0],
          j = [0, to_dyn(x), h],
          x$0 = Re_Dyn[1].call(null, cst_Seq, j);
        return wrap_sem(sem, sem$0, x$0);
       case 3:
        var
         t$0 = param[3],
         sem$1 = param[2],
         k = [0, to_dyn$3([0, sem$1], t$0), 0];
        return wrap_sem(sem, sem$1, Re_Dyn[1].call(null, "Rep", k));
       case 4:
        var m = param[1], l = [0, to_dyn$1(m), 0];
        return Re_Dyn[1].call(null, "Mark", l);
       case 5:
        var
         y$1 = param[2],
         x$1 = param[1],
         n = [0, to_dyn$1(y$1), 0],
         o = [0, to_dyn$1(x$1), n];
        return Re_Dyn[1].call(null, "Erase", o);
       case 6:
        var c = param[1], p = [0, Re_Category[15].call(null, c), 0];
        return Re_Dyn[1].call(null, "Before", p);
       case 7:
        var c$0 = param[1], q = [0, Re_Category[15].call(null, c$0), 0];
        return Re_Dyn[1].call(null, "After", q);
       default:
        var m$0 = param[1], r = [0, Re_Pmark[5].call(null, m$0), 0];
        return Re_Dyn[1].call(null, "Pmark", r);
     }};
   }
   function to_dyn$3(sem, param){
    var def = param[2];
    return dyn_of_def(sem)(def);
   }
   function pp_with_sem(sem, ch, e){
    var match = e[2];
    if(typeof match === "number") return Re_Fmt[2].call(null, ch, "eps");
    switch(match[0]){
      case 0:
       var l = match[1];
       return Re_Fmt[1].call(null, ch, "cst", Re_Cset[39], l);
      case 1:
       var
        l$0 = match[1],
        a = function(a, b){return pp_with_sem(sem, a, b);},
        d = Re_Fmt[10];
       return Re_Fmt[1].call
               (null, ch, "alt", function(b, c){return d(0, a, b, c);}, l$0);
      case 2:
       var
        e$0 = match[3],
        e$1 = match[2],
        k = match[1],
        f = function(a, b){return pp_with_sem(sem, a, b);},
        g = function(a, b){return pp_with_sem(sem, a, b);},
        h = Re_Fmt[9];
       return Re_Fmt[1].call
               (null,
                ch,
                "seq",
                function(a, b){return h(pp$0, g, f, a, b);},
                [0, k, e$1, e$0]);
      case 3:
       var
        e$2 = match[3],
        k$0 = match[2],
        j = [0, k$0],
        m = function(a, b){return pp_with_sem(j, a, b);},
        n = Re_Fmt[8];
       return Re_Fmt[1].call
               (null,
                ch,
                "rep",
                function(a, b){return n(pp$0, m, a, b);},
                [0, k$0, e$2]);
      case 4:
       var i = match[1]; return Re_Fmt[1].call(null, ch, "mark", pp$2, i);
      case 5:
       var e$3 = match[2], b = match[1], o = Re_Fmt[8];
       return Re_Fmt[1].call
               (null,
                ch,
                "erase",
                function(a, b){return o(pp$2, pp$2, a, b);},
                [0, b, e$3]);
      case 6:
       var c = match[1];
       return Re_Fmt[1].call(null, ch, "before", Re_Category[14], c);
      case 7:
       var c$0 = match[1];
       return Re_Fmt[1].call(null, ch, "after", Re_Category[14], c$0);
      default:
       var i$0 = match[1];
       return Re_Fmt[1].call(null, ch, "pmark", Re_Pmark[4], i$0);
    }
   }
   function pp$4(a, b){return pp_with_sem(0, a, b);}
   function mk(ids, def){ids[1]++; return [0, ids[1], def];}
   var a = [1, 0];
   function empty(ids){return mk(ids, a);}
   function cst(ids, s){
    return Re_Cset[47].call(null, s) ? mk(ids, a) : mk(ids, [0, s]);
   }
   function eps(ids){return mk(ids, 0);}
   function rep(ids, kind, sem, x){return mk(ids, [3, kind, sem, x]);}
   function mark(ids, m){return mk(ids, [4, m]);}
   function pmark(ids, i){return mk(ids, [8, i]);}
   function erase(ids, m$0, m){return mk(ids, [5, m$0, m]);}
   function before(ids, c){return mk(ids, [6, c]);}
   function after(ids, c){return mk(ids, [7, c]);}
   function alt(ids, l){
    if(! l) return mk(ids, a);
    if(l[2]) return mk(ids, [1, l]);
    var c = l[1];
    return c;
   }
   function seq(ids, kind, x, y){
    var a = x[2], match = y[2];
    if(typeof a !== "number" && 1 === a[0] && ! a[1]) return x;
    if(typeof match !== "number" && 1 === match[0] && ! match[1]) return y;
    if(typeof a === "number") return y;
    if(typeof match === "number" && equal$0(kind, 332064784)) return x;
    return mk(ids, [2, kind, x, y]);
   }
   function is_eps(expr){return typeof expr[2] === "number" ? 1 : 0;}
   function rename(ids, x){
    var match = x[2];
    if(typeof match !== "number")
     switch(match[0]){
       case 1:
        var l = match[1];
        return mk
                (ids,
                 [1,
                  Stdlib_ListLabels[20].call
                   (null, function(a){return rename(ids, a);}, l)]);
       case 2:
        var z = match[3], y = match[2], k = match[1], a = rename(ids, z);
        return mk(ids, [2, k, rename(ids, y), a]);
       case 3:
        var y$0 = match[3], k$0 = match[2], g = match[1];
        return mk(ids, [3, g, k$0, rename(ids, y$0)]);
     }
    return mk(ids, x[2]);
   }
   var cst_marks = "marks";
   function to_dyn$4(param){
    var
     pmarks = param[2],
     marks = param[1],
     a = caml_call1(Re_Pmark[6][43], pmarks),
     e = Stdlib_ListLabels[20].call(null, Re_Pmark[5], a),
     b = [0, [0, "pmarks", Re_Dyn[2].call(null, e)], 0],
     c =
       Stdlib_ListLabels[20].call
        (null,
         function(param){
          var
           idx = param[2],
           m = param[1],
           a = to_dyn$2(idx),
           b = to_dyn$1(m);
          return Re_Dyn[4].call(null, b, a);
         },
         marks),
     d = [0, [0, cst_marks, Re_Dyn[2].call(null, c)], b];
    return Re_Dyn[5].call(null, d);
   }
   function equal$3(param, t){
    var
     pmarks = param[2],
     marks = param[1],
     a =
       Stdlib_ListLabels[16].call
        (null,
         function(b, param){
          var
           y = param[2],
           x = param[1],
           y$0 = b[2],
           x$0 = b[1],
           a = equal$1(x$0, x);
          return a ? equal$2(y$0, y) : a;
         },
         marks,
         t[1]);
    return a ? caml_call2(Re_Pmark[6][32], pmarks, t[2]) : a;
   }
   var empty$0 = [0, 0, Re_Pmark[6][1]];
   function f(acc, param){
    var i = param[2], a = param[1];
    return hash_combine(a, hash_combine(i, acc));
   }
   function hash(m, accu){
    var
     init = hash_combine(Stdlib_Hashtbl[28].call(null, m[2]), accu),
     l = m[1];
    return Stdlib_ListLabels[26].call(null, f, init, l);
   }
   var unknown = -1;
   function marks_set_idx(idx, marks){
    if(! marks) return 0;
    var rem = marks[2], match = marks[1], idx$0 = match[2], a = match[1];
    return equal$2(idx$0, unknown)
            ? [0, [0, a, idx], marks_set_idx(idx, rem)]
            : marks;
   }
   function marks_set_idx$0(marks, idx){
    var a = marks[2];
    return [0, marks_set_idx(idx, marks[1]), a];
   }
   var
    cst_2 = "<2>",
    cst$0 = "@ ",
    j = [0, [15, [12, 45, [15, 0]]], "%a-%a"],
    k =
      [0,
       [18,
        [1, [0, [11, cst_2, 0], cst_2]],
        [11, cst_marks, [17, [0, cst$0, 1, 0], [15, [17, 0, 0]]]]],
       "@[<2>marks@ %a@]"],
    l =
      [0,
       [18,
        [1, [0, [11, cst_2, 0], cst_2]],
        [11, "pmarks ", [15, [17, 0, 0]]]],
       "@[<2>pmarks %a@]"];
   function pp$5(fmt, param){
    var pmarks = param[2], marks = param[1];
    Stdlib_Format[1].call(null, fmt, 1);
    if(marks){
     var
      a =
        function(fmt, param){
         var i = param[2], a = param[1];
         return caml_call4
                 (Stdlib_Format[139].call(null, fmt)(j), pp$2, a, pp$3, i);
        },
      b = Stdlib_Format[132];
     caml_call2
      (Stdlib_Format[139].call(null, fmt)(k),
       function(c, d){return b(0, a, c, d);},
       marks);
    }
    var pmarks$0 = caml_call1(Re_Pmark[6][43], pmarks);
    if(pmarks$0){
     var c = Re_Pmark[4], d = Stdlib_Format[132];
     caml_call2
      (Stdlib_Format[139].call(null, fmt)(l),
       function(a, b){return d(0, c, a, b);},
       pmarks$0);
    }
    return Stdlib_Format[3].call(null, fmt, 0);
   }
   function equal_list(l1, l2){
    return Stdlib_ListLabels[16].call(null, equal$4, l1, l2);
   }
   function equal$4(x, y){
    switch(x[0]){
      case 0:
       var e1 = x[3], l1 = x[2];
       if(0 === y[0]){
        var e2 = y[3], l2 = y[2], a = equal(e1[1], e2[1]);
        return a ? equal_list(l1, l2) : a;
       }
       break;
      case 1:
       var e1$0 = x[2], marks1 = x[1];
       if(1 === y[0]){
        var e2$0 = y[2], marks2 = y[1], b = equal(e1$0[1], e2$0[1]);
        return b ? equal$3(marks1, marks2) : b;
       }
       break;
      default:
       var marks1$0 = x[1];
       if(2 === y[0]){
        var marks2$0 = y[1];
        return equal$3(marks1$0, marks2$0);
       }
    }
    return 0;
   }
   var letrec_function_context = [];
   function hash_list(l, init){
    return Stdlib_ListLabels[26].call
            (null, letrec_function_context[1], init, l);
   }
   function f$0(accu, x$1){
    switch(x$1[0]){
      case 0:
       var e = x$1[3], l = x$1[2], a = hash_list(l, accu), x = e[1];
       return hash_combine(388635598, hash_combine(x, a));
      case 1:
       var e$0 = x$1[2], marks = x$1[1], b = hash(marks, accu), x$0 = e$0[1];
       return hash_combine(726404471, hash_combine(x$0, b));
      default:
       var marks$0 = x$1[1];
       return hash_combine(471882453, hash(marks$0, accu));
    }
   }
   var g = Re_Hash_set[5], h = Re_Hash_set[1];
   runtime.caml_update_dummy(letrec_function_context, [0, f$0]);
   function e(sem, t){
    var
     a =
       Stdlib_ListLabels[20].call
        (null,
         function(param){
          switch(param[0]){
            case 0:
             var
              y = param[3],
              x = param[2],
              sem$0 = param[1],
              a = [0, to_dyn$3([0, sem$0], y), 0],
              b = [0, e([0, sem$0], x), a];
             return wrap_sem(sem, sem$0, Re_Dyn[1].call(null, "TSeq", b));
            case 1:
             var
              e$0 = param[2],
              marks = param[1],
              base = [0, to_dyn$3(sem, e$0), 0],
              e$1 =
                equal$3(empty$0, marks) ? base : [0, to_dyn$4(marks), base];
             return Re_Dyn[1].call(null, "TExp", e$1);
            default:
             var m = param[1], c = [0, to_dyn$4(m), 0];
             return Re_Dyn[1].call(null, "TMarks", c);
          }
         },
         t);
    return Re_Dyn[2].call(null, a);
   }
   function tseq(kind, x, y, rem){
    a:
    if(x){
     var a = x[1];
     if(1 === a[0] && typeof a[2][2] === "number" && ! x[2]){var marks = a[1], b = [0, [1, marks, y], 0]; break a;}
     var b = [0, [0, kind, x, y], 0];
    }
    else
     var b = 0;
    return Stdlib[37].call(null, b, rem);
   }
   function fold_right(t, init, f){
    if(! t) return init;
    var xs = t[2], x = t[1];
    return caml_call2(f, x, fold_right(xs, init, f));
   }
   function iter_marks(t, f){
    return Stdlib_ListLabels[18].call
            (null,
             function(e){
              if(0 === e[0]){var l = e[2]; return iter_marks(l, f);}
              var marks = e[1];
              return caml_call1(f, marks);
             },
             t);
   }
   var
    cst_TExp = "(TExp",
    m =
      [0,
       [18,
        [1, [0, [11, cst_2, 0], cst_2]],
        [11, "(TSeq", [17, [0, cst$0, 1, 0], [15, [17, [0, cst$0, 1, 0], 0]]]]],
       "@[<2>(TSeq@ %a@ "],
    n = [0, [17, [0, cst$0, 1, 0], [15, [12, 41, [17, 0, 0]]]], "@ %a)@]"],
    o =
      [0,
       [18,
        [1, [0, [11, cst_2, 0], cst_2]],
        [11,
         cst_TExp,
         [17,
          [0, cst$0, 1, 0],
          [15,
           [17,
            [0, cst$0, 1, 0],
            [12,
             40,
             [15,
              [12, 41, [17, [0, cst$0, 1, 0], [11, "(eps))", [17, 0, 0]]]]]]]]]]],
       "@[<2>(TExp@ %a@ (%a)@ (eps))@]"],
    p =
      [0,
       [18,
        [1, [0, [11, cst_2, 0], cst_2]],
        [11,
         cst_TExp,
         [17,
          [0, cst$0, 1, 0],
          [15,
           [17,
            [0, cst$0, 1, 0],
            [12,
             40,
             [15,
              [12, 41, [17, [0, cst$0, 1, 0], [15, [12, 41, [17, 0, 0]]]]]]]]]]]],
       "@[<2>(TExp@ %a@ (%a)@ %a)@]"],
    q =
      [0,
       [18,
        [1, [0, [11, cst_2, 0], cst_2]],
        [11, "(TMatch", [17, [0, cst$0, 1, 0], [15, [12, 41, [17, 0, 0]]]]]],
       "@[<2>(TMatch@ %a)@]"];
   function print_state_rec(ch, e, y){
    switch(e[0]){
      case 0:
       var x = e[3], l = e[2], sem = e[1];
       caml_call2(Stdlib_Format[139].call(null, ch)(m), pp$0, sem);
       print_state_lst(ch, l, x);
       return caml_call2(Stdlib_Format[139].call(null, ch)(n), pp$4, x);
      case 1:
       var marks = e[1];
       if(typeof e[2][2] === "number"){
        var a = y[1];
        return caml_call4
                (Stdlib_Format[139].call(null, ch)(o), pp, a, pp$5, marks);
       }
       var x$0 = e[2], b = x$0[1];
       return caml_call6
               (Stdlib_Format[139].call(null, ch)(p),
                pp,
                b,
                pp$5,
                marks,
                pp$4,
                x$0);
      default:
       var marks$0 = e[1];
       return caml_call2(Stdlib_Format[139].call(null, ch)(q), pp$5, marks$0);
    }
   }
   var
    cst$1 = "()",
    r = [0, [17, [0, cst$0, 1, 0], [11, "| ", 0]], "@ | "],
    s = [0, [11, cst$1, 0], cst$1];
   function print_state_lst(ch, l, y){
    if(! l) return Stdlib_Format[139].call(null, ch)(s);
    var rem = l[2], e = l[1];
    print_state_rec(ch, e, y);
    return Stdlib_ListLabels[18].call
            (null,
             function(e){
              Stdlib_Format[139].call(null, ch)(r);
              return print_state_rec(ch, e, y);
             },
             rem);
   }
   var zero = 0;
   function pp$6(ch, t){return print_state_lst(ch, [0, t, 0], [0, zero, 0]);}
   function first_match(param$0){
    var param = param$0;
    for(;;){
     if(! param) return 0;
     var match = param[1];
     if(2 === match[0]){var marks = match[1]; return [0, marks];}
     var r = param[2];
     param = r;
    }
   }
   function remove_matches(t){
    return Stdlib_ListLabels[44].call
            (null, function(param){return 2 === param[0] ? 0 : 1;}, t);
   }
   function set_idx(idx, xs){
    return Stdlib_ListLabels[20].call
            (null,
             function(param){
              switch(param[0]){
                case 0:
                 var x = param[3], l = param[2], kind = param[1];
                 return [0, kind, set_idx(idx, l), x];
                case 1:
                 var x$0 = param[2], marks = param[1];
                 return [1, marks_set_idx$0(marks, idx), x$0];
                default:
                 var marks$0 = param[1];
                 return [2, marks_set_idx$0(marks$0, idx)];
              }
             },
             xs);
   }
   function add_match(t, marks){return [0, [2, marks], t];}
   function loop(seen, l$2, y){
    var l = l$2;
    for(;;){
     if(! l) return 0;
     var x = l[1];
     switch(x[0]){
       case 0:
        var
         r = l[2],
         x$0 = x[3],
         l$0 = x[2],
         kind = x[1],
         l$1 = loop(seen, l$0, x$0),
         r$0 = loop(seen, r, y);
        return tseq(kind, l$1, x$0, r$0);
       case 1:
        if(typeof x[2][2] === "number"){
         var r$1 = l[2];
         if(! c(seen, y[1])){
          b(seen, y[1]);
          return [0, x, loop(seen, r$1, y)];
         }
         l = r$1;
        }
        else{
         var r$2 = l[2], x$1 = x[2];
         if(! c(seen, x$1[1])){
          b(seen, x$1[1]);
          return [0, x, loop(seen, r$2, y)];
         }
         l = r$2;
        }
        break;
       default: return [0, x, 0];
     }
    }
   }
   var u = [0, [12, 91, [15, [12, 93, 0]]], "[%a]"];
   function pp$7(fmt, t){
    var
     t$0 = t[3],
     a = Re_Fmt[13],
     b = [0, function(b, c){return a("; ", b, c);}],
     c = Stdlib_Format[132];
    return caml_call2
            (Stdlib_Format[139].call(null, fmt)(u),
             function(a, d){return c(b, pp$6, a, d);},
             t$0);
   }
   function idx(t){return t[1];}
   function to_dyn$5(t){var t$0 = t[3]; return e(0, t$0);}
   var empty$1 = 0, dummy = [0, unknown, Re_Category[3], empty$1, 0, -1];
   function mk$0(idx, cat, desc){
    return [0,
            idx,
            cat,
            desc,
            0,
            hash_list
             (desc,
              hash_combine
               (idx, hash_combine(Re_Category[10].call(null, cat), 0)))
            & 1073741823];
   }
   function create$0(cat, expr){
    return mk$0(0, cat, [0, [1, empty$0, expr], 0]);
   }
   function equal$5(param, t){
    var
     desc = param[3],
     category = param[2],
     idx = param[1],
     hash = param[5],
     b = Re_Import[10][8].call(null, hash, t[5]);
    if(b){
     var c = equal$2(idx, t[1]);
     if(c){
      var d = Re_Category[11].call(null, category, t[2]);
      if(d) return equal_list(desc, t[3]);
      var a = d;
     }
     else
      var a = c;
    }
    else
     var a = b;
    return a;
   }
   function status_no_mutex(s){
    var match$0 = s[4];
    if(match$0){var s$0 = match$0[1]; return s$0;}
    var param = s[3];
    if(param){
     var match = param[1];
     if(2 === match[0])
      var
       m = match[1],
       a = m[2],
       st = [0, Re_Mark_infos[1].call(null, m[1]), a];
     else
      var st = 1;
    }
    else
     var st = 0;
    s[4] = [0, st];
    return st;
   }
   function status(m, s){
    var match = s[4];
    if(match){var s$0 = match[1]; return s$0;}
    Stdlib_Mutex[2].call(null, m);
    var st = status_no_mutex(s);
    Stdlib_Mutex[4].call(null, m);
    return st;
   }
   function hash$0(t){return t[5];}
   var Table = Stdlib_Hashtbl[26].call(null, [0, equal$5, hash$0]);
   function create$1(param){
    var a = Stdlib_Atomic[1].call(null, 0), b = h(0);
    return [0, Re_Bit_vector[3].call(null, 1), b, a];
   }
   function index_count(w){return Stdlib_Atomic[3].call(null, w[3]);}
   var eps_expr = [0, zero, 0];
   function delta_expr$0(counter, ctx, marks, x, rem){
    var c = ctx[1], match = x[2];
    if(typeof match === "number") return add_match(rem, marks);
    switch(match[0]){
      case 0:
       var s = match[1];
       return Re_Cset[17].call(null, c, s)
               ? [0, [1, marks, eps_expr], rem]
               : rem;
      case 1:
       var l = match[1];
       return Stdlib_ListLabels[27].call
               (null,
                function(a, b){return delta_expr(ctx, marks, a, b);},
                l,
                rem);
      case 2:
       var
        z = match[3],
        y = match[2],
        kind = match[1],
        y$0 = delta_expr(ctx, marks, y, empty$1);
       return counter < 50
               ? delta_seq$0(counter + 1 | 0, ctx, kind, y$0, z, rem)
               : caml_trampoline_return
                 (delta_seq$0, [0, ctx, kind, y$0, z, rem]);
      case 3:
       var
        y$1 = match[3],
        kind$0 = match[2],
        rep_kind = match[1],
        y$2 = delta_expr(ctx, marks, y$1, empty$1),
        match$0 = first_match(y$2);
       if(match$0)
        var
         marks$0 = match$0[1],
         marks$1 = marks$0,
         y$3 = remove_matches(y$2);
       else
        var marks$1 = marks, y$3 = y$2;
       return 620821490 <= rep_kind
               ? add_match(tseq(kind$0, y$3, x, rem), marks)
               : tseq(kind$0, y$3, x, add_match(rem, marks$1));
      case 4:
       var i = match[1], b = marks[2];
       return add_match
               (rem,
                [0,
                 [0,
                  [0, i, unknown],
                  Stdlib_ListLabels[56].call(null, i, marks[1])],
                 b]);
      case 5:
       var
        stop_inclusive = match[2],
        start_inclusive = match[1],
        a = marks[2];
       return add_match
               (rem,
                [0,
                 Stdlib_ListLabels[44].call
                  (null,
                   function(param){
                    var
                     i = param[1],
                     a = Re_Import[5].call(null, i, start_inclusive);
                    return a ? a : Re_Import[6].call(null, i, stop_inclusive);
                   },
                   marks[1]),
                 a]);
      case 6:
       var cat = match[1];
       return Re_Category[13].call(null, ctx[3], cat)
               ? add_match(rem, marks)
               : rem;
      case 7:
       var cat$0 = match[1];
       return Re_Category[13].call(null, ctx[2], cat$0)
               ? add_match(rem, marks)
               : rem;
      default:
       var i$0 = match[1], d = caml_call2(Re_Pmark[6][2], i$0, marks[2]);
       return add_match(rem, [0, marks[1], d]);
    }
   }
   function delta_expr(ctx, marks, x, rem){
    return caml_trampoline(delta_expr$0(0, ctx, marks, x, rem));
   }
   var t = [0, "lib/automata.ml", 528, 14];
   function delta_seq$0(counter, ctx, kind, y$1, z, rem){
    var match = first_match(y$1);
    if(! match) return tseq(kind, y$1, z, rem);
    var marks = match[1];
    if(-730718166 === kind){
     var b = delta_expr(ctx, marks, z, rem);
     return tseq(kind, remove_matches(y$1), z, b);
    }
    if(332064784 > kind){
     var a = tseq(kind, remove_matches(y$1), z, rem);
     return counter < 50
             ? delta_expr$0(counter + 1 | 0, ctx, marks, z, a)
             : caml_trampoline_return(delta_expr$0, [0, ctx, marks, z, a]);
    }
    var l = 0, param = y$1;
    for(;;){
     if(! param) throw caml_maybe_attach_backtrace([0, Assert_failure, t], 1);
     var x = param[1];
     if(2 === x[0]){
      var
       r$0 = param[2],
       y = remove_matches(r$0),
       y$0 = Stdlib_ListLabels[10].call(null, l);
      return tseq
              (kind, y$0, z, delta_expr(ctx, marks, z, tseq(kind, y, z, rem)));
     }
     var r = param[2], l$0 = [0, x, l];
     l = l$0;
     param = r;
    }
   }
   function delta_seq(ctx, kind, y, z, rem){
    return caml_trampoline(delta_seq$0(0, ctx, kind, y, z, rem));
   }
   function delta_desc(ctx, marks, l, rem){
    return fold_right
            (l,
             rem,
             function(expr, acc){
              switch(expr[0]){
                case 0:
                 var
                  z = expr[3],
                  y = expr[2],
                  kind = expr[1],
                  y$0 = delta_desc(ctx, marks, y, empty$1);
                 return delta_seq(ctx, kind, y$0, z, acc);
                case 1:
                 var e = expr[2], marks$0 = expr[1];
                 return delta_expr(ctx, marks$0, e, acc);
                default: return [0, expr, acc];
              }
             });
   }
   function delta(tbl_ref, next_cat, char, st){
    var
     prev_cat = st[2],
     ctx = [0, char, prev_cat, next_cat],
     l = delta_desc(ctx, empty$0, st[3], empty$1),
     seen = tbl_ref[2];
    g(seen);
    var expr = loop(seen, l, eps_expr);
    Re_Bit_vector[5].call(null, tbl_ref[1]);
    var tbl = tbl_ref[1];
    iter_marks
     (expr,
      function(marks){
       return Stdlib_ListLabels[18].call
               (null,
                function(param){
                 var i = param[2], a = 0 <= i ? 1 : 0;
                 return a ? Re_Bit_vector[2].call(null, tbl, i, 1) : a;
                },
                marks[1]);
      });
    var
     len = Re_Bit_vector[1].call(null, tbl_ref[1]),
     tbl$0 = tbl_ref[1],
     idx = 0;
    for(;;){
     if
      (!
       Re_Import[3].call(null, idx, len)
       && Re_Bit_vector[4].call(null, tbl$0, idx)){
      var idx$0 = idx + 1 | 0;
      idx = idx$0;
      continue;
     }
     if(Re_Import[3].call(null, idx, len)){
      tbl_ref[1] = Re_Bit_vector[3].call(null, 2 * len | 0);
      Stdlib_Atomic[4].call(null, tbl_ref[3], 2 * len | 0);
     }
     var expr$0 = set_idx(idx, expr);
     return mk$0(idx, next_cat, expr$0);
    }
   }
   runtime.caml_register_global
    (60,
     [0,
      [0, compare, 0, prev, next, next2, group_count],
      [0, to_dyn, pp$0],
      [0, to_dyn$0, pp$1],
      is_eps,
      pp$4,
      [0, create],
      cst,
      empty,
      alt,
      seq,
      eps,
      rep,
      mark,
      pmark,
      erase,
      before,
      after,
      rename,
      [0, to_int],
      [0],
      [0,
       pp$7,
       dummy,
       create$0,
       idx,
       status_no_mutex,
       status,
       to_dyn$5,
       Table],
      [0, create$1, index_count],
      delta],
     "Re__Automata");
   return;
  }
  (globalThis));

//# 2236 "../.js/default/re/re.cma.js"
//# shape: Re__Color_map:[[F(2),F(1)*],[F(2),F(2)*,F(2)],F(1),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_string_get = runtime.caml_string_get,
    global_data = runtime.caml_get_global_data(),
    Re_Cset = global_data.Re__Cset,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Bytes = global_data.Stdlib__Bytes;
   function repr(t, color){
    return caml_string_get(t, Re_Cset[2].call(null, color));
   }
   var length = runtime.caml_ml_string_length;
   function get_char(t, c){
    return caml_string_get(t, Re_Cset[2].call(null, c));
   }
   function get(t, c){
    return Re_Cset[5].call(null, runtime.caml_string_unsafe_get(t, c));
   }
   function translate_colors(cm, cset){
    return Re_Cset[41].call
            (null,
             cset,
             Re_Cset[14],
             function(i, j, l){
              var
               start = get_char(cm, i),
               stop = get_char(cm, j),
               a = Re_Cset[25].call(null, start, stop);
              return Re_Cset[9].call(null, a, l);
             });
   }
   function make(param){return Stdlib_Bytes[1].call(null, 257, 0);}
   function flatten(cm){
    var c = caml_create_bytes(256), color_repr = caml_create_bytes(256);
    caml_bytes_set(c, 0, 0);
    caml_bytes_set(color_repr, 0, 0);
    var v = 0, i = 1;
    for(;;){
     if(0 !== runtime.caml_bytes_get(cm, i))
      var v$0 = v + 1 | 0, v$1 = v$0;
     else
      var v$1 = v;
     caml_bytes_set(c, i, Stdlib_Char[1].call(null, v$1));
     caml_bytes_set(color_repr, v$1, Stdlib_Char[1].call(null, i));
     var b = i + 1 | 0;
     if(255 === i){
      var a = Stdlib_Bytes[8].call(null, color_repr, 0, v$1 + 1 | 0);
      return [0, Stdlib_Bytes[44].call(null, c), a];
     }
     v = v$1;
     i = b;
    }
   }
   function split(t, set){
    return Re_Cset[8].call
            (null,
             set,
             function(i, j){
              caml_bytes_set(t, Re_Cset[2].call(null, i), 1);
              return caml_bytes_set(t, Re_Cset[2].call(null, j) + 1 | 0, 1);
             });
   }
   runtime.caml_register_global
    (3,
     [0,
      [0, repr, length],
      [0, get_char, get, translate_colors],
      make,
      flatten,
      split],
     "Re__Color_map");
   return;
  }
  (globalThis));

//# 2318 "../.js/default/re/re.cma.js"
//# shape: Re__Ast:[N,F(2),F(1),F(2),F(1),F(2),N,F(1)*,F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call5(f, a0, a1, a2, a3, a4){
    return (f.l >= 0 ? f.l : f.l = f.length) === 5
            ? f(a0, a1, a2, a3, a4)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Cset = global_data.Re__Cset,
    Re_Dyn = global_data.Re__Dyn,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Re_Pmark = global_data.Re__Pmark,
    Re_Automata = global_data.Re__Automata,
    Re_Fmt = global_data.Re__Fmt,
    Stdlib_Format = global_data.Stdlib__Format,
    Re_Import = global_data.Re__Import,
    Stdlib_Option = global_data.Stdlib__Option,
    Stdlib = global_data.Stdlib,
    Re_Color_map = global_data.Re__Color_map,
    Stdlib_String = global_data.Stdlib__String,
    Assert_failure = global_data.Assert_failure,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Char = global_data.Stdlib__Char,
    Re_Dense_map = global_data.Re__Dense_map,
    cst_Alternative = "Alternative",
    cst_Case = "Case",
    cst_No_case = "No_case";
   function dyn_of_ast(f){
    return function(param){
     switch(param[0]){
       case 0:
        var xs = param[1], b = Stdlib_ListLabels[20].call(null, f, xs);
        return Re_Dyn[1].call(null, cst_Alternative, b);
       case 1:
        var a = param[1], c = [0, caml_call1(f, a), 0];
        return Re_Dyn[1].call(null, cst_No_case, c);
       default:
        var a$0 = param[1], d = [0, caml_call1(f, a$0), 0];
        return Re_Dyn[1].call(null, cst_Case, d);
     }};
   }
   function pp_ast(f, fmt, ast){
    function var$(s, re){return Re_Fmt[1].call(null, fmt, s, f, re);}
    switch(ast[0]){
      case 0:
       var alt = ast[1], a = Re_Fmt[10];
       return Re_Fmt[1].call
               (null,
                fmt,
                cst_Alternative,
                function(b, c){return a(0, f, b, c);},
                alt);
      case 1:
       var c = ast[1]; return var$(cst_No_case, c);
      default: var c$0 = ast[1]; return var$(cst_Case, c$0);
    }
   }
   var
    cst_Complement = "Complement",
    cst_Difference = "Difference",
    cst_Intersection = "Intersection";
   function dyn_of_cset(param){
    switch(param[0]){
      case 0:
       var cset = param[1], a = [0, Re_Cset[51].call(null, cset), 0];
       return Re_Dyn[1].call(null, "Cset", a);
      case 1:
       var
        xs = param[1],
        b = Stdlib_ListLabels[20].call(null, dyn_of_cset, xs);
       return Re_Dyn[1].call(null, cst_Intersection, b);
      case 2:
       var
        xs$0 = param[1],
        d = Stdlib_ListLabels[20].call(null, dyn_of_cset, xs$0);
       return Re_Dyn[1].call(null, cst_Complement, d);
      case 3:
       var
        y = param[2],
        x = param[1],
        e = [0, dyn_of_cset(y), 0],
        f = [0, dyn_of_cset(x), e];
       return Re_Dyn[1].call(null, cst_Difference, f);
      default:
       var c = param[1], g = [0, dyn_of_ast(dyn_of_cset)(c), 0];
       return Re_Dyn[1].call(null, "Cast", g);
    }
   }
   var
    cst_Beg_of_line = "Beg_of_line",
    cst_Beg_of_str = "Beg_of_str",
    cst_Beg_of_word = "Beg_of_word",
    cst_End_of_line = "End_of_line",
    cst_End_of_str = "End_of_str",
    cst_End_of_word = "End_of_word",
    cst_Group = "Group",
    cst_Last_end_of_line = "Last_end_of_line",
    cst_Nest = "Nest",
    cst_No_group = "No_group",
    cst_Not_bound = "Not_bound",
    cst_Pmark = "Pmark",
    cst_Repeat = "Repeat",
    cst_Sem = "Sem",
    cst_Sem_greedy = "Sem_greedy",
    cst_Sequence = "Sequence",
    cst_Set = "Set",
    cst_Start = "Start",
    cst_Stop = "Stop";
   function dyn_of_gen(f){
    return function(param){
     if(typeof param === "number")
      switch(param){
        case 0:
         return Re_Dyn[6].call(null, cst_Beg_of_line);
        case 1:
         return Re_Dyn[6].call(null, cst_End_of_line);
        case 2:
         return Re_Dyn[6].call(null, cst_Beg_of_word);
        case 3:
         return Re_Dyn[6].call(null, cst_End_of_word);
        case 4:
         return Re_Dyn[6].call(null, cst_Not_bound);
        case 5:
         return Re_Dyn[6].call(null, cst_Beg_of_str);
        case 6:
         return Re_Dyn[6].call(null, cst_End_of_str);
        case 7:
         return Re_Dyn[6].call(null, cst_Last_end_of_line);
        case 8:
         return Re_Dyn[6].call(null, cst_Start);
        default: return Re_Dyn[6].call(null, cst_Stop);
      }
     switch(param[0]){
       case 0:
        var a = param[1], b = [0, caml_call1(f, a), 0];
        return Re_Dyn[1].call(null, cst_Set, b);
       case 1:
        var ast = param[1], c = [0, dyn_of_ast(dyn_of_gen(f))(ast), 0];
        return Re_Dyn[1].call(null, "Ast", c);
       case 2:
        var
         xs = param[1],
         d = dyn_of_gen(f),
         e = Stdlib_ListLabels[20].call(null, d, xs);
        return Re_Dyn[1].call(null, cst_Sequence, e);
       case 3:
        var max = param[3], min = param[2], gen = param[1];
        if(max)
         var x = max[1], base = [0, Re_Dyn[3].call(null, x), 0];
        else
         var base = 0;
        var
         g = [0, Re_Dyn[3].call(null, min), base],
         h = [0, dyn_of_gen(f)(gen), g];
        return Re_Dyn[1].call(null, cst_Repeat, h);
       case 4:
        var t = param[2], name = param[1], args = [0, dyn_of_gen(f)(t), 0];
        if(name)
         var
          name$0 = name[1],
          args$0 = [0, Re_Dyn[7].call(null, name$0), args];
        else
         var args$0 = args;
        return Re_Dyn[1].call(null, cst_Group, args$0);
       case 5:
        var x$0 = param[1], i = [0, dyn_of_gen(f)(x$0), 0];
        return Re_Dyn[1].call(null, cst_No_group, i);
       case 6:
        var x$1 = param[1], j = [0, dyn_of_gen(f)(x$1), 0];
        return Re_Dyn[1].call(null, cst_Nest, j);
       case 7:
        var
         t$0 = param[2],
         pmark = param[1],
         k = [0, dyn_of_gen(f)(t$0), 0],
         l = [0, Re_Pmark[5].call(null, pmark), k];
        return Re_Dyn[1].call(null, cst_Pmark, l);
       case 8:
        var
         t$1 = param[2],
         sem = param[1],
         m = [0, dyn_of_gen(f)(t$1), 0],
         n = [0, caml_call1(Re_Automata[2][1], sem), m];
        return Re_Dyn[1].call(null, cst_Sem, n);
       default:
        var
         t$2 = param[2],
         rep = param[1],
         o = [0, dyn_of_gen(f)(t$2), 0],
         p = [0, caml_call1(Re_Automata[3][1], rep), o];
        return Re_Dyn[1].call(null, cst_Sem_greedy, p);
     }};
   }
   var
    a = [0, [15, [17, [0, "@ ", 1, 0], [4, 0, 0, 0, [15, 0]]]], "%a@ %d%a"];
   function pp_gen(pp_cset, fmt, t){
    function pp(a, b){return pp_gen(pp_cset, a, b);}
    function var$(s, re){return Re_Fmt[1].call(null, fmt, s, pp, re);}
    if(typeof t === "number")
     switch(t){
       case 0:
        return Re_Fmt[2].call(null, fmt, cst_Beg_of_line);
       case 1:
        return Re_Fmt[2].call(null, fmt, cst_End_of_line);
       case 2:
        return Re_Fmt[2].call(null, fmt, cst_Beg_of_word);
       case 3:
        return Re_Fmt[2].call(null, fmt, cst_End_of_word);
       case 4:
        return Re_Fmt[2].call(null, fmt, cst_Not_bound);
       case 5:
        return Re_Fmt[2].call(null, fmt, cst_Beg_of_str);
       case 6:
        return Re_Fmt[2].call(null, fmt, cst_End_of_str);
       case 7:
        return Re_Fmt[2].call(null, fmt, cst_Last_end_of_line);
       case 8:
        return Re_Fmt[2].call(null, fmt, cst_Start);
       default: return Re_Fmt[2].call(null, fmt, cst_Stop);
     }
    switch(t[0]){
      case 0:
       var cset = t[1]; return caml_call2(pp_cset, fmt, cset);
      case 1:
       var a$0 = t[1]; return pp_ast(pp, fmt, a$0);
      case 2:
       var rel = t[1], b = Re_Fmt[10];
       return Re_Fmt[1].call
               (null,
                fmt,
                cst_Sequence,
                function(a, c){return b(0, pp, a, c);},
                rel);
      case 3:
       var
        stop = t[3],
        start = t[2],
        re = t[1],
        pp$0 =
          function(fmt, param){
           var b = Re_Fmt[3];
           return caml_call5
                   (Stdlib_Format[139].call(null, fmt)(a),
                    pp,
                    re,
                    start,
                    b,
                    stop);
          };
       return Re_Fmt[1].call(null, fmt, cst_Repeat, pp$0, 0);
      case 4:
       var match = t[1];
       if(match){
        var c = t[2], n = match[1], d = Re_Fmt[2], e = Re_Fmt[8];
        return Re_Fmt[1].call
                (null,
                 fmt,
                 "Named_group",
                 function(a, b){return e(d, pp, a, b);},
                 [0, n, c]);
       }
       var c$0 = t[2];
       return var$(cst_Group, c$0);
      case 5:
       var c$1 = t[1]; return var$(cst_No_group, c$1);
      case 6:
       var c$2 = t[1]; return var$(cst_Nest, c$2);
      case 7:
       var r = t[2], m = t[1], f = Re_Pmark[4], g = Re_Fmt[8];
       return Re_Fmt[1].call
               (null,
                fmt,
                cst_Pmark,
                function(a, b){return g(f, pp, a, b);},
                [0, m, r]);
      case 8:
       var a$1 = t[2], sem = t[1], h = Re_Automata[2][2], i = Re_Fmt[8];
       return Re_Fmt[1].call
               (null,
                fmt,
                cst_Sem,
                function(a, b){return i(h, pp, a, b);},
                [0, sem, a$1]);
      default:
       var re$0 = t[2], k = t[1], j = Re_Automata[3][2], l = Re_Fmt[8];
       return Re_Fmt[1].call
               (null,
                fmt,
                cst_Sem_greedy,
                function(a, b){return l(j, pp, a, b);},
                [0, k, re$0]);
    }
   }
   function pp_cset(fmt, cset){
    function seq(s, rel){
     var a = Re_Fmt[10];
     return Re_Fmt[1].call
             (null, fmt, s, function(b, c){return a(0, pp_cset, b, c);}, rel);
    }
    switch(cset[0]){
      case 0:
       var s = cset[1];
       return Re_Fmt[1].call(null, fmt, cst_Set, Re_Cset[39], s);
      case 1:
       var c = cset[1]; return seq(cst_Intersection, c);
      case 2:
       var c$0 = cset[1]; return seq(cst_Complement, c$0);
      case 3:
       var b = cset[2], a = cset[1], d = Re_Fmt[8];
       return Re_Fmt[1].call
               (null,
                fmt,
                cst_Difference,
                function(a, b){return d(pp_cset, pp_cset, a, b);},
                [0, a, b]);
      default: var s$0 = cset[1]; return pp_ast(pp_cset, fmt, s$0);
    }
   }
   function equal(cset, x1$4, x2$4){
    a:
    {
     b:
     {
      c:
      {
       var x1 = x1$4, x2 = x2$4;
       d:
       for(;;){
        if(typeof x1 === "number") break b;
        switch(x1[0]){
          case 0:
           if(typeof x2 === "number") break a;
           if(0 !== x2[0]) break a;
           var s2 = x2[1], s1 = x1[1];
           return caml_call2(cset, s1, s2);
          case 1:
           break c;
          case 2:
           break d;
          case 3:
           if(typeof x2 === "number") break a;
           if(3 !== x2[0]) break a;
           var
            j2 = x2[3],
            i2 = x2[2],
            x2$0 = x2[1],
            j1 = x1[3],
            i1 = x1[2],
            x1$0 = x1[1],
            c = Re_Import[10][8].call(null, i1, i2);
           if(c){
            var d = Stdlib_Option[12].call(null, Re_Import[10][8], j1, j2);
            if(d){x1 = x1$0; x2 = x2$0; break;}
            var e = d;
           }
           else
            var e = c;
           return e;
          case 4:
           if(typeof x2 === "number") break a;
           if(4 === x2[0]) return 0;
           break a;
          case 6:
           if(typeof x2 === "number") break a;
           if(6 !== x2[0]) break a;
           var x2$1 = x2[1], x1$1 = x1[1];
           x1 = x1$1;
           x2 = x2$1;
           break;
          case 7:
           if(typeof x2 === "number") break a;
           if(7 !== x2[0]) break a;
           var
            r2 = x2[2],
            m2 = x2[1],
            r1 = x1[2],
            m1 = x1[1],
            f = Re_Pmark[1].call(null, m1, m2);
           if(! f) return f;
           x1 = r1;
           x2 = r2;
           break;
          case 8:
           if(typeof x2 === "number") break a;
           if(8 !== x2[0]) break a;
           var
            x2$2 = x2[2],
            sem = x2[1],
            x1$2 = x1[2],
            sem$0 = x1[1],
            g = Re_Import[1][1].call(null, sem$0, sem);
           if(! g) return g;
           x1 = x1$2;
           x2 = x2$2;
           break;
          case 9:
           if(typeof x2 === "number") break a;
           if(9 !== x2[0]) break a;
           var
            x2$3 = x2[2],
            rep = x2[1],
            x1$3 = x1[2],
            rep$0 = x1[1],
            h = Re_Import[1][1].call(null, rep$0, rep);
           if(! h) return h;
           x1 = x1$3;
           x2 = x2$3;
           break;
          default: break a;
        }
       }
       if(typeof x2 === "number") break a;
       if(2 !== x2[0]) break a;
       var l2 = x2[1], l1 = x1[1];
       return Stdlib_ListLabels[16].call
               (null, function(a, b){return equal(cset, a, b);}, l1, l2);
      }
      if(typeof x2 === "number") break a;
      if(1 !== x2[0]) break a;
      var
       y = x2[1],
       x = x1[1],
       eq = function(a, b){return equal(cset, a, b);},
       b = y[1],
       a = x[1];
      return Stdlib_ListLabels[16].call(null, eq, a, b);
     }
     switch(x1){
       case 0:
        if(typeof x2 !== "number" || x2) break a; break;
       case 1:
        if(typeof x2 !== "number" || 1 !== x2) break a; break;
       case 2:
        if(typeof x2 !== "number" || 2 !== x2) break a; break;
       case 3:
        if(typeof x2 !== "number" || 3 !== x2) break a; break;
       case 4:
        if(typeof x2 !== "number" || 4 !== x2) break a; break;
       case 5:
        if(typeof x2 !== "number" || 5 !== x2) break a; break;
       case 6:
        if(typeof x2 !== "number" || 6 !== x2) break a; break;
       case 7:
        if(typeof x2 !== "number" || 7 !== x2) break a; break;
       case 8:
        if(typeof x2 !== "number" || 8 !== x2) break a; break;
       default: if(typeof x2 !== "number" || 9 > x2) break a;
     }
     return 1;
    }
    return 0;
   }
   var to_dyn = dyn_of_gen(dyn_of_cset);
   function pp(a, b){return pp_gen(pp_cset, a, b);}
   function cset(cset){return [0, [0, cset]];}
   function handle_case_cset(ign_case$0, param$0){
    a:
    {
     b:
     {
      var ign_case = ign_case$0, param = param$0;
      c:
      for(;;)
       switch(param[0]){
         case 0:
          var s = param[1]; return ign_case ? Re_Cset[18].call(null, s) : s;
         case 1:
          break a;
         case 2:
          break b;
         case 3:
          var
           r = param[2],
           r$0 = param[1],
           e = handle_case_cset(ign_case, r),
           f = Re_Cset[13].call(null, Re_Cset[45], e),
           g = handle_case_cset(ign_case, r$0);
          return Re_Cset[12].call(null, g, f);
         default:
          var match = param[1];
          switch(match[0]){
            case 0:
             break c;
            case 1:
             var a = match[1]; ign_case = 1; param = a; break;
            default: var a$0 = match[1]; ign_case = 0; param = a$0;
          }
       }
      var
       l$1 = match[1],
       h =
         Stdlib_ListLabels[20].call
          (null, function(a){return handle_case_cset(ign_case, a);}, l$1);
      return Re_Cset[10].call(null, h);
     }
     var
      l$0 = param[1],
      c =
        Stdlib_ListLabels[20].call
         (null, function(a){return handle_case_cset(ign_case, a);}, l$0),
      d = Re_Cset[10].call(null, c);
     return Re_Cset[13].call(null, Re_Cset[45], d);
    }
    var
     l = param[1],
     b =
       Stdlib_ListLabels[20].call
        (null, function(a){return handle_case_cset(ign_case, a);}, l);
    return Re_Cset[11].call(null, b);
   }
   function handle_case(ign_case$0, r$9){
    a:
    {
     var ign_case = ign_case$0, r = r$9;
     b:
     for(;;){
      if(typeof r === "number") return r;
      switch(r[0]){
        case 0:
         var s = r[1]; return [0, handle_case_cset(ign_case, s)];
        case 1:
         var match = r[1];
         switch(match[0]){
           case 0:
            break a;
           case 1:
            var r$0 = match[1]; ign_case = 1; r = r$0; break;
           default: var r$1 = match[1]; ign_case = 0; r = r$1;
         }
         break;
        case 2:
         break b;
        case 3:
         var j = r[3], i = r[2], r$2 = r[1];
         return [3, handle_case(ign_case, r$2), i, j];
        case 4:
         var r$3 = r[2], n = r[1]; return [4, n, handle_case(ign_case, r$3)];
        case 5:
         var r$4 = r[1]; return [5, handle_case(ign_case, r$4)];
        case 6:
         var r$5 = r[1]; return [6, handle_case(ign_case, r$5)];
        case 7:
         var r$6 = r[2], i$0 = r[1];
         return [7, i$0, handle_case(ign_case, r$6)];
        case 8:
         var r$7 = r[2], k = r[1]; return [8, k, handle_case(ign_case, r$7)];
        default:
         var r$8 = r[2], k$0 = r[1];
         return [9, k$0, handle_case(ign_case, r$8)];
      }
     }
     var l$1 = r[1];
     return [2,
             Stdlib_ListLabels[20].call
              (null, function(a){return handle_case(ign_case, a);}, l$1)];
    }
    var
     l = match[1],
     l$0 =
       Stdlib_ListLabels[20].call
        (null, function(a){return handle_case(ign_case, a);}, l);
    return [1, [0, l$0]];
   }
   function seq(l){if(l && ! l[2]){var r = l[1]; return r;} return [2, l];}
   var
    f =
      Re_Dense_map[1].call
       (null,
        256,
        function(i){
         var a = Stdlib_Char[1].call(null, i);
         return cset(Re_Cset[46].call(null, a));
        });
   function char(c){return caml_call1(f, c);}
   var any = cset(Re_Cset[45]);
   function str(s){
    var b = caml_ml_string_length(s) - 1 | 0, a = 0;
    if(b < 0)
     var l$0 = a;
    else{
     var l = a, i = b;
     for(;;){
      var
       c = runtime.caml_string_get(s, i),
       d = [0, caml_call1(f, c), l],
       e = i - 1 | 0;
      if(0 === i){var l$0 = d; break;}
      l = d;
      i = e;
     }
    }
    return seq(l$0);
   }
   function as_set_elems(elems){
    try{
     var
      e =
        Stdlib_ListLabels[20].call
         (null,
          function(param){
           if(typeof param !== "number" && 0 === param[0]){var e = param[1]; return e;}
           throw Stdlib[3];
          },
          elems);
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[3]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, e];
   }
   var empty = [1, [0, 0]];
   function alt(elems){
    if(! elems) return empty;
    if(! elems[2]){var x = elems[1]; return x;}
    var match = as_set_elems(elems);
    if(! match) return [1, [0, elems]];
    var elems$0 = match[1];
    return [0, [4, [0, elems$0]]];
   }
   var epsilon = seq(0);
   function repn(r, i, j){
    var cst_Re_repn = "Re.repn";
    if(Re_Import[5].call(null, i, 0)) Stdlib[1].call(null, cst_Re_repn);
    if(j){
     var j$0 = j[1];
     if(Re_Import[5].call(null, j$0, i))
      return Stdlib[1].call(null, cst_Re_repn);
     if(0 === j$0){
      if(0 === i) return epsilon;
     }
     else if(1 === j$0 && 1 === i) return r;
    }
    return [3, r, i, j];
   }
   function rep(r){return repn(r, 0, 0);}
   function rep1(r){return repn(r, 1, 0);}
   var b = [0, 1];
   function opt(r){return repn(r, 0, b);}
   var bow = 2, eow = 3;
   function word(r){return seq([0, bow, [0, r, [0, eow, 0]]]);}
   var bos = 5, eos = 6;
   function whole_string(r){return seq([0, bos, [0, r, [0, eos, 0]]]);}
   function make_set(f, t){
    if(typeof t !== "number" && 0 === t[0]){
     var x = t[1];
     return [0, [4, caml_call1(f[1], x)]];
    }
    return [1, caml_call1(f[1], t)];
   }
   function longest(t){
    if(typeof t !== "number" && 0 === t[0]) return t;
    return [8, -730718166, t];
   }
   function shortest(t){
    if(typeof t !== "number" && 0 === t[0]) return t;
    return [8, -1034406550, t];
   }
   function first(t){
    if(typeof t !== "number" && 0 === t[0]) return t;
    return [8, 332064784, t];
   }
   function greedy(t){
    if(typeof t !== "number" && 0 === t[0]) return t;
    return [9, -904640576, t];
   }
   function non_greedy(t){
    if(typeof t !== "number" && 0 === t[0]) return t;
    return [9, 620821490, t];
   }
   function group(name, r){return [4, name, r];}
   function no_group(t){
    if(typeof t !== "number" && 0 === t[0]) return t;
    return [5, t];
   }
   function nest(r){return [6, r];}
   function set(str){return cset(Re_Cset[26].call(null, str));}
   function mark(r){
    var i = Re_Pmark[3].call(null, 0);
    return [0, i, [7, i, r]];
   }
   function as_set_or_error(name, elems){
    var match = as_set_elems(elems);
    if(! match) return Stdlib[1].call(null, name);
    var s = match[1];
    return s;
   }
   function inter(elems){return [0, [1, as_set_or_error("Re.inter", elems)]];}
   function compl(elems){return [0, [2, as_set_or_error("Re.compl", elems)]];}
   function diff(r$0, r){
    if
     (typeof r$0 !== "number"
      && 0 === r$0[0] && typeof r !== "number" && 0 === r[0]){
     var r$1 = r[1], r$2 = r$0[1];
     return [0, [3, r$2, r$1]];
    }
    return Stdlib[1].call(null, "Re.diff");
   }
   var f$0 = [0, function(r){return [2, r];}];
   function case$(t){return make_set(f$0, t);}
   var f$1 = [0, function(r){return [1, r];}];
   function no_case(t){return make_set(f$1, t);}
   var c = [0, "lib/ast.ml", 363, 32];
   function witness(t){
    function witness(t$0){
     var t = t$0;
     a:
     for(;;){
      var cst = "";
      if(typeof t === "number") return cst;
      switch(t[0]){
        case 0:
         var
          c$0 = t[1],
          a = Re_Cset[49].call(null, c$0),
          d = Re_Cset[4].call(null, a);
         return Stdlib_String[1].call(null, 1, d);
        case 1:
         var match = t[1][1];
         if(! match)
          throw caml_maybe_attach_backtrace([0, Assert_failure, c], 1);
         var x = match[1];
         t = x;
         break;
        case 2:
         var xs = t[1], e = Stdlib_ListLabels[20].call(null, witness, xs);
         return Stdlib_String[7].call(null, cst, e);
        case 3:
         break a;
        case 5:
         var r$0 = t[1]; t = r$0; break;
        case 6:
         t = t[1]; break;
        default: t = t[2];
      }
     }
     var
      from = t[2],
      r = t[1],
      w = witness(r),
      b =
        Stdlib_Buffer[1].call
         (null, runtime.caml_mul(caml_ml_string_length(w), from));
     if(from >= 1){
      var i = 1;
      for(;;){
       Stdlib_Buffer[16].call(null, b, w);
       var f = i + 1 | 0;
       if(from === i) break;
       i = f;
      }
     }
     return Stdlib_Buffer[2].call(null, b);
    }
    return witness(handle_case(0, t));
   }
   function merge_sequences(param$0){
    a:
    {
     var param = param$0;
     b:
     for(;;){
      if(! param) return 0;
      var x = param[1];
      if(typeof x === "number") break a;
      switch(x[0]){
        case 1:
         var match = x[1];
         if(0 !== match[0]) break a;
         var r$0 = param[2], l = match[1];
         param = Stdlib[37].call(null, l, r$0);
         break;
        case 2:
         break b;
        default: break a;
      }
     }
     var match$0 = x[1];
     if(match$0){
      var
       r$1 = param[2],
       y = match$0[2],
       x$0 = match$0[1],
       r$2 = merge_sequences(r$1);
      if(r$2){
       var a = r$2[1];
       if(typeof a !== "number" && 2 === a[0]){
        var match$1 = a[1];
        if(match$1){
         var r$3 = r$2[2], y$0 = match$1[2], x$1 = match$1[1];
         if(equal(Re_Cset[7], x$0, x$1)){
          var b = [0, seq(y$0), 0];
          return [0, [2, [0, x$0, [0, [1, [0, [0, seq(y), b]]], 0]]], r$3];
         }
        }
       }
      }
      return [0, [2, [0, x$0, y]], r$2];
     }
    }
    var r = param[2];
    return [0, x, merge_sequences(r)];
   }
   function colorize(color_map, regexp){
    var lnl = [0, 0];
    function colorize(regexp$2){
     var regexp = regexp$2;
     for(;;){
      if(typeof regexp === "number")
       switch(regexp){
         case 7:
          lnl[1] = 1; return 0;
         case 0:
         case 1:
          return Re_Color_map[5].call(null, color_map, Re_Cset[24]);
         case 2:
         case 3:
         case 4:
          return Re_Color_map[5].call(null, color_map, Re_Cset[21]);
         default: return 0;
       }
      switch(regexp[0]){
        case 0:
         var s = regexp[1]; return Re_Color_map[5].call(null, color_map, s);
        case 1:
         var l = regexp[1][1];
         return Stdlib_ListLabels[18].call(null, colorize, l);
        case 2:
         var l$0 = regexp[1];
         return Stdlib_ListLabels[18].call(null, colorize, l$0);
        case 3:
         var regexp$0 = regexp[1]; regexp = regexp$0; break;
        case 4:
        case 7:
         regexp = regexp[2]; break;
        case 5:
        case 6:
         regexp = regexp[1]; break;
        default: var regexp$1 = regexp[2]; regexp = regexp$1;
      }
     }
    }
    colorize(regexp);
    return lnl[1];
   }
   function anchored(param$0){
    var param = param$0;
    for(;;){
     if(typeof param === "number")
      switch(param){case 5:case 8: return 1;}
     else
      switch(param[0]){
        case 1:
         var a = param[1];
         if(0 === a[0]){
          var als = a[1];
          return Stdlib_ListLabels[33].call(null, anchored, als);
         }
         var r = a[1];
         param = r;
         continue;
        case 2:
         var l = param[1];
         return Stdlib_ListLabels[34].call(null, anchored, l);
        case 3:
         var i = param[2], r$0 = param[1], b = Re_Import[6].call(null, i, 0);
         if(! b) return b;
         param = r$0;
         continue;
        case 0: break;
        case 5:
        case 6:
         param = param[1]; continue;
        default: param = param[2]; continue;
      }
     return 0;
    }
   }
   function t_of_cset(x){return [0, x];}
   runtime.caml_register_global
    (81,
     [0,
      to_dyn,
      pp,
      merge_sequences,
      handle_case,
      anchored,
      colorize,
      [0,
       empty,
       epsilon,
       str,
       no_case,
       case$,
       diff,
       compl,
       repn,
       inter,
       char,
       any,
       set,
       mark,
       nest,
       no_group,
       whole_string,
       7,
       longest,
       greedy,
       non_greedy,
       9,
       4,
       group,
       word,
       first,
       bos,
       bow,
       eow,
       eos,
       0,
       8,
       1,
       opt,
       rep,
       rep1,
       alt,
       shortest,
       seq,
       pp,
       witness],
      cset,
      t_of_cset],
     "Re__Ast");
   return;
  }
  (globalThis));

//# 3381 "../.js/default/re/re.cma.js"
//# shape: Re__Group:[F(5)*,F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(1),F(1),F(2),F(1)*,F(1)*,F(2),N,F(2),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Format = global_data.Stdlib__Format,
    Stdlib_Array = global_data.Stdlib__Array,
    Re_Fmt = global_data.Re__Fmt,
    Stdlib_String = global_data.Stdlib__String,
    Re_Mark_infos = global_data.Re__Mark_infos,
    Stdlib_Option = global_data.Stdlib__Option,
    Stdlib = global_data.Stdlib;
   function create(s, gcount, gpos, marks, pmarks){return [0, s, marks, pmarks, gpos, gcount];
   }
   function is_present(t){return 0 <= t ? 1 : 0;}
   function get_no_check(t){return t;}
   var absent = -1;
   function start_offset(t, i){
    var i$0 = Re_Mark_infos[6].call(null, t[2], i);
    if(! Re_Mark_infos[5][1].call(null, i$0)) return absent;
    var a = Re_Mark_infos[5][2].call(null, i$0);
    return caml_check_bound(t[4], a)[a + 1];
   }
   function stop_offset(t, i){
    var i$0 = Re_Mark_infos[7].call(null, t[2], i);
    if(! Re_Mark_infos[5][1].call(null, i$0)) return absent;
    var a = Re_Mark_infos[5][2].call(null, i$0);
    return caml_check_bound(t[4], a)[a + 1];
   }
   function offset_opt(t, i){
    var a = Re_Mark_infos[2].call(null, t[2], i);
    return Stdlib_Option[7].call
            (null,
             function(param){
              var
               stop = param[2],
               start = param[1],
               a = caml_check_bound(t[4], stop)[stop + 1];
              return [0, caml_check_bound(t[4], start)[start + 1], a];
             },
             a);
   }
   function or_not_found(param){
    if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
    var s = param[1];
    return s;
   }
   function offset(t, i){return or_not_found(offset_opt(t, i));}
   function pmarks(t){return t[3];}
   function get(t, i){
    var a = offset_opt(t, i);
    return or_not_found
            (Stdlib_Option[7].call
              (null,
               function(param){
                var p2 = param[2], p1 = param[1];
                return Stdlib_String[16].call(null, t[1], p1, p2 - p1 | 0);
               },
               a));
   }
   function start_opt(subs, i){
    var a = offset_opt(subs, i);
    return Stdlib_Option[7].call(null, function(a){return a[1];}, a);
   }
   function start(subs, i){return or_not_found(start_opt(subs, i));}
   function stop_opt(subs, i){
    var a = offset_opt(subs, i);
    return Stdlib_Option[7].call(null, function(a){return a[2];}, a);
   }
   function stop(subs, i){return or_not_found(stop_opt(subs, i));}
   function test(t, i){return Re_Mark_infos[3].call(null, t[2], i);}
   function get_opt(t, i){return test(t, i) ? [0, get(t, i)] : 0;}
   var dummy_offset = [0, -1, -1];
   function all_offset(t){
    var res = caml_make_vect(t[5], dummy_offset);
    Re_Mark_infos[4].call
     (null,
      t[2],
      function(i, start, stop){
       var
        p1 = caml_check_bound(t[4], start)[start + 1],
        p2 = caml_check_bound(t[4], stop)[stop + 1];
       caml_check_bound(res, i)[i + 1] = [0, p1, p2];
       return 0;
      });
    return res;
   }
   var cst = "";
   function all(t){
    var res = caml_make_vect(t[5], cst);
    Re_Mark_infos[4].call
     (null,
      t[2],
      function(i, start, stop){
       var
        p1 = caml_check_bound(t[4], start)[start + 1],
        p2 = caml_check_bound(t[4], stop)[stop + 1],
        a = Stdlib_String[16].call(null, t[1], p1, p2 - p1 | 0);
       caml_check_bound(res, i)[i + 1] = a;
       return 0;
      });
    return res;
   }
   var
    a =
      [0,
       [18,
        [1, [0, 0, cst]],
        [12,
         40,
         [2,
          0,
          [11,
           " (",
           [4, 0, 0, 0, [12, 32, [4, 0, 0, 0, [11, "))", [17, 0, 0]]]]]]]]],
       "@[(%s (%d %d))@]"];
   function pp(fmt, t){
    var
     offsets = all_offset(t),
     strs = all(t),
     b =
       Stdlib_Array[1].call
        (null,
         strs.length - 1,
         function(i){
          var a = caml_check_bound(offsets, i)[i + 1];
          return [0, caml_check_bound(strs, i)[i + 1], a];
         }),
     matches = Stdlib_Array[10].call(null, b);
    function pp_match(fmt, param){
     var match = param[2], stop = match[2], start = match[1], str = param[1];
     return caml_call3
             (Stdlib_Format[139].call(null, fmt)(a), str, start, stop);
    }
    var c = Re_Fmt[10];
    return Re_Fmt[1].call
            (null,
             fmt,
             "Group",
             function(a, b){return c(0, pp_match, a, b);},
             matches);
   }
   function nb_groups(t){return t[5];}
   runtime.caml_register_global
    (11,
     [0,
      create,
      get,
      get_opt,
      offset,
      offset_opt,
      start,
      start_opt,
      stop,
      stop_opt,
      all,
      all_offset,
      test,
      pmarks,
      nb_groups,
      pp,
      [0, is_present, get_no_check],
      start_offset,
      stop_offset],
     "Re__Group");
   return;
  }
  (globalThis));

//# 3563 "../.js/default/re/re.cma.js"
//# shape: Re__Slice:[N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    global_data = runtime.caml_get_global_data(),
    Re_Import = global_data.Re__Import,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Assert_failure = global_data.Assert_failure,
    cst_lib_slice_ml = "lib/slice.ml",
    a = [0, cst_lib_slice_ml, 22, 20],
    b = [0, cst_lib_slice_ml, 39, 18];
   function get_substring(slices, remains, stop){
    a:
    {
     if(Re_Import[3].call(null, stop, remains)) return "";
     var slices$0 = slices, remains$0 = remains;
     for(;;){
      if(Re_Import[3].call(null, remains$0, 0)){var slices$2 = slices$0; break a;}
      if(! slices$0)
       throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
      var
       slices$1 = slices$0[2],
       slice = slices$0[1],
       len = slice[3],
       pos = slice[2],
       remains$1 = remains$0 - len | 0;
      if(0 > remains$1) break;
      slices$0 = slices$1;
      remains$0 = remains$1;
     }
     var
      pos$0 = pos + remains$0 | 0,
      len$0 = len - remains$0 | 0,
      slices$2 = [0, [0, slice[1], pos$0, len$0], slices$1];
    }
    var
     buf = Stdlib_Buffer[1].call(null, stop - remains | 0),
     remains$4 = stop - remains | 0,
     slices$3 = slices$2,
     remains$2 = remains$4;
    for(;;){
     if(Re_Import[6].call(null, remains$2, 0)){
      if(! slices$3)
       throw caml_maybe_attach_backtrace([0, Assert_failure, b], 1);
      var
       slices$4 = slices$3[2],
       match = slices$3[1],
       len$1 = match[3],
       pos$1 = match[2],
       s = match[1],
       remains$3 = remains$2 - len$1 | 0;
      if(Re_Import[6].call(null, remains$3, 0)){
       Stdlib_Buffer[18].call(null, buf, s, pos$1, len$1);
       slices$3 = slices$4;
       remains$2 = remains$3;
       continue;
      }
      Stdlib_Buffer[18].call(null, buf, s, pos$1, remains$2);
     }
     return Stdlib_Buffer[2].call(null, buf);
    }
   }
   function drop_rev(t$1, remains$1){
    if(Re_Import[3].call(null, remains$1, 0)) return t$1;
    var
     t$2 = Stdlib_ListLabels[10].call(null, t$1),
     t = t$2,
     remains = remains$1;
    for(;;){
     if(Re_Import[3].call(null, remains, 0))
      var a = t;
     else if(t){
      var t$0 = t[2], slice = t[1], len = slice[3], pos = slice[2];
      if(len <= remains){
       var remains$0 = remains - len | 0;
       t = t$0;
       remains = remains$0;
       continue;
      }
      var
       delta = len - remains | 0,
       a = [0, [0, slice[1], pos + delta | 0, len - delta | 0], t$0];
     }
     else
      var a = 0;
     return Stdlib_ListLabels[10].call(null, a);
    }
   }
   runtime.caml_register_global
    (7, [0, [0, get_substring, drop_rev]], "Re__Slice");
   return;
  }
  (globalThis));

//# 3663 "../.js/default/re/re.cma.js"
//# shape: Re__Compile:[N,F(6),F(6),F(4),F(1),F(1)*,F(1)*,F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    caml_string_unsafe_get = runtime.caml_string_unsafe_get,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Re_Import = global_data.Re__Import,
    Stdlib_Mutex = global_data.Stdlib__Mutex,
    Re_Color_map = global_data.Re__Color_map,
    Re_Cset = global_data.Re__Cset,
    Stdlib_Char = global_data.Stdlib__Char,
    Re_Automata = global_data.Re__Automata,
    Re_Category = global_data.Re__Category,
    Re_Ast = global_data.Re__Ast,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Stdlib = global_data.Stdlib,
    Re_Group = global_data.Re__Group,
    Re_Slice = global_data.Re__Slice,
    Re_Mark_infos = global_data.Re__Mark_infos,
    Stdlib_Option = global_data.Stdlib__Option,
    Re_Pmark = global_data.Re__Pmark,
    Stdlib_Array = global_data.Stdlib__Array;
   function break_idx(t){return (t + 5 | 0) * -1 | 0;}
   function get_info(param){return param[1];}
   function follow_transition(param, color){
    return param[(1 + Re_Cset[2].call(null, color) | 0) + 1];
   }
   function set_transition(param, color, st){
    var a = 1 + Re_Cset[2].call(null, color) | 0;
    caml_check_bound(param, a)[a + 1] = st;
   }
   var unknown = -2;
   function is_unknown_transition(st, color){
    var
     st$0 = follow_transition(st, color),
     info = get_info(st$0),
     x = info[1];
    return Re_Import[3].call(null, x, unknown);
   }
   var info = [0, unknown, 0, Re_Automata[21][2]];
   function pp_re(ch, re){return Re_Automata[5].call(null, ch, re[1]);}
   function group_count(re){return re[10];}
   function group_names(re){return re[9];}
   function unsafe_set(t, idx, pos){t[1][idx + 1] = pos;}
   function set(t, idx, pos$0){
    if(t[2] <= idx)
     for(;;){
      t[2] = 2 * t[2] | 0;
      if(t[2] > idx){
       var pos = t[1];
       t[1] = caml_make_vect(t[2], 0);
       Stdlib_Array[9].call(null, pos, 0, t[1], 0, pos.length - 1);
       break;
      }
     }
    return unsafe_set(t, idx, pos$0);
   }
   function first(t){return caml_check_bound(t[1], 0)[1];}
   var empty = [0, [0], 0];
   function make(groups, re){
    if(! groups) return empty;
    var length = caml_call1(Re_Automata[22][2], re[7]) + 1 | 0;
    return [0, caml_make_vect(length, 0), length];
   }
   function category(re, color){
    if(Re_Cset[1].call(null, color, Re_Cset[6])) return Re_Category[4];
    if(Re_Cset[1].call(null, color, re[6])){
     var
      a = Re_Category[6],
      b = Re_Category[1].call(null, Re_Category[8], Re_Category[7]);
     return Re_Category[1].call(null, b, a);
    }
    var c = Re_Color_map[1][1].call(null, re[4], color);
    return Re_Category[2].call(null, c);
   }
   var unknown_state = [0, info];
   function find_state(re, desc){
    try{var b = caml_call2(Re_Automata[21][8][7], re[8], desc); return b;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
     var match = caml_call1(Re_Automata[21][5], desc);
     a:
     {
      if(typeof match === "number" && match){var break_state = 0; break a;}
      var break_state = 1;
     }
     var
      idx = caml_call1(Re_Automata[21][4], desc),
      a =
        break_state
         ? -5 - caml_call1(Re_Automata[19][1], idx) | 0
         : caml_call1(Re_Automata[19][1], idx),
      state = [0, a, 0, desc];
     if(break_state)
      var st$0 = [0, state];
     else{
      var ncol = re[5], st = caml_make_vect(ncol + 1 | 0, unknown_state);
      caml_check_bound(st, 0)[1] = state;
      var st$0 = st;
     }
     caml_call3(Re_Automata[21][8][5], re[8], desc, st$0);
     return st$0;
    }
   }
   function delta(re, cat, color, st){
    return Re_Automata[23].call(null, re[7], cat, color, st[3]);
   }
   function validate(re, s, pos, st){
    var
     a = caml_string_get(s, pos),
     color = Re_Color_map[2][2].call(null, re[3], a);
    Stdlib_Mutex[2].call(null, re[11]);
    if(is_unknown_transition(st, color)){
     var
      cat = category(re, color),
      desc = delta(re, cat, color, get_info(st)),
      st$0 = find_state(re, desc);
     set_transition(st, color, st$0);
    }
    return Stdlib_Mutex[4].call(null, re[11]);
   }
   function next(colors, st, s, pos){
    return follow_transition
            (st,
             Re_Color_map[2][2].call
              (null, colors, caml_string_unsafe_get(s, pos)));
   }
   function loop_no_mark(re, colors, s, pos$1, last, st0$1, st$0){
    var pos = pos$1, st0 = st0$1, st = st$0;
    for(;;){
     if(! Re_Import[5].call(null, pos, last)) return st;
     var st0$0 = next(colors, st, s, pos), idx = get_info(st0$0)[1];
     if(0 <= idx){
      var pos$0 = pos + 1 | 0;
      pos = pos$0;
      st0 = st0$0;
      st = st0$0;
     }
     else{if(idx <= -3) return st0$0; validate(re, s, pos, st0); st = st0;}
    }
   }
   function final(re, st, cat){
    try{var c = Stdlib_ListLabels[51].call(null, cat, st[2]); return c;}
    catch(exn$1){
     var exn = caml_wrap_exception(exn$1);
     if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
     Stdlib_Mutex[2].call(null, re[11]);
     try{var b = Stdlib_ListLabels[51].call(null, cat, st[2]), res$0 = b;}
     catch(exn){
      var exn$0 = caml_wrap_exception(exn);
      if(exn$0 !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn$0, 0);
      var
       st$0 = delta(re, cat, Re_Cset[6], st),
       a = caml_call1(Re_Automata[21][5], st$0),
       res = [0, caml_call1(Re_Automata[21][4], st$0), a];
      st[2] = [0, [0, cat, res], st[2]];
      var res$0 = res;
     }
     Stdlib_Mutex[4].call(null, re[11]);
     return res$0;
    }
   }
   function find_initial_state(re, cat){
    try{var b = Stdlib_ListLabels[51].call(null, cat, re[2]); return b;}
    catch(exn$1){
     var exn = caml_wrap_exception(exn$1);
     if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
     Stdlib_Mutex[2].call(null, re[11]);
     try{var a = Stdlib_ListLabels[51].call(null, cat, re[2]), res = a;}
     catch(exn){
      var exn$0 = caml_wrap_exception(exn);
      if(exn$0 !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn$0, 0);
      var st = find_state(re, caml_call2(Re_Automata[21][3], cat, re[1]));
      re[2] = [0, [0, cat, st], re[2]];
      var res = st;
     }
     Stdlib_Mutex[4].call(null, re[11]);
     return res;
    }
   }
   function get_color(re, s, pos){
    if(Re_Import[5].call(null, pos, 0)) return Re_Cset[6];
    var slen = caml_ml_string_length(s);
    if(slen <= pos) return Re_Cset[6];
    if
     (Re_Import[3].call(null, pos, slen - 1 | 0)
      &&
       !
       Re_Cset[1].call(null, re[6], Re_Cset[6])
       && Stdlib_Char[6].call(null, caml_string_unsafe_get(s, pos), 10))
     return re[6];
    return Re_Color_map[2][2].call
            (null, re[3], caml_string_unsafe_get(s, pos));
   }
   function scan_str(re, positions, s, initial_state, last, pos$2, groups){
    if
     (Re_Import[3].call(null, last, caml_ml_string_length(s))
      &&
       !
       Re_Cset[1].call(null, re[6], Re_Cset[6])
       && Re_Import[6].call(null, last, pos$2)){
     var a = caml_string_get(s, last - 1 | 0);
     if(Stdlib_Char[6].call(null, a, 10)){
      var
       last$0 = last - 1 | 0,
       st$2 = scan_str(re, positions, s, initial_state, last$0, pos$2, groups),
       x$0 = get_info(st$2)[1];
      if(x$0 <= -3) return st$2;
      for(;;){
       var
        st$0 = follow_transition(st$2, re[6]),
        info = get_info(st$0),
        t = info[1];
       if(0 <= t){
        if(groups){var t$0 = info[1]; set(positions, t$0, last$0);}
        return st$0;
       }
       var x = info[1];
       if(x <= -3){
        if(groups) set(positions, break_idx(info[1]), last$0);
        return st$0;
       }
       var color = re[6];
       Stdlib_Mutex[2].call(null, re[11]);
       if(is_unknown_transition(st$2, color)){
        var
         cat = category(re, color),
         real_c = Re_Color_map[2][2].call(null, re[3], 10),
         desc = delta(re, cat, real_c, get_info(st$2)),
         st$1 = find_state(re, desc);
        set_transition(st$2, color, st$1);
       }
       Stdlib_Mutex[4].call(null, re[11]);
      }
     }
    }
    if(! groups)
     return loop_no_mark
             (re, re[3], s, pos$2, last, initial_state, initial_state);
    var colors = re[3], pos = pos$2, st0 = initial_state, st = initial_state;
    for(;;){
     if(! Re_Import[5].call(null, pos, last)) return st;
     var st0$0 = next(colors, st, s, pos), idx = get_info(st0$0)[1];
     if(0 <= idx)
      if(Re_Import[5].call(null, idx, positions[2])){
       unsafe_set(positions, idx, pos);
       var pos$0 = pos + 1 | 0;
       pos = pos$0;
       st0 = st0$0;
       st = st0$0;
      }
      else{
       set(positions, idx, pos);
       var pos$1 = pos + 1 | 0;
       pos = pos$1;
       st0 = st0$0;
       st = st0$0;
      }
     else{
      if(idx <= -3){set(positions, break_idx(idx), pos); return st0$0;}
      validate(re, s, pos, st0);
      st = st0;
     }
    }
   }
   function final_boundary_check
   (re, positions, last, slen, s, state_info, groups){
    var
     a =
       Re_Import[3].call(null, last, slen)
        ? Re_Category[4]
        : category(re, get_color(re, s, last)),
     final_cat = Re_Category[1].call(null, Re_Category[9], a),
     match = final(re, state_info, final_cat),
     res = match[2],
     idx = match[1];
    if(groups && typeof res !== "number")
     set(positions, caml_call1(Re_Automata[19][1], idx), last);
    return res;
   }
   function make_match_str(re, positions, len, groups, partial, s, pos){
    var
     slen = caml_ml_string_length(s),
     last = Re_Import[3].call(null, len, -1) ? slen : pos + len | 0,
     a =
       Re_Import[3].call(null, pos, 0)
        ? Re_Category[4]
        : category(re, get_color(re, s, pos - 1 | 0)),
     initial_cat = Re_Category[1].call(null, Re_Category[9], a),
     initial_state = find_initial_state(re, initial_cat),
     st = scan_str(re, positions, s, initial_state, last, pos, groups),
     state_info = get_info(st),
     x = state_info[1];
    a:
    if(x > -3){
     if(partial && ! groups) break a;
     if(partial && groups){
      var status = caml_call2(Re_Automata[21][6], re[11], state_info[3]);
      if(typeof status === "number" && status){
       var
        status$0 =
          final_boundary_check
           (re, positions, last, slen, s, state_info, groups);
       return typeof status$0 === "number" ? 1 : status$0;
      }
      return status;
     }
     return final_boundary_check
             (re, positions, last, slen, s, state_info, groups);
    }
    return caml_call2(Re_Automata[21][6], re[11], state_info[3]);
   }
   function create(re){
    var
     category = Re_Category[1].call(null, Re_Category[9], Re_Category[4]),
     state = find_initial_state(re, category);
    return [0, state, re];
   }
   function feed(t, s, pos, len){
    var
     last = pos + len | 0,
     state = loop_no_mark(t[2], t[2][3], s, pos, last, t[1], t[1]),
     info = get_info(state),
     x = info[1];
    if(x <= -3){
     var match = caml_call2(Re_Automata[21][6], t[2][11], info[3]);
     a:
     {if(typeof match === "number" && ! match){var a = 1; break a;} var a = 0;
     }
     if(a) return 0;
    }
    return [0, [0, state, t[2]]];
   }
   function finalize(t, s, pos, len){
    var
     last = pos + len | 0,
     state = scan_str(t[2], empty, s, t[1], last, pos, 0),
     info = get_info(state),
     final_cat = Re_Category[1].call(null, Re_Category[9], Re_Category[4]);
    return typeof final(t[2], info, final_cat)[2] === "number" ? 0 : 1;
   }
   function no_match_starts_before(t){return t[5];}
   function create$0(t){return [0, t, make(1, t[2]), 0, 0, 0];}
   function test_mark(t, mark){
    return caml_call2(Re_Pmark[6][31], mark, t[1]);
   }
   function get(t, i){
    var a = Re_Mark_infos[2].call(null, t[3], i);
    return Stdlib_Option[7].call
            (null,
             function(param){
              var
               stop = param[2],
               start = param[1],
               a = t[5],
               start$0 = caml_check_bound(t[4], start)[start + 1] - a | 0,
               b = t[5],
               stop$0 = caml_check_bound(t[4], stop)[stop + 1] - b | 0;
              return caml_call3(Re_Slice[1][1], t[2], start$0, stop$0);
             },
             a);
   }
   function loop(re, abs_pos, colors, positions, s, pos$2, last, st0$1, st$0){
    var pos = pos$2, st0 = st0$1, st = st$0;
    for(;;){
     if(! Re_Import[5].call(null, pos, last)) return st;
     var st0$0 = next(colors, st, s, pos), idx = get_info(st0$0)[1];
     if(0 <= idx)
      if(Re_Import[5].call(null, idx, positions[2])){
       unsafe_set(positions, idx, abs_pos + pos | 0);
       var pos$0 = pos + 1 | 0;
       pos = pos$0;
       st0 = st0$0;
       st = st0$0;
      }
      else{
       set(positions, idx, abs_pos + pos | 0);
       var pos$1 = pos + 1 | 0;
       pos = pos$1;
       st0 = st0$0;
       st = st0$0;
      }
     else{
      if(idx <= -3){
       set(positions, break_idx(idx), abs_pos + pos | 0);
       return st0$0;
      }
      validate(re, s, pos, st0);
      st = st0;
     }
    }
   }
   function feed$0(tt, s, pos, len){
    var
     abs_pos = tt[4],
     slices = tt[3],
     positions = tt[2],
     t = tt[1],
     last = pos + len | 0,
     state = loop(t[2], abs_pos, t[2][3], positions, s, pos, last, t[1], t[1]),
     info = get_info(state),
     x = info[1];
    if(x <= -3){
     var match = caml_call2(Re_Automata[21][6], t[2][11], info[3]);
     a:
     {if(typeof match === "number" && ! match){var a = 1; break a;} var a = 0;
     }
     if(a) return 0;
    }
    var
     t$0 = [0, state, t[2]],
     slices$0 = [0, [0, s, pos, len], slices],
     first_match_pos = first(positions),
     slices$1 =
       caml_call2(Re_Slice[1][2], slices$0, first_match_pos - tt[5] | 0),
     abs_pos$0 = abs_pos + len | 0;
    return [0, [0, t$0, tt[2], slices$1, abs_pos$0, first_match_pos]];
   }
   function finalize$0(tt, s, pos, len){
    var
     abs_pos = tt[4],
     slices = tt[3],
     positions = tt[2],
     t = tt[1],
     last = pos + len | 0,
     state = loop(t[2], abs_pos, t[2][3], positions, s, pos, last, t[1], t[1]),
     info = get_info(state),
     s$0 = caml_call2(Re_Automata[21][6], t[2][11], info[3]);
    if(typeof s$0 === "number" && s$0)
     var
      final_cat = Re_Category[1].call(null, Re_Category[9], Re_Category[4]),
      match = final(t[2], info, final_cat),
      res = match[2],
      idx = match[1],
      match$0 =
        typeof res === "number"
         ? res
         : (set
            (positions,
             caml_call1(Re_Automata[19][1], idx),
             abs_pos + last | 0),
           res);
    else
     var match$0 = s$0;
    if(typeof match$0 === "number") return 0;
    var
     pmarks = match$0[2],
     marks = match$0[1],
     first_match_position = first(positions),
     slices$0 = [0, [0, s, pos, len], slices],
     slices$1 =
       caml_call2(Re_Slice[1][2], slices$0, first_match_position - tt[5] | 0),
     slices$2 = Stdlib_ListLabels[10].call(null, slices$1),
     positions$0 = positions[1];
    return [0,
            [0, pmarks, slices$2, marks, positions$0, first_match_position]];
   }
   function match_str_no_bounds(groups, partial, re, s, pos, len){
    var
     positions = make(groups, re),
     match = make_match_str(re, positions, len, groups, partial, s, pos);
    if(typeof match !== "number"){
     var pmarks = match[2], marks = match[1];
     return [0,
             Re_Group[1].call(null, s, re[10], positions[1], marks, pmarks)];
    }
    if(! match) return 0;
    var no_match_starts_before = groups ? first(positions) : 0;
    return [1, no_match_starts_before];
   }
   var cst_Re_exec_out_of_bounds = "Re.exec: out of bounds";
   function match_str_p(re, s, pos, len){
    var a = Re_Import[5].call(null, pos, 0);
    if(a)
     var b = a;
    else
     var
      c = Re_Import[5].call(null, len, -1),
      b =
        c || Re_Import[6].call(null, pos + len | 0, caml_ml_string_length(s));
    if(b) Stdlib[1].call(null, cst_Re_exec_out_of_bounds);
    return typeof make_match_str(re, empty, len, 0, 0, s, pos) === "number"
            ? 0
            : 1;
   }
   function match_str(groups, partial, re, s, pos, len){
    var a = Re_Import[5].call(null, pos, 0);
    if(a)
     var b = a;
    else
     var
      c = Re_Import[5].call(null, len, -1),
      b =
        c || Re_Import[6].call(null, pos + len | 0, caml_ml_string_length(s));
    if(b) Stdlib[1].call(null, cst_Re_exec_out_of_bounds);
    return match_str_no_bounds(groups, partial, re, s, pos, len);
   }
   function enforce_kind(ids, kind$0, kind, cr){
    if(typeof kind$0 === "number" && 332064784 === kind$0){
     if(typeof kind === "number" && 332064784 === kind) return cr;
     var a = Re_Automata[11].call(null, ids);
     return Re_Automata[10].call(null, ids, kind, cr, a);
    }
    return cr;
   }
   function translate(ctx$2, ast$3){
    a:
    {
     b:
     {
      c:
      {
       d:
       {
        e:
        {
         var ctx = ctx$2, ast = ast$3;
         f:
         for(;;){
          var
           colors = ctx[8],
           cache = ctx[7],
           names = ctx[6],
           pos = ctx[5],
           greedy = ctx[4],
           ign_group = ctx[3],
           kind = ctx[2],
           ids = ctx[1];
          if(typeof ast === "number") break a;
          switch(ast[0]){
            case 0:
             break b;
            case 1:
             break c;
            case 2:
             var l$1 = ast[1]; return [0, trans_seq(ctx, l$1), kind];
            case 3:
             break d;
            case 4:
             var ast$0 = ast[2], n$2 = ast[1];
             if(! ign_group) break e;
             ast = ast$0;
             break;
            case 5:
             var
              ast$1 = ast[1],
              ctx$0 =
                [0, ctx[1], ctx[2], 1, ctx[4], ctx[5], ctx[6], ctx[7], ctx[8]];
             ctx = ctx$0;
             ast = ast$1;
             break;
            case 6:
             break f;
            case 7:
             var
              r$2 = ast[2],
              i$1 = ast[1],
              match$4 = translate(ctx, r$2),
              kind$4 = match$4[2],
              cr$3 = match$4[1],
              M = Re_Automata[14].call(null, ids, i$1);
             return [0,
                     Re_Automata[10].call(null, ids, 332064784, M, cr$3),
                     kind$4];
            case 8:
             var
              r$3 = ast[2],
              kind$5 = ast[1],
              match$5 =
                translate
                 ([0,
                   ctx[1],
                   kind$5,
                   ctx[3],
                   ctx[4],
                   ctx[5],
                   ctx[6],
                   ctx[7],
                   ctx[8]],
                  r$3),
              kind$6 = match$5[2],
              cr$4 = match$5[1];
             return [0, enforce_kind(ids, kind$5, kind$6, cr$4), kind$5];
            default:
             var
              ast$2 = ast[2],
              greedy$0 = ast[1],
              ctx$1 =
                [0,
                 ctx[1],
                 ctx[2],
                 ctx[3],
                 greedy$0,
                 ctx[5],
                 ctx[6],
                 ctx[7],
                 ctx[8]];
             ctx = ctx$1;
             ast = ast$2;
          }
         }
         var
          r$1 = ast[1],
          b = pos[1],
          match$3 = translate(ctx, r$1),
          kind$3 = match$3[2],
          cr$2 = match$3[1],
          e = caml_call1(Re_Automata[1][3], pos[1]),
          K = caml_call2(Re_Automata[1][1], e, b);
         if(Re_Import[3].call(null, K, -1)) return [0, cr$2, kind$3];
         var L = Re_Automata[15].call(null, ids, b, e);
         return [0,
                 Re_Automata[10].call(null, ids, 332064784, L, cr$2),
                 kind$3];
        }
        var p = pos[1];
        if(n$2){
         var name = n$2[1], F = names[1];
         names[1] = [0, [0, name, caml_call1(Re_Automata[1][6], p)], F];
        }
        pos[1] = caml_call1(Re_Automata[1][5], pos[1]);
        var
         match$2 = translate(ctx, ast$0),
         kind$2 = match$2[2],
         cr$1 = match$2[1],
         G = caml_call1(Re_Automata[1][4], p),
         H = Re_Automata[13].call(null, ids, G),
         I = Re_Automata[10].call(null, ids, 332064784, cr$1, H),
         J = Re_Automata[13].call(null, ids, p);
        return [0, Re_Automata[10].call(null, ids, 332064784, J, I), kind$2];
       }
       var
        j = ast[3],
        i$0 = ast[2],
        r$0 = ast[1],
        match$1 = translate(ctx, r$0),
        kind$1 = match$1[2],
        cr$0 = match$1[1];
       if(j){
        var
         j$0 = j[1],
         f =
           620821490 <= greedy
            ? function
             (rem){
              var
               a = Re_Automata[18].call(null, ids, cr$0),
               b = [0, Re_Automata[10].call(null, ids, kind$1, a, rem), 0],
               c = [0, Re_Automata[11].call(null, ids), b];
              return Re_Automata[9].call(null, ids, c);
             }
            : function
             (rem){
              var
               a = [0, Re_Automata[11].call(null, ids), 0],
               b = Re_Automata[18].call(null, ids, cr$0),
               c = [0, Re_Automata[10].call(null, ids, kind$1, b, rem), a];
              return Re_Automata[9].call(null, ids, c);
             },
         v$2 = Re_Automata[11].call(null, ids),
         n$1 = j$0 - i$0 | 0,
         n = n$1,
         v = v$2;
        for(;;){
         if(Re_Import[10][8].call(null, n, 0)){var rem = v, n$4 = i$0; break;}
         var v$0 = f(v), n$0 = n - 1 | 0;
         n = n$0;
         v = v$0;
        }
       }
       else
        var
         rem = Re_Automata[12].call(null, ids, greedy, kind$1, cr$0),
         n$4 = i$0;
       for(;;){
        if(Re_Import[10][8].call(null, n$4, 0)) return [0, rem, kind];
        var
         E = Re_Automata[18].call(null, ids, cr$0),
         v$3 = Re_Automata[10].call(null, ids, kind$1, E, rem),
         n$3 = n$4 - 1 | 0;
        rem = v$3;
        n$4 = n$3;
       }
      }
      var l$0 = ast[1][1], merged_sequences = Re_Ast[3].call(null, l$0);
      if(merged_sequences && ! merged_sequences[2]){
       var
        r = merged_sequences[1],
        match$0 = translate(ctx, r),
        kind$0 = match$0[2],
        cr = match$0[1];
       return [0, enforce_kind(ids, kind, kind$0, cr), kind];
      }
      var
       D =
         Stdlib_ListLabels[20].call
          (null,
           function(r){
            var match = translate(ctx, r), kind$0 = match[2], cr = match[1];
            return enforce_kind(ids, kind, kind$0, cr);
           },
           merged_sequences);
      return [0, Re_Automata[9].call(null, ids, D), kind];
     }
     var s = ast[1], match = Re_Cset[40].call(null, s);
     if(match)
      var
       i = match[1],
       c = Re_Color_map[2][1].call(null, colors, i),
       a = Re_Cset[46].call(null, c);
     else{
      var v$1 = [0, Re_Cset[42].call(null, s), s];
      try{var d = caml_call2(Re_Cset[44][17], v$1, cache[1]), a = d;}
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
       var l = Re_Color_map[2][3].call(null, colors, s);
       cache[1] = caml_call3(Re_Cset[44][2], v$1, l, cache[1]);
       var a = l;
      }
     }
     return [0, Re_Automata[7].call(null, ids, a), kind];
    }
    switch(ast){
      case 0:
       var g = Re_Category[1].call(null, Re_Category[4], Re_Category[7]);
       return [0, Re_Automata[17].call(null, ids, g), kind];
      case 1:
       var h = Re_Category[1].call(null, Re_Category[4], Re_Category[7]);
       return [0, Re_Automata[16].call(null, ids, h), kind];
      case 2:
       var
        k = Re_Automata[16].call(null, ids, Re_Category[5]),
        m = Re_Category[1].call(null, Re_Category[4], Re_Category[6]),
        o = Re_Automata[17].call(null, ids, m);
       return [0, Re_Automata[10].call(null, ids, 332064784, o, k), kind];
      case 3:
       var
        q = Re_Category[1].call(null, Re_Category[4], Re_Category[6]),
        t = Re_Automata[16].call(null, ids, q),
        u = Re_Automata[17].call(null, ids, Re_Category[5]);
       return [0, Re_Automata[10].call(null, ids, 332064784, u, t), kind];
      case 4:
       var
        cat = Re_Category[1].call(null, Re_Category[4], Re_Category[6]),
        w = Re_Automata[16].call(null, ids, cat),
        x = Re_Automata[17].call(null, ids, cat),
        y = [0, Re_Automata[10].call(null, ids, 332064784, x, w), 0],
        z = Re_Automata[16].call(null, ids, Re_Category[5]),
        A = Re_Automata[17].call(null, ids, Re_Category[5]),
        B = [0, Re_Automata[10].call(null, ids, 332064784, A, z), y];
       return [0, Re_Automata[9].call(null, ids, B), kind];
      case 5:
       return [0, Re_Automata[17].call(null, ids, Re_Category[4]), kind];
      case 6:
       return [0, Re_Automata[16].call(null, ids, Re_Category[4]), kind];
      case 7:
       var C = Re_Category[1].call(null, Re_Category[4], Re_Category[8]);
       return [0, Re_Automata[16].call(null, ids, C), kind];
      case 8:
       return [0, Re_Automata[17].call(null, ids, Re_Category[9]), kind];
      default:
       return [0, Re_Automata[16].call(null, ids, Re_Category[9]), kind];
    }
   }
   function trans_seq(ctx, param){
    var kind = ctx[2], ids = ctx[1];
    if(! param) return Re_Automata[11].call(null, ids);
    var r = param[1];
    if(param[2]){
     var
      rem = param[2],
      match = translate(ctx, r),
      kind$0 = match[2],
      cr = match[1],
      cr$0 = trans_seq(ctx, rem);
     return Re_Automata[4].call(null, cr$0)
             ? cr
             : Re_Automata
                 [4].call
                (null, cr)
               ? cr$0
               : Re_Automata[10].call(null, ids, kind$0, cr, cr$0);
    }
    var match$0 = translate(ctx, r), kind$1 = match$0[2], cr$1 = match$0[1];
    return enforce_kind(ids, kind, kind$1, cr$1);
   }
   function compile(r$0){
    if(Re_Ast[5].call(null, r$0))
     var regexp$0 = caml_call2(Re_Ast[7][23], 0, r$0);
    else
     var
      e = [0, caml_call2(Re_Ast[7][23], 0, r$0), 0],
      f = caml_call1(Re_Ast[7][34], Re_Ast[7][11]),
      g = [0, caml_call1(Re_Ast[7][37], f), e],
      regexp$0 = caml_call1(Re_Ast[7][38], g);
    var
     regexp = Re_Ast[4].call(null, 0, regexp$0),
     color_map = Re_Color_map[3].call(null, 0),
     need_lnl = Re_Ast[6].call(null, color_map, regexp),
     match = Re_Color_map[4].call(null, color_map),
     color_repr = match[2],
     colors = match[1],
     ncolor = Re_Color_map[1][2].call(null, color_repr),
     lnl = need_lnl ? Re_Cset[3].call(null, ncolor) : Re_Cset[6],
     ncolor$0 = need_lnl ? ncolor + 1 | 0 : ncolor,
     c = [0, Re_Cset[44][1]],
     d = [0, Re_Automata[1][2]],
     ctx =
       [0,
        caml_call1(Re_Automata[6][1], 0),
        332064784,
        0,
        -904640576,
        d,
        [0, 0],
        c,
        colors],
     match$0 = translate(ctx, regexp),
     kind = match$0[2],
     r = match$0[1],
     initial = enforce_kind(ctx[1], 332064784, kind, r),
     group_count = caml_call1(Re_Automata[1][6], ctx[5][1]),
     group_names = Stdlib_ListLabels[10].call(null, ctx[6][1]),
     a = Stdlib_Mutex[1].call(null, 0),
     b = caml_call1(Re_Automata[21][8][1], 97);
    return [0,
            initial,
            0,
            colors,
            color_repr,
            ncolor$0,
            lnl,
            caml_call1(Re_Automata[22][1], 0),
            b,
            group_names,
            group_count,
            a];
   }
   runtime.caml_register_global
    (18,
     [0,
      [0,
       create,
       feed,
       finalize,
       [0,
        [0, get, test_mark],
        create$0,
        feed$0,
        finalize$0,
        no_match_starts_before]],
      match_str_no_bounds,
      match_str,
      match_str_p,
      compile,
      group_count,
      group_names,
      pp_re],
     "Re__Compile");
   return;
  }
  (globalThis));

//# 4555 "../.js/default/re/re.cma.js"
//# shape: Re__Search:[F(4)->F(1),F(4)->F(1),F(4)->F(1),F(4)->F(1),F(4)->F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Assert_failure = global_data.Assert_failure,
    Re_Compile = global_data.Re__Compile,
    Stdlib_String = global_data.Stdlib__String,
    Re_Group = global_data.Re__Group,
    Stdlib = global_data.Stdlib,
    Stdlib_Seq = global_data.Stdlib__Seq;
   function all(opt, len, re, s){
    var pos = opt ? opt[1] : 0, cst_Re_all = "Re.all";
    if(pos < 0) Stdlib[1].call(null, cst_Re_all);
    if(len){
     var
      l = len[1],
      a = l < 0,
      b = a || caml_ml_string_length(s) < (pos + l | 0);
     if(b) Stdlib[1].call(null, cst_Re_all);
     var limit = pos + l | 0;
    }
    else
     var limit = caml_ml_string_length(s);
    function aux(pos$2, on_match$0, param){
     var pos = pos$2, on_match = on_match$0;
     for(;;){
      if(limit < pos) return 0;
      var match = Re_Compile[3].call(null, 1, 0, re, s, pos, limit - pos | 0);
      if(typeof match !== "number" && 0 === match[0]){
       var
        substr = match[1],
        a = Re_Group[17].call(null, substr, 0),
        p1 = caml_call1(Re_Group[16][2], a),
        b = Re_Group[18].call(null, substr, 0),
        p2 = caml_call1(Re_Group[16][2], b);
       if(! on_match) break;
       if(p1 !== pos) break;
       if(p1 !== p2) break;
       var pos$0 = pos + 1 | 0;
       pos = pos$0;
       on_match = 0;
       continue;
      }
      return 0;
     }
     var pos$1 = p1 === p2 ? p2 + 1 | 0 : p2, c = p1 !== p2 ? 1 : 0;
     return [0, substr, function(a){return aux(pos$1, c, a);}];
    }
    return function(a){return aux(pos, 0, a);};
   }
   function matches(pos, len, re, s){
    var a = all(pos, len, re, s);
    function b(sub){return Re_Group[2].call(null, sub, 0);}
    var c = Stdlib_Seq[29];
    return function(d){return c(b, a, d);};
   }
   var a = [0, "lib/search.ml", 56, 6];
   function split_full(opt, len, re, s){
    var pos = opt ? opt[1] : 0, cst_Re_split = "Re.split";
    if(pos < 0) Stdlib[1].call(null, cst_Re_split);
    if(len){
     var
      l = len[1],
      b = l < 0,
      c = b || caml_ml_string_length(s) < (pos + l | 0);
     if(c) Stdlib[1].call(null, cst_Re_split);
     var limit = pos + l | 0;
    }
    else
     var limit = caml_ml_string_length(s);
    function aux(state$0, i, pos$2, param){
     a:
     {
      b:
      {
       var old_i = i, pos$0 = pos$2;
       for(;;){
        if(typeof state$0 !== "number") break;
        if(limit < pos$0){
         if(old_i === limit) return 0;
         throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
        }
        var
         match =
           Re_Compile[3].call(null, 1, 0, re, s, pos$0, limit - pos$0 | 0);
        if(typeof match === "number") break b;
        if(0 !== match[0]) return 0;
        var
         substr = match[1],
         b = Re_Group[17].call(null, substr, 0),
         p1 = caml_call1(Re_Group[16][2], b),
         c = Re_Group[18].call(null, substr, 0),
         p2 = caml_call1(Re_Group[16][2], c),
         pos$1 = p1 === p2 ? p2 + 1 | 0 : p2;
        if(old_i !== p1) break a;
        if(p1 !== p2) break a;
        if(pos >= p1) break a;
        old_i = p2;
        pos$0 = pos$1;
       }
       var x = state$0[2];
       return [0, x, function(a){return aux(814535476, old_i, pos$0, a);}];
      }
      if(old_i >= limit) return 0;
      var text = Stdlib_String[16].call(null, s, old_i, limit - old_i | 0);
      return [0,
              [0, 936573133, text],
              function(a){return aux(state$0, limit, pos$0, a);}];
     }
     if(pos >= p1)
      return [0,
              [0, -363573681, substr],
              function(a){return aux(state$0, p2, pos$1, a);}];
     var
      text$0 = Stdlib_String[16].call(null, s, old_i, p1 - old_i | 0),
      state = [0, 73271853, [0, -363573681, substr]];
     return [0,
             [0, 936573133, text$0],
             function(a){return aux(state, p2, pos$1, a);}];
    }
    return function(a){return aux(814535476, pos, pos, a);};
   }
   function split(pos, len, re, s){
    var seq = split_full(pos, len, re, s);
    function filter(seq$1, param){
     var seq = seq$1;
     for(;;){
      var match = caml_call1(seq, 0);
      if(! match) return 0;
      var match$0 = match[1], variant = match$0[1];
      if(936573133 <= variant) break;
      var seq$0 = match[2];
      seq = seq$0;
     }
     var tl = match[2], s = match$0[2];
     return [0, s, function(a){return filter(tl, a);}];
    }
    return function(a){return filter(seq, a);};
   }
   function split_delim(pos, len, re, s){
    var seq = split_full(pos, len, re, s);
    function filter(delim$0, seq$1, param){
     a:
     {
      var cst = "";
      b:
      {
       var delim = delim$0, seq = seq$1;
       for(;;){
        var match = caml_call1(seq, 0);
        if(! match) break;
        var match$0 = match[1], variant = match$0[1];
        if(936573133 <= variant) break a;
        var seq$0 = match[2];
        if(delim) break b;
        delim = 1;
        seq = seq$0;
       }
       return delim ? [0, cst, function(param){return 0;}] : 0;
      }
      return [0, cst, function(param){return filter(1, seq$0, 0);}];
     }
     var tl = match[2], s = match$0[2];
     return [0, s, function(a){return filter(0, tl, a);}];
    }
    return function(a){return filter(1, seq, a);};
   }
   runtime.caml_register_global
    (13, [0, all, matches, split_full, split, split_delim], "Re__Search");
   return;
  }
  (globalThis));

//# 4741 "../.js/default/re/re.cma.js"
//# shape: Re__Core:[N,F(1),F(1)*,F(1)*,F(4),F(4),F(4),F(4),F(4),N,F(4),F(4),F(4)->F(1),F(4),F(4),F(4)->F(1),F(4),F(4),F(4),F(4)->F(1),F(4),F(4),F(4)->F(1),N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(2),N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(2),F(2),N,F(2),F(2),F(1),F(1),F(2),F(2),F(1)*,N]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Search = global_data.Re__Search,
    Stdlib_Seq = global_data.Stdlib__Seq,
    Stdlib_ListLabels = global_data.Stdlib__ListLabels,
    Re_Group = global_data.Re__Group,
    Re_Pmark = global_data.Re__Pmark,
    Re_Compile = global_data.Re__Compile,
    Stdlib = global_data.Stdlib,
    Re_Cset = global_data.Re__Cset,
    Re_Ast = global_data.Re__Ast,
    cset = Re_Ast[8];
   function rg(c$0, c){return cset(Re_Cset[25].call(null, c$0, c));}
   var
    notnl = cset(Re_Cset[22]),
    lower = cset(Re_Cset[30]),
    upper = cset(Re_Cset[31]),
    alpha = cset(Re_Cset[32]),
    digit = cset(Re_Cset[19]),
    alnum = cset(Re_Cset[33]),
    wordc = cset(Re_Cset[34]),
    ascii = cset(Re_Cset[23]),
    blank = cset(Re_Cset[27]),
    cntrl = cset(Re_Cset[35]),
    graph = cset(Re_Cset[36]),
    print = cset(Re_Cset[37]),
    punct = cset(Re_Cset[38]),
    space = cset(Re_Cset[28]),
    xdigit = cset(Re_Cset[29]),
    include = Re_Ast[7],
    empty = include[1],
    epsilon = include[2],
    str = include[3],
    no_case = include[4],
    case$ = include[5],
    diff = include[6],
    compl = include[7],
    repn = include[8],
    inter = include[9],
    char = include[10],
    any = include[11],
    set = include[12],
    mark = include[13],
    nest = include[14],
    no_group = include[15],
    whole_string = include[16],
    leol = include[17],
    longest = include[18],
    greedy = include[19],
    non_greedy = include[20],
    stop = include[21],
    not_boundary = include[22],
    group = include[23],
    word = include[24],
    first = include[25],
    bos = include[26],
    bow = include[27],
    eow = include[28],
    eos = include[29],
    bol = include[30],
    start = include[31],
    eol = include[32],
    opt = include[33],
    rep = include[34],
    rep1 = include[35],
    alt = include[36],
    shortest = include[37],
    seq = include[38],
    pp = include[39],
    witness = include[40];
   function exec_internal(a, opt, partial, groups, re, s){
    var pos = a ? a[1] : 0, len = opt ? opt[1] : -1;
    return Re_Compile[3].call(null, groups, partial, re, s, pos, len);
   }
   function exec(pos, len, re, s){
    var match = exec_internal(pos, len, 0, 1, re, s);
    if(typeof match !== "number" && 0 === match[0]){var substr = match[1]; return substr;}
    throw caml_maybe_attach_backtrace(Stdlib[8], 1);
   }
   function exec_opt(pos, len, re, s){
    var match = exec_internal(pos, len, 0, 1, re, s);
    if(typeof match !== "number" && 0 === match[0]){var substr = match[1]; return [0, substr];}
    return 0;
   }
   function execp(a, opt, re, s){
    var pos = a ? a[1] : 0, len = opt ? opt[1] : -1;
    return Re_Compile[4].call(null, re, s, pos, len);
   }
   function exec_partial(pos, len, re, s){
    var match = exec_internal(pos, len, 1, 0, re, s);
    return typeof match === "number"
            ? -1062743954
            : 0 === match[0] ? 782112175 : 939392865;
   }
   function exec_partial_detailed(pos, len, re, s){
    var match = exec_internal(pos, len, 1, 1, re, s);
    if(typeof match === "number") return -1062743954;
    if(0 === match[0]){var group = match[1]; return [0, 782112175, group];}
    var no_match_starts_before = match[1];
    return [0, 939392865, no_match_starts_before];
   }
   function marked(g, p){
    var a = Re_Group[13].call(null, g);
    return caml_call2(Re_Pmark[6][31], p, a);
   }
   function mark_set(g){return Re_Group[13].call(null, g);}
   var equal = Re_Pmark[1], compare = Re_Pmark[2];
   function gen_of_seq(s){
    var r = [0, s];
    return function(param){
     var match = caml_call1(r[1], 0);
     if(! match) return 0;
     var tl = match[2], x = match[1];
     r[1] = tl;
     return [0, x];};
   }
   function split_gen(pos, len, re, s){
    return gen_of_seq(Re_Search[4].call(null, pos, len, re, s));
   }
   function split_full_gen(pos, len, re, s){
    return gen_of_seq(Re_Search[3].call(null, pos, len, re, s));
   }
   function all_gen(pos, len, re, s){
    return gen_of_seq(Re_Search[1].call(null, pos, len, re, s));
   }
   function matches_gen(pos, len, re, s){
    return gen_of_seq(Re_Search[2].call(null, pos, len, re, s));
   }
   var
    split_full_seq = Re_Search[3],
    split_seq = Re_Search[4],
    matches_seq = Re_Search[2],
    all_seq = Re_Search[1],
    get = Re_Group[2],
    get_ofs = Re_Group[4],
    get_all = Re_Group[10],
    get_all_ofs = Re_Group[11],
    test = Re_Group[12];
   function list_of_seq(s){
    var a = Stdlib_Seq[5].call(null, function(l, x){return [0, x, l];}, 0, s);
    return Stdlib_ListLabels[10].call(null, a);
   }
   function all(pos, len, re, s){
    return list_of_seq(Re_Search[1].call(null, pos, len, re, s));
   }
   function matches(pos, len, re, s){
    return list_of_seq(Re_Search[2].call(null, pos, len, re, s));
   }
   function split_full(pos, len, re, s){
    return list_of_seq(Re_Search[3].call(null, pos, len, re, s));
   }
   function split(pos, len, re, s){
    return list_of_seq(Re_Search[4].call(null, pos, len, re, s));
   }
   function split_delim(pos, len, re, s){
    return list_of_seq(Re_Search[5].call(null, pos, len, re, s));
   }
   var
    compile = Re_Compile[5],
    print_re = Re_Compile[8],
    group_names = Re_Compile[7],
    group_count = Re_Compile[6],
    b = Re_Compile[1],
    c = b[4],
    a = Re_Pmark[6],
    Re_Core =
      [0,
       [0,
        Re_Group[2],
        Re_Group[3],
        Re_Group[4],
        Re_Group[5],
        Re_Group[6],
        Re_Group[7],
        Re_Group[8],
        Re_Group[9],
        Re_Group[10],
        Re_Group[11],
        Re_Group[12],
        Re_Group[14],
        Re_Group[15]],
       compile,
       group_count,
       group_names,
       exec,
       exec_opt,
       execp,
       exec_partial,
       exec_partial_detailed,
       [0,
        marked,
        [0,
         a[1],
         a[2],
         a[3],
         a[4],
         a[5],
         a[6],
         a[7],
         a[8],
         a[9],
         a[10],
         a[11],
         a[12],
         a[13],
         a[14],
         a[15],
         a[16],
         a[17],
         a[18],
         a[19],
         a[20],
         a[21],
         a[22],
         a[23],
         a[24],
         a[25],
         a[26],
         a[27],
         a[28],
         a[29],
         a[30],
         a[31],
         a[32],
         a[33],
         a[34],
         a[35],
         a[36],
         a[43],
         a[37],
         a[38],
         a[39],
         a[40],
         a[41],
         a[42]],
        mark_set,
        equal,
        compare],
       all,
       all_gen,
       all_seq,
       matches,
       matches_gen,
       matches_seq,
       split,
       split_delim,
       split_gen,
       split_seq,
       split_full,
       split_full_gen,
       split_full_seq,
       [0,
        Re_Search[1],
        Re_Search[2],
        Re_Search[4],
        Re_Search[5],
        Re_Search[3]],
       str,
       char,
       alt,
       seq,
       empty,
       epsilon,
       rep,
       rep1,
       repn,
       opt,
       bol,
       eol,
       bow,
       eow,
       bos,
       eos,
       leol,
       start,
       stop,
       word,
       not_boundary,
       whole_string,
       longest,
       shortest,
       first,
       greedy,
       non_greedy,
       group,
       no_group,
       nest,
       mark,
       set,
       rg,
       inter,
       diff,
       compl,
       any,
       notnl,
       alnum,
       wordc,
       alpha,
       ascii,
       blank,
       cntrl,
       digit,
       graph,
       lower,
       print,
       punct,
       space,
       upper,
       xdigit,
       case$,
       no_case,
       pp,
       print_re,
       print_re,
       witness,
       get,
       get_ofs,
       get_all,
       get_all_ofs,
       test,
       marked,
       mark_set,
       [0, b[1], b[2], b[3], [0, c[1], c[2], c[3], c[4]]]];
   runtime.caml_register_global(9, Re_Core, "Re__Core");
   return;
  }
  (globalThis));

//# 5088 "../.js/default/re/re.cma.js"
//# shape: Re__Parse_buffer:[N,F(1)*,F(1),F(1),F(1)*,F(2),F(3),F(1),F(2),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    caml_wrap_exception = runtime.caml_wrap_exception,
    Stdlib = runtime.caml_get_global_data().Stdlib,
    Parse_error =
      [248, "Re__Parse_buffer.Parse_error", runtime.caml_fresh_oo_id(0)];
   function create(str){return [0, str, 0];}
   function unget(t){t[2] = t[2] - 1 | 0; return 0;}
   function junk(t){t[2] = t[2] + 1 | 0; return 0;}
   function eos(t){return t[2] === caml_ml_string_length(t[1]) ? 1 : 0;}
   function test(t, c){
    var a = 1 - eos(t), b = a ? caml_string_get(t[1], t[2]) === c ? 1 : 0 : a;
    return b;
   }
   function test2(t, c$0, c){
    var a = (t[2] + 1 | 0) < caml_ml_string_length(t[1]) ? 1 : 0;
    if(a)
     var
      b = caml_string_get(t[1], t[2]) === c$0 ? 1 : 0,
      d = b ? caml_string_get(t[1], t[2] + 1 | 0) === c ? 1 : 0 : b;
    else
     var d = a;
    return d;
   }
   function accept(t, c){
    var r = test(t, c);
    if(r) t[2] = t[2] + 1 | 0;
    return r;
   }
   function get(t){
    var r = caml_string_get(t[1], t[2]);
    t[2] = t[2] + 1 | 0;
    return r;
   }
   function accept_s(t, s){
    var len = caml_ml_string_length(s);
    try{
     var a = len - 1 | 0;
     if(a >= 0){
      var j = 0;
      for(;;){
       try{
        var b = caml_string_get(t[1], t[2] + j | 0);
        if(caml_string_get(s, j) !== b) throw Stdlib[3];
       }
       catch(exn){throw Stdlib[3];}
       var c = j + 1 | 0;
       if(a === j) break;
       j = c;
      }
     }
     t[2] = t[2] + len | 0;
     return 1;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[3]) return 0;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function integer(t){
    if(eos(t)) return 0;
    var d$0 = get(t);
    if(9 < d$0 - 48 >>> 0){unget(t); return 0;}
    var i$1 = d$0 - 48 | 0, i = i$1;
    for(;;){
     if(eos(t)) return [0, i];
     var d = get(t);
     if(9 < d - 48 >>> 0){unget(t); return [0, i];}
     var i$0 = (10 * i | 0) + (d - 48 | 0) | 0;
     if(i$0 < i) throw caml_maybe_attach_backtrace(Parse_error, 1);
     i = i$0;
    }
   }
   runtime.caml_register_global
    (2,
     [0,
      Parse_error,
      create,
      junk,
      unget,
      eos,
      test,
      test2,
      get,
      accept,
      accept_s,
      integer],
     "Re__Parse_buffer");
   return;
  }
  (globalThis));

//# 5941 "../.js/default/re/re.cma.js"
//# shape: Re__Replace:[F(6),F(6)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Re_Compile = global_data.Re__Compile,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Re_Group = global_data.Re__Group,
    Stdlib = global_data.Stdlib;
   function replace(a, len, opt, re, f, s){
    var
     pos = a ? a[1] : 0,
     all = opt ? opt[1] : 1,
     cst_Re_replace = "Re.replace";
    if(pos < 0) Stdlib[1].call(null, cst_Re_replace);
    if(len){
     var
      l = len[1],
      b = l < 0,
      c = b || caml_ml_string_length(s) < (pos + l | 0);
     if(c) Stdlib[1].call(null, cst_Re_replace);
     var limit = pos + l | 0;
    }
    else
     var limit = caml_ml_string_length(s);
    var
     buf = Stdlib_Buffer[1].call(null, caml_ml_string_length(s)),
     pos$0 = pos,
     on_match = 0;
    for(;;){
     if(pos$0 <= limit){
      var
       match = Re_Compile[3].call(null, 1, 0, re, s, pos$0, limit - pos$0 | 0);
      if(typeof match === "number")
       Stdlib_Buffer[18].call(null, buf, s, pos$0, limit - pos$0 | 0);
      else if(0 === match[0]){
       var
        substr = match[1],
        d = Re_Group[17].call(null, substr, 0),
        p1 = caml_call1(Re_Group[16][2], d),
        e = Re_Group[18].call(null, substr, 0),
        p2 = caml_call1(Re_Group[16][2], e);
       if(pos$0 === p1 && p1 === p2 && on_match){
        if(p2 < limit){
         var g = caml_string_get(s, p2);
         Stdlib_Buffer[12].call(null, buf, g);
        }
        var pos$1 = p2 + 1 | 0;
        pos$0 = pos$1;
        on_match = 0;
        continue;
       }
       Stdlib_Buffer[18].call(null, buf, s, pos$0, p1 - pos$0 | 0);
       var replacing = caml_call1(f, substr);
       Stdlib_Buffer[16].call(null, buf, replacing);
       if(all){
        var on_match$0 = p1 !== p2;
        if(p1 !== p2){pos$0 = p2; on_match = on_match$0; continue;}
        if(p2 < limit){
         var h = caml_string_get(s, p2);
         Stdlib_Buffer[12].call(null, buf, h);
        }
        pos$0 = p2 + 1 | 0;
        on_match = on_match$0;
        continue;
       }
       Stdlib_Buffer[18].call(null, buf, s, p2, limit - p2 | 0);
      }
     }
     return Stdlib_Buffer[2].call(null, buf);
    }
   }
   function replace_string(pos, len, all, re, by, s){
    return replace(pos, len, all, re, function(param){return by;}, s);
   }
   runtime.caml_register_global
    (6, [0, replace, replace_string], "Re__Replace");
   return;
  }
  (globalThis));

//# 6453 "../.js/default/re/re.cma.js"
//# shape: Re__Posix_class:[N,F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_list_of_js_array = runtime.caml_list_of_js_array,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    cst_alnum = "alnum",
    cst_alpha = "alpha",
    cst_ascii = "ascii",
    cst_blank = "blank",
    cst_cntrl = "cntrl",
    cst_digit = "digit",
    cst_graph = "graph",
    cst_lower = "lower",
    cst_print = "print",
    cst_punct = "punct",
    cst_space = "space",
    cst_upper = "upper",
    cst_word = "word",
    cst_xdigit = "xdigit",
    names =
      caml_list_of_js_array
       ([cst_alpha,
         cst_alnum,
         cst_ascii,
         cst_blank,
         cst_cntrl,
         cst_digit,
         cst_lower,
         cst_print,
         cst_space,
         cst_upper,
         cst_word,
         cst_punct,
         cst_graph,
         cst_xdigit]),
    Re_Parse_buffer = global_data.Re__Parse_buffer,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib = global_data.Stdlib,
    Re_Core = global_data.Re__Core;
   function of_name(class$){
    var switch$ = runtime.caml_string_compare(class$, cst_lower);
    if(0 <= switch$){
     if(0 >= switch$) return Re_Core[71];
     if(class$ === cst_print) return Re_Core[72];
     if(class$ === cst_punct) return Re_Core[73];
     if(class$ === cst_space) return Re_Core[74];
     if(class$ === cst_upper) return Re_Core[75];
     if(class$ === cst_word) return Re_Core[64];
     if(class$ === cst_xdigit) return Re_Core[76];
    }
    else{
     if(class$ === cst_alnum) return Re_Core[63];
     if(class$ === cst_alpha) return Re_Core[65];
     if(class$ === cst_ascii) return Re_Core[66];
     if(class$ === cst_blank) return Re_Core[67];
     if(class$ === cst_cntrl) return Re_Core[68];
     if(class$ === cst_digit) return Re_Core[69];
     if(class$ === cst_graph) return Re_Core[70];
    }
    var a = Stdlib[28].call(null, "Invalid pcre class: ", class$);
    return Stdlib[1].call(null, a);
   }
   function parse(buf){
    var a = Re_Parse_buffer[9], b = Re_Parse_buffer[10];
    function accept_s(a){return b(buf, a);}
    if(! a(buf, 58)) return 0;
    var compl = a(buf, 94);
    try{var cls = Stdlib_List[39].call(null, accept_s, names);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[8])
      throw caml_maybe_attach_backtrace(Re_Parse_buffer[1], 1);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    if(1 - b(buf, ":]"))
     throw caml_maybe_attach_backtrace(Re_Parse_buffer[1], 1);
    var
     posix_class = of_name(cls),
     c = compl ? caml_call1(Re_Core[60], [0, posix_class, 0]) : posix_class;
    return [0, c];
   }
   runtime.caml_register_global
    (21, [0, names, of_name, parse], "Re__Posix_class");
   return;
  }
  (globalThis));

//# 6553 "../.js/default/re/re.cma.js"
//# shape: Re__Perl:[N,N,F(2),F(2),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_mul = runtime.caml_mul,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_List = global_data.Stdlib__List,
    Re_Core = global_data.Re__Core,
    Re_Parse_buffer = global_data.Re__Parse_buffer,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Re_Posix_class = global_data.Re__Posix_class,
    Stdlib = global_data.Stdlib,
    Parse_error = Re_Parse_buffer[1],
    Not_supported =
      [248, "Re__Perl.Not_supported", runtime.caml_fresh_oo_id(0)];
   function char_of_int(x){
    try{var x$0 = Stdlib[29].call(null, x); return x$0;}
    catch(exn){throw caml_maybe_attach_backtrace(Parse_error, 1);}
   }
   var
    a = [0, caml_call1(Re_Core[26], 95), 0],
    word_char = [0, Re_Core[63], a],
    word = [1, caml_call1(Re_Core[27], word_char)],
    not_word = [1, caml_call1(Re_Core[27], word_char)],
    space = [1, Re_Core[74]],
    not_space = [1, caml_call1(Re_Core[60], [0, Re_Core[74], 0])],
    digit = [1, Re_Core[69]],
    not_digit = [1, caml_call1(Re_Core[60], [0, Re_Core[69], 0])],
    char_b = [0, 8],
    char_newline = [0, 10],
    char_cr = [0, 13],
    char_tab = [0, 9];
   function re(opt, s){
    var
     opts = opt ? opt[1] : 0,
     ungreedy = Stdlib_List[38].call(null, -243745063, opts),
     dotall = Stdlib_List[38].call(null, -424303016, opts),
     dollar_endonly = Stdlib_List[38].call(null, -712595228, opts),
     multiline = Stdlib_List[38].call(null, 1071952589, opts),
     buf = Re_Parse_buffer[2].call(null, s),
     a = Re_Parse_buffer[9];
    function eos(param){return Re_Parse_buffer[5].call(null, buf);}
    function test(c){return Re_Parse_buffer[6].call(null, buf, c);}
    function get(param){return Re_Parse_buffer[8].call(null, buf);}
    function greedy_mod(r){
     var gr$0 = a(buf, 63), gr = ungreedy ? 1 - gr$0 : gr$0;
     return gr ? caml_call1(Re_Core[51], r) : caml_call1(Re_Core[50], r);
    }
    function regexp(param){
     var left = [0, branch(0), 0], left$0 = left;
     for(;;){
      if(! a(buf, 124)){
       var b = Stdlib_List[10].call(null, left$0);
       return caml_call1(Re_Core[27], b);
      }
      var left$1 = [0, branch(0), left$0];
      left$0 = left$1;
     }
    }
    function branch(param){
     var left = 0;
     for(;;){
      if(! eos(0) && ! test(124) && ! test(41)){
       var r = atom(0);
       if(a(buf, 42))
        var b = greedy_mod(caml_call1(Re_Core[31], r));
       else if(a(buf, 43))
        var b = greedy_mod(caml_call1(Re_Core[32], r));
       else if(a(buf, 63))
        var b = greedy_mod(caml_call1(Re_Core[34], r));
       else if(a(buf, 123)){
        var match = Re_Parse_buffer[11].call(null, buf);
        if(match){
         var
          i = match[1],
          j = a(buf, 44) ? Re_Parse_buffer[11].call(null, buf) : [0, i];
         if(1 - a(buf, 125))
          throw caml_maybe_attach_backtrace(Parse_error, 1);
         if(j){
          var j$0 = j[1];
          if(j$0 < i) throw caml_maybe_attach_backtrace(Parse_error, 1);
         }
         var b = greedy_mod(caml_call3(Re_Core[33], r, i, j));
        }
        else{Re_Parse_buffer[4].call(null, buf); var b = r;}
       }
       else
        var b = r;
       var left$0 = [0, b, left];
       left = left$0;
       continue;
      }
      var c = Stdlib_List[10].call(null, left);
      return caml_call1(Re_Core[28], c);
     }
    }
    function atom(param){
     if(a(buf, 46)) return dotall ? Re_Core[61] : Re_Core[62];
     if(! a(buf, 40)){
      if(a(buf, 94)) return multiline ? Re_Core[35] : Re_Core[39];
      if(a(buf, 36))
       return multiline
               ? Re_Core[36]
               : dollar_endonly ? Re_Core[41] : Re_Core[40];
      if(a(buf, 91)){
       if(a(buf, 94)){var h = bracket(0); return caml_call1(Re_Core[60], h);}
       var j = bracket(0);
       return caml_call1(Re_Core[27], j);
      }
      if(! a(buf, 92)){
       if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
       var c = get(0);
       a:
       {
        if(64 <= c){
         if(92 !== c && 123 !== c) break a;
        }
        else
         if(44 <= c){if(63 > c) break a;} else if(42 > c) break a;
        throw caml_maybe_attach_backtrace(Parse_error, 1);
       }
       return caml_call1(Re_Core[26], c);
      }
      if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      var n1 = get(0), switcher = n1 - 48 | 0;
      if(74 >= switcher >>> 0)
       switch(switcher){
         case 17:
          return Re_Core[39];
         case 18:
          return Re_Core[45];
         case 20:
          return caml_call1(Re_Core[60], [0, Re_Core[69], 0]);
         case 21:
          throw caml_maybe_attach_backtrace(Parse_error, 1);
         case 23:
          return Re_Core[42];
         case 33:
          var buf$0 = Stdlib_Buffer[1].call(null, 12);
          for(;;)
           if(a(buf, 92)){
            if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
            var c$0 = get(0);
            if(69 === c$0){
             var q = Stdlib_Buffer[2].call(null, buf$0);
             return caml_call1(Re_Core[25], q);
            }
            Stdlib_Buffer[12].call(null, buf$0, 92);
            Stdlib_Buffer[12].call(null, buf$0, c$0);
           }
           else{
            if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
            var s = get(0);
            Stdlib_Buffer[12].call(null, buf$0, s);
           }
          break;
         case 35:
          return caml_call1(Re_Core[60], [0, Re_Core[74], 0]);
         case 39:
          var l = [0, caml_call1(Re_Core[26], 95), 0];
          return caml_call1(Re_Core[60], [0, Re_Core[63], l]);
         case 42:
          return Re_Core[41];
         case 50:
          return caml_call1
                  (Re_Core[27], [0, Re_Core[37], [0, Re_Core[38], 0]]);
         case 52:
          return Re_Core[69];
         case 53:
          return caml_call1(Re_Core[26], 27);
         case 54:
          return caml_call1(Re_Core[26], 12);
         case 62:
          return caml_call1(Re_Core[26], 10);
         case 63:
          if(a(buf, 123)){
           var acc$1 = 0;
           for(;;){
            if(a(buf, 125)){var match$0 = [0, acc$1]; break;}
            var match = maybe_octaldigit(0);
            if(! match) throw caml_maybe_attach_backtrace(Parse_error, 1);
            var p = match[1], acc$2 = [0, p, acc$1];
            acc$1 = acc$2;
           }
          }
          else
           var match$0 = 0;
          if(! match$0) throw caml_maybe_attach_backtrace(Parse_error, 1);
          var digits$1 = match$0[1], digits = digits$1, acc = 0, i = 1;
          for(;;){
           if(! digits){
            var m = char_of_int(acc);
            return caml_call1(Re_Core[26], m);
           }
           var
            digits$0 = digits[2],
            d = digits[1],
            acc$0 = acc + caml_mul(d, i) | 0,
            i$0 = caml_mul(i, i);
           digits = digits$0;
           acc = acc$0;
           i = i$0;
          }
          break;
         case 66:
          return caml_call1(Re_Core[26], 13);
         case 67:
          return Re_Core[74];
         case 68:
          return caml_call1(Re_Core[26], 9);
         case 71:
          var n = [0, caml_call1(Re_Core[26], 95), 0];
          return caml_call1(Re_Core[27], [0, Re_Core[63], n]);
         case 72:
          if(a(buf, 123)){
           var acc$4 = 0;
           for(;;){
            if(a(buf, 125)){var match$1 = [0, acc$4]; break;}
            var acc$3 = [0, hexdigit(0), acc$4];
            acc$4 = acc$3;
           }
          }
          else
           var match$1 = 0;
          a:
          {
           if(match$1){
            var e = match$1[1];
            if(e){
             var match$2 = e[2], c1 = e[1];
             if(! match$2){var c2$0 = c1, c1$0 = 0; break a;}
             if(! match$2[2]){
              var c2 = match$2[1], c2$0 = c2, c1$0 = c1;
              break a;
             }
            }
            throw caml_maybe_attach_backtrace(Parse_error, 1);
           }
           var
            c1$1 = hexdigit(0),
            c2$1 = hexdigit(0),
            c2$0 = c2$1,
            c1$0 = c1$1;
          }
          var code = (c1$0 * 16 | 0) + c2$0 | 0, o = char_of_int(code);
          return caml_call1(Re_Core[26], o);
         case 74:
          return Re_Core[40];
         case 8:
         case 9:
          throw caml_maybe_attach_backtrace(Not_supported, 1);
         case 0:
         case 1:
         case 2:
         case 3:
         case 4:
         case 5:
         case 6:
         case 7:
          var n2 = maybe_octaldigit(0), n3 = maybe_octaldigit(0);
          if(n2 && n3){
           var
            n3$0 = n3[1],
            n2$0 = n2[1],
            n1$0 = n1 - 48 | 0,
            k = char_of_int(((n1$0 * 64 | 0) + (n2$0 * 8 | 0) | 0) + n3$0 | 0);
           return caml_call1(Re_Core[26], k);
          }
          throw caml_maybe_attach_backtrace(Not_supported, 1);
         case 10:
         case 11:
         case 12:
         case 13:
         case 14:
         case 15:
         case 16:
         case 43:
         case 44:
         case 45:
         case 46:
         case 47:
         case 48: break;
         default: throw caml_maybe_attach_backtrace(Parse_error, 1);
       }
      return caml_call1(Re_Core[26], n1);
     }
     if(! a(buf, 63)){
      var r$1 = regexp(0);
      if(1 - a(buf, 41)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      return caml_call2(Re_Core[52], 0, r$1);
     }
     if(a(buf, 58)){
      var r = regexp(0);
      if(1 - a(buf, 41)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      return r;
     }
     if(! a(buf, 35)){
      if(! a(buf, 60)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      var c$1 = get(0), f = c$1 - 91 | 0;
      a:
      {
       if(5 < f >>> 0){
        if(57 < f + 26 >>> 0) break a;
       }
       else if(4 !== f) break a;
       var b = Stdlib_Buffer[1].call(null, 32);
       Stdlib_Buffer[12].call(null, b, c$1);
       for(;;){
        if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
        var c$2 = get(0);
        b:
        {
         if(65 <= c$2){
          var g = c$2 - 91 | 0;
          if(5 < g >>> 0){if(32 <= g) break b;} else if(4 !== g) break b;
         }
         else{
          if(58 <= c$2){
           if(62 !== c$2) break b;
           var name = Stdlib_Buffer[2].call(null, b), r$0 = regexp(0);
           if(1 - a(buf, 41))
            throw caml_maybe_attach_backtrace(Parse_error, 1);
           return caml_call2(Re_Core[52], [0, name], r$0);
          }
          if(48 > c$2) break b;
         }
         Stdlib_Buffer[12].call(null, b, c$2);
         continue;
        }
        throw caml_maybe_attach_backtrace(Parse_error, 1);
       }
      }
      throw caml_maybe_attach_backtrace(Parse_error, 1);
     }
     for(;;){
      if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      if(a(buf, 41)) return Re_Core[30];
      Re_Parse_buffer[3].call(null, buf);
     }
    }
    function hexdigit(param){
     if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
     var d = get(0);
     if(65 <= d){
      if(97 <= d){
       if(103 > d) return (d - 97 | 0) + 10 | 0;
      }
      else if(71 > d) return (d - 65 | 0) + 10 | 0;
     }
     else if(9 >= d - 48 >>> 0) return d - 48 | 0;
     throw caml_maybe_attach_backtrace(Parse_error, 1);
    }
    function maybe_octaldigit(param){
     if(eos(0)) return 0;
     var d = get(0);
     return 7 < d - 48 >>> 0 ? 0 : [0, d - 48 | 0];
    }
    function bracket(s$2){
     var s = s$2;
     for(;;){
      if(0 !== s && a(buf, 93)) return s;
      var match = char(0);
      if(0 === match[0]){
       var c = match[1];
       if(a(buf, 45)){
        if(a(buf, 93)){
         var b = [0, caml_call1(Re_Core[26], 45), s];
         return [0, caml_call1(Re_Core[26], c), b];
        }
        var match$0 = char(0);
        if(0 === match$0[0]){
         var c$0 = match$0[1];
         s = [0, Re_Core[57].call(null, c, c$0), s];
        }
        else{
         var
          st = match$0[1],
          d = [0, caml_call1(Re_Core[26], 45), [0, st, s]];
         s = [0, caml_call1(Re_Core[26], c), d];
        }
       }
       else{var s$0 = [0, caml_call1(Re_Core[26], c), s]; s = s$0;}
      }
      else{var st$0 = match[1], s$1 = [0, st$0, s]; s = s$1;}
     }
    }
    function char(param){
     if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
     var c = get(0);
     if(91 === c){
      if(a(buf, 61)) throw caml_maybe_attach_backtrace(Not_supported, 1);
      var match = Re_Posix_class[3].call(null, buf);
      if(match){var set = match[1]; return [1, set];}
      if(! a(buf, 46)) return [0, c];
      if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      var c$0 = get(0);
      if(1 - a(buf, 46)) throw caml_maybe_attach_backtrace(Not_supported, 1);
      if(1 - a(buf, 93)) throw caml_maybe_attach_backtrace(Parse_error, 1);
      return [0, c$0];
     }
     if(92 !== c) return [0, c];
     if(eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
     var c$1 = get(0);
     if(58 <= c$1){
      if(123 > c$1)
       switch(c$1 - 58 | 0){
         case 10:
          return not_digit;
         case 25:
          return not_space;
         case 29:
          return not_word;
         case 40:
          return char_b;
         case 42:
          return digit;
         case 52:
          return char_newline;
         case 56:
          return char_cr;
         case 57:
          return space;
         case 58:
          return char_tab;
         case 61:
          return word;
         case 0:
         case 1:
         case 2:
         case 3:
         case 4:
         case 5:
         case 6:
         case 33:
         case 34:
         case 35:
         case 36:
         case 37:
         case 38: break;
         default: throw caml_maybe_attach_backtrace(Parse_error, 1);
       }
     }
     else if(48 <= c$1) throw caml_maybe_attach_backtrace(Not_supported, 1);
     return [0, c$1];
    }
    var res = regexp(0);
    if(1 - eos(0)) throw caml_maybe_attach_backtrace(Parse_error, 1);
    var
     r =
       Stdlib_List[38].call(null, 616470068, opts)
        ? caml_call1(Re_Core[28], [0, Re_Core[42], [0, res, 0]])
        : res,
     r$0 =
       Stdlib_List[38].call(null, 604571177, opts)
        ? caml_call1(Re_Core[78], r)
        : r;
    return r$0;
   }
   var compile = Re_Core[2];
   function compile_pat(opt, s){
    var opts = opt ? opt[1] : 0;
    return compile(re([0, opts], s));
   }
   var b = [1, 404463778], c = [1, 434889564];
   function re_result(opts, s){
    try{var s$0 = re(opts, s);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Not_supported) return b;
     if(exn === Parse_error) return c;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, s$0];
   }
   runtime.caml_register_global
    (13,
     [0, Parse_error, Not_supported, re, re_result, compile, compile_pat],
     "Re__Perl");
   return;
  }
  (globalThis));

//# 7058 "../.js/default/re/re.cma.js"
//# shape: Re__Pcre:[N,N,F(2),F(2),F(2),F(2),F(3),F(2),F(1),F(3),F(3),F(2),F(2),F(3),F(3),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Re_Core = global_data.Re__Core,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Re_Group = global_data.Re__Group,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Array = global_data.Stdlib__Array,
    Re_Perl = global_data.Re__Perl,
    Parse_error = Re_Perl[1],
    Not_supported = Re_Perl[2];
   function re(opt, pat){
    var
     flags = opt ? opt[1] : 0,
     opts =
       Stdlib_List[20].call
        (null,
         function(param){
          return 601676297 <= param
                  ? 613575188 <= param ? 616470068 : 604571177
                  : 426394317 <= param ? 1071952589 : -424303016;
         },
         flags);
    return Re_Perl[3].call(null, [0, opts], pat);
   }
   var a = [1, 404463778], b = [1, 434889564];
   function re_result(flags, s){
    try{var s$0 = re(flags, s);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Not_supported) return a;
     if(exn === Parse_error) return b;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    return [0, s$0];
   }
   function regexp(flags, pat){
    var a = re(flags, pat);
    return Re_Core[2].call(null, a);
   }
   function extract(rex, s){
    var a = Re_Core[5].call(null, 0, 0, rex, s);
    return caml_call1(Re_Core[1][9], a);
   }
   function exec(rex, pos, s){return Re_Core[5].call(null, pos, 0, rex, s);}
   function names(rex){
    var
     a = Re_Core[4].call(null, rex),
     b = Stdlib_List[20].call(null, function(a){return a[1];}, a);
    return Stdlib_Array[11].call(null, b);
   }
   function get_named_substring_opt(rex, name, s){
    var param = Re_Core[4].call(null, rex);
    for(;;){
     if(! param) return 0;
     var match = param[1], rem = param[2], i = match[2], n = match[1];
     if(n === name){
      var s$0 = caml_call2(Re_Core[1][2], s, i);
      if(s$0) return s$0;
      param = rem;
     }
     else{var rem$0 = param[2]; param = rem$0;}
    }
   }
   function get_substring_ofs(s, i){return caml_call2(Re_Core[1][3], s, i);}
   function pmatch(rex, s){return Re_Core[7].call(null, 0, 0, rex, s);}
   function substitute(rex, subst, str){
    var b = Stdlib_Buffer[1].call(null, 1024), pos = 0, on_match = 0;
    for(;;){
     a:
     if(Re_Core[7].call(null, [0, pos], 0, rex, str)){
      var
       ss = Re_Core[5].call(null, [0, pos], 0, rex, str),
       match = caml_call2(Re_Core[1][3], ss, 0),
       fin = match[2],
       start = match[1];
      if(on_match && start === pos && start === fin){
       if(pos >= caml_ml_string_length(str)) break a;
       var a = caml_string_get(str, pos);
       Stdlib_Buffer[12].call(null, b, a);
       var pos$0 = pos + 1 | 0;
       pos = pos$0;
       on_match = 0;
       continue;
      }
      var pat = caml_call2(Re_Core[1][1], ss, 0);
      Stdlib_Buffer[18].call(null, b, str, pos, start - pos | 0);
      var c = caml_call1(subst, pat);
      Stdlib_Buffer[16].call(null, b, c);
      if(start !== fin){pos = fin; on_match = 1; continue;}
      if(fin < caml_ml_string_length(str)){
       var d = caml_string_get(str, fin);
       Stdlib_Buffer[12].call(null, b, d);
       var pos$1 = fin + 1 | 0;
       pos = pos$1;
       on_match = 0;
       continue;
      }
     }
     else
      Stdlib_Buffer[18].call
       (null, b, str, pos, caml_ml_string_length(str) - pos | 0);
     return Stdlib_Buffer[2].call(null, b);
    }
   }
   var c = [0, 0];
   function split(rex, s){
    function split(accu$1, start$1){
     var accu = accu$1, start = start$1;
     for(;;){
      if(start === caml_ml_string_length(s)) return accu;
      try{
       var
        g = Re_Core[5].call(null, [0, start], 0, rex, s),
        g$0 =
          Re_Group[8].call(null, g, 0) === start
           ? Re_Core[5].call(null, [0, start + 1 | 0], 0, rex, s)
           : g;
      }
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn === Stdlib[8])
        return [0,
                Stdlib_String[16].call
                 (null, s, start, caml_ml_string_length(s) - start | 0),
                accu];
       throw caml_maybe_attach_backtrace(exn, 0);
      }
      var
       start$0 = Re_Group[8].call(null, g$0, 0),
       a = Re_Group[6].call(null, g$0, 0) - start | 0,
       accu$0 = [0, Stdlib_String[16].call(null, s, start, a), accu];
      accu = accu$0;
      start = start$0;
     }
    }
    try{var g = Re_Core[5].call(null, c, 0, rex, s);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[8]) return s === "" ? 0 : [0, s, 0];
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    if(0 === Re_Group[6].call(null, g, 0))
     var a = split(0, Re_Group[8].call(null, g, 0));
    else
     var
      b = Re_Group[8].call(null, g, 0),
      d = Re_Group[6].call(null, g, 0),
      a = split([0, Stdlib_String[16].call(null, s, 0, d), 0], b);
    return Stdlib_List[10].call(null, a);
   }
   function quote(s){
    var
     len = caml_ml_string_length(s),
     buf = caml_create_bytes(len << 1),
     d = len - 1 | 0,
     b = 0;
    if(d < 0)
     var pos$4 = b;
    else{
     var pos = b, i = 0;
     for(;;){
      var c = runtime.caml_string_unsafe_get(s, i);
      a:
      {
       b:
       {
        if(91 <= c){
         var a = c - 93 | 0;
         if(29 < a >>> 0){if(32 <= a) break b;} else if(1 !== a) break b;
        }
        else
         if(47 <= c){
          if(63 !== c) break b;
         }
         else{
          if(36 > c) break b;
          switch(c - 36 | 0){case 1:case 2:case 3:case 8:case 9: break b;
          }
         }
        caml_bytes_unsafe_set(buf, pos, 92);
        var pos$1 = pos + 1 | 0;
        caml_bytes_unsafe_set(buf, pos$1, c);
        var pos$2 = pos$1 + 1 | 0, pos$3 = pos$2;
        break a;
       }
       caml_bytes_unsafe_set(buf, pos, c);
       var pos$0 = pos + 1 | 0, pos$3 = pos$0;
      }
      var e = i + 1 | 0;
      if(d === i){var pos$4 = pos$3; break;}
      pos = pos$3;
      i = e;
     }
    }
    var r = caml_create_bytes(pos$4);
    runtime.caml_blit_bytes(buf, 0, r, 0, pos$4);
    return Stdlib_Bytes[44].call(null, r);
   }
   var d = [0, -1, -1];
   function full_split(opt, rex, s){
    var max = opt ? opt[1] : 0;
    if(0 === caml_ml_string_length(s)) return 0;
    if(1 === max) return [0, [0, s], 0];
    var
     results = Re_Core[21].call(null, 0, 0, rex, s),
     matches =
       Stdlib_List[20].call
        (null,
         function(param){
          var variant = param[1];
          if(936573133 <= variant){var s = param[2]; return [0, [0, s], 0];}
          var
           d$0 = param[2],
           matches = caml_call1(Re_Core[1][10], d$0),
           delim = caml_call2(Re_Core[1][1], d$0, 0),
           b = matches.length - 2 | 0,
           a = 0;
          if(b < 1)
           var l$0 = a;
          else{
           var l = a, i = 1;
           for(;;){
            var
             e =
               runtime.caml_equal
                 (runtime.caml_check_bound(matches, i)[i + 1], d)
                ? 0
                : [2, i, caml_call2(Re_Core[1][1], d$0, i)],
             c = [0, e, l],
             f = i + 1 | 0;
            if(b === i){var l$0 = c; break;}
            l = c;
            i = f;
           }
          }
          return [0, [1, delim], Stdlib_List[10].call(null, l$0)];
         },
         results);
    return Stdlib_List[14].call(null, matches);
   }
   function get_substring(s, i){return caml_call2(Re_Core[1][1], s, i);}
   function get_named_substring(rex, name, s){
    var match = get_named_substring_opt(rex, name, s);
    if(! match) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
    var s$0 = match[1];
    return s$0;
   }
   runtime.caml_register_global
    (14,
     [0,
      Parse_error,
      Not_supported,
      re,
      re_result,
      regexp,
      extract,
      exec,
      get_substring,
      names,
      get_named_substring,
      get_named_substring_opt,
      get_substring_ofs,
      pmatch,
      substitute,
      full_split,
      split,
      quote],
     "Re__Pcre");
   return;
  }
  (globalThis));

//# 7587 "../.js/default/re/re.cma.js"
//# shape: Re:[N,F(1),F(1)*,F(1)*,F(4),F(4),F(4),F(4),F(4),N,F(4),F(4),F(4)->F(1),F(4),F(4),F(4)->F(1),F(4),F(4),F(4),F(4)->F(1),F(4),F(4),F(4)->F(1),N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(2),N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(2),F(2),N,F(2),F(2),F(1),F(1),F(2),F(2),F(1)*,N,F(6),F(6)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    global_data = runtime.caml_get_global_data(),
    Re_Core = global_data.Re__Core,
    Re_Replace = global_data.Re__Replace,
    Group = Re_Core[1],
    compile = Re_Core[2],
    group_count = Re_Core[3],
    group_names = Re_Core[4],
    exec = Re_Core[5],
    exec_opt = Re_Core[6],
    execp = Re_Core[7],
    exec_partial = Re_Core[8],
    exec_partial_detailed = Re_Core[9],
    Mark = Re_Core[10],
    all = Re_Core[11],
    all_gen = Re_Core[12],
    all_seq = Re_Core[13],
    matches = Re_Core[14],
    matches_gen = Re_Core[15],
    matches_seq = Re_Core[16],
    split = Re_Core[17],
    split_delim = Re_Core[18],
    split_gen = Re_Core[19],
    split_seq = Re_Core[20],
    split_full = Re_Core[21],
    split_full_gen = Re_Core[22],
    split_full_seq = Re_Core[23],
    Seq = Re_Core[24],
    str = Re_Core[25],
    char = Re_Core[26],
    alt = Re_Core[27],
    seq = Re_Core[28],
    empty = Re_Core[29],
    epsilon = Re_Core[30],
    rep = Re_Core[31],
    rep1 = Re_Core[32],
    repn = Re_Core[33],
    opt = Re_Core[34],
    bol = Re_Core[35],
    eol = Re_Core[36],
    bow = Re_Core[37],
    eow = Re_Core[38],
    bos = Re_Core[39],
    eos = Re_Core[40],
    leol = Re_Core[41],
    start = Re_Core[42],
    stop = Re_Core[43],
    word = Re_Core[44],
    not_boundary = Re_Core[45],
    whole_string = Re_Core[46],
    longest = Re_Core[47],
    shortest = Re_Core[48],
    first = Re_Core[49],
    greedy = Re_Core[50],
    non_greedy = Re_Core[51],
    group = Re_Core[52],
    no_group = Re_Core[53],
    nest = Re_Core[54],
    mark = Re_Core[55],
    set = Re_Core[56],
    rg = Re_Core[57],
    inter = Re_Core[58],
    diff = Re_Core[59],
    compl = Re_Core[60],
    any = Re_Core[61],
    notnl = Re_Core[62],
    alnum = Re_Core[63],
    wordc = Re_Core[64],
    alpha = Re_Core[65],
    ascii = Re_Core[66],
    blank = Re_Core[67],
    cntrl = Re_Core[68],
    digit = Re_Core[69],
    graph = Re_Core[70],
    lower = Re_Core[71],
    print = Re_Core[72],
    punct = Re_Core[73],
    space = Re_Core[74],
    upper = Re_Core[75],
    xdigit = Re_Core[76],
    case$ = Re_Core[77],
    no_case = Re_Core[78],
    pp = Re_Core[79],
    pp_re = Re_Core[80],
    print_re = Re_Core[81],
    witness = Re_Core[82],
    get = Re_Core[83],
    get_ofs = Re_Core[84],
    get_all = Re_Core[85],
    get_all_ofs = Re_Core[86],
    test = Re_Core[87],
    marked = Re_Core[88],
    mark_set = Re_Core[89],
    Stream = Re_Core[90],
    replace = Re_Replace[1],
    replace_string = Re_Replace[2];
   runtime.caml_register_global
    (2,
     [0,
      Group,
      compile,
      group_count,
      group_names,
      exec,
      exec_opt,
      execp,
      exec_partial,
      exec_partial_detailed,
      Mark,
      all,
      all_gen,
      all_seq,
      matches,
      matches_gen,
      matches_seq,
      split,
      split_delim,
      split_gen,
      split_seq,
      split_full,
      split_full_gen,
      split_full_seq,
      Seq,
      str,
      char,
      alt,
      seq,
      empty,
      epsilon,
      rep,
      rep1,
      repn,
      opt,
      bol,
      eol,
      bow,
      eow,
      bos,
      eos,
      leol,
      start,
      stop,
      word,
      not_boundary,
      whole_string,
      longest,
      shortest,
      first,
      greedy,
      non_greedy,
      group,
      no_group,
      nest,
      mark,
      set,
      rg,
      inter,
      diff,
      compl,
      any,
      notnl,
      alnum,
      wordc,
      alpha,
      ascii,
      blank,
      cntrl,
      digit,
      graph,
      lower,
      print,
      punct,
      space,
      upper,
      xdigit,
      case$,
      no_case,
      pp,
      pp_re,
      print_re,
      witness,
      get,
      get_ofs,
      get_all,
      get_all_ofs,
      test,
      marked,
      mark_set,
      Stream,
      replace,
      replace_string],
     "Re");
   return;
  }
  (globalThis));

//# 6 "../.js/default/unix/unix.cma.js"
//# shape: Unix:[N,F(1),F(2),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(2),F(3),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),N,N,N,F(3),F(1),F(1),F(4),F(4),F(4),F(4),F(4),F(4),F(4),F(4),F(1),F(1),F(1),F(1),F(3),F(2),F(2),F(1),F(1),F(1),F(1),N,F(6),F(1),F(2),F(3),F(1),F(2),F(2),F(3),F(3),F(1),F(2),F(2),F(3),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(5),F(6),F(1),F(1),F(1),F(1),F(2),F(2),F(2),F(3),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(1),F(4),F(3),F(2),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(1)*,F(1),N,N,N,N,F(1)*,F(4),F(1)*,F(4),F(2),F(2),F(2),F(2),F(2),F(1),F(1),F(5),F(5),F(5),F(5),F(6),F(6),F(2),F(3),F(2),F(3),F(2),F(3),F(2),F(3),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(2),F(1),F(3),F(2),F(1),F(2),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_ba_dim_1 = runtime.caml_ba_dim_1,
    caml_channel_descriptor = runtime.caml_channel_descriptor,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_sys_exit = runtime.caml_sys_exit,
    caml_unix_close = runtime.caml_unix_close,
    caml_unix_getpwnam = runtime.caml_unix_getpwnam,
    caml_unix_inchannel_of_filedes = runtime.caml_unix_inchannel_of_filedescr,
    caml_unix_inet_addr_of_string = runtime.caml_unix_inet_addr_of_string,
    caml_unix_outchannel_of_filede = runtime.caml_unix_outchannel_of_filedescr,
    caml_unix_write_bigarray = runtime.caml_unix_write_bigarray,
    caml_wrap_exception = runtime.caml_wrap_exception,
    unix_error_message = runtime.unix_error_message;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib_Mutex = global_data.Stdlib__Mutex,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_Fun = global_data.Stdlib__Fun,
    Stdlib_Int = global_data.Stdlib__Int;
   global_data.Stdlib__Array;
   var
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_Callback = global_data.Stdlib__Callback,
    Stdlib_Printexc = global_data.Stdlib__Printexc,
    cst_Unix_Unix_error = "Unix.Unix_error",
    Unix_error = [248, cst_Unix_Unix_error, runtime.caml_fresh_oo_id(0)],
    cst = "";
   Stdlib_Callback[2].call
    (null, cst_Unix_Unix_error, [0, Unix_error, 0, cst, cst]);
   var
    cst$0 = ", ",
    a =
      [0,
       [11,
        "Unix.Unix_error(Unix.",
        [2, 0, [11, cst$0, [3, 0, [11, cst$0, [3, 0, [12, 41, 0]]]]]]],
       "Unix.Unix_error(Unix.%s, %S, %S)"],
    b = [0, [11, "EUNKNOWNERR ", [4, 0, 0, 0, 0]], "EUNKNOWNERR %d"];
   Stdlib_Printexc[9].call
    (null,
     function(param){
      if(param[1] !== Unix_error) return 0;
      var s = param[4], s$0 = param[3], e = param[2];
      if(typeof e === "number"){
       var c = e;
       if(34 <= c)
        switch(c){
          case 34:
           var msg = "ESPIPE"; break;
          case 35:
           var msg = "ESRCH"; break;
          case 36:
           var msg = "EXDEV"; break;
          case 37:
           var msg = "EWOULDBLOCK"; break;
          case 38:
           var msg = "EINPROGRESS"; break;
          case 39:
           var msg = "EALREADY"; break;
          case 40:
           var msg = "ENOTSOCK"; break;
          case 41:
           var msg = "EDESTADDRREQ"; break;
          case 42:
           var msg = "EMSGSIZE"; break;
          case 43:
           var msg = "EPROTOTYPE"; break;
          case 44:
           var msg = "ENOPROTOOPT"; break;
          case 45:
           var msg = "EPROTONOSUPPORT"; break;
          case 46:
           var msg = "ESOCKTNOSUPPORT"; break;
          case 47:
           var msg = "EOPNOTSUPP"; break;
          case 48:
           var msg = "EPFNOSUPPORT"; break;
          case 49:
           var msg = "EAFNOSUPPORT"; break;
          case 50:
           var msg = "EADDRINUSE"; break;
          case 51:
           var msg = "EADDRNOTAVAIL"; break;
          case 52:
           var msg = "ENETDOWN"; break;
          case 53:
           var msg = "ENETUNREACH"; break;
          case 54:
           var msg = "ENETRESET"; break;
          case 55:
           var msg = "ECONNABORTED"; break;
          case 56:
           var msg = "ECONNRESET"; break;
          case 57:
           var msg = "ENOBUFS"; break;
          case 58:
           var msg = "EISCONN"; break;
          case 59:
           var msg = "ENOTCONN"; break;
          case 60:
           var msg = "ESHUTDOWN"; break;
          case 61:
           var msg = "ETOOMANYREFS"; break;
          case 62:
           var msg = "ETIMEDOUT"; break;
          case 63:
           var msg = "ECONNREFUSED"; break;
          case 64:
           var msg = "EHOSTDOWN"; break;
          case 65:
           var msg = "EHOSTUNREACH"; break;
          case 66:
           var msg = "ELOOP"; break;
          default: var msg = "EOVERFLOW";
        }
       else
        switch(c){
          case 0:
           var msg = "E2BIG"; break;
          case 1:
           var msg = "EACCES"; break;
          case 2:
           var msg = "EAGAIN"; break;
          case 3:
           var msg = "EBADF"; break;
          case 4:
           var msg = "EBUSY"; break;
          case 5:
           var msg = "ECHILD"; break;
          case 6:
           var msg = "EDEADLK"; break;
          case 7:
           var msg = "EDOM"; break;
          case 8:
           var msg = "EEXIST"; break;
          case 9:
           var msg = "EFAULT"; break;
          case 10:
           var msg = "EFBIG"; break;
          case 11:
           var msg = "EINTR"; break;
          case 12:
           var msg = "EINVAL"; break;
          case 13:
           var msg = "EIO"; break;
          case 14:
           var msg = "EISDIR"; break;
          case 15:
           var msg = "EMFILE"; break;
          case 16:
           var msg = "EMLINK"; break;
          case 17:
           var msg = "ENAMETOOLONG"; break;
          case 18:
           var msg = "ENFILE"; break;
          case 19:
           var msg = "ENODEV"; break;
          case 20:
           var msg = "ENOENT"; break;
          case 21:
           var msg = "ENOEXEC"; break;
          case 22:
           var msg = "ENOLCK"; break;
          case 23:
           var msg = "ENOMEM"; break;
          case 24:
           var msg = "ENOSPC"; break;
          case 25:
           var msg = "ENOSYS"; break;
          case 26:
           var msg = "ENOTDIR"; break;
          case 27:
           var msg = "ENOTEMPTY"; break;
          case 28:
           var msg = "ENOTTY"; break;
          case 29:
           var msg = "ENXIO"; break;
          case 30:
           var msg = "EPERM"; break;
          case 31:
           var msg = "EPIPE"; break;
          case 32:
           var msg = "ERANGE"; break;
          default: var msg = "EROFS";
        }
      }
      else
       var x = e[1], msg = caml_call1(Stdlib_Printf[4].call(null, b), x);
      return [0, caml_call3(Stdlib_Printf[4].call(null, a), msg, s$0, s)];
     });
   function handle_unix_error(f, arg){
    try{var c = caml_call1(f, arg); return c;}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Unix_error) throw caml_maybe_attach_backtrace(exn, 0);
     var
      arg$0 = exn[4],
      fun_name = exn[3],
      err = exn[2],
      a = runtime.caml_check_bound(runtime.caml_sys_argv(0), 0)[1];
     Stdlib[49].call(null, a);
     Stdlib[49].call(null, ': "');
     Stdlib[49].call(null, fun_name);
     Stdlib[49].call(null, '" failed');
     if(0 < caml_ml_string_length(arg$0)){
      Stdlib[49].call(null, ' on "');
      Stdlib[49].call(null, arg$0);
      Stdlib[49].call(null, '"');
     }
     Stdlib[49].call(null, ": ");
     var b = unix_error_message(err);
     Stdlib[53].call(null, b);
     return Stdlib[99].call(null, 2);
    }
   }
   var c = caml_int64_create_lo_mi_hi(0, 0, 0);
   function read(fd, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_read(fd, buf, ofs, len);
    return Stdlib[1].call(null, "Unix.read");
   }
   function read_bigarray(fd, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ba_dim_1(buf) - len | 0) >= ofs)
     return runtime.caml_unix_read_bigarray(fd, buf, ofs, len);
    return Stdlib[1].call(null, "Unix.read_bigarray");
   }
   function write(fd, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_write(fd, buf, ofs, len);
    return Stdlib[1].call(null, "Unix.write");
   }
   function write_bigarray(fd, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ba_dim_1(buf) - len | 0) >= ofs)
     return caml_unix_write_bigarray(fd, buf, ofs, len, 0);
    return Stdlib[1].call(null, "Unix.write_bigarray");
   }
   function single_write(fd, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_single_write(fd, buf, ofs, len);
    return Stdlib[1].call(null, "Unix.single_write");
   }
   function single_write_bigarray(fd, buf, ofs, len){
    if(0 <= ofs && 0 <= len && (caml_ba_dim_1(buf) - len | 0) >= ofs)
     return caml_unix_write_bigarray(fd, buf, ofs, len, 1);
    return Stdlib[1].call(null, "Unix.single_write_bigarray");
   }
   function write_substring(fd, buf, ofs, len){
    return write(fd, Stdlib_Bytes[45].call(null, buf), ofs, len);
   }
   function single_write_substring(fd, buf, ofs, len){
    return single_write(fd, Stdlib_Bytes[45].call(null, buf), ofs, len);
   }
   function map_file(fd, opt, kind, layout, shared, dims){
    var pos = opt ? opt[1] : c;
    return runtime.caml_unix_map_file_bytecode
            (fd, kind, layout, shared, dims, pos);
   }
   function pause(param){
    var sigs = runtime.caml_unix_sigprocmask(1, 0);
    return runtime.caml_unix_sigsuspend(sigs);
   }
   function sleep(duration){return runtime.caml_unix_sleep(duration);}
   function is_inet6_addr(s){return 16 === caml_ml_string_length(s) ? 1 : 0;}
   var
    cst_0_0_0_0 = "0.0.0.0",
    inet_addr_any = caml_unix_inet_addr_of_string(cst_0_0_0_0),
    cst_127_0_0_1 = "127.0.0.1",
    inet_addr_loopback = caml_unix_inet_addr_of_string(cst_127_0_0_1),
    inet6_addr_any = caml_unix_inet_addr_of_string("::"),
    inet6_addr_loopback = caml_unix_inet_addr_of_string("::1");
   function domain_of_sockaddr(param){
    if(0 === param[0]) return 0;
    var a = param[1];
    return is_inet6_addr(a) ? 2 : 1;
   }
   function recv(fd, buf, ofs, len, flags){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_recv(fd, buf, ofs, len, flags);
    return Stdlib[1].call(null, "Unix.recv");
   }
   function recvfrom(fd, buf, ofs, len, flags){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_recvfrom(fd, buf, ofs, len, flags);
    return Stdlib[1].call(null, "Unix.recvfrom");
   }
   function send(fd, buf, ofs, len, flags){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_send(fd, buf, ofs, len, flags);
    return Stdlib[1].call(null, "Unix.send");
   }
   function sendto(fd, buf, ofs, len, flags, addr){
    if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(buf) - len | 0) >= ofs)
     return runtime.caml_unix_sendto(fd, buf, ofs, len, flags, addr);
    return Stdlib[1].call(null, "Unix.sendto");
   }
   function send_substring(fd, buf, ofs, len, flags){
    return send(fd, Stdlib_Bytes[45].call(null, buf), ofs, len, flags);
   }
   function sendto_substring(fd, buf, ofs, len, flags, addr){
    return sendto(fd, Stdlib_Bytes[45].call(null, buf), ofs, len, flags, addr);
   }
   function getsockopt(fd, opt){
    return runtime.caml_unix_getsockopt(0, fd, opt);
   }
   function setsockopt(fd, opt, v){
    return runtime.caml_unix_setsockopt(0, fd, opt, v);
   }
   function getsockopt_int(fd, opt){
    return runtime.caml_unix_getsockopt(1, fd, opt);
   }
   function setsockopt_int(fd, opt, v){
    return runtime.caml_unix_setsockopt(1, fd, opt, v);
   }
   function getsockopt_optint(fd, opt){
    return runtime.caml_unix_getsockopt(2, fd, opt);
   }
   function setsockopt_optint(fd, opt, v){
    return runtime.caml_unix_setsockopt(2, fd, opt, v);
   }
   function getsockopt_float(fd, opt){
    return runtime.caml_unix_getsockopt(3, fd, opt);
   }
   function setsockopt_float(fd, opt, v){
    return runtime.caml_unix_setsockopt(3, fd, opt, v);
   }
   function getsockopt_error(fd){
    return runtime.caml_unix_getsockopt(4, fd, 0);
   }
   var cst_tcp = "tcp", cst_udp = "udp";
   function getaddrinfo(node, service, opts){
    try{
     var
      d = runtime.caml_unix_getaddrinfo(node, service, opts),
      e = Stdlib_List[10].call(null, d);
     return e;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Stdlib[6]) throw caml_maybe_attach_backtrace(exn, 0);
     var opt_socktype = [0, 0], opt_protocol = [0, 0];
     Stdlib_List[18].call
      (null,
       function(param){
        if(typeof param === "number"){if(2 === param) return 0;}
        else
         switch(param[0]){
           case 1:
            var s = param[1]; opt_socktype[1] = [0, s]; return 0;
           case 2:
            var p = param[1]; opt_protocol[1] = p; return 0;
         }
        return 0;
       },
       opts);
     var
      get_port =
        function(ty, kind){
         if(service === cst) return [0, [0, ty, 0], 0];
         try{
          var b = [0, [0, ty, runtime.caml_int_of_string(service)], 0];
          return b;
         }
         catch(exn$1){
          var exn = caml_wrap_exception(exn$1);
          if(exn[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(exn, 0);
          try{
           var
            a =
              [0,
               [0, ty, runtime.caml_unix_getservbyname(service, kind)[3]],
               0];
           return a;
          }
          catch(exn){
           var exn$0 = caml_wrap_exception(exn);
           if(exn$0 === Stdlib[8]) return 0;
           throw caml_maybe_attach_backtrace(exn$0, 0);
          }
         }
        },
      match = opt_socktype[1];
     if(match)
      var
       ty = match[1],
       ports =
         1 === ty
          ? get_port(1, cst_udp)
          : ty
            ? service === cst ? [0, [0, ty, 0], 0] : 0
            : get_port(0, cst_tcp);
     else
      var
       b = get_port(1, cst_udp),
       c = get_port(0, cst_tcp),
       ports = Stdlib[37].call(null, c, b);
     var
      addresses =
        node === cst
         ? Stdlib_List
             [37].call
            (null, 2, opts)
           ? [0, [0, inet_addr_any, cst_0_0_0_0], 0]
           : [0, [0, inet_addr_loopback, cst_127_0_0_1], 0]
         : [0, [0, caml_unix_inet_addr_of_string(node), node], 0],
      a =
        Stdlib_List[20].call
         (null,
          function(param){
           var port = param[2], ty = param[1];
           return Stdlib_List[20].call
                   (null,
                    function(param){
                     var name = param[2], addr = param[1];
                     return [0, 1, ty, opt_protocol[1], [1, addr, port], name];
                    },
                    addresses);
          },
          ports);
     return Stdlib_List[15].call(null, a);
    }
   }
   function getnameinfo(addr, opts){
    try{var d = runtime.caml_unix_getnameinfo(addr, opts); return d;}
    catch(exn$2){
     var exn$1 = caml_wrap_exception(exn$2);
     if(exn$1[1] !== Stdlib[6]) throw caml_maybe_attach_backtrace(exn$1, 0);
     if(0 === addr[0]){var f = addr[1]; return [0, cst, f];}
     var p = addr[2], a = addr[1];
     try{
      if(Stdlib_List[37].call(null, 1, opts))
       throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      var c = runtime.caml_unix_gethostbyaddr(a)[1], hostname = c;
     }
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
      if(Stdlib_List[37].call(null, 2, opts))
       throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      var hostname = runtime.caml_unix_string_of_inet_addr(a);
     }
     try{
      if(Stdlib_List[37].call(null, 3, opts))
       throw caml_maybe_attach_backtrace(Stdlib[8], 1);
      var
       kind = Stdlib_List[37].call(null, 4, opts) ? cst_udp : cst_tcp,
       b = runtime.caml_unix_getservbyport(p, kind)[1],
       service = b;
     }
     catch(exn){
      var exn$0 = caml_wrap_exception(exn);
      if(exn$0 !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn$0, 0);
      var service = Stdlib_Int[12].call(null, p);
     }
     return [0, hostname, service];
    }
   }
   function waitpid_non_intr(pid){
    for(;;)
     try{var a = runtime.caml_unix_waitpid(0, pid); return a;}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn[1] === Unix_error){
       var match = exn[2];
       if(typeof match === "number" && 11 === match) continue;
      }
      throw caml_maybe_attach_backtrace(exn, 0);
     }
   }
   var d = [0, 1];
   function create_process_gen
   (cmd, args, optenv, new_stdin, new_stdout, new_stderr){
    var toclose = [0, 0];
    function close_after(param){
     return Stdlib_List[18].call
             (null,
              function(fd){
               try{var a = caml_unix_close(fd); return a;}
               catch(exn$0){
                var exn = caml_wrap_exception(exn$0);
                if(exn[1] === Unix_error) return 0;
                throw caml_maybe_attach_backtrace(exn, 0);
               }
              },
              toclose[1]);
    }
    function file_descr_not_standard(fd$1){
     var fd = fd$1;
     for(;;){
      if(3 <= fd) return fd;
      var fd$0 = runtime.caml_unix_dup(d, fd);
      toclose[1] = [0, fd$0, toclose[1]];
      fd = fd$0;
     }
    }
    var
     a = 2 === new_stderr ? 2 : file_descr_not_standard(new_stderr),
     b = 1 === new_stdout ? 1 : file_descr_not_standard(new_stdout),
     c = 0 === new_stdin ? 0 : file_descr_not_standard(new_stdin),
     redirections = [0, c, b, a];
    return Stdlib_Fun[5].call
            (null,
             close_after,
             function(param){
              return runtime.caml_unix_spawn
                      (cmd, args, optenv, 1, redirections);
             });
   }
   function create_process(cmd, args, new_stdin, new_stdout, new_stderr){
    return create_process_gen(cmd, args, 0, new_stdin, new_stdout, new_stderr);
   }
   function create_process_env
   (cmd, args, env, new_stdin, new_stdout, new_stderr){
    return create_process_gen
            (cmd, args, [0, env], new_stdin, new_stdout, new_stderr);
   }
   var cst_c = "-c", cst_bin_sh = "/bin/sh", shell = cst_bin_sh;
   function system(cmd){
    var
     pid =
       runtime.caml_unix_spawn
        (cst_bin_sh, [0, shell, cst_c, cmd], 0, 0, [0, 0, 1, 2]);
    return waitpid_non_intr(pid)[2];
   }
   var
    popen_processes = Stdlib_Hashtbl[1].call(null, 0, 7),
    popen_mutex = Stdlib_Mutex[1].call(null, 0);
   function open_proc(prog, args, envopt, proc, input, output, error){
    var pid = create_process_gen(prog, args, envopt, input, output, error);
    return Stdlib_Mutex[5].call
            (null,
             popen_mutex,
             function(param){
              return Stdlib_Hashtbl[5].call(null, popen_processes, proc, pid);
             });
   }
   var stdin = 0, stderr = 2, e = [0, 1];
   function open_process_args_in(prog, args){
    var
     match = runtime.caml_unix_pipe(e, 0),
     in_write = match[2],
     in_read = match[1],
     inchan = caml_unix_inchannel_of_filedes(in_read);
    try{open_proc(prog, args, 0, [1, inchan], stdin, in_write, stderr);}
    catch(e){
     var e$0 = caml_wrap_exception(e);
     Stdlib[93].call(null, inchan);
     caml_unix_close(in_write);
     throw caml_maybe_attach_backtrace(e$0, 0);
    }
    caml_unix_close(in_write);
    return inchan;
   }
   var stdout = 1, f = [0, 1];
   function open_process_args_out(prog, args){
    var
     match = runtime.caml_unix_pipe(f, 0),
     out_write = match[2],
     out_read = match[1],
     outchan = caml_unix_outchannel_of_filede(out_write);
    try{open_proc(prog, args, 0, [2, outchan], out_read, stdout, stderr);}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     Stdlib[76].call(null, outchan);
     caml_unix_close(out_read);
     throw caml_maybe_attach_backtrace(e, 0);
    }
    caml_unix_close(out_read);
    return outchan;
   }
   var g = [0, 1], h = [0, 1];
   function open_process_args(prog, args){
    var
     match = runtime.caml_unix_pipe(g, 0),
     in_write = match[2],
     in_read = match[1];
    try{var match$0 = runtime.caml_unix_pipe(h, 0);}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     caml_unix_close(in_read);
     caml_unix_close(in_write);
     throw caml_maybe_attach_backtrace(e, 0);
    }
    var
     out_write = match$0[2],
     out_read = match$0[1],
     inchan = caml_unix_inchannel_of_filedes(in_read),
     outchan = caml_unix_outchannel_of_filede(out_write);
    try{
     open_proc
      (prog, args, 0, [0, inchan, outchan], out_read, in_write, stderr);
    }
    catch(e){
     var e$0 = caml_wrap_exception(e);
     caml_unix_close(out_read);
     caml_unix_close(out_write);
     caml_unix_close(in_read);
     caml_unix_close(in_write);
     throw caml_maybe_attach_backtrace(e$0, 0);
    }
    caml_unix_close(out_read);
    caml_unix_close(in_write);
    return [0, inchan, outchan];
   }
   var i = [0, 1], j = [0, 1], k = [0, 1];
   function open_process_args_full(prog, args, env){
    var
     match = runtime.caml_unix_pipe(i, 0),
     in_write = match[2],
     in_read = match[1];
    try{var match$0 = runtime.caml_unix_pipe(j, 0);}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     caml_unix_close(in_read);
     caml_unix_close(in_write);
     throw caml_maybe_attach_backtrace(e, 0);
    }
    var out_write = match$0[2], out_read = match$0[1];
    try{var match$1 = runtime.caml_unix_pipe(k, 0);}
    catch(e){
     var e$0 = caml_wrap_exception(e);
     caml_unix_close(in_read);
     caml_unix_close(in_write);
     caml_unix_close(out_read);
     caml_unix_close(out_write);
     throw caml_maybe_attach_backtrace(e$0, 0);
    }
    var
     err_write = match$1[2],
     err_read = match$1[1],
     inchan = caml_unix_inchannel_of_filedes(in_read),
     outchan = caml_unix_outchannel_of_filede(out_write),
     errchan = caml_unix_inchannel_of_filedes(err_read);
    try{
     open_proc
      (prog,
       args,
       [0, env],
       [3, inchan, outchan, errchan],
       out_read,
       in_write,
       err_write);
    }
    catch(e){
     var e$1 = caml_wrap_exception(e);
     caml_unix_close(out_read);
     caml_unix_close(out_write);
     caml_unix_close(in_read);
     caml_unix_close(in_write);
     caml_unix_close(err_read);
     caml_unix_close(err_write);
     throw caml_maybe_attach_backtrace(e$1, 0);
    }
    caml_unix_close(out_read);
    caml_unix_close(in_write);
    caml_unix_close(err_write);
    return [0, inchan, outchan, errchan];
   }
   function open_process_shell(fn, cmd){
    return caml_call2(fn, shell, [0, shell, cst_c, cmd]);
   }
   function open_process_in(cmd){
    return open_process_shell(open_process_args_in, cmd);
   }
   function open_process_out(cmd){
    return open_process_shell(open_process_args_out, cmd);
   }
   function open_process(cmd){
    return open_process_shell(open_process_args, cmd);
   }
   function open_process_full(cmd){
    return open_process_shell(open_process_args_full, cmd);
   }
   function find_proc_id(fun_name, proc){
    try{
     var
      a =
        Stdlib_Mutex[5].call
         (null,
          popen_mutex,
          function(param){
           return Stdlib_Hashtbl[6].call(null, popen_processes, proc);
          });
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[8])
      throw caml_maybe_attach_backtrace([0, Unix_error, 3, fun_name, cst], 1);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function remove_proc_id(proc){
    return Stdlib_Mutex[5].call
            (null,
             popen_mutex,
             function(param){
              return Stdlib_Hashtbl[10].call(null, popen_processes, proc);
             });
   }
   function process_in_pid(inchan){
    return find_proc_id("process_in_pid", [1, inchan]);
   }
   function process_out_pid(outchan){
    return find_proc_id("process_out_pid", [2, outchan]);
   }
   function process_pid(param){
    var outchan = param[2], inchan = param[1];
    return find_proc_id("process_pid", [0, inchan, outchan]);
   }
   function process_full_pid(param){
    var errchan = param[3], outchan = param[2], inchan = param[1];
    return find_proc_id("process_full_pid", [3, inchan, outchan, errchan]);
   }
   function close_process_in(inchan){
    var proc = [1, inchan], pid = find_proc_id("close_process_in", proc);
    remove_proc_id(proc);
    Stdlib[93].call(null, inchan);
    return waitpid_non_intr(pid)[2];
   }
   function close_process_out(outchan){
    var proc = [2, outchan], pid = find_proc_id("close_process_out", proc);
    remove_proc_id(proc);
    try{Stdlib[76].call(null, outchan);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
    }
    return waitpid_non_intr(pid)[2];
   }
   function close_process(param){
    var
     outchan = param[2],
     inchan = param[1],
     proc = [0, inchan, outchan],
     pid = find_proc_id("close_process", proc);
    remove_proc_id(proc);
    Stdlib[93].call(null, inchan);
    try{Stdlib[76].call(null, outchan);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
    }
    return waitpid_non_intr(pid)[2];
   }
   function close_process_full(param){
    var
     errchan = param[3],
     outchan = param[2],
     inchan = param[1],
     proc = [3, inchan, outchan, errchan],
     pid = find_proc_id("close_process_full", proc);
    remove_proc_id(proc);
    Stdlib[93].call(null, inchan);
    try{Stdlib[76].call(null, outchan);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
    }
    Stdlib[93].call(null, errchan);
    return waitpid_non_intr(pid)[2];
   }
   var l = [0, 1];
   function open_connection(sockaddr){
    var
     sock = runtime.caml_unix_socket(l, domain_of_sockaddr(sockaddr), 0, 0);
    try{
     runtime.caml_unix_connect(sock, sockaddr);
     var
      a = caml_unix_outchannel_of_filede(sock),
      b = [0, caml_unix_inchannel_of_filedes(sock), a];
     return b;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     caml_unix_close(sock);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function shutdown_connection(inchan){
    return runtime.caml_unix_shutdown(caml_channel_descriptor(inchan), 1);
   }
   var m = [0, 1], n = [0, 1];
   function establish_server(server_fun, sockaddr){
    var
     sock = runtime.caml_unix_socket(n, domain_of_sockaddr(sockaddr), 0, 0);
    runtime.caml_unix_setsockopt(0, sock, 2, 1);
    runtime.caml_unix_bind(sock, sockaddr);
    runtime.caml_unix_listen(sock, 5);
    for(;;){
     try{var match$0 = runtime.caml_unix_accept(m, sock);}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn[1] === Unix_error){
       var match = exn[2];
       if(typeof match === "number" && 11 === match) continue;
      }
      throw caml_maybe_attach_backtrace(exn, 0);
     }
     var s = match$0[1], id = runtime.caml_unix_fork(0);
     if(0 === id){
      if(0 !== runtime.caml_unix_fork(0)) caml_sys_exit(0);
      caml_unix_close(sock);
      var
       inchan = caml_unix_inchannel_of_filedes(s),
       outchan = caml_unix_outchannel_of_filede(s);
      caml_call2(server_fun, inchan, outchan);
      Stdlib[99].call(null, 0);
     }
     else{caml_unix_close(s); waitpid_non_intr(id);}
    }
   }
   var
    Unix =
      [0,
       Unix_error,
       unix_error_message,
       handle_unix_error,
       function(a){return runtime.caml_unix_environment(a);},
       function(a){return runtime.caml_unix_environment_unsafe(a);},
       runtime.caml_sys_getenv,
       runtime.caml_sys_unsafe_getenv,
       function(b, a){return runtime.caml_unix_putenv(b, a);},
       function(b, a){return runtime.caml_unix_execv(b, a);},
       function(c, b, a){return runtime.caml_unix_execve(c, b, a);},
       function(b, a){return runtime.caml_unix_execvp(b, a);},
       function(c, b, a){return runtime.caml_unix_execvpe(c, b, a);},
       function(a){return runtime.caml_unix_fork(a);},
       function(a){return runtime.caml_unix_wait(a);},
       function(b, a){return runtime.caml_unix_waitpid(b, a);},
       system,
       caml_sys_exit,
       function(a){return runtime.caml_unix_getpid(a);},
       function(a){return runtime.caml_unix_getppid(a);},
       function(a){return runtime.caml_unix_nice(a);},
       stdin,
       stdout,
       stderr,
       runtime.caml_unix_open,
       caml_unix_close,
       runtime.caml_unix_fsync,
       read,
       read_bigarray,
       write,
       write_bigarray,
       single_write,
       write_substring,
       single_write_substring,
       single_write_bigarray,
       caml_unix_inchannel_of_filedes,
       caml_unix_outchannel_of_filede,
       caml_channel_descriptor,
       caml_channel_descriptor,
       runtime.caml_unix_lseek,
       runtime.caml_unix_truncate,
       runtime.caml_unix_ftruncate,
       runtime.caml_unix_stat,
       runtime.caml_unix_lstat,
       runtime.caml_unix_fstat,
       runtime.caml_unix_isatty,
       [0,
        runtime.caml_unix_lseek_64,
        runtime.caml_unix_truncate_64,
        runtime.caml_unix_ftruncate_64,
        runtime.caml_unix_stat_64,
        runtime.caml_unix_lstat_64,
        runtime.caml_unix_fstat_64],
       map_file,
       runtime.caml_unix_unlink,
       runtime.caml_unix_rename,
       runtime.caml_unix_link,
       function(a){return runtime.caml_unix_realpath(a);},
       runtime.caml_unix_chmod,
       runtime.caml_unix_fchmod,
       function(c, b, a){return runtime.caml_unix_chown(c, b, a);},
       function(c, b, a){return runtime.caml_unix_fchown(c, b, a);},
       function(a){return runtime.caml_unix_umask(a);},
       runtime.caml_unix_access,
       function(b, a){return runtime.caml_unix_dup(b, a);},
       function(c, b, a){return runtime.caml_unix_dup2(c, b, a);},
       function(a){return runtime.caml_unix_set_nonblock(a);},
       function(a){return runtime.caml_unix_clear_nonblock(a);},
       function(a){return runtime.caml_unix_set_close_on_exec(a);},
       function(a){return runtime.caml_unix_clear_close_on_exec(a);},
       runtime.caml_unix_mkdir,
       runtime.caml_unix_rmdir,
       runtime.caml_unix_chdir,
       function(a){return runtime.caml_sys_getcwd(a);},
       function(a){return runtime.caml_unix_chroot(a);},
       runtime.caml_unix_opendir,
       runtime.caml_unix_readdir,
       runtime.caml_unix_rewinddir,
       runtime.caml_unix_closedir,
       function(b, a){return runtime.caml_unix_pipe(b, a);},
       function(b, a){return runtime.caml_unix_mkfifo(b, a);},
       create_process,
       create_process_env,
       open_process_in,
       open_process_out,
       open_process,
       open_process_full,
       open_process_args,
       open_process_args_in,
       open_process_args_out,
       open_process_args_full,
       process_in_pid,
       process_out_pid,
       process_pid,
       process_full_pid,
       close_process_in,
       close_process_out,
       close_process,
       close_process_full,
       runtime.caml_unix_symlink,
       runtime.caml_unix_has_symlink,
       runtime.caml_unix_readlink,
       function(d, c, b, a){return runtime.caml_unix_select(d, c, b, a);},
       function(c, b, a){return runtime.caml_unix_lockf(c, b, a);},
       function(b, a){return runtime.caml_unix_kill(b, a);},
       function(b, a){return runtime.caml_unix_sigprocmask(b, a);},
       function(a){return runtime.caml_unix_sigpending(a);},
       function(a){return runtime.caml_unix_sigsuspend(a);},
       pause,
       function(a){return runtime.caml_unix_time(a);},
       function(a){return runtime.caml_unix_gettimeofday(a);},
       runtime.caml_unix_gmtime,
       runtime.caml_unix_localtime,
       runtime.caml_unix_mktime,
       function(a){return runtime.caml_unix_alarm(a);},
       sleep,
       function(a){return runtime.caml_unix_sleep(a);},
       function(a){return runtime.caml_unix_times(a);},
       runtime.caml_unix_utimes,
       function(a){return runtime.caml_unix_getitimer(a);},
       function(b, a){return runtime.caml_unix_setitimer(b, a);},
       runtime.caml_unix_getuid,
       runtime.caml_unix_geteuid,
       function(a){return runtime.caml_unix_setuid(a);},
       runtime.caml_unix_getgid,
       runtime.caml_unix_getegid,
       function(a){return runtime.caml_unix_setgid(a);},
       function(a){return runtime.caml_unix_getgroups(a);},
       function(a){return runtime.caml_unix_setgroups(a);},
       function(b, a){return runtime.caml_unix_initgroups(b, a);},
       function(a){return runtime.caml_unix_getlogin(a);},
       caml_unix_getpwnam,
       caml_unix_getpwnam,
       caml_unix_getpwnam,
       caml_unix_getpwnam,
       function(a){return caml_unix_inet_addr_of_string(a);},
       function(a){return runtime.caml_unix_string_of_inet_addr(a);},
       inet_addr_any,
       inet_addr_loopback,
       inet6_addr_any,
       inet6_addr_loopback,
       is_inet6_addr,
       function(d, c, b, a){return runtime.caml_unix_socket(d, c, b, a);},
       domain_of_sockaddr,
       function(d, c, b, a){return runtime.caml_unix_socketpair(d, c, b, a);},
       function(b, a){return runtime.caml_unix_accept(b, a);},
       function(b, a){return runtime.caml_unix_bind(b, a);},
       function(b, a){return runtime.caml_unix_connect(b, a);},
       function(b, a){return runtime.caml_unix_listen(b, a);},
       function(b, a){return runtime.caml_unix_shutdown(b, a);},
       function(a){return runtime.caml_unix_getsockname(a);},
       function(a){return runtime.caml_unix_getpeername(a);},
       recv,
       recvfrom,
       send,
       send_substring,
       sendto,
       sendto_substring,
       getsockopt,
       setsockopt,
       getsockopt_int,
       setsockopt_int,
       getsockopt_optint,
       setsockopt_optint,
       getsockopt_float,
       setsockopt_float,
       getsockopt_error,
       open_connection,
       shutdown_connection,
       establish_server,
       function(a){return runtime.caml_unix_gethostname(a);},
       function(a){return runtime.caml_unix_gethostbyname(a);},
       function(a){return runtime.caml_unix_gethostbyaddr(a);},
       function(a){return runtime.caml_unix_getprotobyname(a);},
       function(a){return runtime.caml_unix_getprotobynumber(a);},
       function(b, a){return runtime.caml_unix_getservbyname(b, a);},
       function(b, a){return runtime.caml_unix_getservbyport(b, a);},
       getaddrinfo,
       getnameinfo,
       function(a){return runtime.caml_unix_tcgetattr(a);},
       function(c, b, a){return runtime.caml_unix_tcsetattr(c, b, a);},
       function(b, a){return runtime.caml_unix_tcsendbreak(b, a);},
       function(a){return runtime.caml_unix_tcdrain(a);},
       function(b, a){return runtime.caml_unix_tcflush(b, a);},
       function(b, a){return runtime.caml_unix_tcflow(b, a);},
       function(a){return runtime.caml_unix_setsid(a);}];
   runtime.caml_register_global(140, Unix, "Unix");
   return;
  }
  (globalThis));

//# 1039 "../.js/default/unix/unix.cma.js"
//# shape: UnixLabels:[N,F(1),F(2),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(2),F(3),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),N,N,N,F(3),F(1),F(1),F(4),F(4),F(4),F(4),F(4),F(4),F(4),F(4),F(1),F(1),F(1),F(1),F(3),F(2),F(2),F(1),F(1),F(1),F(1),N,F(6),F(1),F(2),F(3),F(1),F(2),F(2),F(3),F(3),F(1),F(2),F(2),F(3),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(5),F(6),F(1),F(1),F(1),F(1),F(2),F(2),F(2),F(3),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(1),F(4),F(3),F(2),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(1)*,F(1),N,N,N,N,F(1)*,F(4),F(1)*,F(4),F(2),F(2),F(2),F(2),F(2),F(1),F(1),F(5),F(5),F(5),F(5),F(6),F(6),F(2),F(3),F(2),F(3),F(2),F(3),F(2),F(3),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(2),F(1),F(3),F(2),F(1),F(2),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    Unix = runtime.caml_get_global_data().Unix,
    Unix_error = Unix[1],
    error_message = Unix[2],
    handle_unix_error = Unix[3],
    environment = Unix[4],
    unsafe_environment = Unix[5],
    getenv = Unix[6],
    unsafe_getenv = Unix[7],
    putenv = Unix[8],
    execv = Unix[9],
    execve = Unix[10],
    execvp = Unix[11],
    execvpe = Unix[12],
    fork = Unix[13],
    wait = Unix[14],
    waitpid = Unix[15],
    system = Unix[16],
    exit = Unix[17],
    getpid = Unix[18],
    getppid = Unix[19],
    nice = Unix[20],
    stdin = Unix[21],
    stdout = Unix[22],
    stderr = Unix[23],
    openfile = Unix[24],
    close = Unix[25],
    fsync = Unix[26],
    read = Unix[27],
    read_bigarray = Unix[28],
    write = Unix[29],
    write_bigarray = Unix[30],
    single_write = Unix[31],
    write_substring = Unix[32],
    single_write_substring = Unix[33],
    single_write_bigarray = Unix[34],
    in_channel_of_descr = Unix[35],
    out_channel_of_descr = Unix[36],
    descr_of_in_channel = Unix[37],
    descr_of_out_channel = Unix[38],
    lseek = Unix[39],
    truncate = Unix[40],
    ftruncate = Unix[41],
    stat = Unix[42],
    lstat = Unix[43],
    fstat = Unix[44],
    isatty = Unix[45],
    LargeFile = Unix[46],
    map_file = Unix[47],
    unlink = Unix[48],
    rename = Unix[49],
    link = Unix[50],
    realpath = Unix[51],
    chmod = Unix[52],
    fchmod = Unix[53],
    chown = Unix[54],
    fchown = Unix[55],
    umask = Unix[56],
    access = Unix[57],
    dup = Unix[58],
    dup2 = Unix[59],
    set_nonblock = Unix[60],
    clear_nonblock = Unix[61],
    set_close_on_exec = Unix[62],
    clear_close_on_exec = Unix[63],
    mkdir = Unix[64],
    rmdir = Unix[65],
    chdir = Unix[66],
    getcwd = Unix[67],
    chroot = Unix[68],
    opendir = Unix[69],
    readdir = Unix[70],
    rewinddir = Unix[71],
    closedir = Unix[72],
    pipe = Unix[73],
    mkfifo = Unix[74],
    create_process = Unix[75],
    create_process_env = Unix[76],
    open_process_in = Unix[77],
    open_process_out = Unix[78],
    open_process = Unix[79],
    open_process_full = Unix[80],
    open_process_args = Unix[81],
    open_process_args_in = Unix[82],
    open_process_args_out = Unix[83],
    open_process_args_full = Unix[84],
    process_in_pid = Unix[85],
    process_out_pid = Unix[86],
    process_pid = Unix[87],
    process_full_pid = Unix[88],
    close_process_in = Unix[89],
    close_process_out = Unix[90],
    close_process = Unix[91],
    close_process_full = Unix[92],
    symlink = Unix[93],
    has_symlink = Unix[94],
    readlink = Unix[95],
    select = Unix[96],
    lockf = Unix[97],
    kill = Unix[98],
    sigprocmask = Unix[99],
    sigpending = Unix[100],
    sigsuspend = Unix[101],
    pause = Unix[102],
    time = Unix[103],
    gettimeofday = Unix[104],
    gmtime = Unix[105],
    localtime = Unix[106],
    mktime = Unix[107],
    alarm = Unix[108],
    sleep = Unix[109],
    sleepf = Unix[110],
    times = Unix[111],
    utimes = Unix[112],
    getitimer = Unix[113],
    setitimer = Unix[114],
    getuid = Unix[115],
    geteuid = Unix[116],
    setuid = Unix[117],
    getgid = Unix[118],
    getegid = Unix[119],
    setgid = Unix[120],
    getgroups = Unix[121],
    setgroups = Unix[122],
    initgroups = Unix[123],
    getlogin = Unix[124],
    getpwnam = Unix[125],
    getgrnam = Unix[126],
    getpwuid = Unix[127],
    getgrgid = Unix[128],
    inet_addr_of_string = Unix[129],
    string_of_inet_addr = Unix[130],
    inet_addr_any = Unix[131],
    inet_addr_loopback = Unix[132],
    inet6_addr_any = Unix[133],
    inet6_addr_loopback = Unix[134],
    is_inet6_addr = Unix[135],
    socket = Unix[136],
    domain_of_sockaddr = Unix[137],
    socketpair = Unix[138],
    accept = Unix[139],
    bind = Unix[140],
    connect = Unix[141],
    listen = Unix[142],
    shutdown = Unix[143],
    getsockname = Unix[144],
    getpeername = Unix[145],
    recv = Unix[146],
    recvfrom = Unix[147],
    send = Unix[148],
    send_substring = Unix[149],
    sendto = Unix[150],
    sendto_substring = Unix[151],
    getsockopt = Unix[152],
    setsockopt = Unix[153],
    getsockopt_int = Unix[154],
    setsockopt_int = Unix[155],
    getsockopt_optint = Unix[156],
    setsockopt_optint = Unix[157],
    getsockopt_float = Unix[158],
    setsockopt_float = Unix[159],
    getsockopt_error = Unix[160],
    open_connection = Unix[161],
    shutdown_connection = Unix[162],
    establish_server = Unix[163],
    gethostname = Unix[164],
    gethostbyname = Unix[165],
    gethostbyaddr = Unix[166],
    getprotobyname = Unix[167],
    getprotobynumber = Unix[168],
    getservbyname = Unix[169],
    getservbyport = Unix[170],
    getaddrinfo = Unix[171],
    getnameinfo = Unix[172],
    tcgetattr = Unix[173],
    tcsetattr = Unix[174],
    tcsendbreak = Unix[175],
    tcdrain = Unix[176],
    tcflush = Unix[177],
    tcflow = Unix[178],
    setsid = Unix[179];
   runtime.caml_register_global
    (1,
     [0,
      Unix_error,
      error_message,
      handle_unix_error,
      environment,
      unsafe_environment,
      getenv,
      unsafe_getenv,
      putenv,
      execv,
      execve,
      execvp,
      execvpe,
      fork,
      wait,
      waitpid,
      system,
      exit,
      getpid,
      getppid,
      nice,
      stdin,
      stdout,
      stderr,
      openfile,
      close,
      fsync,
      read,
      read_bigarray,
      write,
      write_bigarray,
      single_write,
      write_substring,
      single_write_substring,
      single_write_bigarray,
      in_channel_of_descr,
      out_channel_of_descr,
      descr_of_in_channel,
      descr_of_out_channel,
      lseek,
      truncate,
      ftruncate,
      stat,
      lstat,
      fstat,
      isatty,
      LargeFile,
      map_file,
      unlink,
      rename,
      link,
      realpath,
      chmod,
      fchmod,
      chown,
      fchown,
      umask,
      access,
      dup,
      dup2,
      set_nonblock,
      clear_nonblock,
      set_close_on_exec,
      clear_close_on_exec,
      mkdir,
      rmdir,
      chdir,
      getcwd,
      chroot,
      opendir,
      readdir,
      rewinddir,
      closedir,
      pipe,
      mkfifo,
      create_process,
      create_process_env,
      open_process_in,
      open_process_out,
      open_process,
      open_process_full,
      open_process_args,
      open_process_args_in,
      open_process_args_out,
      open_process_args_full,
      process_in_pid,
      process_out_pid,
      process_pid,
      process_full_pid,
      close_process_in,
      close_process_out,
      close_process,
      close_process_full,
      symlink,
      has_symlink,
      readlink,
      select,
      lockf,
      kill,
      sigprocmask,
      sigpending,
      sigsuspend,
      pause,
      time,
      gettimeofday,
      gmtime,
      localtime,
      mktime,
      alarm,
      sleep,
      sleepf,
      times,
      utimes,
      getitimer,
      setitimer,
      getuid,
      geteuid,
      setuid,
      getgid,
      getegid,
      setgid,
      getgroups,
      setgroups,
      initgroups,
      getlogin,
      getpwnam,
      getgrnam,
      getpwuid,
      getgrgid,
      inet_addr_of_string,
      string_of_inet_addr,
      inet_addr_any,
      inet_addr_loopback,
      inet6_addr_any,
      inet6_addr_loopback,
      is_inet6_addr,
      socket,
      domain_of_sockaddr,
      socketpair,
      accept,
      bind,
      connect,
      listen,
      shutdown,
      getsockname,
      getpeername,
      recv,
      recvfrom,
      send,
      send_substring,
      sendto,
      sendto_substring,
      getsockopt,
      setsockopt,
      getsockopt_int,
      setsockopt_int,
      getsockopt_optint,
      setsockopt_optint,
      getsockopt_float,
      setsockopt_float,
      getsockopt_error,
      open_connection,
      shutdown_connection,
      establish_server,
      gethostname,
      gethostbyname,
      gethostbyaddr,
      getprotobyname,
      getprotobynumber,
      getservbyname,
      getservbyport,
      getaddrinfo,
      getnameinfo,
      tcgetattr,
      tcsetattr,
      tcsendbreak,
      tcdrain,
      tcflush,
      tcflow,
      setsid],
     "UnixLabels");
   return;
  }
  (globalThis));

//# 5 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_types:[N,N,N,F(1),F(1),N,N,N,N,N,N,N,N,N,N,N,N,N,N,F(1),F(1),N,N,N,N,F(3),F(2),F(2),F(3),F(2),F(3),F(3),F(2),F(1),F(1),F(1),F(1)*,F(1)*,F(1),N,F(1),F(3),N,N,N,N,N,N,F(1),N,N,N,N,F(1)*,F(6),F(5),F(5),F(2),F(1),F(1),F(1)*,F(1)*,F(1)*,F(1)*,F(1)*,F(1)*,F(1)*,F(1),F(1)*,F(1)*,F(1)*,F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(1),F(1)*,F(2),F(2),F(1),F(1),F(1),F(1),F(1)*,F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(2),F(2),F(3),F(2),F(1)*,F(1),F(1),F(1),F(1),F(1)*,F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(2),F(1),F(1),F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_fresh_oo_id = runtime.caml_fresh_oo_id,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib = global_data.Stdlib,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_Uchar = global_data.Stdlib__Uchar,
    Stdlib_Queue = global_data.Stdlib__Queue,
    Stdlib_Float = global_data.Stdlib__Float,
    sym_to_id = Stdlib_Hashtbl[1].call(null, 0, 512),
    id_to_sym = Stdlib_Hashtbl[1].call(null, 0, 512),
    sym_next = [0, 0];
   function intern(s){
    var match = Stdlib_Hashtbl[7].call(null, sym_to_id, s);
    if(match){var id = match[1]; return id;}
    var id$0 = sym_next[1];
    sym_next[1]++;
    Stdlib_Hashtbl[11].call(null, sym_to_id, s, id$0);
    Stdlib_Hashtbl[11].call(null, id_to_sym, id$0, s);
    return id$0;
   }
   function unintern(id){
    var match = Stdlib_Hashtbl[7].call(null, id_to_sym, id);
    if(match){var s = match[1]; return s;}
    var a = Stdlib[33].call(null, id), b = Stdlib[28].call(null, a, ">");
    return Stdlib[28].call(null, "<sym:", b);
   }
   var
    vm_call_closure_ref =
      [0,
       function(a, param){
        throw caml_maybe_attach_backtrace
               ([0, Stdlib[7], "VM call_closure not initialized"], 1);
       }],
    cek_call_ref =
      [0,
       function(a, param){
        throw caml_maybe_attach_backtrace
               ([0, Stdlib[7], "CEK call not initialized"], 1);
       }],
    cek_eval_lambda_ref =
      [0,
       function(a, param){
        throw caml_maybe_attach_backtrace
               ([0, Stdlib[7], "CEK eval lambda not initialized"], 1);
       }],
    Eval_error = [248, "Sx_types.Eval_error", caml_fresh_oo_id(0)],
    Parse_error = [248, "Sx_types.Parse_error", caml_fresh_oo_id(0)],
    CekPerformRequest =
      [248, "Sx_types.CekPerformRequest", caml_fresh_oo_id(0)],
    default_vm_globals = [0, Stdlib_Hashtbl[1].call(null, 0, 0)],
    convert_vm_suspension = [0, function(param){return 0;}],
    vm_suspension_to_dict = [0, function(param){return 0;}],
    rtd_table = Stdlib_Hashtbl[1].call(null, 0, 16);
   function make_env(param){
    return [0, Stdlib_Hashtbl[1].call(null, 0, 16), 0];
   }
   function env_extend(parent){
    return [0, Stdlib_Hashtbl[1].call(null, 0, 16), [0, parent]];
   }
   var env_bind_hook = [0, 0];
   function env_bind(env, name, v){
    var a = intern(name);
    Stdlib_Hashtbl[11].call(null, env[1], a, v);
    var match = env_bind_hook[1];
    if(match){var f = match[1]; caml_call3(f, env, name, v);}
    return 0;
   }
   function env_has_id(env$1, id){
    var env = env$1;
    for(;;){
     var a = Stdlib_Hashtbl[9].call(null, env[1], id);
     if(a)
      var b = a;
     else{
      var match = env[2];
      if(match){var env$0 = match[1]; env = env$0; continue;}
      var b = 0;
     }
     return b;
    }
   }
   function env_has(env, name){return env_has_id(env, intern(name));}
   var symbol_resolve_hook = [0, 0];
   function env_get_id(env$1, id, name){
    var env = env$1;
    for(;;){
     var match = Stdlib_Hashtbl[7].call(null, env[1], id);
     if(match){var v = match[1]; return v;}
     var match$0 = env[2];
     if(! match$0){
      var
       match$1 = symbol_resolve_hook[1],
       cst_Undefined_symbol = "Undefined symbol: ";
      if(! match$1)
       throw caml_maybe_attach_backtrace
              ([0,
                Eval_error,
                Stdlib[28].call(null, cst_Undefined_symbol, name)],
               1);
      var hook = match$1[1], match$2 = caml_call1(hook, name);
      if(! match$2)
       throw caml_maybe_attach_backtrace
              ([0,
                Eval_error,
                Stdlib[28].call(null, cst_Undefined_symbol, name)],
               1);
      var v$0 = match$2[1];
      Stdlib_Hashtbl[11].call(null, env[1], id, v$0);
      return v$0;
     }
     var env$0 = match$0[1];
     env = env$0;
    }
   }
   function env_get(env, name){return env_get_id(env, intern(name), name);}
   function env_set_id(env$1, id, v){
    var env = env$1;
    for(;;){
     if(Stdlib_Hashtbl[9].call(null, env[1], id)){
      Stdlib_Hashtbl[11].call(null, env[1], id, v);
      var match = env_bind_hook[1];
      if(match){var f = match[1]; caml_call3(f, env, unintern(id), v);}
      return 0;
     }
     var match$0 = env[2];
     if(! match$0){Stdlib_Hashtbl[11].call(null, env[1], id, v); return 0;}
     var env$0 = match$0[1];
     env = env$0;
    }
   }
   function env_set(env, name, v){return env_set_id(env, intern(name), v);}
   function env_merge(base, overlay){
    if(base === overlay)
     return [0, Stdlib_Hashtbl[1].call(null, 0, 16), [0, base]];
    a:
    {
     b:
     {
      c:
      {
       var e = overlay, depth = 0;
       for(;;){
        if(100 < depth) break b;
        if(e === base) break c;
        var match = e[2];
        if(! match) break;
        var p = match[1], depth$0 = depth + 1 | 0;
        e = p;
        depth = depth$0;
       }
       var a = 0;
       break a;
      }
      var a = 1;
      break a;
     }
     var a = 0;
    }
    if(a) return [0, Stdlib_Hashtbl[1].call(null, 0, 16), [0, base]];
    var e$0 = [0, Stdlib_Hashtbl[1].call(null, 0, 16), [0, base]];
    Stdlib_Hashtbl[12].call
     (null,
      function(id, v){
       var a = 1 - env_has_id(base, id);
       return a ? Stdlib_Hashtbl[11].call(null, e$0[1], id, v) : a;
      },
      overlay[1]);
    return e$0;
   }
   var
    a = [0, [8, [0, 0, 3], 0, [0, 17], 0], "%.17g"],
    b = [0, [8, [0, 0, 3], 0, 0, 0], "%g"];
   function format_number(n){
    if(Stdlib_Float[17].call(null, n)) return "nan";
    if(n === Stdlib_Float[6]) return "inf";
    if(n === Stdlib_Float[7]) return "-inf";
    if(Stdlib_Float[18].call(null, n) && Math.abs(n) < 10000000000000000.)
     return Stdlib[33].call(null, n | 0);
    return Stdlib_Float[18].call(null, n)
            ? caml_call1(Stdlib_Printf[4].call(null, a), n)
            : caml_call1(Stdlib_Printf[4].call(null, b), n);
   }
   var cst = "", cst_false = "false", cst_true = "true";
   function value_to_string(param){
    if(typeof param === "number"){if(0 === param) return cst;}
    else
     switch(param[0]){
       case 0:
        return param[1] ? cst_true : cst_false;
       case 1:
        var n = param[1]; return Stdlib[33].call(null, n);
       case 2:
        var n$0 = param[1]; return format_number(n$0);
       case 3:
       case 4:
       case 5:
        var s = param[1]; return s;
     }
    return "<value>";
   }
   function value_to_string_list(param){
    a:
    if(typeof param !== "number"){
     switch(param[0]){
       case 6:
        var items = param[1]; break;
       case 21:
        var items = param[1][1]; break;
       default: break a;
     }
     return Stdlib_List[20].call(null, value_to_string, items);
    }
    return 0;
   }
   function value_to_bool(param){
    if(typeof param === "number"){if(0 === param) return 0;}
    else if(0 === param[0]){var b = param[1]; return b;}
    return 1;
   }
   function value_to_string_opt(param){
    if(typeof param === "number"){if(0 === param) return 0;}
    else if(param[0] - 3 >>> 0 < 2){var s = param[1]; return [0, s];}
    return 0;
   }
   function unwrap_env_val(param){
    if(typeof param !== "number" && 20 === param[0]){var e = param[1]; return e;}
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, "make_lambda: expected env for closure"], 1);
   }
   var lambda_uid_counter = [0, 0];
   function next_lambda_uid(param){
    lambda_uid_counter[1]++;
    return lambda_uid_counter[1];
   }
   function make_lambda(params, body, closure){
    a:
    {
     if(typeof params !== "number" && 6 === params[0]){
      var
       items = params[1],
       ps = Stdlib_List[20].call(null, value_to_string, items);
      break a;
     }
     var ps = value_to_string_list(params);
    }
    var a = next_lambda_uid(0);
    return [8, [0, ps, body, unwrap_env_val(closure), 0, 0, 0, a]];
   }
   var
    jit_excluded = Stdlib_Hashtbl[1].call(null, 0, 64),
    jit_excluded_prefixes = [0, 0];
   function jit_name_excluded(name){
    var a = Stdlib_Hashtbl[9].call(null, jit_excluded, name);
    return a
            ? a
            : Stdlib_List
               [34].call
              (null,
               function(p){
                var
                 a =
                   caml_ml_string_length(p) <= caml_ml_string_length(name)
                    ? 1
                    : 0,
                 b =
                   a
                    ? Stdlib_String
                        [16].call
                       (null, name, 0, caml_ml_string_length(p))
                      === p
                      ? 1
                      : 0
                    : a;
                return b;
               },
               jit_excluded_prefixes[1]);
   }
   var
    jit_excluded_caller_names = Stdlib_Hashtbl[1].call(null, 0, 16),
    jit_cache_queue = Stdlib_Queue[2].call(null, 0);
   function jit_cache_size(param){
    return Stdlib_Queue[14].call(null, jit_cache_queue);
   }
   var cst_auto = "auto";
   function make_component
   (name, params, has_children, body, closure, affinity){
    var
     n = value_to_string(name),
     ps = value_to_string_list(params),
     hc = value_to_bool(has_children);
    if(typeof affinity === "number" || ! (3 === affinity[0]))
     var aff = cst_auto;
    else
     var s = affinity[1], aff = s;
    return [9, [0, n, ps, hc, body, unwrap_env_val(closure), aff, 0, 0]];
   }
   function make_island(name, params, has_children, body, closure){
    var
     n = value_to_string(name),
     ps = value_to_string_list(params),
     hc = value_to_bool(has_children);
    return [10, [0, n, ps, hc, body, unwrap_env_val(closure), 0, 0]];
   }
   function make_macro(params, rest_param, body, closure, name){
    var
     ps = value_to_string_list(params),
     rp = value_to_string_opt(rest_param),
     n = value_to_string_opt(name);
    return [11, [0, ps, rp, body, unwrap_env_val(closure), n]];
   }
   function make_thunk(expr, env){return [12, expr, unwrap_env_val(env)];}
   function make_symbol(name){return [4, value_to_string(name)];}
   function make_keyword(name){return [5, value_to_string(name)];}
   var cst_lambda = "lambda", cst_macro = "macro", cst_nil = "nil";
   function type_of(param){
    if(typeof param === "number") return 0 === param ? cst_nil : "eof-object";
    var
     cst_continuation = "continuation",
     cst_dict = "dict",
     cst_function = "function",
     cst_number = "number";
    switch(param[0]){
      case 0:
       return "boolean";
      case 1:
       return cst_number;
      case 2:
       return cst_number;
      case 3:
       return "string";
      case 4:
       return "symbol";
      case 5:
       return "keyword";
      case 7:
       return cst_dict;
      case 8:
       return cst_lambda;
      case 9:
       return "component";
      case 10:
       return "island";
      case 11:
       return cst_macro;
      case 12:
       return "thunk";
      case 13:
       return cst_continuation;
      case 14:
       return cst_continuation;
      case 15:
       return cst_function;
      case 16:
       return "signal";
      case 17:
       return "raw-html";
      case 18:
       return "spread";
      case 19:
       return "sx-expr";
      case 20:
       return "env";
      case 22:
       return cst_dict;
      case 23:
       return cst_dict;
      case 24:
       return cst_function;
      case 25:
       return "vm-frame";
      case 26:
       return "vm-machine";
      case 27:
       var r = param[1]; return r[1][1];
      case 28:
       return "parameter";
      case 29:
       return "vector";
      case 30:
       return "string-buffer";
      case 31:
       return "hash-table";
      case 32:
       return "char";
      case 33:
       return 0 === param[1][2][0] ? "input-port" : "output-port";
      case 34:
       return "rational";
      case 35:
       return "set";
      case 36:
       return "regexp";
      case 37:
       return "bytevector";
      case 38:
       var a = param[1]; return a[1];
      default: return "list";
    }
   }
   function is_nil(param){
    if(typeof param === "number" && ! param) return 1;
    return 0;
   }
   function is_lambda(param){
    if(typeof param !== "number" && 8 === param[0]) return 1;
    return 0;
   }
   function is_component(param){
    if(typeof param !== "number" && 9 === param[0]) return 1;
    return 0;
   }
   function is_island(param){
    if(typeof param !== "number" && 10 === param[0]) return 1;
    return 0;
   }
   function is_macro(param){
    if(typeof param !== "number" && 11 === param[0]) return 1;
    return 0;
   }
   function is_thunk(param){
    if(typeof param !== "number" && 12 === param[0]) return 1;
    return 0;
   }
   function is_signal(param){
    if(typeof param !== "number")
     switch(param[0]){
       case 7:
        var d = param[1]; return Stdlib_Hashtbl[9].call(null, d, "__signal");
       case 16:
        return 1;
     }
    return 0;
   }
   function is_record(param){
    if(typeof param !== "number" && 27 === param[0]) return 1;
    return 0;
   }
   function is_callable(param){
    if(typeof param !== "number")
     switch(param[0]){case 8:case 13:case 14:case 15:case 24: return 1;}
    return 0;
   }
   function sx_truthy(param){
    a:
    {
     if(typeof param === "number"){if(0 !== param) break a;}
     else if(0 !== param[0] || param[1]) break a;
     return 0;
    }
    return 1;
   }
   function symbol_name(v){
    if(typeof v !== "number" && 4 === v[0]){var s = v[1]; return [3, s];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, "Expected symbol, got ", a)],
            1);
   }
   function keyword_name(v){
    if(typeof v !== "number" && 5 === v[0]){var k = v[1]; return [3, k];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, "Expected keyword, got ", a)],
            1);
   }
   var cst_Expected_lambda_got = "Expected lambda, got ";
   function lambda_params(v){
    if(typeof v !== "number" && 8 === v[0]){
     var l = v[1];
     return [6, Stdlib_List[20].call(null, function(s){return [3, s];}, l[1])];
    }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_lambda_got, a)],
            1);
   }
   function lambda_body(v){
    if(typeof v !== "number" && 8 === v[0]){var l = v[1]; return l[2];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_lambda_got, a)],
            1);
   }
   function lambda_closure(v){
    if(typeof v !== "number" && 8 === v[0]){var l = v[1]; return [20, l[3]];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_lambda_got, a)],
            1);
   }
   function lambda_name(v){
    if(typeof v !== "number" && 8 === v[0]){
     var l = v[1], match = l[4];
     if(! match) return 0;
     var n = match[1];
     return [3, n];
    }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_lambda_got, a)],
            1);
   }
   function set_lambda_name(l, n){
    if(typeof l !== "number" && 8 === l[0]){
     var l$0 = l[1];
     l$0[4] = [0, n];
     return 0;
    }
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, "set-lambda-name!: not a lambda"], 1);
   }
   var cst_Expected_component_got = "Expected component, got ";
   function component_name(v){
    if(typeof v !== "number" && v[0] - 9 >>> 0 < 2){var c = v[1]; return [3, c[1]];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, cst_Expected_component_got, a)],
            1);
   }
   function component_file(param){
    if(typeof param !== "number")
     switch(param[0]){
       case 9:
        var c = param[1], match = c[7];
        if(! match) return 0;
        var f = match[1];
        return [3, f];
       case 10:
        var i = param[1], match$0 = i[6];
        if(! match$0) return 0;
        var f$0 = match$0[1];
        return [3, f$0];
     }
    return 0;
   }
   function component_set_file(v, f){
    if(typeof v !== "number")
     switch(v[0]){
       case 9:
        if(typeof f !== "number" && 3 === f[0]){var s = f[1], c = v[1]; c[7] = [0, s];
        }
        break;
       case 10:
        if(typeof f !== "number" && 3 === f[0]){
         var s$0 = f[1], i = v[1];
         i[6] = [0, s$0];
        }
        break;
     }
    return 0;
   }
   function component_params(v){
    if(typeof v !== "number")
     switch(v[0]){
       case 9:
        var c = v[1];
        return [6,
                Stdlib_List[20].call(null, function(s){return [3, s];}, c[2])];
       case 10:
        var i = v[1];
        return [6,
                Stdlib_List[20].call(null, function(s){return [3, s];}, i[2])];
     }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, cst_Expected_component_got, a)],
            1);
   }
   function component_body(v){
    if(typeof v !== "number" && v[0] - 9 >>> 0 < 2){var c = v[1]; return c[4];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, cst_Expected_component_got, a)],
            1);
   }
   function component_closure(v){
    if(typeof v !== "number" && v[0] - 9 >>> 0 < 2){var c = v[1]; return [20, c[5]];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, cst_Expected_component_got, a)],
            1);
   }
   function component_has_children(v){
    if(typeof v !== "number" && v[0] - 9 >>> 0 < 2){var c = v[1]; return [0, c[3]];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, cst_Expected_component_got, a)],
            1);
   }
   var c = [3, cst_auto], d = [3, "client"];
   function component_affinity(param){
    if(typeof param !== "number")
     switch(param[0]){
       case 9:
        var c$0 = param[1]; return [3, c$0[6]];
       case 10:
        return d;
     }
    return c;
   }
   var cst_Expected_macro_got = "Expected macro, got ";
   function macro_params(v){
    if(typeof v !== "number" && 11 === v[0]){
     var m = v[1];
     return [6, Stdlib_List[20].call(null, function(s){return [3, s];}, m[1])];
    }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_macro_got, a)],
            1);
   }
   function macro_rest_param(v){
    if(typeof v !== "number" && 11 === v[0]){
     var m = v[1], match = m[2];
     if(! match) return 0;
     var s = match[1];
     return [3, s];
    }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_macro_got, a)],
            1);
   }
   function macro_body(v){
    if(typeof v !== "number" && 11 === v[0]){var m = v[1]; return m[3];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_macro_got, a)],
            1);
   }
   function macro_closure(v){
    if(typeof v !== "number" && 11 === v[0]){var m = v[1]; return [20, m[4]];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_macro_got, a)],
            1);
   }
   var cst_Expected_thunk_got = "Expected thunk, got ";
   function thunk_expr(v){
    if(typeof v !== "number" && 12 === v[0]){var e = v[1]; return e;}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_thunk_got, a)],
            1);
   }
   function thunk_env(v){
    if(typeof v !== "number" && 12 === v[0]){var e = v[2]; return [20, e];}
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, cst_Expected_thunk_got, a)],
            1);
   }
   function val_to_int(v){
    if(typeof v !== "number")
     switch(v[0]){
       case 1:
        var n = v[1]; return n;
       case 2:
        var n$0 = v[1]; return n$0 | 0;
     }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, Stdlib[28].call(null, "Expected number, got ", a)],
            1);
   }
   var
    rtd_counter = [0, 0],
    e =
      [0,
       [11, "make-rtd: ctor param ", [2, 0, [11, " not in fields", 0]]],
       "make-rtd: ctor param %s not in fields"];
   function make_rtd(name, fields, ctor_params){
    var uid = rtd_counter[1];
    rtd_counter[1]++;
    a:
    {
     if(typeof fields !== "number" && 6 === fields[0]){var l$0 = fields[1], a = l$0; break a;}
     var a = 0;
    }
    var field_names = Stdlib_List[20].call(null, value_to_string, a);
    a:
    {
     if(typeof ctor_params !== "number" && 6 === ctor_params[0]){var l = ctor_params[1], b = l; break a;}
     var b = 0;
    }
    var
     ctor_names = Stdlib_List[20].call(null, value_to_string, b),
     field_arr = Stdlib_Array[11].call(null, field_names),
     c =
       Stdlib_List[20].call
        (null,
         function(cp){
          var j = 0, param = field_names;
          for(;;){
           if(! param)
            throw caml_maybe_attach_backtrace
                   ([0,
                     Eval_error,
                     caml_call1(Stdlib_Printf[4].call(null, e), cp)],
                    1);
           var f = param[1];
           if(f === cp) return j;
           var rest = param[2], j$0 = j + 1 | 0;
           j = j$0;
           param = rest;
          }
         },
         ctor_names),
     ctor_map = Stdlib_Array[11].call(null, c),
     rt = [0, value_to_string(name), uid, field_arr, ctor_map];
    Stdlib_Hashtbl[5].call(null, rtd_table, uid, rt);
    return [2, uid];
   }
   var
    cst_args_got = " args, got ",
    cst_s_expected_d_args_got_d = "%s: expected %d args, got %d",
    cst_expected = ": expected ",
    f =
      [0,
       [2,
        0,
        [11, cst_expected, [4, 0, 0, 0, [11, cst_args_got, [4, 0, 0, 0, 0]]]]],
       cst_s_expected_d_args_got_d];
   function make_record(uid_val, args_list){
    var uid = val_to_int(uid_val);
    a:
    {
     if(typeof args_list !== "number" && 6 === args_list[0]){var l = args_list[1], ctor_args = l; break a;}
     var ctor_args = 0;
    }
    var match = Stdlib_Hashtbl[7].call(null, rtd_table, uid);
    if(! match)
     throw caml_maybe_attach_backtrace
            ([0, Eval_error, "make-record: unknown rtd"], 1);
    var
     rt = match[1],
     n_ctor = rt[4].length - 1,
     n_args = Stdlib_List[1].call(null, ctor_args);
    if(n_args !== n_ctor){
     var a = rt[1];
     throw caml_maybe_attach_backtrace
            ([0,
              Eval_error,
              caml_call3(Stdlib_Printf[4].call(null, f), a, n_ctor, n_args)],
             1);
    }
    var fields = caml_make_vect(rt[3].length - 1, 0);
    Stdlib_List[19].call
     (null,
      function(i, arg){
       var a = caml_check_bound(rt[4], i)[i + 1];
       caml_check_bound(fields, a)[a + 1] = arg;
       return 0;
      },
      ctor_args);
    return [27, [0, rt, fields]];
   }
   var
    cst_out_of_bounds_for = " out of bounds for ",
    g =
      [0,
       [11,
        "record-ref: index ",
        [4, 0, 0, 0, [11, cst_out_of_bounds_for, [2, 0, 0]]]],
       "record-ref: index %d out of bounds for %s"];
   function record_ref(v, idx){
    if(typeof v !== "number" && 27 === v[0]){
     var
      r = v[1],
      i = val_to_int(idx),
      b = i < 0,
      c = b || r[2].length - 1 <= i;
     if(! c) return caml_check_bound(r[2], i)[i + 1];
     var d = r[1][1];
     throw caml_maybe_attach_backtrace
            ([0, Eval_error, caml_call2(Stdlib_Printf[4].call(null, g), i, d)],
             1);
    }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, "record-ref: not a record, got ", a)],
            1);
   }
   var
    h =
      [0,
       [11,
        "record-set!: index ",
        [4, 0, 0, 0, [11, cst_out_of_bounds_for, [2, 0, 0]]]],
       "record-set!: index %d out of bounds for %s"];
   function record_set_b(v, idx, new_val){
    if(typeof v !== "number" && 27 === v[0]){
     var
      r = v[1],
      i = val_to_int(idx),
      b = i < 0,
      c = b || r[2].length - 1 <= i;
     if(c){
      var d = r[1][1];
      throw caml_maybe_attach_backtrace
             ([0,
               Eval_error,
               caml_call2(Stdlib_Printf[4].call(null, h), i, d)],
              1);
     }
     caml_check_bound(r[2], i)[i + 1] = new_val;
     return 0;
    }
    var a = type_of(v);
    throw caml_maybe_attach_backtrace
           ([0,
             Eval_error,
             Stdlib[28].call(null, "record-set!: not a record, got ", a)],
            1);
   }
   var i = [0, 0];
   function record_type_p(v, uid_val){
    if(typeof v !== "number" && 27 === v[0]){
     var r = v[1], a = val_to_int(uid_val);
     return [0, r[1][2] === a ? 1 : 0];
    }
    return i;
   }
   function record_p(v){return [0, is_record(v)];}
   var
    j =
      [0,
       [2,
        0,
        [11, cst_expected, [4, 0, 0, 0, [11, cst_args_got, [4, 0, 0, 0, 0]]]]],
       cst_s_expected_d_args_got_d];
   function make_record_constructor(uid_val){
    var
     uid = val_to_int(uid_val),
     match = Stdlib_Hashtbl[7].call(null, rtd_table, uid);
    if(! match)
     throw caml_maybe_attach_backtrace
            ([0, Eval_error, "make-record-constructor: unknown rtd"], 1);
    var rt = match[1];
    return [15,
            rt[1],
            function(args){
             var
              n_ctor = rt[4].length - 1,
              n_args = Stdlib_List[1].call(null, args);
             if(n_args !== n_ctor){
              var a = rt[1];
              throw caml_maybe_attach_backtrace
                     ([0,
                       Eval_error,
                       caml_call3
                        (Stdlib_Printf[4].call(null, j), a, n_ctor, n_args)],
                      1);
             }
             var fields = caml_make_vect(rt[3].length - 1, 0);
             Stdlib_List[19].call
              (null,
               function(i, arg){
                var a = caml_check_bound(rt[4], i)[i + 1];
                caml_check_bound(fields, a)[a + 1] = arg;
                return 0;
               },
               args);
             return [27, [0, rt, fields]];
            }];
   }
   var k = [0, 0];
   function make_record_predicate(uid_val){
    var uid = val_to_int(uid_val);
    return [15,
            "?",
            function(args){
             a:
             if(args){
              var a = args[1];
              if(typeof a !== "number" && 27 === a[0]){
               if(args[2]) break a;
               var r = a[1];
               return [0, r[1][2] === uid ? 1 : 0];
              }
              if(! args[2]) return k;
             }
             throw caml_maybe_attach_backtrace
                    ([0, Eval_error, "record predicate: expected 1 arg"], 1);
            }];
   }
   var
    cst_out_of_bounds = " out of bounds",
    l =
      [0,
       [11,
        "record accessor: index ",
        [4, 0, 0, 0, [11, cst_out_of_bounds, 0]]],
       "record accessor: index %d out of bounds"];
   function make_record_accessor(idx_val){
    var idx = val_to_int(idx_val);
    return [15,
            "ref",
            function(args){
             a:
             if(args){
              var v = args[1];
              if(typeof v !== "number" && 27 === v[0]){
               if(args[2]) break a;
               var r = v[1], b = idx < 0, c = b || r[2].length - 1 <= idx;
               if(c)
                throw caml_maybe_attach_backtrace
                       ([0,
                         Eval_error,
                         caml_call1(Stdlib_Printf[4].call(null, l), idx)],
                        1);
               return caml_check_bound(r[2], idx)[idx + 1];
              }
              if(! args[2]){
               var a = type_of(v);
               throw caml_maybe_attach_backtrace
                      ([0,
                        Eval_error,
                        Stdlib[28].call
                         (null, "record accessor: not a record, got ", a)],
                       1);
              }
             }
             throw caml_maybe_attach_backtrace
                    ([0, Eval_error, "record accessor: expected 1 arg"], 1);
            }];
   }
   var
    m =
      [0,
       [11,
        "record mutator: index ",
        [4, 0, 0, 0, [11, cst_out_of_bounds, 0]]],
       "record mutator: index %d out of bounds"];
   function make_record_mutator(idx_val){
    var idx = val_to_int(idx_val);
    return [15,
            "set!",
            function(args){
             if(args){
              var a = args[1];
              if(typeof a !== "number" && 27 === a[0]){
               var b = args[2];
               if(b && ! b[2]){
                var
                 new_val = b[1],
                 r = a[1],
                 c = idx < 0,
                 d = c || r[2].length - 1 <= idx;
                if(d)
                 throw caml_maybe_attach_backtrace
                        ([0,
                          Eval_error,
                          caml_call1(Stdlib_Printf[4].call(null, m), idx)],
                         1);
                caml_check_bound(r[2], idx)[idx + 1] = new_val;
                return 0;
               }
              }
             }
             throw caml_maybe_attach_backtrace
                    ([0, Eval_error, "record mutator: expected (record value)"],
                     1);
            }];
   }
   var n = [0, 0], o = [0, 1];
   function parameter_p(v){
    if(typeof v !== "number" && 28 === v[0]) return o;
    return n;
   }
   function parameter_uid(v){
    if(typeof v !== "number" && 28 === v[0]){var p = v[1]; return [3, p[1]];}
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, "parameter-uid: not a parameter"], 1);
   }
   function parameter_default(v){
    if(typeof v !== "number" && 28 === v[0]){var p = v[1]; return p[2];}
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, "parameter-default: not a parameter"], 1);
   }
   function parameter_converter(v){
    if(typeof v !== "number" && 28 === v[0]){
     var p = v[1], match = p[3];
     if(! match) return 0;
     var c = match[1];
     return c;
    }
    throw caml_maybe_attach_backtrace
           ([0, Eval_error, "parameter-converter: not a parameter"], 1);
   }
   function make_dict(param){return Stdlib_Hashtbl[1].call(null, 0, 8);}
   function dict_get(d, key){
    var match = Stdlib_Hashtbl[7].call(null, d, key);
    if(! match) return 0;
    var v = match[1];
    return v;
   }
   function dict_has(d, key){return Stdlib_Hashtbl[9].call(null, d, key);}
   function dict_set(d, key, v){
    return Stdlib_Hashtbl[11].call(null, d, key, v);
   }
   function dict_delete(d, key){return Stdlib_Hashtbl[10].call(null, d, key);}
   function dict_keys(d){
    return Stdlib_Hashtbl[14].call
            (null, function(k, param, acc){return [0, [3, k], acc];}, d, 0);
   }
   function dict_vals(d){
    return Stdlib_Hashtbl[14].call
            (null, function(param, v, acc){return [0, v, acc];}, d, 0);
   }
   var
    p =
      [0,
       [11,
        "<vm-frame:ip=",
        [4, 0, 0, 0, [11, " base=", [4, 0, 0, 0, [12, 62, 0]]]]],
       "<vm-frame:ip=%d base=%d>"],
    q =
      [0,
       [11,
        "<vm-machine:sp=",
        [4, 0, 0, 0, [11, " frames=", [4, 0, 0, 0, [12, 62, 0]]]]],
       "<vm-machine:sp=%d frames=%d>"],
    r =
      [0,
       [11, "<string-buffer:", [4, 0, 0, 0, [12, 62, 0]]],
       "<string-buffer:%d>"],
    s =
      [0, [11, "<hash-table:", [4, 0, 0, 0, [12, 62, 0]]], "<hash-table:%d>"],
    t =
      [0,
       [11, "<input-port:pos=", [4, 0, 0, 0, [2, 0, [12, 62, 0]]]],
       "<input-port:pos=%d%s>"],
    u =
      [0,
       [11, "<output-port:len=", [4, 0, 0, 0, [2, 0, [12, 62, 0]]]],
       "<output-port:len=%d%s>"],
    v = [0, [11, "<set:", [4, 0, 0, 0, [12, 62, 0]]], "<set:%d>"];
   function inspect_into(buf, param){
    if(typeof param === "number")
     return 0 === param
             ? Stdlib_Buffer[16].call(null, buf, cst_nil)
             : Stdlib_Buffer[16].call(null, buf, "#!eof");
    var cst$1 = ")>", cst$0 = ", ", cst$2 = '>"';
    switch(param[0]){
      case 0:
       return param[1]
               ? Stdlib_Buffer[16].call(null, buf, cst_true)
               : Stdlib_Buffer[16].call(null, buf, cst_false);
      case 1:
       var n = param[1], h = Stdlib[33].call(null, n);
       return Stdlib_Buffer[16].call(null, buf, h);
      case 2:
       var n$0 = param[1], j = format_number(n$0);
       return Stdlib_Buffer[16].call(null, buf, j);
      case 3:
       var s$0 = param[1];
       Stdlib_Buffer[12].call(null, buf, 34);
       Stdlib_String[30].call
        (null,
         function(c){
          if(34 === c) return Stdlib_Buffer[16].call(null, buf, '\\"');
          if(14 <= c){
           if(92 === c) return Stdlib_Buffer[16].call(null, buf, "\\\\");
          }
          else if(9 <= c)
           switch(c - 9 | 0){
             case 0:
              return Stdlib_Buffer[16].call(null, buf, "\\t");
             case 1:
              return Stdlib_Buffer[16].call(null, buf, "\\n");
             case 4:
              return Stdlib_Buffer[16].call(null, buf, "\\r");
           }
          return Stdlib_Buffer[12].call(null, buf, c);
         },
         s$0);
       return Stdlib_Buffer[12].call(null, buf, 34);
      case 4:
       var s$1 = param[1]; return Stdlib_Buffer[16].call(null, buf, s$1);
      case 5:
       var k = param[1];
       Stdlib_Buffer[12].call(null, buf, 58);
       return Stdlib_Buffer[16].call(null, buf, k);
      case 6:
       var items = param[1]; break;
      case 7:
       var d = param[1];
       Stdlib_Buffer[12].call(null, buf, 123);
       var first = [0, 1];
       Stdlib_Hashtbl[12].call
        (null,
         function(k, v){
          if(first[1])
           first[1] = 0;
          else
           Stdlib_Buffer[12].call(null, buf, 32);
          Stdlib_Buffer[12].call(null, buf, 58);
          Stdlib_Buffer[16].call(null, buf, k);
          Stdlib_Buffer[12].call(null, buf, 32);
          return inspect_into(buf, v);
         },
         d);
       return Stdlib_Buffer[12].call(null, buf, 125);
      case 8:
       var l = param[1], match = l[4];
       if(match) var n$1 = match[1], tag = n$1; else var tag = cst_lambda;
       Stdlib_Buffer[12].call(null, buf, 60);
       Stdlib_Buffer[16].call(null, buf, tag);
       Stdlib_Buffer[12].call(null, buf, 40);
       var o = Stdlib_String[7].call(null, cst$0, l[1]);
       Stdlib_Buffer[16].call(null, buf, o);
       return Stdlib_Buffer[16].call(null, buf, cst$1);
      case 9:
       var c = param[1];
       Stdlib_Buffer[16].call(null, buf, "<Component ~");
       Stdlib_Buffer[16].call(null, buf, c[1]);
       Stdlib_Buffer[12].call(null, buf, 40);
       var w = Stdlib_String[7].call(null, cst$0, c[2]);
       Stdlib_Buffer[16].call(null, buf, w);
       return Stdlib_Buffer[16].call(null, buf, cst$1);
      case 10:
       var i = param[1];
       Stdlib_Buffer[16].call(null, buf, "<Island ~");
       Stdlib_Buffer[16].call(null, buf, i[1]);
       Stdlib_Buffer[12].call(null, buf, 40);
       var y = Stdlib_String[7].call(null, cst$0, i[2]);
       Stdlib_Buffer[16].call(null, buf, y);
       return Stdlib_Buffer[16].call(null, buf, cst$1);
      case 11:
       var m = param[1], match$0 = m[5];
       if(match$0)
        var n$2 = match$0[1], tag$0 = n$2;
       else
        var tag$0 = cst_macro;
       Stdlib_Buffer[12].call(null, buf, 60);
       Stdlib_Buffer[16].call(null, buf, tag$0);
       Stdlib_Buffer[12].call(null, buf, 40);
       var z = Stdlib_String[7].call(null, cst$0, m[1]);
       Stdlib_Buffer[16].call(null, buf, z);
       return Stdlib_Buffer[16].call(null, buf, cst$1);
      case 12:
       return Stdlib_Buffer[16].call(null, buf, "<thunk>");
      case 13:
       return Stdlib_Buffer[16].call(null, buf, "<continuation>");
      case 14:
       return Stdlib_Buffer[16].call(null, buf, "<callcc-continuation>");
      case 15:
       var name = param[1];
       Stdlib_Buffer[16].call(null, buf, "<native:");
       Stdlib_Buffer[16].call(null, buf, name);
       return Stdlib_Buffer[12].call(null, buf, 62);
      case 16:
       return Stdlib_Buffer[16].call(null, buf, "<signal>");
      case 17:
       var s$2 = param[1];
       Stdlib_Buffer[16].call(null, buf, '"<raw-html:');
       var A = Stdlib[33].call(null, caml_ml_string_length(s$2));
       Stdlib_Buffer[16].call(null, buf, A);
       return Stdlib_Buffer[16].call(null, buf, cst$2);
      case 18:
       return Stdlib_Buffer[16].call(null, buf, "<spread>");
      case 19:
       var s$3 = param[1];
       Stdlib_Buffer[16].call(null, buf, '"<sx-expr:');
       var B = Stdlib[33].call(null, caml_ml_string_length(s$3));
       Stdlib_Buffer[16].call(null, buf, B);
       return Stdlib_Buffer[16].call(null, buf, cst$2);
      case 20:
       return Stdlib_Buffer[16].call(null, buf, "<env>");
      case 21:
       var items = param[1][1]; break;
      case 22:
       return Stdlib_Buffer[16].call(null, buf, "<cek-state>");
      case 23:
       var f = param[1];
       Stdlib_Buffer[16].call(null, buf, "<frame:");
       Stdlib_Buffer[16].call(null, buf, f[1]);
       return Stdlib_Buffer[12].call(null, buf, 62);
      case 24:
       var cl = param[1];
       Stdlib_Buffer[16].call(null, buf, "<vm:");
       var match$1 = cl[3];
       if(match$1) var n$3 = match$1[1], n$4 = n$3; else var n$4 = "anon";
       Stdlib_Buffer[16].call(null, buf, n$4);
       return Stdlib_Buffer[12].call(null, buf, 62);
      case 25:
       var
        f$0 = param[1],
        C = f$0[3],
        D = f$0[2],
        E = caml_call2(Stdlib_Printf[4].call(null, p), D, C);
       return Stdlib_Buffer[16].call(null, buf, E);
      case 26:
       var
        m$0 = param[1],
        F = Stdlib_List[1].call(null, m$0[3]),
        G = m$0[2],
        H = caml_call2(Stdlib_Printf[4].call(null, q), G, F);
       return Stdlib_Buffer[16].call(null, buf, H);
      case 27:
       var r$0 = param[1];
       Stdlib_Buffer[16].call(null, buf, "<record:");
       Stdlib_Buffer[16].call(null, buf, r$0[1][1]);
       Stdlib_Array[13].call
        (null,
         function(i, v){
          Stdlib_Buffer[12].call(null, buf, 32);
          var a = caml_check_bound(r$0[1][3], i)[i + 1];
          Stdlib_Buffer[16].call(null, buf, a);
          Stdlib_Buffer[12].call(null, buf, 61);
          return inspect_into(buf, v);
         },
         r$0[2]);
       return Stdlib_Buffer[12].call(null, buf, 62);
      case 28:
       var p$0 = param[1];
       Stdlib_Buffer[16].call(null, buf, "<parameter:");
       Stdlib_Buffer[16].call(null, buf, p$0[1]);
       return Stdlib_Buffer[12].call(null, buf, 62);
      case 29:
       var arr = param[1];
       Stdlib_Buffer[16].call(null, buf, "#(");
       Stdlib_Array[13].call
        (null,
         function(i, v){
          if(0 < i) Stdlib_Buffer[12].call(null, buf, 32);
          return inspect_into(buf, v);
         },
         arr);
       return Stdlib_Buffer[12].call(null, buf, 41);
      case 30:
       var
        b = param[1],
        I = Stdlib_Buffer[7].call(null, b),
        J = caml_call1(Stdlib_Printf[4].call(null, r), I);
       return Stdlib_Buffer[16].call(null, buf, J);
      case 31:
       var
        ht = param[1],
        K = Stdlib_Hashtbl[15].call(null, ht),
        L = caml_call1(Stdlib_Printf[4].call(null, s), K);
       return Stdlib_Buffer[16].call(null, buf, L);
      case 32:
       var n$5 = param[1];
       Stdlib_Buffer[16].call(null, buf, "#\\");
       if(33 <= n$5){
        if(127 === n$5) return Stdlib_Buffer[16].call(null, buf, "delete");
       }
       else if(0 <= n$5)
        switch(n$5){
          case 0:
           return Stdlib_Buffer[16].call(null, buf, "nul");
          case 8:
           return Stdlib_Buffer[16].call(null, buf, "backspace");
          case 9:
           return Stdlib_Buffer[16].call(null, buf, "tab");
          case 10:
           return Stdlib_Buffer[16].call(null, buf, "newline");
          case 13:
           return Stdlib_Buffer[16].call(null, buf, "return");
          case 27:
           return Stdlib_Buffer[16].call(null, buf, "escape");
          case 32:
           return Stdlib_Buffer[16].call(null, buf, "space");
        }
       var M = Stdlib_Uchar[8].call(null, n$5);
       return Stdlib_Buffer[13].call(null, buf, M);
      case 33:
       var
        e = param[1],
        sp_closed = e[1],
        match$2 = e[2],
        cst_closed = ":closed";
       if(0 === match$2[0]){
        var
         pos = match$2[2],
         N = sp_closed ? cst_closed : cst,
         O = pos[1],
         P = caml_call2(Stdlib_Printf[4].call(null, t), O, N);
        return Stdlib_Buffer[16].call(null, buf, P);
       }
       var
        b$0 = match$2[1],
        Q = sp_closed ? cst_closed : cst,
        R = Stdlib_Buffer[7].call(null, b$0),
        S = caml_call2(Stdlib_Printf[4].call(null, u), R, Q);
       return Stdlib_Buffer[16].call(null, buf, S);
      case 34:
       var d$0 = param[2], n$6 = param[1], T = Stdlib[33].call(null, n$6);
       Stdlib_Buffer[16].call(null, buf, T);
       Stdlib_Buffer[12].call(null, buf, 47);
       var U = Stdlib[33].call(null, d$0);
       return Stdlib_Buffer[16].call(null, buf, U);
      case 35:
       var
        ht$0 = param[1],
        V = Stdlib_Hashtbl[15].call(null, ht$0),
        W = caml_call1(Stdlib_Printf[4].call(null, v), V);
       return Stdlib_Buffer[16].call(null, buf, W);
      case 36:
       var flags = param[2], src = param[1];
       Stdlib_Buffer[16].call(null, buf, "#/");
       Stdlib_Buffer[16].call(null, buf, src);
       Stdlib_Buffer[12].call(null, buf, 47);
       return Stdlib_Buffer[16].call(null, buf, flags);
      case 37:
       var b$1 = param[1];
       Stdlib_Buffer[16].call(null, buf, "#u8(");
       var n$7 = runtime.caml_ml_bytes_length(b$1), g = n$7 - 1 | 0;
       if(g >= 0){
        var i$0 = 0;
        for(;;){
         if(0 < i$0) Stdlib_Buffer[12].call(null, buf, 32);
         var
          X = runtime.caml_bytes_get(b$1, i$0),
          Y = Stdlib[33].call(null, X);
         Stdlib_Buffer[16].call(null, buf, Y);
         var Z = i$0 + 1 | 0;
         if(g === i$0) break;
         i$0 = Z;
        }
       }
       return Stdlib_Buffer[12].call(null, buf, 41);
      default:
       var a = param[1];
       Stdlib_Buffer[12].call(null, buf, 40);
       Stdlib_Buffer[16].call(null, buf, a[2]);
       Stdlib_Array[12].call
        (null,
         function(v){
          Stdlib_Buffer[12].call(null, buf, 32);
          return inspect_into(buf, v);
         },
         a[3]);
       return Stdlib_Buffer[12].call(null, buf, 41);
    }
    Stdlib_Buffer[12].call(null, buf, 40);
    if(items){
     var rest = items[2], x = items[1];
     inspect_into(buf, x);
     Stdlib_List[18].call
      (null,
       function(v){
        Stdlib_Buffer[12].call(null, buf, 32);
        return inspect_into(buf, v);
       },
       rest);
    }
    return Stdlib_Buffer[12].call(null, buf, 41);
   }
   function inspect(v){
    var buf = Stdlib_Buffer[1].call(null, 64);
    inspect_into(buf, v);
    return Stdlib_Buffer[2].call(null, buf);
   }
   runtime.caml_register_global
    (179,
     [0,
      sym_to_id,
      id_to_sym,
      sym_next,
      intern,
      unintern,
      vm_call_closure_ref,
      cek_call_ref,
      cek_eval_lambda_ref,
      Eval_error,
      Parse_error,
      CekPerformRequest,
      [0, 0],
      [0, 0],
      default_vm_globals,
      convert_vm_suspension,
      vm_suspension_to_dict,
      rtd_table,
      rtd_counter,
      [0, 0],
      make_env,
      env_extend,
      env_bind_hook,
      [0, 0],
      [0, 0],
      symbol_resolve_hook,
      env_bind,
      env_has_id,
      env_has,
      env_get_id,
      env_get,
      env_set_id,
      env_set,
      env_merge,
      format_number,
      value_to_string,
      value_to_string_list,
      value_to_bool,
      value_to_string_opt,
      unwrap_env_val,
      lambda_uid_counter,
      next_lambda_uid,
      make_lambda,
      [0, 4],
      [0, 0],
      [0, 0],
      [0, 0],
      jit_excluded,
      jit_excluded_prefixes,
      jit_name_excluded,
      jit_excluded_caller_names,
      [0, 5000],
      [0, 0],
      jit_cache_queue,
      jit_cache_size,
      make_component,
      make_island,
      make_macro,
      make_thunk,
      make_symbol,
      make_keyword,
      type_of,
      is_nil,
      is_lambda,
      is_component,
      is_island,
      is_macro,
      is_thunk,
      is_signal,
      is_record,
      is_callable,
      sx_truthy,
      symbol_name,
      keyword_name,
      lambda_params,
      lambda_body,
      lambda_closure,
      lambda_name,
      set_lambda_name,
      component_name,
      component_file,
      component_set_file,
      component_set_file,
      component_params,
      component_body,
      component_closure,
      component_has_children,
      component_affinity,
      macro_params,
      macro_rest_param,
      macro_body,
      macro_closure,
      thunk_expr,
      thunk_env,
      val_to_int,
      make_rtd,
      make_record,
      record_ref,
      record_set_b,
      record_type_p,
      record_p,
      make_record_constructor,
      make_record_predicate,
      make_record_accessor,
      make_record_mutator,
      parameter_p,
      parameter_uid,
      parameter_default,
      parameter_converter,
      make_dict,
      dict_get,
      dict_has,
      dict_set,
      dict_delete,
      dict_keys,
      dict_vals,
      inspect_into,
      inspect],
     "Sx_types");
   return;
  }
  (globalThis));

//# 1532 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_cbor:[N,F(3),F(2)*,F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    global_data = runtime.caml_get_global_data(),
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib_List = global_data.Stdlib__List,
    Sx_types = global_data.Sx_types,
    Stdlib = global_data.Stdlib,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Int64 = global_data.Stdlib__Int64,
    Cbor_error = [248, "Sx_cbor.Cbor_error", runtime.caml_fresh_oo_id(0)],
    a = caml_int64_create_lo_mi_hi(255, 0, 0),
    b = caml_int64_create_lo_mi_hi(0, 256, 0);
   function write_head(buf, major, v){
    var m = major << 5, v64 = runtime.caml_int64_of_int32(v);
    function put_be(nbytes){
     var b = nbytes - 1 | 0;
     if(b >= 0){
      var i = b;
      for(;;){
       var
        c =
          Stdlib_Char[1].call
           (null,
            runtime.caml_int64_to_int32
             (runtime.caml_int64_and
               (runtime.caml_int64_shift_right_unsigned(v64, 8 * i | 0), a)));
       Stdlib_Buffer[12].call(null, buf, c);
       var d = i - 1 | 0;
       if(0 === i) break;
       i = d;
      }
     }
     return 0;
    }
    if(24 > v){
     var g = Stdlib_Char[1].call(null, m | v);
     return Stdlib_Buffer[12].call(null, buf, g);
    }
    if(256 > v){
     var f = Stdlib_Char[1].call(null, m | 24);
     Stdlib_Buffer[12].call(null, buf, f);
     return put_be(1);
    }
    if(65536 > v){
     var e = Stdlib_Char[1].call(null, m | 25);
     Stdlib_Buffer[12].call(null, buf, e);
     return put_be(2);
    }
    if(0 <= Stdlib_Int64[15].call(null, v64, b)){
     var c = Stdlib_Char[1].call(null, m | 27);
     Stdlib_Buffer[12].call(null, buf, c);
     return put_be(8);
    }
    var d = Stdlib_Char[1].call(null, m | 26);
    Stdlib_Buffer[12].call(null, buf, d);
    return put_be(4);
   }
   function key_order(a, b){
    var la = caml_ml_string_length(a), lb = caml_ml_string_length(b);
    return la !== lb
            ? runtime.caml_int_compare(la, lb)
            : runtime.caml_string_compare(a, b);
   }
   function encode_into(buf, v){
    if(typeof v === "number"){
     if(0 === v) return Stdlib_Buffer[12].call(null, buf, 246);
    }
    else
     switch(v[0]){
       case 0:
        return v[1]
                ? Stdlib_Buffer[12].call(null, buf, 245)
                : Stdlib_Buffer[12].call(null, buf, 244);
       case 1:
        var n = v[1];
        return 0 <= n ? write_head(buf, 0, n) : write_head(buf, 1, -1 - n | 0);
       case 2:
        throw caml_maybe_attach_backtrace
               ([0,
                 Cbor_error,
                 "cbor-encode: floats unsupported (dag-cbor subset)"],
                1);
       case 3:
        var s = v[1];
        write_head(buf, 3, caml_ml_string_length(s));
        return Stdlib_Buffer[16].call(null, buf, s);
       case 6:
        var items = v[1];
        write_head(buf, 4, Stdlib_List[1].call(null, items));
        return Stdlib_List[18].call
                (null, function(a){return encode_into(buf, a);}, items);
       case 7:
        var
         d = v[1],
         keys =
           Stdlib_Hashtbl[14].call
            (null, function(k, param, acc){return [0, k, acc];}, d, 0),
         keys$0 = Stdlib_List[62].call(null, key_order, keys);
        write_head(buf, 5, Stdlib_List[1].call(null, keys$0));
        return Stdlib_List[18].call
                (null,
                 function(k){
                  write_head(buf, 3, caml_ml_string_length(k));
                  Stdlib_Buffer[16].call(null, buf, k);
                  return encode_into(buf, Stdlib_Hashtbl[6].call(null, d, k));
                 },
                 keys$0);
       case 4:
       case 5:
        var s$0 = v[1];
        write_head(buf, 3, caml_ml_string_length(s$0));
        return Stdlib_Buffer[16].call(null, buf, s$0);
     }
    var a = Sx_types[61].call(null, v);
    throw caml_maybe_attach_backtrace
           ([0,
             Cbor_error,
             Stdlib[28].call(null, "cbor-encode: unencodable value ", a)],
            1);
   }
   function encode(v){
    var buf = Stdlib_Buffer[1].call(null, 64);
    encode_into(buf, v);
    return Stdlib_Buffer[2].call(null, buf);
   }
   var c = [0, 0], d = [0, 1];
   function decode(s){
    var
     len = caml_ml_string_length(s),
     cst_cbor_decode_truncated = "cbor-decode: truncated",
     pos = [0, 0];
    function byte(param){
     if(len <= pos[1])
      throw caml_maybe_attach_backtrace
             ([0, Cbor_error, cst_cbor_decode_truncated], 1);
     var c = runtime.caml_string_get(s, pos[1]);
     pos[1]++;
     return c;
    }
    function read_uint(ai){
     if(24 > ai) return ai;
     if(24 === ai) return byte(0);
     if(25 === ai){var a = byte(0), b = byte(0); return a << 8 | b;}
     if(26 === ai){
      var v$1 = 0, for$ = 0;
      for(;;){
       var v = v$1 << 8 | byte(0), c = for$ + 1 | 0;
       if(3 === for$) return v;
       v$1 = v;
       for$ = c;
      }
     }
     else{
      if(27 !== ai)
       throw caml_maybe_attach_backtrace
              ([0, Cbor_error, "cbor-decode: bad additional info"], 1);
      var v$2 = 0, for$0 = 0;
      for(;;){
       var v$0 = v$2 << 8 | byte(0), d = for$0 + 1 | 0;
       if(7 === for$0) return v$0;
       v$2 = v$0;
       for$0 = d;
      }
     }
    }
    function item(param){
     a:
     {
      b:
      for(;;){
       var b = byte(0), major = b >>> 5 | 0, ai = b & 31;
       if(7 < major >>> 0)
        throw caml_maybe_attach_backtrace
               ([0, Cbor_error, "cbor-decode: bad major type"], 1);
       switch(major){
         case 0:
          return [1, read_uint(ai)];
         case 1:
          return [1, -1 - read_uint(ai) | 0];
         case 4:
          break a;
         case 5:
          break b;
         case 6:
          read_uint(ai); break;
         case 7:
          var switcher = ai - 20 | 0;
          if(3 < switcher >>> 0)
           throw caml_maybe_attach_backtrace
                  ([0,
                    Cbor_error,
                    "cbor-decode: floats/simple unsupported (dag-cbor subset)"],
                   1);
          switch(switcher){
            case 0:
             return c;
            case 1:
             return d;
            default: return 0;
          }
         default:
          var n = read_uint(ai);
          if(len < (pos[1] + n | 0))
           throw caml_maybe_attach_backtrace
                  ([0, Cbor_error, cst_cbor_decode_truncated], 1);
          var r = Stdlib_String[16].call(null, s, pos[1], n);
          pos[1] = pos[1] + n | 0;
          return [3, r];
       }
      }
      var n$1 = read_uint(ai), d$0 = Sx_types[109].call(null, 0);
      if(n$1 >= 1){
       var for$ = 1;
       for(;;){
        var match = item(0);
        if(typeof match !== "number" && 3 === match[0]){
         var k = match[1], a = item(0);
         Stdlib_Hashtbl[11].call(null, d$0, k, a);
         var e = for$ + 1 | 0;
         if(n$1 === for$) break;
         for$ = e;
         continue;
        }
        throw caml_maybe_attach_backtrace
               ([0, Cbor_error, "cbor-decode: non-string map key"], 1);
       }
      }
      return [7, d$0];
     }
     var n$0 = read_uint(ai);
     return [6,
             Stdlib_List[11].call(null, n$0, function(param){return item(0);})];
    }
    var v = item(0);
    return v;
   }
   runtime.caml_register_global
    (21,
     [0, Cbor_error, write_head, key_order, encode_into, encode, decode],
     "Sx_cbor");
   return;
  }
  (globalThis));

//# 1787 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_sha2:[N,F(2)*,F(1),N,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*,F(2)*,F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_get = runtime.caml_bytes_get,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_check_bound = runtime.caml_check_bound,
    caml_int64_add = runtime.caml_int64_add,
    caml_int64_and = runtime.caml_int64_and,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_int64_mul = runtime.caml_int64_mul,
    caml_int64_of_int32 = runtime.caml_int64_of_int32,
    caml_int64_or = runtime.caml_int64_or,
    caml_int64_shift_left = runtime.caml_int64_shift_left,
    caml_int64_shift_right_unsigne = runtime.caml_int64_shift_right_unsigned,
    caml_int64_to_int32 = runtime.caml_int64_to_int32,
    caml_int64_xor = runtime.caml_int64_xor,
    caml_make_vect = runtime.caml_make_vect,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_obj_dup = runtime.caml_obj_dup;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_Int32 = global_data.Stdlib__Int32,
    Stdlib_Int64 = global_data.Stdlib__Int64,
    k256 =
      caml_obj_dup
       ([0,
         1116352408,
         1899447441,
         -1245643825,
         -373957723,
         961987163,
         1508970993,
         -1841331548,
         -1424204075,
         -670586216,
         310598401,
         607225278,
         1426881987,
         1925078388,
         -2132889090,
         -1680079193,
         -1046744716,
         -459576895,
         -272742522,
         264347078,
         604807628,
         770255983,
         1249150122,
         1555081692,
         1996064986,
         -1740746414,
         -1473132947,
         -1341970488,
         -1084653625,
         -958395405,
         -710438585,
         113926993,
         338241895,
         666307205,
         773529912,
         1294757372,
         1396182291,
         1695183700,
         1986661051,
         -2117940946,
         -1838011259,
         -1564481375,
         -1474664885,
         -1035236496,
         -949202525,
         -778901479,
         -694614492,
         -200395387,
         275423344,
         430227734,
         506948616,
         659060556,
         883997877,
         958139571,
         1322822218,
         1537002063,
         1747873779,
         1955562222,
         2024104815,
         -2067236844,
         -1933114872,
         -1866530822,
         -1538233109,
         -1090935817,
         -965641998]),
    b = caml_int64_create_lo_mi_hi(8, 0, 0),
    d = caml_int64_create_lo_mi_hi(255, 0, 0);
   function rotr32(x, n){return x >>> n | 0 | x << (32 - n | 0);}
   var
    a =
      [0,
       1779033703,
       -1150833019,
       1013904242,
       -1521486534,
       1359893119,
       -1694144372,
       528734635,
       1541459225],
    c = [0, [5, 6, [0, 2, 8], 0, 0], "%08lx"];
   function sha256_hex(msg){
    var
     h = caml_obj_dup(a),
     len = caml_ml_string_length(msg),
     bitlen = caml_int64_mul(caml_int64_of_int32(len), b),
     r = (len + 1 | 0) % 64 | 0,
     padlen = 56 < r ? 120 - r | 0 : 56 - r | 0,
     total = ((len + 1 | 0) + padlen | 0) + 8 | 0,
     buf = Stdlib_Bytes[1].call(null, total, 0);
    Stdlib_Bytes[12].call(null, msg, 0, buf, 0, len);
    caml_bytes_set(buf, len, 128);
    var i = 0;
    for(;;){
     caml_bytes_set
      (buf,
       (total - 1 | 0) - i | 0,
       Stdlib_Char[1].call
        (null,
         caml_int64_to_int32
          (caml_int64_and
            (caml_int64_shift_right_unsigne(bitlen, 8 * i | 0), d))));
     var V = i + 1 | 0;
     if(7 === i) break;
     i = V;
    }
    function byte(i){return caml_bytes_get(buf, i);}
    var
     w = caml_make_vect(64, 0),
     nblocks = total / 64 | 0,
     g = nblocks - 1 | 0;
    if(g >= 0){
     var b$0 = 0;
     for(;;){
      var base = b$0 * 64 | 0, t$1 = 0;
      for(;;){
       var
        o = base + (t$1 * 4 | 0) | 0,
        Q = byte(o + 3 | 0),
        R = byte(o + 2 | 0) << 8 | Q,
        S = byte(o + 1 | 0) << 16,
        T = byte(o) << 24 | S | R;
       caml_check_bound(w, t$1)[t$1 + 1] = T;
       var U = t$1 + 1 | 0;
       if(15 === t$1) break;
       t$1 = U;
      }
      var t$0 = 16;
      for(;;){
       var
        j = t$0 - 15 | 0,
        k = t$0 - 15 | 0,
        J = caml_check_bound(w, j)[j + 1] >>> 3 | 0,
        l = t$0 - 15 | 0,
        K = rotr32(caml_check_bound(w, k)[k + 1], 18),
        s0$0 = rotr32(caml_check_bound(w, l)[l + 1], 7) ^ K ^ J,
        m = t$0 - 2 | 0,
        n = t$0 - 2 | 0,
        L = caml_check_bound(w, m)[m + 1] >>> 10 | 0,
        p = t$0 - 2 | 0,
        M = rotr32(caml_check_bound(w, n)[n + 1], 19),
        s1$0 = rotr32(caml_check_bound(w, p)[p + 1], 17) ^ M ^ L,
        q = t$0 - 7 | 0,
        s = t$0 - 16 | 0,
        N = caml_check_bound(w, q)[q + 1] + s1$0 | 0,
        O = (caml_check_bound(w, s)[s + 1] + s0$0 | 0) + N | 0;
       caml_check_bound(w, t$0)[t$0 + 1] = O;
       var P = t$0 + 1 | 0;
       if(63 === t$0) break;
       t$0 = P;
      }
      var
       u = caml_check_bound(h, 0)[1],
       v = caml_check_bound(h, 1)[2],
       x = caml_check_bound(h, 2)[3],
       y = caml_check_bound(h, 3)[4],
       z = caml_check_bound(h, 4)[5],
       A = caml_check_bound(h, 5)[6],
       B = caml_check_bound(h, 6)[7],
       hh$0 = caml_check_bound(h, 7)[8],
       hh = B,
       f = A,
       e$0 = z,
       d$0 = y,
       c$0 = x,
       bb$0 = v,
       bb = u,
       t = 0;
      for(;;){
       var
        D = rotr32(e$0, 25),
        E = rotr32(e$0, 11),
        s1 = rotr32(e$0, 6) ^ E ^ D,
        ch = e$0 & f ^ Stdlib_Int32[11].call(null, e$0) & hh,
        F = caml_check_bound(w, t)[t + 1],
        t1 =
          ((hh$0 + s1 | 0) + (ch + caml_check_bound(k256, t)[t + 1] | 0) | 0)
          + F
          | 0,
        G = rotr32(bb, 22),
        H = rotr32(bb, 13),
        s0 = rotr32(bb, 2) ^ H ^ G,
        maj = bb & bb$0 ^ bb & c$0 ^ bb$0 & c$0,
        t2 = s0 + maj | 0,
        e = d$0 + t1 | 0,
        a$0 = t1 + t2 | 0,
        I = t + 1 | 0;
       if(63 === t) break;
       hh$0 = hh;
       hh = f;
       f = e$0;
       e$0 = e;
       d$0 = c$0;
       c$0 = bb$0;
       bb$0 = bb;
       bb = a$0;
       t = I;
      }
      h[1] = caml_check_bound(h, 0)[1] + a$0 | 0;
      h[2] = caml_check_bound(h, 1)[2] + bb | 0;
      h[3] = caml_check_bound(h, 2)[3] + bb$0 | 0;
      h[4] = caml_check_bound(h, 3)[4] + c$0 | 0;
      h[5] = caml_check_bound(h, 4)[5] + e | 0;
      h[6] = caml_check_bound(h, 5)[6] + e$0 | 0;
      h[7] = caml_check_bound(h, 6)[7] + f | 0;
      h[8] = caml_check_bound(h, 7)[8] + hh | 0;
      var C = b$0 + 1 | 0;
      if(g === b$0) break;
      b$0 = C;
     }
    }
    var out = Stdlib_Buffer[1].call(null, 64);
    Stdlib_Array[12].call
     (null,
      function(x){
       var a = caml_call1(Stdlib_Printf[4].call(null, c), x);
       return Stdlib_Buffer[16].call(null, out, a);
      },
      h);
    return Stdlib_Buffer[2].call(null, out);
   }
   var
    k512 =
      caml_obj_dup
       ([0,
         caml_int64_create_lo_mi_hi(2666018, 3119319, 17034),
         caml_int64_create_lo_mi_hi(15689165, 4493603, 28983),
         caml_int64_create_lo_mi_hi(5061423, 16502764, 46528),
         caml_int64_create_lo_mi_hi(9034684, 14394753, 59829),
         caml_int64_create_lo_mi_hi(4764984, 12737523, 14678),
         caml_int64_create_lo_mi_hi(380953, 1175990, 23025),
         caml_int64_create_lo_mi_hi(1658779, 8561839, 37439),
         caml_int64_create_lo_mi_hi(7176472, 6215130, 43804),
         caml_int64_create_lo_mi_hi(197186, 11180195, 55303),
         caml_int64_create_lo_mi_hi(7368638, 5964101, 4739),
         caml_int64_create_lo_mi_hi(14987916, 8765006, 9265),
         caml_int64_create_lo_mi_hi(16757986, 8242133, 21772),
         caml_int64_create_lo_mi_hi(8096111, 6124786, 29374),
         caml_int64_create_lo_mi_hi(1480369, 11664955, 32990),
         caml_int64_create_lo_mi_hi(13046325, 436005, 39900),
         caml_int64_create_lo_mi_hi(6891156, 15824079, 49563),
         caml_int64_create_lo_mi_hi(15813330, 6930846, 58523),
         caml_int64_create_lo_mi_hi(5187043, 4687416, 61374),
         caml_int64_create_lo_mi_hi(9229749, 10339979, 4033),
         caml_int64_create_lo_mi_hi(11312229, 10603639, 9228),
         caml_int64_create_lo_mi_hi(2818677, 2912089, 11753),
         caml_int64_create_lo_mi_hi(10937475, 8694382, 19060),
         caml_int64_create_lo_mi_hi(4324308, 11132093, 23728),
         caml_int64_create_lo_mi_hi(1135541, 8968835, 30457),
         caml_int64_create_lo_mi_hi(6741931, 5329646, 38974),
         caml_int64_create_lo_mi_hi(11809296, 13004077, 43057),
         caml_int64_create_lo_mi_hi(16458047, 2607256, 45059),
         caml_int64_create_lo_mi_hi(15666916, 8374206, 48985),
         caml_int64_create_lo_mi_hi(11046850, 783165, 50912),
         caml_int64_create_lo_mi_hi(698149, 9521043, 54695),
         caml_int64_create_lo_mi_hi(229999, 6509024, 1738),
         caml_int64_create_lo_mi_hi(945776, 2713354, 5161),
         caml_int64_create_lo_mi_hi(13774844, 689478, 10167),
         caml_int64_create_lo_mi_hi(2541862, 2177116, 11803),
         caml_int64_create_lo_mi_hi(12856045, 7208026, 19756),
         caml_int64_create_lo_mi_hi(9810911, 856989, 21304),
         caml_int64_create_lo_mi_hi(11494366, 7558283, 25866),
         caml_int64_create_lo_mi_hi(7844520, 703292, 30314),
         caml_int64_create_lo_mi_hi(15576806, 13184583, 33218),
         caml_int64_create_lo_mi_hi(8533307, 2917652, 37490),
         caml_int64_create_lo_mi_hi(15795044, 15245644, 41663),
         caml_int64_create_lo_mi_hi(4337665, 6704060, 43034),
         caml_int64_create_lo_mi_hi(16291729, 9138384, 49739),
         caml_int64_create_lo_mi_hi(5553712, 5350150, 51052),
         caml_int64_create_lo_mi_hi(15684120, 15210966, 53650),
         caml_int64_create_lo_mi_hi(6662416, 402517, 54937),
         caml_int64_create_lo_mi_hi(7413802, 3507543, 62478),
         caml_int64_create_lo_mi_hi(12308920, 10514482, 4202),
         caml_int64_create_lo_mi_hi(13816008, 12654264, 6564),
         caml_int64_create_lo_mi_hi(4303699, 7080017, 7735),
         caml_int64_create_lo_mi_hi(9366425, 7818463, 10056),
         caml_int64_create_lo_mi_hi(10176680, 12367329, 13488),
         caml_int64_create_lo_mi_hi(13195875, 832453, 14620),
         caml_int64_create_lo_mi_hi(4295371, 11160291, 20184),
         caml_int64_create_lo_mi_hi(6546291, 13258615, 23452),
         caml_int64_create_lo_mi_hi(11712675, 7336918, 26670),
         caml_int64_create_lo_mi_hi(15708924, 8580701, 29839),
         caml_int64_create_lo_mi_hi(1519456, 6516547, 30885),
         caml_int64_create_lo_mi_hi(15772530, 7869601, 33992),
         caml_int64_create_lo_mi_hi(6568428, 133146, 36039),
         caml_int64_create_lo_mi_hi(6495784, 16775715, 37054),
         caml_int64_create_lo_mi_hi(8568297, 7138270, 42064),
         caml_int64_create_lo_mi_hi(13007125, 10745778, 48889),
         caml_int64_create_lo_mi_hi(7492395, 7926499, 50801),
         caml_int64_create_lo_mi_hi(2515356, 4116202, 51751),
         caml_int64_create_lo_mi_hi(12632583, 12109601, 53638),
         caml_int64_create_lo_mi_hi(14740254, 8246989, 60122),
         caml_int64_create_lo_mi_hi(7262584, 5210094, 62845),
         caml_int64_create_lo_mi_hi(1535930, 6793842, 1776),
         caml_int64_create_lo_mi_hi(13146278, 8242594, 2659),
         caml_int64_create_lo_mi_hi(16321966, 9962686, 4415),
         caml_int64_create_lo_mi_hi(1853211, 734483, 7025),
         caml_int64_create_lo_mi_hi(294276, 7861539, 10459),
         caml_int64_create_lo_mi_hi(13051027, 11238208, 13002),
         caml_int64_create_lo_mi_hi(13221564, 12454421, 15518),
         caml_int64_create_lo_mi_hi(1051980, 6800540, 17181),
         caml_int64_create_lo_mi_hi(4080310, 13942475, 19653),
         caml_int64_create_lo_mi_hi(6651434, 2727164, 22911),
         caml_int64_create_lo_mi_hi(14088940, 7318330, 24523),
         caml_int64_create_lo_mi_hi(4675607, 1674314, 27716)]),
    lnot64 = Stdlib_Int64[11],
    e =
      [0,
       caml_int64_create_lo_mi_hi(12372232, 15099891, 27145),
       caml_int64_create_lo_mi_hi(13281083, 11437444, 47975),
       caml_int64_create_lo_mi_hi(9762859, 15954686, 15470),
       caml_int64_create_lo_mi_hi(1914609, 16071263, 42319),
       caml_int64_create_lo_mi_hi(15106769, 5406637, 20750),
       caml_int64_create_lo_mi_hi(4090911, 6851627, 39685),
       caml_int64_create_lo_mi_hi(4308331, 14265339, 8067),
       caml_int64_create_lo_mi_hi(8266105, 13441299, 23520)],
    f = caml_int64_create_lo_mi_hi(8, 0, 0),
    g = caml_int64_create_lo_mi_hi(0, 0, 0),
    i = caml_int64_create_lo_mi_hi(0, 0, 0),
    j = caml_int64_create_lo_mi_hi(255, 0, 0);
   function rotr64(x, n){
    return caml_int64_or
            (caml_int64_shift_right_unsigne(x, n),
             caml_int64_shift_left(x, 64 - n | 0));
   }
   var h = [0, [7, 6, [0, 2, 16], 0, 0], "%016Lx"];
   function sha512_hex(msg){
    var
     h$0 = caml_obj_dup(e),
     len = caml_ml_string_length(msg),
     bitlen = caml_int64_mul(caml_int64_of_int32(len), f),
     r = (len + 1 | 0) % 128 | 0,
     padlen = 112 < r ? 240 - r | 0 : 112 - r | 0,
     total = ((len + 1 | 0) + padlen | 0) + 16 | 0,
     buf = Stdlib_Bytes[1].call(null, total, 0);
    Stdlib_Bytes[12].call(null, msg, 0, buf, 0, len);
    caml_bytes_set(buf, len, 128);
    var i$0 = 0;
    for(;;){
     caml_bytes_set
      (buf,
       (total - 1 | 0) - i$0 | 0,
       Stdlib_Char[1].call
        (null,
         caml_int64_to_int32
          (caml_int64_and
            (caml_int64_shift_right_unsigne(bitlen, 8 * i$0 | 0), j))));
     var Q = i$0 + 1 | 0;
     if(7 === i$0) break;
     i$0 = Q;
    }
    var
     w = caml_make_vect(80, g),
     nblocks = total / 128 | 0,
     k = nblocks - 1 | 0;
    if(k >= 0){
     var b = 0;
     for(;;){
      var base = b * 128 | 0, t$1 = 0;
      for(;;){
       var o = base + (t$1 * 8 | 0) | 0, v$0 = i, j$0 = 0;
       for(;;){
        var
         v =
           caml_int64_or
            (caml_int64_shift_left(v$0, 8),
             caml_int64_of_int32(caml_bytes_get(buf, o + j$0 | 0))),
         P = j$0 + 1 | 0;
        if(7 === j$0) break;
        v$0 = v;
        j$0 = P;
       }
       caml_check_bound(w, t$1)[t$1 + 1] = v;
       var O = t$1 + 1 | 0;
       if(15 === t$1) break;
       t$1 = O;
      }
      var t$0 = 16;
      for(;;){
       var
        l = t$0 - 15 | 0,
        m = t$0 - 15 | 0,
        K = caml_int64_shift_right_unsigne(caml_check_bound(w, l)[l + 1], 7),
        n = t$0 - 15 | 0,
        V = caml_int64_xor(rotr64(caml_check_bound(w, m)[m + 1], 8), K),
        s0$0 = caml_int64_xor(rotr64(caml_check_bound(w, n)[n + 1], 1), V),
        p = t$0 - 2 | 0,
        q = t$0 - 2 | 0,
        L = caml_int64_shift_right_unsigne(caml_check_bound(w, p)[p + 1], 6),
        s = t$0 - 2 | 0,
        U = caml_int64_xor(rotr64(caml_check_bound(w, q)[q + 1], 61), L),
        s1$0 = caml_int64_xor(rotr64(caml_check_bound(w, s)[s + 1], 19), U),
        u = t$0 - 7 | 0,
        x = t$0 - 16 | 0,
        M = caml_check_bound(w, u)[u + 1],
        T =
          caml_int64_add
           (caml_int64_add
             (caml_int64_add(caml_check_bound(w, x)[x + 1], s0$0), M),
            s1$0);
       caml_check_bound(w, t$0)[t$0 + 1] = T;
       var N = t$0 + 1 | 0;
       if(79 === t$0) break;
       t$0 = N;
      }
      var
       y = caml_check_bound(h$0, 0)[1],
       z = caml_check_bound(h$0, 1)[2],
       A = caml_check_bound(h$0, 2)[3],
       B = caml_check_bound(h$0, 3)[4],
       C = caml_check_bound(h$0, 4)[5],
       D = caml_check_bound(h$0, 5)[6],
       E = caml_check_bound(h$0, 6)[7],
       hh$0 = caml_check_bound(h$0, 7)[8],
       hh = E,
       f$0 = D,
       e$1 = C,
       d = B,
       c = A,
       bb$0 = z,
       bb = y,
       t = 0;
      for(;;){
       var
        G = rotr64(e$1, 41),
        S = caml_int64_xor(rotr64(e$1, 18), G),
        s1 = caml_int64_xor(rotr64(e$1, 14), S),
        ch =
          caml_int64_xor
           (caml_int64_and(e$1, f$0), caml_int64_and(lnot64(e$1), hh)),
        H = caml_check_bound(w, t)[t + 1],
        t1 =
          caml_int64_add
           (caml_int64_add
             (caml_int64_add(caml_int64_add(hh$0, s1), ch),
              caml_check_bound(k512, t)[t + 1]),
            H),
        I = rotr64(bb, 39),
        R = caml_int64_xor(rotr64(bb, 34), I),
        s0 = caml_int64_xor(rotr64(bb, 28), R),
        maj =
          caml_int64_xor
           (caml_int64_and(bb, bb$0),
            caml_int64_xor(caml_int64_and(bb, c), caml_int64_and(bb$0, c))),
        t2 = caml_int64_add(s0, maj),
        e$0 = caml_int64_add(d, t1),
        a = caml_int64_add(t1, t2),
        J = t + 1 | 0;
       if(79 === t) break;
       hh$0 = hh;
       hh = f$0;
       f$0 = e$1;
       e$1 = e$0;
       d = c;
       c = bb$0;
       bb$0 = bb;
       bb = a;
       t = J;
      }
      h$0[1] = caml_int64_add(caml_check_bound(h$0, 0)[1], a);
      h$0[2] = caml_int64_add(caml_check_bound(h$0, 1)[2], bb);
      h$0[3] = caml_int64_add(caml_check_bound(h$0, 2)[3], bb$0);
      h$0[4] = caml_int64_add(caml_check_bound(h$0, 3)[4], c);
      h$0[5] = caml_int64_add(caml_check_bound(h$0, 4)[5], e$0);
      h$0[6] = caml_int64_add(caml_check_bound(h$0, 5)[6], e$1);
      h$0[7] = caml_int64_add(caml_check_bound(h$0, 6)[7], f$0);
      h$0[8] = caml_int64_add(caml_check_bound(h$0, 7)[8], hh);
      var F = b + 1 | 0;
      if(k === b) break;
      b = F;
     }
    }
    var out = Stdlib_Buffer[1].call(null, 128);
    Stdlib_Array[12].call
     (null,
      function(x){
       var a = caml_call1(Stdlib_Printf[4].call(null, h), x);
       return Stdlib_Buffer[16].call(null, out, a);
      },
      h$0);
    return Stdlib_Buffer[2].call(null, out);
   }
   runtime.caml_register_global
    (20,
     [0,
      k256,
      rotr32,
      sha256_hex,
      k512,
      caml_int64_and,
      caml_int64_or,
      caml_int64_xor,
      caml_int64_add,
      lnot64,
      rotr64,
      sha512_hex],
     "Sx_sha2");
   return;
  }
  (globalThis));

//# 2327 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_cid:[F(1),N,F(1),F(1),F(2),F(2),N,N,F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    global_data = runtime.caml_get_global_data(),
    Sx_cbor = global_data.Sx_cbor,
    Sx_sha2 = global_data.Sx_sha2,
    Stdlib = global_data.Stdlib,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Buffer = global_data.Stdlib__Buffer;
   function varint(n){
    var buf = Stdlib_Buffer[1].call(null, 4), cont = 1, n$1 = n;
    for(;;){
     if(! cont) return Stdlib_Buffer[2].call(null, buf);
     var b = n$1 & 127, n$0 = n$1 >>> 7 | 0;
     if(0 === n$0){
      var a = Stdlib_Char[1].call(null, b);
      Stdlib_Buffer[12].call(null, buf, a);
      cont = 0;
      n$1 = n$0;
     }
     else{
      var c = Stdlib_Char[1].call(null, b | 128);
      Stdlib_Buffer[12].call(null, buf, c);
      n$1 = n$0;
     }
    }
   }
   var cst_abcdefghijklmnopqrstuvwxyz = "abcdefghijklmnopqrstuvwxyz234567";
   function base32_lower(s){
    var
     buf =
       Stdlib_Buffer[1].call
        (null, ((caml_ml_string_length(s) * 8 | 0) + 4 | 0) / 5 | 0),
     acc = [0, 0],
     bits = [0, 0];
    Stdlib_String[30].call
     (null,
      function(c){
       acc[1] = acc[1] << 8 | c;
       bits[1] = bits[1] + 8 | 0;
       for(;;){
        if(5 > bits[1]){acc[1] = acc[1] & ((1 << bits[1]) - 1 | 0); return 0;}
        bits[1] = bits[1] - 5 | 0;
        var
         a =
           caml_string_get
            (cst_abcdefghijklmnopqrstuvwxyz, (acc[1] >>> bits[1] | 0) & 31);
        Stdlib_Buffer[12].call(null, buf, a);
       }
      },
      s);
    if(0 < bits[1]){
     var
      a =
        caml_string_get
         (cst_abcdefghijklmnopqrstuvwxyz, acc[1] << (5 - bits[1] | 0) & 31);
     Stdlib_Buffer[12].call(null, buf, a);
    }
    return Stdlib_Buffer[2].call(null, buf);
   }
   function unhex(h){
    var
     n = caml_ml_string_length(h) / 2 | 0,
     b = runtime.caml_create_bytes(n),
     a = n - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var
       c = Stdlib_String[16].call(null, h, 2 * i | 0, 2),
       d = runtime.caml_int_of_string(Stdlib[28].call(null, "0x", c));
      runtime.caml_bytes_set(b, i, Stdlib_Char[1].call(null, d));
      var e = i + 1 | 0;
      if(a === i) break;
      i = e;
     }
    }
    return Stdlib_Bytes[44].call(null, b);
   }
   function multihash(code, digest){
    var
     a = varint(caml_ml_string_length(digest)),
     b = Stdlib[28].call(null, a, digest),
     c = varint(code);
    return Stdlib[28].call(null, c, b);
   }
   function cidv1(codec, mh){
    var
     a = varint(codec),
     b = Stdlib[28].call(null, a, mh),
     c = base32_lower(Stdlib[28].call(null, "\x01", b));
    return Stdlib[28].call(null, "b", c);
   }
   var codec_dag_cbor = 113, mh_sha2_256 = 18;
   function cid_from_sx(v){
    var
     cbor = Sx_cbor[5].call(null, v),
     digest = unhex(Sx_sha2[3].call(null, cbor));
    return cidv1(codec_dag_cbor, multihash(mh_sha2_256, digest));
   }
   runtime.caml_register_global
    (11,
     [0,
      varint,
      cst_abcdefghijklmnopqrstuvwxyz,
      base32_lower,
      unhex,
      multihash,
      cidv1,
      codec_dag_cbor,
      mh_sha2_256,
      cid_from_sx],
     "Sx_cid");
   return;
  }
  (globalThis));

//# 2453 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_cst:[F(1),F(1),F(1),F(2),F(1),F(2),F(2),F(3)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    global_data = runtime.caml_get_global_data(),
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib = global_data.Stdlib,
    Stdlib_List = global_data.Stdlib__List,
    Sx_types = global_data.Sx_types,
    Stdlib_String = global_data.Stdlib__String;
   function trivia_to_string(ts){
    var buf = Stdlib_Buffer[1].call(null, 64);
    Stdlib_List[18].call
     (null,
      function(param){
       if(0 === param[0]){
        var s = param[1];
        return Stdlib_Buffer[16].call(null, buf, s);
       }
       var s$0 = param[1];
       return Stdlib_Buffer[16].call(null, buf, s$0);
      },
      ts);
    return Stdlib_Buffer[2].call(null, buf);
   }
   function cst_to_source(node){
    switch(node[0]){
      case 0:
       var
        token = node[2],
        leading_trivia = node[1],
        a = trivia_to_string(leading_trivia);
       return Stdlib[28].call(null, a, token);
      case 1:
       var
        trailing_trivia = node[5],
        close_delim = node[4],
        children = node[3],
        open_delim = node[2],
        leading_trivia$0 = node[1],
        buf = Stdlib_Buffer[1].call(null, 256),
        b = trivia_to_string(leading_trivia$0);
       Stdlib_Buffer[16].call(null, buf, b);
       Stdlib_Buffer[12].call(null, buf, open_delim);
       Stdlib_List[18].call
        (null,
         function(c){
          var a = cst_to_source(c);
          return Stdlib_Buffer[16].call(null, buf, a);
         },
         children);
       var c = trivia_to_string(trailing_trivia);
       Stdlib_Buffer[16].call(null, buf, c);
       Stdlib_Buffer[12].call(null, buf, close_delim);
       return Stdlib_Buffer[2].call(null, buf);
      default:
       var
        trailing_trivia$0 = node[3],
        children$0 = node[2],
        leading_trivia$1 = node[1],
        buf$0 = Stdlib_Buffer[1].call(null, 256),
        d = trivia_to_string(leading_trivia$1);
       Stdlib_Buffer[16].call(null, buf$0, d);
       Stdlib_Buffer[12].call(null, buf$0, 123);
       Stdlib_List[18].call
        (null,
         function(c){
          var a = cst_to_source(c);
          return Stdlib_Buffer[16].call(null, buf$0, a);
         },
         children$0);
       var e = trivia_to_string(trailing_trivia$0);
       Stdlib_Buffer[16].call(null, buf$0, e);
       Stdlib_Buffer[12].call(null, buf$0, 125);
       return Stdlib_Buffer[2].call(null, buf$0);
    }
   }
   var cst = "";
   function cst_to_source_file(nodes){
    var a = Stdlib_List[20].call(null, cst_to_source, nodes);
    return Stdlib_String[7].call(null, cst, a);
   }
   function cst_file_to_source(nodes, trailing){
    var a = trivia_to_string(trailing), b = cst_to_source_file(nodes);
    return Stdlib[28].call(null, b, a);
   }
   function cst_to_ast(param){
    switch(param[0]){
      case 0:
       var value = param[3]; return value;
      case 1:
       var children = param[3];
       return [6, Stdlib_List[20].call(null, cst_to_ast, children)];
      default:
       var
        children$0 = param[2],
        d = Sx_types[109].call(null, 0),
        param$0 = children$0;
       for(;;){
        if(param$0){
         var match = param$0[2];
         if(match){
          var
           rest = match[2],
           v = match[1],
           k = param$0[1],
           match$0 = cst_to_ast(k);
          if(typeof match$0 === "number" || ! (match$0[0] - 3 >>> 0 < 3))
           var key_str = cst;
          else
           var k$0 = match$0[1], key_str = k$0;
          var a = cst_to_ast(v);
          Sx_types[112].call(null, d, key_str, a);
          param$0 = rest;
          continue;
         }
        }
        return [7, d];
       }
    }
   }
   function offset_to_loc(src, offset){
    var
     c =
       Stdlib[16].call
        (null, offset - 1 | 0, runtime.caml_ml_string_length(src) - 1 | 0),
     a = 1,
     b = 0;
    if(c < 0)
     var col$1 = b, line$2 = a;
    else{
     var col = b, line = a, i = 0;
     for(;;){
      if(10 === runtime.caml_string_get(src, i))
       var line$0 = line + 1 | 0, col$0 = 0, line$1 = line$0;
      else
       var col$0 = col + 1 | 0, line$1 = line;
      var d = i + 1 | 0;
      if(c === i){var col$1 = col$0, line$2 = line$1; break;}
      col = col$0;
      line = line$1;
      i = d;
     }
    }
    return [0, line$2, col$1];
   }
   function cst_to_ast_loc(src, nodes){
    return Stdlib_List[20].call
            (null,
             function(node){
              if(1 === node[0])
               var span$1 = node[6], span$0 = span$1;
              else
               var span = node[4], span$0 = span;
              var
               value = cst_to_ast(node),
               match = offset_to_loc(src, span$0[1]),
               col = match[2],
               line = match[1],
               d = Sx_types[109].call(null, 0);
              Sx_types[112].call(null, d, "form", value);
              Sx_types[112].call(null, d, "line", [2, line]);
              Sx_types[112].call(null, d, "col", [2, col]);
              return [7, d];
             },
             nodes);
   }
   function apply_edit(path, new_cst_nodes, original_cst_nodes){
    function go(nodes, idx_path){
     if(! idx_path) return nodes;
     var target = idx_path[1];
     if(! idx_path[2])
      return Stdlib_List[21].call
              (null,
               function(i, node){
                if(i !== target) return node;
                if(new_cst_nodes && ! new_cst_nodes[2]){
                 var replacement = new_cst_nodes[1], leading_trivia = node[1];
                 switch(replacement[0]){
                   case 0:
                    return [0,
                            leading_trivia,
                            replacement[2],
                            replacement[3],
                            replacement[4]];
                   case 1:
                    return [1,
                            leading_trivia,
                            replacement[2],
                            replacement[3],
                            replacement[4],
                            replacement[5],
                            replacement[6]];
                   default:
                    return [2,
                            leading_trivia,
                            replacement[2],
                            replacement[3],
                            replacement[4]];
                 }
                }
                return node;
               },
               nodes);
     var rest = idx_path[2];
     return Stdlib_List[21].call
             (null,
              function(i, node){
               if(i === target)
                switch(node[0]){
                  case 0:
                   return node;
                  case 1:
                   var
                    a = node[6],
                    b = node[5],
                    c = node[4],
                    d = go(node[3], rest);
                   return [1, node[1], node[2], d, c, b, a];
                  default:
                   var e = node[4], f = node[3], g = go(node[2], rest);
                   return [2, node[1], g, f, e];
                }
               return node;
              },
              nodes);
    }
    return go(original_cst_nodes, path);
   }
   runtime.caml_register_global
    (10,
     [0,
      trivia_to_string,
      cst_to_source,
      cst_to_source_file,
      cst_file_to_source,
      cst_to_ast,
      offset_to_loc,
      cst_to_ast_loc,
      apply_edit],
     "Sx_cst");
   return;
  }
  (globalThis));

//# 2702 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_ed25519:[N,N,N,F(1),N,F(1),F(1),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(3),F(1),F(2),N,F(1),F(2),F(2),F(2),F(2),F(1),N,N,N,N,F(2),F(2),F(1),F(1),F(1),N,F(1),F(1),F(3)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_check_bound = runtime.caml_check_bound,
    caml_int64_add = runtime.caml_int64_add,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_int64_of_int32 = runtime.caml_int64_of_int32,
    caml_int64_to_int32 = runtime.caml_int64_to_int32,
    caml_int_compare = runtime.caml_int_compare,
    caml_make_vect = runtime.caml_make_vect,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    global_data = runtime.caml_get_global_data(),
    b = caml_int64_create_lo_mi_hi(0, 0, 0),
    Stdlib_String = global_data.Stdlib__String,
    Stdlib = global_data.Stdlib,
    Sx_sha2 = global_data.Sx_sha2,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_Array = global_data.Stdlib__Array;
   function norm(a){
    var n = a.length - 1;
    for(;;){
     if(1 < n){
      var b = n - 1 | 0;
      if(0 === caml_check_bound(a, b)[b + 1]){
       var n$0 = n - 1 | 0;
       n = n$0;
       continue;
      }
     }
     return n === a.length - 1 ? a : Stdlib_Array[6].call(null, a, 0, n);
    }
   }
   var c = caml_int64_create_lo_mi_hi(0, 0, 0), bzero = [0, 0];
   function of_int(n){
    if(0 === n) return bzero;
    var n$0 = n, r = 0;
    for(;;){
     if(0 >= n$0){
      var b = Stdlib_List[10].call(null, r);
      return norm(Stdlib_Array[11].call(null, b));
     }
     var a = [0, n$0 & 67108863, r];
     n$0 = n$0 >>> 26 | 0;
     r = a;
    }
   }
   function is_zero(a){
    var
     b = 1 === a.length - 1 ? 1 : 0,
     c = b ? 0 === caml_check_bound(a, 0)[1] ? 1 : 0 : b;
    return c;
   }
   function cmp(a, b){
    var
     a$0 = norm(a),
     b$0 = norm(b),
     la = a$0.length - 1,
     lb = b$0.length - 1;
    if(la !== lb) return caml_int_compare(la, lb);
    var i = la - 1 | 0, r = 0;
    for(;;){
     if(0 === r && 0 <= i){
      var c = caml_check_bound(b$0, i)[i + 1];
      if(caml_check_bound(a$0, i)[i + 1] !== c)
       var
        d = caml_check_bound(b$0, i)[i + 1],
        r$0 = caml_int_compare(caml_check_bound(a$0, i)[i + 1], d);
      else
       var r$0 = r;
      var i$0 = i - 1 | 0;
      i = i$0;
      r = r$0;
      continue;
     }
     return r;
    }
   }
   function add(a, b){
    var
     la = a.length - 1,
     lb = b.length - 1,
     n = Stdlib[17].call(null, la, lb) + 1 | 0,
     r = caml_make_vect(n, 0),
     c = n - 1 | 0;
    if(c >= 0){
     var carry = 0, i = 0;
     for(;;){
      var
       d = i < lb ? caml_check_bound(b, i)[i + 1] : 0,
       e = i < la ? caml_check_bound(a, i)[i + 1] : 0,
       s = (carry + e | 0) + d | 0;
      caml_check_bound(r, i)[i + 1] = s & 67108863;
      var f = s >>> 26 | 0, g = i + 1 | 0;
      if(c === i) break;
      carry = f;
      i = g;
     }
    }
    return norm(r);
   }
   function sub(a, b){
    var
     la = a.length - 1,
     lb = b.length - 1,
     r = caml_make_vect(la, 0),
     c = la - 1 | 0;
    if(c >= 0){
     var borrow = 0, i = 0;
     for(;;){
      var
       d = i < lb ? caml_check_bound(b, i)[i + 1] : 0,
       s = (caml_check_bound(a, i)[i + 1] - borrow | 0) - d | 0,
       borrow$0 =
         0 <= s
          ? (caml_check_bound(r, i)[i + 1] = s, 0)
          : (caml_check_bound(r, i)[i + 1] = s + 67108864 | 0, 1),
       e = i + 1 | 0;
      if(c === i) break;
      borrow = borrow$0;
      i = e;
     }
    }
    return norm(r);
   }
   function mul(a, b$0){
    var
     la = a.length - 1,
     lb = b$0.length - 1,
     r = caml_make_vect(la + lb | 0, 0),
     maskL = caml_int64_create_lo_mi_hi(16777215, 3, 0),
     c = la - 1 | 0;
    if(c >= 0){
     var i = 0;
     for(;;){
      var
       ai = caml_int64_of_int32(caml_check_bound(a, i)[i + 1]),
       d = lb - 1 | 0;
      if(d < 0)
       var carry$0 = b;
      else{
       var carry = b, j = 0;
       for(;;){
        var
         g = i + j | 0,
         n =
           runtime.caml_int64_mul
            (ai, caml_int64_of_int32(caml_check_bound(b$0, j)[j + 1])),
         s =
           caml_int64_add
            (caml_int64_add
              (caml_int64_of_int32(caml_check_bound(r, g)[g + 1]), n),
             carry),
         h = i + j | 0;
        caml_check_bound(r, h)[h + 1] =
         caml_int64_to_int32(runtime.caml_int64_and(s, maskL));
        var k = runtime.caml_int64_shift_right_unsigned(s, 26), o = j + 1 | 0;
        if(d === j){var carry$0 = k; break;}
        carry = k;
        j = o;
       }
      }
      var
       e = i + lb | 0,
       f = i + lb | 0,
       l = caml_check_bound(r, e)[e + 1] + caml_int64_to_int32(carry$0) | 0;
      caml_check_bound(r, f)[f + 1] = l;
      var m = i + 1 | 0;
      if(c === i) break;
      i = m;
     }
    }
    return norm(r);
   }
   function numbits(a){
    var a$0 = norm(a), hi = a$0.length - 2 | 0;
    if(0 === hi && 0 === caml_check_bound(a$0, 0)[1]) return 0;
    var v = caml_check_bound(a$0, hi)[hi + 1], b = 0;
    for(;;){
     if(0 >= v) return (hi * 26 | 0) + b | 0;
     var b$0 = b + 1 | 0;
     v = v >>> 1 | 0;
     b = b$0;
    }
   }
   function bit(a, i){
    var limb = i / 26 | 0, off = i % 26 | 0;
    return a.length - 1 <= limb
            ? 0
            : (caml_check_bound(a, limb)[limb + 1] >>> off | 0) & 1;
   }
   function bn_mod(a, m){
    if(0 > cmp(a, m)) return norm(a);
    var b = numbits(a) - 1 | 0;
    if(b < 0)
     var r$3 = bzero;
    else{
     var r$0 = bzero, i = b;
     for(;;){
      var
       r = add(r$0, r$0),
       r$1 = 1 === bit(a, i) ? add(r, [0, 1]) : r,
       r$2 = 0 <= cmp(r$1, m) ? sub(r$1, m) : r$1,
       c = i - 1 | 0;
      if(0 === i){var r$3 = r$2; break;}
      r$0 = r$2;
      i = c;
     }
    }
    return r$3;
   }
   function div_small(a, d){
    var
     la = a.length - 1,
     q = caml_make_vect(la, 0),
     dL = caml_int64_of_int32(d),
     b = la - 1 | 0;
    if(b >= 0){
     var rem = c, i = b;
     for(;;){
      var
       cur =
         runtime.caml_int64_or
          (runtime.caml_int64_shift_left(rem, 26),
           caml_int64_of_int32(caml_check_bound(a, i)[i + 1])),
       e = caml_int64_to_int32(runtime.caml_int64_div(cur, dL));
      caml_check_bound(q, i)[i + 1] = e;
      var f = runtime.caml_int64_mod(cur, dL), g = i - 1 | 0;
      if(0 === i) break;
      rem = f;
      i = g;
     }
    }
    return norm(q);
   }
   function powmod(b0, e, m){
    var d = bn_mod(b0, m), nb = numbits(e), c = nb - 1 | 0, a = [0, 1];
    if(c < 0)
     var result$1 = a;
    else{
     var b = d, result = a, i = 0;
     for(;;){
      var
       result$0 = 1 === bit(e, i) ? bn_mod(mul(result, b), m) : result,
       f = bn_mod(mul(b, b), m),
       g = i + 1 | 0;
      if(c === i){var result$1 = result$0; break;}
      b = f;
      result = result$0;
      i = g;
     }
    }
    return result$1;
   }
   function of_bytes_le(s){
    var a = caml_ml_string_length(s) - 1 | 0;
    if(a < 0)
     var acc$0 = bzero;
    else{
     var acc = bzero, i = a;
     for(;;){
      var
       c = of_int(caml_string_get(s, i)),
       b = add(mul(acc, of_int(256)), c),
       d = i - 1 | 0;
      if(0 === i){var acc$0 = b; break;}
      acc = b;
      i = d;
     }
    }
    return acc$0;
   }
   function to_bytes_le(a, n){
    var b = Stdlib_Bytes[1].call(null, n, 0), c = n - 1 | 0, e = norm(a);
    if(c >= 0){
     var cur = e, i = 0;
     for(;;){
      var
       q = div_small(cur, 256),
       qm = mul(q, of_int(256)),
       d = sub(cur, qm),
       r = is_zero(d) ? 0 : caml_check_bound(d, 0)[1];
      caml_bytes_set(b, i, Stdlib_Char[1].call(null, r));
      var f = i + 1 | 0;
      if(c === i) break;
      cur = q;
      i = f;
     }
    }
    return Stdlib_Bytes[44].call(null, b);
   }
   var twop255 = caml_make_vect(11, 0);
   caml_check_bound(twop255, 9)[10] = 2097152;
   var d = of_int(19), p = sub(norm(twop255), d);
   function fmod(a){return bn_mod(a, p);}
   function fadd(a, b){var a$0 = add(a, b); return bn_mod(a$0, p);}
   function fsub(a, b){
    var a$0 = add(a, sub(p, bn_mod(b, p)));
    return bn_mod(a$0, p);
   }
   function fmul(a, b){var a$0 = mul(a, b); return bn_mod(a$0, p);}
   function fpow(a, e){return powmod(a, e, p);}
   function finv(a){var e = sub(p, of_int(2)); return powmod(a, e, p);}
   var
    ell =
      of_bytes_le
       ("\xed\xd3\xf5\\\x1ac\x12X\xd6\x9c\xf7\xa2\xde\xf9\xde\x14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x10"),
    inv666 = finv(of_int(121666)),
    f = of_int(121665),
    a = mul(fsub(of_int(0), f), inv666),
    dconst = bn_mod(a, p),
    e = div_small(sub(p, of_int(1)), 4),
    a$0 = of_int(2),
    sqrtm1 = powmod(a$0, e, p),
    g = of_int(1),
    identity = [0, bzero, of_int(1), g, bzero];
   function padd(p1, p2){
    var
     d = fsub(p2[2], p2[1]),
     a = fmul(fsub(p1[2], p1[1]), d),
     i = fadd(p2[2], p2[1]),
     b = fmul(fadd(p1[2], p1[1]), i),
     j = p2[4],
     k = fmul(of_int(2), dconst),
     c = fmul(fmul(p1[4], k), j),
     l = p2[3],
     m = of_int(2),
     dd = fmul(fmul(p1[3], m), l),
     e = fsub(b, a),
     f = fsub(dd, c),
     g = fadd(dd, c),
     h = fadd(b, a),
     n = fmul(e, h),
     o = fmul(f, g),
     p = fmul(g, h);
    return [0, fmul(e, f), p, o, n];
   }
   function scalar_mul(n, q){
    var a = numbits(n) - 1 | 0;
    if(a < 0)
     var r$2 = identity;
    else{
     var r$0 = identity, i = a;
     for(;;){
      var
       r = padd(r$0, r$0),
       r$1 = 1 === bit(n, i) ? padd(r, q) : r,
       b = i - 1 | 0;
      if(0 === i){var r$2 = r$1; break;}
      r$0 = r$1;
      i = b;
     }
    }
    return r$2;
   }
   function pnegate(q){
    var a = q[4], b = fsub(of_int(0), a), c = q[3], d = q[2], e = q[1];
    return [0, fsub(of_int(0), e), d, c, b];
   }
   function decompress(s){
    if(32 !== caml_ml_string_length(s)) return 0;
    var
     sign = (caml_string_get(s, 31) >>> 7 | 0) & 1,
     s$0 = Stdlib_Bytes[5].call(null, s),
     b = caml_string_get(s, 31) & 127;
    caml_bytes_set(s$0, 31, Stdlib_Char[1].call(null, b));
    var y = of_bytes_le(Stdlib_Bytes[44].call(null, s$0));
    if(0 <= cmp(y, p)) return 0;
    var
     y2 = fmul(y, y),
     u = fsub(y2, of_int(1)),
     c = of_int(1),
     v = fadd(fmul(dconst, y2), c),
     v3 = fmul(fmul(v, v), v),
     v7 = fmul(fmul(v3, v3), v),
     exp = div_small(sub(p, of_int(5)), 8),
     a = fmul(u, v7),
     e = powmod(a, exp, p),
     x0 = fmul(fmul(u, v3), e),
     vx2 = fmul(v, fmul(x0, x0)),
     x =
       0 === cmp(vx2, u)
        ? [0, x0]
        : 0 === cmp(vx2, fsub(of_int(0), u)) ? [0, fmul(x0, sqrtm1)] : 0;
    if(! x) return 0;
    var x$0 = x[1];
    if(is_zero(x$0) && 1 === sign) return 0;
    var
     x$1 = bit(x$0, 0) !== sign ? fsub(of_int(0), x$0) : x$0,
     d = fmul(x$1, y);
    return [0, [0, x$1, y, of_int(1), d]];
   }
   function encode(q){
    var
     zi = finv(q[3]),
     x = fmul(q[1], zi),
     y = fmul(q[2], zi),
     a = to_bytes_le(y, 32),
     b = Stdlib_Bytes[5].call(null, a),
     c = bit(x, 0) << 7,
     last = runtime.caml_bytes_get(b, 31) | c;
    caml_bytes_set(b, 31, Stdlib_Char[1].call(null, last));
    return Stdlib_Bytes[44].call(null, b);
   }
   var
    h = finv(of_int(5)),
    by = fmul(of_int(4), h),
    match = decompress(to_bytes_le(by, 32));
   if(match)
    var pt = match[1], base_point = pt;
   else
    var
     base_point =
       Stdlib[2].call(null, "ed25519: base point decompress failed");
   function unhex(h){
    var
     n = caml_ml_string_length(h) / 2 | 0,
     b = runtime.caml_create_bytes(n),
     a = n - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var
       c = Stdlib_String[16].call(null, h, 2 * i | 0, 2),
       d = runtime.caml_int_of_string(Stdlib[28].call(null, "0x", c));
      caml_bytes_set(b, i, Stdlib_Char[1].call(null, d));
      var e = i + 1 | 0;
      if(a === i) break;
      i = e;
     }
    }
    return Stdlib_Bytes[44].call(null, b);
   }
   function sha512_bytes(s){return unhex(Sx_sha2[11].call(null, s));}
   function verify(pubkey, msg, sig){
    if
     (32 === caml_ml_string_length(pubkey)
      && 64 === caml_ml_string_length(sig)){
     var
      rb = Stdlib_String[16].call(null, sig, 0, 32),
      sb = Stdlib_String[16].call(null, sig, 32, 32),
      s = of_bytes_le(sb);
     if(0 <= cmp(s, ell)) return 0;
     var match = decompress(pubkey);
     if(! match) return 0;
     var
      a = match[1],
      b = Stdlib[28].call(null, pubkey, msg),
      h = sha512_bytes(Stdlib[28].call(null, rb, b)),
      k = bn_mod(of_bytes_le(h), ell),
      sb_pt = scalar_mul(s, base_point),
      ka = scalar_mul(k, a),
      chk = padd(sb_pt, pnegate(ka));
     try{var c = encode(chk) === rb ? 1 : 0; return c;}catch(exn){return 0;}
    }
    return 0;
   }
   var
    Sx_ed25519 =
      [0,
       26,
       67108864,
       67108863,
       norm,
       bzero,
       of_int,
       is_zero,
       cmp,
       add,
       sub,
       mul,
       numbits,
       bit,
       bn_mod,
       div_small,
       powmod,
       of_bytes_le,
       to_bytes_le,
       p,
       fmod,
       fadd,
       fsub,
       fmul,
       fpow,
       finv,
       ell,
       dconst,
       sqrtm1,
       identity,
       padd,
       scalar_mul,
       pnegate,
       decompress,
       encode,
       base_point,
       unhex,
       sha512_bytes,
       verify];
   runtime.caml_register_global(12, Sx_ed25519, "Sx_ed25519");
   return;
  }
  (globalThis));

//# 3213 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_parser:[F(1)*,F(1),F(1),F(1)*,F(1),F(1)*,F(1)*,F(1)*,F(1),F(1),F(2),F(2),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(5),F(3),F(1),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_div = runtime.caml_div,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_mul = runtime.caml_mul,
    caml_string_get = runtime.caml_string_get;
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Sx_types = global_data.Sx_types,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_List = global_data.Stdlib__List,
    Sx_cst = global_data.Sx_cst,
    Stdlib = global_data.Stdlib,
    Stdlib_Uchar = global_data.Stdlib__Uchar;
   function make_state(src){return [0, src, caml_ml_string_length(src), 0];}
   function peek(s){
    return s[3] < s[2] ? [0, caml_string_get(s[1], s[3])] : 0;
   }
   function advance(s){s[3] = s[3] + 1 | 0; return 0;}
   function at_end(s){return s[2] <= s[3] ? 1 : 0;}
   function skip_whitespace_and_comments(s){
    a:
    for(;;){
     if(at_end(s)) return 0;
     var match = caml_string_get(s[1], s[3]);
     b:
     {
      if(14 <= match){
       if(32 !== match){
        if(59 !== match) break b;
        for(;;){
         if(s[3] < s[2] && 10 !== caml_string_get(s[1], s[3])){advance(s); continue;}
         if(s[3] >= s[2]) continue a;
         advance(s);
         continue a;
        }
       }
      }
      else
       if(11 <= match){if(13 > match) break b;} else if(9 > match) break b;
      advance(s);
      continue;
     }
     return 0;
    }
   }
   function is_ident_start(param){
    a:
    {
     if(96 <= param){
      if(123 <= param){
       if(126 !== param) break a;
      }
      else if(97 > param) break a;
     }
     else{
      var a = param - 33 | 0;
      if(57 < a >>> 0){
       if(62 > a) break a;
      }
      else if(32 > a)
       switch(a){
         case 0:
         case 5:
         case 9:
         case 10:
         case 12:
         case 14:
         case 27:
         case 28:
         case 29:
         case 30: break;
         default: break a;
       }
     }
     return 1;
    }
    return 0;
   }
   function is_ident_char(c){
    if(is_ident_start(c)) return 1;
    a:
    {
     if(47 <= c){
      if(10 < c - 48 >>> 0) break a;
     }
     else{
      if(35 > c) break a;
      switch(c - 35 | 0){case 0:case 9:case 11: break;default: break a;
      }
     }
     return 1;
    }
    return 0;
   }
   function read_string(s){
    advance(s);
    var buf = Stdlib_Buffer[1].call(null, 64);
    for(;;){
     if(at_end(s))
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[10], "Unterminated string"], 1);
     var c = caml_string_get(s[1], s[3]);
     advance(s);
     if(34 === c) return Stdlib_Buffer[2].call(null, buf);
     if(92 === c){
      if(at_end(s))
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[10], "Unterminated string escape"], 1);
      var esc = caml_string_get(s[1], s[3]);
      advance(s);
      if(34 === esc)
       Stdlib_Buffer[12].call(null, buf, 34);
      else{
       if(92 <= esc){
        if(118 > esc)
         switch(esc - 92 | 0){
           case 0:
            Stdlib_Buffer[12].call(null, buf, 92); continue;
           case 4:
            Stdlib_Buffer[12].call(null, buf, 96); continue;
           case 18:
            Stdlib_Buffer[12].call(null, buf, 10); continue;
           case 22:
            Stdlib_Buffer[12].call(null, buf, 13); continue;
           case 24:
            Stdlib_Buffer[12].call(null, buf, 9); continue;
           case 25:
            if(s[2] < (s[3] + 4 | 0))
             throw caml_maybe_attach_backtrace
                    ([0, Sx_types[10], "Incomplete \\u escape"], 1);
            var hex = Stdlib_String[16].call(null, s[1], s[3], 4);
            s[3] = s[3] + 4 | 0;
            var
             code =
               runtime.caml_int_of_string(Stdlib[28].call(null, "0x", hex)),
             ubuf = Stdlib_Buffer[1].call(null, 4),
             a = Stdlib_Uchar[8].call(null, code);
            Stdlib_Buffer[13].call(null, ubuf, a);
            var b = Stdlib_Buffer[2].call(null, ubuf);
            Stdlib_Buffer[16].call(null, buf, b);
            continue;
         }
       }
       else if(47 === esc){Stdlib_Buffer[12].call(null, buf, 47); continue;}
       Stdlib_Buffer[12].call(null, buf, 92);
       Stdlib_Buffer[12].call(null, buf, esc);
      }
     }
     else
      Stdlib_Buffer[12].call(null, buf, c);
    }
   }
   function read_symbol(s){
    var start = s[3];
    for(;;){
     if(s[3] < s[2] && is_ident_char(caml_string_get(s[1], s[3]))){advance(s); continue;}
     return Stdlib_String[16].call(null, s[1], start, s[3] - start | 0);
    }
   }
   function gcd(a, b){
    var
     b$2 = Stdlib[18].call(null, b),
     a$1 = Stdlib[18].call(null, a),
     a$0 = a$1,
     b$0 = b$2;
    for(;;){
     if(0 === b$0) return a$0;
     var b$1 = runtime.caml_mod(a$0, b$0);
     a$0 = b$0;
     b$0 = b$1;
    }
   }
   function make_rat(n, d){
    if(0 === d)
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[10], "rational: division by zero"], 1);
    var
     sign = 0 <= d ? 1 : -1,
     a = Stdlib[18].call(null, d),
     g = gcd(Stdlib[18].call(null, n), a),
     rn = caml_div(caml_mul(sign, n), g),
     rd = caml_div(caml_mul(sign, d), g);
    return 1 === rd ? [1, rn] : [34, rn, rd];
   }
   var cst = "";
   function try_number(str){
    var
     has_dec = Stdlib_String[15].call(null, str, 46),
     b = Stdlib_String[15].call(null, str, 101),
     has_exp = b || Stdlib_String[15].call(null, str, 69);
    if(! has_dec && ! has_exp){
     var match$0 = Stdlib_String[17].call(null, 47, str);
     if(match$0){
      var a = match$0[2];
      if(a && ! a[2]){
       var den_s = a[1], num_s = match$0[1];
       if(num_s !== cst && den_s !== cst){
        var
         match$3 = Stdlib[34].call(null, num_s),
         match$4 = Stdlib[34].call(null, den_s);
        if(match$3 && match$4){
         var d = match$4[1], n$2 = match$3[1];
         try{var c = [0, make_rat(n$2, d)]; return c;}catch(exn){return 0;}
        }
        return 0;
       }
      }
     }
     var match$1 = Stdlib[34].call(null, str);
     if(match$1){var n$0 = match$1[1]; return [0, [1, n$0]];}
     var match$2 = Stdlib[36].call(null, str);
     if(! match$2) return 0;
     var n$1 = match$2[1];
     return [0, [2, n$1]];
    }
    var match = Stdlib[36].call(null, str);
    if(! match) return 0;
    var n = match[1];
    return [0, [2, n]];
   }
   var
    cst_pos = " (pos ",
    cst_at_line = " at line ",
    cst_col = " col ",
    cst_Unexpected_char = "Unexpected char: ",
    cst_Unexpected_char_c_at_line_ =
      "Unexpected char: %c at line %d col %d (pos %d)",
    cst_Unterminated_raw_string = "Unterminated raw string",
    cst_false = "false",
    cst_nil = "nil",
    cst_quasiquote = "quasiquote",
    cst_quote = "quote",
    cst_splice_unquote = "splice-unquote",
    cst_true = "true",
    cst_unquote = "unquote",
    a =
      [0,
       [11,
        "Unexpected end of input at line ",
        [4, 0, 0, 0, [11, cst_pos, [4, 0, 0, 0, [12, 41, 0]]]]],
       "Unexpected end of input at line %d (pos %d)"],
    b = [4, cst_quasiquote],
    c =
      [0,
       [11,
        cst_Unexpected_char,
        [0,
         [11,
          cst_at_line,
          [4,
           0,
           0,
           0,
           [11,
            cst_col,
            [4, 0, 0, 0, [11, cst_pos, [4, 0, 0, 0, [12, 41, 0]]]]]]]]],
       cst_Unexpected_char_c_at_line_],
    d = [0, 1],
    e = [0, 0],
    f = [4, cst_quote],
    g = [4, cst_quote],
    h = [4, cst_splice_unquote],
    i = [4, cst_unquote];
   function read_value(s){
    a:
    {
     b:
     {
      c:
      {
       d:
       {
        e:
        {
         f:
         {
          g:
          for(;;){
           skip_whitespace_and_comments(s);
           if(at_end(s)) break a;
           var match = caml_string_get(s[1], s[3]);
           if(92 <= match) break c;
           if(45 <= match) break d;
           if(34 > match) break b;
           switch(match - 34 | 0){
             case 0:
              return [3, read_string(s)];
             case 1:
              if
               ((s[3] + 1 | 0) < s[2]
                && 92 === caml_string_get(s[1], s[3] + 1 | 0))
               break e;
              h:
              if((s[3] + 1 | 0) < s[2]){
               if
                (116 !== caml_string_get(s[1], s[3] + 1 | 0)
                 && 102 !== caml_string_get(s[1], s[3] + 1 | 0))
                break h;
               if
                (s[2] > (s[3] + 2 | 0)
                 && is_ident_char(caml_string_get(s[1], s[3] + 2 | 0)))
                break h;
               var b$0 = 116 === caml_string_get(s[1], s[3] + 1 | 0) ? 1 : 0;
               advance(s);
               advance(s);
               return [0, b$0];
              }
              if((s[3] + 1 | 0) >= s[2]) break f;
              if(59 !== caml_string_get(s[1], s[3] + 1 | 0)) break f;
              advance(s);
              advance(s);
              read_value(s);
              break;
             case 5:
              advance(s); return [6, [0, g, [0, read_value(s), 0]]];
             case 6:
              return read_list(s, 41);
             case 10:
              break g;
             default: break b;
           }
          }
          advance(s);
          if(s[3] < s[2] && 64 === caml_string_get(s[1], s[3])){
           advance(s);
           return [6, [0, h, [0, read_value(s), 0]]];
          }
          return [6, [0, i, [0, read_value(s), 0]]];
         }
         if
          ((s[3] + 1 | 0) < s[2] && 39 === caml_string_get(s[1], s[3] + 1 | 0)){
          advance(s);
          advance(s);
          return [6, [0, f, [0, read_value(s), 0]]];
         }
         if((s[3] + 1 | 0) >= s[2]) break b;
         if(124 !== caml_string_get(s[1], s[3] + 1 | 0)) break b;
         advance(s);
         advance(s);
         var buf = Stdlib_Buffer[1].call(null, 64);
         for(;;){
          if(at_end(s))
           throw caml_maybe_attach_backtrace
                  ([0, Sx_types[10], cst_Unterminated_raw_string], 1);
          var c$1 = caml_string_get(s[1], s[3]);
          advance(s);
          if(124 === c$1) return [3, Stdlib_Buffer[2].call(null, buf)];
          Stdlib_Buffer[12].call(null, buf, c$1);
         }
        }
        advance(s);
        advance(s);
        if(at_end(s))
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[10], "Unexpected end of input after #\\"], 1);
        var char_start = s[3];
        if(! is_ident_start(caml_string_get(s[1], s[3]))){
         var c$0 = caml_string_get(s[1], s[3]);
         advance(s);
         return [32, c$0];
        }
        for(;;){
         if(s[3] >= s[2]) break;
         if(! is_ident_char(caml_string_get(s[1], s[3]))) break;
         advance(s);
        }
        var
         name =
           Stdlib_String[16].call
            (null, s[1], char_start, s[3] - char_start | 0),
         switch$ = runtime.caml_string_compare(name, "nul");
        e:
        {
         if(0 <= switch$){
          if(0 >= switch$){var cp = 0; break e;}
          if(name === "null"){var cp = 0; break e;}
          if(name === "return"){var cp = 13; break e;}
          if(name === "rubout"){var cp = 127; break e;}
          if(name === "space"){var cp = 32; break e;}
          if(name === "tab"){var cp = 9; break e;}
         }
         else{
          if(name === "altmode"){var cp = 27; break e;}
          if(name === "backspace"){var cp = 8; break e;}
          if(name === "delete"){var cp = 127; break e;}
          if(name === "escape"){var cp = 27; break e;}
          if(name === "newline"){var cp = 10; break e;}
         }
         var cp = caml_string_get(name, 0);
        }
        return [32, cp];
       }
       if(91 <= match) return read_list(s, 93);
       break b;
      }
      if(96 === match){advance(s); return [6, [0, b, [0, read_value(s), 0]]];}
      if(123 === match) return read_dict(s);
     }
     var token = read_symbol(s);
     if(token !== cst){
      if(token === cst_false) return e;
      if(token === cst_nil) return 0;
      if(token === cst_true) return d;
      if(58 === caml_string_get(token, 0))
       return [5,
               Stdlib_String[16].call
                (null, token, 1, caml_ml_string_length(token) - 1 | 0)];
      var match$0 = try_number(token);
      if(! match$0) return [4, token];
      var n = match$0[1];
      return n;
     }
     var l = s[3] - 1 | 0, j = 1, k = 1;
     if(l < 0)
      var col$2 = k, line$3 = j;
     else{
      var col = k, line$0 = j, i$0 = 0;
      for(;;){
       if(10 === caml_string_get(s[1], i$0))
        var line$1 = line$0 + 1 | 0, col$1 = 1, line$2 = line$1;
       else
        var col$0 = col + 1 | 0, col$1 = col$0, line$2 = line$0;
       var u = i$0 + 1 | 0;
       if(l === i$0){var col$2 = col$1, line$3 = line$2; break;}
       col = col$1;
       line$0 = line$2;
       i$0 = u;
      }
     }
     var
      q = s[3],
      r = caml_string_get(s[1], s[3]),
      t = caml_call4(Stdlib_Printf[4].call(null, c), r, line$3, col$2, q);
     throw caml_maybe_attach_backtrace([0, Sx_types[10], t], 1);
    }
    var line = [0, 1];
    Stdlib_String[30].call
     (null,
      function(c){
       var a = 10 === c ? 1 : 0, b = a ? (line[1]++, 0) : a;
       return b;
      },
      s[1]);
    var
     m = s[3],
     o = line[1],
     p = caml_call2(Stdlib_Printf[4].call(null, a), o, m);
    throw caml_maybe_attach_backtrace([0, Sx_types[10], p], 1);
   }
   var cst_Unterminated_list = "Unterminated list";
   function read_list(s, close_char){
    advance(s);
    var items = 0;
    for(;;){
     skip_whitespace_and_comments(s);
     if(at_end(s))
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[10], cst_Unterminated_list], 1);
     if(caml_string_get(s[1], s[3]) === close_char){
      advance(s);
      return [6, Stdlib_List[10].call(null, items)];
     }
     items = [0, read_value(s), items];
    }
   }
   var cst_Unterminated_dict = "Unterminated dict";
   function read_dict(s){
    advance(s);
    var d = Sx_types[109].call(null, 0);
    for(;;){
     skip_whitespace_and_comments(s);
     if(at_end(s))
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[10], cst_Unterminated_dict], 1);
     if(125 === caml_string_get(s[1], s[3])){advance(s); return [7, d];}
     var key = read_value(s);
     if(typeof key !== "number" && key[0] - 3 >>> 0 < 3){
      var key_str = key[1], v = read_value(s);
      Sx_types[112].call(null, d, key_str, v);
      continue;
     }
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[10], "Dict key must be keyword, string, or symbol"],
             1);
    }
   }
   function parse_all(src){
    var s = make_state(src), results = 0;
    for(;;){
     skip_whitespace_and_comments(s);
     if(at_end(s)) return Stdlib_List[10].call(null, results);
     results = [0, read_value(s), results];
    }
   }
   function parse_file(path){
    var
     ic = Stdlib[79].call(null, path),
     n = Stdlib[92].call(null, ic),
     src = Stdlib[86].call(null, ic, n);
    Stdlib[93].call(null, ic);
    return parse_all(src);
   }
   function collect_trivia(s){
    var items = 0;
    a:
    for(;;){
     b:
     if(! at_end(s)){
      var match = caml_string_get(s[1], s[3]);
      if(14 <= match){
       if(32 !== match){
        if(59 !== match) break b;
        var start$0 = s[3];
        for(;;){
         if(s[3] >= s[2]) break;
         if(10 === caml_string_get(s[1], s[3])) break;
         advance(s);
        }
        var
         text =
           Stdlib_String[16].call(null, s[1], start$0, s[3] - start$0 | 0);
        if(s[3] < s[2]) advance(s);
        var
         text$0 =
           0 < s[3]
            ? s
               [3]
              <= s[2]
              ? 10
                === caml_string_get(s[1], s[3] - 1 | 0)
                ? Stdlib[28].call(null, text, "\n")
                : text
              : text
            : text;
        items = [0, [1, text$0], items];
        continue;
       }
      }
      else
       if(11 <= match){if(13 > match) break b;} else if(9 > match) break b;
      var start = s[3];
      for(;;){
       if(s[3] < s[2]){
        var c = caml_string_get(s[1], s[3]), b = 32 === c;
        if(b)
         var a = b;
        else{
         var d = 9 === c;
         if(d) var a = d; else var e = 10 === c, a = e || 13 === c;
        }
        if(a){advance(s); continue;}
       }
       items =
        [0,
         [0, Stdlib_String[16].call(null, s[1], start, s[3] - start | 0)],
         items];
       continue a;
      }
     }
     return Stdlib_List[10].call(null, items);
    }
   }
   var
    j = [4, cst_quasiquote],
    k =
      [0,
       [11,
        cst_Unexpected_char,
        [0,
         [11,
          cst_at_line,
          [4,
           0,
           0,
           0,
           [11,
            cst_col,
            [4, 0, 0, 0, [11, cst_pos, [4, 0, 0, 0, [12, 41, 0]]]]]]]]],
       cst_Unexpected_char_c_at_line_],
    l = [0, 1],
    m = [0, 0],
    n = [4, cst_quote],
    o = [4, cst_quote];
   function read_cst(s){
    var trivia = collect_trivia(s);
    if(at_end(s))
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[10], "Unexpected end of input"], 1);
    var start = s[3], match = caml_string_get(s[1], s[3]);
    if(92 <= match){
     if(96 === match){
      advance(s);
      var
       inner = read_cst(s),
       end_pos = s[3],
       token = Stdlib_String[16].call(null, s[1], start, end_pos - start | 0),
       value = [6, [0, j, [0, Sx_cst[5].call(null, inner), 0]]];
      return [0, trivia, token, value, [0, start, end_pos]];
     }
     if(123 === match) return read_cst_dict(s, trivia, start);
    }
    else
     if(45 <= match){
      if(91 <= match) return read_cst_list(s, trivia, start, 91, 93);
     }
     else if(34 <= match)
      switch(match - 34 | 0){
        case 0:
         var
          value$1 = [3, read_string(s)],
          end_pos$1 = s[3],
          token$1 =
            Stdlib_String[16].call(null, s[1], start, end_pos$1 - start | 0);
         return [0, trivia, token$1, value$1, [0, start, end_pos$1]];
        case 1:
         if
          ((s[3] + 1 | 0) < s[2] && 59 === caml_string_get(s[1], s[3] + 1 | 0)){
          advance(s);
          advance(s);
          read_cst(s);
          var
           next = read_cst(s),
           combined_trivia = Stdlib[37].call(null, trivia, next[1]);
          switch(next[0]){
            case 0:
             return [0, combined_trivia, next[2], next[3], next[4]];
            case 1:
             return [1,
                     combined_trivia,
                     next[2],
                     next[3],
                     next[4],
                     next[5],
                     next[6]];
            default: return [2, combined_trivia, next[2], next[3], next[4]];
          }
         }
         if
          ((s[3] + 1 | 0) < s[2] && 39 === caml_string_get(s[1], s[3] + 1 | 0)){
          advance(s);
          advance(s);
          var
           inner$0 = read_cst(s),
           end_pos$2 = s[3],
           token$2 =
             Stdlib_String[16].call(null, s[1], start, end_pos$2 - start | 0),
           value$2 = [6, [0, n, [0, Sx_cst[5].call(null, inner$0), 0]]];
          return [0, trivia, token$2, value$2, [0, start, end_pos$2]];
         }
         if
          ((s[3] + 1 | 0) < s[2]
           && 124 === caml_string_get(s[1], s[3] + 1 | 0)){
          advance(s);
          advance(s);
          var buf = Stdlib_Buffer[1].call(null, 64);
          for(;;){
           if(at_end(s))
            throw caml_maybe_attach_backtrace
                   ([0, Sx_types[10], cst_Unterminated_raw_string], 1);
           var c = caml_string_get(s[1], s[3]);
           advance(s);
           if(124 === c){
            var
             end_pos$3 = s[3],
             token$3 =
               Stdlib_String[16].call
                (null, s[1], start, end_pos$3 - start | 0);
            return [0,
                    trivia,
                    token$3,
                    [3, Stdlib_Buffer[2].call(null, buf)],
                    [0, start, end_pos$3]];
           }
           Stdlib_Buffer[12].call(null, buf, c);
          }
         }
         break;
        case 5:
         advance(s);
         var
          inner$1 = read_cst(s),
          end_pos$4 = s[3],
          token$4 =
            Stdlib_String[16].call(null, s[1], start, end_pos$4 - start | 0),
          value$3 = [6, [0, o, [0, Sx_cst[5].call(null, inner$1), 0]]];
         return [0, trivia, token$4, value$3, [0, start, end_pos$4]];
        case 6:
         return read_cst_list(s, trivia, start, 40, 41);
        case 10:
         advance(s);
         var
          e = s[3] < s[2],
          splice = e ? 64 === caml_string_get(s[1], s[3]) : e;
         if(splice) advance(s);
         var
          inner$2 = read_cst(s),
          end_pos$5 = s[3],
          token$5 =
            Stdlib_String[16].call(null, s[1], start, end_pos$5 - start | 0),
          sym$0 = splice ? cst_splice_unquote : cst_unquote,
          value$4 =
            [6, [0, [4, sym$0], [0, Sx_cst[5].call(null, inner$2), 0]]];
         return [0, trivia, token$5, value$4, [0, start, end_pos$5]];
      }
    var sym = read_symbol(s);
    if(sym === cst){
     var d = s[3] - 1 | 0, a = 1, b = 1;
     if(d < 0)
      var col$2 = b, line$2 = a;
     else{
      var col = b, line = a, i = 0;
      for(;;){
       if(10 === caml_string_get(s[1], i))
        var line$0 = line + 1 | 0, col$1 = 1, line$1 = line$0;
       else
        var col$0 = col + 1 | 0, col$1 = col$0, line$1 = line;
       var p = i + 1 | 0;
       if(d === i){var col$2 = col$1, line$2 = line$1; break;}
       col = col$1;
       line = line$1;
       i = p;
      }
     }
     var
      f = s[3],
      g = caml_string_get(s[1], s[3]),
      h = caml_call4(Stdlib_Printf[4].call(null, k), g, line$2, col$2, f);
     throw caml_maybe_attach_backtrace([0, Sx_types[10], h], 1);
    }
    var
     end_pos$0 = s[3],
     token$0 =
       Stdlib_String[16].call(null, s[1], start, end_pos$0 - start | 0);
    if(sym !== cst_false)
     if(sym !== cst_nil)
      if(sym !== cst_true)
       if(58 === caml_string_get(sym, 0))
        var
         value$0 =
           [5,
            Stdlib_String[16].call
             (null, sym, 1, caml_ml_string_length(sym) - 1 | 0)];
       else{
        var match$0 = try_number(sym);
        if(match$0)
         var n$0 = match$0[1], value$0 = n$0;
        else
         var value$0 = [4, sym];
       }
      else
       var value$0 = l;
     else
      var value$0 = 0;
    else
     var value$0 = m;
    return [0, trivia, token$0, value$0, [0, start, end_pos$0]];
   }
   function read_cst_list(s, trivia, start, open_c, close_c){
    advance(s);
    var children = 0;
    for(;;){
     var child_trivia = collect_trivia(s);
     if(at_end(s))
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[10], cst_Unterminated_list], 1);
     if(caml_string_get(s[1], s[3]) === close_c){
      advance(s);
      var end_pos = s[3];
      return [1,
              trivia,
              open_c,
              Stdlib_List[10].call(null, children),
              close_c,
              child_trivia,
              [0, start, end_pos]];
     }
     var child = read_cst_inner(s);
     switch(child[0]){
       case 0:
        var
         a = child[4],
         b = child[3],
         c = child[2],
         child_with_trivia =
           [0, Stdlib[37].call(null, child_trivia, child[1]), c, b, a];
        break;
       case 1:
        var
         d = child[6],
         e = child[5],
         f = child[4],
         g = child[3],
         h = child[2],
         child_with_trivia =
           [1, Stdlib[37].call(null, child_trivia, child[1]), h, g, f, e, d];
        break;
       default:
        var
         i = child[4],
         j = child[3],
         k = child[2],
         child_with_trivia =
           [2, Stdlib[37].call(null, child_trivia, child[1]), k, j, i];
     }
     children = [0, child_with_trivia, children];
    }
   }
   function read_cst_dict(s, trivia, start){
    advance(s);
    var children = 0;
    for(;;){
     var child_trivia = collect_trivia(s);
     if(at_end(s))
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[10], cst_Unterminated_dict], 1);
     if(125 === caml_string_get(s[1], s[3])){
      advance(s);
      var end_pos = s[3];
      return [2,
              trivia,
              Stdlib_List[10].call(null, children),
              child_trivia,
              [0, start, end_pos]];
     }
     var child = read_cst_inner(s);
     switch(child[0]){
       case 0:
        var
         a = child[4],
         b = child[3],
         c = child[2],
         child_with_trivia =
           [0, Stdlib[37].call(null, child_trivia, child[1]), c, b, a];
        break;
       case 1:
        var
         d = child[6],
         e = child[5],
         f = child[4],
         g = child[3],
         h = child[2],
         child_with_trivia =
           [1, Stdlib[37].call(null, child_trivia, child[1]), h, g, f, e, d];
        break;
       default:
        var
         i = child[4],
         j = child[3],
         k = child[2],
         child_with_trivia =
           [2, Stdlib[37].call(null, child_trivia, child[1]), k, j, i];
     }
     children = [0, child_with_trivia, children];
    }
   }
   function read_cst_inner(s){return read_cst(s);}
   function parse_all_cst(src){
    var s = make_state(src), results = 0;
    for(;;){
     var trivia = collect_trivia(s);
     if(at_end(s)) return [0, Stdlib_List[10].call(null, results), trivia];
     var node = read_cst_inner(s);
     switch(node[0]){
       case 0:
        var
         a = node[4],
         b = node[3],
         c = node[2],
         node_with_trivia =
           [0, Stdlib[37].call(null, trivia, node[1]), c, b, a];
        break;
       case 1:
        var
         d = node[6],
         e = node[5],
         f = node[4],
         g = node[3],
         h = node[2],
         node_with_trivia =
           [1, Stdlib[37].call(null, trivia, node[1]), h, g, f, e, d];
        break;
       default:
        var
         i = node[4],
         j = node[3],
         k = node[2],
         node_with_trivia =
           [2, Stdlib[37].call(null, trivia, node[1]), k, j, i];
     }
     results = [0, node_with_trivia, results];
    }
   }
   function parse_file_cst(path){
    var
     ic = Stdlib[79].call(null, path),
     n = Stdlib[92].call(null, ic),
     src = Stdlib[86].call(null, ic, n);
    Stdlib[93].call(null, ic);
    return parse_all_cst(src);
   }
   runtime.caml_register_global
    (61,
     [0,
      make_state,
      peek,
      advance,
      at_end,
      skip_whitespace_and_comments,
      is_ident_start,
      is_ident_char,
      is_ident_char,
      read_string,
      read_symbol,
      gcd,
      make_rat,
      try_number,
      read_value,
      read_list,
      read_dict,
      parse_all,
      parse_file,
      collect_trivia,
      read_cst,
      read_cst_list,
      read_cst_dict,
      read_cst_inner,
      parse_all_cst,
      parse_file_cst],
     "Sx_parser");
   return;
  }
  (globalThis));

//# 4166 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_rsa:[N,N,N,F(1),N,F(1),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(3),F(1),F(2),F(2),N,F(2),F(1),N,F(1),F(3)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_check_bound = runtime.caml_check_bound,
    caml_int_compare = runtime.caml_int_compare,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_string_get = runtime.caml_string_get,
    global_data = runtime.caml_get_global_data(),
    Sx_sha2 = global_data.Sx_sha2,
    Stdlib = global_data.Stdlib,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Array = global_data.Stdlib__Array;
   function norm(a){
    var n = a.length - 1;
    for(;;){
     if(1 < n){
      var b = n - 1 | 0;
      if(0 === caml_check_bound(a, b)[b + 1]){
       var n$0 = n - 1 | 0;
       n = n$0;
       continue;
      }
     }
     return n === a.length - 1 ? a : Stdlib_Array[6].call(null, a, 0, n);
    }
   }
   function is_zero(a){
    var
     b = 1 === a.length - 1 ? 1 : 0,
     c = b ? 0 === caml_check_bound(a, 0)[1] ? 1 : 0 : b;
    return c;
   }
   function cmp(a, b){
    var
     a$0 = norm(a),
     b$0 = norm(b),
     la = a$0.length - 1,
     lb = b$0.length - 1;
    if(la !== lb) return caml_int_compare(la, lb);
    var i = la - 1 | 0, r = 0;
    for(;;){
     if(0 === r && 0 <= i){
      var c = caml_check_bound(b$0, i)[i + 1];
      if(caml_check_bound(a$0, i)[i + 1] !== c)
       var
        d = caml_check_bound(b$0, i)[i + 1],
        r$0 = caml_int_compare(caml_check_bound(a$0, i)[i + 1], d);
      else
       var r$0 = r;
      var i$0 = i - 1 | 0;
      i = i$0;
      r = r$0;
      continue;
     }
     return r;
    }
   }
   function add(a, b){
    var
     la = a.length - 1,
     lb = b.length - 1,
     n = Stdlib[17].call(null, la, lb) + 1 | 0,
     r = caml_make_vect(n, 0),
     c = n - 1 | 0;
    if(c >= 0){
     var carry = 0, i = 0;
     for(;;){
      var
       d = i < lb ? caml_check_bound(b, i)[i + 1] : 0,
       e = i < la ? caml_check_bound(a, i)[i + 1] : 0,
       s = (carry + e | 0) + d | 0;
      caml_check_bound(r, i)[i + 1] = s & 67108863;
      var f = s >>> 26 | 0, g = i + 1 | 0;
      if(c === i) break;
      carry = f;
      i = g;
     }
    }
    return norm(r);
   }
   function sub(a, b){
    var
     la = a.length - 1,
     lb = b.length - 1,
     r = caml_make_vect(la, 0),
     c = la - 1 | 0;
    if(c >= 0){
     var borrow = 0, i = 0;
     for(;;){
      var
       d = i < lb ? caml_check_bound(b, i)[i + 1] : 0,
       s = (caml_check_bound(a, i)[i + 1] - borrow | 0) - d | 0,
       borrow$0 =
         0 <= s
          ? (caml_check_bound(r, i)[i + 1] = s, 0)
          : (caml_check_bound(r, i)[i + 1] = s + 67108864 | 0, 1),
       e = i + 1 | 0;
      if(c === i) break;
      borrow = borrow$0;
      i = e;
     }
    }
    return norm(r);
   }
   function mul(a, b){
    var
     la = a.length - 1,
     lb = b.length - 1,
     r = caml_make_vect(la + lb | 0, 0),
     c = la - 1 | 0;
    if(c >= 0){
     var i = 0;
     for(;;){
      var e = lb - 1 | 0, d = 0;
      if(e < 0)
       var carry$0 = d;
      else{
       var carry = d, j = 0;
       for(;;){
        var
         o = caml_check_bound(b, j)[j + 1],
         h = i + j | 0,
         p = runtime.caml_mul(caml_check_bound(a, i)[i + 1], o),
         s = (caml_check_bound(r, h)[h + 1] + p | 0) + carry | 0,
         k = i + j | 0;
        caml_check_bound(r, k)[k + 1] = s & 67108863;
        var l = s >>> 26 | 0, q = j + 1 | 0;
        if(e === j){var carry$0 = l; break;}
        carry = l;
        j = q;
       }
      }
      var
       f = i + lb | 0,
       g = i + lb | 0,
       m = caml_check_bound(r, f)[f + 1] + carry$0 | 0;
      caml_check_bound(r, g)[g + 1] = m;
      var n = i + 1 | 0;
      if(c === i) break;
      i = n;
     }
    }
    return norm(r);
   }
   function numbits(a){
    var a$0 = norm(a), hi = a$0.length - 2 | 0;
    if(0 === hi && 0 === caml_check_bound(a$0, 0)[1]) return 0;
    var v = caml_check_bound(a$0, hi)[hi + 1], b = 0;
    for(;;){
     if(0 >= v) return (hi * 26 | 0) + b | 0;
     var b$0 = b + 1 | 0;
     v = v >>> 1 | 0;
     b = b$0;
    }
   }
   function bit(a, i){
    var limb = i / 26 | 0, off = i % 26 | 0;
    return a.length - 1 <= limb
            ? 0
            : (caml_check_bound(a, limb)[limb + 1] >>> off | 0) & 1;
   }
   var bzero = [0, 0];
   function bn_mod(a, m){
    if(0 > cmp(a, m)) return norm(a);
    var b = numbits(a) - 1 | 0;
    if(b < 0)
     var r$3 = bzero;
    else{
     var r$0 = bzero, i = b;
     for(;;){
      var
       r = add(r$0, r$0),
       r$1 = 1 === bit(a, i) ? add(r, [0, 1]) : r,
       r$2 = 0 <= cmp(r$1, m) ? sub(r$1, m) : r$1,
       c = i - 1 | 0;
      if(0 === i){var r$3 = r$2; break;}
      r$0 = r$2;
      i = c;
     }
    }
    return r$3;
   }
   function powmod(b0, e, m){
    var d = bn_mod(b0, m), c = numbits(e) - 1 | 0, a = [0, 1];
    if(c < 0)
     var result$1 = a;
    else{
     var b = d, result = a, i = 0;
     for(;;){
      var
       result$0 = 1 === bit(e, i) ? bn_mod(mul(result, b), m) : result,
       f = bn_mod(mul(b, b), m),
       g = i + 1 | 0;
      if(c === i){var result$1 = result$0; break;}
      b = f;
      result = result$0;
      i = g;
     }
    }
    return result$1;
   }
   function of_bytes_be(s){
    var a = caml_ml_string_length(s) - 1 | 0;
    if(a < 0)
     var acc$0 = bzero;
    else{
     var acc = bzero, i = 0;
     for(;;){
      var
       c = [0, caml_string_get(s, i)],
       b = add(mul(acc, [0, 256]), c),
       d = i + 1 | 0;
      if(a === i){var acc$0 = b; break;}
      acc = b;
      i = d;
     }
    }
    return acc$0;
   }
   function div_small(a, d){
    var la = a.length - 1, q = caml_make_vect(la, 0), b = la - 1 | 0;
    if(b >= 0){
     var rem = 0, i = b;
     for(;;){
      var
       cur = rem << 26 | caml_check_bound(a, i)[i + 1],
       c = runtime.caml_div(cur, d);
      caml_check_bound(q, i)[i + 1] = c;
      var e = runtime.caml_mod(cur, d), f = i - 1 | 0;
      if(0 === i) break;
      rem = e;
      i = f;
     }
    }
    return norm(q);
   }
   function to_bytes_be(a, n){
    var b = Stdlib_Bytes[1].call(null, n, 0), c = n - 1 | 0, e = norm(a);
    if(c >= 0){
     var cur = e, i = c;
     for(;;){
      var
       q = div_small(cur, 256),
       d = sub(cur, mul(q, [0, 256])),
       r = is_zero(d) ? 0 : caml_check_bound(d, 0)[1];
      caml_bytes_set(b, i, Stdlib_Char[1].call(null, r));
      var f = i - 1 | 0;
      if(0 === i) break;
      cur = q;
      i = f;
     }
    }
    return Stdlib_Bytes[44].call(null, b);
   }
   var Der = [248, "Sx_rsa.Der", runtime.caml_fresh_oo_id(0)];
   function der_tlv(s, pos){
    if(caml_ml_string_length(s) < (pos + 2 | 0))
     throw caml_maybe_attach_backtrace([0, Der, "short"], 1);
    var tag = caml_string_get(s, pos), l0 = caml_string_get(s, pos + 1 | 0);
    if(128 <= l0){
     var nb = l0 & 127;
     if(caml_ml_string_length(s) < ((pos + 2 | 0) + nb | 0))
      throw caml_maybe_attach_backtrace([0, Der, "short len"], 1);
     var b = nb - 1 | 0, a = 0;
     if(b < 0)
      var v$0 = a;
     else{
      var v = a, i = 0;
      for(;;){
       var
        c = v << 8 | caml_string_get(s, (pos + 2 | 0) + i | 0),
        d = i + 1 | 0;
       if(b === i){var v$0 = c; break;}
       v = c;
       i = d;
      }
     }
     var hdr = 2 + nb | 0, hdr$0 = hdr, len = v$0;
    }
    else
     var hdr$0 = 2, len = l0;
    return [0, tag, pos + hdr$0 | 0, len, (pos + hdr$0 | 0) + len | 0];
   }
   function parse_spki(der){
    var match = der_tlv(der, 0), c = match[2];
    if(48 !== match[1])
     throw caml_maybe_attach_backtrace
            ([0, Der, "spki: outer not SEQUENCE"], 1);
    var
     after_alg = der_tlv(der, c)[4],
     match$0 = der_tlv(der, after_alg),
     bc = match$0[2],
     bt = match$0[1];
    if(3 !== bt)
     throw caml_maybe_attach_backtrace
            ([0, Der, "spki: expected BIT STRING"], 1);
    var
     rpk_start = bc + 1 | 0,
     match$1 = der_tlv(der, rpk_start),
     sc = match$1[2],
     st = match$1[1];
    if(48 !== st)
     throw caml_maybe_attach_backtrace
            ([0, Der, "spki: RSAPublicKey not SEQUENCE"], 1);
    var
     match$2 = der_tlv(der, sc),
     after_n = match$2[4],
     nl = match$2[3],
     nc = match$2[2],
     nt = match$2[1];
    if(2 !== nt)
     throw caml_maybe_attach_backtrace
            ([0, Der, "spki: modulus not INTEGER"], 1);
    var
     match$3 = der_tlv(der, after_n),
     el = match$3[3],
     ec = match$3[2],
     et = match$3[1];
    if(2 !== et)
     throw caml_maybe_attach_backtrace
            ([0, Der, "spki: exponent not INTEGER"], 1);
    var
     n = of_bytes_be(Stdlib_String[16].call(null, der, nc, nl)),
     e = of_bytes_be(Stdlib_String[16].call(null, der, ec, el));
    return [0, n, e];
   }
   function unhex(h){
    var
     n = caml_ml_string_length(h) / 2 | 0,
     b = runtime.caml_create_bytes(n),
     a = n - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var
       c = Stdlib_String[16].call(null, h, 2 * i | 0, 2),
       d = runtime.caml_int_of_string(Stdlib[28].call(null, "0x", c));
      caml_bytes_set(b, i, Stdlib_Char[1].call(null, d));
      var e = i + 1 | 0;
      if(a === i) break;
      i = e;
     }
    }
    return Stdlib_Bytes[44].call(null, b);
   }
   var
    sha256_digestinfo_prefix =
      "010\r\x06\t`\x86H\x01e\x03\x04\x02\x01\x05\0\x04 ";
   function verify(spki, msg, sig){
    try{
     var
      match = parse_spki(spki),
      e = match[2],
      n = match[1],
      k = (numbits(n) + 7 | 0) / 8 | 0;
     if(caml_ml_string_length(sig) !== k)
      var a = 0;
     else{
      var s = of_bytes_be(sig);
      if(0 <= cmp(s, n))
       var a = 0;
      else{
       var
        m = powmod(s, e, n),
        em = to_bytes_be(m, k),
        h = unhex(Sx_sha2[3].call(null, msg)),
        t = Stdlib[28].call(null, sha256_digestinfo_prefix, h),
        tlen = caml_ml_string_length(t);
       if(k < (tlen + 11 | 0))
        var a = 0;
       else{
        var
         b = 0 === caml_string_get(em, 0) ? 1 : 0,
         c = b ? 1 === caml_string_get(em, 1) ? 1 : 0 : b,
         ps_end = (k - tlen | 0) - 1 | 0,
         d = ps_end - 1 | 0;
        if(d < 2)
         var ok$1 = c;
        else{
         var ok = c, i = 2;
         for(;;){
          var ok$0 = 255 !== caml_string_get(em, i) ? 0 : ok, f = i + 1 | 0;
          if(d === i){var ok$1 = ok$0; break;}
          ok = ok$0;
          i = f;
         }
        }
        var
         ok$2 = 0 !== caml_string_get(em, ps_end) ? 0 : ok$1,
         a =
           Stdlib_String[16].call(null, em, ps_end + 1 | 0, tlen) !== t
            ? 0
            : ok$2;
       }
      }
     }
     return a;
    }
    catch(exn){return 0;}
   }
   runtime.caml_register_global
    (16,
     [0,
      26,
      67108864,
      67108863,
      norm,
      bzero,
      is_zero,
      cmp,
      add,
      sub,
      mul,
      numbits,
      bit,
      bn_mod,
      powmod,
      of_bytes_be,
      div_small,
      to_bytes_be,
      Der,
      der_tlv,
      parse_spki,
      sha256_digestinfo_prefix,
      unhex,
      verify],
     "Sx_rsa");
   return;
  }
  (globalThis));

//# 4607 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_sha3:[F(2)*,F(2)*,F(1)*,F(2)*,N,N,F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_check_bound = runtime.caml_check_bound,
    caml_int64_and = runtime.caml_int64_and,
    caml_int64_create_lo_mi_hi = runtime.caml_int64_create_lo_mi_hi,
    caml_int64_shift_left = runtime.caml_int64_shift_left,
    caml_int64_shift_right_unsigne = runtime.caml_int64_shift_right_unsigned,
    caml_int64_xor = runtime.caml_int64_xor,
    caml_make_vect = runtime.caml_make_vect,
    caml_obj_dup = runtime.caml_obj_dup;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_Int64 = global_data.Stdlib__Int64,
    lnot64 = Stdlib_Int64[11];
   function rotl64(x, n){
    return 0 === n
            ? x
            : runtime.caml_int64_or
              (caml_int64_shift_left(x, n),
               caml_int64_shift_right_unsigne(x, 64 - n | 0));
   }
   var
    rho =
      caml_obj_dup
       ([0,
         0,
         1,
         62,
         28,
         27,
         36,
         44,
         6,
         55,
         20,
         3,
         10,
         43,
         25,
         39,
         41,
         45,
         15,
         21,
         8,
         18,
         2,
         61,
         56,
         14]),
    rc =
      caml_obj_dup
       ([0,
         caml_int64_create_lo_mi_hi(1, 0, 0),
         caml_int64_create_lo_mi_hi(32898, 0, 0),
         caml_int64_create_lo_mi_hi(32906, 0, 32768),
         caml_int64_create_lo_mi_hi(32768, 128, 32768),
         caml_int64_create_lo_mi_hi(32907, 0, 0),
         caml_int64_create_lo_mi_hi(1, 128, 0),
         caml_int64_create_lo_mi_hi(32897, 128, 32768),
         caml_int64_create_lo_mi_hi(32777, 0, 32768),
         caml_int64_create_lo_mi_hi(138, 0, 0),
         caml_int64_create_lo_mi_hi(136, 0, 0),
         caml_int64_create_lo_mi_hi(32777, 128, 0),
         caml_int64_create_lo_mi_hi(10, 128, 0),
         caml_int64_create_lo_mi_hi(32907, 128, 0),
         caml_int64_create_lo_mi_hi(139, 0, 32768),
         caml_int64_create_lo_mi_hi(32905, 0, 32768),
         caml_int64_create_lo_mi_hi(32771, 0, 32768),
         caml_int64_create_lo_mi_hi(32770, 0, 32768),
         caml_int64_create_lo_mi_hi(128, 0, 32768),
         caml_int64_create_lo_mi_hi(32778, 0, 0),
         caml_int64_create_lo_mi_hi(10, 128, 32768),
         caml_int64_create_lo_mi_hi(32897, 128, 32768),
         caml_int64_create_lo_mi_hi(32896, 0, 32768),
         caml_int64_create_lo_mi_hi(1, 128, 0),
         caml_int64_create_lo_mi_hi(32776, 128, 32768)]),
    a = caml_int64_create_lo_mi_hi(0, 0, 0),
    b = caml_int64_create_lo_mi_hi(0, 0, 0),
    c = caml_int64_create_lo_mi_hi(0, 0, 0),
    d = caml_int64_create_lo_mi_hi(0, 0, 0),
    e = caml_int64_create_lo_mi_hi(255, 0, 0);
   function keccak_f(a$0){
    var
     c$0 = caml_make_vect(5, a),
     d = caml_make_vect(5, b),
     b$0 = caml_make_vect(25, c),
     round = 0;
    for(;;){
     var x$3 = 0;
     for(;;){
      var
       p = x$3 + 20 | 0,
       q = x$3 + 15 | 0,
       J = caml_check_bound(a$0, p)[p + 1],
       r = x$3 + 10 | 0,
       S = caml_int64_xor(caml_check_bound(a$0, q)[q + 1], J),
       s = x$3 + 5 | 0,
       R = caml_int64_xor(caml_check_bound(a$0, r)[r + 1], S),
       Q = caml_int64_xor(caml_check_bound(a$0, s)[s + 1], R),
       P = caml_int64_xor(caml_check_bound(a$0, x$3)[x$3 + 1], Q);
      caml_check_bound(c$0, x$3)[x$3 + 1] = P;
      var K = x$3 + 1 | 0;
      if(4 === x$3) break;
      x$3 = K;
     }
     var x$2 = 0;
     for(;;){
      var
       n = (x$2 + 1 | 0) % 5 | 0,
       o = (x$2 + 4 | 0) % 5 | 0,
       H = rotl64(caml_check_bound(c$0, n)[n + 1], 1),
       O = caml_int64_xor(caml_check_bound(c$0, o)[o + 1], H);
      caml_check_bound(d, x$2)[x$2 + 1] = O;
      var I = x$2 + 1 | 0;
      if(4 === x$2) break;
      x$2 = I;
     }
     var x$1 = 0;
     for(;;){
      var y$1 = 0;
      for(;;){
       var
        l = x$1 + (5 * y$1 | 0) | 0,
        F = caml_check_bound(d, x$1)[x$1 + 1],
        m = x$1 + (5 * y$1 | 0) | 0,
        N = caml_int64_xor(caml_check_bound(a$0, l)[l + 1], F);
       caml_check_bound(a$0, m)[m + 1] = N;
       var G = y$1 + 1 | 0;
       if(4 === y$1) break;
       y$1 = G;
      }
      var E = x$1 + 1 | 0;
      if(4 === x$1) break;
      x$1 = E;
     }
     var x$0 = 0;
     for(;;){
      var y$0 = 0;
      for(;;){
       var
        ny = ((2 * x$0 | 0) + (3 * y$0 | 0) | 0) % 5 | 0,
        i = x$0 + (5 * y$0 | 0) | 0,
        j = x$0 + (5 * y$0 | 0) | 0,
        B = caml_check_bound(rho, i)[i + 1],
        k = y$0 + (5 * ny | 0) | 0,
        C = rotl64(caml_check_bound(a$0, j)[j + 1], B);
       caml_check_bound(b$0, k)[k + 1] = C;
       var D = y$0 + 1 | 0;
       if(4 === y$0) break;
       y$0 = D;
      }
      var A = x$0 + 1 | 0;
      if(4 === x$0) break;
      x$0 = A;
     }
     var y = 0;
     a:
     for(;;){
      var x = 0;
      for(;;){
       var
        e = ((x + 2 | 0) % 5 | 0) + (5 * y | 0) | 0,
        f = ((x + 1 | 0) % 5 | 0) + (5 * y | 0) | 0,
        w = caml_check_bound(b$0, e)[e + 1],
        g = x + (5 * y | 0) | 0,
        M = caml_int64_and(lnot64(caml_check_bound(b$0, f)[f + 1]), w),
        h = x + (5 * y | 0) | 0,
        L = caml_int64_xor(caml_check_bound(b$0, g)[g + 1], M);
       caml_check_bound(a$0, h)[h + 1] = L;
       var z = x + 1 | 0;
       if(4 === x){
        var v = y + 1 | 0;
        if(4 !== y){y = v; break;}
        var t = caml_check_bound(rc, round)[round + 1];
        a$0[1] = caml_int64_xor(caml_check_bound(a$0, 0)[1], t);
        var u = round + 1 | 0;
        if(23 === round) return 0;
        round = u;
        break a;
       }
       x = z;
      }
     }
    }
   }
   var f = [0, [4, 6, [0, 2, 2], 0, 0], "%02x"];
   function sha3_256_hex(msg){
    var
     len = runtime.caml_ml_string_length(msg),
     q = 136 - (len % 136 | 0) | 0,
     padded = Stdlib_Bytes[1].call(null, len + q | 0, 0);
    Stdlib_Bytes[12].call(null, msg, 0, padded, 0, len);
    if(1 === q)
     caml_bytes_set(padded, len, 134);
    else{
     caml_bytes_set(padded, len, 6);
     caml_bytes_set(padded, (len + q | 0) - 1 | 0, 128);
    }
    var
     total = runtime.caml_ml_bytes_length(padded),
     a = caml_make_vect(25, d),
     nblocks = total / 136 | 0,
     b = nblocks - 1 | 0;
    if(b >= 0){
     var blk = 0;
     a:
     for(;;){
      var base = blk * 136 | 0, j$0 = 0;
      for(;;){
       var
        lane$0 = j$0 / 8 | 0,
        sh$0 = (j$0 % 8 | 0) * 8 | 0,
        byte$0 =
          runtime.caml_int64_of_int32
           (runtime.caml_bytes_get(padded, base + j$0 | 0));
       a[lane$0 + 1] =
        caml_int64_xor
         (caml_check_bound(a, lane$0)[lane$0 + 1],
          caml_int64_shift_left(byte$0, sh$0));
       var i = j$0 + 1 | 0;
       if(135 === j$0){
        keccak_f(a);
        var h = blk + 1 | 0;
        if(b === blk) break a;
        blk = h;
        break;
       }
       j$0 = i;
      }
     }
    }
    var out = Stdlib_Buffer[1].call(null, 64), j = 0;
    for(;;){
     var
      lane = j / 8 | 0,
      sh = (j % 8 | 0) * 8 | 0,
      byte =
        runtime.caml_int64_to_int32
         (caml_int64_and
           (caml_int64_shift_right_unsigne
             (caml_check_bound(a, lane)[lane + 1], sh),
            e)),
      c = caml_call1(Stdlib_Printf[4].call(null, f), byte);
     Stdlib_Buffer[16].call(null, out, c);
     var g = j + 1 | 0;
     if(31 === j) return Stdlib_Buffer[2].call(null, out);
     j = g;
    }
   }
   runtime.caml_register_global
    (12,
     [0,
      caml_int64_xor,
      caml_int64_and,
      lnot64,
      rotl64,
      rho,
      rc,
      keccak_f,
      sha3_256_hex],
     "Sx_sha3");
   return;
  }
  (globalThis));

//# 4888 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_primitives:[N,N,N,N,N,N,N,F(1),F(1),F(1),N,F(1),F(2),F(1),F(1),N,F(1),F(1),F(1),F(1),F(1),F(1)*,F(1),N,F(2),F(2),F(1),F(1),F(1),F(2),F(2),F(2),F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_bytes_get = runtime.caml_bytes_get,
    caml_bytes_set = runtime.caml_bytes_set,
    caml_check_bound = runtime.caml_check_bound,
    caml_create_bytes = runtime.caml_create_bytes,
    caml_div = runtime.caml_div,
    caml_equal = runtime.caml_equal,
    caml_float_of_string = runtime.caml_float_of_string,
    caml_int_of_string = runtime.caml_int_of_string,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_bytes_length = runtime.caml_ml_bytes_length,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_mod = runtime.caml_mod,
    caml_mul = runtime.caml_mul,
    caml_obj_dup = runtime.caml_obj_dup,
    caml_round_float = runtime.caml_round_float,
    caml_string_get = runtime.caml_string_get,
    caml_sys_file_exists = runtime.caml_sys_file_exists,
    caml_sys_read_directory = runtime.caml_sys_read_directory,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Stdlib = global_data.Stdlib,
    Stdlib_Float = global_data.Stdlib__Float,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Sx_types = global_data.Sx_types,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Char = global_data.Stdlib__Char,
    Stdlib_List = global_data.Stdlib__List,
    Sx_rsa = global_data.Sx_rsa,
    Sx_ed25519 = global_data.Sx_ed25519,
    Sx_cid = global_data.Sx_cid,
    Sx_cbor = global_data.Sx_cbor,
    Sx_sha3 = global_data.Sx_sha3,
    Sx_sha2 = global_data.Sx_sha2,
    Stdlib_Queue = global_data.Stdlib__Queue,
    Unix = global_data.Unix,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_Bytes = global_data.Stdlib__Bytes,
    Stdlib_Filename = global_data.Stdlib__Filename,
    Sx_parser = global_data.Sx_parser,
    Re = global_data.Re,
    Re_Pcre = global_data.Re__Pcre,
    Stdlib_Uchar = global_data.Stdlib__Uchar,
    Stdlib_Scanf = global_data.Stdlib__Scanf,
    primitives = Stdlib_Hashtbl[1].call(null, 0, 128),
    sx_call_fn =
      [0,
       function(a, param){
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "sx_call not initialized"], 1);
       }],
    sx_trampoline_fn = [0, function(v){return v;}],
    scope_stacks = Stdlib_Hashtbl[1].call(null, 0, 8),
    scope_trace = [0, 0],
    scope_log = [0, 0];
   function scope_trace_enable(param){
    scope_trace[1] = 1;
    scope_log[1] = 0;
    return 0;
   }
   function scope_trace_disable(param){scope_trace[1] = 0; return 0;}
   function scope_trace_drain(param){
    var log = Stdlib_List[10].call(null, scope_log[1]);
    scope_log[1] = 0;
    return log;
   }
   var request_cookies = Stdlib_Hashtbl[1].call(null, 0, 8);
   function scope_clear_all(param){
    return Stdlib_Hashtbl[2].call(null, scope_stacks);
   }
   function register(name, fn){
    return Stdlib_Hashtbl[11].call(null, primitives, name, fn);
   }
   function is_primitive(name){
    return Stdlib_Hashtbl[9].call(null, primitives, name);
   }
   function get_primitive(name){
    var match = Stdlib_Hashtbl[7].call(null, primitives, name);
    if(match){var fn = match[1]; return [15, name, fn];}
    var a = Stdlib[28].call(null, "Unknown primitive: ", name);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
   }
   var
    trampoline_hook = [0, function(v){return v;}],
    cst_Expected_number_got = "Expected number, got ";
   function as_int(v){
    if(typeof v !== "number")
     switch(v[0]){
       case 1:
        var n = v[1]; return n;
       case 2:
        var n$0 = v[1]; return n$0 | 0;
     }
    var
     a = Sx_types[61].call(null, v),
     b = Stdlib[28].call(null, cst_Expected_number_got, a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   function a(param){
    if(typeof param !== "number" && 1 === param[0]) return 1;
    return 0;
   }
   var b = Stdlib_List[33];
   function all_ints(c){return b(a, c);}
   var
    cst = "",
    cst$0 = ": ",
    cst_signal = "__signal",
    cst_dict = "dict",
    cst_value = "value";
   function as_number(t$1){
    a:
    {
     var t = t$1;
     for(;;){
      if(typeof t === "number") break;
      switch(t[0]){
        case 0:
         return t[1] ? 1. : 0.;
        case 1:
         var n = t[1]; return n;
        case 2:
         var n$0 = t[1]; return n$0;
        case 3:
         var s = t[1], match$0 = Stdlib[36].call(null, s);
         if(! match$0) return Stdlib_Float[8];
         var n$1 = match$0[1];
         return n$1;
        case 12:
         var t$0 = caml_call1(trampoline_hook[1], t); t = t$0; break;
        case 34:
         var d$0 = t[2], n$2 = t[1]; return n$2 / d$0;
        default: break a;
      }
     }
     if(0 === t) return 0.;
    }
    if(typeof t === "number" || ! (7 === t[0]))
     var a = cst;
    else{
     var d = t[1];
     if(Stdlib_Hashtbl[7].call(null, d, cst_signal)){
      var match = Stdlib_Hashtbl[7].call(null, d, cst_value);
      if(match)
       var v = match[1], b = Sx_types[35].call(null, v);
      else
       var b = "?";
      var
       h = Stdlib[28].call(null, b, "}"),
       a = Stdlib[28].call(null, "signal{value=", h);
     }
     else
      var a = cst_dict;
    }
    var
     c = Stdlib[28].call(null, cst$0, a),
     e = Sx_types[61].call(null, t),
     f = Stdlib[28].call(null, e, c),
     g = Stdlib[28].call(null, cst_Expected_number_got, f);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
   }
   function as_string(v){
    if(typeof v !== "number" && 3 === v[0]){var s = v[1]; return s;}
    var
     a = Sx_types[61].call(null, v),
     b = Stdlib[28].call(null, "Expected string, got ", a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   function as_list(t$1){
    var t = t$1;
    for(;;){
     if(typeof t === "number"){if(0 === t) return 0;}
     else
      switch(t[0]){
        case 6:
         var l = t[1]; return l;
        case 12:
         var t$0 = caml_call1(sx_trampoline_fn[1], t); t = t$0; continue;
        case 21:
         var r = t[1]; return r[1];
      }
     var
      a = Sx_types[61].call(null, t),
      b = Stdlib[28].call(null, "Expected list, got ", a);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
    }
   }
   function as_bool(v){
    if(typeof v !== "number" && 0 === v[0]){var b = v[1]; return b;}
    return Sx_types[71].call(null, v);
   }
   var cst_false = "false", cst_true = "true";
   function to_string(t$1){
    var t = t$1;
    for(;;){
     if(typeof t === "number"){if(0 === t) return cst;}
     else
      switch(t[0]){
        case 0:
         return t[1] ? cst_true : cst_false;
        case 1:
         var n = t[1]; return Stdlib[33].call(null, n);
        case 2:
         var n$0 = t[1]; return Sx_types[34].call(null, n$0);
        case 12:
         var t$0 = caml_call1(trampoline_hook[1], t); t = t$0; continue;
        case 3:
        case 4:
        case 5:
        case 17:
        case 19:
         var s = t[1]; return s;
      }
     return Sx_types[117].call(null, t);
    }
   }
   function rat_gcd(a, b){
    var
     b$2 = Stdlib[18].call(null, b),
     a$1 = Stdlib[18].call(null, a),
     a$0 = a$1,
     b$0 = b$2;
    for(;;){
     if(0 === b$0) return a$0;
     var b$1 = caml_mod(a$0, b$0);
     a$0 = b$0;
     b$0 = b$1;
    }
   }
   var cst_rational_division_by_zero = "rational: division by zero";
   function make_rat(n, d){
    if(0 === d)
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[9], cst_rational_division_by_zero], 1);
    var
     sign = 0 <= d ? 1 : -1,
     a = Stdlib[18].call(null, d),
     g = rat_gcd(Stdlib[18].call(null, n), a),
     rn = caml_div(caml_mul(sign, n), g),
     rd = caml_div(caml_mul(sign, d), g);
    return 1 === rd ? [1, rn] : [34, rn, rd];
   }
   function rat_of_val(v){
    if(typeof v !== "number")
     switch(v[0]){
       case 1:
        var n = v[1]; return [0, n, 1];
       case 34:
        var d = v[2], n$0 = v[1]; return [0, n$0, d];
     }
    var
     a = Sx_types[61].call(null, v),
     b = Stdlib[28].call(null, "expected integer or rational, got ", a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   function has_rational(args){
    return Stdlib_List[34].call
            (null,
             function(param){
              if(typeof param !== "number" && 34 === param[0]) return 1;
              return 0;
             },
             args);
   }
   function has_float(args){
    return Stdlib_List[34].call
            (null,
             function(param){
              if(typeof param !== "number" && 2 === param[0]) return 1;
              return 0;
             },
             args);
   }
   function rat_add(a, param){
    var bd = param[2], bn = param[1], ad = a[2], an = a[1];
    return make_rat(caml_mul(an, bd) + caml_mul(bn, ad) | 0, caml_mul(ad, bd));
   }
   function rat_sub(a, param){
    var bd = param[2], bn = param[1], ad = a[2], an = a[1];
    return make_rat(caml_mul(an, bd) - caml_mul(bn, ad) | 0, caml_mul(ad, bd));
   }
   function rat_mul(a, param){
    var bd = param[2], bn = param[1], ad = a[2], an = a[1];
    return make_rat(caml_mul(an, bn), caml_mul(ad, bd));
   }
   function rat_div(a, param){
    var bd = param[2], bn = param[1], ad = a[2], an = a[1];
    if(0 === bn)
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[9], cst_rational_division_by_zero], 1);
    return make_rat(caml_mul(an, bd), caml_mul(ad, bn));
   }
   var
    cst$1 = " ",
    cst_d_d = "%d/%d",
    cst_g = "%g",
    c = [0, [8, [0, 0, 3], 0, 0, 0], cst_g],
    d = [0, [11, "#\\", [0, 0]], "#\\%c"],
    e = [0, [4, 0, 0, 0, [12, 47, [4, 0, 0, 0, 0]]], cst_d_d];
   function sx_write_val(v){
    if(typeof v === "number") return 0 === v ? "()" : "#!eof";
    switch(v[0]){
      case 0:
       return v[1] ? "#t" : "#f";
      case 1:
       var n = v[1]; return Stdlib[33].call(null, n);
      case 2:
       var n$0 = v[1], s = caml_call1(Stdlib_Printf[4].call(null, c), n$0);
       if
        (!
         Stdlib_String[15].call(null, s, 46)
         && ! Stdlib_String[15].call(null, s, 101))
        return s;
       return s;
      case 3:
       var
        s$0 = v[1],
        buf = Stdlib_Buffer[1].call(null, caml_ml_string_length(s$0) + 2 | 0);
       Stdlib_Buffer[12].call(null, buf, 34);
       Stdlib_String[30].call
        (null,
         function(c){
          if(34 === c) return Stdlib_Buffer[16].call(null, buf, '\\"');
          if(14 <= c){
           if(92 === c) return Stdlib_Buffer[16].call(null, buf, "\\\\");
          }
          else if(9 <= c)
           switch(c - 9 | 0){
             case 0:
              return Stdlib_Buffer[16].call(null, buf, "\\t");
             case 1:
              return Stdlib_Buffer[16].call(null, buf, "\\n");
             case 4:
              return Stdlib_Buffer[16].call(null, buf, "\\r");
           }
          return Stdlib_Buffer[12].call(null, buf, c);
         },
         s$0);
       Stdlib_Buffer[12].call(null, buf, 34);
       return Stdlib_Buffer[2].call(null, buf);
      case 4:
       var s$1 = v[1]; return s$1;
      case 5:
       var k = v[1]; return Stdlib[28].call(null, ":", k);
      case 6:
       var items = v[1]; break;
      case 21:
       var items = v[1][1]; break;
      case 32:
       var n$1 = v[1];
       if(32 === n$1) return "#\\space";
       if(10 === n$1) return "#\\newline";
       if(9 === n$1) return "#\\tab";
       var g = Stdlib_Char[1].call(null, n$1 & 255);
       return caml_call1(Stdlib_Printf[4].call(null, d), g);
      case 34:
       var d$0 = v[2], n$2 = v[1];
       return caml_call2(Stdlib_Printf[4].call(null, e), n$2, d$0);
      default: return Sx_types[117].call(null, v);
    }
    var
     a = Stdlib_List[20].call(null, sx_write_val, items),
     b = Stdlib_String[7].call(null, cst$1, a),
     f = Stdlib[28].call(null, b, ")");
    return Stdlib[28].call(null, "(", f);
   }
   function sx_display_val(v){
    if(typeof v !== "number")
     switch(v[0]){
       case 3:
        var s = v[1]; return s;
       case 32:
        var n = v[1], a = Stdlib_Char[1].call(null, n & 255);
        return Stdlib_String[1].call(null, 1, a);
     }
    return sx_write_val(v);
   }
   var f = [1, 0];
   register
    ("+",
     function(args){
      if(b(a, args))
       return [1,
               Stdlib_List[26].call
                (null,
                 function(acc, a){
                  if(typeof a !== "number" && 1 === a[0]){var n = a[1]; return acc + n | 0;}
                  return acc;
                 },
                 0,
                 args)];
      if(has_rational(args) && ! has_float(args))
       return Stdlib_List[26].call
               (null,
                function(acc, a){
                 if(typeof acc !== "number")
                  switch(acc[0]){
                    case 1:
                     var an = acc[1]; return rat_add([0, an, 1], rat_of_val(a));
                    case 34:
                     var ad = acc[2], an$0 = acc[1];
                     return rat_add([0, an$0, ad], rat_of_val(a));
                  }
                 return acc;
                },
                f,
                args);
      return [2,
              Stdlib_List[26].call
               (null, function(acc, a){return acc + as_number(a);}, 0., args)];
     });
   var cst$5 = "-", g = [2, 0.], h = [1, 0], i = [1, 0];
   register
    (cst$5,
     function(args){
      if(! args) return i;
      var a$0 = args[1];
      a:
      {
       if(typeof a$0 !== "number")
        switch(a$0[0]){
          case 1:
           if(args[2]) break a; var n = a$0[1]; return [1, - n | 0];
          case 34:
           if(args[2]) break a;
           var d = a$0[2], n$0 = a$0[1];
           return make_rat(- n$0 | 0, d);
        }
       if(! args[2]) return [2, - as_number(a$0)];
      }
      if(! b(a, args)){
       if(has_rational(args) && ! has_float(args)){
        if(! args) return h;
        var tl$0 = args[2], h$1 = args[1];
        return Stdlib_List[26].call
                (null,
                 function(acc, a){
                  if(typeof acc !== "number")
                   switch(acc[0]){
                     case 1:
                      var an = acc[1]; return rat_sub([0, an, 1], rat_of_val(a));
                     case 34:
                      var ad = acc[2], an$0 = acc[1];
                      return rat_sub([0, an$0, ad], rat_of_val(a));
                   }
                  return acc;
                 },
                 h$1,
                 tl$0);
       }
       var rest = args[2], a$1 = args[1], c = as_number(a$1);
       return [2,
               Stdlib_List[26].call
                (null, function(acc, x){return acc - as_number(x);}, c, rest)];
      }
      if(args){
       var match = args[1];
       if(typeof match !== "number" && 1 === match[0]){
        var tl = args[2], h$0 = match[1];
        return [1,
                Stdlib_List[26].call
                 (null,
                  function(acc, a){
                   if(typeof a !== "number" && 1 === a[0]){var n = a[1]; return acc - n | 0;}
                   return acc;
                  },
                  h$0,
                  tl)];
       }
      }
      return g;
     });
   var j = [1, 1];
   register
    ("*",
     function(args){
      if(b(a, args))
       return [1,
               Stdlib_List[26].call
                (null,
                 function(acc, a){
                  if(typeof a !== "number" && 1 === a[0]){var n = a[1]; return caml_mul(acc, n);
                  }
                  return acc;
                 },
                 1,
                 args)];
      if(has_rational(args) && ! has_float(args))
       return Stdlib_List[26].call
               (null,
                function(acc, a){
                 if(typeof acc !== "number")
                  switch(acc[0]){
                    case 1:
                     var an = acc[1]; return rat_mul([0, an, 1], rat_of_val(a));
                    case 34:
                     var ad = acc[2], an$0 = acc[1];
                     return rat_mul([0, an$0, ad], rat_of_val(a));
                  }
                 return acc;
                },
                j,
                args);
      return [2,
              Stdlib_List[26].call
               (null, function(acc, a){return acc * as_number(a);}, 1., args)];
     });
   var cst$6 = "/";
   register
    (cst$6,
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           var e = args[2];
           if(! e) break a;
           var c = e[1], a$0 = a[1];
           if(typeof c !== "number")
            switch(c[0]){
              case 1:
               if(e[2]) break a; var b$0 = c[1]; return make_rat(a$0, b$0);
              case 34:
               if(e[2]) break a;
               var bd = c[2], bn = c[1];
               return make_rat(caml_mul(a$0, bd), bn);
            }
           break;
          case 34:
           var f = args[2];
           if(! f) break a;
           var d = f[1], ad = a[2], an = a[1];
           if(typeof d !== "number")
            switch(d[0]){
              case 1:
               if(f[2]) break a;
               var b$1 = d[1];
               return make_rat(an, caml_mul(ad, b$1));
              case 34:
               if(f[2]) break a;
               var bd$0 = d[2], bn$0 = d[1];
               return rat_div([0, an, ad], [0, bn$0, bd$0]);
            }
           break;
        }
       var g = args[2];
       if(g && ! g[2]){
        var b = g[1], h = as_number(b);
        return [2, as_number(a) / h];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "/: expected 2 args"], 1);
     });
   register
    ("mod",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 1 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [1, caml_mod(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], f = as_number(b);
        return [2, as_number(a) % f];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "mod: expected 2 args"], 1);
     });
   register
    ("inc",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n = a[1];
        return [1, n + 1 | 0];
       }
       if(! args[2]) return [2, as_number(a) + 1.];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "inc: 1 arg"], 1);
     });
   register
    ("dec",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n = a[1];
        return [1, n - 1 | 0];
       }
       if(! args[2]) return [2, as_number(a) - 1.];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "dec: 1 arg"], 1);
     });
   register
    ("abs",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n = a[1];
        return [1, Stdlib[18].call(null, n)];
       }
       if(! args[2]) return [2, Math.abs(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "abs: 1 arg"], 1);
     });
   register
    ("floor",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n = a[1];
        return [1, n];
       }
       if(! args[2]) return [1, Math.floor(as_number(a)) | 0];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "floor: 1 arg"], 1);
     });
   register
    ("ceil",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n = a[1];
        return [1, n];
       }
       if(! args[2]) return [1, Math.ceil(as_number(a)) | 0];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "ceil: 1 arg"], 1);
     });
   register
    ("round",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0] && ! args[2]){var n$0 = a[1]; return [1, n$0];}
       var match = args[2];
       if(! match) return [1, caml_round_float(as_number(a)) | 0];
       if(! match[2]){
        var
         b = match[1],
         n = as_number(a),
         places = as_int(b),
         factor = Math.pow(10., places);
        return [2, caml_round_float(n * factor) / factor];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "round: 1-2 args"], 1);
     });
   register
    ("min",
     function(args){
      if(args)
       return b(a, args)
               ? [1,
                 Stdlib_List[26].call
                  (null,
                   function(acc, a){
                    if(typeof a !== "number" && 1 === a[0]){
                     var n = a[1];
                     return Stdlib[16].call(null, acc, n);
                    }
                    return acc;
                   },
                   Stdlib[19],
                   args)]
               : [2,
                 Stdlib_List[26].call
                  (null,
                   function(acc, a){
                    var b = as_number(a);
                    return Stdlib_Float[23].call(null, acc, b);
                   },
                   Stdlib_Float[6],
                   args)];
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "min: at least 1 arg"], 1);
     });
   register
    ("max",
     function(args){
      if(args)
       return b(a, args)
               ? [1,
                 Stdlib_List[26].call
                  (null,
                   function(acc, a){
                    if(typeof a !== "number" && 1 === a[0]){
                     var n = a[1];
                     return Stdlib[17].call(null, acc, n);
                    }
                    return acc;
                   },
                   Stdlib[20],
                   args)]
               : [2,
                 Stdlib_List[26].call
                  (null,
                   function(acc, a){
                    var b = as_number(a);
                    return Stdlib_Float[24].call(null, acc, b);
                   },
                   Stdlib_Float[7],
                   args)];
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "max: at least 1 arg"], 1);
     });
   register
    ("sqrt",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.sqrt(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "sqrt: 1 arg"], 1);
     });
   register
    ("pow",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1], d = as_number(b);
        return [2, Math.pow(as_number(a), d)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "pow: 2 args"], 1);
     });
   register
    ("cbrt",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_cbrt_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "cbrt: 1 arg"], 1);
     });
   register
    ("exp",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.exp(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "exp: 1 arg"], 1);
     });
   register
    ("expm1",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_expm1_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "expm1: 1 arg"], 1);
     });
   register
    ("log",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.log(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "log: 1 arg"], 1);
     });
   register
    ("log2",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.log(as_number(a)) / 0.6931471805599453];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "log2: 1 arg"], 1);
     });
   register
    ("log10",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_log10_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "log10: 1 arg"], 1);
     });
   register
    ("log1p",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_log1p_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "log1p: 1 arg"], 1);
     });
   register
    ("sin",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.sin(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "sin: 1 arg"], 1);
     });
   register
    ("cos",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.cos(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "cos: 1 arg"], 1);
     });
   register
    ("tan",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.tan(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "tan: 1 arg"], 1);
     });
   register
    ("asin",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.asin(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "asin: 1 arg"], 1);
     });
   register
    ("acos",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, Math.acos(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "acos: 1 arg"], 1);
     });
   register
    ("atan",
     function(args){
      if(args){
       var match = args[2], a = args[1];
       if(! match) return [2, Math.atan(as_number(a))];
       if(! match[2]){
        var x = match[1], b = as_number(x);
        return [2, Math.atan2(as_number(a), b)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "atan: 1-2 args"], 1);
     });
   register
    ("atan2",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1], d = as_number(b);
        return [2, Math.atan2(as_number(a), d)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "atan2: 2 args"], 1);
     });
   register
    ("sinh",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_sinh_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "sinh: 1 arg"], 1);
     });
   register
    ("cosh",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_cosh_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "cosh: 1 arg"], 1);
     });
   register
    ("tanh",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_tanh_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "tanh: 1 arg"], 1);
     });
   register
    ("asinh",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_asinh_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "asinh: 1 arg"], 1);
     });
   register
    ("acosh",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_acosh_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "acosh: 1 arg"], 1);
     });
   register
    ("atanh",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2, runtime.caml_atanh_float(as_number(a))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "atanh: 1 arg"], 1);
     });
   register
    ("hypot",
     function(args){
      var
       sum =
         Stdlib_List[26].call
          (null,
           function(acc, a){var x = as_number(a); return acc + x * x;},
           0.,
           args);
      return [2, Math.sqrt(sum)];
     });
   register
    ("sign",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n$0 = a[1], c = 0 < n$0 ? 1 : 0 <= n$0 ? 0 : -1;
        return [1, c];
       }
       if(! args[2]){
        var
         n = as_number(a),
         b =
           Stdlib_Float[17].call(null, n)
            ? Stdlib_Float[8]
            : 0. < n ? 1. : n < 0. ? -1. : n;
        return [2, b];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "sign: 1 arg"], 1);
     });
   register
    ("fround",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [2,
               runtime.caml_int32_float_of_bits
                (runtime.caml_int32_bits_of_float(as_number(a)))];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "fround: 1 arg"], 1);
     });
   var k = [2, 32.];
   register
    ("clz32",
     function(args){
      if(args && ! args[2]){
       var a = args[1], n = as_number(a);
       a:
       {
        if
         (! Stdlib_Float[17].call(null, n) && ! Stdlib_Float[16].call(null, n)){var i = n % 4294967296. | 0; break a;}
        var i = 0;
       }
       if(caml_equal(i, 0)) return k;
       var x = i, count = 0;
       for(;;){
        if(! caml_equal(x & -2147483648, 0)) return [2, count];
        var count$0 = count + 1 | 0;
        x = x << 1;
        count = count$0;
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "clz32: 1 arg"], 1);
     });
   register
    ("imul",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var
         b = c[1],
         a = args[1],
         tou32 =
           function(f){
            if
             (!
              Stdlib_Float[17].call(null, f)
              && ! Stdlib_Float[16].call(null, f))
             return f % 4294967296. | 0;
            return 0;
           },
         ai = tou32(as_number(a)),
         bi = tou32(as_number(b)),
         r = caml_mul(ai, bi);
        return [2, r];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "imul: 2 args"], 1);
     });
   register
    ("clamp",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[2];
        if(b && ! b[2]){
         var
          hi = b[1],
          lo = a[1],
          x = args[1],
          x$0 = as_number(x),
          lo$0 = as_number(lo),
          hi$0 = as_number(hi),
          c = Stdlib_Float[23].call(null, hi$0, x$0);
         return [2, Stdlib_Float[24].call(null, lo$0, c)];
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "clamp: 3 args"], 1);
     });
   register
    ("truncate",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        if(args[2]) break a;
        var n$0 = a[1];
        return [1, n$0];
       }
       if(! args[2]){
        var n = as_number(a), b = 0. <= n ? Math.floor(n) : Math.ceil(n);
        return [1, b | 0];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "truncate: 1 arg"], 1);
     });
   register
    ("remainder",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 1 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [1, caml_mod(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], f = as_number(b);
        return [2, as_number(a) % f];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "remainder: 2 args"], 1);
     });
   register
    ("modulo",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 1 === e[0]){
         if(d[2]) break a;
         var
          b$1 = e[1],
          a$1 = a[1],
          r$1 = caml_mod(a$1, b$1),
          r$2 =
            0 === r$1
             ? r$1
             : (0 < r$1 ? 1 : 0) === (0 < b$1 ? 1 : 0) ? r$1 : r$1 + b$1 | 0;
         return [1, r$2];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var
         b = c[1],
         a$0 = as_number(a),
         b$0 = as_number(b),
         r = a$0 % b$0,
         r$0 =
           r === 0.
            ? r
            : (0. < r ? 1 : 0) === (0. < b$0 ? 1 : 0) ? r : r + b$0;
        return [2, r$0];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "modulo: 2 args"], 1);
     });
   var l = [0, 0], m = [0, 1], n = [0, 0];
   register
    ("exact?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(args[2]) break a; return m;
          case 2:
           if(args[2]) break a; return n;
        }
       if(! args[2]) return l;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "exact?: 1 arg"], 1);
     });
   var o = [0, 0], p = [0, 0], q = [0, 1];
   register
    ("inexact?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(args[2]) break a; return p;
          case 2:
           if(args[2]) break a; return q;
        }
       if(! args[2]) return o;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "inexact?: 1 arg"], 1);
     });
   register
    ("exact->inexact",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(args[2]) break a; var n = a[1]; return [2, n];
          case 2:
           if(args[2]) break a; var n$0 = a[1]; return [2, n$0];
          case 34:
           if(args[2]) break a; var d = a[2], n$1 = a[1]; return [2, n$1 / d];
        }
       if(! args[2]) return [2, as_number(a)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "exact->inexact: 1 arg"], 1);
     });
   register
    ("inexact->exact",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(args[2]) break a; var n = a[1]; return [1, n];
          case 2:
           if(args[2]) break a;
           var n$0 = a[1];
           return [1, caml_round_float(n$0) | 0];
        }
       if(! args[2]) return [1, caml_round_float(as_number(a)) | 0];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "inexact->exact: 1 arg"], 1);
     });
   register
    ("expt",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var f = d[1];
        if(typeof f !== "number" && 1 === f[0]){
         if(d[2]) break a;
         var b$0 = f[1], base = a[1];
         if(0 <= b$0){
          var e = b$0, acc = 1;
          for(;;){
           if(0 === e) return [1, acc];
           var acc$0 = caml_mul(acc, base), e$0 = e - 1 | 0;
           e = e$0;
           acc = acc$0;
          }
         }
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], g = as_number(b);
        return [2, Math.pow(as_number(a), g)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "expt: 2 args"], 1);
     });
   register
    ("quotient",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 1 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [1, caml_div(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var
         b = c[1],
         f = as_number(b),
         n = as_number(a) / f,
         g = 0. <= n ? Math.floor(n) : Math.ceil(n);
        return [1, g | 0];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "quotient: 2 args"], 1);
     });
   function igcd(a$0, b$1){
    var a = a$0, b = b$1;
    for(;;){if(0 === b) return a; var b$0 = caml_mod(a, b); a = b; b = b$0;}
   }
   register
    ("gcd",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 1 === e[0]){
         if(d[2]) break a;
         var b$3 = e[1], a$2 = a[1], f = Stdlib[18].call(null, b$3);
         return [1, igcd(Stdlib[18].call(null, a$2), f)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var
         b = c[1],
         b$2 = Math.abs(as_number(b)),
         a$1 = Math.abs(as_number(a)),
         a$0 = a$1,
         b$0 = b$2;
        for(;;){
         if(b$0 === 0.) return [2, a$0];
         var b$1 = a$0 % b$0;
         a$0 = b$0;
         b$0 = b$1;
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "gcd: 2 args"], 1);
     });
   var r = [2, 0.], s = [1, 0];
   register
    ("lcm",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 1 === e[0]){
         if(d[2]) break a;
         var
          b$3 = e[1],
          a$2 = a[1],
          f = Stdlib[18].call(null, b$3),
          g = igcd(Stdlib[18].call(null, a$2), f);
         if(0 === g) return s;
         var h = Stdlib[18].call(null, b$3);
         return [1, caml_mul(caml_div(Stdlib[18].call(null, a$2), g), h)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var
         b = c[1],
         a$0 = Math.abs(as_number(a)),
         b$0 = Math.abs(as_number(b)),
         a$1 = a$0,
         b$1 = b$0;
        for(;;){
         if(b$1 === 0.) return a$1 === 0. ? r : [2, a$0 / a$1 * b$0];
         var b$2 = a$1 % b$1;
         a$1 = b$1;
         b$1 = b$2;
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "lcm: 2 args"], 1);
     });
   var
    cst_0 = "0",
    t = [0, [8, [0, 0, 3], 0, 0, 0], cst_g],
    u = [0, [4, 0, 0, 0, [12, 47, [4, 0, 0, 0, 0]]], cst_d_d];
   register
    ("number->string",
     function(args){
      function int_to_radix(n, r){
       if(0 === n) return cst_0;
       var neg = n < 0, buf = Stdlib_Buffer[1].call(null, 16);
       function go(n){
        var a = 0 < n ? 1 : 0;
        if(! a) return a;
        go(caml_div(n, r));
        var
         b =
           caml_string_get
            ("0123456789abcdefghijklmnopqrstuvwxyz", caml_mod(n, r));
        return Stdlib_Buffer[12].call(null, buf, b);
       }
       go(Stdlib[18].call(null, n));
       var a = Stdlib_Buffer[2].call(null, buf), b = neg ? cst$5 : cst;
       return Stdlib[28].call(null, b, a);
      }
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        var
         cst_number_string_radix_out_of = "number->string: radix out of range";
        switch(a[0]){
          case 1:
           var match = args[2], n = a[1];
           if(! match) return [3, Stdlib[33].call(null, n)];
           var b = match[1];
           if(typeof b !== "number" && 1 === b[0] && ! match[2]){
            var r = b[1], e = r < 2, g = e || 36 < r;
            if(g)
             throw caml_maybe_attach_backtrace
                    ([0, Sx_types[9], cst_number_string_radix_out_of], 1);
            return [3, int_to_radix(n, r)];
           }
           break;
          case 2:
           var match$0 = args[2], f = a[1];
           if(! match$0)
            return [3, caml_call1(Stdlib_Printf[4].call(null, t), f)];
           var c = match$0[1];
           if(typeof c !== "number" && 1 === c[0] && ! match$0[2]){
            var r$0 = c[1], h = r$0 < 2, i = h || 36 < r$0;
            if(i)
             throw caml_maybe_attach_backtrace
                    ([0, Sx_types[9], cst_number_string_radix_out_of], 1);
            return [3, int_to_radix(f | 0, r$0)];
           }
           break;
          case 34:
           if(! args[2]){
            var d = a[2], n$0 = a[1];
            return [3, caml_call2(Stdlib_Printf[4].call(null, u), n$0, d)];
           }
           break;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "number->string: 1-2 args"], 1);
     });
   register
    ("string->number",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var match = args[2], s = a[1];
        if(! match)
         try{var m = [1, caml_int_of_string(s)]; return m;}
         catch(exn){
          try{var l = [2, caml_float_of_string(s)]; return l;}
          catch(exn){return 0;}
         }
        var b = match[1];
        if(typeof b !== "number" && 1 === b[0] && ! match[2]){
         var r = b[1];
         try{
          var
           e = 0 < caml_ml_string_length(s),
           neg = e ? 45 === caml_string_get(s, 0) : e,
           start = neg ? 1 : 0,
           g = caml_ml_string_length(s) - 1 | 0,
           f = 0;
          if(g < start)
           var n$0 = f;
          else{
           var n = f, i = start;
           for(;;){
            var c = caml_string_get(s, i);
            a:
            {
             if(48 <= c && 57 >= c){var d = c - 48 | 0; break a;}
             if(97 <= c && 122 >= c){var d = c - 87 | 0; break a;}
             if(65 <= c && 90 >= c){var d = c - 55 | 0; break a;}
             throw caml_maybe_attach_backtrace(Stdlib[3], 1);
            }
            if(r <= d) throw caml_maybe_attach_backtrace(Stdlib[3], 1);
            var h = caml_mul(n, r) + d | 0, k = i + 1 | 0;
            if(g === i){var n$0 = h; break;}
            n = h;
            i = k;
           }
          }
          var j = neg ? - n$0 | 0 : n$0;
          return [1, j];
         }
         catch(exn){return 0;}
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string->number: 1-2 args"], 1);
     });
   function make_rational_val(n, d){
    if(0 === d)
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[9], "make-rational: denominator cannot be zero"], 1);
    var
     sign = 0 <= d ? 1 : -1,
     b$1 = Stdlib[18].call(null, d),
     a$0 = Stdlib[18].call(null, n),
     a = a$0,
     b = b$1;
    for(;;){
     if(0 === b){
      var
       rn = caml_div(caml_mul(sign, n), a),
       rd = caml_div(caml_mul(sign, d), a);
      return 1 === rd ? [1, rn] : [34, rn, rd];
     }
     var b$0 = caml_mod(a, b);
     a = b;
     b = b$0;
    }
   }
   register
    ("make-rational",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           var b = args[2];
           if(b){
            var c = b[1], n = a[1];
            if(typeof c !== "number")
             switch(c[0]){
               case 1:
                if(! b[2]){var d = c[1]; return make_rational_val(n, d);}
                break;
               case 2:
                if(! b[2]){var f = c[1]; return make_rational_val(n, f | 0);}
                break;
             }
           }
           break;
          case 2:
           var e = args[2];
           if(e){
            var g = e[1];
            if(typeof g !== "number" && 1 === g[0] && ! e[2]){
             var d$0 = g[1], f$0 = a[1];
             return make_rational_val(f$0 | 0, d$0);
            }
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-rational: expected 2 integers"], 1);
     });
   var v = [0, 0], w = [0, 1];
   register
    ("rational?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 34 === a[0]){if(args[2]) break a; return w;}
       if(! args[2]) return v;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "rational?: expected 1 arg"], 1);
     });
   register
    ("numerator",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(! args[2]){var n = a[1]; return [1, n];} break;
          case 34:
           if(! args[2]){var n$0 = a[1]; return [1, n$0];} break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "numerator: expected rational or integer"], 1);
     });
   var x = [1, 1];
   register
    ("denominator",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(! args[2]) return x; break;
          case 34:
           if(! args[2]){var d = a[2]; return [1, d];} break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "denominator: expected rational or integer"],
              1);
     });
   var
    cst_s$0 = "%s",
    y = [0, [8, [0, 0, 2], 0, 0, 0], "%E"],
    z = [0, [8, [0, 0, 4], 0, 0, 0], "%G"],
    A = [0, [4, 8, 0, 0, 0], "%X"],
    B = [0, [2, 0, 0], cst_s$0],
    C = [0, [4, 0, 0, 0, 0], "%d"],
    D = [0, [8, [0, 0, 1], 0, 0, 0], "%e"],
    E = [0, [8, [0, 0, 0], 0, 0, 0], "%f"],
    F = [0, [8, [0, 0, 3], 0, 0, 0], cst_g],
    G = [0, [4, 10, 0, 0, 0], "%o"],
    H = [0, [2, 0, 0], cst_s$0],
    I = [0, [4, 12, 0, 0, 0], "%u"],
    J = [0, [4, 6, 0, 0, 0], "%x"];
   register
    ("printf-spec",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 3 === c[0]){
        var d = args[2];
        if(d && ! d[2]){
         var
          arg = d[1],
          spec_str = c[1],
          n = caml_ml_string_length(spec_str),
          g = n < 2,
          h = g || 37 !== caml_string_get(spec_str, 0);
         if(h){
          var
           j = Stdlib[28].call(null, "printf-spec: invalid spec ", spec_str);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], j], 1);
         }
         var
          type_char = caml_string_get(spec_str, n - 1 | 0),
          to_int =
            function(v){
             if(typeof v !== "number")
              switch(v[0]){
                case 0:
                 return v[1] ? 1 : 0;
                case 1:
                 var i = v[1]; return i;
                case 2:
                 var f = v[1]; return f | 0;
                case 3:
                 var s = v[1], s$0 = Stdlib_String[24].call(null, s);
                 try{var b = caml_int_of_string(s$0); return b;}
                 catch(exn){
                  try{var a = caml_float_of_string(s$0) | 0; return a;}
                  catch(exn){return 0;}
                 }
              }
             return 0;
            },
          to_float =
            function(v){
             if(typeof v !== "number")
              switch(v[0]){
                case 1:
                 var i = v[1]; return i;
                case 2:
                 var f = v[1]; return f;
                case 3:
                 var s = v[1], s$0 = Stdlib_String[24].call(null, s);
                 try{var a = caml_float_of_string(s$0); return a;}
                 catch(exn){return 0.;}
              }
             return 0.;
            };
         try{
          var switcher = type_char - 69 | 0;
          a:
          if(51 >= switcher >>> 0){
           switch(switcher){
             case 0:
              var
               fmt = Stdlib_Scanf[13].call(null, spec_str, y),
               o = to_float(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt), o)];
              break;
             case 2:
              var
               fmt$0 = Stdlib_Scanf[13].call(null, spec_str, z),
               p = to_float(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$0), p)];
              break;
             case 19:
              var
               fmt$1 = Stdlib_Scanf[13].call(null, spec_str, A),
               q = to_int(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$1), q)];
              break;
             case 30:
              var
               n_val = to_int(arg),
               body = Stdlib_String[16].call(null, spec_str, 0, n - 1 | 0),
               r = Stdlib[28].call(null, body, "s"),
               fmt$2 = Stdlib_Scanf[13].call(null, r, B),
               t = Stdlib_Char[1].call(null, n_val & 255),
               u = Stdlib_String[1].call(null, 1, t),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$2), u)];
              break;
             case 32:
              var
               fmt$4 = Stdlib_Scanf[13].call(null, spec_str, D),
               w = to_float(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$4), w)];
              break;
             case 33:
              var
               fmt$5 = Stdlib_Scanf[13].call(null, spec_str, E),
               x = to_float(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$5), x)];
              break;
             case 34:
              var
               fmt$6 = Stdlib_Scanf[13].call(null, spec_str, F),
               K = to_float(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$6), K)];
              break;
             case 42:
              var
               fmt$7 = Stdlib_Scanf[13].call(null, spec_str, G),
               L = to_int(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$7), L)];
              break;
             case 46:
              var fmt$8 = Stdlib_Scanf[13].call(null, spec_str, H);
              b:
              {
               if(typeof arg === "number"){
                if(0 === arg){var b = cst; break b;}
               }
               else
                switch(arg[0]){
                  case 0:
                   if(arg[1]){var b = "1"; break b;} var b = cst_0; break b;
                  case 1:
                   var i = arg[1], b = Stdlib[33].call(null, i); break b;
                  case 2:
                   var f = arg[1], b = Sx_types[34].call(null, f); break b;
                  case 3:
                   var s = arg[1], b = s; break b;
                }
               var b = Sx_types[117].call(null, arg);
              }
              var a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$8), b)];
              break;
             case 48:
              var
               fmt$9 = Stdlib_Scanf[13].call(null, spec_str, I),
               M = to_int(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$9), M)];
              break;
             case 51:
              var
               fmt$10 = Stdlib_Scanf[13].call(null, spec_str, J),
               N = to_int(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$10), N)];
              break;
             case 31:
             case 36:
              var
               fmt$3 = Stdlib_Scanf[13].call(null, spec_str, C),
               v = to_int(arg),
               a = [3, caml_call1(Stdlib_Printf[4].call(null, fmt$3), v)];
              break;
             default: break a;
           }
           return a;
          }
          var
           l = Stdlib_String[1].call(null, 1, type_char),
           m =
             Stdlib[28].call(null, "printf-spec: unsupported conversion ", l);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], m], 1);
         }
         catch(e$0){
          var e = caml_wrap_exception(e$0);
          if(e[1] === Sx_types[9]) throw caml_maybe_attach_backtrace(e, 0);
          var
           k = Stdlib[28].call(null, "printf-spec: invalid format ", spec_str);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], k], 1);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "printf-spec: (spec arg)"], 1);
     });
   register
    ("scan-spec",
     function(args){
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 3 === b[0]){
        var c = args[2];
        if(c){
         var f = c[1];
         if(typeof f !== "number" && 3 === f[0] && ! c[2]){
          var
           input = f[1],
           spec_str = b[1],
           n = caml_ml_string_length(spec_str),
           r = n < 2,
           s = r || 37 !== caml_string_get(spec_str, 0);
          if(s){
           var
            t = Stdlib[28].call(null, "scan-spec: invalid spec ", spec_str);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], t], 1);
          }
          var
           type_char = caml_string_get(spec_str, n - 1 | 0),
           len = caml_ml_string_length(input),
           i = [0, 0];
          if(99 !== type_char)
           for(;;){
            if(i[1] >= len) break;
            if
             (32 !== caml_string_get(input, i[1])
              &&
               9 !== caml_string_get(input, i[1])
               && 10 !== caml_string_get(input, i[1]))
             break;
            i[1]++;
           }
          var start = i[1];
          try{
           var switcher = type_char - 88 | 0;
           a:
           if(32 >= switcher >>> 0){
            var cst_consumed = "consumed";
            switch(switcher){
              case 11:
               if(i[1] < len){
                var
                 d$0 = Stdlib_Hashtbl[1].call(null, 0, 2),
                 x = [1, caml_string_get(input, i[1])];
                Stdlib_Hashtbl[11].call(null, d$0, cst_value, x);
                Stdlib_Hashtbl[11].call
                 (null, d$0, cst_consumed, [1, i[1] + 1 | 0]);
                var a = [7, d$0];
               }
               else
                var a = 0;
               break;
              case 23:
               var j$14 = i[1];
               for(;;){
                if
                 (j$14 < len
                  &&
                   48 <= caml_string_get(input, j$14)
                   && 55 >= caml_string_get(input, j$14)){
                 var j$15 = j$14 + 1 | 0;
                 j$14 = j$15;
                 continue;
                }
                if(start < j$14){
                 var
                  C =
                    Stdlib_String[16].call(null, input, start, j$14 - start | 0),
                  n_val$1 = caml_int_of_string(Stdlib[28].call(null, "0o", C)),
                  d$3 = Stdlib_Hashtbl[1].call(null, 0, 2);
                 Stdlib_Hashtbl[11].call(null, d$3, cst_value, [1, n_val$1]);
                 Stdlib_Hashtbl[11].call(null, d$3, cst_consumed, [1, j$14]);
                 var a = [7, d$3];
                 break;
                }
                var a = 0;
                break;
               }
               break;
              case 27:
               var j$16 = i[1];
               for(;;){
                if
                 (j$16 < len
                  &&
                   32 !== caml_string_get(input, j$16)
                   &&
                    9 !== caml_string_get(input, j$16)
                    && 10 !== caml_string_get(input, j$16)){
                 var j$17 = j$16 + 1 | 0;
                 j$16 = j$17;
                 continue;
                }
                if(start < j$16){
                 var
                  d$4 = Stdlib_Hashtbl[1].call(null, 0, 2),
                  D =
                    [3,
                     Stdlib_String[16].call(null, input, start, j$16 - start | 0)];
                 Stdlib_Hashtbl[11].call(null, d$4, cst_value, D);
                 Stdlib_Hashtbl[11].call(null, d$4, cst_consumed, [1, j$16]);
                 var a = [7, d$4];
                 break;
                }
                var a = 0;
                break;
               }
               break;
              case 0:
              case 32:
               var j$1 = i[1];
               for(;;){
                b:
                if(j$1 < len){
                 c:
                 {
                  if
                   (48 <= caml_string_get(input, j$1)
                    && 57 >= caml_string_get(input, j$1))
                   break c;
                  if
                   (97 <= caml_string_get(input, j$1)
                    && 102 >= caml_string_get(input, j$1))
                   break c;
                  if
                   (65 > caml_string_get(input, j$1)
                    || 70 < caml_string_get(input, j$1))
                   break b;
                 }
                 var j$2 = j$1 + 1 | 0;
                 j$1 = j$2;
                 continue;
                }
                if(start < j$1){
                 var
                  w =
                    Stdlib_String[16].call(null, input, start, j$1 - start | 0),
                  n_val = caml_int_of_string(Stdlib[28].call(null, "0x", w)),
                  d = Stdlib_Hashtbl[1].call(null, 0, 2);
                 Stdlib_Hashtbl[11].call(null, d, cst_value, [1, n_val]);
                 Stdlib_Hashtbl[11].call(null, d, cst_consumed, [1, j$1]);
                 var a = [7, d];
                 break;
                }
                var a = 0;
                break;
               }
               break;
              case 12:
              case 17:
               var j = i[1], g = j < len;
               if(g)
                var
                 y = 45 === caml_string_get(input, j),
                 h = y || 43 === caml_string_get(input, j);
               else
                var h = g;
               if(h) var j$3 = j + 1 | 0, j$4 = j$3; else var j$4 = j;
               for(;;){
                if(j$4 >= len) break;
                if(48 > caml_string_get(input, j$4)) break;
                if(57 < caml_string_get(input, j$4)) break;
                var j$5 = j$4 + 1 | 0;
                j$4 = j$5;
               }
               b:
               if(start < j$4){
                c:
                {
                 if
                  (48 <= caml_string_get(input, start)
                   && 57 >= caml_string_get(input, start))
                  break c;
                 if
                  ((start + 1 | 0) >= j$4
                   ||
                    45 !== caml_string_get(input, start)
                    && 43 !== caml_string_get(input, start))
                  break b;
                }
                var
                 n_val$0 =
                   caml_int_of_string
                    (Stdlib_String[16].call(null, input, start, j$4 - start | 0)),
                 d$1 = Stdlib_Hashtbl[1].call(null, 0, 2);
                Stdlib_Hashtbl[11].call(null, d$1, cst_value, [1, n_val$0]);
                Stdlib_Hashtbl[11].call(null, d$1, cst_consumed, [1, j$4]);
                var a = [7, d$1];
                break;
               }
               var a = 0;
               break;
              case 13:
              case 14:
              case 15:
               var j$0 = i[1], k = j$0 < len;
               if(k)
                var
                 z = 45 === caml_string_get(input, j$0),
                 l = z || 43 === caml_string_get(input, j$0);
               else
                var l = k;
               if(l) var j$6 = j$0 + 1 | 0, j$7 = j$6; else var j$7 = j$0;
               for(;;){
                if(j$7 >= len) break;
                b:
                {
                 if
                  (48 <= caml_string_get(input, j$7)
                   && 57 >= caml_string_get(input, j$7))
                  break b;
                 if(46 !== caml_string_get(input, j$7)) break;
                }
                var j$8 = j$7 + 1 | 0;
                j$7 = j$8;
               }
               var m = j$7 < len;
               if(m)
                var
                 A = 101 === caml_string_get(input, j$7),
                 o = A || 69 === caml_string_get(input, j$7);
               else
                var o = m;
               if(o){
                var j$9 = j$7 + 1 | 0, p = j$9 < len;
                if(p)
                 var
                  B = 45 === caml_string_get(input, j$9),
                  q = B || 43 === caml_string_get(input, j$9);
                else
                 var q = p;
                if(q)
                 var j$10 = j$9 + 1 | 0, j$11 = j$10;
                else
                 var j$11 = j$9;
                for(;;){
                 if(j$11 >= len){var j$13 = j$11; break;}
                 if(48 > caml_string_get(input, j$11)){var j$13 = j$11; break;}
                 if(57 < caml_string_get(input, j$11)){var j$13 = j$11; break;}
                 var j$12 = j$11 + 1 | 0;
                 j$11 = j$12;
                }
               }
               else
                var j$13 = j$7;
               if(start < j$13){
                var
                 f_val =
                   caml_float_of_string
                    (Stdlib_String[16].call
                      (null, input, start, j$13 - start | 0)),
                 d$2 = Stdlib_Hashtbl[1].call(null, 0, 2);
                Stdlib_Hashtbl[11].call(null, d$2, cst_value, [2, f_val]);
                Stdlib_Hashtbl[11].call(null, d$2, cst_consumed, [1, j$13]);
                var a = [7, d$2];
               }
               else
                var a = 0;
               break;
              default: break a;
            }
            return a;
           }
           var
            u = Stdlib_String[1].call(null, 1, type_char),
            v = Stdlib[28].call(null, "scan-spec: unsupported conversion ", u);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], v], 1);
          }
          catch(e$0){
           var e = caml_wrap_exception(e$0);
           if(e[1] === Sx_types[9]) throw caml_maybe_attach_backtrace(e, 0);
           return 0;
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "scan-spec: (spec input)"], 1);
     });
   register
    ("parse-int",
     function(args){
      function parse_leading_int(s){
       var
        len = caml_ml_string_length(s),
        a = 0 < len,
        neg = a ? 45 === caml_string_get(s, 0) : a;
       if(neg)
        var start = 1;
       else
        var
         b = 0 < len,
         d = b ? 43 === caml_string_get(s, 0) : b,
         start = d ? 1 : 0;
       var j = start;
       for(;;){
        if
         (j < len
          && 48 <= caml_string_get(s, j) && 57 >= caml_string_get(s, j)){var j$0 = j + 1 | 0; j = j$0; continue;}
        if(start >= j) return 0;
        var
         n =
           caml_int_of_string
            (Stdlib_String[16].call(null, s, start, j - start | 0)),
         c = neg ? - n | 0 : n;
        return [0, c];
       }
      }
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           var c = args[2], n = a[1]; if(c && c[2]) break a; return [1, n];
          case 2:
           var d = args[2], n$0 = a[1];
           if(d && d[2]) break a;
           return [1, n$0 | 0];
          case 3:
           var match = args[2], s = a[1];
           if(match){
            if(match[2]) break a;
            var default_val$0 = match[1], match$0 = parse_leading_int(s);
            if(! match$0) return default_val$0;
            var n$1 = match$0[1];
            return [1, n$1];
           }
           var match$1 = parse_leading_int(s);
           if(! match$1) return 0;
           var n$2 = match$1[1];
           return [1, n$2];
        }
       var b = args[2];
       if(b && ! b[2]){var default_val = b[1]; return default_val;}
      }
      return 0;
     });
   register
    ("parse-float",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 2:
           if(! args[2]){var n = a[1]; return [2, n];} break;
          case 3:
           if(! args[2]){
            var s = a[1], match = Stdlib[36].call(null, s);
            if(! match) return 0;
            var n$0 = match[1];
            return [2, n$0];
           }
           break;
        }
      }
      return 0;
     });
   var cst_host_handle = "__host_handle";
   function safe_eq(a, b){
    if(a === b) return 1;
    a:
    if(typeof a === "number"){
     if(0 === a && typeof b === "number" && ! b) return 1;
    }
    else{
     switch(a[0]){
       case 0:
        if(typeof b === "number") break a;
        if(0 !== b[0]) break a;
        var y = b[1], x = a[1];
        return x === y ? 1 : 0;
       case 1:
        var x$0 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var y$0 = b[1]; return x$0 === y$0 ? 1 : 0;
          case 2:
           var y$1 = b[1]; return x$0 === y$1 ? 1 : 0;
          case 34:
           var d = b[2], n = b[1]; return caml_mul(x$0, d) === n ? 1 : 0;
          default: break a;
        }
       case 2:
        var x$1 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var y$2 = b[1]; return x$1 === y$2 ? 1 : 0;
          case 2:
           var y$3 = b[1]; return x$1 === y$3 ? 1 : 0;
          case 34:
           var d$0 = b[2], n$0 = b[1]; return x$1 === n$0 / d$0 ? 1 : 0;
          default: break a;
        }
       case 3:
        if(typeof b === "number") break a;
        if(3 !== b[0]) break a;
        var y$4 = b[1], x$2 = a[1];
        return x$2 === y$4 ? 1 : 0;
       case 4:
        if(typeof b === "number") break a;
        if(4 !== b[0]) break a;
        var y$5 = b[1], x$3 = a[1];
        return x$3 === y$5 ? 1 : 0;
       case 5:
        if(typeof b === "number") break a;
        if(5 !== b[0]) break a;
        var y$6 = b[1], x$4 = a[1];
        return x$4 === y$6 ? 1 : 0;
       case 6:
        var la = a[1]; break;
       case 7:
        if(typeof b === "number") break a;
        if(7 !== b[0]) break a;
        var
         b$0 = b[1],
         a$0 = a[1],
         match = Stdlib_Hashtbl[7].call(null, a$0, cst_host_handle),
         match$0 = Stdlib_Hashtbl[7].call(null, b$0, cst_host_handle);
        if(match){
         var e = match[1];
         if(typeof e !== "number" && 2 === e[0] && match$0){
          var match$1 = match$0[1];
          if(typeof match$1 !== "number" && 2 === match$1[0]){
           var hb = match$1[1], ha = e[1];
           return ha === hb ? 1 : 0;
          }
         }
        }
        else if(! match$0){
         var
          t = Stdlib_Hashtbl[15].call(null, b$0),
          h = Stdlib_Hashtbl[15].call(null, a$0) === t ? 1 : 0;
         if(h){
          var eq = [0, 1];
          Stdlib_Hashtbl[12].call
           (null,
            function(k, v){
             var a = eq[1];
             if(a){
              var match = Stdlib_Hashtbl[7].call(null, b$0, k);
              if(match){
               var
                v$0 = match[1],
                b = 1 - safe_eq(v, v$0),
                d = b ? (eq[1] = 0, 0) : b;
               return d;
              }
              eq[1] = 0;
              var c = 0;
             }
             else
              var c = a;
             return c;
            },
            a$0);
          var j = eq[1];
         }
         else
          var j = h;
         return j;
        }
        return 0;
       case 21:
        var la = a[1][1]; break;
       case 27:
        if(typeof b === "number") break a;
        if(27 !== b[0]) break a;
        var b$1 = b[1], a$1 = a[1], k = a$1[1][2] === b$1[1][2] ? 1 : 0;
        if(k){
         var l = a$1[2].length - 1 === b$1[2].length - 1 ? 1 : 0;
         if(l){
          var o = a$1[2].length - 2 | 0, m = 1;
          if(o < 0)
           var c = m;
          else{
           var eq$0 = m, i = 0;
           for(;;){
            var
             u = caml_check_bound(b$1[2], i)[i + 1],
             eq$1 =
               1 - safe_eq(caml_check_bound(a$1[2], i)[i + 1], u) ? 0 : eq$0,
             v = i + 1 | 0;
            if(o === i){var c = eq$1; break;}
            eq$0 = eq$1;
            i = v;
           }
          }
         }
         else
          var c = l;
        }
        else
         var c = k;
        return c;
       case 28:
        if(typeof b === "number") break a;
        if(28 !== b[0]) break a;
        var b$2 = b[1], a$2 = a[1];
        return a$2[1] === b$2[1] ? 1 : 0;
       case 29:
        if(typeof b === "number") break a;
        if(29 !== b[0]) break a;
        var
         b$3 = b[1],
         a$3 = a[1],
         p = a$3.length - 1 === b$3.length - 1 ? 1 : 0;
        if(p){
         var r = a$3.length - 2 | 0, q = 1;
         if(r < 0)
          var f = q;
         else{
          var eq$2 = q, i$0 = 0;
          for(;;){
           var
            w = caml_check_bound(b$3, i$0)[i$0 + 1],
            eq$3 =
              1 - safe_eq(caml_check_bound(a$3, i$0)[i$0 + 1], w) ? 0 : eq$2,
            z = i$0 + 1 | 0;
           if(r === i$0){var f = eq$3; break;}
           eq$2 = eq$3;
           i$0 = z;
          }
         }
        }
        else
         var f = p;
        return f;
       case 34:
        var d$1 = a[2], n$1 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var y$7 = b[1]; return n$1 === caml_mul(y$7, d$1) ? 1 : 0;
          case 2:
           var y$8 = b[1]; return n$1 / d$1 === y$8 ? 1 : 0;
          case 34:
           var bd = b[2], bn = b[1];
           return caml_mul(n$1, bd) === caml_mul(bn, d$1) ? 1 : 0;
          default: break a;
        }
       default: break a;
     }
     if(typeof b !== "number"){
      switch(b[0]){
        case 6:
         var lb = b[1]; break;
        case 21:
         var lb = b[1][1]; break;
        default: break a;
      }
      var
       s = Stdlib_List[1].call(null, lb),
       g = Stdlib_List[1].call(null, la) === s ? 1 : 0;
      return g ? Stdlib_List[35].call(null, safe_eq, la, lb) : g;
     }
    }
    return 0;
   }
   register
    ("=",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){var b = c[1], a = args[1]; return [0, safe_eq(a, b)];}
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "=: 2 args"], 1);
     });
   register
    ("!=",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1];
        return [0, 1 - safe_eq(a, b)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "!=: 2 args"], 1);
     });
   var cst$7 = "<";
   register
    (cst$7,
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 3 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [0, runtime.caml_string_lessthan(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], f = as_number(b);
        return [0, as_number(a) < f ? 1 : 0];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "<: 2 args"], 1);
     });
   var cst$8 = ">";
   register
    (cst$8,
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 3 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [0, runtime.caml_string_greaterthan(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], f = as_number(b);
        return [0, f < as_number(a) ? 1 : 0];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], ">: 2 args"], 1);
     });
   register
    ("<=",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 3 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [0, runtime.caml_string_lessequal(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], f = as_number(b);
        return [0, as_number(a) <= f ? 1 : 0];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "<=: 2 args"], 1);
     });
   register
    (">=",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var d = args[2];
        if(! d) break a;
        var e = d[1];
        if(typeof e !== "number" && 3 === e[0]){
         if(d[2]) break a;
         var b$0 = e[1], a$0 = a[1];
         return [0, runtime.caml_string_greaterequal(a$0, b$0)];
        }
       }
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], f = as_number(b);
        return [0, f <= as_number(a) ? 1 : 0];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], ">=: 2 args"], 1);
     });
   register
    ("not",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [0, 1 - Sx_types[71].call(null, a)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "not: 1 arg"], 1);
     });
   register
    ("nil?",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [0, Sx_types[62].call(null, a)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "nil?: 1 arg"], 1);
     });
   var K = [0, 0], L = [0, 1];
   register
    ("number?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && a[0] - 1 >>> 0 < 2){if(args[2]) break a; return L;}
       if(! args[2]) return K;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "number?: 1 arg"], 1);
     });
   var M = [0, 0], N = [0, 1];
   register
    ("integer?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(args[2]) break a; return N;
          case 2:
           if(args[2]) break a;
           var f = a[1];
           return [0, Stdlib_Float[18].call(null, f)];
        }
       if(! args[2]) return M;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "integer?: 1 arg"], 1);
     });
   var O = [0, 0], P = [0, 1];
   register
    ("float?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 2 === a[0]){if(args[2]) break a; return P;}
       if(! args[2]) return O;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "float?: 1 arg"], 1);
     });
   var Q = [0, 0], R = [0, 1];
   register
    ("string?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){if(args[2]) break a; return R;}
       if(! args[2]) return Q;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "string?: 1 arg"], 1);
     });
   var S = [0, 0], T = [0, 1];
   register
    ("boolean?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 0 === a[0]){if(args[2]) break a; return T;}
       if(! args[2]) return S;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "boolean?: 1 arg"], 1);
     });
   var U = [0, 0], V = [0, 1];
   register
    ("list?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){case 6:case 21: if(args[2]) break a; return V;}
       if(! args[2]) return U;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "list?: 1 arg"], 1);
     });
   var W = [0, 0], X = [0, 1], Y = [0, 1];
   register
    ("dict?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 7:
           if(args[2]) break a; return X;
          case 38:
           if(args[2]) break a; return Y;
        }
       if(! args[2]) return W;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "dict?: 1 arg"], 1);
     });
   var Z = [0, 0], _ = [0, 1];
   register
    ("adt?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 38 === a[0]){if(args[2]) break a; return _;}
       if(! args[2]) return Z;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "adt?: 1 arg"], 1);
     });
   var $ = [0, 0], aa = [0, 1];
   register
    ("symbol?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 4 === a[0]){if(args[2]) break a; return aa;}
       if(! args[2]) return $;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "symbol?: 1 arg"], 1);
     });
   var ab = [0, 0], ac = [0, 1];
   register
    ("keyword?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 5 === a[0]){if(args[2]) break a; return ac;}
       if(! args[2]) return ab;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "keyword?: 1 arg"], 1);
     });
   var
    ad = [0, 1],
    ae = [0, 0],
    af = [0, 0],
    ag = [0, 1],
    ah = [0, 0],
    ai = [0, 1];
   register
    ("empty?",
     function(args){
      a:
      if(args){
       var a = args[1];
       b:
       {
        if(typeof a !== "number"){
         c:
         {
          switch(a[0]){
            case 3:
             if(a[1] !== cst){if(args[2]) break a; return af;}
             if(args[2]) break a;
             return ag;
            case 6:
             if(a[1]){if(args[2]) break a; break c;}
             if(args[2]) break a;
             break;
            case 7:
             if(args[2]) break a;
             var d = a[1];
             return [0, 0 === Stdlib_Hashtbl[15].call(null, d) ? 1 : 0];
            case 21:
             if(a[1][1]){if(args[2]) break a; break c;}
             if(args[2]) break a;
             break;
            default: break b;
          }
          return ai;
         }
         return ah;
        }
        if(0 === a){if(args[2]) break a; return ad;}
       }
       if(! args[2]) return ae;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "empty?: 1 arg"], 1);
     });
   register
    ("odd?",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [0, 0 !== ((as_number(a) | 0) % 2 | 0) ? 1 : 0];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "odd?: 1 arg"], 1);
     });
   register
    ("even?",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [0, 0 === ((as_number(a) | 0) % 2 | 0) ? 1 : 0];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "even?: 1 arg"], 1);
     });
   register
    ("zero?",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [0, as_number(a) === 0. ? 1 : 0];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "zero?: 1 arg"], 1);
     });
   register
    ("str",
     function(args){
      var a = Stdlib_List[20].call(null, to_string, args);
      return [3, Stdlib_String[7].call(null, cst, a)];
     });
   register
    ("upper",
     function(args){
      if(args && ! args[2]){
       var a = args[1], b = as_string(a);
       return [3, Stdlib_String[26].call(null, b)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "upper: 1 arg"], 1);
     });
   register
    ("upcase",
     function(args){
      if(args && ! args[2]){
       var a = args[1], b = as_string(a);
       return [3, Stdlib_String[26].call(null, b)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "upcase: 1 arg"], 1);
     });
   register
    ("lower",
     function(args){
      if(args && ! args[2]){
       var a = args[1], b = as_string(a);
       return [3, Stdlib_String[27].call(null, b)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "lower: 1 arg"], 1);
     });
   register
    ("downcase",
     function(args){
      if(args && ! args[2]){
       var a = args[1], b = as_string(a);
       return [3, Stdlib_String[27].call(null, b)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "downcase: 1 arg"], 1);
     });
   register
    ("trim",
     function(args){
      if(args && ! args[2]){
       var a = args[1], b = as_string(a);
       return [3, Stdlib_String[24].call(null, b)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "trim: 1 arg"], 1);
     });
   register
    ("string-length",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [1, caml_ml_string_length(as_string(a))];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string-length: 1 arg"], 1);
     });
   register
    ("string-contains?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var needle = c[1], haystack = a[1], i = 0;
          for(;;){
           if
            (caml_ml_string_length(haystack)
             < (i + caml_ml_string_length(needle) | 0))
            var d = 0;
           else{
            if
             (Stdlib_String[16].call
               (null, haystack, i, caml_ml_string_length(needle))
              !== needle){
             var i$0 = i + 1 | 0;
             i = i$0;
             continue;
            }
            var d = 1;
           }
           return [0, d];
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string-contains?: 2 string args"], 1);
     });
   var aj = [0, 0];
   register
    ("starts-with?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var
           prefix = c[1],
           s = a[1],
           d =
             caml_ml_string_length(prefix) <= caml_ml_string_length(s) ? 1 : 0,
           e =
             d
              ? Stdlib_String
                  [16].call
                 (null, s, 0, caml_ml_string_length(prefix))
                === prefix
                ? 1
                : 0
              : d;
          return [0, e];
         }
        }
       }
      }
      return aj;
     });
   var ak = [0, 0];
   register
    ("ends-with?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var
           suffix = c[1],
           s = a[1],
           sl = caml_ml_string_length(s),
           xl = caml_ml_string_length(suffix),
           d = xl <= sl ? 1 : 0,
           e =
             d
              ? Stdlib_String
                  [16].call
                 (null, s, sl - xl | 0, xl)
                === suffix
                ? 1
                : 0
              : d;
          return [0, e];
         }
        }
       }
      }
      return ak;
     });
   var al = [2, -1.];
   register
    ("index-of",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 3:
           var b = args[2];
           if(! b) break a;
           var c = b[1];
           if(typeof c === "number") break a;
           if(3 !== c[0]) break a;
           if(b[2]) break a;
           var
            needle = c[1],
            haystack = a[1],
            nl = caml_ml_string_length(needle),
            hl = caml_ml_string_length(haystack),
            i = 0;
           for(;;){
            if(hl < (i + nl | 0)) return al;
            if(Stdlib_String[16].call(null, haystack, i, nl) === needle)
             return [2, i];
            var i$0 = i + 1 | 0;
            i = i$0;
           }
           break;
          case 6:
           var d = args[2];
           if(! d) break a;
           if(d[2]) break a;
           var target = d[1], items = a[1];
           break;
          case 21:
           var e = args[2], f = a[1][1];
           if(! e) break a;
           if(e[2]) break a;
           var target = e[1], items = f;
           break;
          default: break a;
        }
        var
         eq =
           function(a, b){
            if(typeof a === "number"){
             if(0 === a && typeof b === "number" && ! b) return 1;
            }
            else
             switch(a[0]){
               case 0:
                if(typeof b !== "number" && 0 === b[0]){
                 var y = b[1], x = a[1];
                 return x === y ? 1 : 0;
                }
                break;
               case 1:
                var x$0 = a[1];
                if(typeof b !== "number")
                 switch(b[0]){
                   case 1:
                    var y$0 = b[1]; return x$0 === y$0 ? 1 : 0;
                   case 2:
                    var y$1 = b[1]; return x$0 === y$1 ? 1 : 0;
                 }
                break;
               case 2:
                var x$1 = a[1];
                if(typeof b !== "number")
                 switch(b[0]){
                   case 1:
                    var y$2 = b[1]; return x$1 === y$2 ? 1 : 0;
                   case 2:
                    var y$3 = b[1]; return x$1 === y$3 ? 1 : 0;
                 }
                break;
               case 3:
                if(typeof b !== "number" && 3 === b[0]){
                 var y$4 = b[1], x$2 = a[1];
                 return x$2 === y$4 ? 1 : 0;
                }
                break;
               case 4:
                if(typeof b !== "number" && 4 === b[0]){
                 var y$5 = b[1], x$3 = a[1];
                 return x$3 === y$5 ? 1 : 0;
                }
                break;
               case 5:
                if(typeof b !== "number" && 5 === b[0]){
                 var y$6 = b[1], x$4 = a[1];
                 return x$4 === y$6 ? 1 : 0;
                }
                break;
             }
            return a === b ? 1 : 0;
           },
         i$1 = 0,
         param = items;
        for(;;){
         if(! param) return 0;
         var h = param[1];
         if(eq(h, target)) return [2, i$1];
         var tl = param[2], i$2 = i$1 + 1 | 0;
         i$1 = i$2;
         param = tl;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "index-of: 2 string args or list+target"], 1);
     });
   register
    ("substring",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[2];
         if(c && ! c[2]){
          var
           end_v = c[1],
           start_v = b[1],
           s = a[1],
           i = as_int(start_v),
           j = as_int(end_v),
           len = caml_ml_string_length(s),
           d = Stdlib[16].call(null, i, len),
           i$0 = Stdlib[17].call(null, 0, d),
           e = Stdlib[16].call(null, j, len),
           j$0 = Stdlib[17].call(null, 0, e),
           f = Stdlib[17].call(null, 0, j$0 - i$0 | 0);
          return [3, Stdlib_String[16].call(null, s, i$0, f)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "substring: 3 args"], 1);
     });
   register
    ("substr",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var match = b[2], start_v = b[1], s = a[1];
         if(! match){
          var
           i$1 = as_int(start_v),
           sl$0 = caml_ml_string_length(s),
           e = Stdlib[16].call(null, i$1, sl$0),
           i$2 = Stdlib[17].call(null, 0, e);
          return [3, Stdlib_String[16].call(null, s, i$2, sl$0 - i$2 | 0)];
         }
         if(! match[2]){
          var
           len_v = match[1],
           i = as_int(start_v),
           n = as_int(len_v),
           sl = caml_ml_string_length(s),
           c = Stdlib[16].call(null, i, sl),
           i$0 = Stdlib[17].call(null, 0, c),
           d = Stdlib[16].call(null, n, sl - i$0 | 0),
           n$0 = Stdlib[17].call(null, 0, d);
          return [3, Stdlib_String[16].call(null, s, i$0, n$0)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "substr: 2-3 args"], 1);
     });
   register
    ("split",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var sep = c[1], s = a[1];
          if(1 === caml_ml_string_length(sep)){
           var
            d = caml_string_get(sep, 0),
            e = Stdlib_String[17].call(null, d, s);
           return [6,
                   Stdlib_List[20].call(null, function(p){return [3, p];}, e)];
          }
          var
           f = caml_call1(Re[25], sep),
           re = Re[2].call(null, f),
           g = Re[17].call(null, 0, 0, re, s);
          return [6,
                  Stdlib_List[20].call(null, function(p){return [3, p];}, g)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "split: 2 args"], 1);
     });
   register
    ("join",
     function(args){
      a:
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 3 === b[0]){
        var c = args[2];
        if(c){
         var a = c[1], sep = b[1];
         if(typeof a !== "number"){
          switch(a[0]){
            case 6:
             var items = a[1]; break;
            case 21:
             var items = a[1][1]; break;
            default: break a;
          }
          if(! c[2]){
           var d = Stdlib_List[20].call(null, to_string, items);
           return [3, Stdlib_String[7].call(null, sep, d)];
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "join: 2 args"], 1);
     });
   var am = [0, [8, [0, 0, 3], 0, 0, 0], cst_g];
   register
    ("replace",
     function(args){
      function to_str(t){
       if(typeof t === "number"){if(0 === t) return cst;}
       else
        switch(t[0]){
          case 0:
           return t[1] ? cst_true : cst_false;
          case 1:
           var n = t[1]; return Stdlib[33].call(null, n);
          case 2:
           var n$0 = t[1];
           return Stdlib_Float[18].call(null, n$0)
                   ? Stdlib[33].call(null, n$0 | 0)
                   : caml_call1(Stdlib_Printf[4].call(null, am), n$0);
          case 12:
           var v = caml_call1(sx_trampoline_fn[1], t);
           if(typeof v !== "number" && 3 === v[0]){var s$0 = v[1]; return s$0;}
           return to_string(v);
          case 3:
          case 4:
          case 5:
          case 17:
          case 19:
           var s = t[1]; return s;
        }
       return to_string(t);
      }
      if(args){
       var a = args[2];
       if(a){
        var b = a[2];
        if(b && ! b[2]){
         var
          new_s = b[1],
          old_s = a[1],
          s = args[1],
          s$0 = to_str(s),
          old_s$0 = to_str(old_s),
          new_s$0 = to_str(new_s),
          ol = caml_ml_string_length(old_s$0);
         if(0 === ol) return [3, s$0];
         var
          buf = Stdlib_Buffer[1].call(null, caml_ml_string_length(s$0)),
          i = 0;
         for(;;){
          if(caml_ml_string_length(s$0) <= i)
           return [3, Stdlib_Buffer[2].call(null, buf)];
          if
           ((i + ol | 0) <= caml_ml_string_length(s$0)
            && Stdlib_String[16].call(null, s$0, i, ol) === old_s$0){
           Stdlib_Buffer[16].call(null, buf, new_s$0);
           var i$0 = i + ol | 0;
           i = i$0;
           continue;
          }
          var c = caml_string_get(s$0, i);
          Stdlib_Buffer[12].call(null, buf, c);
          var i$1 = i + 1 | 0;
          i = i$1;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "replace: 3 string args"], 1);
     });
   register
    ("char-from-code",
     function(args){
      if(args && ! args[2]){
       var
        a = args[1],
        n = as_int(a),
        buf = Stdlib_Buffer[1].call(null, 4),
        b = Stdlib_Uchar[8].call(null, n);
       Stdlib_Buffer[13].call(null, buf, b);
       return [3, Stdlib_Buffer[2].call(null, buf)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-from-code: 1 arg"], 1);
     });
   register
    ("char-at",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var n = b[1], s = a[1], i = as_int(n);
         if(0 <= i && i < caml_ml_string_length(s)){
          var c = caml_string_get(s, i);
          return [3, Stdlib_String[1].call(null, 1, c)];
         }
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-at: string and index"], 1);
     });
   register
    ("char-code",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var s = a[1];
        if(0 < caml_ml_string_length(s)) return [1, caml_string_get(s, 0)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-code: 1 non-empty string arg"], 1);
     });
   register
    ("parse-number",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         s = a[1],
         has_dec = Stdlib_String[15].call(null, s, 46),
         b = Stdlib_String[15].call(null, s, 101),
         has_exp = b || Stdlib_String[15].call(null, s, 69);
        if(! has_dec && ! has_exp){
         var match = Stdlib[34].call(null, s);
         if(match){var n = match[1]; return [1, n];}
         try{var d = [2, caml_float_of_string(s)]; return d;}
         catch(exn){
          var exn$0 = caml_wrap_exception(exn);
          if(exn$0[1] === Stdlib[7]) return 0;
          throw caml_maybe_attach_backtrace(exn$0, 0);
         }
        }
        try{var c = [2, caml_float_of_string(s)]; return c;}
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] === Stdlib[7]) return 0;
         throw caml_maybe_attach_backtrace(exn, 0);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "parse-number: 1 string arg"], 1);
     });
   var an = [0, 0, 0];
   register
    ("regex-match",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var input = c[1], pattern = a[1];
          try{
           var
            f = Re_Pcre[3].call(null, 0, pattern),
            re = Re[2].call(null, f),
            match = Re[6].call(null, 0, 0, re, input);
           if(match){
            var
             group = match[1],
             full = caml_call2(Re[1][1], group, 0),
             n = caml_call1(Re[1][12], group),
             d = n - 1 | 0,
             groups = [0, [0, [3, full], 0]];
            if(d >= 1){
             var i = 1;
             for(;;){
              try{
               var h = [0, [3, caml_call2(Re[1][1], group, i)], 0];
               groups[1] = Stdlib[37].call(null, groups[1], h);
              }
              catch(exn$0){
               var exn = caml_wrap_exception(exn$0);
               if(exn !== Stdlib[8])
                throw caml_maybe_attach_backtrace(exn, 0);
               groups[1] = Stdlib[37].call(null, groups[1], an);
              }
              var g = i + 1 | 0;
              if(d === i) break;
              i = g;
             }
            }
            var e = [6, groups[1]];
           }
           else
            var e = 0;
           return e;
          }
          catch(exn){return 0;}
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-match: pattern and input strings"], 1);
     });
   var ao = [0, 0];
   register
    ("regex-match?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var input = c[1], pattern = a[1];
          try{
           var
            d = Re_Pcre[3].call(null, 0, pattern),
            e = Re[2].call(null, d),
            f = [0, Re[7].call(null, 0, 0, e, input)];
           return f;
          }
          catch(exn){return ao;}
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-match?: pattern and input strings"], 1);
     });
   register
    ("regex-find-all",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var input = c[1], pattern = a[1];
          try{
           var
            d = Re_Pcre[3].call(null, 0, pattern),
            re = Re[2].call(null, d),
            matches = Re[11].call(null, 0, 0, re, input),
            results =
              Stdlib_List[20].call
               (null,
                function(group){
                 try{var a = [3, caml_call2(Re[1][1], group, 1)]; return a;}
                 catch(exn$0){
                  var exn = caml_wrap_exception(exn$0);
                  if(exn === Stdlib[8])
                   return [3, caml_call2(Re[1][1], group, 0)];
                  throw caml_maybe_attach_backtrace(exn, 0);
                 }
                },
                matches);
           return [21, [0, results]];
          }
          catch(exn){return [21, [0, 0]];}
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-find-all: pattern and input strings"],
              1);
     });
   var cst_regex_replace = "regex-replace";
   register
    (cst_regex_replace,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0]){
          var d = b[2];
          if(d){
           var e = d[1];
           if(typeof e !== "number" && 3 === e[0] && ! d[2]){
            var input = e[1], replacement = c[1], pattern = a[1];
            try{
             var
              f = Re_Pcre[3].call(null, 0, pattern),
              re = Re[2].call(null, f),
              g = [3, Re[92].call(null, 0, 0, 0, re, replacement, input)];
             return g;
            }
            catch(exn){return [3, input];}
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "regex-replace: pattern, replacement, input strings"],
              1);
     });
   register
    ("regex-replace-first",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0]){
          var d = b[2];
          if(d){
           var e = d[1];
           if(typeof e !== "number" && 3 === e[0] && ! d[2]){
            var input = e[1], replacement = c[1], pattern = a[1];
            try{
             var
              g = Re_Pcre[3].call(null, 0, pattern),
              re = Re[2].call(null, g),
              match = Re[6].call(null, 0, 0, re, input);
             if(match)
              var
               group = match[1],
               start = caml_call2(Re[1][5], group, 0),
               stop = caml_call2(Re[1][7], group, 0),
               h =
                 Stdlib_String[16].call
                  (null, input, stop, caml_ml_string_length(input) - stop | 0),
               i = Stdlib[28].call(null, replacement, h),
               j = Stdlib_String[16].call(null, input, 0, start),
               f = [3, Stdlib[28].call(null, j, i)];
             else
              var f = [3, input];
             return f;
            }
            catch(exn){return [3, input];}
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "regex-replace-first: pattern, replacement, input strings"],
              1);
     });
   var cst_regex_split = "regex-split";
   register
    (cst_regex_split,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var input = c[1], pattern = a[1];
          try{
           var
            d = Re_Pcre[3].call(null, 0, pattern),
            re = Re[2].call(null, d),
            e = Re[17].call(null, 0, 0, re, input),
            f =
              [21,
               [0, Stdlib_List[20].call(null, function(s){return [3, s];}, e)]];
           return f;
          }
          catch(exn){return [21, [0, [0, [3, input], 0]]];}
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-split: pattern and input strings"], 1);
     });
   register("list", function(args){return [21, [0, args]];});
   var
    cst_args = " args",
    cst_len = "len",
    ap = [0, [11, "len: ", [4, 0, 0, 0, [11, cst_args, 0]]], "len: %d args"],
    aq = [1, 0],
    ar = [1, 1],
    as = [1, 1],
    at = [1, 0];
   register
    (cst_len,
     function(args){
      a:
      if(args){
       var a = args[1];
       b:
       {
        if(typeof a !== "number"){
         switch(a[0]){
           case 0:
            if(a[1]){if(args[2]) break a; return ar;}
            if(args[2]) break a;
            break b;
           case 3:
            if(args[2]) break a;
            var s = a[1];
            return [1, caml_ml_string_length(s)];
           case 6:
            if(args[2]) break a; var l = a[1]; break;
           case 7:
            if(args[2]) break a;
            var d = a[1];
            return [1, Stdlib_Hashtbl[15].call(null, d)];
           case 17:
            if(args[2]) break a;
            var s$0 = a[1];
            return [1, caml_ml_string_length(s$0)];
           case 18:
            if(args[2]) break a;
            var pairs = a[1];
            return [1, Stdlib_List[1].call(null, pairs)];
           case 19:
            if(args[2]) break a;
            var s$1 = a[1];
            return [1, caml_ml_string_length(s$1)];
           case 21:
            var e = a[1][1]; if(args[2]) break a; var l = e; break;
           case 1:
           case 2:
            if(args[2]) break a; return as;
           case 4:
           case 5:
           case 8:
           case 9:
           case 10:
           case 11:
           case 12:
           case 15:
            if(args[2]) break a; return at;
           default: break a;
         }
         return [1, Stdlib_List[1].call(null, l)];
        }
        if(0 !== a || args[2]) break a;
       }
       return aq;
      }
      var
       b = Stdlib_List[1].call(null, args),
       c = caml_call1(Stdlib_Printf[4].call(null, ap), b);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
     });
   register("length", Stdlib_Hashtbl[6].call(null, primitives, cst_len));
   register
    ("first",
     function(args){
      a:
      if(args){
       var x = args[1];
       b:
       {
        if(typeof x !== "number"){
         c:
         {
          switch(x[0]){
            case 6:
             var a = x[1];
             if(a){if(args[2]) break a; var x$0 = a[1]; break c;}
             if(args[2]) break a;
             break;
            case 21:
             var b = x[1][1];
             if(b){if(args[2]) break a; var x$0 = b[1]; break c;}
             if(args[2]) break a;
             break;
            default: break b;
          }
          return 0;
         }
         return x$0;
        }
        if(0 === x){if(args[2]) break a; return 0;}
       }
       if(! args[2]){
        var
         c = Sx_types[117].call(null, x),
         d = Stdlib[28].call(null, "first: expected list, got ", c);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "first: 1 list arg"], 1);
     });
   var au = [6, 0], av = [6, 0];
   register
    ("rest",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        b:
        {
         switch(a[0]){
           case 6:
            var b = a[1];
            if(b){if(args[2]) break a; var xs = b[2]; break b;}
            if(args[2]) break a;
            break;
           case 21:
            var c = a[1][1];
            if(c){if(args[2]) break a; var xs = c[2]; break b;}
            if(args[2]) break a;
            break;
           default: break a;
         }
         return av;
        }
        return [6, xs];
       }
       if(0 === a && ! args[2]) return au;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "rest: 1 list arg"], 1);
     });
   register
    ("last",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var l = a[1]; break;
          case 21:
           var b = a[1][1]; if(args[2]) break a; var l = b; break;
          default: break a;
        }
        var match = Stdlib_List[10].call(null, l);
        if(! match) return 0;
        var x = match[1];
        return x;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "last: 1 list arg"], 1);
     });
   var aw = [6, 0];
   register
    ("init",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var l = a[1]; break;
          case 21:
           var b = a[1][1]; if(args[2]) break a; var l = b; break;
          default: break a;
        }
        var match = Stdlib_List[10].call(null, l);
        if(! match) return aw;
        var rest = match[2];
        return [6, Stdlib_List[10].call(null, rest)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "init: 1 list arg"], 1);
     });
   register
    ("nth",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 3:
           var b = args[2];
           if(! b) break a;
           if(b[2]) break a;
           var n = b[1], s = a[1], i = as_int(n);
           if(0 <= i && i < caml_ml_string_length(s)){
            var e = caml_string_get(s, i);
            return [3, Stdlib_String[1].call(null, 1, e)];
           }
           return 0;
          case 6:
           var c = args[2];
           if(! c) break a;
           if(c[2]) break a;
           var n$0 = c[1], l = a[1];
           break;
          case 21:
           var d = args[2], h = a[1][1];
           if(! d) break a;
           if(d[2]) break a;
           var n$0 = d[1], l = h;
           break;
          default: break a;
        }
        try{
         var f = as_int(n$0), g = Stdlib_List[8].call(null, l, f);
         return g;
        }
        catch(exn){return 0;}
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "nth: list/string and number"], 1);
     });
   register
    ("cons",
     function(args){
      a:
      if(args){
       var a = args[2];
       if(a){
        var b = a[1], x = args[1];
        if(typeof b !== "number"){
         switch(b[0]){
           case 6:
            if(a[2]) break a; var l = b[1]; break;
           case 21:
            var c = b[1][1]; if(a[2]) break a; var l = c; break;
           default: break a;
         }
         return [6, [0, x, l]];
        }
        if(0 === b && ! a[2]) return [6, [0, x, 0]];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "cons: value and list"], 1);
     });
   register
    ("append",
     function(args){
      a:
      if(args){
       var v = args[1];
       b:
       {
        c:
        if(typeof v === "number"){
         if(0 === v){
          var d = args[2];
          if(! d) break a;
          var a = d[1];
          if(typeof a === "number") break b;
          switch(a[0]){
            case 6:
             var lb$0 = a[1]; break;
            case 21:
             var lb$0 = a[1][1]; break;
            default: break b;
          }
          if(d[2]) break a;
          return [6, lb$0];
         }
        }
        else{
         switch(v[0]){
           case 6:
            var la$1 = v[1]; break;
           case 21:
            var la$1 = v[1][1]; break;
           default: break c;
         }
         var h = args[2];
         if(! h) break a;
         var c = h[1];
         if(typeof c !== "number"){
          switch(c[0]){
            case 6:
             var lb$1 = c[1]; break;
            case 21:
             var lb$1 = c[1][1]; break;
            default: break c;
          }
          if(h[2]) break a;
          return [6, Stdlib[37].call(null, la$1, lb$1)];
         }
        }
        if(typeof v !== "number"){
         switch(v[0]){
           case 6:
            var la$0 = v[1]; break;
           case 21:
            var la$0 = v[1][1]; break;
           default: break b;
         }
         var g = args[2];
         if(! g) break a;
         var i = g[1];
         if(typeof i === "number" && ! i){if(g[2]) break a; return [6, la$0];}
        }
       }
       b:
       if(typeof v !== "number"){
        switch(v[0]){
          case 6:
           var la = v[1]; break;
          case 21:
           var la = v[1][1]; break;
          default: break b;
        }
        var f = args[2];
        if(! f) break a;
        if(f[2]) break a;
        var v$0 = f[1];
        return [6, Stdlib[37].call(null, la, [0, v$0, 0])];
       }
       var e = args[2];
       if(e){
        var b = e[1];
        if(typeof b !== "number"){
         switch(b[0]){
           case 6:
            var lb = b[1]; break;
           case 21:
            var lb = b[1][1]; break;
           default: break a;
         }
         if(! e[2]) return [6, Stdlib[37].call(null, [0, v, 0], lb)];
        }
       }
      }
      var all = Stdlib_List[24].call(null, as_list, args);
      return [6, all];
     });
   register
    ("append!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           var b = args[2];
           if(b && ! b[2]){
            var item = b[1], items = a[1];
            return [6, Stdlib[37].call(null, items, [0, item, 0])];
           }
           break;
          case 21:
           var c = args[2];
           if(c && ! c[2]){
            var item$0 = c[1], r = a[1];
            r[1] = Stdlib[37].call(null, r[1], [0, item$0, 0]);
            return [21, r];
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "append!: list and item"], 1);
     });
   register
    ("reverse",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var l = a[1]; break;
          case 21:
           var b = a[1][1]; if(args[2]) break a; var l = b; break;
          default: break a;
        }
        return [6, Stdlib_List[10].call(null, l)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "reverse: 1 list"], 1);
     });
   register
    ("flatten",
     function(args){
      function flat(x){
       a:
       if(typeof x !== "number"){
        switch(x[0]){
          case 6:
           var items = x[1]; break;
          case 21:
           var items = x[1][1]; break;
          default: break a;
        }
        return Stdlib_List[24].call(null, flat, items);
       }
       return [0, x, 0];
      }
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var l = a[1]; break;
          case 21:
           var b = a[1][1]; if(args[2]) break a; var l = b; break;
          default: break a;
        }
        return [6, Stdlib_List[24].call(null, flat, l)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "flatten: 1 list"], 1);
     });
   register
    ("concat",
     function(args){return [6, Stdlib_List[24].call(null, as_list, args)];});
   register
    ("contains?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 3:
           var b = args[2];
           if(! b) break a;
           var c = b[1];
           if(typeof c === "number") break a;
           if(3 !== c[0]) break a;
           if(b[2]) break a;
           var sub = c[1], s = a[1], i = 0;
           for(;;){
            if
             (caml_ml_string_length(s) < (i + caml_ml_string_length(sub) | 0))
             var f = 0;
            else{
             if
              (Stdlib_String[16].call(null, s, i, caml_ml_string_length(sub))
               !== sub){
              var i$0 = i + 1 | 0;
              i = i$0;
              continue;
             }
             var f = 1;
            }
            return [0, f];
           }
          case 6:
           var d = args[2];
           if(! d) break a;
           if(d[2]) break a;
           var item = d[1], l = a[1];
           break;
          case 21:
           var e = args[2], g = a[1][1];
           if(! e) break a;
           if(e[2]) break a;
           var item = e[1], l = g;
           break;
          default: break a;
        }
        var
         safe_eq =
           function(a, b){
            var d = a === b ? 1 : 0;
            if(d)
             var e = d;
            else{
             if(typeof a === "number"){
              if(0 === a && typeof b === "number" && ! b) return 1;
             }
             else
              switch(a[0]){
                case 0:
                 if(typeof b !== "number" && 0 === b[0]){
                  var y = b[1], x = a[1];
                  return x === y ? 1 : 0;
                 }
                 break;
                case 1:
                 var x$0 = a[1];
                 if(typeof b !== "number")
                  switch(b[0]){
                    case 1:
                     var y$0 = b[1]; return x$0 === y$0 ? 1 : 0;
                    case 2:
                     var y$1 = b[1]; return x$0 === y$1 ? 1 : 0;
                  }
                 break;
                case 2:
                 var x$1 = a[1];
                 if(typeof b !== "number")
                  switch(b[0]){
                    case 1:
                     var y$2 = b[1]; return x$1 === y$2 ? 1 : 0;
                    case 2:
                     var y$3 = b[1]; return x$1 === y$3 ? 1 : 0;
                  }
                 break;
                case 3:
                 if(typeof b !== "number" && 3 === b[0]){
                  var y$4 = b[1], x$2 = a[1];
                  return x$2 === y$4 ? 1 : 0;
                 }
                 break;
                case 4:
                 if(typeof b !== "number" && 4 === b[0]){
                  var y$5 = b[1], x$3 = a[1];
                  return x$3 === y$5 ? 1 : 0;
                 }
                 break;
                case 5:
                 if(typeof b !== "number" && 5 === b[0]){
                  var y$6 = b[1], x$4 = a[1];
                  return x$4 === y$6 ? 1 : 0;
                 }
                 break;
                case 7:
                 if(typeof b !== "number" && 7 === b[0]){
                  var
                   b$0 = b[1],
                   a$0 = a[1],
                   match = Stdlib_Hashtbl[7].call(null, a$0, cst_host_handle),
                   match$0 = Stdlib_Hashtbl[7].call(null, b$0, cst_host_handle);
                  if(match){
                   var c = match[1];
                   if(typeof c !== "number" && 2 === c[0] && match$0){
                    var match$1 = match$0[1];
                    if(typeof match$1 !== "number" && 2 === match$1[0]){
                     var hb = match$1[1], ha = c[1];
                     return ha === hb ? 1 : 0;
                    }
                   }
                  }
                  return 0;
                 }
                 break;
              }
             var e = 0;
            }
            return e;
           };
        return [0,
                Stdlib_List[34].call
                 (null, function(x){return safe_eq(x, item);}, l)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "contains?: 2 args"], 1);
     });
   var ax = [6, 0], ay = [6, 0];
   register
    ("range",
     function(args){
      if(args){
       var match = args[2], start_v = args[1];
       if(! match){
        var n = as_int(start_v), h = Stdlib[17].call(null, 0, n);
        return [6, Stdlib_List[11].call(null, h, function(i){return [1, i];})];
       }
       var match$0 = match[2], stop_v = match[1];
       if(! match$0){
        var
         s$1 = as_int(start_v),
         e$1 = as_int(stop_v),
         len = Stdlib[17].call(null, 0, e$1 - s$1 | 0);
        return [6,
                Stdlib_List[11].call
                 (null, len, function(i){return [1, s$1 + i | 0];})];
       }
       if(! match$0[2]){
        var step_v = match$0[1];
        if
         (typeof start_v !== "number"
          &&
           1 === start_v[0]
           &&
            typeof stop_v !== "number"
            &&
             1 === stop_v[0] && typeof step_v !== "number" && 1 === step_v[0]){
         var st$0 = step_v[1], e$0 = stop_v[1], s$0 = start_v[1];
         if(0 === st$0) return ay;
         var b = 0;
         if(0 < st$0){
          var i = s$0, items = b;
          for(;;){
           if(i >= e$0){var items$1 = items; break;}
           var f = [0, [1, i], items];
           i = i + st$0 | 0;
           items = f;
          }
         }
         else{
          var i$0 = s$0, items$0 = b;
          for(;;){
           if(e$0 >= i$0){var items$1 = items$0; break;}
           var g = [0, [1, i$0], items$0];
           i$0 = i$0 + st$0 | 0;
           items$0 = g;
          }
         }
         return [6, Stdlib_List[10].call(null, items$1)];
        }
        var
         s = as_number(start_v),
         e = as_number(stop_v),
         st = as_number(step_v);
        if(st === 0.) return ax;
        var a = 0;
        if(0. < st){
         var i$1 = s, items$2 = a;
         for(;;){
          if(! (i$1 < e)){var items$4 = items$2; break;}
          var c = [0, [2, i$1], items$2];
          i$1 = i$1 + st;
          items$2 = c;
         }
        }
        else{
         var i$2 = s, items$3 = a;
         for(;;){
          if(! (e < i$2)){var items$4 = items$3; break;}
          var d = [0, [2, i$2], items$3];
          i$2 = i$2 + st;
          items$3 = d;
         }
        }
        return [6, Stdlib_List[10].call(null, items$4)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "range: 1-3 args"], 1);
     });
   register
    ("slice",
     function(args){
      a:
      if(args){
       var a = args[1];
       b:
       if(typeof a !== "number"){
        switch(a[0]){
          case 3:
           var d = args[2];
           if(! d) break a;
           var match = d[2], start_v$0 = d[1], s = a[1];
           if(! match){
            var
             k = as_int(start_v$0),
             i$1 = Stdlib[17].call(null, 0, k),
             m = Stdlib[17].call(null, 0, caml_ml_string_length(s) - i$1 | 0);
            return [3, Stdlib_String[16].call(null, s, i$1, m)];
           }
           if(match[2]) break a;
           var
            end_v$0 = match[1],
            g = as_int(start_v$0),
            i$0 = Stdlib[17].call(null, 0, g),
            j$1 = as_int(end_v$0),
            sl = caml_ml_string_length(s),
            j$2 = Stdlib[16].call(null, j$1, sl),
            h = Stdlib[17].call(null, 0, j$2 - i$0 | 0);
           return [3, Stdlib_String[16].call(null, s, i$0, h)];
          case 6:
           var l$0 = a[1]; break;
          case 21:
           var l$0 = a[1][1]; break;
          default: break b;
        }
        var e = args[2];
        if(! e) break a;
        if(! e[2]){
         var
          start_v$1 = e[1],
          o = as_int(start_v$1),
          i$2 = Stdlib[17].call(null, 0, o),
          n = i$2,
          l$1 = l$0;
         for(;;){
          if(l$1){
           var xs = l$1[2];
           if(0 < n){var n$0 = n - 1 | 0; n = n$0; l$1 = xs; continue;}
          }
          return [6, l$1];
         }
        }
       }
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           var l = a[1]; break;
          case 21:
           var l = a[1][1]; break;
          default: break a;
        }
        var b = args[2];
        if(b){
         var c = b[2];
         if(c && ! c[2]){
          var
           end_v = c[1],
           start_v = b[1],
           f = as_int(start_v),
           i = Stdlib[17].call(null, 0, f),
           j = as_int(end_v),
           len = Stdlib_List[1].call(null, l),
           j$0 = Stdlib[16].call(null, j, len),
           take_range =
             function(idx$1, param$0){
              var idx = idx$1, param = param$0;
              for(;;){
               if(! param) return 0;
               var xs = param[2], x = param[1];
               if(j$0 <= idx) return 0;
               if(i <= idx) return [0, x, take_range(idx + 1 | 0, xs)];
               var idx$0 = idx + 1 | 0;
               idx = idx$0;
               param = xs;
              }
             };
          return [6, take_range(0, l)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "slice: 2-3 args"], 1);
     });
   register
    ("sort",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var l = a[1]; break;
          case 21:
           var b = a[1][1]; if(args[2]) break a; var l = b; break;
          default: break a;
        }
        return [6, Stdlib_List[59].call(null, runtime.caml_compare, l)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "sort: 1 list"], 1);
     });
   register
    ("zip",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var
         b = c[1],
         a = args[1],
         la = as_list(a),
         lb = as_list(b),
         l1 = la,
         l2 = lb,
         acc = 0;
        for(;;){
         if(l1 && l2){
          var
           ys = l2[2],
           y = l2[1],
           xs = l1[2],
           x = l1[1],
           acc$0 = [0, [6, [0, x, [0, y, 0]]], acc];
          l1 = xs;
          l2 = ys;
          acc = acc$0;
          continue;
         }
         return [6, Stdlib_List[10].call(null, acc)];
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "zip: 2 lists"], 1);
     });
   register
    ("zip-pairs",
     function(args){
      if(args && ! args[2]){
       var
        v = args[1],
        l = as_list(v),
        go =
          function(param){
           if(param){
            var match = param[2];
            if(match){
             var rest = match[2], b = match[1], a = param[1];
             return [0, [6, [0, a, [0, b, 0]]], go(rest)];
            }
           }
           return 0;
          };
       return [6, go(l)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "zip-pairs: 1 list"], 1);
     });
   register
    ("take",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           var l = a[1]; break;
          case 21:
           var l = a[1][1]; break;
          default: break a;
        }
        var b = args[2];
        if(b && ! b[2]){
         var
          n = b[1],
          take_n =
            function(i, param){
             if(param){
              var xs = param[2], x = param[1];
              if(0 < i) return [0, x, take_n(i - 1 | 0, xs)];
             }
             return 0;
            };
         return [6, take_n(as_int(n), l)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "take: list and number"], 1);
     });
   register
    ("drop",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           var l = a[1]; break;
          case 21:
           var l = a[1][1]; break;
          default: break a;
        }
        var b = args[2];
        if(b && ! b[2]){
         var n = b[1], i$1 = as_int(n), i = i$1, l$0 = l;
         for(;;){
          if(l$0){
           var xs = l$0[2];
           if(0 < i){var i$0 = i - 1 | 0; i = i$0; l$0 = xs; continue;}
          }
          return [6, l$0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "drop: list and number"], 1);
     });
   register
    ("chunk-every",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           var l = a[1]; break;
          case 21:
           var l = a[1][1]; break;
          default: break a;
        }
        var b = args[2];
        if(b && ! b[2]){
         var
          n = b[1],
          size = as_int(n),
          go =
            function(l){
             if(! l) return 0;
             function take_n(i, param){
              if(param){
               var xs = param[2], x = param[1];
               if(0 < i) return [0, x, take_n(i - 1 | 0, xs)];
              }
              return 0;
             }
             var i = size, l$0 = l;
             for(;;){
              if(l$0){
               var xs = l$0[2];
               if(0 < i){var i$0 = i - 1 | 0; i = i$0; l$0 = xs; continue;}
              }
              var a = go(l$0);
              return [0, [6, take_n(size, l)], a];
             }
            };
         return [6, go(l)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "chunk-every: list and number"], 1);
     });
   register
    ("unique",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           var l = a[1]; break;
          case 21:
           var l = a[1][1]; break;
          default: break a;
        }
        if(! args[2]){
         var
          seen = Stdlib_Hashtbl[1].call(null, 0, 16),
          result =
            Stdlib_List[44].call
             (null,
              function(x){
               var key = Sx_types[117].call(null, x);
               return Stdlib_Hashtbl[9].call(null, seen, key)
                       ? 0
                       : (Stdlib_Hashtbl[11].call(null, seen, key, 1), 1);
              },
              l);
         return [6, result];
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "unique: 1 list"], 1);
     });
   register
    (cst_dict,
     function(args){
      var d = Sx_types[109].call(null, 0), param = args;
      for(;;){
       if(! param) return [7, d];
       var a = param[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 3:
           var match = param[2];
           if(match){
            var rest = match[2], v = match[1], k = a[1];
            Sx_types[112].call(null, d, k, v);
            param = rest;
            continue;
           }
           break;
          case 5:
           var match$0 = param[2];
           if(match$0){
            var rest$0 = match$0[2], v$0 = match$0[1], k$0 = a[1];
            Sx_types[112].call(null, d, k$0, v$0);
            param = rest$0;
            continue;
           }
           break;
        }
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "dict: pairs of key value"], 1);
      }
     });
   register
    ("get",
     function(args){
      a:
      if(args){
       var a = args[1];
       b:
       if(typeof a === "number"){
        if(0 === a){
         var g = args[2];
         if(! g) break a;
         if(g[2]) break a;
         return 0;
        }
       }
       else{
        switch(a[0]){
          case 6:
           var e = args[2];
           if(! e) break a;
           if(e[2]) break a;
           var n = e[1], l = a[1];
           break;
          case 7:
           var b = args[2];
           if(! b) break a;
           var c = b[1], d = a[1];
           if(typeof c === "number") break b;
           switch(c[0]){
             case 3:
              if(b[2]) break a;
              var k = c[1];
              return Sx_types[110].call(null, d, k);
             case 5:
              if(b[2]) break a;
              var k$0 = c[1];
              return Sx_types[110].call(null, d, k$0);
             default: break b;
           }
          case 21:
           var f = args[2], o = a[1][1];
           if(! f) break a;
           if(f[2]) break a;
           var n = f[1], l = o;
           break;
          default: break b;
        }
        c:
        {
         if(typeof n !== "number" && n[0] - 1 >>> 0 < 2){var i = 1; break c;}
         var i = 0;
        }
        if(i)
         try{var j = as_int(n), m = Stdlib_List[8].call(null, l, j); return m;
         }
         catch(exn){return 0;}
       }
       var h = args[2];
       if(h && ! h[2]) return 0;
      }
      return 0;
     });
   register
    ("has-key?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 7 === c[0]){
        var a = args[2];
        if(a){
         var b = a[1], d = c[1];
         if(typeof b !== "number")
          switch(b[0]){
            case 3:
             if(! a[2]){
              var k = b[1];
              return [0, Sx_types[111].call(null, d, k)];
             }
             break;
            case 5:
             if(! a[2]){
              var k$0 = b[1];
              return [0, Sx_types[111].call(null, d, k$0)];
             }
             break;
          }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "has-key?: dict and key"], 1);
     });
   register
    ("assoc",
     function(args){
      if(args){
       var match = args[1];
       if(typeof match !== "number" && 7 === match[0]){
        var
         rest = args[2],
         d = match[1],
         d2 = Stdlib_Hashtbl[4].call(null, d),
         param = rest;
        for(;;){
         if(! param) return [7, d2];
         var a = param[1];
         if(typeof a !== "number")
          switch(a[0]){
            case 3:
             var match$0 = param[2];
             if(match$0){
              var rest$0 = match$0[2], v = match$0[1], k = a[1];
              Stdlib_Hashtbl[11].call(null, d2, k, v);
              param = rest$0;
              continue;
             }
             break;
            case 5:
             var match$1 = param[2];
             if(match$1){
              var rest$1 = match$1[2], v$0 = match$1[1], k$0 = a[1];
              Stdlib_Hashtbl[11].call(null, d2, k$0, v$0);
              param = rest$1;
              continue;
             }
             break;
          }
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "assoc: pairs"], 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "assoc: dict + pairs"], 1);
     });
   register
    ("dissoc",
     function(args){
      if(args){
       var match = args[1];
       if(typeof match !== "number" && 7 === match[0]){
        var
         keys = args[2],
         d = match[1],
         d2 = Stdlib_Hashtbl[4].call(null, d);
        Stdlib_List[18].call
         (null,
          function(k){
           var a = to_string(k);
           return Stdlib_Hashtbl[10].call(null, d2, a);
          },
          keys);
        return [7, d2];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "dissoc: dict + keys"], 1);
     });
   register
    ("merge",
     function(args){
      var d = Sx_types[109].call(null, 0);
      Stdlib_List[18].call
       (null,
        function(param){
         if(typeof param !== "number" && 7 === param[0]){
          var src = param[1];
          return Stdlib_Hashtbl[12].call
                  (null,
                   function(k, v){
                    return Stdlib_Hashtbl[11].call(null, d, k, v);
                   },
                   src);
         }
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "merge: all args must be dicts"], 1);
        },
        args);
      return [7, d];
     });
   register
    ("keys",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0] && ! args[2]){
        var d = a[1];
        return [6, Sx_types[114].call(null, d)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "keys: 1 dict"], 1);
     });
   register
    ("vals",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0] && ! args[2]){
        var d = a[1];
        return [6, Sx_types[115].call(null, d)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "vals: 1 dict"], 1);
     });
   register("mutable-list", function(args){return [21, [0, 0]];});
   register
    ("set-nth!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           var d = args[2];
           if(d){
            var e = d[2];
            if(e && ! e[2])
             throw caml_maybe_attach_backtrace
                    ([0,
                      Sx_types[9],
                      "set-nth!: list is immutable, use ListRef"],
                     1);
           }
           break;
          case 21:
           var b = args[2];
           if(b){
            var c = b[2];
            if(c && ! c[2]){
             var v = c[1], idx = b[1], r = a[1], i = as_int(idx), l = r[1];
             r[1] =
              Stdlib_List[21].call
               (null, function(j, x){return j === i ? v : x;}, l);
             return 0;
            }
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-nth!: expected (list idx val)"], 1);
     });
   register
    ("dict-set!",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 7 === c[0]){
        var a = args[2];
        if(a){
         var b = a[1], d = c[1];
         if(typeof b !== "number")
          switch(b[0]){
            case 3:
             var e = a[2];
             if(e && ! e[2]){
              var v = e[1], k = b[1];
              Sx_types[112].call(null, d, k, v);
              return v;
             }
             break;
            case 5:
             var f = a[2];
             if(f && ! f[2]){
              var v$0 = f[1], k$0 = b[1];
              Sx_types[112].call(null, d, k$0, v$0);
              return v$0;
             }
             break;
          }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "dict-set!: dict key val"], 1);
     });
   register
    ("dict-get",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 7 === c[0]){
        var a = args[2];
        if(a){
         var b = a[1], d = c[1];
         if(typeof b !== "number")
          switch(b[0]){
            case 3:
             if(! a[2]){var k = b[1]; return Sx_types[110].call(null, d, k);}
             break;
            case 5:
             if(! a[2]){
              var k$0 = b[1];
              return Sx_types[110].call(null, d, k$0);
             }
             break;
          }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "dict-get: dict and key"], 1);
     });
   register
    ("dict-has?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var k = c[1], d = a[1];
          return [0, Sx_types[111].call(null, d, k)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "dict-has?: dict and key"], 1);
     });
   register
    ("dict-delete!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var k = c[1], d = a[1];
          Sx_types[113].call(null, d, k);
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "dict-delete!: dict and key"], 1);
     });
   register
    ("type-of",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [3, Sx_types[61].call(null, a)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "type-of: 1 arg"], 1);
     });
   register
    ("inspect",
     function(args){
      if(args && ! args[2]){
       var a = args[1];
       return [3, Sx_types[117].call(null, a)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "inspect: 1 arg"], 1);
     });
   var
    cst_s = "~%s",
    az = [3, "<lambda>"],
    aA = [0, [12, 126, [2, 0, 0]], cst_s],
    aB = [0, [12, 126, [2, 0, 0]], cst_s],
    aC = [0, [12, 58, [2, 0, [12, 32, [2, 0, 0]]]], ":%s %s"],
    aD =
      [0, [11, "(make-spread {", [2, 0, [11, "})", 0]]], "(make-spread {%s})"],
    aE = [0, [11, "#<", [2, 0, [12, 62, 0]]], "#<%s>"],
    aF = [0, [11, "#<parameter ", [2, 0, [12, 62, 0]]], "#<parameter %s>"],
    aG = [0, [11, "#(", [2, 0, [12, 41, 0]]], "#(%s)"];
   register
    ("serialize",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 8:
           if(args[2]) break a; return az;
          case 9:
           if(args[2]) break a;
           var c = a[1], b = c[1];
           return [3, caml_call1(Stdlib_Printf[4].call(null, aA), b)];
          case 10:
           if(args[2]) break a;
           var i = a[1], d = i[1];
           return [3, caml_call1(Stdlib_Printf[4].call(null, aB), d)];
          case 17:
           if(args[2]) break a; var s = a[1]; return [3, s];
          case 18:
           if(args[2]) break a;
           var
            pairs = a[1],
            dict_parts =
              Stdlib_List[20].call
               (null,
                function(param){
                 var
                  v = param[2],
                  k = param[1],
                  a = Sx_types[117].call(null, v);
                 return caml_call2(Stdlib_Printf[4].call(null, aC), k, a);
                },
                pairs),
            e = Stdlib_String[7].call(null, cst$1, dict_parts);
           return [3, caml_call1(Stdlib_Printf[4].call(null, aD), e)];
          case 19:
           if(args[2]) break a; var s$0 = a[1]; return [3, s$0];
          case 27:
           if(args[2]) break a;
           var r = a[1], f = r[1][1];
           return [3, caml_call1(Stdlib_Printf[4].call(null, aE), f)];
          case 28:
           if(args[2]) break a;
           var p = a[1], g = p[1];
           return [3, caml_call1(Stdlib_Printf[4].call(null, aF), g)];
          case 29:
           if(args[2]) break a;
           var
            arr = a[1],
            h =
              Stdlib_Array[14].call
               (null, function(v){return Sx_types[117].call(null, v);}, arr),
            elts = Stdlib_Array[10].call(null, h),
            j = Stdlib_String[7].call(null, cst$1, elts);
           return [3, caml_call1(Stdlib_Printf[4].call(null, aG), j)];
        }
       if(! args[2]) return [3, Sx_types[117].call(null, a)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "serialize: 1 arg"], 1);
     });
   register
    ("make-symbol",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [4, s];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-symbol: expected string"], 1);
     });
   var cst_error = "error";
   register
    (cst_error,
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        if(args[2]) break a;
        var msg = a[1];
        throw caml_maybe_attach_backtrace([0, Sx_types[9], msg], 1);
       }
       if(! args[2]){
        var b = to_string(a);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "error: 1 arg"], 1);
     });
   register
    ("host-error",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        if(args[2]) break a;
        var msg = a[1];
        throw caml_maybe_attach_backtrace([0, Sx_types[9], msg], 1);
       }
       if(! args[2]){
        var b = to_string(a);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "host-error: 1 arg"], 1);
     });
   register
    ("host-warn",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        if(args[2]) break a;
        var msg = a[1];
        Stdlib[53].call(null, msg);
        return 0;
       }
       if(! args[2]){
        var b = to_string(a);
        Stdlib[53].call(null, b);
        return 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "host-warn: 1 arg"], 1);
     });
   register
    ("try-catch",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var catch_fn = a[1], try_fn = args[1];
        try{
         var
          c = caml_call2(sx_call_fn[1], try_fn, 0),
          d = caml_call1(sx_trampoline_fn[1], c);
         return d;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
         var
          msg = exn[2],
          b = caml_call2(sx_call_fn[1], catch_fn, [0, [3, msg], 0]);
         return caml_call1(sx_trampoline_fn[1], b);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "try-catch: expected (try-fn catch-fn)"], 1);
     });
   var is_client = [0, 0];
   register("client?", function(args){return [0, is_client[1]];});
   var store_registry = Stdlib_Hashtbl[1].call(null, 0, 16);
   register
    ("def-store",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var init_fn = b[1], name = a[1];
         if(1 - Stdlib_Hashtbl[9].call(null, store_registry, name)){
          var
           c = caml_call2(sx_call_fn[1], init_fn, 0),
           store = caml_call1(sx_trampoline_fn[1], c);
          Stdlib_Hashtbl[11].call(null, store_registry, name, store);
         }
         var match = Stdlib_Hashtbl[7].call(null, store_registry, name);
         if(! match) return 0;
         var v = match[1];
         return v;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "def-store: expected (name init-fn)"], 1);
     });
   register
    ("use-store",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         name = a[1],
         match = Stdlib_Hashtbl[7].call(null, store_registry, name);
        if(match){var v = match[1]; return v;}
        var b = Stdlib[28].call(null, "Store not found: ", name);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "use-store: expected (name)"], 1);
     });
   register
    ("clear-stores",
     function(args){Stdlib_Hashtbl[2].call(null, store_registry); return 0;});
   var aH = [0, 1], aI = [0, 1], aJ = [6, 0], aK = [6, 0];
   register
    ("resource",
     function(args){
      var state = Stdlib_Hashtbl[1].call(null, 0, 8);
      Stdlib_Hashtbl[11].call(null, state, "loading", aH);
      Stdlib_Hashtbl[11].call(null, state, "data", 0);
      Stdlib_Hashtbl[11].call(null, state, cst_error, 0);
      var sig_d = Stdlib_Hashtbl[1].call(null, 0, 8);
      Stdlib_Hashtbl[11].call(null, sig_d, cst_signal, aI);
      Stdlib_Hashtbl[11].call(null, sig_d, cst_value, [7, state]);
      Stdlib_Hashtbl[11].call(null, sig_d, "subscribers", aJ);
      Stdlib_Hashtbl[11].call(null, sig_d, "deps", aK);
      return [7, sig_d];
     });
   register
    ("apply",
     function(args){
      function call(f, a){
       if(typeof f !== "number" && 15 === f[0]){
        var fn = f[2];
        return caml_call1(fn, a);
       }
       var b = caml_call2(sx_call_fn[1], f, a);
       return caml_call1(sx_trampoline_fn[1], b);
      }
      a:
      if(args){
       var c = args[2];
       if(c){
        var b = c[1], f = args[1];
        if(typeof b === "number"){
         if(0 === b && ! c[2]) return call(f, 0);
        }
        else{
         switch(b[0]){
           case 6:
            var a = b[1]; break;
           case 21:
            var a = b[1][1]; break;
           default: break a;
         }
         if(! c[2]) return call(f, a);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "apply: function and list"], 1);
     });
   register
    ("identical?",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1];
        a:
        {
         if(typeof a === "number"){
          if(0 === a && typeof b === "number" && ! b){var identical = 1; break a;}
         }
         else
          switch(a[0]){
            case 0:
             if(typeof b !== "number" && 0 === b[0]){
              var y = b[1], x = a[1], identical = x === y ? 1 : 0;
              break a;
             }
             break;
            case 1:
             var x$0 = a[1];
             if(typeof b !== "number")
              switch(b[0]){
                case 1:
                 var y$0 = b[1], identical = x$0 === y$0 ? 1 : 0; break a;
                case 2:
                 var y$1 = b[1], identical = x$0 === y$1 ? 1 : 0; break a;
              }
             break;
            case 2:
             var x$1 = a[1];
             if(typeof b !== "number")
              switch(b[0]){
                case 1:
                 var y$2 = b[1], identical = x$1 === y$2 ? 1 : 0; break a;
                case 2:
                 var y$3 = b[1], identical = x$1 === y$3 ? 1 : 0; break a;
              }
             break;
            case 3:
             if(typeof b !== "number" && 3 === b[0]){
              var y$4 = b[1], x$2 = a[1], identical = x$2 === y$4 ? 1 : 0;
              break a;
             }
             break;
          }
         var identical = a === b ? 1 : 0;
        }
        return [0, identical];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "identical?: 2 args"], 1);
     });
   register
    ("make-spread",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0] && ! args[2]){
        var
         d = a[1],
         pairs =
           Stdlib_Hashtbl[14].call
            (null, function(k, v, acc){return [0, [0, k, v], acc];}, d, 0);
        return [18, pairs];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-spread: 1 dict"], 1);
     });
   var aL = [0, 0], aM = [0, 1];
   register
    ("spread?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 18 === a[0]){if(args[2]) break a; return aM;}
       if(! args[2]) return aL;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "spread?: 1 arg"], 1);
     });
   register
    ("spread-attrs",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 18 === a[0] && ! args[2]){
        var pairs = a[1], d = Sx_types[109].call(null, 0);
        Stdlib_List[18].call
         (null,
          function(param){
           var v = param[2], k = param[1];
           return Sx_types[112].call(null, d, k, v);
          },
          pairs);
        return [7, d];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "spread-attrs: 1 spread"], 1);
     });
   function call_any(f, args){
    if(typeof f !== "number" && 15 === f[0]){
     var fn = f[2];
     return caml_call1(fn, args);
    }
    var a = caml_call2(sx_call_fn[1], f, args);
    return caml_call1(sx_trampoline_fn[1], a);
   }
   var aN = [6, 0];
   register
    ("map",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a === "number"){
         if(0 === a && ! b[2]) return aN;
        }
        else{
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2])
          return [6,
                  Stdlib_List[20].call
                   (null, function(x){return call_any(f, [0, x, 0]);}, items)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "map: expected (fn list)"], 1);
     });
   var aO = [6, 0];
   register
    ("map-indexed",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a === "number"){
         if(0 === a && ! b[2]) return aO;
        }
        else{
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2])
          return [6,
                  Stdlib_List[21].call
                   (null,
                    function(i, x){return call_any(f, [0, [1, i], [0, x, 0]]);},
                    items)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "map-indexed: expected (fn list)"], 1);
     });
   var aP = [6, 0];
   register
    ("filter",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a === "number"){
         if(0 === a && ! b[2]) return aP;
        }
        else{
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2])
          return [6,
                  Stdlib_List[44].call
                   (null,
                    function(x){
                     var a = call_any(f, [0, x, 0]);
                     return Sx_types[71].call(null, a);
                    },
                    items)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "filter: expected (fn list)"], 1);
     });
   var
    cst$4 = ", ",
    aQ =
      [0,
       [11,
        "for-each: expected (fn list), got (",
        [2, 0, [11, ") ", [4, 0, 0, 0, [11, cst_args, 0]]]]],
       "for-each: expected (fn list), got (%s) %d args"];
   register
    ("for-each",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a === "number"){
         if(0 === a && ! b[2]) return 0;
        }
        else{
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2]){
          Stdlib_List[18].call
           (null, function(x){call_any(f, [0, x, 0]); return 0;}, items);
          return 0;
         }
        }
       }
      }
      var
       c =
         Stdlib_List[20].call
          (null, function(v){return Sx_types[61].call(null, v);}, args),
       types = Stdlib_String[7].call(null, cst$4, c),
       d = Stdlib_List[1].call(null, args),
       e = caml_call2(Stdlib_Printf[4].call(null, aQ), types, d);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
     });
   register
    ("reduce",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var c = b[2];
        if(c){
         var a = c[1], init = b[1], f = args[1];
         if(typeof a !== "number"){
          switch(a[0]){
            case 6:
             var items = a[1]; break;
            case 21:
             var items = a[1][1]; break;
            default: break a;
          }
          if(! c[2])
           return Stdlib_List[26].call
                   (null,
                    function(acc, x){return call_any(f, [0, acc, [0, x, 0]]);},
                    init,
                    items);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "reduce: expected (fn init list)"], 1);
     });
   var aR = [0, 0], aS = [0, 0];
   register
    ("some",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a === "number"){
         if(0 === a && ! b[2]) return aR;
        }
        else{
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2]){
          var param = items;
          for(;;){
           if(! param) return aS;
           var rest = param[2], x = param[1], result = call_any(f, [0, x, 0]);
           if(Sx_types[71].call(null, result)) return result;
           param = rest;
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "some: expected (fn list)"], 1);
     });
   var aT = [0, 1];
   register
    ("every?",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a === "number"){
         if(0 === a && ! b[2]) return aT;
        }
        else{
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2])
          return [0,
                  Stdlib_List[33].call
                   (null,
                    function(x){
                     var a = call_any(f, [0, x, 0]);
                     return Sx_types[71].call(null, a);
                    },
                    items)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "every?: expected (fn list)"], 1);
     });
   register
    ("make-vm-stack",
     function(args){
      if(args && ! args[2]){
       var n = args[1], a = as_int(n);
       return [21,
               [0, Stdlib_List[11].call(null, a, function(param){return 0;})]];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-vm-stack: expected (size)"], 1);
     });
   register
    ("vm-stack-get",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 21 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var n = b[1], r = a[1], c = as_int(n);
         return Stdlib_List[8].call(null, r[1], c);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vm-stack-get: expected (stack idx)"], 1);
     });
   register
    ("vm-stack-set!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 21 === a[0]){
        var b = args[2];
        if(b){
         var c = b[2];
         if(c && ! c[2]){
          var v = c[1], n = b[1], r = a[1], i = as_int(n);
          r[1] =
           Stdlib_List[21].call
            (null, function(j, x){return j === i ? v : x;}, r[1]);
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vm-stack-set!: expected (stack idx val)"], 1);
     });
   register
    ("vm-stack-length",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 21 === a[0] && ! args[2]){
        var r = a[1];
        return [1, Stdlib_List[1].call(null, r[1])];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vm-stack-length: expected (stack)"], 1);
     });
   register
    ("vm-stack-copy!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 21 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 21 === c[0]){
          var d = b[2];
          if(d && ! d[2]){
           var
            n = d[1],
            dst = c[1],
            src = a[1],
            count = as_int(n),
            src_items = src[1];
           dst[1] =
            Stdlib_List[21].call
             (null,
              function(i, x){
               return i < count ? Stdlib_List[8].call(null, src_items, i) : x;
              },
              dst[1]);
           return 0;
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vm-stack-copy!: expected (src dst count)"], 1);
     });
   var aU = [0, 0];
   register
    ("primitive?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        return [0, Stdlib_Hashtbl[9].call(null, primitives, name)];
       }
      }
      return aU;
     });
   var aV = [0, 0], aW = [0, 1];
   register
    ("lambda?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]) return aW;
      }
      return aV;
     });
   var aX = [0, 0], aY = [0, 1];
   register
    ("island?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 10 === a[0] && ! args[2]) return aY;
      }
      return aX;
     });
   var aZ = [0, 0];
   register
    ("record?",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       return Sx_types[100].call(null, v);
      }
      return aZ;
     });
   register
    ("make-rtd",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[2];
        if(b && ! b[2]){
         var ctor_params = b[1], fields = a[1], name = args[1];
         return Sx_types[95].call(null, name, fields, ctor_params);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-rtd: expected (name fields ctor-params)"],
              1);
     });
   register
    ("make-record",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var arg_list = a[1], uid = args[1];
        return Sx_types[96].call(null, uid, arg_list);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-record: expected (uid args-list)"], 1);
     });
   register
    ("record-ref",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var idx = a[1], v = args[1];
        return Sx_types[97].call(null, v, idx);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "record-ref: expected (record index)"], 1);
     });
   register
    ("record-set!",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[2];
        if(b && ! b[2]){
         var nv = b[1], idx = a[1], v = args[1];
         return Sx_types[98].call(null, v, idx, nv);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "record-set!: expected (record index value)"],
              1);
     });
   var a0 = [0, 0];
   register
    ("record-type?",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var uid = a[1], v = args[1];
        return Sx_types[99].call(null, v, uid);
       }
      }
      return a0;
     });
   register
    ("make-record-constructor",
     function(args){
      if(args && ! args[2]){
       var uid = args[1];
       return Sx_types[101].call(null, uid);
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-record-constructor: expected (uid)"], 1);
     });
   register
    ("make-record-predicate",
     function(args){
      if(args && ! args[2]){
       var uid = args[1];
       return Sx_types[102].call(null, uid);
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-record-predicate: expected (uid)"], 1);
     });
   register
    ("make-record-accessor",
     function(args){
      if(args && ! args[2]){
       var idx = args[1];
       return Sx_types[103].call(null, idx);
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-record-accessor: expected (index)"], 1);
     });
   register
    ("make-record-mutator",
     function(args){
      if(args && ! args[2]){
       var idx = args[1];
       return Sx_types[104].call(null, idx);
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-record-mutator: expected (index)"], 1);
     });
   register
    ("make-parameter",
     function(args){
      if(args){
       var match = args[2], init = args[1], cst_param = "__param_";
       if(! match){
        var uid$0 = Sx_types[19][1];
        Sx_types[19][1]++;
        var b = Stdlib[33].call(null, uid$0);
        return [28, [0, Stdlib[28].call(null, cst_param, b), init, 0]];
       }
       if(! match[2]){
        var converter = match[1], uid = Sx_types[19][1];
        Sx_types[19][1]++;
        if(typeof converter === "number" || ! (15 === converter[0]))
         var converted = init;
        else
         var f = converter[2], converted = caml_call1(f, [0, init, 0]);
        var a = Stdlib[33].call(null, uid);
        return [28,
                [0,
                 Stdlib[28].call(null, cst_param, a),
                 converted,
                 [0, converter]]];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-parameter: expected 1-2 args"], 1);
     });
   var a1 = [0, 0], a2 = [0, 0], a3 = [0, 1];
   register
    ("parameter?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 28 === a[0]){if(args[2]) break a; return a3;}
       if(! args[2]) return a2;
      }
      return a1;
     });
   register
    ("parameter-uid",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 28 === a[0] && ! args[2]){var p = a[1]; return [3, p[1]];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "parameter-uid: expected parameter"], 1);
     });
   register
    ("parameter-default",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 28 === a[0] && ! args[2]){var p = a[1]; return p[2];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "parameter-default: expected parameter"], 1);
     });
   register
    ("parameter-converter",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 28 === a[0] && ! args[2]){
        var p = a[1], match = p[3];
        if(! match) return 0;
        var c = match[1];
        return c;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "parameter-converter: expected parameter"], 1);
     });
   register
    ("make-vector",
     function(args){
      if(args){
       var match = args[2], n = args[1];
       if(! match) return [29, caml_make_vect(as_int(n), 0)];
       if(! match[2]){
        var fill = match[1];
        return [29, caml_make_vect(as_int(n), fill)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "make-vector: expected (length) or (length fill)"],
              1);
     });
   register
    ("vector",
     function(args){return [29, Stdlib_Array[11].call(null, args)];});
   var a4 = [0, 0], a5 = [0, 1];
   register
    ("vector?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0]){if(args[2]) break a; return a5;}
       if(! args[2]) return a4;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "vector?: 1 arg"], 1);
     });
   register
    ("vector-length",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0] && ! args[2]){var arr = a[1]; return [1, arr.length - 1];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vector-length: expected vector"], 1);
     });
   var
    cst_out_of_bounds_length = " out of bounds (length ",
    a6 =
      [0,
       [11,
        "vector-ref: index ",
        [4,
         0,
         0,
         0,
         [11, cst_out_of_bounds_length, [4, 0, 0, 0, [12, 41, 0]]]]],
       "vector-ref: index %d out of bounds (length %d)"];
   register
    ("vector-ref",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var
          n = b[1],
          arr = a[1],
          i = as_int(n),
          c = i < 0,
          d = c || arr.length - 1 <= i;
         if(! d) return caml_check_bound(arr, i)[i + 1];
         var
          e = caml_call2(Stdlib_Printf[4].call(null, a6), i, arr.length - 1);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vector-ref: expected (vector index)"], 1);
     });
   var
    a7 =
      [0,
       [11,
        "vector-set!: index ",
        [4,
         0,
         0,
         0,
         [11, cst_out_of_bounds_length, [4, 0, 0, 0, [12, 41, 0]]]]],
       "vector-set!: index %d out of bounds (length %d)"];
   register
    ("vector-set!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0]){
        var b = args[2];
        if(b){
         var c = b[2];
         if(c && ! c[2]){
          var
           v = c[1],
           n = b[1],
           arr = a[1],
           i = as_int(n),
           d = i < 0,
           e = d || arr.length - 1 <= i;
          if(e){
           var
            f = caml_call2(Stdlib_Printf[4].call(null, a7), i, arr.length - 1);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
          }
          caml_check_bound(arr, i)[i + 1] = v;
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vector-set!: expected (vector index value)"],
              1);
     });
   register
    ("vector->list",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0] && ! args[2]){
        var arr = a[1];
        return [6, Stdlib_Array[10].call(null, arr)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vector->list: expected vector"], 1);
     });
   register
    ("list->vector",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           if(! args[2]){
            var l = a[1];
            return [29, Stdlib_Array[11].call(null, l)];
           }
           break;
          case 21:
           var l$0 = a[1][1];
           if(! args[2]) return [29, Stdlib_Array[11].call(null, l$0)];
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "list->vector: expected list"], 1);
     });
   register
    ("vector-fill!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var v = b[1], arr = a[1];
         Stdlib_Array[8].call(null, arr, 0, arr.length - 1, v);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "vector-fill!: expected (vector value)"], 1);
     });
   register
    ("vector-copy",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 29 === a[0]){
        var match = args[2], arr = a[1];
        if(! match) return [29, Stdlib_Array[7].call(null, arr)];
        var match$0 = match[2], s = match[1];
        if(! match$0){
         var start$0 = as_int(s), len$0 = arr.length - 1 - start$0 | 0;
         return 0 < len$0
                 ? [29, Stdlib_Array[6].call(null, arr, start$0, len$0)]
                 : [29, [0]];
        }
        if(! match$0[2]){
         var
          e = match$0[1],
          start = as_int(s),
          b = as_int(e),
          stop = Stdlib[16].call(null, b, arr.length - 1),
          len = stop - start | 0;
         return 0 < len
                 ? [29, Stdlib_Array[6].call(null, arr, start, len)]
                 : [29, [0]];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "vector-copy: expected (vector) or (vector start) or (vector start end)"],
              1);
     });
   register
    ("make-string-buffer",
     function(param){return [30, Stdlib_Buffer[1].call(null, 64)];});
   var a8 = [0, 0], a9 = [0, 1];
   register
    ("string-buffer?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 30 === a[0]){if(args[2]) break a; return a9;}
       if(! args[2]) return a8;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string-buffer?: expected 1 arg"], 1);
     });
   register
    ("string-buffer-append!",
     function(args){
      a:
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 30 === b[0]){
        var a = args[2];
        if(a){
         var v = a[1], buf = b[1];
         if(typeof v !== "number" && 3 === v[0]){
          if(a[2]) break a;
          var s = v[1];
          Stdlib_Buffer[16].call(null, buf, s);
          return 0;
         }
         if(! a[2]){
          var
           c = Sx_types[61].call(null, v),
           d =
             Stdlib[28].call
              (null, "string-buffer-append!: expected string, got ", c);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "string-buffer-append!: expected (buffer string)"],
              1);
     });
   register
    ("string-buffer->string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 30 === a[0] && ! args[2]){
        var buf = a[1];
        return [3, Stdlib_Buffer[2].call(null, buf)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string-buffer->string: expected (buffer)"], 1);
     });
   register
    ("string-buffer-length",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 30 === a[0] && ! args[2]){
        var buf = a[1];
        return [1, Stdlib_Buffer[7].call(null, buf)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string-buffer-length: expected (buffer)"], 1);
     });
   register
    ("make-buffer",
     function(param){return [30, Stdlib_Buffer[1].call(null, 64)];});
   var a_ = [0, 0], a$ = [0, 1];
   register
    ("buffer?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 30 === a[0]){if(args[2]) break a; return a$;}
       if(! args[2]) return a_;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "buffer?: expected 1 arg"], 1);
     });
   register
    ("buffer-append!",
     function(args){
      a:
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 30 === b[0]){
        var a = args[2];
        if(a){
         var v = a[1], buf = b[1];
         if(typeof v === "number"){
          if(0 === v){
           if(a[2]) break a;
           Stdlib_Buffer[16].call(null, buf, cst);
           return 0;
          }
         }
         else
          switch(v[0]){
            case 0:
             if(v[1]){
              if(a[2]) break a;
              Stdlib_Buffer[16].call(null, buf, cst_true);
              return 0;
             }
             if(a[2]) break a;
             Stdlib_Buffer[16].call(null, buf, cst_false);
             return 0;
            case 1:
             if(a[2]) break a;
             var n = v[1], d = Stdlib[33].call(null, n);
             Stdlib_Buffer[16].call(null, buf, d);
             return 0;
            case 2:
             if(a[2]) break a;
             var n$0 = v[1], e = Sx_types[34].call(null, n$0);
             Stdlib_Buffer[16].call(null, buf, e);
             return 0;
            case 3:
             if(a[2]) break a;
             var s = v[1];
             Stdlib_Buffer[16].call(null, buf, s);
             return 0;
            case 4:
             if(a[2]) break a;
             var s$0 = v[1];
             Stdlib_Buffer[16].call(null, buf, s$0);
             return 0;
            case 32:
             if(a[2]) break a;
             var n$1 = v[1], f = Stdlib_Uchar[8].call(null, n$1);
             Stdlib_Buffer[13].call(null, buf, f);
             return 0;
          }
         if(! a[2]){
          var c = Sx_types[117].call(null, v);
          Stdlib_Buffer[16].call(null, buf, c);
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "buffer-append!: expected (buffer value)"], 1);
     });
   register
    ("buffer->string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 30 === a[0] && ! args[2]){
        var buf = a[1];
        return [3, Stdlib_Buffer[2].call(null, buf)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "buffer->string: expected (buffer)"], 1);
     });
   register
    ("buffer-length",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 30 === a[0] && ! args[2]){
        var buf = a[1];
        return [1, Stdlib_Buffer[7].call(null, buf)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "buffer-length: expected (buffer)"], 1);
     });
   var cap_stack = [0, 0];
   register
    ("with-capabilities",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           var b = args[2];
           if(b && ! b[2]){
            var
             body = b[1],
             caps = a[1],
             cap_set =
               Stdlib_List[23].call
                (null,
                 function(v){
                  if(typeof v !== "number" && v[0] - 3 >>> 0 < 3){var s = v[1]; return [0, s];}
                  return 0;
                 },
                 caps),
             prev = cap_stack[1];
            cap_stack[1] = cap_set;
            if(typeof body !== "number")
             switch(body[0]){
               case 8:
               case 15:
               case 24:
                try{var result = caml_call2(Sx_types[7][1], body, 0);}
                catch(exn$0){
                 var exn = caml_wrap_exception(exn$0);
                 cap_stack[1] = prev;
                 throw caml_maybe_attach_backtrace(exn, 0);
                }
                cap_stack[1] = prev;
                return result;
             }
            cap_stack[1] = prev;
            return body;
           }
           break;
          case 21:
           var caps$0 = a[1][1], c = args[2];
           if(c && ! c[2]){
            var
             body$0 = c[1],
             cap_set$0 =
               Stdlib_List[23].call
                (null,
                 function(v){
                  if(typeof v !== "number" && v[0] - 3 >>> 0 < 3){var s = v[1]; return [0, s];}
                  return 0;
                 },
                 caps$0),
             prev$0 = cap_stack[1];
            cap_stack[1] = cap_set$0;
            if(typeof body$0 !== "number")
             switch(body$0[0]){
               case 8:
               case 15:
               case 24:
                try{var result$0 = caml_call2(Sx_types[7][1], body$0, 0);}
                catch(exn){
                 var exn$0 = caml_wrap_exception(exn);
                 cap_stack[1] = prev$0;
                 throw caml_maybe_attach_backtrace(exn$0, 0);
                }
                cap_stack[1] = prev$0;
                return result$0;
             }
            cap_stack[1] = prev$0;
            return body$0;
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "with-capabilities: expected (cap-list body-fn)"],
              1);
     });
   register
    ("current-capabilities",
     function(args){
      return 0 === cap_stack[1]
              ? 0
              : [6,
                Stdlib_List[20].call
                 (null, function(s){return [3, s];}, cap_stack[1])];
     });
   var ba = [0, 1], bb = [0, 1];
   register
    ("has-capability?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && a[0] - 3 >>> 0 < 3 && ! args[2]){
        var cap = a[1];
        return 0 === cap_stack[1]
                ? bb
                : [0, Stdlib_List[37].call(null, cap, cap_stack[1])];
       }
      }
      return ba;
     });
   var
    bc =
      [0,
       [11,
        "Capability '",
        [2,
         0,
         [11, "' not available. Current capabilities: [", [2, 0, [12, 93, 0]]]]],
       "Capability '%s' not available. Current capabilities: [%s]"];
   register
    ("require-capability!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && a[0] - 3 >>> 0 < 3 && ! args[2]){
        var cap = a[1];
        if(0 === cap_stack[1]) return 0;
        if(Stdlib_List[37].call(null, cap, cap_stack[1])) return 0;
        var
         b = Stdlib_String[7].call(null, cst$4, cap_stack[1]),
         c = caml_call2(Stdlib_Printf[4].call(null, bc), cap, b);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
       }
      }
      return 0;
     });
   register
    ("capability-restricted?",
     function(args){return [0, 0 !== cap_stack[1] ? 1 : 0];});
   var bd = [0, 0], be = [0, 1], bf = [0, 1];
   register
    ("is-else-clause?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 0:
           if(a[1] && ! args[2]) return be; break;
          case 5:
           if(a[1] === "else" && ! args[2]) return bf; break;
        }
      }
      return bd;
     });
   var bg = [0, 0];
   register
    ("cond-scheme?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 6 === a[0] && ! args[2]){
        var clauses = a[1];
        return [0,
                Stdlib_List[33].call
                 (null,
                  function(c){
                   if(typeof c !== "number" && 6 === c[0]){
                    var l = c[1];
                    return 2 === Stdlib_List[1].call(null, l) ? 1 : 0;
                   }
                   return 0;
                  },
                  clauses)];
       }
      }
      return bg;
     });
   var bh = [0, 0], bi = [0, 1], bj = [0, 1];
   register
    ("component?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]) return bi; break;
          case 10:
           if(! args[2]) return bj; break;
        }
      }
      return bh;
     });
   register
    ("lambda-closure",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]){var l = a[1]; return [20, l[3]];}
      }
      return 0;
     });
   register
    ("component-closure",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return [20, c[5]];} break;
          case 10:
           if(! args[2]){var i = a[1]; return [20, i[5]];} break;
        }
      }
      return 0;
     });
   var bk = [0, 0];
   register
    ("component-has-children?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return [0, c[3]];} break;
          case 10:
           if(! args[2]){var i = a[1]; return [0, i[3]];} break;
        }
      }
      return bk;
     });
   register
    ("component-name",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return [3, c[1]];} break;
          case 10:
           if(! args[2]){var i = a[1]; return [3, i[1]];} break;
        }
      }
      return 0;
     });
   var bl = [6, 0];
   register
    ("component-params",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){
            var c = a[1];
            return [6,
                    Stdlib_List[20].call
                     (null, function(s){return [3, s];}, c[2])];
           }
           break;
          case 10:
           if(! args[2]){
            var i = a[1];
            return [6,
                    Stdlib_List[20].call
                     (null, function(s){return [3, s];}, i[2])];
           }
           break;
        }
      }
      return bl;
     });
   register
    ("component-body",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return c[4];} break;
          case 10:
           if(! args[2]){var i = a[1]; return i[4];} break;
        }
      }
      return 0;
     });
   register
    ("component-file",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       return Sx_types[80].call(null, v);
      }
      return 0;
     });
   register
    ("component-set-file!",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var f = a[1], v = args[1];
        return Sx_types[81].call(null, v, f);
       }
      }
      return 0;
     });
   var bm = [0, 0], bn = [0, 1];
   register
    ("macro?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 11 === a[0] && ! args[2]) return bn;
      }
      return bm;
     });
   register
    ("for-each-indexed",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var a = b[1], f = args[1];
        if(typeof a !== "number"){
         switch(a[0]){
           case 6:
            var items = a[1]; break;
           case 21:
            var items = a[1][1]; break;
           default: break a;
         }
         if(! b[2]){
          Stdlib_List[19].call
           (null,
            function(i, x){call_any(f, [0, [2, i], [0, x, 0]]); return 0;},
            items);
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "for-each-indexed: expected (fn list)"], 1);
     });
   var bo = [6, 0];
   register
    ("lambda-params",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]){
        var l = a[1];
        return [6,
                Stdlib_List[20].call(null, function(s){return [3, s];}, l[1])];
       }
      }
      return bo;
     });
   register
    ("lambda-body",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]){var l = a[1]; return l[2];}
      }
      return 0;
     });
   var bp = [0, 1];
   register
    ("empty-dict?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0] && ! args[2]){
        var d = a[1];
        return [0, 0 === Stdlib_Hashtbl[15].call(null, d) ? 1 : 0];
       }
      }
      return bp;
     });
   register
    ("make-raw-html",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [17, s];}
      }
      return 0;
     });
   var bq = [3, cst];
   register
    ("raw-html-content",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 17 === a[0] && ! args[2]){var s = a[1]; return [3, s];}
      }
      return bq;
     });
   var cst_VM_undefined = "VM undefined: ";
   register
    ("get-primitive",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         name = a[1],
         match = Stdlib_Hashtbl[7].call(null, primitives, name);
        if(match){var fn = match[1]; return [15, name, fn];}
        var b = Stdlib[28].call(null, cst_VM_undefined, name);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "get-primitive: expected (name)"], 1);
     });
   register
    ("call-primitive",
     function(args){
      a:
      if(args){
       var d = args[1];
       if(typeof d !== "number" && 3 === d[0]){
        var c = args[2];
        if(c){
         var b = c[1], name = d[1];
         if(typeof b === "number"){
          if(0 === b && ! c[2]){
           var match = Stdlib_Hashtbl[7].call(null, primitives, name);
           if(match){var fn = match[1]; return caml_call1(fn, 0);}
           var e = Stdlib[28].call(null, cst_VM_undefined, name);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
          }
         }
         else{
          switch(b[0]){
            case 6:
             var a = b[1]; break;
            case 21:
             var a = b[1][1]; break;
            default: break a;
          }
          if(! c[2]){
           var match$0 = Stdlib_Hashtbl[7].call(null, primitives, name);
           if(match$0){var fn$0 = match$0[1]; return caml_call1(fn$0, a);}
           var f = Stdlib[28].call(null, cst_VM_undefined, name);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "call-primitive: expected (name args-list)"],
              1);
     });
   register
    ("get-cookie",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         name = a[1],
         match = Stdlib_Hashtbl[7].call(null, request_cookies, name);
        if(! match) return 0;
        var v = match[1];
        return [3, v];
       }
      }
      return 0;
     });
   register("set-cookie", function(args){return 0;});
   var
    cst_depth = " depth=",
    cst$3 = "->",
    cst_scope_push = "scope-push!",
    br =
      [0,
       [11,
        "PUSH ",
        [2, 0, [11, cst_depth, [4, 0, 0, 0, [11, cst$3, [4, 0, 0, 0, 0]]]]]],
       "PUSH %s depth=%d->%d"];
   register
    (cst_scope_push,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var value = b[1], name = a[1];
         try{
          var f = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = f;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
          var stack = 0;
         }
         if(scope_trace[1]){
          var
           c = scope_log[1],
           d = Stdlib_List[1].call(null, stack) + 1 | 0,
           e = Stdlib_List[1].call(null, stack);
          scope_log[1] =
           [0, caml_call3(Stdlib_Printf[4].call(null, br), name, e, d), c];
         }
         Stdlib_Hashtbl[11].call(null, scope_stacks, name, [0, value, stack]);
         return 0;
        }
       }
      }
      return 0;
     });
   var
    cst_scope_pop = "scope-pop!",
    bs =
      [0,
       [11,
        "POP ",
        [2, 0, [11, cst_depth, [4, 0, 0, 0, [11, cst$3, [4, 0, 0, 0, 0]]]]]],
       "POP %s depth=%d->%d"];
   register
    (cst_scope_pop,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var f = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = f;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(scope_trace[1]){
         var
          b = scope_log[1],
          c = Stdlib_List[1].call(null, stack) - 1 | 0,
          d = Stdlib[17].call(null, 0, c),
          e = Stdlib_List[1].call(null, stack);
         scope_log[1] =
          [0, caml_call3(Stdlib_Printf[4].call(null, bs), name, e, d), b];
        }
        if(stack){
         var rest = stack[2];
         Stdlib_Hashtbl[11].call(null, scope_stacks, name, rest);
        }
        return 0;
       }
      }
      return 0;
     });
   var
    cst_found = " found=",
    bt =
      [0,
       [11,
        "PEEK ",
        [2, 0, [11, cst_depth, [4, 0, 0, 0, [11, cst_found, [9, 0, 0]]]]]],
       "PEEK %s depth=%d found=%b"];
   register
    ("scope-peek",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var d = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = d;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(scope_trace[1]){
         var b = scope_log[1], c = Stdlib_List[1].call(null, stack);
         scope_log[1] =
          [0,
           caml_call3
            (Stdlib_Printf[4].call(null, bt), name, c, 0 !== stack ? 1 : 0),
           b];
        }
        if(! stack) return 0;
        var v = stack[1];
        return v;
       }
      }
      return 0;
     });
   var
    cst_context = "context",
    bu =
      [0,
       [11,
        "CTX ",
        [2, 0, [11, cst_depth, [4, 0, 0, 0, [11, cst_found, [9, 0, 0]]]]]],
       "CTX %s depth=%d found=%b"];
   register
    (cst_context,
     function(args){
      if(args){
       var match = args[1];
       if(typeof match !== "number" && 3 === match[0]){
        var rest = args[2], name = match[1];
        try{
         var c = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = c;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(scope_trace[1]){
         var a = scope_log[1], b = Stdlib_List[1].call(null, stack);
         scope_log[1] =
          [0,
           caml_call3
            (Stdlib_Printf[4].call(null, bu), name, b, 0 !== stack ? 1 : 0),
           a];
        }
        if(stack){var v = stack[1]; return v;}
        if(! rest) return 0;
        var default_val = rest[1];
        return default_val;
       }
      }
      return 0;
     });
   var
    bv = [3, "bad args"],
    bw =
      [0,
       [11,
        "name=",
        [2,
         0,
         [11,
          " stack_len=",
          [4, 0, 0, 0, [11, " all_keys=[", [2, 0, [12, 93, 0]]]]]]],
       "name=%s stack_len=%d all_keys=[%s]"];
   register
    ("context-debug",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var d = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = d;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        var
         all_keys =
           Stdlib_Hashtbl[14].call
            (null,
             function(k, param, acc){return [0, k, acc];},
             scope_stacks,
             0),
         b = Stdlib_String[7].call(null, ",", all_keys),
         c = Stdlib_List[1].call(null, stack);
        return [3, caml_call3(Stdlib_Printf[4].call(null, bw), name, c, b)];
       }
      }
      return bv;
     });
   register
    ("collect!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var value = b[1], name = a[1];
         try{
          var d = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = d;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
          var stack = 0;
         }
         if(stack){
          var match = stack[1];
          if(typeof match !== "number" && 6 === match[0]){
           var rest = stack[2], items = match[1];
           if(1 - Stdlib_List[37].call(null, value, items)){
            var
             c = [0, [6, Stdlib[37].call(null, items, [0, value, 0])], rest];
            Stdlib_Hashtbl[11].call(null, scope_stacks, name, c);
           }
          }
         }
         else
          Stdlib_Hashtbl[11].call
           (null, scope_stacks, name, [0, [6, [0, value, 0]], 0]);
         return 0;
        }
       }
      }
      return 0;
     });
   var cst_collected = "collected", bx = [6, 0], by = [6, 0];
   register
    (cst_collected,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var b = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = b;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(stack){
         var match = stack[1];
         if(typeof match !== "number" && 6 === match[0]){var items = match[1]; return [6, items];}
        }
        return by;
       }
      }
      return bx;
     });
   var
    cst_clear_collected = "clear-collected!",
    bz = [6, 0],
    bA = [0, [6, 0], 0];
   register
    (cst_clear_collected,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var b = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = b;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(stack){
         var rest = stack[2];
         Stdlib_Hashtbl[11].call(null, scope_stacks, name, [0, bz, rest]);
        }
        else
         Stdlib_Hashtbl[11].call(null, scope_stacks, name, bA);
        return 0;
       }
      }
      return 0;
     });
   register
    ("provide-reactive!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var value = b[1], name = a[1];
         try{
          var c = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = c;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
          var stack = 0;
         }
         Stdlib_Hashtbl[11].call
          (null, scope_stacks, name, [0, [16, [0, value, 0, 0]], stack]);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "provide-reactive!: expected (name value)"], 1);
     });
   register
    ("provide-pop-reactive!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var b = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = b;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(stack){
         var rest = stack[2];
         Stdlib_Hashtbl[11].call(null, scope_stacks, name, rest);
        }
        return 0;
       }
      }
      return 0;
     });
   var
    bB =
      [0,
       [11, "provide-set!: '", [2, 0, [11, "' is not a reactive provide", 0]]],
       "provide-set!: '%s' is not a reactive provide"];
   register
    ("provide-set!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var new_value = b[1], name = a[1];
         try{
          var d = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = d;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
          var stack = 0;
         }
         if(stack){
          var match = stack[1];
          if(typeof match !== "number" && 16 === match[0]){
           var sig = match[1];
           sig[1] = new_value;
           Stdlib_List[18].call
            (null, function(sub){return caml_call1(sub, 0);}, sig[2]);
           return 0;
          }
         }
         var c = caml_call1(Stdlib_Printf[4].call(null, bB), name);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "provide-set!: expected (name new-value)"], 1);
     });
   register
    ("peek",
     function(args){
      if(args){
       var match = args[1];
       if(typeof match !== "number" && 3 === match[0]){
        var name = match[1];
        try{
         var a = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = a;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(! stack) return 0;
        var v = stack[1];
        if(typeof v !== "number" && 16 === v[0]){var sig = v[1]; return sig[1];}
        return v;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "peek: expected (name)"], 1);
     });
   var tracking_active = [0, 0], tracking_deps = [0, 0];
   register
    ("tracking-start!",
     function(args){tracking_active[1] = 1; tracking_deps[1] = 0; return 0;});
   register
    ("tracking-stop!",
     function(args){
      tracking_active[1] = 0;
      var deps = tracking_deps[1];
      tracking_deps[1] = 0;
      return [6, deps];
     });
   register
    ("tracking-active?", function(args){return [0, tracking_active[1]];});
   Stdlib_Hashtbl[10].call(null, primitives, cst_context);
   register
    (cst_context,
     function(args){
      if(args){
       var match = args[1];
       if(typeof match !== "number" && 3 === match[0]){
        var rest = args[2], name = match[1];
        try{
         var a = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = a;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(! stack){
         if(! rest) return 0;
         var default_val = rest[1];
         return default_val;
        }
        var v = stack[1];
        if(typeof v !== "number" && 16 === v[0]){
         var sig = v[1];
         if
          (tracking_active[1]
           && 1 - Stdlib_List[38].call(null, [16, sig], tracking_deps[1]))
          tracking_deps[1] = [0, [16, sig], tracking_deps[1]];
         return sig[1];
        }
        return v;
       }
      }
      return 0;
     });
   register
    ("tracking-register-scope!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        if(! tracking_active[1]) return 0;
        try{
         var b = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = b;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(stack){
         var match = stack[1];
         if(typeof match !== "number" && 16 === match[0]){
          var sig = match[1];
          if(1 - Stdlib_List[38].call(null, [16, sig], tracking_deps[1]))
           tracking_deps[1] = [0, [16, sig], tracking_deps[1]];
          return 0;
         }
        }
        return 0;
       }
      }
      return 0;
     });
   register
    ("deref",
     function(args){
      a:
      if(args){
       var v = args[1];
       if(typeof v !== "number" && 16 === v[0]){
        if(args[2]) break a;
        var sig = v[1];
        if
         (tracking_active[1]
          && 1 - Stdlib_List[38].call(null, [16, sig], tracking_deps[1]))
         tracking_deps[1] = [0, [16, sig], tracking_deps[1]];
        return sig[1];
       }
       if(! args[2]) return v;
      }
      return 0;
     });
   register
    ("bind",
     function(args){
      a:
      if(args){
       var b = args[2], body_fn = args[1];
       if(b && b[2]) break a;
       b:
       {
        if(args){
         var a = args[2];
         if(a && ! a[2]){var u = a[1], update_fn = [0, u]; break b;}
        }
        var update_fn = 0;
       }
       var
        disposers = [0, 0],
        run_tracked =
          function(param){
           Stdlib_List[18].call
            (null, function(d){return caml_call1(d, 0);}, disposers[1]);
           disposers[1] = 0;
           tracking_active[1] = 1;
           tracking_deps[1] = 0;
           var
            result = caml_call2(Sx_types[7][1], body_fn, 0),
            deps = tracking_deps[1];
           tracking_active[1] = 0;
           tracking_deps[1] = 0;
           Stdlib_List[18].call
            (null,
             function(dep){
              if(typeof dep !== "number" && 16 === dep[0]){
               var
                sig = dep[1],
                subscriber =
                  function(param){
                   var new_result = run_tracked(0);
                   if(! update_fn) return 0;
                   var f = update_fn[1];
                   caml_call2(Sx_types[7][1], f, [6, [0, new_result, 0]]);
                   return 0;
                  };
               sig[2] = [0, subscriber, sig[2]];
               disposers[1] =
                [0,
                 function(param){
                  sig[2] =
                   Stdlib_List[44].call
                    (null,
                     function(s){return s !== subscriber ? 1 : 0;},
                     sig[2]);
                  return 0;
                 },
                 disposers[1]];
               return 0;
              }
              return 0;
             },
             deps);
           return result;
          };
       return run_tracked(0);
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "bind: expected (body-fn) or (body-fn update-fn)"],
              1);
     });
   var cst_scope_emit = "scope-emit!";
   register
    (cst_scope_emit,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var value = b[1], name = a[1];
         try{
          var d = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = d;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
          var stack = 0;
         }
         if(stack){
          var match = stack[1];
          if(typeof match === "number"){
           if(0 === match){
            var rest = stack[2];
            Stdlib_Hashtbl[11].call
             (null, scope_stacks, name, [0, [6, [0, value, 0]], rest]);
           }
          }
          else if(6 === match[0]){
           var
            rest$0 = stack[2],
            items = match[1],
            c = [0, [6, Stdlib[37].call(null, items, [0, value, 0])], rest$0];
           Stdlib_Hashtbl[11].call(null, scope_stacks, name, c);
          }
         }
         else
          Stdlib_Hashtbl[11].call
           (null, scope_stacks, name, [0, [6, [0, value, 0]], 0]);
         return 0;
        }
       }
      }
      return 0;
     });
   register
    ("emit!",
     function(args){
      var match = Stdlib_Hashtbl[7].call(null, primitives, cst_scope_emit);
      if(! match) return 0;
      var fn = match[1];
      return caml_call1(fn, args);
     });
   var cst_emitted = "emitted", bC = [6, 0], bD = [6, 0];
   register
    (cst_emitted,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1];
        try{
         var b = Stdlib_Hashtbl[6].call(null, scope_stacks, name), stack = b;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
         var stack = 0;
        }
        if(stack){
         var match = stack[1];
         if(typeof match !== "number" && 6 === match[0]){var items = match[1]; return [6, items];}
        }
        return bD;
       }
      }
      return bC;
     });
   var bE = [6, 0];
   register
    ("scope-emitted",
     function(args){
      var match = Stdlib_Hashtbl[7].call(null, primitives, cst_emitted);
      if(! match) return bE;
      var fn = match[1];
      return caml_call1(fn, args);
     });
   var bF = [6, 0];
   register
    ("scope-collected",
     function(args){
      var match = Stdlib_Hashtbl[7].call(null, primitives, cst_collected);
      if(! match) return bF;
      var fn = match[1];
      return caml_call1(fn, args);
     });
   register
    ("scope-clear-collected!",
     function(args){
      var
       match = Stdlib_Hashtbl[7].call(null, primitives, cst_clear_collected);
      if(! match) return 0;
      var fn = match[1];
      return caml_call1(fn, args);
     });
   register
    ("provide-push!",
     function(args){
      var match = Stdlib_Hashtbl[7].call(null, primitives, cst_scope_push);
      if(! match) return 0;
      var fn = match[1];
      return caml_call1(fn, args);
     });
   register
    ("provide-pop!",
     function(args){
      var match = Stdlib_Hashtbl[7].call(null, primitives, cst_scope_pop);
      if(! match) return 0;
      var fn = match[1];
      return caml_call1(fn, args);
     });
   register
    ("hs-safe-call",
     function(args){
      if(args && ! args[2]){
       var thunk = args[1];
       try{var a = caml_call2(Sx_types[7][1], thunk, 0); return a;}
       catch(exn){return 0;}
      }
      return 0;
     });
   var
    regex_table = Stdlib_Hashtbl[1].call(null, 0, 32),
    cst_id = "id",
    bG = [0, 1];
   function make_regex_value(id, source, flags){
    var d = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, d, "__regex__", bG);
    Stdlib_Hashtbl[11].call(null, d, cst_id, [2, id]);
    Stdlib_Hashtbl[11].call(null, d, "source", [3, source]);
    Stdlib_Hashtbl[11].call(null, d, "flags", [3, flags]);
    return [7, d];
   }
   function regex_of_value(param){
    if(typeof param !== "number" && 7 === param[0]){
     var d = param[1], match = Stdlib_Hashtbl[7].call(null, d, cst_id);
     if(match){
      var match$0 = match[1];
      if(typeof match$0 !== "number" && 2 === match$0[0]){
       var
        n = match$0[1],
        match$1 = Stdlib_Hashtbl[7].call(null, regex_table, n | 0);
       if(! match$1)
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "regex: handle not found"], 1);
       var r = match$1[1];
       return r;
      }
     }
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[9], "regex: missing id"], 1);
    }
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "regex: expected regex dict"], 1);
   }
   var cst_groups = "groups", cst_input = "input", cst_match = "match";
   function group_to_dict(g, input){
    var
     d = Stdlib_Hashtbl[1].call(null, 0, 4),
     e = [3, caml_call2(Re[1][1], g, 0)];
    Stdlib_Hashtbl[11].call(null, d, cst_match, e);
    var f = [2, caml_call2(Re[1][5], g, 0)];
    Stdlib_Hashtbl[11].call(null, d, "index", f);
    Stdlib_Hashtbl[11].call(null, d, cst_input, [3, input]);
    var count = caml_call1(Re[1][12], g), b = count - 1 | 0, a = 0;
    if(b < 1)
     var groups$0 = a;
    else{
     var groups = a, i = b;
     for(;;){
      try{var j = caml_call2(Re[1][1], g, i), s = j;}
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
       var s = cst;
      }
      var c = [0, [3, s], groups], h = i - 1 | 0;
      if(1 === i){var groups$0 = c; break;}
      groups = c;
      i = h;
     }
    }
    Stdlib_Hashtbl[11].call(null, d, cst_groups, [6, groups$0]);
    return [7, d];
   }
   var regex_next_id = [0, 0];
   register
    ("regex-compile",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var
         match = args[2],
         source = a[1],
         cst_regex_compile_invalid_patt = "regex-compile: invalid pattern ";
        if(! match)
         try{
          var
           h = Re_Pcre[3].call(null, 0, source),
           re$0 = Re[2].call(null, h),
           id$0 = regex_next_id[1];
          regex_next_id[1]++;
          Stdlib_Hashtbl[11].call
           (null, regex_table, id$0, [0, re$0, source, cst]);
          var i = make_regex_value(id$0, source, cst);
          return i;
         }
         catch(exn){
          var
           g = Stdlib[28].call(null, cst_regex_compile_invalid_patt, source);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
         }
        var b = match[1];
        if(typeof b !== "number" && 3 === b[0]){
         var c = match[2], flags = b[1];
         if(c && c[2]) break a;
         var opts = [0, 0];
         Stdlib_String[30].call
          (null,
           function(param){
            var switcher = param - 105 | 0;
            if(10 >= switcher >>> 0)
             switch(switcher){
               case 0:
                opts[1] = [0, 601676297, opts[1]]; return 0;
               case 4:
                opts[1] = [0, 426394317, opts[1]]; return 0;
               case 10:
                opts[1] = [0, -459022792, opts[1]]; return 0;
             }
            return 0;
           },
           flags);
         var opts$0 = opts[1];
         try{
          var
           e = Re_Pcre[3].call(null, [0, opts$0], source),
           re = Re[2].call(null, e),
           id = regex_next_id[1];
          regex_next_id[1]++;
          Stdlib_Hashtbl[11].call
           (null, regex_table, id, [0, re, source, flags]);
          var f = make_regex_value(id, source, flags);
          return f;
         }
         catch(exn){
          var
           d = Stdlib[28].call(null, cst_regex_compile_invalid_patt, source);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-compile: (source flags)"], 1);
     });
   register
    ("regex-test",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1];
        if(typeof b !== "number" && 3 === b[0] && ! a[2]){
         var s = b[1], rx = args[1], re = regex_of_value(rx)[1];
         return [0, Re[7].call(null, 0, 0, re, s)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-test: (regex string)"], 1);
     });
   register
    ("regex-exec",
     function(args){
      a:
      if(args){
       var a = args[2];
       if(a){
        var b = a[1];
        if(typeof b !== "number" && 3 === b[0]){
         var match = a[2], s = b[1], rx = args[1];
         if(match){
          var c = match[1];
          if(typeof c === "number") break a;
          if(2 !== c[0]) break a;
          if(match[2]) break a;
          var n = c[1], start = n | 0;
         }
         else
          var start = 0;
         var re = regex_of_value(rx)[1];
         try{
          var
           g = Re[5].call(null, [0, start], 0, re, s),
           d = group_to_dict(g, s);
          return d;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn === Stdlib[8]) return 0;
          throw caml_maybe_attach_backtrace(exn, 0);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-exec: (regex string start?)"], 1);
     });
   register
    ("regex-match-all",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1];
        if(typeof b !== "number" && 3 === b[0] && ! a[2]){
         var
          s = b[1],
          rx = args[1],
          re = regex_of_value(rx)[1],
          all = Re[11].call(null, 0, 0, re, s);
         return [6,
                 Stdlib_List[20].call
                  (null, function(g){return group_to_dict(g, s);}, all)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-match-all: (regex string)"], 1);
     });
   register
    (cst_regex_replace,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1];
        if(typeof b !== "number" && 3 === b[0]){
         var c = a[2];
         if(c){
          var d = c[1];
          if(typeof d !== "number" && 3 === d[0] && ! c[2]){
           var
            replacement = d[1],
            s = b[1],
            rx = args[1],
            match = regex_of_value(rx),
            flags = match[3],
            re = match[1],
            expand =
              function(g){
               var
                buf =
                  Stdlib_Buffer[1].call
                   (null, caml_ml_string_length(replacement)),
                n = caml_ml_string_length(replacement),
                i = 0;
               for(;;){
                if(i >= n) return Stdlib_Buffer[2].call(null, buf);
                var c = caml_string_get(replacement, i);
                if(36 === c && (i + 1 | 0) < n){
                 var
                  c$0 = caml_string_get(replacement, i + 1 | 0),
                  switcher = c$0 - 36 | 0;
                 if(2 >= switcher >>> 0)
                  switch(switcher){
                    case 0:
                     Stdlib_Buffer[12].call(null, buf, 36);
                     i = i + 2 | 0;
                     continue;
                    case 2:
                     var b = caml_call2(Re[1][1], g, 0);
                     Stdlib_Buffer[16].call(null, buf, b);
                     i = i + 2 | 0;
                     continue;
                  }
                 if(48 <= c$0 && 57 >= c$0){
                  var idx = c$0 - 48 | 0;
                  try{
                   var a = caml_call2(Re[1][1], g, idx);
                   Stdlib_Buffer[16].call(null, buf, a);
                  }
                  catch(exn$0){
                   var exn = caml_wrap_exception(exn$0);
                   if(exn !== Stdlib[8])
                    throw caml_maybe_attach_backtrace(exn, 0);
                  }
                  i = i + 2 | 0;
                  continue;
                 }
                 Stdlib_Buffer[12].call(null, buf, c);
                 var i$0 = i + 1 | 0;
                 i = i$0;
                 continue;
                }
                Stdlib_Buffer[12].call(null, buf, c);
                var i$1 = i + 1 | 0;
                i = i$1;
               }
              },
            global = Stdlib_String[15].call(null, flags, 103);
           if(global) return [3, Re[91].call(null, 0, 0, 0, re, expand, s)];
           var match$0 = Re[6].call(null, 0, 0, re, s);
           if(! match$0) return [3, s];
           var
            g = match$0[1],
            repl = expand(g),
            e = caml_call2(Re[1][5], g, 0),
            before = Stdlib_String[16].call(null, s, 0, e),
            after_start = caml_call2(Re[1][7], g, 0),
            after =
              Stdlib_String[16].call
               (null,
                s,
                after_start,
                caml_ml_string_length(s) - after_start | 0),
            f = Stdlib[28].call(null, repl, after);
           return [3, Stdlib[28].call(null, before, f)];
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-replace: (regex string replacement)"],
              1);
     });
   register
    ("regex-replace-fn",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1];
        if(typeof b !== "number" && 3 === b[0]){
         var c = a[2];
         if(c && ! c[2]){
          var
           f = c[1],
           s = b[1],
           rx = args[1],
           match = regex_of_value(rx),
           flags = match[3],
           re = match[1],
           call_fn =
             function(g){
              var
               match_str = caml_call2(Re[1][1], g, 0),
               count = caml_call1(Re[1][12], g),
               b = count - 1 | 0,
               a = 0;
              if(b < 1)
               var groups_before$0 = a;
              else{
               var groups_before = a, i = b;
               for(;;){
                try{var h = [3, caml_call2(Re[1][1], g, i)], v$0 = h;}
                catch(exn$0){
                 var exn = caml_wrap_exception(exn$0);
                 if(exn !== Stdlib[8])
                  throw caml_maybe_attach_backtrace(exn, 0);
                 var v$0 = 0;
                }
                var c = [0, v$0, groups_before], e = i - 1 | 0;
                if(1 === i){var groups_before$0 = c; break;}
                groups_before = c;
                i = e;
               }
              }
              var
               idx = [2, caml_call2(Re[1][5], g, 0)],
               d =
                 Stdlib[37].call
                  (null, groups_before$0, [0, idx, [0, [3, s], 0]]),
               all_args = Stdlib[37].call(null, [0, [3, match_str], 0], d),
               v = caml_call2(Sx_types[7][1], f, [6, all_args]);
              if(typeof v !== "number")
               switch(v[0]){
                 case 2:
                  var n = v[1]; return Sx_types[34].call(null, n);
                 case 3:
                  var s$0 = v[1]; return s$0;
               }
              return Sx_types[117].call(null, v);
             },
           global = Stdlib_String[15].call(null, flags, 103);
          if(global) return [3, Re[91].call(null, 0, 0, 0, re, call_fn, s)];
          var match$0 = Re[6].call(null, 0, 0, re, s);
          if(! match$0) return [3, s];
          var
           g = match$0[1],
           repl = call_fn(g),
           d = caml_call2(Re[1][5], g, 0),
           before = Stdlib_String[16].call(null, s, 0, d),
           after_start = caml_call2(Re[1][7], g, 0),
           after =
             Stdlib_String[16].call
              (null,
               s,
               after_start,
               caml_ml_string_length(s) - after_start | 0),
           e = Stdlib[28].call(null, repl, after);
          return [3, Stdlib[28].call(null, before, e)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-replace-fn: (regex string fn)"], 1);
     });
   register
    (cst_regex_split,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1];
        if(typeof b !== "number" && 3 === b[0] && ! a[2]){
         var
          s = b[1],
          rx = args[1],
          re = regex_of_value(rx)[1],
          c = Re[17].call(null, 0, 0, re, s);
         return [6,
                 Stdlib_List[20].call(null, function(x){return [3, x];}, c)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-split: (regex string)"], 1);
     });
   register
    ("regex-source",
     function(args){
      if(args && ! args[2]){
       var rx = args[1], source = regex_of_value(rx)[2];
       return [3, source];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-source: (regex)"], 1);
     });
   register
    ("regex-flags",
     function(args){
      if(args && ! args[2]){
       var rx = args[1], flags = regex_of_value(rx)[3];
       return [3, flags];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regex-flags: (regex)"], 1);
     });
   function make_regexp_value(source, flags){
    var opts = [0, 0];
    Stdlib_String[30].call
     (null,
      function(param){
       var switcher = param - 105 | 0;
       if(10 >= switcher >>> 0)
        switch(switcher){
          case 0:
           opts[1] = [0, 601676297, opts[1]]; return 0;
          case 4:
           opts[1] = [0, 426394317, opts[1]]; return 0;
          case 10:
           opts[1] = [0, -459022792, opts[1]]; return 0;
        }
       return 0;
      },
      flags);
    var opts$0 = opts[1];
    try{
     var
      b = Re_Pcre[3].call(null, [0, opts$0], source),
      compiled = Re[2].call(null, b),
      c = [36, source, flags, compiled];
     return c;
    }
    catch(exn){
     var a = Stdlib[28].call(null, "make-regexp: invalid pattern: ", source);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
    }
   }
   var cst_end = "end", cst_start = "start";
   function match_dict(g, input){
    var
     d = Stdlib_Hashtbl[1].call(null, 0, 4),
     e = [3, caml_call2(Re[1][1], g, 0)];
    Stdlib_Hashtbl[11].call(null, d, cst_match, e);
    var f = [1, caml_call2(Re[1][5], g, 0)];
    Stdlib_Hashtbl[11].call(null, d, cst_start, f);
    var h = [1, caml_call2(Re[1][7], g, 0)];
    Stdlib_Hashtbl[11].call(null, d, cst_end, h);
    Stdlib_Hashtbl[11].call(null, d, cst_input, [3, input]);
    var count = caml_call1(Re[1][12], g), b = count - 1 | 0, a = 0;
    if(b < 1)
     var groups$0 = a;
    else{
     var groups = a, i = b;
     for(;;){
      try{var k = caml_call2(Re[1][1], g, i), s = k;}
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
       var s = cst;
      }
      var c = [0, [3, s], groups], j = i - 1 | 0;
      if(1 === i){var groups$0 = c; break;}
      groups = c;
      i = j;
     }
    }
    Stdlib_Hashtbl[11].call(null, d, cst_groups, [6, groups$0]);
    return [7, d];
   }
   register
    ("make-regexp",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var match = args[2], src = a[1];
        if(! match) return make_regexp_value(src, cst);
        var b = match[1];
        if(typeof b !== "number" && 3 === b[0] && ! match[2]){
         var flags = b[1];
         return make_regexp_value(src, flags);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-regexp: (pattern [flags])"], 1);
     });
   var bH = [0, 0], bI = [0, 1];
   register
    ("regexp?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0]){if(args[2]) break a; return bI;}
       if(! args[2]) return bH;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "regexp?: 1 arg"], 1);
     });
   register
    ("regexp-source",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0] && ! args[2]){var src = a[1]; return [3, src];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regexp-source: expected regexp"], 1);
     });
   register
    ("regexp-flags",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0] && ! args[2]){var flags = a[2]; return [3, flags];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regexp-flags: expected regexp"], 1);
     });
   register
    ("regexp-match",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var s = c[1], re = a[3], match = Re[6].call(null, 0, 0, re, s);
          if(! match) return 0;
          var g = match[1];
          return match_dict(g, s);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regexp-match: (regexp string)"], 1);
     });
   register
    ("regexp-match-all",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var s = c[1], re = a[3], d = Re[11].call(null, 0, 0, re, s);
          return [6,
                  Stdlib_List[20].call
                   (null, function(g){return match_dict(g, s);}, d)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regexp-match-all: (regexp string)"], 1);
     });
   register
    ("regexp-replace",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0]){
        var b = args[2];
        if(b){
         var d = b[1];
         if(typeof d !== "number" && 3 === d[0]){
          var e = b[2];
          if(e){
           var f = e[1];
           if(typeof f !== "number" && 3 === f[0] && ! e[2]){
            var
             replacement = f[1],
             s = d[1],
             re = a[3],
             match = Re[6].call(null, 0, 0, re, s);
            if(! match) return [3, s];
            var
             g = match[1],
             buf = Stdlib_Buffer[1].call(null, caml_ml_string_length(s)),
             n = caml_ml_string_length(replacement),
             k = caml_call2(Re[1][5], g, 0),
             l = Stdlib_String[16].call(null, s, 0, k);
            Stdlib_Buffer[16].call(null, buf, l);
            var i = 0;
            for(;;){
             if(i >= n){
              var
               m = caml_ml_string_length(s) - caml_call2(Re[1][7], g, 0) | 0,
               o = caml_call2(Re[1][7], g, 0),
               p = Stdlib_String[16].call(null, s, o, m);
              Stdlib_Buffer[16].call(null, buf, p);
              return [3, Stdlib_Buffer[2].call(null, buf)];
             }
             var c = caml_string_get(replacement, i);
             if(36 === c && (i + 1 | 0) < n){
              var
               c$0 = caml_string_get(replacement, i + 1 | 0),
               switcher = c$0 - 36 | 0;
              if(2 >= switcher >>> 0)
               switch(switcher){
                 case 0:
                  Stdlib_Buffer[12].call(null, buf, 36);
                  i = i + 2 | 0;
                  continue;
                 case 2:
                  var j = caml_call2(Re[1][1], g, 0);
                  Stdlib_Buffer[16].call(null, buf, j);
                  i = i + 2 | 0;
                  continue;
               }
              if(48 <= c$0 && 57 >= c$0){
               var idx = c$0 - 48 | 0;
               try{
                var h = caml_call2(Re[1][1], g, idx);
                Stdlib_Buffer[16].call(null, buf, h);
               }
               catch(exn$0){
                var exn = caml_wrap_exception(exn$0);
                if(exn !== Stdlib[8])
                 throw caml_maybe_attach_backtrace(exn, 0);
               }
               i = i + 2 | 0;
               continue;
              }
              Stdlib_Buffer[12].call(null, buf, c);
              var i$0 = i + 1 | 0;
              i = i$0;
              continue;
             }
             Stdlib_Buffer[12].call(null, buf, c);
             var i$1 = i + 1 | 0;
             i = i$1;
            }
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regexp-replace: (regexp string replacement)"],
              1);
     });
   register
    ("regexp-replace-all",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0]){
          var d = b[2];
          if(d){
           var e = d[1];
           if(typeof e !== "number" && 3 === e[0] && ! d[2]){
            var
             replacement = e[1],
             s = c[1],
             re = a[3],
             expand =
               function(g){
                var
                 buf =
                   Stdlib_Buffer[1].call
                    (null, caml_ml_string_length(replacement)),
                 n = caml_ml_string_length(replacement),
                 i = 0;
                for(;;){
                 if(i >= n) return Stdlib_Buffer[2].call(null, buf);
                 var c = caml_string_get(replacement, i);
                 if(36 === c && (i + 1 | 0) < n){
                  var
                   c$0 = caml_string_get(replacement, i + 1 | 0),
                   switcher = c$0 - 36 | 0;
                  if(2 >= switcher >>> 0)
                   switch(switcher){
                     case 0:
                      Stdlib_Buffer[12].call(null, buf, 36);
                      i = i + 2 | 0;
                      continue;
                     case 2:
                      var b = caml_call2(Re[1][1], g, 0);
                      Stdlib_Buffer[16].call(null, buf, b);
                      i = i + 2 | 0;
                      continue;
                   }
                  if(48 <= c$0 && 57 >= c$0){
                   var idx = c$0 - 48 | 0;
                   try{
                    var a = caml_call2(Re[1][1], g, idx);
                    Stdlib_Buffer[16].call(null, buf, a);
                   }
                   catch(exn$0){
                    var exn = caml_wrap_exception(exn$0);
                    if(exn !== Stdlib[8])
                     throw caml_maybe_attach_backtrace(exn, 0);
                   }
                   i = i + 2 | 0;
                   continue;
                  }
                  Stdlib_Buffer[12].call(null, buf, c);
                  var i$0 = i + 1 | 0;
                  i = i$0;
                  continue;
                 }
                 Stdlib_Buffer[12].call(null, buf, c);
                 var i$1 = i + 1 | 0;
                 i = i$1;
                }
               };
            return [3, Re[91].call(null, 0, 0, 0, re, expand, s)];
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "regexp-replace-all: (regexp string replacement)"],
              1);
     });
   register
    ("regexp-split",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 36 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var s = c[1], re = a[3], d = Re[17].call(null, 0, 0, re, s);
          return [6,
                  Stdlib_List[20].call(null, function(x){return [3, x];}, d)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "regexp-split: (regexp string)"], 1);
     });
   register
    ("bitwise-and",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 1 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 1 === e[0] && ! d[2]){var b = e[1], a = c[1]; return [1, a & b];}
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bitwise-and: expected (integer integer)"], 1);
     });
   register
    ("bitwise-or",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 1 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 1 === e[0] && ! d[2]){var b = e[1], a = c[1]; return [1, a | b];}
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bitwise-or: expected (integer integer)"], 1);
     });
   register
    ("bitwise-xor",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 1 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 1 === e[0] && ! d[2]){var b = e[1], a = c[1]; return [1, a ^ b];}
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bitwise-xor: expected (integer integer)"], 1);
     });
   register
    ("bitwise-not",
     function(args){
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 1 === b[0] && ! args[2]){var a = b[1]; return [1, Stdlib[21].call(null, a)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bitwise-not: expected (integer)"], 1);
     });
   register
    ("arithmetic-shift",
     function(args){
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 1 === b[0]){
        var c = args[2];
        if(c){
         var d = c[1];
         if(typeof d !== "number" && 1 === d[0] && ! c[2]){
          var
           count = d[1],
           a = b[1],
           e = 0 <= count ? a << count : a >> (- count | 0);
          return [1, e];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "arithmetic-shift: expected (integer integer)"],
              1);
     });
   register
    ("bit-count",
     function(args){
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 1 === b[0] && ! args[2]){
        var a = b[1], c = 0, n = Stdlib[18].call(null, a);
        for(;;){
         if(0 === n) return [1, c];
         c = c + (n & 1) | 0;
         n = n >>> 1 | 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bit-count: expected (integer)"], 1);
     });
   register
    ("integer-length",
     function(args){
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 1 === b[0] && ! args[2]){
        var a = b[1], bits = 0, n = Stdlib[18].call(null, a);
        for(;;){
         if(0 === n) return [1, bits];
         var bits$0 = bits + 1 | 0;
         bits = bits$0;
         n = n >>> 1 | 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "integer-length: expected (integer)"], 1);
     });
   register
    ("make-hash-table",
     function(param){return [31, Stdlib_Hashtbl[1].call(null, 0, 16)];});
   var bJ = [0, 0], bK = [0, 0], bL = [0, 1];
   register
    ("hash-table?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0]){if(args[2]) break a; return bL;}
       if(! args[2]) return bK;
      }
      return bJ;
     });
   register
    ("hash-table-set!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0]){
        var b = args[2];
        if(b){
         var c = b[2];
         if(c && ! c[2]){
          var v = c[1], k = b[1], ht = a[1];
          try{Stdlib_Hashtbl[11].call(null, ht, k, v);}
          catch(exn){
           var found = [0, 0];
           Stdlib_Hashtbl[12].call
            (null,
             function(ek, param){
              var
               a = ek === k ? 1 : 0,
               b =
                 a
                  ? (Stdlib_Hashtbl
                      [11].call
                     (null, ht, ek, v),
                    found[1] = 1,
                    0)
                  : a;
              return b;
             },
             ht);
           if(1 - found[1]) Stdlib_Hashtbl[11].call(null, ht, k, v);
          }
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-set!: expected (ht key val)"], 1);
     });
   register
    ("hash-table-ref",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0]){
        var b = args[2];
        if(b){
         var match = b[2], k = b[1], ht = a[1];
         if(! match)
          try{var d = Stdlib_Hashtbl[6].call(null, ht, k); return d;}
          catch(exn){
           var exn$0 = caml_wrap_exception(exn);
           if(exn$0 === Stdlib[8])
            throw caml_maybe_attach_backtrace
                   ([0, Sx_types[9], "hash-table-ref: key not found"], 1);
           throw caml_maybe_attach_backtrace(exn$0, 0);
          }
         if(! match[2]){
          var default$ = match[1];
          try{var c = Stdlib_Hashtbl[6].call(null, ht, k); return c;}
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn === Stdlib[8]) return default$;
           throw caml_maybe_attach_backtrace(exn, 0);
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "hash-table-ref: expected (ht key) or (ht key default)"],
              1);
     });
   register
    ("hash-table-delete!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var k = b[1], ht = a[1];
         Stdlib_Hashtbl[10].call(null, ht, k);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-delete!: expected (ht key)"], 1);
     });
   register
    ("hash-table-size",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0] && ! args[2]){
        var ht = a[1];
        return [1, Stdlib_Hashtbl[15].call(null, ht)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-size: expected (ht)"], 1);
     });
   register
    ("hash-table-keys",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0] && ! args[2]){
        var ht = a[1];
        return [6,
                Stdlib_Hashtbl[14].call
                 (null, function(k, param, acc){return [0, k, acc];}, ht, 0)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-keys: expected (ht)"], 1);
     });
   register
    ("hash-table-values",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0] && ! args[2]){
        var ht = a[1];
        return [6,
                Stdlib_Hashtbl[14].call
                 (null, function(param, v, acc){return [0, v, acc];}, ht, 0)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-values: expected (ht)"], 1);
     });
   register
    ("hash-table->alist",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0] && ! args[2]){
        var ht = a[1];
        return [6,
                Stdlib_Hashtbl[14].call
                 (null,
                  function(k, v, acc){
                   return [0, [6, [0, k, [0, v, 0]]], acc];
                  },
                  ht,
                  0)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table->alist: expected (ht)"], 1);
     });
   register
    ("hash-table-for-each",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var fn = b[1], ht = a[1];
         Stdlib_Hashtbl[12].call
          (null,
           function(k, v){
            caml_call2(Sx_types[7][1], fn, [6, [0, k, [0, v, 0]]]);
            return 0;
           },
           ht);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-for-each: expected (ht fn)"], 1);
     });
   register
    ("hash-table-merge!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 31 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 31 === c[0] && ! b[2]){
          var src = c[1], dst = a[1];
          Stdlib_Hashtbl[12].call
           (null,
            function(k, v){return Stdlib_Hashtbl[11].call(null, dst, k, v);},
            src);
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "hash-table-merge!: expected (dst src)"], 1);
     });
   var bM = [6, 0];
   function seq_to_list(v){
    if(typeof v === "number"){if(0 === v) return bM;}
    else
     switch(v[0]){
       case 3:
        var s = v[1], chars = [0, 0];
        Stdlib_String[30].call
         (null,
          function(c){
           var a = chars[1];
           chars[1] = [0, [3, Stdlib_String[1].call(null, 1, c)], a];
           return 0;
          },
          s);
        return [6, Stdlib_List[10].call(null, chars[1])];
       case 6:
        return v;
       case 21:
        var items = v[1][1]; return [6, items];
       case 29:
        var arr = v[1]; return [6, Stdlib_Array[10].call(null, arr)];
     }
    return v;
   }
   register
    ("seq-to-list",
     function(args){
      if(args && ! args[2]){var v = args[1]; return seq_to_list(v);}
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "seq-to-list: expected 1 arg"], 1);
     });
   register
    ("sequence-to-list",
     function(args){
      if(args && ! args[2]){var v = args[1]; return seq_to_list(v);}
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sequence-to-list: expected 1 arg"], 1);
     });
   register
    ("sequence-to-vector",
     function(args){
      if(args && ! args[2]){
       var v = args[1], x = seq_to_list(v);
       if(typeof x !== "number" && 6 === x[0]){
        var xs = x[1];
        return [29, Stdlib_Array[11].call(null, xs)];
       }
       return x;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sequence-to-vector: expected 1 arg"], 1);
     });
   register
    ("sequence-length",
     function(args){
      a:
      if(args){
       var v = args[1];
       if(typeof v !== "number")
        switch(v[0]){
          case 3:
           if(args[2]) break a;
           var s = v[1];
           return [1, caml_ml_string_length(s)];
          case 29:
           if(args[2]) break a; var arr = v[1]; return [1, arr.length - 1];
        }
       if(! args[2]){
        var match = seq_to_list(v);
        if(typeof match !== "number" && 6 === match[0]){
         var xs = match[1];
         return [1, Stdlib_List[1].call(null, xs)];
        }
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "sequence-length: expected sequence"], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sequence-length: expected 1 arg"], 1);
     });
   var
    cst_out_of_bounds = " out of bounds",
    cst_sequence_ref_index = "sequence-ref: index ",
    cst_sequence_ref_index_d_out_o = "sequence-ref: index %d out of bounds",
    bN =
      [0,
       [11, cst_sequence_ref_index, [4, 0, 0, 0, [11, cst_out_of_bounds, 0]]],
       cst_sequence_ref_index_d_out_o],
    bO =
      [0,
       [11, cst_sequence_ref_index, [4, 0, 0, 0, [11, cst_out_of_bounds, 0]]],
       cst_sequence_ref_index_d_out_o],
    bP =
      [0,
       [11, cst_sequence_ref_index, [4, 0, 0, 0, [11, cst_out_of_bounds, 0]]],
       cst_sequence_ref_index_d_out_o];
   register
    ("sequence-ref",
     function(args){
      a:
      if(args){
       var v = args[1];
       if(typeof v !== "number" && 3 === v[0]){
        var a = args[2];
        if(! a) break a;
        var b = a[1], s = v[1];
        if(typeof b !== "number")
         switch(b[0]){
           case 1:
            if(a[2]) break a;
            var i$0 = b[1];
            if(0 <= i$0 && caml_ml_string_length(s) > i$0){
             var g = caml_string_get(s, i$0);
             return [3, Stdlib_String[1].call(null, 1, g)];
            }
            var f = caml_call1(Stdlib_Printf[4].call(null, bO), i$0);
            throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
           case 2:
            if(a[2]) break a;
            var n$1 = b[1], i$1 = n$1 | 0;
            if(0 <= i$1 && caml_ml_string_length(s) > i$1){
             var j = caml_string_get(s, i$1);
             return [3, Stdlib_String[1].call(null, 1, j)];
            }
            var h = caml_call1(Stdlib_Printf[4].call(null, bP), i$1);
            throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
         }
       }
       var c = args[2];
       if(c && ! c[2]){
        var idx = c[1], lst = seq_to_list(v);
        b:
        if(typeof idx !== "number"){
         switch(idx[0]){
           case 1:
            var n = idx[1], i = n; break;
           case 2:
            var n$0 = idx[1], i = n$0 | 0; break;
           default: break b;
         }
         if(typeof lst !== "number" && 6 === lst[0]){
          var xs = lst[1];
          try{var e = Stdlib_List[8].call(null, xs, i); return e;}
          catch(exn){
           var d = caml_call1(Stdlib_Printf[4].call(null, bN), i);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
          }
         }
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "sequence-ref: expected sequence"], 1);
        }
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "sequence-ref: index must be number"], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sequence-ref: expected (seq index)"], 1);
     });
   register
    ("sequence-append",
     function(args){
      a:
      if(args){
       var v1 = args[1];
       if(typeof v1 !== "number" && 3 === v1[0]){
        var b = args[2];
        if(! b) break a;
        var c = b[1];
        if(typeof c !== "number" && 3 === c[0]){
         if(b[2]) break a;
         var s2 = c[1], s1 = v1[1];
         return [3, Stdlib[28].call(null, s1, s2)];
        }
       }
       var a = args[2];
       if(a && ! a[2]){
        var v2 = a[1], l1 = seq_to_list(v1), l2 = seq_to_list(v2);
        if
         (typeof l1 !== "number"
          && 6 === l1[0] && typeof l2 !== "number" && 6 === l2[0]){
         var xs2 = l2[1], xs1 = l1[1];
         return [6, Stdlib[37].call(null, xs1, xs2)];
        }
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "sequence-append: expected sequences"], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sequence-append: expected 2 args"], 1);
     });
   register
    ("in-range",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           var match = args[2], n = a[1];
           if(match){
            var b = match[1];
            if(typeof b !== "number" && 1 === b[0]){
             var match$0 = match[2], hi = b[1];
             if(match$0){
              var c = match$0[1];
              if(typeof c !== "number" && 1 === c[0] && ! match$0[2]){
               var step = c[1];
               if(0 === step)
                throw caml_maybe_attach_backtrace
                       ([0, Sx_types[9], "in-range: step cannot be zero"], 1);
               var i = n, acc = 0;
               for(;;){
                a:
                {
                 if(0 < step && hi <= i) break a;
                 if(0 > step && i <= hi) break a;
                 var acc$0 = [0, [1, i], acc], i$0 = i + step | 0;
                 i = i$0;
                 acc = acc$0;
                 continue;
                }
                return [6, Stdlib_List[10].call(null, acc)];
               }
              }
             }
             else{
              var i$3 = hi - 1 | 0, i$1 = i$3, acc$1 = 0;
              for(;;){
               if(i$1 < n) return [6, acc$1];
               var acc$2 = [0, [1, i$1], acc$1], i$2 = i$1 - 1 | 0;
               i$1 = i$2;
               acc$1 = acc$2;
              }
             }
            }
           }
           else{
            var i$6 = n - 1 | 0, i$4 = i$6, acc$3 = 0;
            for(;;){
             if(0 > i$4) return [6, acc$3];
             var acc$4 = [0, [1, i$4], acc$3], i$5 = i$4 - 1 | 0;
             i$4 = i$5;
             acc$3 = acc$4;
            }
           }
           break;
          case 2:
           var match$1 = args[2], n$0 = a[1];
           if(match$1){
            var d = match$1[1];
            if(typeof d !== "number" && 2 === d[0] && ! match$1[2]){
             var
              hi$0 = d[1],
              lo_i = n$0 | 0,
              hi_i = hi$0 | 0,
              i$9 = hi_i - 1 | 0,
              i$7 = i$9,
              acc$5 = 0;
             for(;;){
              if(i$7 < lo_i) return [6, acc$5];
              var acc$6 = [0, [1, i$7], acc$5], i$8 = i$7 - 1 | 0;
              i$7 = i$8;
              acc$5 = acc$6;
             }
            }
           }
           else{
            var hi$1 = n$0 | 0, i$12 = hi$1 - 1 | 0, i$10 = i$12, acc$7 = 0;
            for(;;){
             if(0 > i$10) return [6, acc$7];
             var acc$8 = [0, [1, i$10], acc$7], i$11 = i$10 - 1 | 0;
             i$10 = i$11;
             acc$7 = acc$8;
            }
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "in-range: expected (end) or (start end) or (start end step)"],
              1);
     });
   var gensym_counter = [0, 0];
   register
    ("gensym",
     function(args){
      a:
      {
       if(args){
        var a = args[1];
        if(typeof a !== "number")
         switch(a[0]){
           case 3:
            if(! args[2]){var s = a[1], prefix = s; break a;} break;
           case 4:
            if(! args[2]){var s$0 = a[1], prefix = s$0; break a;} break;
         }
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "gensym: expected optional prefix string"],
                1);
       }
       var prefix = "g";
      }
      gensym_counter[1]++;
      var b = Stdlib[33].call(null, gensym_counter[1]);
      return [4, Stdlib[28].call(null, prefix, b)];
     });
   register
    ("string->symbol",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [4, s];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string->symbol: expected 1 string"], 1);
     });
   register
    ("symbol->string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 4 === a[0] && ! args[2]){var s = a[1]; return [3, s];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "symbol->string: expected 1 symbol"], 1);
     });
   register
    ("intern",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [4, s];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "intern: expected 1 string"], 1);
     });
   var bQ = [0, 1];
   register
    ("symbol-interned?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 4 === a[0] && ! args[2]) return bQ;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "symbol-interned?: expected 1 symbol"], 1);
     });
   function char_downcase_cp(n){
    if(65 <= n && 90 >= n) return n + 32 | 0;
    return n;
   }
   register
    ("make-char",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0] && ! args[2]){var n = a[1]; return [32, n];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-char: expected integer codepoint"], 1);
     });
   var bR = [0, 0], bS = [0, 1];
   register
    ("char?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0]){if(args[2]) break a; return bS;}
       if(! args[2]) return bR;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char?: expected 1 argument"], 1);
     });
   register
    ("char->integer",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){var n = a[1]; return [1, n];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char->integer: expected char"], 1);
     });
   register
    ("integer->char",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0] && ! args[2]){var n = a[1]; return [32, n];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "integer->char: expected integer"], 1);
     });
   register
    ("char-upcase",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){
        var n = a[1], b = 97 <= n ? 122 < n ? n : n - 32 | 0 : n;
        return [32, b];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-upcase: expected char"], 1);
     });
   register
    ("char-downcase",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){var n = a[1]; return [32, char_downcase_cp(n)];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-downcase: expected char"], 1);
     });
   register
    ("char=?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1];
          return [0, a === b ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char=?: expected 2 chars"], 1);
     });
   register
    ("char<?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1];
          return [0, a < b ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char<?: expected 2 chars"], 1);
     });
   register
    ("char>?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1];
          return [0, b < a ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char>?: expected 2 chars"], 1);
     });
   register
    ("char<=?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1];
          return [0, a <= b ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char<=?: expected 2 chars"], 1);
     });
   register
    ("char>=?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1];
          return [0, b <= a ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char>=?: expected 2 chars"], 1);
     });
   register
    ("char-ci=?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1], f = char_downcase_cp(b);
          return [0, char_downcase_cp(a) === f ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-ci=?: expected 2 chars"], 1);
     });
   register
    ("char-ci<?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1], f = char_downcase_cp(b);
          return [0, char_downcase_cp(a) < f ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-ci<?: expected 2 chars"], 1);
     });
   register
    ("char-ci>?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1], f = char_downcase_cp(b);
          return [0, f < char_downcase_cp(a) ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-ci>?: expected 2 chars"], 1);
     });
   register
    ("char-ci<=?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1], f = char_downcase_cp(b);
          return [0, char_downcase_cp(a) <= f ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-ci<=?: expected 2 chars"], 1);
     });
   register
    ("char-ci>=?",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 32 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 32 === e[0] && ! d[2]){
          var b = e[1], a = c[1], f = char_downcase_cp(b);
          return [0, f <= char_downcase_cp(a) ? 1 : 0];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-ci>=?: expected 2 chars"], 1);
     });
   register
    ("char-alphabetic?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){
        var n = a[1], b = 65 <= n ? 1 : 0, c = b ? n <= 90 ? 1 : 0 : b;
        if(c)
         var d = c;
        else
         var e = 97 <= n ? 1 : 0, d = e ? n <= 122 ? 1 : 0 : e;
        return [0, d];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-alphabetic?: expected char"], 1);
     });
   register
    ("char-numeric?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){
        var n = a[1], b = 48 <= n ? 1 : 0, c = b ? n <= 57 ? 1 : 0 : b;
        return [0, c];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-numeric?: expected char"], 1);
     });
   register
    ("char-whitespace?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){
        var n = a[1], c = 32 === n ? 1 : 0;
        if(c)
         var b = c;
        else{
         var d = 9 === n ? 1 : 0;
         if(d)
          var b = d;
         else
          var e = 10 === n ? 1 : 0, b = e || (13 === n ? 1 : 0);
        }
        return [0, b];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-whitespace?: expected char"], 1);
     });
   register
    ("char-upper-case?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){
        var n = a[1], b = 65 <= n ? 1 : 0, c = b ? n <= 90 ? 1 : 0 : b;
        return [0, c];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-upper-case?: expected char"], 1);
     });
   register
    ("char-lower-case?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0] && ! args[2]){
        var n = a[1], b = 97 <= n ? 1 : 0, c = b ? n <= 122 ? 1 : 0 : b;
        return [0, c];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-lower-case?: expected char"], 1);
     });
   register
    ("string->list",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var s = a[1], chars = [0, 0];
        Stdlib_String[30].call
         (null, function(c){chars[1] = [0, [32, c], chars[1]]; return 0;}, s);
        return [6, Stdlib_List[10].call(null, chars[1])];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string->list: expected string"], 1);
     });
   register
    ("list->string",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var chars = a[1]; break;
          case 21:
           var c = a[1][1]; if(args[2]) break a; var chars = c; break;
          default: break a;
        }
        var
         b = Stdlib_List[1].call(null, chars),
         buf = Stdlib_Buffer[1].call(null, b);
        Stdlib_List[18].call
         (null,
          function(v){
           if(typeof v !== "number" && 32 === v[0]){
            var n = v[1], c = Stdlib_Char[1].call(null, n & 255);
            return Stdlib_Buffer[12].call(null, buf, c);
           }
           var
            a = Sx_types[61].call(null, v),
            b = Stdlib[28].call(null, "list->string: expected char, got ", a);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
          },
          chars);
        return [3, Stdlib_Buffer[2].call(null, buf)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "list->string: expected list of chars"], 1);
     });
   register("eof-object", function(args){return 1;});
   var bT = [0, 1], bU = [0, 0];
   register
    ("eof-object?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a === "number" && a){if(args[2]) break a; return bT;}
       if(! args[2]) return bU;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "eof-object?: expected 1 argument"], 1);
     });
   register
    ("open-input-string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [33, [0, 0, [0, s, [0, 0]]]];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "open-input-string: expected string"], 1);
     });
   register
    ("open-output-string",
     function(args){
      if(args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "open-output-string: expected no arguments"],
               1);
      return [33, [0, 0, [1, Stdlib_Buffer[1].call(null, 64)]]];
     });
   register
    ("get-output-string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 33 === a[0]){
        var b = a[1][2];
        if(0 !== b[0] && ! args[2]){
         var buf = b[1];
         return [3, Stdlib_Buffer[2].call(null, buf)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "get-output-string: expected output port"], 1);
     });
   var bV = [0, 0], bW = [0, 1];
   register
    ("port?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 33 === a[0]){if(args[2]) break a; return bW;}
       if(! args[2]) return bV;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "port?: expected 1 argument"], 1);
     });
   var bX = [0, 0], bY = [0, 1];
   register
    ("input-port?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 33 === a[0] && 0 === a[1][2][0]){if(args[2]) break a; return bY;}
       if(! args[2]) return bX;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "input-port?: expected 1 argument"], 1);
     });
   var bZ = [0, 0], b0 = [0, 1];
   register
    ("output-port?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 33 === a[0] && 0 !== a[1][2][0]){if(args[2]) break a; return b0;}
       if(! args[2]) return bZ;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "output-port?: expected 1 argument"], 1);
     });
   register
    ("close-port",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 33 === a[0] && ! args[2]){var p = a[1]; p[1] = 1; return 0;}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "close-port: expected port"], 1);
     });
   register
    ("read-char",
     function(args){
      if(! args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "read-char: no default port in this host"], 1);
      var
       a = args[1],
       cst_read_char_expected_input_p = "read-char: expected input port";
      if(typeof a !== "number" && 33 === a[0] && ! args[2]){
       var p = a[1], match = p[2];
       if(0 !== match[0])
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], cst_read_char_expected_input_p], 1);
       var pos = match[2], src = match[1];
       if(! p[1] && caml_ml_string_length(src) > pos[1]){
        var cp = caml_string_get(src, pos[1]);
        pos[1]++;
        return [32, cp];
       }
       return 1;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_read_char_expected_input_p], 1);
     });
   register
    ("peek-char",
     function(args){
      if(! args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "peek-char: no default port in this host"], 1);
      var
       a = args[1],
       cst_peek_char_expected_input_p = "peek-char: expected input port";
      if(typeof a !== "number" && 33 === a[0] && ! args[2]){
       var p = a[1], match = p[2];
       if(0 !== match[0])
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], cst_peek_char_expected_input_p], 1);
       var pos = match[2], src = match[1];
       if(! p[1] && caml_ml_string_length(src) > pos[1])
        return [32, caml_string_get(src, pos[1])];
       return 1;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_peek_char_expected_input_p], 1);
     });
   register
    ("read-line",
     function(args){
      if(! args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "read-line: no default port in this host"], 1);
      var
       a = args[1],
       cst_read_line_expected_input_p = "read-line: expected input port";
      if(typeof a !== "number" && 33 === a[0] && ! args[2]){
       var p = a[1], match = p[2];
       if(0 !== match[0])
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], cst_read_line_expected_input_p], 1);
       var pos = match[2], src = match[1];
       if(! p[1] && caml_ml_string_length(src) > pos[1]){
        var start = pos[1], len = caml_ml_string_length(src);
        for(;;){
         if(pos[1] < len && 10 !== caml_string_get(src, pos[1])){pos[1]++; continue;}
         var
          line = Stdlib_String[16].call(null, src, start, pos[1] - start | 0);
         if(pos[1] < len) pos[1]++;
         return [3, line];
        }
       }
       return 1;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_read_line_expected_input_p], 1);
     });
   register
    ("write-char",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 32 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 33 === c[0] && ! b[2]){
          var p = c[1], n = a[1], match = p[2];
          if(0 === match[0])
           throw caml_maybe_attach_backtrace
                  ([0, Sx_types[9], "write-char: expected output port"], 1);
          var buf = match[1];
          if(1 - p[1]){
           var d = Stdlib_Char[1].call(null, n & 255);
           Stdlib_Buffer[12].call(null, buf, d);
          }
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "write-char: expected char and output port"],
              1);
     });
   register
    ("write-string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 33 === c[0] && ! b[2]){
          var p = c[1], s = a[1], match = p[2];
          if(0 === match[0])
           throw caml_maybe_attach_backtrace
                  ([0, Sx_types[9], "write-string: expected output port"], 1);
          var buf = match[1];
          if(1 - p[1]) Stdlib_Buffer[16].call(null, buf, s);
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "write-string: expected string and output port"],
              1);
     });
   var b1 = [0, 0];
   register
    ("char-ready?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 33 === a[0]){
        var c = a[1];
        if(! c[1]){
         var b = c[2];
         if(0 === b[0]){
          if(args[2]) break a;
          var pos = b[2], src = b[1];
          return [0, pos[1] < caml_ml_string_length(src) ? 1 : 0];
         }
        }
        if(! args[2]) return b1;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "char-ready?: expected input port"], 1);
     });
   function read_postprocess(v){
    if(typeof v !== "number" && 6 === v[0]){
     var items = v[1];
     return items
             ? [6, Stdlib_List[20].call(null, read_postprocess, items)]
             : 0;
    }
    return v;
   }
   register
    ("read",
     function(args){
      if(! args) return 1;
      var a = args[1];
      if(typeof a !== "number" && 33 === a[0] && ! args[2]){
       var p = a[1], match = p[2];
       if(0 !== match[0])
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "read: expected input port"], 1);
       var pos = match[2], src = match[1], len = caml_ml_string_length(src);
       if(! p[1] && len > pos[1]){
        var
         sub = Stdlib_String[16].call(null, src, pos[1], len - pos[1] | 0),
         s = Sx_parser[1].call(null, sub);
        Sx_parser[5].call(null, s);
        if(Sx_parser[4].call(null, s)){pos[1] = len; return 1;}
        try{
         var form = read_postprocess(Sx_parser[14].call(null, s));
         pos[1] = pos[1] + s[3] | 0;
         return form;
        }
        catch(exn){pos[1] = len; return 1;}
       }
       return 1;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "read: expected optional input port"], 1);
     });
   register
    ("write",
     function(args){
      if(args){
       var match = args[2], v = args[1];
       if(! match) return [3, sx_write_val(v)];
       var a = match[1];
       if(typeof a !== "number" && 33 === a[0] && ! match[2]){
        var p = a[1], match$0 = p[2];
        if(0 === match$0[0])
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "write: expected output port"], 1);
        var buf = match$0[1];
        if(1 - p[1]){
         var b = sx_write_val(v);
         Stdlib_Buffer[16].call(null, buf, b);
        }
        return 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "write: expected val [port]"], 1);
     });
   register
    ("display",
     function(args){
      if(args){
       var match = args[2], v = args[1];
       if(! match) return [3, sx_display_val(v)];
       var a = match[1];
       if(typeof a !== "number" && 33 === a[0] && ! match[2]){
        var p = a[1], match$0 = p[2];
        if(0 === match$0[0])
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "display: expected output port"], 1);
        var buf = match$0[1];
        if(1 - p[1]){
         var b = sx_display_val(v);
         Stdlib_Buffer[16].call(null, buf, b);
        }
        return 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "display: expected val [port]"], 1);
     });
   register
    ("newline",
     function(args){
      if(! args) return 0;
      var a = args[1];
      if(typeof a !== "number" && 33 === a[0] && ! args[2]){
       var p = a[1], match = p[2];
       if(0 === match[0])
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "newline: expected output port"], 1);
       var buf = match[1];
       if(1 - p[1]) Stdlib_Buffer[12].call(null, buf, 10);
       return 0;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "newline: expected optional output port"], 1);
     });
   register
    ("write-to-string",
     function(args){
      if(args && ! args[2]){var v = args[1]; return [3, sx_write_val(v)];}
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "write-to-string: 1 arg"], 1);
     });
   register
    ("display-to-string",
     function(args){
      if(args && ! args[2]){var v = args[1]; return [3, sx_display_val(v)];}
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "display-to-string: 1 arg"], 1);
     });
   var
    cst_f = "%.*f",
    cst_6f = "%.6f",
    b2 = [0, [8, [0, 0, 0], 0, [0, 6], 0], cst_6f],
    b3 = [0, [8, [0, 0, 0], 0, 1, 0], cst_f],
    b4 = [0, [8, [0, 0, 0], 0, [0, 6], 0], cst_6f],
    b5 = [0, [8, [0, 0, 0], 0, 1, 0], cst_f];
   register
    ("format-decimal",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           var b = args[2];
           if(b){
            var d = b[1], n = a[1];
            if(typeof d !== "number" && 1 === d[0]){
             if(b[2]) break;
             var prec = d[1];
             return [3, caml_call2(Stdlib_Printf[4].call(null, b3), prec, n)];
            }
            if(! b[2])
             return [3, caml_call1(Stdlib_Printf[4].call(null, b2), n)];
           }
           break;
          case 2:
           var c = args[2];
           if(c){
            var e = c[1], n$0 = a[1];
            if(typeof e !== "number" && 1 === e[0]){
             if(c[2]) break;
             var prec$0 = e[1];
             return [3,
                     caml_call2(Stdlib_Printf[4].call(null, b5), prec$0, n$0)];
            }
            if(! c[2])
             return [3, caml_call1(Stdlib_Printf[4].call(null, b4), n$0)];
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "format-decimal: expected number precision"],
              1);
     });
   register("current-input-port", function(param){return 0;});
   register("current-output-port", function(param){return 0;});
   register("current-error-port", function(param){return 0;});
   function set_key(v){return Sx_types[117].call(null, v);}
   register
    ("make-set",
     function(args){
      var ht = Stdlib_Hashtbl[1].call(null, 0, 8);
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           if(! args[2]){
            var items = a[1];
            Stdlib_List[18].call
             (null,
              function(v){
               var a = set_key(v);
               return Stdlib_Hashtbl[11].call(null, ht, a, v);
              },
              items);
            break a;
           }
           break;
          case 21:
           if(! args[2]){
            var r = a[1];
            Stdlib_List[18].call
             (null,
              function(v){
               var a = set_key(v);
               return Stdlib_Hashtbl[11].call(null, ht, a, v);
              },
              r[1]);
            break a;
           }
           break;
        }
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "make-set: expected optional list"], 1);
      }
      return [35, ht];
     });
   var b6 = [0, 0], b7 = [0, 1];
   register
    ("set?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0]){if(args[2]) break a; return b7;}
       if(! args[2]) return b6;
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "set?: 1 arg"], 1);
     });
   register
    ("set-add!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var v = b[1], ht = a[1], c = set_key(v);
         Stdlib_Hashtbl[11].call(null, ht, c, v);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-add!: expected set val"], 1);
     });
   register
    ("set-member?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var v = b[1], ht = a[1], c = set_key(v);
         return [0, Stdlib_Hashtbl[9].call(null, ht, c)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-member?: expected set val"], 1);
     });
   register
    ("set-remove!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var v = b[1], ht = a[1], c = set_key(v);
         Stdlib_Hashtbl[10].call(null, ht, c);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-remove!: expected set val"], 1);
     });
   register
    ("set-size",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0] && ! args[2]){
        var ht = a[1];
        return [1, Stdlib_Hashtbl[15].call(null, ht)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-size: expected set"], 1);
     });
   register
    ("set->list",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0] && ! args[2]){
        var ht = a[1];
        return [6,
                Stdlib_Hashtbl[14].call
                 (null, function(param, v, acc){return [0, v, acc];}, ht, 0)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set->list: expected set"], 1);
     });
   register
    ("list->set",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a === "number"){
        if(0 === a && ! args[2])
         return [35, Stdlib_Hashtbl[1].call(null, 0, 0)];
       }
       else
        switch(a[0]){
          case 6:
           if(! args[2]){
            var
             items = a[1],
             b = Stdlib_List[1].call(null, items),
             ht = Stdlib_Hashtbl[1].call(null, 0, b);
            Stdlib_List[18].call
             (null,
              function(v){
               var a = set_key(v);
               return Stdlib_Hashtbl[11].call(null, ht, a, v);
              },
              items);
            return [35, ht];
           }
           break;
          case 21:
           if(! args[2]){
            var
             r = a[1],
             c = Stdlib_List[1].call(null, r[1]),
             ht$0 = Stdlib_Hashtbl[1].call(null, 0, c);
            Stdlib_List[18].call
             (null,
              function(v){
               var a = set_key(v);
               return Stdlib_Hashtbl[11].call(null, ht$0, a, v);
              },
              r[1]);
            return [35, ht$0];
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "list->set: expected list"], 1);
     });
   register
    ("set-union",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 35 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 35 === e[0] && ! d[2]){
          var b = e[1], a = c[1], ht = Stdlib_Hashtbl[4].call(null, a);
          Stdlib_Hashtbl[12].call
           (null,
            function(k, v){return Stdlib_Hashtbl[11].call(null, ht, k, v);},
            b);
          return [35, ht];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-union: expected 2 sets"], 1);
     });
   register
    ("set-intersection",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 35 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 35 === e[0] && ! d[2]){
          var b = e[1], a = c[1], ht = Stdlib_Hashtbl[1].call(null, 0, 8);
          Stdlib_Hashtbl[12].call
           (null,
            function(k, v){
             var a = Stdlib_Hashtbl[9].call(null, b, k);
             return a ? Stdlib_Hashtbl[11].call(null, ht, k, v) : a;
            },
            a);
          return [35, ht];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-intersection: expected 2 sets"], 1);
     });
   register
    ("set-difference",
     function(args){
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 35 === c[0]){
        var d = args[2];
        if(d){
         var e = d[1];
         if(typeof e !== "number" && 35 === e[0] && ! d[2]){
          var b = e[1], a = c[1], ht = Stdlib_Hashtbl[1].call(null, 0, 8);
          Stdlib_Hashtbl[12].call
           (null,
            function(k, v){
             var a = 1 - Stdlib_Hashtbl[9].call(null, b, k);
             return a ? Stdlib_Hashtbl[11].call(null, ht, k, v) : a;
            },
            a);
          return [35, ht];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-difference: expected 2 sets"], 1);
     });
   register
    ("set-for-each",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var fn = b[1], ht = a[1];
         Stdlib_Hashtbl[12].call
          (null,
           function(param, v){
            caml_call2(Sx_types[7][1], fn, [6, [0, v, 0]]);
            return 0;
           },
           ht);
         return 0;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-for-each: expected set fn"], 1);
     });
   register
    ("set-map",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 35 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var
          fn = b[1],
          ht = a[1],
          c = Stdlib_Hashtbl[15].call(null, ht),
          out = Stdlib_Hashtbl[1].call(null, 0, c);
         Stdlib_Hashtbl[12].call
          (null,
           function(param, v){
            var
             r = caml_call2(Sx_types[7][1], fn, [6, [0, v, 0]]),
             a = set_key(r);
            return Stdlib_Hashtbl[11].call(null, out, a, r);
           },
           ht);
         return [35, out];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "set-map: expected set fn"], 1);
     });
   register
    ("make-bytevector",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var match = args[2], n = a[1];
        if(! match) return [37, Stdlib_Bytes[1].call(null, n, 0)];
        var b = match[1];
        if(typeof b !== "number" && 1 === b[0] && ! match[2]){
         var fill = b[1], c = fill < 0, d = c || 255 < fill;
         if(d)
          throw caml_maybe_attach_backtrace
                 ([0, Sx_types[9], "make-bytevector: fill must be 0-255"], 1);
         var e = Stdlib_Char[1].call(null, fill);
         return [37, Stdlib_Bytes[1].call(null, n, e)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "make-bytevector: expected n [fill]"], 1);
     });
   var b8 = [0, 0], b9 = [0, 1];
   register
    ("bytevector?",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0]){if(args[2]) break a; return b9;}
       if(! args[2]) return b8;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bytevector?: 1 arg"], 1);
     });
   register
    ("bytevector-length",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0] && ! args[2]){var b = a[1]; return [1, caml_ml_bytes_length(b)];}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bytevector-length: expected bytevector"], 1);
     });
   var
    cst_out_of_range = " out of range",
    b_ =
      [0,
       [11,
        "bytevector-u8-ref: index ",
        [4, 0, 0, 0, [11, cst_out_of_range, 0]]],
       "bytevector-u8-ref: index %d out of range"];
   register
    ("bytevector-u8-ref",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0]){
        var c = args[2];
        if(c){
         var d = c[1];
         if(typeof d !== "number" && 1 === d[0] && ! c[2]){
          var
           i = d[1],
           b = a[1],
           e = i < 0,
           f = e || caml_ml_bytes_length(b) <= i;
          if(! f) return [1, caml_bytes_get(b, i)];
          var g = caml_call1(Stdlib_Printf[4].call(null, b_), i);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bytevector-u8-ref: expected bytevector index"],
              1);
     });
   var
    b$ =
      [0,
       [11,
        "bytevector-u8-set!: index ",
        [4, 0, 0, 0, [11, cst_out_of_range, 0]]],
       "bytevector-u8-set!: index %d out of range"];
   register
    ("bytevector-u8-set!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0]){
        var c = args[2];
        if(c){
         var d = c[1];
         if(typeof d !== "number" && 1 === d[0]){
          var e = c[2];
          if(e){
           var f = e[1];
           if(typeof f !== "number" && 1 === f[0] && ! e[2]){
            var
             byte = f[1],
             i = d[1],
             b = a[1],
             g = i < 0,
             h = g || caml_ml_bytes_length(b) <= i;
            if(h){
             var j = caml_call1(Stdlib_Printf[4].call(null, b$), i);
             throw caml_maybe_attach_backtrace([0, Sx_types[9], j], 1);
            }
            var k = byte < 0, l = k || 255 < byte;
            if(l)
             throw caml_maybe_attach_backtrace
                    ([0, Sx_types[9], "bytevector-u8-set!: byte must be 0-255"],
                     1);
            caml_bytes_set(b, i, Stdlib_Char[1].call(null, byte));
            return 0;
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "bytevector-u8-set!: expected bytevector index byte"],
              1);
     });
   register
    ("bytevector-copy",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0]){
        var match = args[2], b = a[1];
        if(! match) return [37, Stdlib_Bytes[4].call(null, b)];
        var c = match[1];
        if(typeof c !== "number" && 1 === c[0]){
         var match$0 = match[2], start = c[1];
         if(! match$0){
          var len = caml_ml_bytes_length(b) - start | 0;
          return [37, Stdlib_Bytes[7].call(null, b, start, len)];
         }
         var d = match$0[1];
         if(typeof d !== "number" && 1 === d[0] && ! match$0[2]){
          var stop = d[1];
          return [37, Stdlib_Bytes[7].call(null, b, start, stop - start | 0)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "bytevector-copy: expected bytevector [start [end]]"],
              1);
     });
   register
    ("bytevector-copy!",
     function(args){
      function do_copy(dst, at, src, start, stop){
       var len = stop - start | 0;
       Stdlib_Bytes[11].call(null, src, start, dst, at, len);
       return 0;
      }
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 1 === c[0]){
          var d = b[2];
          if(d){
           var e = d[1];
           if(typeof e !== "number" && 37 === e[0]){
            var match = d[2], src = e[1], at = c[1], dst = a[1];
            if(! match)
             return do_copy(dst, at, src, 0, caml_ml_bytes_length(src));
            var f = match[1];
            if(typeof f !== "number" && 1 === f[0]){
             var match$0 = match[2], start = f[1];
             if(! match$0)
              return do_copy(dst, at, src, start, caml_ml_bytes_length(src));
             var g = match$0[1];
             if(typeof g !== "number" && 1 === g[0] && ! match$0[2]){
              var stop = g[1];
              return do_copy(dst, at, src, start, stop);
             }
            }
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "bytevector-copy!: expected dst at src [start [end]]"],
              1);
     });
   register
    ("bytevector-append",
     function(args){
      var
       bufs =
         Stdlib_List[20].call
          (null,
           function(param){
            if(typeof param !== "number" && 37 === param[0]){var b = param[1]; return b;}
            throw caml_maybe_attach_backtrace
                   ([0, Sx_types[9], "bytevector-append: expected bytevectors"],
                    1);
           },
           args),
       total =
         Stdlib_List[26].call
          (null,
           function(acc, b){return acc + caml_ml_bytes_length(b) | 0;},
           0,
           bufs),
       result = caml_create_bytes(total),
       pos = [0, 0];
      Stdlib_List[18].call
       (null,
        function(b){
         var len = caml_ml_bytes_length(b);
         Stdlib_Bytes[11].call(null, b, 0, result, pos[1], len);
         pos[1] = pos[1] + len | 0;
         return 0;
        },
        bufs);
      return [37, result];
     });
   register
    ("utf8->string",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0]){
        var match = args[2], b = a[1];
        if(! match) return [3, Stdlib_Bytes[6].call(null, b)];
        var c = match[1];
        if(typeof c !== "number" && 1 === c[0]){
         var match$0 = match[2], start = c[1];
         if(! match$0)
          return [3,
                  Stdlib_Bytes[8].call
                   (null, b, start, caml_ml_bytes_length(b) - start | 0)];
         var d = match$0[1];
         if(typeof d !== "number" && 1 === d[0] && ! match$0[2]){
          var stop = d[1];
          return [3, Stdlib_Bytes[8].call(null, b, start, stop - start | 0)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "utf8->string: expected bytevector [start [end]]"],
              1);
     });
   register
    ("string->utf8",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var match = args[2], s = a[1];
        if(! match) return [37, Stdlib_Bytes[5].call(null, s)];
        var b = match[1];
        if(typeof b !== "number" && 1 === b[0]){
         var match$0 = match[2], start = b[1];
         if(! match$0){
          var
           len = caml_ml_string_length(s) - start | 0,
           e = Stdlib_String[16].call(null, s, start, len);
          return [37, Stdlib_Bytes[5].call(null, e)];
         }
         var c = match$0[1];
         if(typeof c !== "number" && 1 === c[0] && ! match$0[2]){
          var
           stop = c[1],
           d = Stdlib_String[16].call(null, s, start, stop - start | 0);
          return [37, Stdlib_Bytes[5].call(null, d)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "string->utf8: expected string [start [end]]"],
              1);
     });
   register
    ("bytevector->list",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 37 === a[0] && ! args[2]){
        var
         b = a[1],
         items =
           Stdlib_List[11].call
            (null,
             caml_ml_bytes_length(b),
             function(i){return [1, caml_bytes_get(b, i)];});
        return [6, items];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "bytevector->list: expected bytevector"], 1);
     });
   var
    ca =
      [0,
       [11,
        "list->bytevector: byte ",
        [4, 0, 0, 0, [11, cst_out_of_range, 0]]],
       "list->bytevector: byte %d out of range"];
   register
    ("list->bytevector",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var items = a[1]; break;
          case 21:
           var c = a[1][1]; if(args[2]) break a; var items = c; break;
          default: break a;
        }
        var
         bytes_list =
           Stdlib_List[20].call
            (null,
             function(v){
              if(typeof v !== "number" && 1 === v[0]){
               var n = v[1];
               if(0 <= n && 255 >= n) return Stdlib_Char[1].call(null, n);
               var c = caml_call1(Stdlib_Printf[4].call(null, ca), n);
               throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
              }
              var
               a = Sx_types[61].call(null, v),
               b =
                 Stdlib[28].call
                  (null, "list->bytevector: expected integer, got ", a);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
             },
             items),
         b = caml_create_bytes(Stdlib_List[1].call(null, bytes_list));
        Stdlib_List[19].call
         (null, function(i, c){return caml_bytes_set(b, i, c);}, bytes_list);
        return [37, b];
       }
       if(0 === a && ! args[2]) return [37, caml_create_bytes(0)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "list->bytevector: expected list"], 1);
     });
   register
    ("file-read",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var path = a[1];
        try{
         var
          ic = Stdlib[79].call(null, path),
          n = Stdlib[92].call(null, ic),
          s = caml_create_bytes(n);
         Stdlib[85].call(null, ic, s, 0, n);
         Stdlib[93].call(null, ic);
         var c = [3, Stdlib_Bytes[6].call(null, s)];
         return c;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
         var msg = exn[2], b = Stdlib[28].call(null, "file-read: ", msg);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-read: (path)"], 1);
     });
   var cst$2 = ".";
   register
    ("file-list-dir",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var path = a[1];
        try{
         var
          names = caml_sys_read_directory(path),
          c = Stdlib_Array[10].call(null, names),
          names$1 =
            Stdlib_List[44].call
             (null,
              function(n){
               var a = n !== cst$2 ? 1 : 0, b = a ? n !== ".." ? 1 : 0 : a;
               return b;
              },
              c),
          names$0 =
            Stdlib_List[59].call(null, runtime.caml_string_compare, names$1),
          d =
            [6,
             Stdlib_List[20].call(null, function(n){return [3, n];}, names$0)];
         return d;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
         var msg = exn[2], b = Stdlib[28].call(null, "file-list-dir: ", msg);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-list-dir: (path)"], 1);
     });
   register
    ("file-write",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var content = c[1], path = a[1];
          try{
           var oc = Stdlib[60].call(null, path);
           Stdlib[66].call(null, oc, content);
           Stdlib[76].call(null, oc);
           return 0;
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn[1] !== Stdlib[11])
            throw caml_maybe_attach_backtrace(exn, 0);
           var msg = exn[2], d = Stdlib[28].call(null, "file-write: ", msg);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-write: (path content)"], 1);
     });
   var cb = [0, 2, [0, 3, [0, 1, [0, 7, 0]]]];
   register
    ("file-append",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var content = c[1], path = a[1];
          try{
           var oc = Stdlib[62].call(null, cb, 420, path);
           Stdlib[66].call(null, oc, content);
           Stdlib[76].call(null, oc);
           return 0;
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn[1] !== Stdlib[11])
            throw caml_maybe_attach_backtrace(exn, 0);
           var msg = exn[2], d = Stdlib[28].call(null, "file-append: ", msg);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-append: (path content)"], 1);
     });
   register
    ("file-exists?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var path = a[1];
        return [0, caml_sys_file_exists(path)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-exists?: (path)"], 1);
     });
   register
    ("file-glob",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         pat = a[1],
         dir = Stdlib_Filename[14].call(null, pat),
         base_pat = Stdlib_Filename[13].call(null, pat),
         cst = cst$2,
         dir$0 =
           dir === cst$2
            ? 1
              < caml_ml_string_length(pat)
              ? 46 === caml_string_get(pat, 0) ? dir : cst
              : cst
            : dir;
        try{
         var
          entries = caml_sys_read_directory(dir$0),
          c =
            Stdlib_Array[18].call
             (null,
              function(acc, entry){
               var
                pn = caml_ml_string_length(base_pat),
                sn = caml_ml_string_length(entry);
               function go(pi$4, si$3){
                var pi = pi$4, si = si$3;
                for(;;){
                 if(pi === pn) return si === sn ? 1 : 0;
                 var c = caml_string_get(base_pat, pi);
                 if(42 === c){var i = si; break;}
                 if(63 === c){
                  var f = si < sn ? 1 : 0;
                  if(! f) return f;
                  var si$0 = si + 1 | 0, pi$0 = pi + 1 | 0;
                  pi = pi$0;
                  si = si$0;
                 }
                 else{
                  if(91 !== c){
                   var o = si < sn ? 1 : 0;
                   if(o){
                    var p = caml_string_get(entry, si) === c ? 1 : 0;
                    if(p){
                     var si$2 = si + 1 | 0, pi$3 = pi + 1 | 0;
                     pi = pi$3;
                     si = si$2;
                     continue;
                    }
                    var q = p;
                   }
                   else
                    var q = o;
                   return q;
                  }
                  var
                   pi$1 = pi + 1 | 0,
                   g = pi$1 < pn ? 1 : 0,
                   negate =
                     g ? 94 === caml_string_get(base_pat, pi$1) ? 1 : 0 : g;
                  if(negate)
                   var pi$5 = pi$1 + 1 | 0, pi$6 = pi$5;
                  else
                   var pi$6 = pi$1;
                  var matched = 0, pi$7 = pi$6;
                  for(;;){
                   if(pi$7 < pn && 93 !== caml_string_get(base_pat, pi$7)){
                    var
                     c1 = caml_string_get(base_pat, pi$7),
                     pi$8 = pi$7 + 1 | 0;
                    if
                     ((pi$8 + 1 | 0) < pn
                      && 45 === caml_string_get(base_pat, pi$8)){
                     var
                      c2 = caml_string_get(base_pat, pi$8 + 1 | 0),
                      pi$2 = pi$8 + 2 | 0,
                      k = si < sn;
                     if(k)
                      var
                       l = c1 <= caml_string_get(entry, si),
                       m = l ? caml_string_get(entry, si) <= c2 : l;
                     else
                      var m = k;
                     if(m){matched = 1; pi$7 = pi$2; continue;}
                     pi$7 = pi$2;
                     continue;
                    }
                    var
                     n = si < sn,
                     r = n ? caml_string_get(entry, si) === c1 : n;
                    if(r){matched = 1; pi$7 = pi$8; continue;}
                    pi$7 = pi$8;
                    continue;
                   }
                   if(pi$7 < pn)
                    var pi$9 = pi$7 + 1 | 0, pi$10 = pi$9;
                   else
                    var pi$10 = pi$7;
                   var h = matched ? 1 - negate : matched;
                   if(h)
                    var a = h;
                   else
                    var j = 1 - matched, a = j ? negate : j;
                   if(! a) return a;
                   var si$1 = si + 1 | 0;
                   pi = pi$10;
                   si = si$1;
                   break;
                  }
                 }
                }
                for(;;){
                 var b = i <= sn ? 1 : 0;
                 if(b){
                  var d = go(pi + 1 | 0, i);
                  if(! d){var i$0 = i + 1 | 0; i = i$0; continue;}
                  var e = d;
                 }
                 else
                  var e = b;
                 return e;
                }
               }
               if(! go(0, 0)) return acc;
               var
                full =
                  dir$0 === cst$2
                   ? entry
                   : Stdlib_Filename[4].call(null, dir$0, entry);
               return [0, full, acc];
              },
              0,
              entries),
          d = Stdlib_List[59].call(null, Stdlib_String[10], c),
          b = d;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(exn, 0);
         var b = 0;
        }
        return [6, Stdlib_List[20].call(null, function(s){return [3, s];}, b)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-glob: (pattern)"], 1);
     });
   function stat_or(param){
    if(typeof param !== "number" && 3 === param[0]){
     var path = param[1];
     try{var a = [0, Unix[42].call(null, path)]; return a;}
     catch(exn){return 0;}
    }
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "file: path must be a string"], 1);
   }
   var cc = [1, 0];
   register
    ("file-size",
     function(args){
      if(args && ! args[2]){
       var v = args[1], match = stat_or(v);
       if(! match) return cc;
       var s = match[1];
       return [1, s[9]];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-size: (path)"], 1);
     });
   var cd = [1, 0];
   register
    ("file-mtime",
     function(args){
      if(args && ! args[2]){
       var v = args[1], match = stat_or(v);
       if(! match) return cd;
       var s = match[1];
       return [1, s[11] | 0];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-mtime: (path)"], 1);
     });
   var ce = [0, 0];
   register
    ("file-isfile?",
     function(args){
      if(args && ! args[2]){
       var v = args[1], match = stat_or(v);
       if(! match) return ce;
       var s = match[1];
       return [0, 0 === s[3] ? 1 : 0];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-isfile?: (path)"], 1);
     });
   var cf = [0, 0];
   register
    ("file-isdir?",
     function(args){
      if(args && ! args[2]){
       var v = args[1], match = stat_or(v);
       if(! match) return cf;
       var s = match[1];
       return [0, 1 === s[3] ? 1 : 0];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-isdir?: (path)"], 1);
     });
   var cg = [0, 0, 0];
   register
    ("file-readable?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var path = a[1];
        try{Unix[57].call(null, path, cg); var b = 1;}catch(exn){var b = 0;}
        return [0, b];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-readable?: (path)"], 1);
     });
   var ch = [0, 1, 0];
   register
    ("file-writable?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var path = a[1];
        try{Unix[57].call(null, path, ch); var b = 1;}catch(exn){var b = 0;}
        return [0, b];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-writable?: (path)"], 1);
     });
   var cst_file = "file";
   register
    ("file-stat",
     function(args){
      if(args && ! args[2]){
       var v = args[1], match = stat_or(v);
       if(! match) return 0;
       var s = match[1], d = Stdlib_Hashtbl[1].call(null, 0, 6);
       Stdlib_Hashtbl[11].call(null, d, "size", [1, s[9]]);
       Stdlib_Hashtbl[11].call(null, d, "mtime", [1, s[11] | 0]);
       Stdlib_Hashtbl[11].call(null, d, "atime", [1, s[10] | 0]);
       Stdlib_Hashtbl[11].call(null, d, "ctime", [1, s[12] | 0]);
       Stdlib_Hashtbl[11].call(null, d, "mode", [1, s[4]]);
       switch(s[3]){
         case 0:
          var a = cst_file; break;
         case 1:
          var a = "directory"; break;
         case 2:
          var a = "characterSpecial"; break;
         case 3:
          var a = "blockSpecial"; break;
         case 4:
          var a = "link"; break;
         case 5:
          var a = "fifo"; break;
         default: var a = "socket";
       }
       Stdlib_Hashtbl[11].call(null, d, "type", [3, a]);
       return [7, d];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-stat: (path)"], 1);
     });
   register
    ("file-delete",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var path = a[1];
        a:
        try{
         if(runtime.caml_sys_is_directory(path))
          Unix[65].call(null, path);
         else
          Unix[48].call(null, path);
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
         var e = exn[2];
         if(typeof e === "number" && 20 === e) break a;
         var
          b = Unix[2].call(null, e),
          c = Stdlib[28].call(null, "file-delete: ", b);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
        }
        return 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-delete: (path)"], 1);
     });
   register
    ("file-mkdir",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         path = a[1],
         mk =
           function(p){
            if(p !== cst && p !== cst$2 && p !== cst$6){
             if(caml_sys_file_exists(p)) return;
             mk(Stdlib_Filename[14].call(null, p));
             try{Unix[64].call(null, p, 493); return;}
             catch(exn$0){
              var exn = caml_wrap_exception(exn$0);
              if(exn[1] === Unix[1]){
               var match = exn[2];
               if(typeof match === "number" && 8 === match) return;
              }
              throw caml_maybe_attach_backtrace(exn, 0);
             }
            }
           };
        try{mk(path);}
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
         var
          e = exn[2],
          b = Unix[2].call(null, e),
          c = Stdlib[28].call(null, "file-mkdir: ", b);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
        }
        return 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-mkdir: (path)"], 1);
     });
   register
    ("file-copy",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var dst = c[1], src = a[1];
          try{
           var
            ic = Stdlib[80].call(null, src),
            oc = Stdlib[61].call(null, dst),
            buf = caml_create_bytes(8192);
           for(;;){
            var
             n = Stdlib[84].call(null, ic, buf, 0, caml_ml_bytes_length(buf));
            if(0 >= n){
             Stdlib[93].call(null, ic);
             Stdlib[76].call(null, oc);
             return 0;
            }
            Stdlib[68].call(null, oc, buf, 0, n);
           }
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn[1] !== Stdlib[11])
            throw caml_maybe_attach_backtrace(exn, 0);
           var msg = exn[2], d = Stdlib[28].call(null, "file-copy: ", msg);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-copy: (src dst)"], 1);
     });
   register
    ("file-rename",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var dst = c[1], src = a[1];
          try{runtime.caml_sys_rename(src, dst);}
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn[1] !== Stdlib[11])
            throw caml_maybe_attach_backtrace(exn, 0);
           var msg = exn[2], d = Stdlib[28].call(null, "file-rename: ", msg);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
          }
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "file-rename: (src dst)"], 1);
     });
   var channel_table = Stdlib_Hashtbl[1].call(null, 0, 16);
   function chan_get(name){
    var match = Stdlib_Hashtbl[7].call(null, channel_table, name);
    if(match){var c = match[1]; return c;}
    var a = Stdlib[28].call(null, "channel: no such channel ", name);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
   }
   var
    channel_next_id = [0, 0],
    ci = [0, 2, [0, 5, [0, 6, 0]]],
    cj = [0, 1, [0, 5, [0, 6, 0]]],
    ck = [0, 2, 0],
    cl = [0, 0, 0],
    cm = [0, 2, [0, 5, [0, 4, 0]]],
    cn = [0, 1, [0, 5, [0, 4, 0]]],
    co = [0, [11, cst_file, [4, 0, 0, 0, 0]], "file%d"];
   register
    ("channel-open",
     function(args){
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 3 === b[0]){
        var c = args[2];
        if(c){
         var d = c[1];
         if(typeof d !== "number" && 3 === d[0] && ! c[2]){
          var mode = d[1], path = b[1];
          try{
           if(mode !== "a")
            if(mode !== "a+")
             if(mode !== "r")
              if(mode !== "r+")
               if(mode !== "w"){
                if(mode !== "w+"){
                 var
                  f =
                    Stdlib[28].call(null, "channel-open: invalid mode ", mode);
                 throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
                }
                var a = ci;
               }
               else
                var a = cj;
              else
               var a = ck;
             else
              var a = cl;
            else
             var a = cm;
           else
            var a = cn;
           var
            fd = Unix[24].call(null, path, a, 420),
            id = channel_next_id[1];
           channel_next_id[1]++;
           var name = caml_call1(Stdlib_Printf[4].call(null, co), id);
           Stdlib_Hashtbl[11].call
            (null, channel_table, name, [0, fd, mode, [0, 0], [0, 1]]);
           return [3, name];
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
           var
            e = exn[2],
            g = Unix[2].call(null, e),
            h = Stdlib[28].call(null, "channel-open: ", g);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-open: (path mode)"], 1);
     });
   register
    ("channel-close",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1], fd = chan_get(name)[1];
        try{Unix[25].call(null, fd);}catch(exn){}
        Stdlib_Hashtbl[10].call(null, channel_table, name);
        return 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-close: (channel)"], 1);
     });
   register
    ("channel-read",
     function(args){
      a:
      if(args){
       var b = args[1];
       if(typeof b !== "number" && 3 === b[0]){
        var match = args[2], name = b[1];
        if(match){
         var a = match[1];
         if(typeof a === "number") break a;
         switch(a[0]){
           case 1:
            if(match[2]) break a; var m = a[1], max_n = m; break;
           case 2:
            if(match[2]) break a; var m$0 = a[1], max_n = m$0 | 0; break;
           default: break a;
         }
        }
        else
         var max_n = -1;
        var
         match$0 = chan_get(name),
         eof = match$0[3],
         fd = match$0[1],
         buf = caml_create_bytes(8192),
         chunk = 8192,
         buffer = Stdlib_Buffer[1].call(null, chunk),
         total = [0, 0],
         stop = [0, 0];
        for(;;){
         if(stop[1]) return [3, Stdlib_Buffer[2].call(null, buffer)];
         var
          want =
            0 <= max_n
             ? Stdlib[16].call(null, chunk, max_n - total[1] | 0)
             : chunk;
         if(0 < want)
          try{
           var r = Unix[27].call(null, fd, buf, 0, want);
           if(0 === r){
            eof[1] = 1;
            stop[1] = 1;
           }
           else{
            Stdlib_Buffer[19].call(null, buffer, buf, 0, r);
            total[1] = total[1] + r | 0;
           }
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           b:
           if(exn[1] === Unix[1]){
            var c = exn[2];
            if(typeof c === "number"){
             if(2 !== c && 37 !== c) break b;
             stop[1] = 1;
             continue;
            }
           }
           throw caml_maybe_attach_backtrace(exn, 0);
          }
         else
          stop[1] = 1;
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-read: (channel ?n?)"], 1);
     });
   register
    ("channel-read-line",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var
         name = a[1],
         match = chan_get(name),
         eof = match[3],
         fd = match[1],
         buf = Stdlib_Buffer[1].call(null, 80),
         one = caml_create_bytes(1),
         got_data = [0, 0],
         stop = [0, 0];
        for(;;){
         if(stop[1])
          return got_data[1] ? [3, Stdlib_Buffer[2].call(null, buf)] : 0;
         try{
          var r = Unix[27].call(null, fd, one, 0, 1);
          if(0 === r){
           eof[1] = 1;
           stop[1] = 1;
          }
          else{
           got_data[1] = 1;
           var c = caml_bytes_get(one, 0);
           if(10 === c)
            stop[1] = 1;
           else
            Stdlib_Buffer[12].call(null, buf, c);
          }
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          a:
          if(exn[1] === Unix[1]){
           var b = exn[2];
           if(typeof b === "number"){
            if(2 !== b && 37 !== b) break a;
            stop[1] = 1;
            continue;
           }
          }
          throw caml_maybe_attach_backtrace(exn, 0);
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-read-line: (channel)"], 1);
     });
   register
    ("channel-write",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var c = args[2];
        if(c){
         var d = c[1];
         if(typeof d !== "number" && 3 === d[0] && ! c[2]){
          var
           s = d[1],
           name = a[1],
           fd = chan_get(name)[1],
           b = Stdlib_Bytes[5].call(null, s),
           n = caml_ml_bytes_length(b),
           written = [0, 0];
          for(;;){
           if(written[1] >= n) return 0;
           try{
            var
             w = Unix[29].call(null, fd, b, written[1], n - written[1] | 0);
            written[1] = written[1] + w | 0;
           }
           catch(exn$0){
            var exn = caml_wrap_exception(exn$0);
            a:
            if(exn[1] === Unix[1]){
             var e = exn[2];
             if(typeof e === "number"){
              if(2 !== e && 37 !== e) break a;
              written[1] = n;
              continue;
             }
            }
            throw caml_maybe_attach_backtrace(exn, 0);
           }
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-write: (channel string)"], 1);
     });
   register
    ("channel-flush",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var name = a[1]; chan_get(name); return 0;}
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-flush: (channel)"], 1);
     });
   register
    ("channel-seek",
     function(args){
      a:
      if(args){
       var c = args[1];
       if(typeof c !== "number" && 3 === c[0]){
        var a = args[2];
        if(a){
         var b = a[1], name = c[1];
         if(typeof b !== "number"){
          switch(b[0]){
            case 1:
             var match = a[2], o = b[1];
             if(match){
              var d = match[1];
              if(typeof d === "number") break a;
              if(3 !== d[0]) break a;
              if(match[2]) break a;
              var w = d[1], whence = w, offset = o;
             }
             else
              var whence = cst_start, offset = o;
             break;
            case 2:
             var match$1 = a[2], o$0 = b[1];
             if(match$1){
              var e = match$1[1];
              if(typeof e === "number") break a;
              if(3 !== e[0]) break a;
              if(match$1[2]) break a;
              var w$0 = e[1], whence = w$0, offset = o$0 | 0;
             }
             else
              var whence = cst_start, offset = o$0 | 0;
             break;
            default: break a;
          }
          var match$0 = chan_get(name), eof = match$0[3], fd = match$0[1];
          if(whence !== "current")
           if(whence !== cst_end){
            if(whence !== cst_start){
             var
              f =
                Stdlib[28].call(null, "channel-seek: invalid whence ", whence);
             throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
            }
            var cmd = 0;
           }
           else
            var cmd = 2;
          else
           var cmd = 1;
          Unix[39].call(null, fd, offset, cmd);
          eof[1] = 0;
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-seek: (channel offset ?whence?)"], 1);
     });
   register
    ("channel-tell",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1], fd = chan_get(name)[1];
        return [1, Unix[39].call(null, fd, 0, 1)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-tell: (channel)"], 1);
     });
   register
    ("channel-eof?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1], eof = chan_get(name)[3];
        return [0, eof[1]];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-eof?: (channel)"], 1);
     });
   register
    ("channel-blocking?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1], blocking = chan_get(name)[4];
        return [0, blocking[1]];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-blocking?: (channel)"], 1);
     });
   register
    ("channel-set-blocking!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var c = args[2];
        if(c){
         var d = c[1];
         if(typeof d !== "number" && 0 === d[0] && ! c[2]){
          var
           b = d[1],
           name = a[1],
           match = chan_get(name),
           blocking = match[4],
           fd = match[1];
          blocking[1] = b;
          try{if(b) Unix[61].call(null, fd); else Unix[60].call(null, fd);}
          catch(exn){}
          return 0;
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-set-blocking!: (channel bool)"], 1);
     });
   var cst_exec = "exec: ", cst_exec_empty_command = "exec: empty command";
   register
    ("exec-process",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var items = a[1]; break;
          case 21:
           var m = a[1][1]; if(args[2]) break a; var items = m; break;
          default: break a;
        }
        var
         c =
           Stdlib_List[20].call
            (null,
             function(v){
              if(typeof v !== "number" && 3 === v[0]){var s = v[1]; return s;}
              return Sx_types[117].call(null, v);
             },
             items),
         argv = Stdlib_Array[11].call(null, c);
        if(0 === argv.length - 1)
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], cst_exec_empty_command], 1);
        var
         match = Unix[73].call(null, 0, 0),
         out_w = match[2],
         out_r = match[1],
         match$0 = Unix[73].call(null, 0, 0),
         err_w = match$0[2],
         err_r = match$0[1];
        try{
         var
          g = Unix[21],
          h = caml_check_bound(argv, 0)[1],
          pid = Unix[75].call(null, h, argv, g, out_w, err_w);
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
         var e = exn[2];
         Unix[25].call(null, out_r);
         Unix[25].call(null, out_w);
         Unix[25].call(null, err_r);
         Unix[25].call(null, err_w);
         var
          d = Unix[2].call(null, e),
          f = Stdlib[28].call(null, cst_exec, d);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
        }
        Unix[25].call(null, out_w);
        Unix[25].call(null, err_w);
        var
         buf = Stdlib_Buffer[1].call(null, 256),
         errbuf = Stdlib_Buffer[1].call(null, 64),
         chunk = caml_create_bytes(4096),
         read_all =
           function(fd, target){
            try{
             var stop = 0;
             for(;;){
              if(stop) return;
              var
               n =
                 Unix[27].call
                  (null, fd, chunk, 0, caml_ml_bytes_length(chunk));
              if(0 === n)
               stop = 1;
              else
               Stdlib_Buffer[19].call(null, target, chunk, 0, n);
             }
            }
            catch(exn){return;}
           };
        read_all(out_r, buf);
        read_all(err_r, errbuf);
        Unix[25].call(null, out_r);
        Unix[25].call(null, err_r);
        var status = Unix[15].call(null, 0, pid)[2];
        if(0 === status[0])
         var n = status[1], exit_code = n;
        else
         var exit_code = 1;
        var
         s = Stdlib_Buffer[2].call(null, buf),
         trimmed =
           0 < caml_ml_string_length(s)
            ? 10
              === caml_string_get(s, caml_ml_string_length(s) - 1 | 0)
              ? Stdlib_String
                 [16].call
                (null, s, 0, caml_ml_string_length(s) - 1 | 0)
              : s
            : s;
        if(0 === exit_code) return [3, trimmed];
        if(0 < Stdlib_Buffer[7].call(null, errbuf))
         var
          i = Stdlib_Buffer[2].call(null, errbuf),
          b = Stdlib[28].call(null, cst$0, i);
        else
         var b = cst;
        var
         j = Stdlib[33].call(null, exit_code),
         k = Stdlib[28].call(null, j, b),
         l = Stdlib[28].call(null, "exec: child exited ", k);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], l], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "exec-process: (cmd-list)"], 1);
     });
   var cp = [0, 0, 0], cq = [0, 4, 0], cr = [0, 6, 0];
   register
    ("exec-pipeline",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           if(args[2]) break a; var items = a[1]; break;
          case 21:
           var k = a[1][1]; if(args[2]) break a; var items = k; break;
          default: break a;
        }
        var
         words =
           Stdlib_List[20].call
            (null,
             function(v){
              if(typeof v !== "number" && 3 === v[0]){var s = v[1]; return s;}
              return Sx_types[117].call(null, v);
             },
             items);
        if(0 === words)
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], cst_exec_empty_command], 1);
        var
         extract_redirs =
           function(ws){
            var
             cleaned = 0,
             merge_err = 0,
             err_path = 0,
             out_append = 0,
             out_path = 0,
             in_path = 0,
             param = ws;
            for(;;){
             if(! param)
              return [0,
                      Stdlib_List[10].call(null, cleaned),
                      in_path,
                      out_path,
                      out_append,
                      err_path,
                      merge_err];
             var w = param[1];
             if(w !== "2>"){
              if(w === "2>@1"){
               var rest$3 = param[2];
               merge_err = 1;
               param = rest$3;
               continue;
              }
              if(w !== cst$7)
               if(w !== cst$8){
                if(w === ">>"){
                 var match = param[2];
                 if(match){
                  var rest$0 = match[2], p = match[1];
                  out_append = 1;
                  out_path = [0, p];
                  param = rest$0;
                  continue;
                 }
                }
               }
               else{
                var match$0 = param[2];
                if(match$0){
                 var rest$1 = match$0[2], p$0 = match$0[1];
                 out_append = 0;
                 out_path = [0, p$0];
                 param = rest$1;
                 continue;
                }
               }
              else{
               var match$1 = param[2];
               if(match$1){
                var rest$2 = match$1[2], p$1 = match$1[1];
                in_path = [0, p$1];
                param = rest$2;
                continue;
               }
              }
             }
             else{
              var match$2 = param[2];
              if(match$2){
               var rest$4 = match$2[2], p$2 = match$2[1];
               err_path = [0, p$2];
               param = rest$4;
               continue;
              }
             }
             var rest = param[2];
             cleaned = [0, w, cleaned];
             param = rest;
            }
           },
         acc = 0,
         cur = 0,
         param = words;
        for(;;){
         if(! param) break;
         var w = param[1];
         if(w !== "|"){
          var rest = param[2], cur$0 = [0, w, cur];
          cur = cur$0;
          param = rest;
         }
         else{
          var
           rest$0 = param[2],
           acc$0 = [0, Stdlib_List[10].call(null, cur), acc];
          acc = acc$0;
          cur = 0;
          param = rest$0;
         }
        }
        var
         c = [0, Stdlib_List[10].call(null, cur), acc],
         d = Stdlib_List[10].call(null, c),
         stages = Stdlib_List[20].call(null, extract_redirs, d);
        if(0 === stages)
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "exec: no stages"], 1);
        var
         n = Stdlib_List[1].call(null, stages),
         f = Stdlib[17].call(null, 0, n - 1 | 0),
         pipes =
           Stdlib_Array[1].call
            (null, f, function(param){return Unix[73].call(null, 0, 0);}),
         match = Unix[73].call(null, 0, 0),
         final_w = match[2],
         final_r = match[1],
         match$0 = Unix[73].call(null, 0, 0),
         errstash_w = match$0[2],
         errstash_r = match$0[1],
         close_safe =
           function(fd){
            try{var a = Unix[25].call(null, fd); return a;}
            catch(exn){return 0;}
           },
         open_out_redir =
           function(path, append){
            var a = append ? cq : cr;
            try{
             var g = Unix[24].call(null, path, [0, 1, [0, 5, a]], 420);
             return g;
            }
            catch(exn$0){
             var exn = caml_wrap_exception(exn$0);
             if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
             var
              e = exn[2],
              b = Unix[2].call(null, e),
              c = Stdlib[28].call(null, cst$0, b),
              d = Stdlib[28].call(null, path, c),
              f = Stdlib[28].call(null, "exec: open >", d);
             throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
            }
           },
         stages_arr = Stdlib_Array[11].call(null, stages),
         pids = [0, 0];
        try{
         Stdlib_Array[13].call
          (null,
           function(i, param){
            var
             merge = param[6],
             ep = param[5],
             app = param[4],
             op = param[3],
             ip = param[2],
             cleaned = param[1];
            if(0 === cleaned)
             throw caml_maybe_attach_backtrace
                    ([0, Sx_types[9], "exec: empty stage in pipeline"], 1);
            var argv = Stdlib_Array[11].call(null, cleaned);
            if(0 === i)
             if(ip){
              var path = ip[1];
              try{var m = Unix[24].call(null, path, cp, 420), stdin_fd = m;}
              catch(exn$0){
               var exn = caml_wrap_exception(exn$0);
               if(exn[1] !== Unix[1])
                throw caml_maybe_attach_backtrace(exn, 0);
               var
                e = exn[2],
                h = Unix[2].call(null, e),
                j = Stdlib[28].call(null, cst$0, h),
                k = Stdlib[28].call(null, path, j),
                l = Stdlib[28].call(null, "exec: open <", k);
               throw caml_maybe_attach_backtrace([0, Sx_types[9], l], 1);
              }
             }
             else
              var stdin_fd = Unix[21];
            else
             var
              g = i - 1 | 0,
              stdin_fd = caml_check_bound(pipes, g)[g + 1][1];
            if(i === (n - 1 | 0))
             if(op)
              var path$0 = op[1], stdout_fd = open_out_redir(path$0, app);
             else
              var stdout_fd = final_w;
            else
             var stdout_fd = caml_check_bound(pipes, i)[i + 1][2];
            if(merge)
             var stderr_fd = stdout_fd;
            else if(ep)
             var path$1 = ep[1], stderr_fd = open_out_redir(path$1, 0);
            else
             var stderr_fd = i === (n - 1 | 0) ? errstash_w : Unix[23];
            try{
             var
              t = caml_check_bound(argv, 0)[1],
              pid =
                Unix[75].call(null, t, argv, stdin_fd, stdout_fd, stderr_fd);
            }
            catch(exn){
             var exn$0 = caml_wrap_exception(exn);
             if(exn$0[1] !== Unix[1])
              throw caml_maybe_attach_backtrace(exn$0, 0);
             var
              e$0 = exn$0[2],
              o = Unix[2].call(null, e$0),
              p = Stdlib[28].call(null, cst$0, o),
              q = caml_check_bound(argv, 0)[1],
              r = Stdlib[28].call(null, q, p),
              s = Stdlib[28].call(null, cst_exec, r);
             throw caml_maybe_attach_backtrace([0, Sx_types[9], s], 1);
            }
            pids[1] = [0, pid, pids[1]];
            if(0 < i){
             var a = i - 1 | 0;
             close_safe(caml_check_bound(pipes, a)[a + 1][1]);
            }
            if(i < (n - 1 | 0))
             close_safe(caml_check_bound(pipes, i)[i + 1][2]);
            var b = 0 === i, u = b ? 0 !== ip : b;
            if(u) close_safe(stdin_fd);
            var c = i === (n - 1 | 0), v = c ? 0 !== op : c;
            if(v) close_safe(stdout_fd);
            var d = 1 - merge, f = d ? 0 !== ep ? 1 : 0 : d;
            return f ? close_safe(stderr_fd) : f;
           },
           stages_arr);
        }
        catch(e$0){
         var e = caml_wrap_exception(e$0);
         close_safe(final_r);
         close_safe(final_w);
         close_safe(errstash_r);
         close_safe(errstash_w);
         Stdlib_Array[12].call
          (null,
           function(param){
            var b = param[2], a = param[1];
            close_safe(a);
            return close_safe(b);
           },
           pipes);
         throw caml_maybe_attach_backtrace(e, 0);
        }
        close_safe(final_w);
        close_safe(errstash_w);
        var
         buf = Stdlib_Buffer[1].call(null, 256),
         errbuf = Stdlib_Buffer[1].call(null, 64),
         chunk = caml_create_bytes(4096),
         read_all =
           function(fd, target){
            try{
             var stop = 0;
             for(;;){
              if(stop) return;
              var
               r =
                 Unix[27].call
                  (null, fd, chunk, 0, caml_ml_bytes_length(chunk));
              if(0 === r)
               stop = 1;
              else
               Stdlib_Buffer[19].call(null, target, chunk, 0, r);
             }
            }
            catch(exn){return;}
           };
        read_all(final_r, buf);
        read_all(errstash_r, errbuf);
        close_safe(final_r);
        close_safe(errstash_r);
        var
         exit_codes =
           Stdlib_List[22].call
            (null,
             function(pid){
              var st = Unix[15].call(null, 0, pid)[2];
              if(0 !== st[0]) return 1;
              var c = st[1];
              return c;
             },
             pids[1]),
         match$1 = Stdlib_List[10].call(null, exit_codes);
        if(match$1)
         var last = match$1[1], final_code = last;
        else
         var final_code = 0;
        var
         s = Stdlib_Buffer[2].call(null, buf),
         trimmed =
           0 < caml_ml_string_length(s)
            ? 10
              === caml_string_get(s, caml_ml_string_length(s) - 1 | 0)
              ? Stdlib_String
                 [16].call
                (null, s, 0, caml_ml_string_length(s) - 1 | 0)
              : s
            : s;
        if(0 === final_code) return [3, trimmed];
        if(0 < Stdlib_Buffer[7].call(null, errbuf))
         var
          g = Stdlib_Buffer[2].call(null, errbuf),
          b = Stdlib[28].call(null, cst$0, g);
        else
         var b = cst;
        var
         h = Stdlib[33].call(null, final_code),
         i = Stdlib[28].call(null, h, b),
         j = Stdlib[28].call(null, "exec: pipeline last stage exited ", i);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], j], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "exec-pipeline: (word-list)"], 1);
     });
   function resolve_inet_addr(host){
    if(host !== cst && host !== "0.0.0.0"){
     if(host === "localhost") return Unix[132];
     try{var d = Unix[129].call(null, host); return d;}
     catch(exn$0){
      var cst_socket_cannot_resolve = "socket: cannot resolve ";
      try{
       var entry = Unix[165].call(null, host);
       if(0 === entry[4].length - 1){
        var b = Stdlib[28].call(null, cst_socket_cannot_resolve, host);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
       }
       var c = caml_check_bound(entry[4], 0)[1];
       return c;
      }
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
       var a = Stdlib[28].call(null, cst_socket_cannot_resolve, host);
       throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
      }
     }
    }
    return Unix[131];
   }
   function port_of(v){
    if(typeof v !== "number")
     switch(v[0]){
       case 1:
        var n = v[1]; return n;
       case 2:
        var n$0 = v[1]; return n$0 | 0;
     }
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "socket: port must be a number"], 1);
   }
   var cs = [0, [11, "sock", [4, 0, 0, 0, 0]], "sock%d"];
   function alloc_chan_name(param){
    var id = channel_next_id[1];
    channel_next_id[1]++;
    return caml_call1(Stdlib_Printf[4].call(null, cs), id);
   }
   var cst_rw = "rw";
   register
    ("socket-connect",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var
          port_v = b[1],
          host = a[1],
          port = port_of(port_v),
          addr = [1, resolve_inet_addr(host), port],
          sock = Unix[136].call(null, 0, 1, 0, 0);
         try{Unix[141].call(null, sock, addr);}
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
          var e = exn[2];
          try{Unix[25].call(null, sock);}catch(exn){}
          var
           c = Unix[2].call(null, e),
           d = Stdlib[28].call(null, "socket-connect: ", c);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
         }
         var name = alloc_chan_name(0);
         Stdlib_Hashtbl[11].call
          (null, channel_table, name, [0, sock, cst_rw, [0, 0], [0, 1]]);
         return [3, name];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "socket-connect: (host port)"], 1);
     });
   register
    ("socket-connect-async",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b && ! b[2]){
         var
          port_v = b[1],
          host = a[1],
          port = port_of(port_v),
          addr = [1, resolve_inet_addr(host), port],
          sock = Unix[136].call(null, 0, 1, 0, 0);
         Unix[60].call(null, sock);
         a:
         try{Unix[141].call(null, sock, addr);}
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
          var e = exn[2];
          if(typeof e === "number" && 1 >= e - 37 >>> 0) break a;
          try{Unix[25].call(null, sock);}catch(exn){}
          var
           c = Unix[2].call(null, e),
           d = Stdlib[28].call(null, "socket-connect-async: ", c);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
         }
         var name = alloc_chan_name(0);
         Stdlib_Hashtbl[11].call
          (null, channel_table, name, [0, sock, cst_rw, [0, 0], [0, 0]]);
         return [3, name];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "socket-connect-async: (host port)"], 1);
     });
   var ct = [3, cst];
   register
    ("channel-async-error",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1], fd = chan_get(name)[1];
        try{
         var err = Unix[160].call(null, fd);
         if(err)
          var e$0 = err[1], b = [3, Unix[2].call(null, e$0)];
         else
          var b = ct;
         return b;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
         var e = exn[2];
         return [3, Unix[2].call(null, e)];
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "channel-async-error: (channel)"], 1);
     });
   register
    ("socket-server",
     function(args){
      a:
      if(args){
       var port_v = args[1];
       if(args[2]){
        if(typeof port_v === "number") break a;
        if(3 !== port_v[0]) break a;
        var a = args[2];
        if(a[2]) break a;
        var
         port_v$0 = a[1],
         h = port_v[1],
         port = port_of(port_v$0),
         host = h;
       }
       else
        var port = port_of(port_v), host = cst;
       var
        addr = [1, resolve_inet_addr(host), port],
        sock = Unix[136].call(null, 0, 1, 0, 0);
       Unix[153].call(null, sock, 2, 1);
       try{Unix[140].call(null, sock, addr);}
       catch(exn$0){
        var exn = caml_wrap_exception(exn$0);
        if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
        var e = exn[2];
        try{Unix[25].call(null, sock);}catch(exn){}
        var
         b = Unix[2].call(null, e),
         c = Stdlib[28].call(null, "socket-server: bind: ", b);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
       }
       Unix[142].call(null, sock, 8);
       var name = alloc_chan_name(0);
       Stdlib_Hashtbl[11].call
        (null, channel_table, name, [0, sock, "server", [0, 0], [0, 1]]);
       return [3, name];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "socket-server: (port) or (host port)"], 1);
     });
   register
    ("socket-accept",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var name = a[1], sock = chan_get(name)[1];
        try{var match = Unix[139].call(null, 0, sock);}
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Unix[1]) throw caml_maybe_attach_backtrace(exn, 0);
         var
          e = exn[2],
          b = Unix[2].call(null, e),
          c = Stdlib[28].call(null, "socket-accept: ", b);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
        }
        var client_addr = match[2], client_sock = match[1];
        if(0 === client_addr[0])
         var path = client_addr[1], port = 0, host_str = path;
        else
         var
          port$0 = client_addr[2],
          addr = client_addr[1],
          host_str$0 = Unix[130].call(null, addr),
          port = port$0,
          host_str = host_str$0;
        var client_name = alloc_chan_name(0);
        Stdlib_Hashtbl[11].call
         (null,
          channel_table,
          client_name,
          [0, client_sock, cst_rw, [0, 0], [0, 1]]);
        var d = Stdlib_Hashtbl[1].call(null, 0, 3);
        Stdlib_Hashtbl[11].call(null, d, "channel", [3, client_name]);
        Stdlib_Hashtbl[11].call(null, d, "host", [3, host_str]);
        Stdlib_Hashtbl[11].call(null, d, "port", [1, port]);
        return [7, d];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "socket-accept: (server-channel)"], 1);
     });
   register
    ("io-select-channels",
     function(args){
      function to_list(v){
       a:
       {
        if(typeof v !== "number"){
         switch(v[0]){
           case 6:
            var xs = v[1]; break;
           case 21:
            var xs = v[1][1]; break;
           default: break a;
         }
         return xs;
        }
        if(0 === v) return 0;
       }
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "io-select-channels: expected list"], 1);
      }
      function chan_name_of(v){
       if(typeof v !== "number" && 3 === v[0]){var s = v[1]; return s;}
       throw caml_maybe_attach_backtrace
              ([0,
                Sx_types[9],
                "io-select-channels: channel must be a string"],
               1);
      }
      if(args){
       var a = args[2];
       if(a){
        var b = a[2];
        if(b && ! b[2]){
         var t = b[1], w = a[1], r = args[1];
         a:
         if(typeof t !== "number"){
          switch(t[0]){
            case 1:
             var n = t[1], timeout_ms = n; break;
            case 2:
             var n$0 = t[1], timeout_ms = n$0 | 0; break;
            default: break a;
          }
          var
           write_list = to_list(w),
           read_list = to_list(r),
           read_pairs =
             Stdlib_List[20].call
              (null,
               function(v){
                var name = chan_name_of(v), fd = chan_get(name)[1];
                return [0, name, fd];
               },
               read_list),
           write_pairs =
             Stdlib_List[20].call
              (null,
               function(v){
                var name = chan_name_of(v), fd = chan_get(name)[1];
                return [0, name, fd];
               },
               write_list),
           read_fds =
             Stdlib_List[20].call(null, function(a){return a[2];}, read_pairs),
           write_fds =
             Stdlib_List[20].call
              (null, function(a){return a[2];}, write_pairs),
           timeout = 0 <= timeout_ms ? timeout_ms / 1000. : -1.;
          b:
          try{
           var
            c = Unix[96].call(null, read_fds, write_fds, 0, timeout),
            g = c[2],
            h = c[1],
            ready_w = g,
            ready_r = h;
          }
          catch(exn$0){
           var exn = caml_wrap_exception(exn$0);
           if(exn[1] === Unix[1]){
            var match = exn[2];
            if(typeof match === "number" && 11 === match){var ready_w = 0, ready_r = 0; break b;}
           }
           throw caml_maybe_attach_backtrace(exn, 0);
          }
          var
           names_of =
             function(pairs, ready){
              return Stdlib_List[23].call
                      (null,
                       function(param){
                        var fd = param[2], n = param[1];
                        return Stdlib_List[34].call
                                 (null, function(rfd){return caml_equal(rfd, fd);}, ready)
                                ? [0, [3, n]]
                                : 0;
                       },
                       pairs);
             },
           d = Stdlib_Hashtbl[1].call(null, 0, 2),
           e = [6, names_of(read_pairs, ready_r)];
          Stdlib_Hashtbl[11].call(null, d, "readable", e);
          var f = [6, names_of(write_pairs, ready_w)];
          Stdlib_Hashtbl[11].call(null, d, "writable", f);
          return [7, d];
         }
         throw caml_maybe_attach_backtrace
                ([0,
                  Sx_types[9],
                  "io-select-channels: timeout must be a number"],
                 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "io-select-channels: (read-list write-list timeout-ms)"],
              1);
     });
   register
    ("clock-seconds",
     function(args){
      if(args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "clock-seconds: no args"], 1);
      return [1, Unix[104].call(null, 0) | 0];
     });
   register
    ("clock-milliseconds",
     function(args){
      if(args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "clock-milliseconds: no args"], 1);
      return [1, Unix[104].call(null, 0) * 1000. | 0];
     });
   var
    cst_02d = "%02d",
    cst_May = "May",
    cst_local = "local",
    cst_utc = "utc",
    cu =
      [0,
       "Sunday",
       "Monday",
       "Tuesday",
       "Wednesday",
       "Thursday",
       "Friday",
       "Saturday"],
    cv =
      [0,
       "January",
       "February",
       "March",
       "April",
       cst_May,
       "June",
       "July",
       "August",
       "September",
       "October",
       "November",
       "December"],
    cw = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d],
    cx = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d],
    cy = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d],
    cz = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d],
    cA = [0, [4, 0, [0, 2, 4], 0, 0], "%04d"],
    cB = [0, "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    cC =
      [0,
       "Jan",
       "Feb",
       "Mar",
       "Apr",
       cst_May,
       "Jun",
       "Jul",
       "Aug",
       "Sep",
       "Oct",
       "Nov",
       "Dec"],
    cD = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d],
    cE = [0, [4, 0, [0, 1, 2], 0, 0], "%2d"],
    cF = [0, [4, 0, [0, 2, 3], 0, 0], "%03d"],
    cG = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d],
    cH = [0, [4, 0, [0, 2, 2], 0, 0], cst_02d];
   register
    ("clock-format",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var match = args[2], t = a[1];
        if(match){
         var b = match[1];
         if(typeof b === "number") break a;
         if(3 !== b[0]) break a;
         var match$0 = match[2], f = b[1];
         if(match$0){
          var c = match$0[1];
          if(typeof c === "number") break a;
          if(3 !== c[0]) break a;
          if(match$0[2]) break a;
          var z = c[1], tz = z, fmt = f;
         }
         else
          var tz = cst_utc, fmt = f;
        }
        else
         var tz = cst_utc, fmt = "%a %b %e %H:%M:%S %Z %Y";
        var
         tm =
           tz === cst_local
            ? Unix[106].call(null, t)
            : Unix[105].call(null, t),
         tz_label = tz === cst_local ? cst : "UTC";
        return [3,
                function(fmt){
                  var
                   buf = Stdlib_Buffer[1].call(null, 32),
                   n = caml_ml_string_length(fmt),
                   i = 0;
                  for(;;){
                   if(i >= n) return Stdlib_Buffer[2].call(null, buf);
                   if(37 === caml_string_get(fmt, i) && (i + 1 | 0) < n){
                    var
                     c = caml_string_get(fmt, i + 1 | 0),
                     switcher = c - 37 | 0;
                    a:
                    {
                     if(84 >= switcher >>> 0)
                      switch(switcher){
                        case 0:
                         Stdlib_Buffer[12].call(null, buf, 37); break a;
                        case 28:
                         var
                          days = caml_obj_dup(cu),
                          a = tm[7],
                          f = caml_check_bound(days, a)[a + 1];
                         Stdlib_Buffer[16].call(null, buf, f);
                         break a;
                        case 29:
                         var
                          mons = caml_obj_dup(cv),
                          b = tm[5],
                          g = caml_check_bound(mons, b)[b + 1];
                         Stdlib_Buffer[16].call(null, buf, g);
                         break a;
                        case 35:
                         var
                          j = tm[3],
                          k = caml_call1(Stdlib_Printf[4].call(null, cw), j);
                         Stdlib_Buffer[16].call(null, buf, k);
                         break a;
                        case 36:
                         var
                          h = tm[3] % 12 | 0,
                          l = 0 === h ? 12 : h,
                          m = caml_call1(Stdlib_Printf[4].call(null, cx), l);
                         Stdlib_Buffer[16].call(null, buf, m);
                         break a;
                        case 40:
                         var
                          o = tm[2],
                          p = caml_call1(Stdlib_Printf[4].call(null, cy), o);
                         Stdlib_Buffer[16].call(null, buf, p);
                         break a;
                        case 46:
                         var
                          q = tm[1],
                          r = caml_call1(Stdlib_Printf[4].call(null, cz), q);
                         Stdlib_Buffer[16].call(null, buf, r);
                         break a;
                        case 52:
                         var
                          s = 1900 + tm[6] | 0,
                          t = caml_call1(Stdlib_Printf[4].call(null, cA), s);
                         Stdlib_Buffer[16].call(null, buf, t);
                         break a;
                        case 53:
                         Stdlib_Buffer[16].call(null, buf, tz_label); break a;
                        case 60:
                         var
                          days$0 = caml_obj_dup(cB),
                          d = tm[7],
                          u = caml_check_bound(days$0, d)[d + 1];
                         Stdlib_Buffer[16].call(null, buf, u);
                         break a;
                        case 63:
                         var
                          w = tm[4],
                          x = caml_call1(Stdlib_Printf[4].call(null, cD), w);
                         Stdlib_Buffer[16].call(null, buf, x);
                         break a;
                        case 64:
                         var
                          y = tm[4],
                          z = caml_call1(Stdlib_Printf[4].call(null, cE), y);
                         Stdlib_Buffer[16].call(null, buf, z);
                         break a;
                        case 69:
                         var
                          A = tm[8] + 1 | 0,
                          B = caml_call1(Stdlib_Printf[4].call(null, cF), A);
                         Stdlib_Buffer[16].call(null, buf, B);
                         break a;
                        case 72:
                         var
                          C = tm[5] + 1 | 0,
                          D = caml_call1(Stdlib_Printf[4].call(null, cG), C);
                         Stdlib_Buffer[16].call(null, buf, D);
                         break a;
                        case 75:
                         var E = 12 <= tm[3] ? "PM" : "AM";
                         Stdlib_Buffer[16].call(null, buf, E);
                         break a;
                        case 82:
                         var F = Stdlib[33].call(null, tm[7]);
                         Stdlib_Buffer[16].call(null, buf, F);
                         break a;
                        case 84:
                         var
                          G = (1900 + tm[6] | 0) % 100 | 0,
                          H = caml_call1(Stdlib_Printf[4].call(null, cH), G);
                         Stdlib_Buffer[16].call(null, buf, H);
                         break a;
                        case 61:
                        case 67:
                         var
                          mons$0 = caml_obj_dup(cC),
                          e = tm[5],
                          v = caml_check_bound(mons$0, e)[e + 1];
                         Stdlib_Buffer[16].call(null, buf, v);
                         break a;
                      }
                     Stdlib_Buffer[12].call(null, buf, 37);
                     Stdlib_Buffer[12].call(null, buf, c);
                    }
                    i = i + 2 | 0;
                    continue;
                   }
                   var I = caml_string_get(fmt, i);
                   Stdlib_Buffer[12].call(null, buf, I);
                   var i$0 = i + 1 | 0;
                   i = i$0;
                  }
                 }
                 (fmt)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "clock-format: (seconds [format [tz]])"], 1);
     });
   var
    cI = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
    cJ = [0, 0, 0, 0, 1, 0, 70, 0, 0, 0];
   register
    ("clock-scan",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0]){
          var match = b[2], fmt = c[1], str = a[1];
          if(match){
           var d = match[1];
           if(typeof d === "number") break a;
           if(3 !== d[0]) break a;
           if(match[2]) break a;
           var z = d[1], tz = z;
          }
          else
           var tz = cst_utc;
          var
           n = caml_ml_string_length(fmt),
           sn = caml_ml_string_length(str),
           j = [0, 0],
           read_n_digits =
             function(k){
              var cnt = 0, s = cst;
              for(;;){
               if
                (cnt < k
                 &&
                  j[1] < sn
                  &&
                   48 <= caml_string_get(str, j[1])
                   && 57 >= caml_string_get(str, j[1])){
                var
                 a = caml_string_get(str, j[1]),
                 b = Stdlib_String[1].call(null, 1, a),
                 c = Stdlib[28].call(null, s, b);
                j[1]++;
                var cnt$0 = cnt + 1 | 0;
                cnt = cnt$0;
                s = c;
                continue;
               }
               return s === cst ? 0 : caml_int_of_string(s);
              }
             },
           skip_ws =
             function(param){
              for(;;){
               a:
               if(j[1] < sn){
                if
                 (32 !== caml_string_get(str, j[1])
                  && 9 !== caml_string_get(str, j[1]))
                 break a;
                j[1]++;
                continue;
               }
               return;
              }
             },
           i = 0,
           tm = cJ;
          for(;;){
           if(i >= n) break;
           if(37 === caml_string_get(fmt, i) && (i + 1 | 0) < n){
            var match$0 = caml_string_get(fmt, i + 1 | 0);
            if(100 <= match$0)
             if(109 === match$0)
              var
               w = tm[9],
               x = tm[8],
               A = tm[7],
               B = tm[6],
               C = read_n_digits(2) - 1 | 0,
               tm$0 = [0, tm[1], tm[2], tm[3], tm[4], C, B, A, x, w];
             else if(121 === match$0)
              var
               y$1 = read_n_digits(2),
               D = tm[9],
               E = tm[8],
               F = tm[7],
               y$2 = 70 <= y$1 ? y$1 : 100 + y$1 | 0,
               tm$0 = [0, tm[1], tm[2], tm[3], tm[4], tm[5], y$2, F, E, D];
             else if(102 <= match$0)
              var tm$0 = tm;
             else{
              skip_ws(0);
              var
               G = tm[9],
               H = tm[8],
               I = tm[7],
               J = tm[6],
               K = tm[5],
               L = read_n_digits(2),
               tm$0 = [0, tm[1], tm[2], tm[3], L, K, J, I, H, G];
             }
            else if(72 <= match$0)
             if(90 <= match$0)
              var tm$0 = tm;
             else
              switch(match$0 - 72 | 0){
                case 5:
                 var
                  T = tm[9],
                  U = tm[8],
                  V = tm[7],
                  W = tm[6],
                  X = tm[5],
                  Y = tm[4],
                  Z = tm[3],
                  _ = read_n_digits(2),
                  tm$0 = [0, tm[1], _, Z, Y, X, W, V, U, T];
                 break;
                case 11:
                 var
                  $ = tm[9],
                  aa = tm[8],
                  ab = tm[7],
                  ac = tm[6],
                  ad = tm[5],
                  ae = tm[4],
                  af = tm[3],
                  ag = tm[2],
                  tm$0 = [0, read_n_digits(2), ag, af, ae, ad, ac, ab, aa, $];
                 break;
                case 17:
                 var
                  ah = tm[9],
                  ai = tm[8],
                  aj = tm[7],
                  ak = read_n_digits(4) - 1900 | 0,
                  tm$0 =
                    [0, tm[1], tm[2], tm[3], tm[4], tm[5], ak, aj, ai, ah];
                 break;
                case 0:
                case 1:
                 var
                  M = tm[9],
                  N = tm[8],
                  O = tm[7],
                  P = tm[6],
                  Q = tm[5],
                  R = tm[4],
                  S = read_n_digits(2),
                  tm$0 = [0, tm[1], tm[2], S, R, Q, P, O, N, M];
                 break;
                default: var tm$0 = tm;
              }
            else if(37 === match$0)
             var
              l = j[1] < sn,
              al = l ? 37 === caml_string_get(str, j[1]) : l,
              tm$0 = al ? (j[1]++, tm) : tm;
            else
             var tm$0 = tm;
            i = i + 2 | 0;
            tm = tm$0;
            continue;
           }
           if(32 === caml_string_get(fmt, i))
            skip_ws(0);
           else{
            var o = j[1] < sn;
            if(o)
             var
              am = caml_string_get(fmt, i),
              p = caml_string_get(str, j[1]) === am;
            else
             var p = o;
            if(p) j[1]++;
           }
           var i$0 = i + 1 | 0;
           i = i$0;
          }
          if(tz === cst_local)
           var secs = Unix[107].call(null, tm)[1] | 0;
          else{
           var
            is_leap =
              function(y){
               var a = 0 === (y % 4 | 0) ? 1 : 0;
               if(a)
                var
                 c = 0 !== (y % 100 | 0) ? 1 : 0,
                 b = c || (0 === (y % 400 | 0) ? 1 : 0);
               else
                var b = a;
               return b;
              },
            days_in_month = caml_obj_dup(cI),
            year = tm[6] + 1900 | 0,
            mon = tm[5],
            mday = tm[4],
            total_days = 0;
           if(1970 <= year){
            var e = year - 1 | 0;
            if(e < 1970)
             var total_days$3 = total_days;
            else{
             var total_days$1 = total_days, y = 1970;
             for(;;){
              var
               s = is_leap(y) ? 366 : 365,
               h = total_days$1 + s | 0,
               t = y + 1 | 0;
              if(e === y){var total_days$3 = h; break;}
              total_days$1 = h;
              y = t;
             }
            }
           }
           else if(1969 < year)
            var total_days$3 = total_days;
           else{
            var total_days$2 = total_days, y$0 = year;
            for(;;){
             var
              u = is_leap(y$0) ? 366 : 365,
              k = total_days$2 - u | 0,
              v = y$0 + 1 | 0;
             if(1969 === y$0){var total_days$3 = k; break;}
             total_days$2 = k;
             y$0 = v;
            }
           }
           var f = mon - 1 | 0;
           if(f < 0)
            var total_days$7 = total_days$3;
           else{
            var total_days$4 = total_days$3, m = 0;
            for(;;){
             var
              total_days$0 =
                total_days$4 + caml_check_bound(days_in_month, m)[m + 1] | 0,
              g = 1 === m,
              q = g ? is_leap(year) : g;
             if(q)
              var
               total_days$5 = total_days$0 + 1 | 0,
               total_days$6 = total_days$5;
             else
              var total_days$6 = total_days$0;
             var r = m + 1 | 0;
             if(f === m){var total_days$7 = total_days$6; break;}
             total_days$4 = total_days$6;
             m = r;
            }
           }
           var
            secs =
              (((((total_days$7 + mday | 0) - 1 | 0) * 86400 | 0)
              + (tm[3] * 3600 | 0)
              | 0)
              + (tm[2] * 60 | 0)
              | 0)
              + tm[1]
              | 0;
          }
          return [1, secs];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "clock-scan: (str fmt [tz])"], 1);
     });
   register
    ("env-lookup",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var key = a[1], env_val = args[1];
        a:
        {
         if(typeof env_val === "number"){
          if(0 === env_val){var e$0 = Sx_types[20].call(null, 0); break a;}
         }
         else if(20 === env_val[0]){var e = env_val[1], e$0 = e; break a;}
         throw caml_maybe_attach_backtrace
                ([0,
                  Sx_types[9],
                  "env-lookup: first arg must be an environment"],
                 1);
        }
        var k = Sx_types[35].call(null, key);
        return Sx_types[28].call(null, e$0, k)
                ? Sx_types[30].call(null, e$0, k)
                : 0;
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "env-lookup: (env key)"], 1);
     });
   register
    ("env-extend",
     function(args){
      if(! args)
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], "env-extend: requires at least one arg"], 1);
      var pairs = args[2], env_val = args[1];
      a:
      {
       if(typeof env_val === "number"){
        if(0 === env_val){
         var parent_env = Sx_types[20].call(null, 0);
         break a;
        }
       }
       else if(20 === env_val[0]){
        var e = env_val[1], parent_env = e;
        break a;
       }
       throw caml_maybe_attach_backtrace
              ([0,
                Sx_types[9],
                "env-extend: first arg must be an environment"],
               1);
      }
      var child = Sx_types[21].call(null, parent_env), param = pairs;
      for(;;){
       if(! param) return [20, child];
       var match = param[2], k = param[1];
       if(! match)
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "env-extend: odd number of key-val pairs"],
                1);
       var rest = match[2], v = match[1], a = Sx_types[35].call(null, k);
       Sx_types[26].call(null, child, a, v);
       param = rest;
      }
     });
   register
    ("jit-stats",
     function(args){
      var d = Stdlib_Hashtbl[1].call(null, 0, 8);
      Stdlib_Hashtbl[11].call(null, d, "threshold", [2, Sx_types[43][1]]);
      Stdlib_Hashtbl[11].call(null, d, "budget", [2, Sx_types[51][1]]);
      var a = [2, Sx_types[54].call(null, 0)];
      Stdlib_Hashtbl[11].call(null, d, "cache-size", a);
      Stdlib_Hashtbl[11].call(null, d, "compiled", [2, Sx_types[44][1]]);
      Stdlib_Hashtbl[11].call(null, d, "compile-failed", [2, Sx_types[45][1]]);
      Stdlib_Hashtbl[11].call
       (null, d, "below-threshold", [2, Sx_types[46][1]]);
      Stdlib_Hashtbl[11].call(null, d, "evicted", [2, Sx_types[52][1]]);
      return [7, d];
     });
   register
    ("jit-set-threshold!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(! args[2]){var n = a[1]; Sx_types[43][1] = n; return 0;} break;
          case 2:
           if(! args[2]){var n$0 = a[1]; Sx_types[43][1] = n$0 | 0; return 0;}
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "jit-set-threshold!: (n) where n is integer"],
              1);
     });
   register
    ("jit-set-budget!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 1:
           if(! args[2]){var n = a[1]; Sx_types[51][1] = n; return 0;} break;
          case 2:
           if(! args[2]){var n$0 = a[1]; Sx_types[51][1] = n$0 | 0; return 0;}
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "jit-set-budget!: (n) where n is integer"], 1);
     });
   register
    ("jit-reset-cache!",
     function(args){
      Stdlib_Queue[15].call
       (null,
        function(param){
         var v = param[2];
         if(typeof v !== "number" && 8 === v[0]){var l = v[1]; l[5] = 0; return 0;}
         return 0;
        },
        Sx_types[53]);
      Stdlib_Queue[11].call(null, Sx_types[53]);
      return 0;
     });
   register
    ("jit-exclude!",
     function(args){
      Stdlib_List[18].call
       (null,
        function(a){
         if(typeof a !== "number" && a[0] - 3 >>> 0 < 2){
          var n = a[1], len = caml_ml_string_length(n);
          if(0 < len && 42 === caml_string_get(n, len - 1 | 0)){
           var
            prefix = Stdlib_String[16].call(null, n, 0, len - 1 | 0),
            b = 1 - Stdlib_List[37].call(null, prefix, Sx_types[48][1]),
            c = b ? (Sx_types[48][1] = [0, prefix, Sx_types[48][1]], 0) : b;
           return c;
          }
          return Stdlib_Hashtbl[11].call(null, Sx_types[47], n, 0);
         }
         return 0;
        },
        args);
      return 0;
     });
   var cK = [0, 0];
   register
    ("jit-excluded?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && a[0] - 3 >>> 0 < 2 && ! args[2]){var n = a[1]; return [0, Sx_types[49].call(null, n)];}
      }
      return cK;
     });
   register
    ("jit-exclude-callers-of!",
     function(args){
      Stdlib_List[18].call
       (null,
        function(a){
         if(typeof a !== "number" && a[0] - 3 >>> 0 < 2){
          var n = a[1];
          return Stdlib_Hashtbl[11].call(null, Sx_types[50], n, 0);
         }
         return 0;
        },
        args);
      return 0;
     });
   register
    ("jit-reset-counters!",
     function(args){
      Sx_types[44][1] = 0;
      Sx_types[45][1] = 0;
      Sx_types[46][1] = 0;
      Sx_types[52][1] = 0;
      return 0;
     });
   register
    ("crypto-sha256",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [3, Sx_sha2[3].call(null, s)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "crypto-sha256: (bytes)"], 1);
     });
   register
    ("crypto-sha512",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var s = a[1];
        return [3, Sx_sha2[11].call(null, s)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "crypto-sha512: (bytes)"], 1);
     });
   register
    ("crypto-sha3-256",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [3, Sx_sha3[8].call(null, s)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "crypto-sha3-256: (bytes)"], 1);
     });
   register
    ("cbor-encode",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       try{var a = [3, Sx_cbor[5].call(null, v)]; return a;}
       catch(exn$0){
        var exn = caml_wrap_exception(exn$0);
        if(exn[1] !== Sx_cbor[1]) throw caml_maybe_attach_backtrace(exn, 0);
        var m = exn[2];
        throw caml_maybe_attach_backtrace([0, Sx_types[9], m], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "cbor-encode: (value)"], 1);
     });
   register
    ("cbor-decode",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var s = a[1];
        try{var b = Sx_cbor[6].call(null, s); return b;}
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Sx_cbor[1]) throw caml_maybe_attach_backtrace(exn, 0);
         var m = exn[2];
         throw caml_maybe_attach_backtrace([0, Sx_types[9], m], 1);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "cbor-decode: (bytes)"], 1);
     });
   register
    ("cid-from-bytes",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 1 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0] && ! b[2]){
          var mh = c[1], codec = a[1];
          return [3, Sx_cid[6].call(null, codec, mh)];
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "cid-from-bytes: (codec multihash-bytes)"], 1);
     });
   register
    ("cid-from-sx",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       try{var a = [3, Sx_cid[9].call(null, v)]; return a;}
       catch(exn$0){
        var exn = caml_wrap_exception(exn$0);
        if(exn[1] !== Sx_cbor[1]) throw caml_maybe_attach_backtrace(exn, 0);
        var m = exn[2];
        throw caml_maybe_attach_backtrace([0, Sx_types[9], m], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "cid-from-sx: (value)"], 1);
     });
   var cL = [0, 0];
   register
    ("ed25519-verify",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0]){
          var d = b[2];
          if(d){
           var e = d[1];
           if(typeof e !== "number" && 3 === e[0] && ! d[2]){
            var sg = e[1], msg = c[1], pk = a[1];
            try{var g = Sx_ed25519[38].call(null, pk, msg, sg), f = g;}
            catch(exn){var f = 0;}
            return [0, f];
           }
          }
         }
        }
       }
      }
      return cL;
     });
   var cM = [0, 0];
   register
    ("rsa-sha256-verify",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0]){
        var b = args[2];
        if(b){
         var c = b[1];
         if(typeof c !== "number" && 3 === c[0]){
          var d = b[2];
          if(d){
           var e = d[1];
           if(typeof e !== "number" && 3 === e[0] && ! d[2]){
            var sg = e[1], msg = c[1], spki = a[1];
            try{var g = Sx_rsa[23].call(null, spki, msg, sg), f = g;}
            catch(exn){var f = 0;}
            return [0, f];
           }
          }
         }
        }
       }
      }
      return cM;
     });
   runtime.caml_register_global
    (1364,
     [0,
      primitives,
      sx_call_fn,
      sx_trampoline_fn,
      is_client,
      scope_stacks,
      scope_trace,
      scope_log,
      scope_trace_enable,
      scope_trace_disable,
      scope_trace_drain,
      request_cookies,
      scope_clear_all,
      register,
      is_primitive,
      get_primitive,
      trampoline_hook,
      as_int,
      all_ints,
      as_number,
      as_string,
      as_list,
      as_bool,
      to_string,
      gensym_counter,
      rat_gcd,
      make_rat,
      rat_of_val,
      has_rational,
      has_float,
      rat_add,
      rat_sub,
      rat_mul,
      rat_div,
      sx_write_val,
      sx_display_val],
     "Sx_primitives");
   return;
  }
  (globalThis));

//# 17871 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_runtime:[F(2),F(2),F(1),F(1),F(1),F(1),F(2),F(2),F(2),F(1),F(2),F(3),F(2),F(1),F(1),F(1),F(1),F(2),F(2),F(2),F(1),F(1),F(2),F(2),F(1),F(2),F(1),F(1),F(1),F(2),F(2),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(3),F(3),F(2),F(2),F(1),F(1),F(3),F(2),F(2),F(1),F(1),F(2),F(1),F(1),F(1),F(2),F(2),F(3),F(1),F(1),F(2),F(1),F(2),F(1)*,F(1)*,F(1),F(2),F(2),F(3),F(3),F(1),F(1),F(2),F(2),F(1)*,F(1)*,F(1)*,F(1)*,F(1)*,F(1)*,F(1),F(1)*,F(1),F(1),F(2),F(1)*,F(2),F(1),F(1)*,F(2),F(1),F(1)*,F(1),F(1),F(4),F(2),F(1),F(1),F(2),F(2),F(1),N,F(2),N,N,F(1)*,F(1),F(2),F(2),F(2),F(1)*,F(2)*,F(1)*,F(1)*,F(2),F(4),F(2),F(2),F(2),F(2)*,F(1)*,N,N,N,N,F(1),N,F(1),F(1),F(2)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_mul = runtime.caml_mul,
    caml_string_compare = runtime.caml_string_compare,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_List = global_data.Stdlib__List,
    Stdlib = global_data.Stdlib,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib_String = global_data.Stdlib__String,
    Sx_types = global_data.Sx_types,
    Sx_primitives = global_data.Sx_primitives,
    Stdlib_Array = global_data.Stdlib__Array;
   function fast_eq(a, b){
    if(a === b) return 1;
    a:
    if(typeof a === "number"){
     if(0 === a && typeof b === "number" && ! b) return 1;
    }
    else{
     switch(a[0]){
       case 0:
        if(typeof b === "number") break a;
        if(0 !== b[0]) break a;
        var y = b[1], x = a[1];
        return x === y ? 1 : 0;
       case 1:
        var x$0 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var y$0 = b[1]; return x$0 === y$0 ? 1 : 0;
          case 2:
           var y$1 = b[1]; return x$0 === y$1 ? 1 : 0;
          case 34:
           var d = b[2], n = b[1]; return caml_mul(x$0, d) === n ? 1 : 0;
          default: break a;
        }
       case 2:
        var x$1 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var y$2 = b[1]; return x$1 === y$2 ? 1 : 0;
          case 2:
           var y$3 = b[1]; return x$1 === y$3 ? 1 : 0;
          case 34:
           var d$0 = b[2], n$0 = b[1]; return x$1 === n$0 / d$0 ? 1 : 0;
          default: break a;
        }
       case 3:
        if(typeof b === "number") break a;
        if(3 !== b[0]) break a;
        var y$4 = b[1], x$2 = a[1];
        return x$2 === y$4 ? 1 : 0;
       case 4:
        if(typeof b === "number") break a;
        if(4 !== b[0]) break a;
        var y$5 = b[1], x$3 = a[1];
        return x$3 === y$5 ? 1 : 0;
       case 5:
        if(typeof b === "number") break a;
        if(5 !== b[0]) break a;
        var y$6 = b[1], x$4 = a[1];
        return x$4 === y$6 ? 1 : 0;
       case 6:
        var la = a[1]; break;
       case 21:
        var la = a[1][1]; break;
       case 34:
        var ad = a[2], an = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var y$7 = b[1]; return an === caml_mul(y$7, ad) ? 1 : 0;
          case 2:
           var y$8 = b[1]; return an / ad === y$8 ? 1 : 0;
          case 34:
           var bd = b[2], bn = b[1];
           return caml_mul(an, bd) === caml_mul(bn, ad) ? 1 : 0;
          default: break a;
        }
       default: break a;
     }
     if(typeof b !== "number"){
      switch(b[0]){
        case 6:
         var lb = b[1]; break;
        case 21:
         var lb = b[1][1]; break;
        default: break a;
      }
      try{var c = Stdlib_List[35].call(null, fast_eq, la, lb); return c;}
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn[1] === Stdlib[6]) return 0;
       throw caml_maybe_attach_backtrace(exn, 0);
      }
     }
    }
    return 0;
   }
   var
    cst_empty = "empty?",
    cst_first = "first",
    cst_len = "len",
    cst_rest = "rest",
    a = [6, 0],
    b = [6, 0],
    c = [6, 0],
    e = [1, 0],
    f = [0, 1],
    g = [0, 0],
    h = [0, 1],
    i = [0, 0],
    j = [0, 1];
   function prim_call(name, args){
    if(name !== "<"){
     if(name !== "<="){
      if(name !== "="){
       if(name !== ">"){
        if(name !== ">="){
         if(name !== cst_empty){
          if(name !== cst_first){
           if(name !== cst_len){
            if(name === cst_rest && args){
             var k = args[1];
             if(typeof k === "number"){
              if(0 === k && ! args[2]) return a;
             }
             else
              switch(k[0]){
                case 6:
                 var N = k[1];
                 if(N){
                  if(! args[2]){var xs = N[2]; return [6, xs];}
                 }
                 else if(! args[2]) return b;
                 break;
                case 21:
                 var O = k[1][1];
                 if(O){
                  if(! args[2]){var xs$0 = O[2]; return [6, xs$0];}
                 }
                 else if(! args[2]) return c;
                 break;
              }
            }
           }
           else if(args){
            var d = args[1];
            if(typeof d === "number"){
             if(0 === d && ! args[2]) return e;
            }
            else
             switch(d[0]){
               case 3:
                if(! args[2]){
                 var s = d[1];
                 return [1, caml_ml_string_length(s)];
                }
                break;
               case 6:
                if(! args[2]){
                 var l = d[1];
                 return [1, Stdlib_List[1].call(null, l)];
                }
                break;
               case 21:
                if(! args[2]){
                 var r = d[1];
                 return [1, Stdlib_List[1].call(null, r[1])];
                }
                break;
             }
           }
          }
          else if(args){
           var m = args[1];
           if(typeof m === "number"){
            if(0 === m && ! args[2]) return 0;
           }
           else
            switch(m[0]){
              case 6:
               var P = m[1];
               if(P){
                if(! args[2]){var x = P[1]; return x;}
               }
               else if(! args[2]) return 0;
               break;
              case 21:
               var Q = m[1][1];
               if(Q){
                if(! args[2]){var x$0 = Q[1]; return x$0;}
               }
               else if(! args[2]) return 0;
               break;
            }
          }
         }
         else if(args){
          var n = args[1];
          if(typeof n === "number"){
           if(0 === n && ! args[2]) return f;
          }
          else
           switch(n[0]){
             case 6:
              if(n[1]){if(! args[2]) return g;} else if(! args[2]) return h;
              break;
             case 21:
              if(n[1][1]){
               if(! args[2]) return i;
              }
              else if(! args[2]) return j;
              break;
           }
         }
        }
        else if(args){
         var o = args[1];
         if(typeof o !== "number")
          switch(o[0]){
            case 1:
             var p = args[2];
             if(p){
              var q = p[1], x$1 = o[1];
              if(typeof q !== "number")
               switch(q[0]){
                 case 1:
                  if(! p[2]){var y = q[1]; return [0, y <= x$1 ? 1 : 0];}
                  break;
                 case 2:
                  if(! p[2]){var y$0 = q[1]; return [0, y$0 <= x$1 ? 1 : 0];}
                  break;
               }
             }
             break;
            case 2:
             var t = args[2];
             if(t){
              var u = t[1], x$2 = o[1];
              if(typeof u !== "number")
               switch(u[0]){
                 case 1:
                  if(! t[2]){var y$1 = u[1]; return [0, y$1 <= x$2 ? 1 : 0];}
                  break;
                 case 2:
                  if(! t[2]){var y$2 = u[1]; return [0, y$2 <= x$2 ? 1 : 0];}
                  break;
               }
             }
             break;
          }
        }
       }
       else if(args){
        var v = args[1];
        if(typeof v !== "number")
         switch(v[0]){
           case 1:
            var w = args[2];
            if(w){
             var z = w[1], x$3 = v[1];
             if(typeof z !== "number")
              switch(z[0]){
                case 1:
                 if(! w[2]){var y$3 = z[1]; return [0, y$3 < x$3 ? 1 : 0];}
                 break;
                case 2:
                 if(! w[2]){var y$4 = z[1]; return [0, y$4 < x$3 ? 1 : 0];}
                 break;
              }
            }
            break;
           case 2:
            var A = args[2];
            if(A){
             var B = A[1], x$4 = v[1];
             if(typeof B !== "number")
              switch(B[0]){
                case 1:
                 if(! A[2]){var y$5 = B[1]; return [0, y$5 < x$4 ? 1 : 0];}
                 break;
                case 2:
                 if(! A[2]){var y$6 = B[1]; return [0, y$6 < x$4 ? 1 : 0];}
                 break;
              }
            }
            break;
         }
       }
      }
      else if(args){
       var M = args[2];
       if(M && ! M[2]){
        var b$0 = M[1], a$0 = args[1];
        return [0, fast_eq(a$0, b$0)];
       }
      }
     }
     else if(args){
      var C = args[1];
      if(typeof C !== "number")
       switch(C[0]){
         case 1:
          var D = args[2];
          if(D){
           var E = D[1], x$5 = C[1];
           if(typeof E !== "number")
            switch(E[0]){
              case 1:
               if(! D[2]){var y$7 = E[1]; return [0, x$5 <= y$7 ? 1 : 0];}
               break;
              case 2:
               if(! D[2]){var y$8 = E[1]; return [0, x$5 <= y$8 ? 1 : 0];}
               break;
            }
          }
          break;
         case 2:
          var F = args[2];
          if(F){
           var G = F[1], x$6 = C[1];
           if(typeof G !== "number")
            switch(G[0]){
              case 1:
               if(! F[2]){var y$9 = G[1]; return [0, x$6 <= y$9 ? 1 : 0];}
               break;
              case 2:
               if(! F[2]){var y$10 = G[1]; return [0, x$6 <= y$10 ? 1 : 0];}
               break;
            }
          }
          break;
       }
     }
    }
    else if(args){
     var H = args[1];
     if(typeof H !== "number")
      switch(H[0]){
        case 1:
         var I = args[2];
         if(I){
          var J = I[1], x$7 = H[1];
          if(typeof J !== "number")
           switch(J[0]){
             case 1:
              if(! I[2]){var y$11 = J[1]; return [0, x$7 < y$11 ? 1 : 0];}
              break;
             case 2:
              if(! I[2]){var y$12 = J[1]; return [0, x$7 < y$12 ? 1 : 0];}
              break;
           }
         }
         break;
        case 2:
         var K = args[2];
         if(K){
          var L = K[1], x$8 = H[1];
          if(typeof L !== "number")
           switch(L[0]){
             case 1:
              if(! K[2]){var y$13 = L[1]; return [0, x$8 < y$13 ? 1 : 0];}
              break;
             case 2:
              if(! K[2]){var y$14 = L[1]; return [0, x$8 < y$14 ? 1 : 0];}
              break;
           }
         }
         break;
      }
    }
    var match = Stdlib_Hashtbl[7].call(null, Sx_primitives[1], name);
    if(match){var f$0 = match[1]; return caml_call1(f$0, args);}
    var R = Stdlib[28].call(null, "Unknown primitive: ", name);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], R], 1);
   }
   var cst = "";
   function value_to_str(v){
    if(typeof v === "number"){if(0 === v) return cst;}
    else
     switch(v[0]){
       case 0:
        return v[1] ? "true" : "false";
       case 2:
        var n = v[1]; return Sx_types[34].call(null, n);
       case 3:
       case 4:
       case 5:
        var s = v[1]; return s;
     }
    return Sx_types[117].call(null, v);
   }
   function sx_to_string(v){return [3, value_to_str(v)];}
   function sx_str(args){
    var a = Stdlib_List[20].call(null, value_to_str, args);
    return Stdlib_String[7].call(null, cst, a);
   }
   function sx_to_list(v){
    if(typeof v === "number"){if(0 === v) return 0;}
    else
     switch(v[0]){
       case 6:
        var l = v[1]; return l;
       case 21:
        var r = v[1]; return r[1];
     }
    var
     a = Sx_types[61].call(null, v),
     b = Stdlib[28].call(null, "Expected list, got ", a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   function sx_call(f, args){
    if(typeof f !== "number")
     switch(f[0]){
       case 8:
        return caml_call2(Sx_types[8][1], f, args);
       case 13:
        var k = f[1];
        if(args) var x = args[1], x$0 = x; else var x$0 = 0;
        return caml_call1(k, x$0);
       case 14:
        throw caml_maybe_attach_backtrace
               ([0,
                 Sx_types[9],
                 "callcc continuations must be invoked through the CEK machine"],
                1);
       case 15:
        var fn = f[2]; return caml_call1(fn, args);
       case 24:
        var cl = f[1]; return caml_call2(Sx_types[6][1], cl, args);
     }
    var nargs = Stdlib_List[1].call(null, args);
    if(0 === nargs)
     var args_preview = cst;
    else
     var
      d =
        Stdlib_List[20].call
         (null,
          function(a){
           var s = Sx_types[117].call(null, a);
           if(40 >= caml_ml_string_length(s)) return s;
           var b = Stdlib_String[16].call(null, s, 0, 40);
           return Stdlib[28].call(null, b, "..");
          },
          args),
      s = Stdlib_String[7].call(null, ", ", d),
      e = Stdlib[28].call(null, s, "]"),
      args_preview = Stdlib[28].call(null, " with args=[", e);
    var
     a = Sx_types[117].call(null, f),
     b = Stdlib[28].call(null, a, args_preview),
     c = Stdlib[28].call(null, "Not callable: ", b);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
   }
   Sx_primitives[2][1] = sx_call;
   function sx_apply(f, args_list){return sx_call(f, sx_to_list(args_list));}
   var cst_eval_error = "__eval_error__", k = [0, 1];
   function sx_apply_cek(f, args_list){
    if(typeof f !== "number")
     switch(f[0]){
       case 15:
       case 24:
        try{var a = sx_apply(f, args_list); return a;}
        catch(e$0){
         var e = caml_wrap_exception(e$0);
         if(e[1] === Sx_types[11]) throw caml_maybe_attach_backtrace(e, 0);
         var match = caml_call1(Sx_types[16][1], e);
         if(match){var marker = match[1]; return marker;}
         if(e[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(e, 0);
         var msg = e[2], d = Stdlib_Hashtbl[1].call(null, 0, 3);
         Stdlib_Hashtbl[11].call(null, d, cst_eval_error, k);
         Stdlib_Hashtbl[11].call(null, d, "message", [3, msg]);
         return [7, d];
        }
     }
    return sx_apply(f, args_list);
   }
   function is_eval_error(v){
    if(typeof v !== "number" && 7 === v[0]){
     var d = v[1], match = Stdlib_Hashtbl[7].call(null, d, cst_eval_error);
     if(match){
      var a = match[1];
      if(typeof a !== "number" && 0 === a[0] && a[1]) return 1;
     }
     return 0;
    }
    return 0;
   }
   function sx_append_b(lst, item){
    if(typeof lst !== "number")
     switch(lst[0]){
       case 6:
        var items = lst[1];
        return [6, Stdlib[37].call(null, items, [0, item, 0])];
       case 21:
        var r = lst[1];
        r[1] = Stdlib[37].call(null, r[1], [0, item, 0]);
        return lst;
     }
    var
     a = Sx_types[61].call(null, lst),
     b = Stdlib[28].call(null, "append!: expected list, got ", a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   var
    cst_current_item = "current-item",
    cst_effect_list = "effect-list",
    cst_emitted = "emitted",
    cst_extra = "extra",
    cst_extra2 = "extra2",
    cst_first_render = "first-render",
    cst_frames = "frames",
    cst_has_effects = "has-effects",
    cst_head_name = "head-name",
    cst_ho_type = "ho-type",
    cst_indexed = "indexed",
    cst_ip = "ip",
    cst_match_val = "match-val",
    cst_phase = "phase",
    cst_raw_args = "raw-args",
    cst_remaining = "remaining",
    cst_results = "results",
    cst_scheme = "scheme",
    cst_sp = "sp",
    cst_stack = "stack",
    cst_subscribers = "subscribers",
    cst_update_fn = "update-fn",
    cst_value = "value";
   function sx_dict_set_b(d, k, v){
    if(typeof d !== "number")
     switch(d[0]){
       case 7:
        var tbl = d[1];
        if(typeof k !== "number")
         switch(k[0]){
           case 3:
           case 5:
            var key = k[1];
            Stdlib_Hashtbl[11].call(null, tbl, key, v);
            return v;
         }
        break;
       case 23:
        if(typeof k !== "number" && 3 === k[0]){
         var
          key$0 = k[1],
          f = d[1],
          switch$ = caml_string_compare(key$0, cst_indexed);
         a:
         {
          b:
          if(0 <= switch$){
           if(0 < switch$ && key$0 !== cst_match_val && key$0 !== cst_phase){
            if(key$0 !== cst_raw_args){
             if(key$0 === cst_remaining){f[5] = v; return v;}
             if(key$0 !== cst_results){
              if(key$0 === cst_scheme) break b;
              if(key$0 !== cst_subscribers){
               if(key$0 === cst_update_fn) break b;
               if(key$0 !== cst_value) break a;
               break b;
              }
             }
            }
            f[8] = v;
            return v;
           }
          }
          else if(key$0 !== cst_current_item){
           if(key$0 !== cst_effect_list && key$0 !== cst_emitted){
            if(key$0 === cst_extra) break b;
            if(key$0 !== cst_extra2 && key$0 !== cst_first_render){
             if(key$0 === cst_has_effects) break b;
             if(key$0 === cst_head_name) break b;
             if(key$0 !== cst_ho_type) break a;
             break b;
            }
           }
           f[10] = v;
           return v;
          }
          f[9] = v;
          return v;
         }
         var
          b =
            Stdlib[28].call
             (null, "dict-set! cek-frame: unknown field ", key$0);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
        }
        break;
       case 25:
        if(typeof k !== "number" && 3 === k[0]){
         var key$1 = k[1], f$0 = d[1];
         if(key$1 !== cst_ip){
          var
           c =
             Stdlib[28].call
              (null, "dict-set! vm-frame: unknown field ", key$1);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
         }
         f$0[2] = Sx_types[94].call(null, v);
         return v;
        }
        break;
       case 26:
        if(typeof k !== "number" && 3 === k[0]){
         var key$2 = k[1], m = d[1];
         if(key$2 !== cst_frames){
          if(key$2 === cst_sp){m[2] = Sx_types[94].call(null, v); return v;}
          if(key$2 !== cst_stack){
           var
            e =
              Stdlib[28].call
               (null, "dict-set! vm-machine: unknown field ", key$2);
           throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
          }
          if(typeof v !== "number" && 6 === v[0]) return v;
          throw caml_maybe_attach_backtrace
                 ([0, Sx_types[9], "vm: stack must be array"], 1);
         }
         a:
         {
          if(typeof v !== "number" && 6 === v[0]){
           var
            l = v[1],
            a =
              Stdlib_List[20].call
               (null,
                function(x){
                 if(typeof x !== "number" && 25 === x[0]){var f = x[1]; return f;}
                 throw caml_maybe_attach_backtrace
                        ([0, Sx_types[9], "vm: frames must be vm-frame list"], 1);
                },
                l);
           break a;
          }
          var a = 0;
         }
         m[3] = a;
         return v;
        }
        break;
     }
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "dict-set!: expected dict and string key"], 1);
   }
   var
    cst_body = "body",
    cst_else = "else",
    cst_name = "name",
    cst_type = "type",
    l = [0, 1];
   function get_val(container, key){
    a:
    if(typeof container === "number"){if(0 === container) return 0;}
    else{
     var cst_env = "env";
     switch(container[0]){
       case 6:
        var l$0 = container[1]; break;
       case 7:
        var d = container[1];
        if(typeof key === "number") break a;
        switch(key[0]){
          case 3:
          case 5:
           var k = key[1]; return Sx_types[110].call(null, d, k);
          default: break a;
        }
       case 21:
        var l$0 = container[1][1]; break;
       case 22:
        if(typeof key === "number") break a;
        if(3 !== key[0]) break a;
        var k$0 = key[1], s = container[1];
        return k$0 !== "control"
                ? k$0
                  !== cst_env
                  ? k$0
                    !== "kont"
                    ? k$0
                      !== cst_phase
                      ? k$0 !== cst_value ? 0 : s[5]
                      : [3, s[4]]
                    : s[3]
                  : s[2]
                : s[1];
       case 23:
        if(typeof key === "number") break a;
        if(3 !== key[0]) break a;
        var
         k$1 = key[1],
         f = container[1],
         switch$ = caml_string_compare(k$1, cst_head_name);
        if(0 <= switch$){
         if(0 >= switch$) return f[9];
         var switch$0 = caml_string_compare(k$1, cst_results);
         if(0 <= switch$0){
          if(0 >= switch$0) return f[8];
          if(k$1 === cst_scheme) return f[9];
          if(k$1 === cst_subscribers) return f[8];
          if(k$1 === "then") return f[4];
          if(k$1 === cst_type) return [3, f[1]];
          if(k$1 === cst_update_fn) return f[9];
          if(k$1 === cst_value) return f[9];
          if(k$1 === "winders-len") return f[9];
         }
         else{
          if(k$1 === cst_ho_type) return f[9];
          if(k$1 === cst_indexed) return f[9];
          if(k$1 === cst_match_val) return f[9];
          if(k$1 === cst_name) return f[3];
          if(k$1 === cst_phase) return f[9];
          if(k$1 === "prev-tracking") return f[9];
          if(k$1 === cst_raw_args) return f[8];
          if(k$1 === cst_remaining) return f[5];
         }
        }
        else{
         var switch$1 = caml_string_compare(k$1, cst_env);
         if(0 <= switch$1){
          if(0 >= switch$1) return f[2];
          if(k$1 === "evaled") return f[7];
          if(k$1 === cst_extra) return f[9];
          if(k$1 === cst_extra2) return f[10];
          if(k$1 === "f") return f[6];
          if(k$1 === "file") return f[2];
          if(k$1 === cst_first_render) return f[10];
          if(k$1 === cst_has_effects) return f[9];
         }
         else{
          if(k$1 === "after-thunk") return f[6];
          if(k$1 === "args") return f[7];
          if(k$1 === cst_body) return f[4];
          if(k$1 === "body-result") return f[3];
          if(k$1 === cst_current_item) return f[9];
          if(k$1 === cst_effect_list) return f[10];
          if(k$1 === cst_else) return f[3];
          if(k$1 === cst_emitted) return f[10];
         }
        }
        return 0;
       case 24:
        if(typeof key === "number") break a;
        if(3 !== key[0]) break a;
        var k$2 = key[1], cl = container[1];
        if(k$2 === "vm-closure-env"){
         var match$2 = cl[5];
         if(! match$2) return 0;
         var e = match$2[1];
         return [20, e];
        }
        if(k$2 === "vm-code"){
         var c = cl[1], match$0 = c[6];
         if(match$0)
          var l$2 = match$0[1], bc = l$2;
         else{
          var
           i = Stdlib_Array[14].call(null, function(i){return [2, i];}, c[4]),
           l$5 = Stdlib_Array[10].call(null, i);
          c[6] = [0, l$5];
          var bc = l$5;
         }
         var match$1 = c[7];
         if(match$1)
          var l$3 = match$1[1], consts = l$3;
         else{
          var l$4 = Stdlib_Array[10].call(null, c[5]);
          c[7] = [0, l$4];
          var consts = l$4;
         }
         var d$0 = Stdlib_Hashtbl[1].call(null, 0, 4);
         Stdlib_Hashtbl[11].call(null, d$0, "vc-bytecode", [6, bc]);
         Stdlib_Hashtbl[11].call(null, d$0, "vc-constants", [6, consts]);
         Stdlib_Hashtbl[11].call(null, d$0, "vc-arity", [2, c[1]]);
         Stdlib_Hashtbl[11].call(null, d$0, "vc-rest-arity", [2, c[2]]);
         Stdlib_Hashtbl[11].call(null, d$0, "vc-locals", [2, c[3]]);
         return [7, d$0];
        }
        if(k$2 === "vm-globals") return [7, cl[4]];
        if(k$2 !== "vm-name"){
         if(k$2 !== "vm-upvalues") return 0;
         var
          h = Stdlib_Array[14].call(null, function(uv){return uv[1];}, cl[2]);
         return [6, Stdlib_Array[10].call(null, h)];
        }
        var match = cl[3];
        if(! match) return 0;
        var n$1 = match[1];
        return [3, n$1];
       case 25:
        if(typeof key === "number") break a;
        if(3 !== key[0]) break a;
        var k$3 = key[1], f$0 = container[1];
        return k$3 !== "base"
                ? k$3
                  !== "closure"
                  ? k$3
                    !== cst_ip
                    ? k$3 !== "local-cells" ? 0 : 0
                    : [2, f$0[2]]
                  : [24, f$0[1]]
                : [2, f$0[3]];
       case 26:
        if(typeof key === "number") break a;
        if(3 !== key[0]) break a;
        var k$4 = key[1], m = container[1];
        return k$4 !== cst_frames
                ? k$4
                  !== "globals"
                  ? k$4 !== cst_sp ? k$4 !== cst_stack ? 0 : 0 : [2, m[2]]
                  : [7, m[4]]
                : [6,
                  Stdlib_List[20].call
                   (null, function(f){return [25, f];}, m[3])];
       case 38:
        var a = container[1];
        if(typeof key === "number") break a;
        switch(key[0]){
          case 3:
          case 5:
           var k$5 = key[1];
           return k$5 !== "_adt"
                   ? k$5
                     !== "_ctor"
                     ? k$5
                       !== "_fields"
                       ? k$5 !== "_type" ? 0 : [3, a[1]]
                       : [6, Stdlib_Array[10].call(null, a[3])]
                     : [3, a[2]]
                   : l;
          default: break a;
        }
       default: break a;
     }
     if(typeof key !== "number" && 2 === key[0]){
      var n$0 = key[1];
      try{var g = Stdlib_List[8].call(null, l$0, n$0 | 0); return g;}
      catch(exn){return 0;}
     }
     if(typeof container !== "number"){
      switch(container[0]){
        case 6:
         var l$1 = container[1]; break;
        case 21:
         var l$1 = container[1][1]; break;
        default: break a;
      }
      if(typeof key !== "number" && 1 === key[0]){
       var n = key[1];
       try{var b = Stdlib_List[8].call(null, l$1, n); return b;}
       catch(exn){return 0;}
      }
     }
    }
    return 0;
   }
   Sx_primitives[13].call
    (null,
     "get",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var match = a[2], k = a[1], c = args[1];
        if(! match) return get_val(c, k);
        if(! match[2]){
         var default$ = match[1];
         try{
          var v = get_val(c, k), default$0 = 0 === v ? default$ : v;
          return default$0;
         }
         catch(exn){return default$;}
        }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "get: 2-3 args"], 1);
     });
   function prim(name){
    var match = Stdlib_Hashtbl[7].call(null, Sx_primitives[1], name);
    if(! match)
     return function(param){
      var a = Stdlib[28].call(null, "Missing prim: ", name);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);};
    var f = match[1];
    return f;
   }
   function first(args){return caml_call1(prim(cst_first), [0, args, 0]);}
   function rest(args){return caml_call1(prim(cst_rest), [0, args, 0]);}
   function last(args){return caml_call1(prim("last"), [0, args, 0]);}
   function nth(coll, i){
    return caml_call1(prim("nth"), [0, coll, [0, i, 0]]);
   }
   function cons(x, l){return caml_call1(prim("cons"), [0, x, [0, l, 0]]);}
   function append(a, b){
    return caml_call1(prim("append"), [0, a, [0, b, 0]]);
   }
   function reverse(l){return caml_call1(prim("reverse"), [0, l, 0]);}
   function flatten(l){return caml_call1(prim("flatten"), [0, l, 0]);}
   function concat(a, b){
    return caml_call1(prim("concat"), [0, a, [0, b, 0]]);
   }
   function slice(a, b){return caml_call1(prim("slice"), [0, a, [0, b, 0]]);}
   function len(a){return caml_call1(prim(cst_len), [0, a, 0]);}
   function get(a, b){return get_val(a, b);}
   function sort(a){return caml_call1(prim("sort"), [0, a, 0]);}
   function range(a){return caml_call1(prim("range"), [0, a, 0]);}
   function unique(a){return caml_call1(prim("unique"), [0, a, 0]);}
   function zip(a, b){return caml_call1(prim("zip"), [0, a, [0, b, 0]]);}
   function take(a, b){return caml_call1(prim("take"), [0, a, [0, b, 0]]);}
   function drop(a, b){return caml_call1(prim("drop"), [0, a, [0, b, 0]]);}
   function keyword_p(a){return caml_call1(prim("keyword?"), [0, a, 0]);}
   function empty_p(a){return caml_call1(prim(cst_empty), [0, a, 0]);}
   function number_p(a){return caml_call1(prim("number?"), [0, a, 0]);}
   function string_p(a){return caml_call1(prim("string?"), [0, a, 0]);}
   function boolean_p(a){return caml_call1(prim("boolean?"), [0, a, 0]);}
   function list_p(a){return caml_call1(prim("list?"), [0, a, 0]);}
   function dict_p(a){return caml_call1(prim("dict?"), [0, a, 0]);}
   function symbol_p(a){return caml_call1(prim("symbol?"), [0, a, 0]);}
   function str(args){return [3, sx_str(args)];}
   function upper(a){return caml_call1(prim("upper"), [0, a, 0]);}
   function upcase(a){return caml_call1(prim("upcase"), [0, a, 0]);}
   function lower(a){return caml_call1(prim("lower"), [0, a, 0]);}
   function downcase(a){return caml_call1(prim("downcase"), [0, a, 0]);}
   function trim(a){return caml_call1(prim("trim"), [0, a, 0]);}
   function split(a, b){return caml_call1(prim("split"), [0, a, [0, b, 0]]);}
   function join(a, b){return caml_call1(prim("join"), [0, a, [0, b, 0]]);}
   function replace(a, b, c){
    return caml_call1(prim("replace"), [0, a, [0, b, [0, c, 0]]]);
   }
   function substring(a, b, c){
    return caml_call1(prim("substring"), [0, a, [0, b, [0, c, 0]]]);
   }
   function assoc(d, k, v){
    return caml_call1(prim("assoc"), [0, d, [0, k, [0, v, 0]]]);
   }
   function dissoc(d, k){
    return caml_call1(prim("dissoc"), [0, d, [0, k, 0]]);
   }
   function merge(a, b){return caml_call1(prim("merge"), [0, a, [0, b, 0]]);}
   function keys(a){return caml_call1(prim("keys"), [0, a, 0]);}
   function vals(a){return caml_call1(prim("vals"), [0, a, 0]);}
   function dict_set(a, b, c){
    return caml_call1(prim("dict-set!"), [0, a, [0, b, [0, c, 0]]]);
   }
   function dict_get(a, b){
    return caml_call1(prim("dict-get"), [0, a, [0, b, 0]]);
   }
   function dict_delete(a, b){
    return caml_call1(prim("dict-delete!"), [0, a, [0, b, 0]]);
   }
   function abs(a){return caml_call1(prim("abs"), [0, a, 0]);}
   function sqrt(a){return caml_call1(prim("sqrt"), [0, a, 0]);}
   function pow(a, b){return caml_call1(prim("pow"), [0, a, [0, b, 0]]);}
   function floor(a){return caml_call1(prim("floor"), [0, a, 0]);}
   function ceil(a){return caml_call1(prim("ceil"), [0, a, 0]);}
   function round(a){return caml_call1(prim("round"), [0, a, 0]);}
   function min(a, b){return caml_call1(prim("min"), [0, a, [0, b, 0]]);}
   function max(a, b){return caml_call1(prim("max"), [0, a, [0, b, 0]]);}
   function clamp(a, b, c){
    return caml_call1(prim("clamp"), [0, a, [0, b, [0, c, 0]]]);
   }
   function error(msg){
    var a = value_to_str(msg);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
   }
   function inspect(v){return [3, Sx_types[117].call(null, v)];}
   function apply(f, args){return sx_apply(f, args);}
   function spread_attrs(a){
    return caml_call1(prim("spread-attrs"), [0, a, 0]);
   }
   function sx_context(a, b){return prim_call("context", [0, a, [0, b, 0]]);}
   function trampoline(v){return v;}
   function type_of(v){return [3, Sx_types[61].call(null, v)];}
   function unwrap_env(v){
    if(typeof v === "number"){
     if(0 === v) return Sx_types[20].call(null, 0);
    }
    else
     switch(v[0]){
       case 7:
        var d = v[1], e = Sx_types[20].call(null, 0);
        Stdlib_Hashtbl[12].call
         (null,
          function(k, v){Sx_types[26].call(null, e, k, v); return 0;},
          d);
        return e;
       case 20:
        var e$0 = v[1]; return e$0;
     }
    var
     a = Sx_types[61].call(null, v),
     b = Stdlib[28].call(null, "Expected env, got ", a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   function env_has(e, name){
    var a = value_to_str(name), b = unwrap_env(e);
    return [0, Sx_types[28].call(null, b, a)];
   }
   function env_get(e, name){
    var a = value_to_str(name), b = unwrap_env(e);
    return Sx_types[30].call(null, b, a);
   }
   function env_bind(e, name, v){
    var a = value_to_str(name), b = unwrap_env(e);
    return Sx_types[26].call(null, b, a, v);
   }
   function env_set(e, name, v){
    var a = value_to_str(name), b = unwrap_env(e);
    return Sx_types[32].call(null, b, a, v);
   }
   function make_env(param){return [20, Sx_types[20].call(null, 0)];}
   function env_extend(e){
    var a = unwrap_env(e);
    return [20, Sx_types[21].call(null, a)];
   }
   function env_merge(a, b){
    var c = unwrap_env(b), d = unwrap_env(a);
    return [20, Sx_types[33].call(null, d, c)];
   }
   function set_lambda_name(l, n){
    var a = value_to_str(n);
    return Sx_types[78].call(null, l, a);
   }
   function is_nil(v){return [0, Sx_types[62].call(null, v)];}
   function is_thunk(v){return [0, Sx_types[67].call(null, v)];}
   function is_lambda(v){return [0, Sx_types[63].call(null, v)];}
   function is_component(v){return [0, Sx_types[64].call(null, v)];}
   function is_island(v){return [0, Sx_types[65].call(null, v)];}
   function is_macro(v){return [0, Sx_types[66].call(null, v)];}
   function is_signal(v){return [0, Sx_types[68].call(null, v)];}
   function is_callable(v){return [0, Sx_types[70].call(null, v)];}
   function is_primitive(name){
    var a = value_to_str(name);
    return [0, Sx_primitives[14].call(null, a)];
   }
   function get_primitive(name){
    var a = value_to_str(name);
    return Sx_primitives[15].call(null, a);
   }
   function for_each_indexed(fn, coll){
    var a = sx_to_list(coll);
    Stdlib_List[19].call
     (null, function(i, x){sx_call(fn, [0, [2, i], [0, x, 0]]); return 0;}, a);
    return 0;
   }
   var m = [0, 0], n = [0, 1];
   function continuation_p(v){
    if(typeof v !== "number" && 13 === v[0]) return n;
    return m;
   }
   function make_cek_continuation(captured, rest_kont){
    var data = Stdlib_Hashtbl[1].call(null, 0, 2);
    Stdlib_Hashtbl[11].call(null, data, "captured", captured);
    Stdlib_Hashtbl[11].call(null, data, "rest-kont", rest_kont);
    return [13, function(v){return v;}, [0, data]];
   }
   function continuation_data(v){
    if(typeof v !== "number" && 13 === v[0]){
     var match = v[2];
     if(! match) return [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
     var d = match[1];
     return [7, d];
    }
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "not a continuation"], 1);
   }
   var o = [0, 0], p = [0, 1];
   function callcc_continuation_p(v){
    if(typeof v !== "number" && 14 === v[0]) return p;
    return o;
   }
   function make_callcc_continuation(captured, winders_len){
    a:
    {
     if(typeof winders_len !== "number")
      switch(winders_len[0]){
        case 1:
         var n$0 = winders_len[1], n = n$0; break a;
        case 2:
         var f = winders_len[1], n = f | 0; break a;
      }
     var n = 0;
    }
    return [14, sx_to_list(captured), n];
   }
   function callcc_continuation_data(v){
    if(typeof v !== "number" && 14 === v[0]){var frames = v[1]; return [6, frames];}
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "not a callcc continuation"], 1);
   }
   var q = [2, 0.];
   function callcc_continuation_winders_le(v){
    if(typeof v !== "number" && 14 === v[0]){var n = v[2]; return [2, n];}
    return q;
   }
   function host_error(msg){
    var a = value_to_str(msg);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
   }
   function host_warn(msg){
    var a = value_to_str(msg);
    Stdlib[53].call(null, a);
    return 0;
   }
   function dynamic_wind_call(before, body, after, env){
    sx_call(before, 0);
    var result = sx_call(body, 0);
    sx_call(after, 0);
    return result;
   }
   var cst_scope_push = "scope-push!";
   function scope_push(name, value){
    return prim_call(cst_scope_push, [0, name, [0, value, 0]]);
   }
   var cst_scope_pop = "scope-pop!";
   function scope_pop(name){return prim_call(cst_scope_pop, [0, name, 0]);}
   function scope_peek(name){return prim_call("scope-peek", [0, name, 0]);}
   function scope_emit(name, value){
    return prim_call("scope-emit!", [0, name, [0, value, 0]]);
   }
   function provide_push(name, value){
    return prim_call(cst_scope_push, [0, name, [0, value, 0]]);
   }
   function provide_pop(name){return prim_call(cst_scope_pop, [0, name, 0]);}
   var custom_special_forms = [7, Stdlib_Hashtbl[1].call(null, 0, 4)];
   function register_special_form(name, handler){
    if(7 !== custom_special_forms[0])
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[9], "custom_special_forms not a dict"], 1);
    var tbl = custom_special_forms[1], a = value_to_str(name);
    Stdlib_Hashtbl[11].call(null, tbl, a, handler);
    return handler;
   }
   var r = [0, 0], s = [0, 1];
   function is_else_clause(v){
    if(typeof v !== "number"){
     var cst_default = "default";
     switch(v[0]){
       case 0:
        if(v[1]) return s; break;
       case 4:
        var
         s$0 = v[1],
         a = s$0 === cst_else ? 1 : 0,
         b = a || (s$0 === cst_default ? 1 : 0);
        return [0, b];
       case 5:
        var
         k = v[1],
         c = k === cst_else ? 1 : 0,
         d = c || (k === cst_default ? 1 : 0);
        return [0, d];
     }
    }
    return r;
   }
   function signal_value(s){
    if(typeof s !== "number")
     switch(s[0]){
       case 7:
        var d = s[1], match = Stdlib_Hashtbl[7].call(null, d, cst_value);
        if(! match) return 0;
        var v = match[1];
        return v;
       case 16:
        var sig = s[1]; return sig[1];
     }
    throw caml_maybe_attach_backtrace([0, Sx_types[9], "not a signal"], 1);
   }
   function signal_add_sub_b(s, f){
    if(typeof s !== "number" && 7 === s[0]){
     var d = s[1], match = Stdlib_Hashtbl[7].call(null, d, cst_subscribers);
     if(match){
      var match$0 = match[1];
      if(typeof match$0 !== "number")
       switch(match$0[0]){
         case 6:
          var
           items = match$0[1],
           a = [21, [0, Stdlib[37].call(null, items, [0, f, 0])]];
          Stdlib_Hashtbl[11].call(null, d, cst_subscribers, a);
          return 0;
         case 21:
          var r = match$0[1];
          r[1] = Stdlib[37].call(null, r[1], [0, f, 0]);
          return 0;
       }
     }
     Stdlib_Hashtbl[11].call(null, d, cst_subscribers, [21, [0, [0, f, 0]]]);
     return 0;
    }
    return 0;
   }
   function signal_remove_sub_b(s, f){
    if(typeof s !== "number" && 7 === s[0]){
     var d = s[1], match = Stdlib_Hashtbl[7].call(null, d, cst_subscribers);
     if(match){
      var match$0 = match[1];
      if(typeof match$0 !== "number")
       switch(match$0[0]){
         case 6:
          var
           items = match$0[1],
           a =
             [6,
              Stdlib_List[44].call
               (null, function(x){return x !== f ? 1 : 0;}, items)];
          Stdlib_Hashtbl[11].call(null, d, cst_subscribers, a);
          return 0;
         case 21:
          var r = match$0[1];
          r[1] =
           Stdlib_List[44].call
            (null, function(x){return x !== f ? 1 : 0;}, r[1]);
          return 0;
       }
     }
     return 0;
    }
    return 0;
   }
   function with_island_scope(register_fn, body_fn){
    if(typeof body_fn !== "number" && 15 === body_fn[0]){var f = body_fn[2]; return caml_call1(f, 0);}
    return 0;
   }
   function register_in_scope(dispose_fn){return 0;}
   function component_set_param_types_b(comp, types){return 0;}
   var t = [6, [0, [6, 0], [0, 0, [0, [0, 0], 0]]]];
   function parse_comp_params(params){return t;}
   var u = [6, [0, [6, 0], [0, 0, 0]]];
   function parse_macro_params(params){return u;}
   var v = [0, [6, 0], 0];
   function parse_keyword_args(raw_args, env){
    return [6, [0, [7, Stdlib_Hashtbl[1].call(null, 0, 0)], v]];
   }
   var w = [3, "handler"];
   function make_handler_def(name, params, body, env){
    var d = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, d, cst_type, w);
    Stdlib_Hashtbl[11].call(null, d, cst_name, name);
    Stdlib_Hashtbl[11].call(null, d, "params", params);
    Stdlib_Hashtbl[11].call(null, d, cst_body, body);
    return [7, d];
   }
   var x = [3, "page"];
   function make_page_def(name, opts){
    var d = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, d, cst_type, x);
    Stdlib_Hashtbl[11].call(null, d, cst_name, name);
    return [7, d];
   }
   var y = [2, 1.];
   function sf_defhandler(args, env){
    var name = first(args), rest_args = rest(args), a = nth(rest_args, y);
    return make_handler_def(name, first(rest_args), a, env);
   }
   function strip_prefix(s, prefix){
    if
     (typeof s !== "number"
      && 3 === s[0] && typeof prefix !== "number" && 3 === prefix[0]){
     var p = prefix[1], s$0 = s[1], pl = caml_ml_string_length(p);
     if
      (pl <= caml_ml_string_length(s$0)
       && Stdlib_String[16].call(null, s$0, 0, pl) === p)
      return [3,
              Stdlib_String[16].call
               (null, s$0, pl, caml_ml_string_length(s$0) - pl | 0)];
     return [3, s$0];
    }
    return s;
   }
   function debug_log(a, param){return 0;}
   function mutable_list(param){return [21, [0, 0]];}
   var jit_hit = [0, 0], jit_miss = [0, 0], jit_skip = [0, 0];
   function jit_reset_counters(param){
    jit_hit[1] = 0;
    jit_miss[1] = 0;
    jit_skip[1] = 0;
    return 0;
   }
   var d = Stdlib_Hashtbl[1].call(null, 0, 1), cst_jit_skip = "__jit_skip";
   Stdlib_Hashtbl[11].call(null, d, cst_jit_skip, [0, 1]);
   function is_jit_skip(v){
    if(typeof v !== "number" && 7 === v[0]){
     var d = v[1];
     return Stdlib_Hashtbl[9].call(null, d, cst_jit_skip);
    }
    return 0;
   }
   function jit_skip_p(v){return [0, is_jit_skip(v)];}
   var jit_try_call_fn = [0, 0], jit_skip_sentinel = [7, d];
   function jit_try_call(f, args){
    var match = jit_try_call_fn[1];
    if(! match){jit_skip[1]++; return jit_skip_sentinel;}
    var hook = match[1];
    if(typeof f !== "number" && 8 === f[0]){
     var l = f[1];
     if(0 !== l[4]){
      a:
      {
       if(typeof args !== "number")
        switch(args[0]){
          case 6:
           var arg_list = args[1]; break a;
          case 21:
           var arg_list = args[1][1]; break a;
        }
       var arg_list = 0;
      }
      var match$0 = caml_call2(hook, f, arg_list);
      if(match$0){var result = match$0[1]; jit_hit[1]++; return result;}
      jit_miss[1]++;
      return jit_skip_sentinel;
     }
    }
    jit_skip[1]++;
    return jit_skip_sentinel;
   }
   runtime.caml_register_global
    (234,
     [0,
      fast_eq,
      prim_call,
      value_to_str,
      sx_to_string,
      sx_str,
      sx_to_list,
      sx_call,
      sx_apply,
      sx_apply_cek,
      is_eval_error,
      sx_append_b,
      sx_dict_set_b,
      get_val,
      prim,
      first,
      rest,
      last,
      nth,
      cons,
      append,
      reverse,
      flatten,
      concat,
      slice,
      len,
      get,
      sort,
      range,
      unique,
      zip,
      take,
      drop,
      keyword_p,
      empty_p,
      number_p,
      string_p,
      boolean_p,
      list_p,
      dict_p,
      symbol_p,
      str,
      upper,
      upcase,
      lower,
      downcase,
      trim,
      split,
      join,
      replace,
      substring,
      assoc,
      dissoc,
      merge,
      keys,
      vals,
      dict_set,
      dict_get,
      dict_delete,
      abs,
      sqrt,
      pow,
      floor,
      ceil,
      round,
      min,
      max,
      clamp,
      error,
      inspect,
      apply,
      spread_attrs,
      sx_context,
      trampoline,
      type_of,
      unwrap_env,
      env_has,
      env_get,
      env_bind,
      env_set,
      make_env,
      env_extend,
      env_merge,
      set_lambda_name,
      is_nil,
      is_thunk,
      is_lambda,
      is_component,
      is_island,
      is_macro,
      is_signal,
      is_callable,
      is_primitive,
      get_primitive,
      for_each_indexed,
      continuation_p,
      make_cek_continuation,
      continuation_data,
      callcc_continuation_p,
      make_callcc_continuation,
      callcc_continuation_data,
      callcc_continuation_winders_le,
      host_error,
      host_warn,
      dynamic_wind_call,
      scope_push,
      scope_pop,
      scope_peek,
      scope_emit,
      provide_push,
      provide_pop,
      custom_special_forms,
      register_special_form,
      0,
      0,
      is_else_clause,
      signal_value,
      signal_add_sub_b,
      signal_remove_sub_b,
      with_island_scope,
      register_in_scope,
      component_set_param_types_b,
      parse_comp_params,
      parse_macro_params,
      parse_keyword_args,
      make_handler_def,
      make_page_def,
      sf_defhandler,
      strip_prefix,
      debug_log,
      mutable_list,
      jit_try_call_fn,
      jit_hit,
      jit_miss,
      jit_skip,
      jit_reset_counters,
      jit_skip_sentinel,
      is_jit_skip,
      jit_skip_p,
      jit_try_call],
     "Sx_runtime");
   return;
  }
  (globalThis));

//# 19362 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_ref:[N,F(1),N,N,N,N,F(1),F(3)*,F(3)*,F(3),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3)*,F(2)*,F(2)*,F(4)*,F(4)*,F(3)*,F(2)*,F(6)*,F(3)*,F(3)*,F(2)*,F(3)*,F(4)*,F(3),F(3),F(4)*,F(4)*,F(4)*,F(5)*,F(3)*,F(3)*,F(3)*,F(3)*,F(3)*,F(4)*,F(3)*,F(2)*,F(4)*,F(1)*,F(3)*,F(2)*,F(2)*,F(4)*,F(3)*,F(1)*,F(3)*,F(2)*,F(1)*,F(4)*,F(2)*,F(1),F(3)*,F(3)*,F(2)*,F(2)*,F(2)*,F(1)*,F(2)*,F(3)*,F(5)*,F(2),F(2),F(2),F(1),F(2),F(2),F(1),F(2),F(1),F(1),F(1),F(1),F(3),F(2),F(2),F(1),F(1),N,F(2),N,N,N,N,N,N,N,N,N,N,N,N,N,F(1),F(1),F(1),F(2),N,F(2),F(1),F(1),F(1),N,F(2),F(1),F(1),F(1),F(1),F(2),F(1),F(3),F(1),F(2),F(3),F(2),F(2),F(3),N,N,F(1),N,N,F(1),F(2),F(2),F(3),F(3),F(3),F(2),F(1),F(1),F(2),F(2),F(2),F(3),F(1),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(3),F(3),F(2),F(2),F(3),F(1),F(1),F(2),F(1),F(1),F(3),F(3),F(3),F(3),F(3),F(3),F(1),F(1),F(1),F(1),F(3),F(3),F(3),F(5),F(2),F(2),F(2),F(3),F(3),F(3),F(2),F(3),F(2),F(3),F(3),F(2),F(2),F(2),F(2),F(1),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(2),F(3),F(4),F(1),F(1)*,F(2),F(4),F(3),F(3),F(3),F(3),F(3),F(3),F(3),F(1),F(5),F(4),F(2),F(1),F(1)*,F(2),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(2),F(2),F(2),F(2),F(2),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_equal = runtime.caml_equal,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_trampoline = runtime.caml_trampoline,
    caml_trampoline_return = runtime.caml_trampoline_return,
    caml_update_dummy = runtime.caml_update_dummy,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Sx_runtime = global_data.Sx_runtime,
    Sx_types = global_data.Sx_types,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib = global_data.Stdlib,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib_Array = global_data.Stdlib__Array,
    Sx_primitives = global_data.Sx_primitives,
    trampoline_fn = [0, function(v){return v;}];
   function trampoline(v){return caml_call1(trampoline_fn[1], v);}
   var
    protocol_registry = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
    b = [6, 0];
   function seq_to_list(v){
    if(typeof v === "number"){if(0 === v) return b;}
    else
     switch(v[0]){
       case 3:
        var s = v[1], chars = [0, 0];
        Stdlib_String[30].call
         (null,
          function(c){
           var a = chars[1];
           chars[1] = [0, [3, Stdlib_String[1].call(null, 1, c)], a];
           return 0;
          },
          s);
        return [6, Stdlib_List[10].call(null, chars[1])];
       case 6:
        return v;
       case 21:
        var items = v[1][1]; return [6, items];
       case 29:
        var arr = v[1]; return [6, Stdlib_Array[10].call(null, arr)];
     }
    return v;
   }
   var cst_eval = "eval";
   function make_cek_state(control, env, kont){
    return [22, [0, control, env, kont, cst_eval, 0]];
   }
   var cst_continue = "continue";
   function make_cek_value(value, env, kont){
    return [22, [0, 0, env, kont, cst_continue, value]];
   }
   var
    cst_env = "env",
    cst_io_suspended = "io-suspended",
    cst_kont = "kont",
    cst_phase = "phase",
    cst_request = "request",
    c = [3, cst_io_suspended];
   function make_cek_suspended(request, env, kont){
    var d = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, d, cst_env, env);
    Stdlib_Hashtbl[11].call(null, d, cst_kont, kont);
    Stdlib_Hashtbl[11].call(null, d, cst_phase, c);
    Stdlib_Hashtbl[11].call(null, d, cst_request, request);
    return [7, d];
   }
   var
    cst = "=",
    d = [0, [3, cst_continue], 0],
    e = [3, cst_phase],
    f = [3, cst_kont];
   function cek_terminal_p(state){
    var
     a = [0, Sx_runtime[26].call(null, state, e), d],
     and = Sx_runtime[2].call(null, cst, a);
    if(! Sx_types[71].call(null, and)) return and;
    var b = Sx_runtime[26].call(null, state, f);
    return Sx_runtime[34].call(null, b);
   }
   var g = [0, [3, cst_io_suspended], 0], h = [3, cst_phase];
   function cek_suspended_p(state){
    var a = [0, Sx_runtime[26].call(null, state, h), g];
    return Sx_runtime[2].call(null, cst, a);
   }
   var i = [3, "control"];
   function cek_control(s){return Sx_runtime[26].call(null, s, i);}
   var j = [3, cst_env];
   function cek_env(s){return Sx_runtime[26].call(null, s, j);}
   var k = [3, cst_kont];
   function cek_kont(s){return Sx_runtime[26].call(null, s, k);}
   var l = [3, cst_phase];
   function cek_phase(s){return Sx_runtime[26].call(null, s, l);}
   var m = [3, cst_request];
   function cek_io_request(s){return Sx_runtime[26].call(null, s, m);}
   var cst_value = "value", n = [3, cst_value];
   function cek_value(s){return Sx_runtime[26].call(null, s, n);}
   var cst_if = "if";
   function make_if_frame(then_expr, else_expr, env){
    return [23, [0, cst_if, env, else_expr, then_expr, 0, 0, 0, 0, 0, 0]];
   }
   var cst_when = "when";
   function make_when_frame(body_exprs, env){
    return [23, [0, cst_when, env, 0, body_exprs, 0, 0, 0, 0, 0, 0]];
   }
   var cst_begin = "begin";
   function make_begin_frame(remaining, env){
    return [23, [0, cst_begin, env, 0, 0, remaining, 0, 0, 0, 0, 0]];
   }
   var cst_let = "let";
   function make_let_frame(name, remaining, body, local){
    return [23, [0, cst_let, local, name, body, remaining, 0, 0, 0, 0, 0]];
   }
   var cst_define = "define";
   function make_define_frame(name, env, has_effects, effect_list){
    return [23,
            [0,
             cst_define,
             env,
             name,
             0,
             0,
             0,
             0,
             0,
             has_effects,
             effect_list]];
   }
   var cst_define_foreign = "define-foreign";
   function make_define_foreign_frame(name, spec, env){
    return [23, [0, cst_define_foreign, env, name, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_set = "set";
   function make_set_frame(name, env){
    return [23, [0, cst_set, env, name, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_arg = "arg";
   function make_arg_frame(f, evaled, remaining, env, raw_args, head_name){
    var head_name$0 = Sx_types[71].call(null, head_name) ? head_name : 0;
    return [23,
            [0,
             cst_arg,
             env,
             0,
             0,
             remaining,
             f,
             evaled,
             raw_args,
             head_name$0,
             0]];
   }
   function make_call_frame(f, args, env){
    return [23, [0, "call", env, 0, 0, 0, f, args, 0, 0, 0]];
   }
   var cst_cond = "cond";
   function make_cond_frame(remaining, env, scheme_p){
    return [23, [0, cst_cond, env, 0, 0, remaining, 0, 0, 0, scheme_p, 0]];
   }
   var cst_cond_arrow = "cond-arrow";
   function make_cond_arrow_frame(test_value, env){
    return [23, [0, cst_cond_arrow, env, 0, 0, 0, 0, 0, 0, test_value, 0]];
   }
   var cst_case = "case";
   function make_case_frame(match_val, remaining, env){
    return [23, [0, cst_case, env, 0, 0, remaining, 0, 0, 0, match_val, 0]];
   }
   var cst_thread = "thread";
   function make_thread_frame(remaining, env, mode, name){
    return [23, [0, cst_thread, env, name, 0, remaining, 0, 0, 0, mode, 0]];
   }
   var
    cst_list = "list",
    cst_quote = "quote",
    o = [0, [3, cst_list], 0],
    p = [4, cst_quote],
    q = [4, cst_quote];
   function thread_insert_arg(form, value, fenv){
    var
     a = [0, Sx_runtime[74].call(null, form), o],
     b = Sx_runtime[2].call(null, cst, a);
    if(! Sx_types[71].call(null, b))
     return eval_expr
             ([6, [0, form, [0, [6, [0, q, [0, value, 0]]], 0]]], fenv);
    var
     c = Sx_runtime[16].call(null, form),
     d = Sx_runtime[19].call(null, [6, [0, p, [0, value, 0]]], c),
     e = Sx_runtime[15].call(null, form);
    return eval_expr(Sx_runtime[19].call(null, e, d), fenv);
   }
   var
    cst_append = "append",
    r = [0, [3, cst_list], 0],
    s = [4, cst_quote],
    t = [4, cst_quote];
   function thread_insert_arg_last(form, value, fenv){
    var
     a = [0, Sx_runtime[74].call(null, form), r],
     b = Sx_runtime[2].call(null, cst, a);
    return Sx_types[71].call(null, b)
            ? eval_expr
              (Sx_runtime[2].call
                (null,
                 cst_append,
                 [0, form, [0, [6, [0, [6, [0, s, [0, value, 0]]], 0]], 0]]),
               fenv)
            : eval_expr
              ([6, [0, form, [0, [6, [0, t, [0, value, 0]]], 0]]], fenv);
   }
   var cst_map = "map", u = [0, 0];
   function make_map_frame(f, remaining, results, env){
    return [23, [0, cst_map, env, 0, 0, remaining, f, 0, results, u, 0]];
   }
   var v = [0, 1];
   function make_map_indexed_frame(f, remaining, results, env){
    return [23, [0, cst_map, env, 0, 0, remaining, f, 0, results, v, 0]];
   }
   var cst_multi_map = "multi-map";
   function make_multi_map_frame(f, remaining_lists, results, env){
    return [23,
            [0,
             cst_multi_map,
             env,
             0,
             0,
             remaining_lists,
             f,
             0,
             results,
             0,
             0]];
   }
   var cst_filter = "filter";
   function make_filter_frame(f, remaining, results, current_item, env){
    return [23,
            [0,
             cst_filter,
             env,
             0,
             0,
             remaining,
             f,
             0,
             results,
             current_item,
             0]];
   }
   var cst_reduce = "reduce";
   function make_reduce_frame(f, remaining, env){
    return [23, [0, cst_reduce, env, 0, 0, remaining, f, 0, 0, 0, 0]];
   }
   var cst_for_each = "for-each";
   function make_for_each_frame(f, remaining, env){
    return [23, [0, cst_for_each, env, 0, 0, remaining, f, 0, 0, 0, 0]];
   }
   var cst_some = "some";
   function make_some_frame(f, remaining, env){
    return [23, [0, cst_some, env, 0, 0, remaining, f, 0, 0, 0, 0]];
   }
   var cst_every = "every";
   function make_every_frame(f, remaining, env){
    return [23, [0, cst_every, env, 0, 0, remaining, f, 0, 0, 0, 0]];
   }
   var cst_scope = "scope";
   function make_scope_frame(name, remaining, env){
    return [23, [0, cst_scope, env, name, 0, remaining, 0, 0, 0, 0, 0]];
   }
   var cst_provide = "provide", w = [6, 0];
   function make_provide_frame(name, value, remaining, env){
    return [23, [0, cst_provide, env, name, 0, remaining, 0, 0, w, value, 0]];
   }
   var cst_bind = "bind";
   function make_bind_frame(body, env, prev_tracking){
    return [23, [0, cst_bind, env, 0, body, 0, 0, 0, 0, prev_tracking, 0]];
   }
   var cst_provide_set = "provide-set";
   function make_provide_set_frame(name, env){
    return [23, [0, cst_provide_set, env, name, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_scope_acc = "scope-acc", x = [6, 0];
   function make_scope_acc_frame(name, value, remaining, env){
    var value$0 = Sx_types[71].call(null, value) ? value : 0;
    return [23,
            [0, cst_scope_acc, env, name, 0, remaining, 0, 0, 0, value$0, x]];
   }
   var cst_reset = "reset";
   function make_reset_frame(env){
    return [23, [0, cst_reset, env, 0, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_dict = "dict";
   function make_dict_frame(remaining, results, env){
    return [23, [0, cst_dict, env, 0, 0, remaining, 0, 0, results, 0, 0]];
   }
   var cst_and = "and";
   function make_and_frame(remaining, env){
    return [23, [0, cst_and, env, 0, 0, remaining, 0, 0, 0, 0, 0]];
   }
   var cst_or = "or";
   function make_or_frame(remaining, env){
    return [23, [0, cst_or, env, 0, 0, remaining, 0, 0, 0, 0, 0]];
   }
   var cst_dynamic_wind = "dynamic-wind";
   function make_dynamic_wind_frame(phase, body_thunk, after_thunk, env){
    return [23,
            [0, cst_dynamic_wind, env, 0, 0, 0, after_thunk, 0, 0, phase, 0]];
   }
   var cst_reactive_reset = "reactive-reset";
   function make_reactive_reset_frame(env, update_fn, first_render_p){
    return [23,
            [0,
             cst_reactive_reset,
             env,
             0,
             0,
             0,
             0,
             0,
             0,
             update_fn,
             first_render_p]];
   }
   var cst_callcc = "callcc";
   function make_callcc_frame(env){
    return [23, [0, cst_callcc, env, 0, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_wind_after = "wind-after";
   function make_wind_after_frame(after_thunk, winders_len, env){
    return [23,
            [0,
             cst_wind_after,
             env,
             0,
             0,
             0,
             after_thunk,
             0,
             0,
             winders_len,
             0]];
   }
   var cst_wind_return = "wind-return";
   function make_wind_return_frame(body_result, env){
    return [23, [0, cst_wind_return, env, body_result, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_deref = "deref";
   function make_deref_frame(env){
    return [23, [0, cst_deref, env, 0, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_ho_setup = "ho-setup";
   function make_ho_setup_frame(ho_type, remaining_args, evaled_args, env){
    return [23,
            [0,
             cst_ho_setup,
             env,
             0,
             0,
             remaining_args,
             0,
             evaled_args,
             0,
             ho_type,
             0]];
   }
   var cst_comp_trace = "comp-trace";
   function make_comp_trace_frame(name, file){
    return [23, [0, cst_comp_trace, file, name, 0, 0, 0, 0, 0, 0, 0]];
   }
   var
    cst_file = "file",
    cst_name = "name",
    y = [6, 0],
    z = [0, [3, cst_comp_trace], 0],
    A = [3, cst_file],
    B = [3, cst_name];
   function kont_collect_comp_trace(kont$1){
    var kont = kont$1;
    for(;;){
     var a = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, a)) return y;
     var
      frame = Sx_runtime[15].call(null, kont),
      b = [0, frame_type(frame), z],
      c = Sx_runtime[2].call(null, cst, b);
     if(Sx_types[71].call(null, c)){
      var
       e = kont_collect_comp_trace(Sx_runtime[16].call(null, kont)),
       d = Stdlib_Hashtbl[1].call(null, 0, 2),
       f = Sx_runtime[26].call(null, frame, A);
      Stdlib_Hashtbl[11].call(null, d, cst_file, f);
      var g = Sx_runtime[26].call(null, frame, B);
      Stdlib_Hashtbl[11].call(null, d, cst_name, g);
      return Sx_runtime[19].call(null, [7, d], e);
     }
     var kont$0 = Sx_runtime[16].call(null, kont);
     kont = kont$0;
    }
   }
   var cst_handler = "handler";
   function make_handler_frame(handlers, remaining, env){
    return [23, [0, cst_handler, env, 0, 0, remaining, handlers, 0, 0, 0, 0]];
   }
   var cst_restart = "restart";
   function make_restart_frame(restarts, remaining, env){
    return [23, [0, cst_restart, env, 0, 0, remaining, restarts, 0, 0, 0, 0]];
   }
   var cst_signal_return = "signal-return";
   function make_signal_return_frame(env, saved_kont){
    return [23, [0, cst_signal_return, env, 0, 0, 0, saved_kont, 0, 0, 0, 0]];
   }
   var cst_raise_eval = "raise-eval";
   function make_raise_eval_frame(env, continuable_p){
    return [23, [0, cst_raise_eval, env, 0, 0, 0, 0, 0, 0, continuable_p, 0]];
   }
   var cst_raise_guard = "raise-guard";
   function make_raise_guard_frame(env, saved_kont){
    return [23, [0, cst_raise_guard, env, 0, 0, saved_kont, 0, 0, 0, 0, 0]];
   }
   var cst_perform = "perform";
   function make_perform_frame(env){
    return [23, [0, cst_perform, env, 0, 0, 0, 0, 0, 0, 0, 0]];
   }
   var cst_vm_resume = "vm-resume";
   function make_vm_resume_frame(resume_fn, env){
    return [23, [0, cst_vm_resume, env, 0, 0, 0, resume_fn, 0, 0, 0, 0]];
   }
   var cst_import = "import";
   function make_import_frame(import_set, remaining_sets, env){
    return [23,
            [0, cst_import, env, 0, 0, remaining_sets, 0, import_set, 0, 0, 0]];
   }
   var cst_parameterize = "parameterize";
   function make_parameterize_frame
   (remaining, current_param, results, body, env){
    return [23,
            [0,
             cst_parameterize,
             env,
             0,
             body,
             remaining,
             current_param,
             0,
             results,
             0,
             0]];
   }
   var C = [2, 1.];
   function find_matching_handler(handlers$1, condition){
    var handlers = handlers$1;
    for(;;){
     var a = Sx_runtime[34].call(null, handlers);
     if(Sx_types[71].call(null, a)) return 0;
     var
      pair = Sx_runtime[15].call(null, handlers),
      pred = Sx_runtime[15].call(null, pair),
      handler_fn = Sx_runtime[18].call(null, pair, C),
      b = cek_call(pred, [6, [0, condition, 0]]);
     if(Sx_types[71].call(null, b)) return handler_fn;
     var handlers$0 = Sx_runtime[16].call(null, handlers);
     handlers = handlers$0;
    }
   }
   var cst_f = "f", D = [0, [3, cst_handler], 0], E = [3, cst_f];
   function kont_find_handler(kont$2, condition){
    var kont = kont$2;
    for(;;){
     var a = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, a)) return 0;
     var
      frame = Sx_runtime[15].call(null, kont),
      b = [0, frame_type(frame), D],
      c = Sx_runtime[2].call(null, cst, b);
     if(Sx_types[71].call(null, c)){
      var
       match =
         find_matching_handler(Sx_runtime[26].call(null, frame, E), condition),
       d = Sx_runtime[84].call(null, match);
      if(! Sx_types[71].call(null, d)) return match;
      var kont$0 = Sx_runtime[16].call(null, kont);
      kont = kont$0;
     }
     else{var kont$1 = Sx_runtime[16].call(null, kont); kont = kont$1;}
    }
   }
   var
    cst$0 = ">",
    cst_after_thunk = "after-thunk",
    cst_winders_len = "winders-len",
    winders_ref = [],
    F = [0, [3, cst_handler], 0],
    G = [3, cst_f],
    H = [0, [3, cst_wind_after], 0],
    I = [3, cst_winders_len],
    J = [6, 0],
    K = [3, cst_after_thunk];
   function kont_unwind_to_handler(kont$0, condition){
    var kont = kont$0;
    for(;;){
     var a = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, a)){
      var d = Stdlib_Hashtbl[1].call(null, 0, 2);
      Stdlib_Hashtbl[11].call(null, d, cst_handler, 0);
      Stdlib_Hashtbl[11].call(null, d, cst_kont, kont);
      return [7, d];
     }
     var
      frame = Sx_runtime[15].call(null, kont),
      rest_k = Sx_runtime[16].call(null, kont),
      b = [0, frame_type(frame), F],
      c = Sx_runtime[2].call(null, cst, b);
     if(Sx_types[71].call(null, c)){
      var
       match =
         find_matching_handler(Sx_runtime[26].call(null, frame, G), condition),
       e = Sx_runtime[84].call(null, match);
      if(! Sx_types[71].call(null, e)){
       var d$0 = Stdlib_Hashtbl[1].call(null, 0, 2);
       Stdlib_Hashtbl[11].call(null, d$0, cst_handler, match);
       Stdlib_Hashtbl[11].call(null, d$0, cst_kont, kont);
       return [7, d$0];
      }
      kont = rest_k;
     }
     else{
      var f = [0, frame_type(frame), H], g = Sx_runtime[2].call(null, cst, f);
      if(Sx_types[71].call(null, g)){
       var
        h = [0, Sx_runtime[26].call(null, frame, I), 0],
        i = [0, Sx_runtime[25].call(null, winders_ref[1]), h],
        j = Sx_runtime[2].call(null, cst$0, i);
       if(Sx_types[71].call(null, j))
        winders_ref[1] = Sx_runtime[16].call(null, winders_ref[1]);
       cek_call(Sx_runtime[26].call(null, frame, K), J);
       kont = rest_k;
      }
      else
       kont = rest_k;
     }
    }
   }
   var L = [6, 0];
   function wind_escape_to(target_len){
    for(;;){
     var
      a = [0, Sx_runtime[25].call(null, winders_ref[1]), [0, target_len, 0]],
      b = Sx_runtime[2].call(null, cst$0, a);
     if(! Sx_types[71].call(null, b)) return 0;
     var after_thunk = Sx_runtime[15].call(null, winders_ref[1]);
     winders_ref[1] = Sx_runtime[16].call(null, winders_ref[1]);
     cek_call(after_thunk, L);
    }
   }
   function find_named_restart(restarts$1, name){
    var restarts = restarts$1;
    for(;;){
     var a = Sx_runtime[34].call(null, restarts);
     if(Sx_types[71].call(null, a)) return 0;
     var
      entry = Sx_runtime[15].call(null, restarts),
      b = [0, Sx_runtime[15].call(null, entry), [0, name, 0]],
      c = Sx_runtime[2].call(null, cst, b);
     if(Sx_types[71].call(null, c)) return entry;
     var restarts$0 = Sx_runtime[16].call(null, restarts);
     restarts = restarts$0;
    }
   }
   var M = [0, [3, cst_restart], 0], N = [3, cst_f];
   function kont_find_restart(kont$2, name){
    var kont = kont$2;
    for(;;){
     var a = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, a)) return 0;
     var
      frame = Sx_runtime[15].call(null, kont),
      b = [0, frame_type(frame), M],
      c = Sx_runtime[2].call(null, cst, b);
     if(Sx_types[71].call(null, c)){
      var
       match = find_named_restart(Sx_runtime[26].call(null, frame, N), name),
       d = Sx_runtime[84].call(null, match);
      if(! Sx_types[71].call(null, d))
       return [6,
               [0, match, [0, frame, [0, Sx_runtime[16].call(null, kont), 0]]]];
      var kont$0 = Sx_runtime[16].call(null, kont);
      kont = kont$0;
     }
     else{var kont$1 = Sx_runtime[16].call(null, kont); kont = kont$1;}
    }
   }
   var cst_type = "type", O = [3, cst_type];
   function frame_type(f){return Sx_runtime[26].call(null, f, O);}
   function kont_push(frame, kont){
    return Sx_runtime[19].call(null, frame, kont);
   }
   function kont_top(kont){return Sx_runtime[15].call(null, kont);}
   function kont_pop(kont){return Sx_runtime[16].call(null, kont);}
   function kont_empty_p(kont){return Sx_runtime[34].call(null, kont);}
   var
    captured = [6, 0],
    P = [3, "shift without enclosing reset"],
    Q = [0, [3, cst_reset], 0],
    R = [0, [3, cst_reactive_reset], 0];
   function kont_capture_to_reset(kont){
    var k = kont, captured$0 = captured;
    for(;;){
     var a = Sx_runtime[34].call(null, k);
     if(Sx_types[71].call(null, a)){
      var b = Sx_runtime[3].call(null, P);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
     }
     var
      frame = Sx_runtime[15].call(null, k),
      c = [0, frame_type(frame), Q],
      or = Sx_runtime[2].call(null, cst, c);
     if(Sx_types[71].call(null, or))
      var or$0 = or;
     else
      var
       d = [0, frame_type(frame), R],
       or$0 = Sx_runtime[2].call(null, cst, d);
     if(Sx_types[71].call(null, or$0))
      return [6, [0, captured$0, [0, Sx_runtime[16].call(null, k), 0]]];
     var
      captured$1 =
        Sx_runtime[2].call
         (null, cst_append, [0, captured$0, [0, [6, [0, frame, 0]], 0]]),
      k$0 = Sx_runtime[16].call(null, k);
     k = k$0;
     captured$0 = captured$1;
    }
   }
   var S = [6, 0], T = [2, 1.];
   function kont_push_provides(pairs$1, env, kont$1){
    var pairs = pairs$1, kont = kont$1;
    for(;;){
     var a = Sx_runtime[34].call(null, pairs);
     if(Sx_types[71].call(null, a)) return kont;
     var
      pair = Sx_runtime[15].call(null, pairs),
      b = Sx_runtime[18].call(null, pair, T),
      c = make_provide_frame(Sx_runtime[15].call(null, pair), b, S, env),
      kont$0 = Sx_runtime[19].call(null, c, kont),
      pairs$0 = Sx_runtime[16].call(null, pairs);
     pairs = pairs$0;
     kont = kont$0;
    }
   }
   var U = [0, [3, cst_provide], 0], V = [3, cst_name];
   function kont_find_provide(kont$1, name){
    var kont = kont$1;
    for(;;){
     var b = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, b)) return 0;
     var
      frame = Sx_runtime[15].call(null, kont),
      c = [0, frame_type(frame), U],
      and = Sx_runtime[2].call(null, cst, c);
     if(Sx_types[71].call(null, and))
      var
       d = [0, Sx_runtime[26].call(null, frame, V), [0, name, 0]],
       a = Sx_runtime[2].call(null, cst, d);
     else
      var a = and;
     if(Sx_types[71].call(null, a)) return frame;
     var kont$0 = Sx_runtime[16].call(null, kont);
     kont = kont$0;
    }
   }
   var W = [0, [3, cst_scope_acc], 0], X = [3, cst_name];
   function kont_find_scope_acc(kont$1, name){
    var kont = kont$1;
    for(;;){
     var b = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, b)) return 0;
     var
      frame = Sx_runtime[15].call(null, kont),
      c = [0, frame_type(frame), W],
      and = Sx_runtime[2].call(null, cst, c);
     if(Sx_types[71].call(null, and))
      var
       d = [0, Sx_runtime[26].call(null, frame, X), [0, name, 0]],
       a = Sx_runtime[2].call(null, cst, d);
     else
      var a = and;
     if(Sx_types[71].call(null, a)) return frame;
     var kont$0 = Sx_runtime[16].call(null, kont);
     kont = kont$0;
    }
   }
   var Y = [0, 0], Z = [0, [3, cst_reactive_reset], 0], _ = [0, 1];
   function has_reactive_reset_frame_p(kont$1){
    var kont = kont$1;
    for(;;){
     var a = Sx_runtime[34].call(null, kont);
     if(Sx_types[71].call(null, a)) return Y;
     var
      b = [0, frame_type(Sx_runtime[15].call(null, kont)), Z],
      c = Sx_runtime[2].call(null, cst, b);
     if(Sx_types[71].call(null, c)) return _;
     var kont$0 = Sx_runtime[16].call(null, kont);
     kont = kont$0;
    }
   }
   var
    captured$0 = [6, 0],
    $ = [3, "reactive deref without enclosing reactive-reset"],
    aa = [0, [3, cst_reactive_reset], 0];
   function kont_capture_to_reactive_reset(kont){
    var k = kont, captured = captured$0;
    for(;;){
     var a = Sx_runtime[34].call(null, k);
     if(Sx_types[71].call(null, a)){
      var b = Sx_runtime[3].call(null, $);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
     }
     var
      frame = Sx_runtime[15].call(null, k),
      c = [0, frame_type(frame), aa],
      d = Sx_runtime[2].call(null, cst, c);
     if(Sx_types[71].call(null, d))
      return [6,
              [0, captured, [0, frame, [0, Sx_runtime[16].call(null, k), 0]]]];
     var
      captured$1 =
        Sx_runtime[2].call
         (null, cst_append, [0, captured, [0, [6, [0, frame, 0]], 0]]),
      k$0 = Sx_runtime[16].call(null, k);
     k = k$0;
     captured = captured$1;
    }
   }
   var custom_special_forms = [];
   function register_special_form(name, handler){
    return Sx_runtime[12].call(null, custom_special_forms, name, handler);
   }
   var cst$1 = ".", cst_join = "join", ab = [3, cst$1];
   function library_name_key(spec){
    var
     a = Sx_runtime[6].call(null, spec),
     b =
       [0,
        ab,
        [0,
         [6,
          Stdlib_List[20].call
           (null,
            function(s){
             var a = Sx_runtime[40].call(null, s);
             return Sx_types[71].call(null, a)
                     ? Sx_types[72].call(null, s)
                     : [3, Sx_runtime[5].call(null, [0, s, 0])];
            },
            a)],
         0]];
    return Sx_runtime[2].call(null, cst_join, b);
   }
   var cst_has_key = "has-key?", library_registry = [];
   function library_loaded_p(spec){
    var a = [0, library_registry, [0, library_name_key(spec), 0]];
    return Sx_runtime[2].call(null, cst_has_key, a);
   }
   var cst_exports = "exports", ac = [3, cst_exports];
   function library_exports(spec){
    var
     a = library_name_key(spec),
     entry = Sx_runtime[26].call(null, library_registry, a);
    return Sx_types[71].call(null, entry)
            ? Sx_runtime[26].call(null, entry, ac)
            : [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
   }
   function register_library(spec, exports){
    var d = Stdlib_Hashtbl[1].call(null, 0, 1);
    Stdlib_Hashtbl[11].call(null, d, cst_exports, exports);
    var a = library_name_key(spec);
    return Sx_runtime[12].call(null, library_registry, a, [7, d]);
   }
   var io_registry = [];
   function io_register_b(name, spec){
    return Sx_runtime[12].call(null, io_registry, name, spec);
   }
   function io_registered_p(name){
    return Sx_runtime[2].call
            (null, cst_has_key, [0, io_registry, [0, name, 0]]);
   }
   function io_lookup(name){
    return Sx_runtime[26].call(null, io_registry, name);
   }
   var cst_keys = "keys";
   function io_names(param){
    return Sx_runtime[2].call(null, cst_keys, [0, io_registry, 0]);
   }
   var foreign_registry = [];
   function foreign_register_b(name, spec){
    return Sx_runtime[12].call(null, foreign_registry, name, spec);
   }
   function foreign_registered_p(name){
    return Sx_runtime[2].call
            (null, cst_has_key, [0, foreign_registry, [0, name, 0]]);
   }
   function foreign_lookup(name){
    return Sx_runtime[26].call(null, foreign_registry, name);
   }
   function foreign_names(param){
    return Sx_runtime[2].call(null, cst_keys, [0, foreign_registry, 0]);
   }
   var result = [6, 0], ad = [6, 0];
   function foreign_parse_params(param_list){
    var
     a = Sx_runtime[38].call(null, param_list),
     items = Sx_types[71].call(null, a) ? param_list : ad;
    return foreign_parse_params_loop(items, result);
   }
   var cst$2 = ">=", ae = [0, [2, 2.], 0], af = [2, 1.];
   function foreign_parse_kwargs_b(spec, remaining$1){
    var remaining = remaining$1;
    for(;;){
     var
      b = Sx_runtime[34].call(null, remaining),
      and = [0, 1 - Sx_types[71].call(null, b)];
     if(Sx_types[71].call(null, and)){
      var
       c = [0, Sx_runtime[25].call(null, remaining), ae],
       and$0 = Sx_runtime[2].call(null, cst$2, c);
      if(Sx_types[71].call(null, and$0))
       var
        d = Sx_runtime[15].call(null, remaining),
        a = Sx_runtime[33].call(null, d);
      else
       var a = and$0;
     }
     else
      var a = and;
     if(! Sx_types[71].call(null, a)) return 0;
     var
      v = Sx_runtime[18].call(null, remaining, af),
      e = Sx_runtime[33].call(null, v),
      f = Sx_types[71].call(null, e) ? Sx_types[73].call(null, v) : v,
      g = Sx_runtime[15].call(null, remaining),
      h = Sx_types[73].call(null, g);
     Sx_runtime[12].call(null, spec, h, f);
     var
      i = Sx_runtime[16].call(null, remaining),
      remaining$0 = Sx_runtime[16].call(null, i);
     remaining = remaining$0;
    }
   }
   var
    cst_method = "method",
    cst_object = "object",
    ag = [0, [3, cst$1], 0],
    ah = [0, [2, 1.], 0],
    ai = [3, cst$1];
   function foreign_resolve_binding(binding_str){
    var
     parts = Sx_runtime[2].call(null, "split", [0, binding_str, ag]),
     a = [0, Sx_runtime[25].call(null, parts), ah],
     b = Sx_runtime[2].call(null, "<=", a);
    if(Sx_types[71].call(null, b)){
     var d = Stdlib_Hashtbl[1].call(null, 0, 2);
     Stdlib_Hashtbl[11].call(null, d, cst_method, binding_str);
     Stdlib_Hashtbl[11].call(null, d, cst_object, 0);
     return [7, d];
    }
    var
     method = Sx_runtime[17].call(null, parts),
     c = Sx_runtime[21].call(null, parts),
     e = Sx_runtime[16].call(null, c),
     f = [0, ai, [0, Sx_runtime[21].call(null, e), 0]],
     obj = Sx_runtime[2].call(null, cst_join, f),
     d$0 = Stdlib_Hashtbl[1].call(null, 0, 2);
    Stdlib_Hashtbl[11].call(null, d$0, cst_method, method);
    Stdlib_Hashtbl[11].call(null, d$0, cst_object, obj);
    return [7, d$0];
   }
   var
    cst_args_got = " args, got ",
    cst_got = ", got ",
    cst_expected = ": expected ",
    cst$3 = "<",
    cst_any = "any",
    cst_foreign = "foreign ",
    cst_range = "range",
    aj = [3, cst_args_got],
    ak = [3, cst_expected],
    al = [3, cst_foreign],
    am = [2, 0.],
    an = [3, cst_type],
    ao = [0, [3, cst_any], 0],
    ap = [3, cst_got],
    aq = [3, "' expected "],
    ar = [3, cst_name],
    as = [3, ": arg '"],
    at = [3, cst_foreign];
   function foreign_check_args(name, params, args){
    var
     b = Sx_runtime[34].call(null, params),
     and = [0, 1 - Sx_types[71].call(null, b)];
    if(Sx_types[71].call(null, and))
     var
      c = [0, Sx_runtime[25].call(null, params), 0],
      d = [0, Sx_runtime[25].call(null, args), c],
      a = Sx_runtime[2].call(null, cst$3, d);
    else
     var a = and;
    if(Sx_types[71].call(null, a)){
     var
      e = [0, aj, [0, Sx_runtime[25].call(null, args), 0]],
      f =
        [0, al, [0, name, [0, ak, [0, Sx_runtime[25].call(null, params), e]]]],
      g = [3, Sx_runtime[5].call(null, f)],
      h = Sx_runtime[3].call(null, g);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
    }
    var
     i = [0, Sx_runtime[25].call(null, args), 0],
     j = [0, Sx_runtime[25].call(null, params), i],
     k = [0, am, [0, Sx_runtime[2].call(null, "min", j), 0]],
     l = Sx_runtime[2].call(null, cst_range, k),
     m = Sx_runtime[6].call(null, l);
    Stdlib_List[18].call
     (null,
      function(i){
       var
        spec = Sx_runtime[18].call(null, params, i),
        val = Sx_runtime[18].call(null, args, i),
        expected = Sx_runtime[26].call(null, spec, an),
        b = Sx_runtime[2].call(null, cst, [0, expected, ao]),
        and = [0, 1 - Sx_types[71].call(null, b)];
       if(Sx_types[71].call(null, and))
        var
         c = value_matches_type_p(val, expected),
         a = [0, 1 - Sx_types[71].call(null, c)];
       else
        var a = and;
       if(! Sx_types[71].call(null, a)) return 0;
       var
        d =
          [0,
           aq,
           [0, expected, [0, ap, [0, Sx_runtime[74].call(null, val), 0]]]],
        e =
          [0,
           at,
           [0, name, [0, as, [0, Sx_runtime[26].call(null, spec, ar), d]]]],
        f = [3, Sx_runtime[5].call(null, e)],
        g = Sx_runtime[3].call(null, f);
       throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
      },
      m);
    return 0;
   }
   var
    cst_rest = "&rest",
    cst_ffi_args = "__ffi-args__",
    cst_async = "async",
    cst_fn = "fn",
    cst_foreign_dispatch = "foreign-dispatch",
    cst_returns = "returns",
    cst_sync = "sync",
    au = [3, cst_name],
    av = [0, [3, cst_returns], 0],
    aw = [3, cst_returns],
    ax = [0, [3, "promise"], 0],
    ay = [3, cst_async],
    az = [0, [3, cst_async], 0],
    aA = [0, [4, cst_ffi_args], 0],
    aB = [4, cst_quote],
    aC = [4, cst_foreign_dispatch],
    aD = [4, cst_perform],
    aE = [6, [0, [4, cst_rest], [0, [4, cst_ffi_args], 0]]],
    aF = [4, cst_fn],
    aG = [0, [4, cst_ffi_args], 0],
    aH = [4, cst_quote],
    aI = [4, cst_foreign_dispatch],
    aJ = [6, [0, [4, cst_rest], [0, [4, cst_ffi_args], 0]]],
    aK = [4, cst_fn],
    aL = [3, cst_sync],
    aM = [3, cst_sync];
   function foreign_build_lambda(spec){
    var
     name = Sx_runtime[26].call(null, spec, au),
     a = Sx_runtime[2].call(null, cst_has_key, [0, spec, av]);
    if(Sx_types[71].call(null, a))
     var
      r = Sx_runtime[26].call(null, spec, aw),
      b = Sx_runtime[2].call(null, cst, [0, r, ax]),
      mode = Sx_types[71].call(null, b) ? ay : aL;
    else
     var mode = aM;
    var c = Sx_runtime[2].call(null, cst, [0, mode, az]);
    return Sx_types[71].call(null, c)
            ? [6,
              [0,
               aF,
               [0,
                aE,
                [0,
                 [6,
                  [0,
                   aD,
                   [0, [6, [0, aC, [0, [6, [0, aB, [0, name, 0]]], aA]]], 0]]],
                 0]]]]
            : [6,
              [0,
               aK,
               [0,
                aJ,
                [0, [6, [0, aI, [0, [6, [0, aH, [0, name, 0]]], aG]]], 0]]]];
   }
   var
    cst_params = "params",
    aN = [2, 1.],
    aO = [3, cst_name],
    aP = [3, cst_params];
   function sf_define_foreign(args, env){
    var a = Sx_runtime[15].call(null, args), b = Sx_runtime[40].call(null, a);
    if(Sx_types[71].call(null, b))
     var
      c = Sx_runtime[15].call(null, args),
      name = Sx_types[72].call(null, c);
    else
     var name = Sx_runtime[15].call(null, args);
    var
     param_list = Sx_runtime[18].call(null, args, aN),
     spec = [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
    Sx_runtime[12].call(null, spec, aO, name);
    var d = foreign_parse_params(param_list);
    Sx_runtime[12].call(null, spec, aP, d);
    var e = Sx_runtime[16].call(null, args);
    foreign_parse_kwargs_b(spec, Sx_runtime[16].call(null, e));
    foreign_register_b(name, spec);
    return spec;
   }
   function step_sf_define_foreign(args, env, kont){
    var
     spec = sf_define_foreign(args, env),
     a = Sx_runtime[15].call(null, args),
     b = Sx_runtime[40].call(null, a);
    if(Sx_types[71].call(null, b))
     var
      c = Sx_runtime[15].call(null, args),
      name = Sx_types[72].call(null, c);
    else
     var name = Sx_runtime[15].call(null, args);
    var lambda_expr = foreign_build_lambda(spec);
    return make_cek_state
            (lambda_expr,
             env,
             kont_push(make_define_foreign_frame(name, spec, env), kont));
   }
   var
    cst_concat = "concat",
    cst_host_call = "host-call",
    aQ = [0, [3, "'"], 0],
    aR = [3, "foreign-dispatch: unknown foreign function '"],
    aS = [3, cst_params],
    aT = [3, "js"],
    aU = [6, 0],
    aV = [0, [3, ": no binding for current platform"], 0],
    aW = [3, cst_foreign],
    aX = [3, cst_object],
    aY = [3, cst_method],
    aZ = [3, cst_host_call],
    a0 = [3, cst_host_call],
    a1 = [3, "host-global"],
    a2 = [3, cst_host_call],
    a3 = [0, [3, ": host-call not available on this platform"], 0],
    a4 = [3, cst_foreign];
   function foreign_dispatch(name, args){
    var spec = foreign_lookup(name), a = Sx_runtime[84].call(null, spec);
    if(Sx_types[71].call(null, a)){
     var
      b = [3, Sx_runtime[5].call(null, [0, aR, [0, name, aQ]])],
      c = Sx_runtime[3].call(null, b);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
    }
    var
     params = Sx_runtime[26].call(null, spec, aS),
     binding = Sx_runtime[26].call(null, spec, aT),
     d = Sx_runtime[84].call(null, params),
     e = Sx_types[71].call(null, d) ? aU : params;
    foreign_check_args(name, e, args);
    var f = Sx_runtime[84].call(null, binding);
    if(Sx_types[71].call(null, f)){
     var
      g = [3, Sx_runtime[5].call(null, [0, aW, [0, name, aV]])],
      h = Sx_runtime[3].call(null, g);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
    }
    var
     resolved = foreign_resolve_binding(binding),
     obj_name = Sx_runtime[26].call(null, resolved, aX),
     method = Sx_runtime[26].call(null, resolved, aY),
     i = Sx_runtime[92].call(null, aZ);
    if(! Sx_types[71].call(null, i)){
     var
      o = [3, Sx_runtime[5].call(null, [0, a4, [0, name, a3]])],
      p = Sx_runtime[3].call(null, o);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], p], 1);
    }
    var j = Sx_runtime[84].call(null, obj_name);
    if(Sx_types[71].call(null, j)){
     var
      k =
        Sx_runtime[2].call
         (null, cst_concat, [0, [6, [0, 0, [0, method, 0]]], [0, args, 0]]),
      l = Sx_runtime[93].call(null, a0);
     return Sx_runtime[8].call(null, l, k);
    }
    var
     obj = cek_call(Sx_runtime[93].call(null, a1), [6, [0, obj_name, 0]]),
     m =
       Sx_runtime[2].call
        (null, cst_concat, [0, [6, [0, obj, [0, method, 0]]], [0, args, 0]]),
     n = Sx_runtime[93].call(null, a2);
    return Sx_runtime[8].call(null, n, m);
   }
   var
    cst_as = "as",
    a5 = [0, [3, cst_as], 0],
    a6 = [0, [2, 2.], 0],
    a7 = [2, 1.];
   function foreign_parse_params_loop(items$1, acc$2){
    var items = items$1, acc = acc$2;
    for(;;){
     var b = Sx_runtime[34].call(null, items);
     if(Sx_types[71].call(null, b)) return acc;
     var
      item = Sx_runtime[15].call(null, items),
      rest_items = Sx_runtime[16].call(null, items),
      c = Sx_runtime[34].call(null, rest_items),
      and = [0, 1 - Sx_types[71].call(null, c)];
     if(Sx_types[71].call(null, and)){
      var
       e = Sx_runtime[15].call(null, rest_items),
       and$0 = Sx_runtime[33].call(null, e);
      if(Sx_types[71].call(null, and$0)){
       var
        f = Sx_runtime[15].call(null, rest_items),
        g = [0, Sx_types[73].call(null, f), a5],
        and$1 = Sx_runtime[2].call(null, cst, g);
       if(Sx_types[71].call(null, and$1))
        var
         h = [0, Sx_runtime[25].call(null, rest_items), a6],
         a = Sx_runtime[2].call(null, cst$2, h);
       else
        var a = and$1;
      }
      else
       var a = and$0;
     }
     else
      var a = and;
     if(Sx_types[71].call(null, a)){
      var
       d = Stdlib_Hashtbl[1].call(null, 0, 2),
       t = Sx_runtime[18].call(null, rest_items, a7),
       i = Sx_runtime[33].call(null, t),
       j =
         Sx_types[71].call(null, i)
          ? Sx_types[73].call(null, t)
          : [3, Sx_runtime[5].call(null, [0, t, 0])];
      Stdlib_Hashtbl[11].call(null, d, cst_type, j);
      var
       k = Sx_runtime[40].call(null, item),
       l =
         Sx_types[71].call(null, k)
          ? Sx_types[72].call(null, item)
          : [3, Sx_runtime[5].call(null, [0, item, 0])];
      Stdlib_Hashtbl[11].call(null, d, cst_name, l);
      var
       acc$0 =
         Sx_runtime[2].call
          (null, cst_append, [0, acc, [0, [6, [0, [7, d], 0]], 0]]),
       m = Sx_runtime[16].call(null, rest_items),
       items$0 = Sx_runtime[16].call(null, m);
      items = items$0;
      acc = acc$0;
     }
     else{
      var
       n = Sx_runtime[40].call(null, item),
       o =
         Sx_types[71].call(null, n)
          ? Sx_types[72].call(null, item)
          : [3, Sx_runtime[5].call(null, [0, item, 0])],
       acc$1 =
         Sx_runtime[2].call
          (null,
           cst_append,
           [0,
            acc,
            [0, [6, [0, [23, [0, cst_any, 0, o, 0, 0, 0, 0, 0, 0, 0]], 0]], 0]]);
      items = rest_items;
      acc = acc$1;
     }
    }
   }
   var
    cst_args = "args",
    cst_op = "op",
    a8 = [0, [3, "' \xe2\x80\x94 not in *io-registry*"], 0],
    a9 = [3, "io: unknown operation '"],
    a_ = [4, cst_perform];
   function step_sf_io(args, env, kont){
    var
     name = Sx_runtime[15].call(null, args),
     io_args = Sx_runtime[16].call(null, args),
     a = io_registered_p(name),
     b = [0, 1 - Sx_types[71].call(null, a)];
    if(Sx_types[71].call(null, b)){
     var
      c = [3, Sx_runtime[5].call(null, [0, a9, [0, name, a8]])],
      e = Sx_runtime[3].call(null, c);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
    }
    var d = Stdlib_Hashtbl[1].call(null, 0, 2);
    Stdlib_Hashtbl[11].call(null, d, cst_args, io_args);
    Stdlib_Hashtbl[11].call(null, d, cst_op, name);
    return make_cek_state
            (Sx_runtime[19].call(null, a_, [6, [0, [7, d], 0]]), env, kont);
   }
   var strict_ref = [];
   function set_strict_b(val){strict_ref[1] = val; return 0;}
   var prim_param_types_ref = [];
   function set_prim_param_types_b(types){
    prim_param_types_ref[1] = types;
    return 0;
   }
   var
    cst$5 = "-",
    cst$4 = "?",
    cst_boolean = "boolean",
    cst_ends_with = "ends-with?",
    cst_keyword = "keyword",
    cst_lambda = "lambda",
    cst_nil = "nil",
    cst_number = "number",
    cst_slice = "slice",
    cst_string = "string",
    cst_symbol = "symbol",
    a$ = [0, [3, cst_any], 0],
    ba = [0, 1],
    bb = [0, [3, cst_number], 0],
    bc = [0, [3, cst_string], 0],
    bd = [0, [3, cst_boolean], 0],
    be = [0, [3, cst_nil], 0],
    bf = [0, [3, cst_list], 0],
    bg = [0, [3, cst_dict], 0],
    bh = [0, [3, cst_lambda], 0],
    bi = [0, [3, cst_symbol], 0],
    bj = [0, [3, cst_symbol], 0],
    bk = [0, [3, cst_keyword], 0],
    bl = [0, [3, cst_keyword], 0],
    bm = [0, [3, cst$4], 0],
    bn = [0, [2, 1.], 0],
    bo = [2, 0.],
    bp = [0, 1];
   function value_matches_type_p(val, expected_type$1){
    var expected_type = expected_type$1;
    for(;;){
     var a = Sx_runtime[2].call(null, cst, [0, expected_type, a$]);
     if(Sx_types[71].call(null, a)) return ba;
     var b = Sx_runtime[2].call(null, cst, [0, expected_type, bb]);
     if(Sx_types[71].call(null, b)) return Sx_runtime[35].call(null, val);
     var c = Sx_runtime[2].call(null, cst, [0, expected_type, bc]);
     if(Sx_types[71].call(null, c)) return Sx_runtime[36].call(null, val);
     var d = Sx_runtime[2].call(null, cst, [0, expected_type, bd]);
     if(Sx_types[71].call(null, d)) return Sx_runtime[37].call(null, val);
     var e = Sx_runtime[2].call(null, cst, [0, expected_type, be]);
     if(Sx_types[71].call(null, e)) return Sx_runtime[84].call(null, val);
     var f = Sx_runtime[2].call(null, cst, [0, expected_type, bf]);
     if(Sx_types[71].call(null, f)) return Sx_runtime[38].call(null, val);
     var g = Sx_runtime[2].call(null, cst, [0, expected_type, bg]);
     if(Sx_types[71].call(null, g)) return Sx_runtime[39].call(null, val);
     var h = Sx_runtime[2].call(null, cst, [0, expected_type, bh]);
     if(Sx_types[71].call(null, h)) return Sx_runtime[86].call(null, val);
     var i = Sx_runtime[2].call(null, cst, [0, expected_type, bi]);
     if(Sx_types[71].call(null, i)){
      var j = [0, Sx_runtime[74].call(null, val), bj];
      return Sx_runtime[2].call(null, cst, j);
     }
     var k = Sx_runtime[2].call(null, cst, [0, expected_type, bk]);
     if(Sx_types[71].call(null, k)){
      var l = [0, Sx_runtime[74].call(null, val), bl];
      return Sx_runtime[2].call(null, cst, l);
     }
     var
      and = Sx_runtime[36].call(null, expected_type),
      m =
        Sx_types[71].call(null, and)
         ? Sx_runtime[2].call(null, cst_ends_with, [0, expected_type, bm])
         : and;
     if(! Sx_types[71].call(null, m)) return bp;
     var or = Sx_runtime[84].call(null, val);
     if(Sx_types[71].call(null, or)) return or;
     var
      n =
        [0,
         Sx_runtime[2].call(null, "string-length", [0, expected_type, 0]),
         bn],
      o =
        [0,
         expected_type,
         [0, bo, [0, Sx_runtime[2].call(null, cst$5, n), 0]]],
      expected_type$0 = Sx_runtime[2].call(null, cst_slice, o);
     expected_type = expected_type$0;
    }
   }
   var
    cst$7 = " (",
    cst_expected$0 = " expected ",
    cst$6 = ")",
    cst_Type_error = "Type error: ",
    bq = [3, "positional"],
    br = [3, "rest-type"],
    bs = [2, 1.],
    bt = [2, 1.],
    bu = [0, [3, cst$6], 0],
    bv = [3, cst$7],
    bw = [3, cst_got],
    bx = [3, " for param "],
    by = [3, cst_expected$0],
    bz = [3, cst_Type_error],
    bA = [2, 1.],
    bB = [0, [3, cst$6], 0],
    bC = [3, cst$7],
    bD = [3, cst_got],
    bE = [3, " for rest arg "],
    bF = [3, cst_expected$0],
    bG = [3, cst_Type_error],
    bH = [6, 0],
    bI = [6, 0];
   function strict_check_args(name, args){
    var
     and = strict_ref[1],
     b = Sx_types[71].call(null, and) ? prim_param_types_ref[1] : and;
    if(! Sx_types[71].call(null, b)) return 0;
    var spec = Sx_runtime[26].call(null, prim_param_types_ref[1], name);
    if(! Sx_types[71].call(null, spec)) return 0;
    var
     positional = Sx_runtime[26].call(null, spec, bq),
     rest_type = Sx_runtime[26].call(null, spec, br);
    if(Sx_types[71].call(null, positional)){
     var
      c = Sx_runtime[6].call(null, positional),
      d =
        [6,
         Stdlib_List[21].call
          (null,
           function(i, p){var i$0 = [2, i]; return [6, [0, i$0, [0, p, 0]]];},
           c)],
      e = Sx_runtime[6].call(null, d);
     Stdlib_List[18].call
      (null,
       function(pair){
        var
         idx = Sx_runtime[15].call(null, pair),
         param = Sx_runtime[18].call(null, pair, bs),
         p_name = Sx_runtime[15].call(null, param),
         p_type = Sx_runtime[18].call(null, param, bt),
         a = [0, idx, [0, Sx_runtime[25].call(null, args), 0]],
         b = Sx_runtime[2].call(null, cst$3, a);
        if(Sx_types[71].call(null, b)){
         var
          val = Sx_runtime[18].call(null, args, idx),
          c = value_matches_type_p(val, p_type),
          d = [0, 1 - Sx_types[71].call(null, c)];
         if(Sx_types[71].call(null, d)){
          var
           e = [0, bv, [0, [3, Sx_runtime[5].call(null, [0, val, 0])], bu]],
           f =
             [0,
              bz,
              [0,
               name,
               [0,
                by,
                [0,
                 p_type,
                 [0,
                  bx,
                  [0, p_name, [0, bw, [0, Sx_runtime[74].call(null, val), e]]]]]]]],
           g = [3, Sx_runtime[5].call(null, f)],
           h = Sx_runtime[3].call(null, g);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
         }
        }
        return 0;
       },
       e);
    }
    if(Sx_types[71].call(null, rest_type))
     var
      positional$0 = Sx_types[71].call(null, positional) ? positional : bI,
      f = [0, Sx_runtime[25].call(null, positional$0), 0],
      g = [0, Sx_runtime[25].call(null, args), f],
      a = Sx_runtime[2].call(null, cst$0, g);
    else
     var a = rest_type;
    if(! Sx_types[71].call(null, a)) return 0;
    var
     positional$1 = Sx_types[71].call(null, positional) ? positional : bH,
     h = [0, args, [0, Sx_runtime[25].call(null, positional$1), 0]],
     i = Sx_runtime[2].call(null, cst_slice, h),
     j = Sx_runtime[6].call(null, i),
     k =
       [6,
        Stdlib_List[21].call
         (null,
          function(i, v){var i$0 = [2, i]; return [6, [0, i$0, [0, v, 0]]];},
          j)],
     l = Sx_runtime[6].call(null, k);
    Stdlib_List[18].call
     (null,
      function(pair){
       var
        idx = Sx_runtime[15].call(null, pair),
        val = Sx_runtime[18].call(null, pair, bA),
        a = value_matches_type_p(val, rest_type),
        b = [0, 1 - Sx_types[71].call(null, a)];
       if(! Sx_types[71].call(null, b)) return 0;
       var
        c = [0, bC, [0, [3, Sx_runtime[5].call(null, [0, val, 0])], bB]],
        d =
          [0,
           bG,
           [0,
            name,
            [0,
             bF,
             [0,
              rest_type,
              [0,
               bE,
               [0, idx, [0, bD, [0, Sx_runtime[74].call(null, val), c]]]]]]]],
        e = [3, Sx_runtime[5].call(null, d)],
        f = Sx_runtime[3].call(null, e);
       throw caml_maybe_attach_backtrace([0, Sx_types[9], f], 1);
      },
      l);
    return 0;
   }
   var
    cst$9 = "\xce\xbb",
    cst$8 = "+",
    cst_index_of = "index-of",
    bJ = [0, [3, cst_rest], 0],
    bK = [2, 0.],
    bL = [0, [2, 1.], 0],
    bM = [0, 1],
    bN = [6, 0],
    bO = [0, 0];
   function bind_lambda_params(params, args, local){
    var
     rest_idx = Sx_runtime[2].call(null, cst_index_of, [0, params, bJ]),
     and = Sx_runtime[35].call(null, rest_idx);
    if(Sx_types[71].call(null, and))
     var
      b = [0, rest_idx, [0, Sx_runtime[25].call(null, params), 0]],
      a = Sx_runtime[2].call(null, cst$3, b);
    else
     var a = and;
    if(! Sx_types[71].call(null, a)) return bO;
    var
     positional =
       Sx_runtime[2].call
        (null, cst_slice, [0, params, [0, bK, [0, rest_idx, 0]]]),
     c = Sx_runtime[2].call(null, cst$8, [0, rest_idx, bL]),
     rest_name = Sx_runtime[18].call(null, params, c);
    Sx_runtime[94].call
     (null,
      [15,
       cst$9,
       function(args$0){
        if(args$0){
         var a = args$0[2];
         if(a && ! a[2]){
          var
           p = a[1],
           i = args$0[1],
           b = [0, i, [0, Sx_runtime[25].call(null, args), 0]],
           c = Sx_runtime[2].call(null, cst$3, b),
           d =
             Sx_types[71].call(null, c)
              ? Sx_runtime[18].call(null, args, i)
              : 0,
           e = Sx_runtime[4].call(null, p);
          return Sx_runtime[78].call(null, local, e, d);
         }
        }
        return 0;
       }],
      positional);
    var
     d = [0, Sx_runtime[25].call(null, args), [0, rest_idx, 0]],
     e = Sx_runtime[2].call(null, cst$0, d),
     f =
       Sx_types[71].call(null, e)
        ? Sx_runtime[2].call(null, cst_slice, [0, args, [0, rest_idx, 0]])
        : bN,
     g = Sx_runtime[4].call(null, rest_name);
    Sx_runtime[78].call(null, local, g, f);
    return bM;
   }
   var
    cst_expects = " expects ",
    cst_zip = "zip",
    bP = [3, cst_args_got],
    bQ = [3, cst_expects],
    bR = [3, cst_lambda],
    bS = [2, 1.];
   function call_lambda(f, args, caller_env){
    var
     params = Sx_types[74].call(null, f),
     a = Sx_types[76].call(null, f),
     local = Sx_runtime[82].call(null, a, caller_env),
     b = bind_lambda_params(params, args, local),
     c = [0, 1 - Sx_types[71].call(null, b)];
    if(Sx_types[71].call(null, c)){
     var
      d = [0, Sx_runtime[25].call(null, params), 0],
      e = [0, Sx_runtime[25].call(null, args), d],
      g = Sx_runtime[2].call(null, cst$0, e);
     if(Sx_types[71].call(null, g)){
      var
       h = [0, bP, [0, Sx_runtime[25].call(null, args), 0]],
       i = [0, bQ, [0, Sx_runtime[25].call(null, params), h]],
       or = Sx_types[77].call(null, f),
       or$0 = Sx_types[71].call(null, or) ? or : bR,
       j = [3, Sx_runtime[5].call(null, [0, or$0, i])],
       k = Sx_runtime[3].call(null, j);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], k], 1);
     }
     var
      l = Sx_runtime[2].call(null, cst_zip, [0, params, [0, args, 0]]),
      m = Sx_runtime[6].call(null, l);
     Stdlib_List[18].call
      (null,
       function(pair){
        var
         a = Sx_runtime[18].call(null, pair, bS),
         b = Sx_runtime[15].call(null, pair),
         c = Sx_runtime[4].call(null, b);
        Sx_runtime[78].call(null, local, c, a);
        return 0;
       },
       m);
     var
      n = [0, params, [0, Sx_runtime[25].call(null, args), 0]],
      o = Sx_runtime[2].call(null, cst_slice, n),
      p = Sx_runtime[6].call(null, o);
     Stdlib_List[18].call
      (null,
       function(p){
        var a = Sx_runtime[4].call(null, p);
        Sx_runtime[78].call(null, local, a, 0);
        return 0;
       },
       p);
    }
    var q = Sx_types[75].call(null, f);
    return Sx_types[58].call(null, q, local);
   }
   var cst_children = "children", bT = [2, 1.], bU = [3, cst_children];
   function call_component(comp, raw_args, env){
    var
     parsed = parse_keyword_args(raw_args, env),
     kwargs = Sx_runtime[15].call(null, parsed),
     children = Sx_runtime[18].call(null, parsed, bT),
     a = Sx_types[85].call(null, comp),
     local = Sx_runtime[82].call(null, a, env),
     b = Sx_types[83].call(null, comp),
     c = Sx_runtime[6].call(null, b);
    Stdlib_List[18].call
     (null,
      function(p){
       var
        or = Sx_runtime[57].call(null, kwargs, p),
        or$0 = Sx_types[71].call(null, or) ? or : 0,
        a = Sx_runtime[4].call(null, p);
       Sx_runtime[78].call(null, local, a, or$0);
       return 0;
      },
      c);
    var d = Sx_types[86].call(null, comp);
    if(Sx_types[71].call(null, d)){
     var e = Sx_runtime[4].call(null, bU);
     Sx_runtime[78].call(null, local, e, children);
    }
    var f = Sx_types[84].call(null, comp);
    return Sx_types[58].call(null, f, local);
   }
   var
    cst_assoc = "assoc",
    cst_i = "i",
    cst_inc = "inc",
    cst_skip = "skip",
    bV = [6, 0],
    bW = [2, 0.],
    bX = [3, cst_i],
    bY = [0, 0],
    bZ = [3, cst_skip],
    b0 = [3, cst_i],
    b1 = [3, cst_skip],
    b2 = [3, cst_i],
    b3 = [0, 0],
    b4 = [3, cst_skip],
    b5 = [0, [3, cst_keyword], 0],
    b6 = [3, cst_i],
    b7 = [0, 1],
    b8 = [3, cst_skip],
    b9 = [3, cst_i];
   function parse_keyword_args(raw_args, env){
    var
     kwargs = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
     a = Sx_runtime[6].call(null, raw_args),
     d = Stdlib_Hashtbl[1].call(null, 0, 2),
     b = Sx_runtime[3].call(null, bX);
    Stdlib_Hashtbl[11].call(null, d, b, bW);
    var c = Sx_runtime[3].call(null, bZ);
    Stdlib_Hashtbl[11].call(null, d, c, bY);
    var children = [0, bV];
    Stdlib_List[26].call
     (null,
      function(state, arg){
       var
        idx = Sx_runtime[26].call(null, state, b0),
        skip = Sx_runtime[26].call(null, state, b1);
       if(Sx_types[71].call(null, skip)){
        var
         b =
           [0,
            state,
            [0,
             b4,
             [0,
              b3,
              [0, b2, [0, Sx_runtime[2].call(null, cst_inc, [0, idx, 0]), 0]]]]];
        return Sx_runtime[2].call(null, cst_assoc, b);
       }
       var
        c = [0, Sx_runtime[74].call(null, arg), b5],
        and = Sx_runtime[2].call(null, cst, c);
       if(Sx_types[71].call(null, and))
        var
         d = [0, Sx_runtime[25].call(null, raw_args), 0],
         e = [0, Sx_runtime[2].call(null, cst_inc, [0, idx, 0]), d],
         a = Sx_runtime[2].call(null, cst$3, e);
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         f = Sx_runtime[2].call(null, cst_inc, [0, idx, 0]),
         g =
           trampoline(eval_expr(Sx_runtime[18].call(null, raw_args, f), env)),
         h = Sx_types[73].call(null, arg);
        Sx_runtime[12].call(null, kwargs, h, g);
        var
         i =
           [0,
            state,
            [0,
             b8,
             [0,
              b7,
              [0, b6, [0, Sx_runtime[2].call(null, cst_inc, [0, idx, 0]), 0]]]]];
        return Sx_runtime[2].call(null, cst_assoc, i);
       }
       var j = trampoline(eval_expr(arg, env));
       children[1] = Sx_runtime[11].call(null, children[1], j);
       var
        k =
          [0,
           state,
           [0, b9, [0, Sx_runtime[2].call(null, cst_inc, [0, idx, 0]), 0]]];
       return Sx_runtime[2].call(null, cst_assoc, k);
      },
      [7, d],
      a);
    return [6, [0, kwargs, [0, children[1], 0]]];
   }
   var
    cst$10 = "=>",
    b_ = [0, [3, cst_list], 0],
    b$ = [0, [2, 2.], 0],
    ca = [0, [2, 3.], 0],
    cb = [0, [3, cst_symbol], 0],
    cc = [2, 1.],
    cd = [0, [3, cst$10], 0],
    ce = [2, 1.];
   function cond_scheme_p(clauses){
    var a = Sx_runtime[6].call(null, clauses);
    return [0,
            Stdlib_List[33].call
             (null,
              function(c){
               var
                a = [0, Sx_runtime[74].call(null, c), b_],
                and = Sx_runtime[2].call(null, cst, a);
               if(Sx_types[71].call(null, and)){
                var
                 b = [0, Sx_runtime[25].call(null, c), b$],
                 or = Sx_runtime[2].call(null, cst, b);
                if(Sx_types[71].call(null, or))
                 var or$0 = or;
                else{
                 var
                  d = [0, Sx_runtime[25].call(null, c), ca],
                  and$0 = Sx_runtime[2].call(null, cst, d);
                 if(Sx_types[71].call(null, and$0)){
                  var
                   e = Sx_runtime[18].call(null, c, cc),
                   f = [0, Sx_runtime[74].call(null, e), cb],
                   and$1 = Sx_runtime[2].call(null, cst, f);
                  if(Sx_types[71].call(null, and$1))
                   var
                    g = Sx_runtime[18].call(null, c, ce),
                    h = [0, Sx_types[72].call(null, g), cd],
                    or$0 = Sx_runtime[2].call(null, cst, h);
                  else
                   var or$0 = and$1;
                 }
                 else
                  var or$0 = and$0;
                }
               }
               else
                var or$0 = and;
               return Sx_types[71].call(null, or$0);
              },
              a)];
   }
   var
    cst_else = "else",
    cf = [0, [3, cst_keyword], 0],
    cg = [0, [3, cst_else], 0],
    ch = [0, [3, cst_symbol], 0],
    ci = [0, [3, cst_else], 0],
    cj = [0, [3, ":else"], 0];
   function is_else_clause(test){
    var
     a = [0, Sx_runtime[74].call(null, test), cf],
     and = Sx_runtime[2].call(null, cst, a);
    if(Sx_types[71].call(null, and))
     var
      b = [0, Sx_types[73].call(null, test), cg],
      or = Sx_runtime[2].call(null, cst, b);
    else
     var or = and;
    if(Sx_types[71].call(null, or)) return or;
    var
     c = [0, Sx_runtime[74].call(null, test), ch],
     and$0 = Sx_runtime[2].call(null, cst, c);
    if(! Sx_types[71].call(null, and$0)) return and$0;
    var
     d = [0, Sx_types[72].call(null, test), ci],
     or$0 = Sx_runtime[2].call(null, cst, d);
    if(Sx_types[71].call(null, or$0)) return or$0;
    var e = [0, Sx_types[72].call(null, test), cj];
    return Sx_runtime[2].call(null, cst, e);
   }
   var
    cst$11 = "*",
    cst$12 = "/",
    ck = [2, 1.],
    cl = [0, [2, 2.], 0],
    cm = [6, 0],
    cn = [6, 0],
    co = [0, [3, cst_list], 0],
    cp = [0, [2, 2.], 0],
    cq = [0, [3, cst_symbol], 0],
    cr = [2, 1.],
    cs = [0, [2, 1.], 0],
    ct = [3, cst_begin],
    cu = [0, [2, 2.], 0],
    cv = [2, 0.],
    cw = [0, [3, cst_symbol], 0],
    cx = [0, [2, 2.], 0],
    cy = [0, [2, 2.], 0],
    cz = [0, [2, 2.], 0],
    cA = [0, [2, 2.], 0];
   function sf_named_let(args, env){
    var
     b = Sx_runtime[15].call(null, args),
     loop_name = Sx_types[72].call(null, b),
     bindings = Sx_runtime[18].call(null, args, ck),
     body = Sx_runtime[2].call(null, cst_slice, [0, args, cl]),
     c = Sx_runtime[15].call(null, bindings),
     d = [0, Sx_runtime[74].call(null, c), co],
     and = Sx_runtime[2].call(null, cst, d);
    if(Sx_types[71].call(null, and))
     var
      e = Sx_runtime[15].call(null, bindings),
      f = [0, Sx_runtime[25].call(null, e), cp],
      a = Sx_runtime[2].call(null, cst, f);
    else
     var a = and;
    var params = [0, cm], inits = [0, cn];
    if(Sx_types[71].call(null, a)){
     var g = Sx_runtime[6].call(null, bindings);
     Stdlib_List[18].call
      (null,
       function(binding){
        var
         b = Sx_runtime[15].call(null, binding),
         c = [0, Sx_runtime[74].call(null, b), cq],
         d = Sx_runtime[2].call(null, cst, c);
        if(Sx_types[71].call(null, d))
         var
          e = Sx_runtime[15].call(null, binding),
          a = Sx_types[72].call(null, e);
        else
         var a = Sx_runtime[15].call(null, binding);
        params[1] = Sx_runtime[11].call(null, params[1], a);
        var f = Sx_runtime[18].call(null, binding, cr);
        inits[1] = Sx_runtime[11].call(null, inits[1], f);
        return 0;
       },
       g);
    }
    else{
     var
      o = [0, Sx_runtime[25].call(null, bindings), cu],
      p = [0, cv, [0, Sx_runtime[2].call(null, cst$12, o), 0]],
      q = Sx_runtime[2].call(null, cst_range, p),
      r = Sx_runtime[6].call(null, q);
     Stdlib_List[26].call
      (null,
       function(acc, pair_idx){
        var
         b = Sx_runtime[2].call(null, cst$11, [0, pair_idx, cx]),
         c = Sx_runtime[18].call(null, bindings, b),
         d = [0, Sx_runtime[74].call(null, c), cw],
         e = Sx_runtime[2].call(null, cst, d);
        if(Sx_types[71].call(null, e))
         var
          f = Sx_runtime[2].call(null, cst$11, [0, pair_idx, cy]),
          g = Sx_runtime[18].call(null, bindings, f),
          a = Sx_types[72].call(null, g);
        else
         var
          k = Sx_runtime[2].call(null, cst$11, [0, pair_idx, cA]),
          a = Sx_runtime[18].call(null, bindings, k);
        params[1] = Sx_runtime[11].call(null, params[1], a);
        var
         h = [0, Sx_runtime[2].call(null, cst$11, [0, pair_idx, cz]), 0],
         i = Sx_runtime[2].call(null, cst_inc, h),
         j = Sx_runtime[18].call(null, bindings, i);
        inits[1] = Sx_runtime[11].call(null, inits[1], j);
        return 0;
       },
       0,
       r);
    }
    var
     h = [0, Sx_runtime[25].call(null, body), cs],
     i = Sx_runtime[2].call(null, cst, h);
    if(Sx_types[71].call(null, i))
     var loop_body = Sx_runtime[15].call(null, body);
    else
     var
      n = Sx_types[59].call(null, ct),
      loop_body = Sx_runtime[19].call(null, n, body);
    var
     loop_fn = Sx_types[42].call(null, params[1], loop_body, env),
     j = Sx_runtime[4].call(null, loop_name);
    Sx_runtime[83].call(null, loop_fn, j);
    var
     k = Sx_runtime[4].call(null, loop_name),
     l = Sx_types[76].call(null, loop_fn);
    Sx_runtime[78].call(null, l, k, loop_fn);
    var
     m = Sx_runtime[6].call(null, inits[1]),
     init_vals =
       [6,
        Stdlib_List[20].call
         (null, function(e){return trampoline(eval_expr(e, env));}, m)];
    return cek_call(loop_fn, init_vals);
   }
   var
    cB = [0, [2, 1.], 0],
    cC = [0, [3, cst_symbol], 0],
    cD = [0, [3, cst_list], 0],
    cE = [0, [2, 3.], 0],
    cF = [0, [3, cst_keyword], 0],
    cG = [2, 1.],
    cH = [0, [3, cst_as], 0],
    cI = [2, 1.],
    cJ = [3, cst_begin];
   function sf_lambda(args, env){
    var
     params_expr = Sx_runtime[15].call(null, args),
     body_exprs = Sx_runtime[16].call(null, args),
     a = [0, Sx_runtime[25].call(null, body_exprs), cB],
     b = Sx_runtime[2].call(null, cst, a);
    if(Sx_types[71].call(null, b))
     var body = Sx_runtime[15].call(null, body_exprs);
    else
     var
      d = Sx_types[59].call(null, cJ),
      body = Sx_runtime[19].call(null, d, body_exprs);
    var
     c = Sx_runtime[6].call(null, params_expr),
     param_names =
       [6,
        Stdlib_List[20].call
         (null,
          function(p){
           var
            b = [0, Sx_runtime[74].call(null, p), cC],
            c = Sx_runtime[2].call(null, cst, b);
           if(Sx_types[71].call(null, c)) return Sx_types[72].call(null, p);
           var
            d = [0, Sx_runtime[74].call(null, p), cD],
            and = Sx_runtime[2].call(null, cst, d);
           if(Sx_types[71].call(null, and)){
            var
             e = [0, Sx_runtime[25].call(null, p), cE],
             and$0 = Sx_runtime[2].call(null, cst, e);
            if(Sx_types[71].call(null, and$0)){
             var
              f = Sx_runtime[18].call(null, p, cG),
              g = [0, Sx_runtime[74].call(null, f), cF],
              and$1 = Sx_runtime[2].call(null, cst, g);
             if(Sx_types[71].call(null, and$1))
              var
               h = Sx_runtime[18].call(null, p, cI),
               i = [0, Sx_types[73].call(null, h), cH],
               a = Sx_runtime[2].call(null, cst, i);
             else
              var a = and$1;
            }
            else
             var a = and$0;
           }
           else
            var a = and;
           if(! Sx_types[71].call(null, a)) return p;
           var j = Sx_runtime[15].call(null, p);
           return Sx_types[72].call(null, j);
          },
          c)];
    return Sx_types[42].call(null, param_names, body, env);
   }
   var
    cst_current_file = "*current-file*",
    cst_effect_annotations = "*effect-annotations*",
    cst_effects = "effects",
    cst$13 = "~",
    cK = [2, 1.],
    cL = [3, cst$13],
    cM = [2, 1.],
    cN = [2, 2.],
    cO = [3, "auto"],
    cP = [3, "affinity"],
    cQ = [3, cst_effects],
    cR = [0, [3, cst_list], 0],
    cS = [0, [3, cst_symbol], 0],
    cT = [3, cst_effect_annotations],
    cU = [3, cst_effect_annotations],
    cV = [3, cst_effect_annotations],
    cW = [3, cst_current_file],
    cX = [3, cst_current_file];
   function sf_defcomp(args, env){
    var
     name_sym = Sx_runtime[15].call(null, args),
     params_raw = Sx_runtime[18].call(null, args, cK),
     body = Sx_runtime[17].call(null, args),
     a = Sx_types[72].call(null, name_sym),
     comp_name = Sx_runtime[128].call(null, a, cL),
     parsed = parse_comp_params(params_raw),
     params = Sx_runtime[15].call(null, parsed),
     has_children = Sx_runtime[18].call(null, parsed, cM),
     param_types = Sx_runtime[18].call(null, parsed, cN),
     affinity = defcomp_kwarg(args, cP, cO),
     comp =
       Sx_types[55].call
        (null, comp_name, params, has_children, body, env, affinity),
     effects = defcomp_kwarg(args, cQ, 0),
     b = Sx_runtime[84].call(null, param_types),
     and = [0, 1 - Sx_types[71].call(null, b)];
    if(Sx_types[71].call(null, and)){
     var c = Sx_runtime[2].call(null, cst_keys, [0, param_types, 0]);
     Sx_runtime[34].call(null, c);
    }
    var
     d = Sx_runtime[84].call(null, effects),
     e = [0, 1 - Sx_types[71].call(null, d)];
    if(Sx_types[71].call(null, e)){
     var
      f = [0, Sx_runtime[74].call(null, effects), cR],
      g = Sx_runtime[2].call(null, cst, f);
     if(Sx_types[71].call(null, g))
      var
       h = Sx_runtime[6].call(null, effects),
       effect_list =
         [6,
          Stdlib_List[20].call
           (null,
            function(e){
             var
              a = [0, Sx_runtime[74].call(null, e), cS],
              b = Sx_runtime[2].call(null, cst, a);
             return Sx_types[71].call(null, b)
                     ? Sx_types[72].call(null, e)
                     : [3, Sx_runtime[5].call(null, [0, e, 0])];
            },
            h)];
     else
      var
       effect_list =
         [6, [0, [3, Sx_runtime[5].call(null, [0, effects, 0])], 0]];
     var
      i = Sx_runtime[76].call(null, env, cT),
      effect_anns =
        Sx_types[71].call(null, i)
         ? Sx_runtime[77].call(null, env, cU)
         : [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
      j = Sx_types[72].call(null, name_sym);
     Sx_runtime[12].call(null, effect_anns, j, effect_list);
     var k = Sx_runtime[4].call(null, cV);
     Sx_runtime[78].call(null, env, k, effect_anns);
    }
    var l = Sx_runtime[76].call(null, env, cW);
    if(Sx_types[71].call(null, l)){
     var m = Sx_runtime[77].call(null, env, cX);
     Sx_types[82].call(null, comp, m);
    }
    var
     n = Sx_types[72].call(null, name_sym),
     o = Sx_runtime[4].call(null, n);
    Sx_runtime[78].call(null, env, o, comp);
    return comp;
   }
   var
    cY = [0, [2, 1.], 0],
    cZ = [0, [2, 1.], 0],
    c0 = [2, 2.],
    c1 = [0, [3, cst_keyword], 0],
    c2 = [0, [2, 1.], 0],
    c3 = [0, [2, 1.], 0],
    c4 = [0, [3, cst_keyword], 0];
   function defcomp_kwarg(args, key, default$){
    var
     a = [0, Sx_runtime[25].call(null, args), cY],
     end = Sx_runtime[2].call(null, cst$5, a),
     result = [0, default$],
     b = Sx_runtime[2].call(null, cst_range, [0, c0, [0, end, cZ]]),
     c = Sx_runtime[6].call(null, b);
    Stdlib_List[18].call
     (null,
      function(i){
       var
        b = Sx_runtime[18].call(null, args, i),
        c = [0, Sx_runtime[74].call(null, b), c1],
        and = Sx_runtime[2].call(null, cst, c);
       if(Sx_types[71].call(null, and)){
        var
         d = Sx_runtime[18].call(null, args, i),
         e = [0, Sx_types[73].call(null, d), [0, key, 0]],
         and$0 = Sx_runtime[2].call(null, cst, e);
        if(Sx_types[71].call(null, and$0))
         var
          f = [0, Sx_runtime[2].call(null, cst$8, [0, i, c2]), [0, end, 0]],
          a = Sx_runtime[2].call(null, cst$3, f);
        else
         var a = and$0;
       }
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         g = Sx_runtime[2].call(null, cst$8, [0, i, c3]),
         val = Sx_runtime[18].call(null, args, g),
         h = [0, Sx_runtime[74].call(null, val), c4],
         j = Sx_runtime[2].call(null, cst, h),
         k = Sx_types[71].call(null, j) ? Sx_types[73].call(null, val) : val;
        result[1] = k;
       }
       return 0;
      },
      c);
    return result[1];
   }
   var
    c5 = [6, 0],
    c6 = [0, 0],
    c7 = [0, 0],
    c8 = [0, [3, cst_list], 0],
    c9 = [0, [2, 3.], 0],
    c_ = [0, [3, cst_symbol], 0],
    c$ = [0, [3, cst_keyword], 0],
    da = [2, 1.],
    db = [0, [3, cst_as], 0],
    dc = [2, 1.],
    dd = [2, 2.],
    de = [0, [3, cst_symbol], 0],
    df = [0, [3, cst_symbol], 0],
    dg = [0, [3, "&key"], 0],
    dh = [0, 1],
    di = [0, [3, cst_rest], 0],
    dj = [0, 1],
    dk = [0, [3, "&children"], 0],
    dl = [0, 1];
   function parse_comp_params(params_expr){
    var
     param_types = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
     a = Sx_runtime[6].call(null, params_expr),
     params = [0, c5],
     has_children = [0, c6],
     in_key = [0, c7];
    Stdlib_List[18].call
     (null,
      function(p){
       var
        b = [0, Sx_runtime[74].call(null, p), c8],
        and = Sx_runtime[2].call(null, cst, b);
       if(Sx_types[71].call(null, and)){
        var
         c = [0, Sx_runtime[25].call(null, p), c9],
         and$0 = Sx_runtime[2].call(null, cst, c);
        if(Sx_types[71].call(null, and$0)){
         var
          d = Sx_runtime[15].call(null, p),
          e = [0, Sx_runtime[74].call(null, d), c_],
          and$1 = Sx_runtime[2].call(null, cst, e);
         if(Sx_types[71].call(null, and$1)){
          var
           f = Sx_runtime[18].call(null, p, da),
           g = [0, Sx_runtime[74].call(null, f), c$],
           and$2 = Sx_runtime[2].call(null, cst, g);
          if(Sx_types[71].call(null, and$2))
           var
            h = Sx_runtime[18].call(null, p, dc),
            i = [0, Sx_types[73].call(null, h), db],
            a = Sx_runtime[2].call(null, cst, i);
          else
           var a = and$2;
         }
         else
          var a = and$1;
        }
        else
         var a = and$0;
       }
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         j = Sx_runtime[15].call(null, p),
         name = Sx_types[72].call(null, j),
         ptype = Sx_runtime[18].call(null, p, dd),
         k = [0, Sx_runtime[74].call(null, ptype), de],
         l = Sx_runtime[2].call(null, cst, k),
         type_val =
           Sx_types[71].call(null, l) ? Sx_types[72].call(null, ptype) : ptype,
         m = [0, 1 - Sx_types[71].call(null, has_children[1])];
        if(Sx_types[71].call(null, m)){
         params[1] = Sx_runtime[11].call(null, params[1], name);
         Sx_runtime[12].call(null, param_types, name, type_val);
        }
       }
       else{
        var
         n = [0, Sx_runtime[74].call(null, p), df],
         o = Sx_runtime[2].call(null, cst, n);
        if(Sx_types[71].call(null, o)){
         var
          name$0 = Sx_types[72].call(null, p),
          q = Sx_runtime[2].call(null, cst, [0, name$0, dg]);
         if(Sx_types[71].call(null, q))
          in_key[1] = dh;
         else{
          var r = Sx_runtime[2].call(null, cst, [0, name$0, di]);
          if(Sx_types[71].call(null, r))
           has_children[1] = dj;
          else{
           var s = Sx_runtime[2].call(null, cst, [0, name$0, dk]);
           if(Sx_types[71].call(null, s))
            has_children[1] = dl;
           else if(! Sx_types[71].call(null, has_children[1]))
            if(Sx_types[71].call(null, in_key[1]))
             params[1] = Sx_runtime[11].call(null, params[1], name$0);
            else
             params[1] = Sx_runtime[11].call(null, params[1], name$0);
          }
         }
        }
       }
       return 0;
      },
      a);
    return [6, [0, params[1], [0, has_children[1], [0, param_types, 0]]]];
   }
   var
    dm = [2, 1.],
    dn = [0, [2, 2.], 0],
    dp = [0, [2, 1.], 0],
    dq = [3, cst$13],
    dr = [2, 1.],
    ds = [3, cst_current_file],
    dt = [3, cst_current_file],
    du = [3, cst_begin];
   function sf_defisland(args, env){
    var
     name_sym = Sx_runtime[15].call(null, args),
     params_raw = Sx_runtime[18].call(null, args, dm),
     body_exprs = Sx_runtime[2].call(null, cst_slice, [0, args, dn]),
     a = [0, Sx_runtime[25].call(null, body_exprs), dp],
     b = Sx_runtime[2].call(null, cst, a);
    if(Sx_types[71].call(null, b))
     var body = Sx_runtime[15].call(null, body_exprs);
    else
     var
      h = Sx_types[59].call(null, du),
      body = Sx_runtime[19].call(null, h, body_exprs);
    var
     c = Sx_types[72].call(null, name_sym),
     comp_name = Sx_runtime[128].call(null, c, dq),
     parsed = parse_comp_params(params_raw),
     params = Sx_runtime[15].call(null, parsed),
     has_children = Sx_runtime[18].call(null, parsed, dr),
     island =
       Sx_types[56].call(null, comp_name, params, has_children, body, env),
     d = Sx_runtime[76].call(null, env, ds);
    if(Sx_types[71].call(null, d)){
     var e = Sx_runtime[77].call(null, env, dt);
     Sx_types[82].call(null, island, e);
    }
    var
     f = Sx_types[72].call(null, name_sym),
     g = Sx_runtime[4].call(null, f);
    Sx_runtime[78].call(null, env, g, island);
    return island;
   }
   var dv = [0, [2, 2.], 0], dw = [2, 1.];
   function defio_parse_kwargs_b(spec, remaining$1){
    var remaining = remaining$1;
    for(;;){
     var
      b = Sx_runtime[34].call(null, remaining),
      and = [0, 1 - Sx_types[71].call(null, b)];
     if(Sx_types[71].call(null, and)){
      var
       c = [0, Sx_runtime[25].call(null, remaining), dv],
       and$0 = Sx_runtime[2].call(null, cst$2, c);
      if(Sx_types[71].call(null, and$0))
       var
        d = Sx_runtime[15].call(null, remaining),
        a = Sx_runtime[33].call(null, d);
      else
       var a = and$0;
     }
     else
      var a = and;
     if(! Sx_types[71].call(null, a)) return 0;
     var
      e = Sx_runtime[18].call(null, remaining, dw),
      f = Sx_runtime[15].call(null, remaining),
      g = Sx_types[73].call(null, f);
     Sx_runtime[12].call(null, spec, g, e);
     var
      h = Sx_runtime[16].call(null, remaining),
      remaining$0 = Sx_runtime[16].call(null, h);
     remaining = remaining$0;
    }
   }
   var dx = [3, cst_name];
   function sf_defio(args, env){
    var
     name = Sx_runtime[15].call(null, args),
     spec = [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
    Sx_runtime[12].call(null, spec, dx, name);
    defio_parse_kwargs_b(spec, Sx_runtime[16].call(null, args));
    io_register_b(name, spec);
    return spec;
   }
   var dy = [2, 1.], dz = [2, 2.], dA = [2, 1.];
   function sf_defmacro(args, env){
    var
     name_sym = Sx_runtime[15].call(null, args),
     params_raw = Sx_runtime[18].call(null, args, dy),
     body = Sx_runtime[18].call(null, args, dz),
     parsed = parse_macro_params(params_raw),
     params = Sx_runtime[15].call(null, parsed),
     rest_param = Sx_runtime[18].call(null, parsed, dA),
     a = Sx_types[72].call(null, name_sym),
     mac = Sx_types[57].call(null, params, rest_param, body, env, a),
     b = Sx_types[72].call(null, name_sym),
     c = Sx_runtime[4].call(null, b);
    Sx_runtime[78].call(null, env, c, mac);
    return mac;
   }
   var
    cst_in_rest = "in-rest",
    dB = [6, 0],
    dC = [0, 0],
    dD = [3, cst_in_rest],
    dE = [0, [3, cst_symbol], 0],
    dF = [0, [3, cst_rest], 0],
    dG = [0, [3, cst_in_rest], [0, [0, 1], 0]],
    dH = [3, cst_in_rest],
    dI = [0, [3, cst_symbol], 0],
    dJ = [0, [3, cst_symbol], 0];
   function parse_macro_params(params_expr){
    var
     a = Sx_runtime[6].call(null, params_expr),
     d = Stdlib_Hashtbl[1].call(null, 0, 1),
     b = Sx_runtime[3].call(null, dD);
    Stdlib_Hashtbl[11].call(null, d, b, dC);
    var params = [0, dB], rest_param = [0, 0];
    Stdlib_List[26].call
     (null,
      function(state, p){
       var
        b = [0, Sx_runtime[74].call(null, p), dE],
        and = Sx_runtime[2].call(null, cst, b);
       if(Sx_types[71].call(null, and))
        var
         c = [0, Sx_types[72].call(null, p), dF],
         a = Sx_runtime[2].call(null, cst, c);
       else
        var a = and;
       if(Sx_types[71].call(null, a))
        return Sx_runtime[2].call(null, cst_assoc, [0, state, dG]);
       var d = Sx_runtime[26].call(null, state, dH);
       if(Sx_types[71].call(null, d)){
        var
         e = [0, Sx_runtime[74].call(null, p), dI],
         f = Sx_runtime[2].call(null, cst, e),
         g = Sx_types[71].call(null, f) ? Sx_types[72].call(null, p) : p;
        rest_param[1] = g;
        return state;
       }
       var
        h = [0, Sx_runtime[74].call(null, p), dJ],
        i = Sx_runtime[2].call(null, cst, h),
        j = Sx_types[71].call(null, i) ? Sx_types[72].call(null, p) : p;
       params[1] = Sx_runtime[11].call(null, params[1], j);
       return state;
      },
      [7, d],
      a);
    return [6, [0, params[1], [0, rest_param[1], 0]]];
   }
   var
    dK = [0, [3, cst_list], 0],
    dL = [6, 0],
    dM = [0, [3, cst_symbol], 0],
    dN = [0, [3, "unquote"], 0],
    dO = [2, 1.],
    dP = [6, 0],
    dQ = [0, [3, cst_list], 0],
    dR = [0, [2, 2.], 0],
    dS = [0, [3, cst_symbol], 0],
    dT = [0, [3, "splice-unquote"], 0],
    dU = [2, 1.],
    dV = [0, [3, cst_list], 0];
   function qq_expand(template, env){
    var
     b = [0, Sx_runtime[74].call(null, template), dK],
     c = Sx_runtime[2].call(null, cst, b),
     d = [0, 1 - Sx_types[71].call(null, c)];
    if(Sx_types[71].call(null, d)) return template;
    var e = Sx_runtime[34].call(null, template);
    if(Sx_types[71].call(null, e)) return dL;
    var
     head = Sx_runtime[15].call(null, template),
     f = [0, Sx_runtime[74].call(null, head), dM],
     and = Sx_runtime[2].call(null, cst, f);
    if(Sx_types[71].call(null, and))
     var
      g = [0, Sx_types[72].call(null, head), dN],
      a = Sx_runtime[2].call(null, cst, g);
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     return trampoline
             (eval_expr(Sx_runtime[18].call(null, template, dO), env));
    var h = Sx_runtime[6].call(null, template);
    return Stdlib_List[26].call
            (null,
             function(result, item){
              var
               b = [0, Sx_runtime[74].call(null, item), dQ],
               and = Sx_runtime[2].call(null, cst, b);
              if(Sx_types[71].call(null, and)){
               var
                c = [0, Sx_runtime[25].call(null, item), dR],
                and$0 = Sx_runtime[2].call(null, cst, c);
               if(Sx_types[71].call(null, and$0)){
                var
                 d = Sx_runtime[15].call(null, item),
                 e = [0, Sx_runtime[74].call(null, d), dS],
                 and$1 = Sx_runtime[2].call(null, cst, e);
                if(Sx_types[71].call(null, and$1))
                 var
                  f = Sx_runtime[15].call(null, item),
                  g = [0, Sx_types[72].call(null, f), dT],
                  a = Sx_runtime[2].call(null, cst, g);
                else
                 var a = and$1;
               }
               else
                var a = and$0;
              }
              else
               var a = and;
              if(! Sx_types[71].call(null, a)){
               var k = [0, result, [0, [6, [0, qq_expand(item, env), 0]], 0]];
               return Sx_runtime[2].call(null, cst_concat, k);
              }
              var
               spliced =
                 trampoline
                  (eval_expr(Sx_runtime[18].call(null, item, dU), env)),
               h = [0, Sx_runtime[74].call(null, spliced), dV],
               i = Sx_runtime[2].call(null, cst, h);
              if(Sx_types[71].call(null, i))
               return Sx_runtime[2].call
                       (null, cst_concat, [0, result, [0, spliced, 0]]);
              var j = Sx_runtime[84].call(null, spliced);
              return Sx_types[71].call(null, j)
                      ? result
                      : Sx_runtime
                         [2].call
                        (null,
                         cst_concat,
                         [0, result, [0, [6, [0, spliced, 0]], 0]]);
             },
             dP,
             h);
   }
   var
    cst_dec = "dec",
    dW = [6, 0],
    dX = [6, 0],
    dY = [0, [3, cst_list], 0],
    dZ = [0, [2, 2.], 0],
    d0 = [0, [3, cst_symbol], 0],
    d1 = [2, 1.],
    d2 = [2, 1.],
    d3 = [2, 0.],
    d4 = [0, [2, 2.], 0],
    d5 = [2, 0.],
    d6 = [0, [3, cst_symbol], 0],
    d7 = [0, [2, 2.], 0],
    d8 = [0, [2, 2.], 0],
    d9 = [0, [2, 2.], 0],
    d_ = [0, [2, 2.], 0];
   function sf_letrec(args, env){
    var
     bindings = Sx_runtime[15].call(null, args),
     body = Sx_runtime[16].call(null, args),
     local = Sx_runtime[81].call(null, env),
     b = Sx_runtime[15].call(null, bindings),
     c = [0, Sx_runtime[74].call(null, b), dY],
     and = Sx_runtime[2].call(null, cst, c);
    if(Sx_types[71].call(null, and))
     var
      d = Sx_runtime[15].call(null, bindings),
      e = [0, Sx_runtime[25].call(null, d), dZ],
      a = Sx_runtime[2].call(null, cst, e);
    else
     var a = and;
    var names = [0, dW], val_exprs = [0, dX];
    if(Sx_types[71].call(null, a)){
     var f = Sx_runtime[6].call(null, bindings);
     Stdlib_List[18].call
      (null,
       function(binding){
        var
         a = Sx_runtime[15].call(null, binding),
         b = [0, Sx_runtime[74].call(null, a), d0],
         c = Sx_runtime[2].call(null, cst, b);
        if(Sx_types[71].call(null, c))
         var
          d = Sx_runtime[15].call(null, binding),
          vname = Sx_types[72].call(null, d);
        else
         var vname = Sx_runtime[15].call(null, binding);
        names[1] = Sx_runtime[11].call(null, names[1], vname);
        var e = Sx_runtime[18].call(null, binding, d1);
        val_exprs[1] = Sx_runtime[11].call(null, val_exprs[1], e);
        var f = Sx_runtime[4].call(null, vname);
        Sx_runtime[78].call(null, local, f, 0);
        return 0;
       },
       f);
    }
    else{
     var
      p = [0, Sx_runtime[25].call(null, bindings), d4],
      q = [0, d5, [0, Sx_runtime[2].call(null, cst$12, p), 0]],
      r = Sx_runtime[2].call(null, cst_range, q),
      s = Sx_runtime[6].call(null, r);
     Stdlib_List[26].call
      (null,
       function(acc, pair_idx){
        var
         a = Sx_runtime[2].call(null, cst$11, [0, pair_idx, d7]),
         b = Sx_runtime[18].call(null, bindings, a),
         c = [0, Sx_runtime[74].call(null, b), d6],
         d = Sx_runtime[2].call(null, cst, c);
        if(Sx_types[71].call(null, d))
         var
          e = Sx_runtime[2].call(null, cst$11, [0, pair_idx, d8]),
          f = Sx_runtime[18].call(null, bindings, e),
          vname = Sx_types[72].call(null, f);
        else
         var
          j = Sx_runtime[2].call(null, cst$11, [0, pair_idx, d_]),
          vname = Sx_runtime[18].call(null, bindings, j);
        var
         g = [0, Sx_runtime[2].call(null, cst$11, [0, pair_idx, d9]), 0],
         h = Sx_runtime[2].call(null, cst_inc, g),
         val_expr = Sx_runtime[18].call(null, bindings, h);
        names[1] = Sx_runtime[11].call(null, names[1], vname);
        val_exprs[1] = Sx_runtime[11].call(null, val_exprs[1], val_expr);
        var i = Sx_runtime[4].call(null, vname);
        return Sx_runtime[78].call(null, local, i, 0);
       },
       0,
       s);
    }
    var
     g = Sx_runtime[6].call(null, val_exprs[1]),
     values =
       [6,
        Stdlib_List[20].call
         (null, function(e){return trampoline(eval_expr(e, local));}, g)],
     h = Sx_runtime[2].call(null, cst_zip, [0, names[1], [0, values, 0]]),
     i = Sx_runtime[6].call(null, h);
    Stdlib_List[18].call
     (null,
      function(pair){
       var
        a = Sx_runtime[18].call(null, pair, d2),
        b = Sx_runtime[15].call(null, pair),
        c = Sx_runtime[4].call(null, b);
       Sx_runtime[78].call(null, local, c, a);
       return 0;
      },
      i);
    var j = Sx_runtime[6].call(null, values);
    Stdlib_List[18].call
     (null,
      function(val){
       var a = Sx_runtime[86].call(null, val);
       if(Sx_types[71].call(null, a)){
        var b = Sx_runtime[6].call(null, names[1]);
        Stdlib_List[18].call
         (null,
          function(n){
           var
            a = Sx_runtime[77].call(null, local, n),
            b = Sx_runtime[4].call(null, n),
            c = Sx_types[76].call(null, val);
           Sx_runtime[78].call(null, c, b, a);
           return 0;
          },
          b);
       }
       return 0;
      },
      j);
    var
     k = [0, Sx_runtime[25].call(null, body), 0],
     l = [0, body, [0, d3, [0, Sx_runtime[2].call(null, cst_dec, k), 0]]],
     m = Sx_runtime[2].call(null, cst_slice, l),
     n = Sx_runtime[6].call(null, m);
    Stdlib_List[18].call
     (null, function(e){trampoline(eval_expr(e, local)); return 0;}, n);
    var o = Sx_runtime[17].call(null, body);
    return Sx_types[58].call(null, o, local);
   }
   function step_sf_letrec(args, env, kont){
    var thk = sf_letrec(args, env), a = Sx_types[93].call(null, thk);
    return make_cek_state(Sx_types[92].call(null, thk), a, kont);
   }
   var d$ = [2, 1.], ea = [2, 2.], eb = [6, 0], ec = [6, 0], ed = [6, 0];
   function step_sf_dynamic_wind(args, env, kont){
    var
     before = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     body = trampoline(eval_expr(Sx_runtime[18].call(null, args, d$), env)),
     after = trampoline(eval_expr(Sx_runtime[18].call(null, args, ea), env));
    cek_call(before, eb);
    var winders_len = Sx_runtime[25].call(null, winders_ref[1]);
    winders_ref[1] = Sx_runtime[19].call(null, after, winders_ref[1]);
    return continue_with_call
            (body,
             ed,
             env,
             ec,
             kont_push(make_wind_after_frame(after, winders_len, env), kont));
   }
   var
    ee = [0, [2, 1.], 0],
    ef = [0, [2, 2.], 0],
    eg = [0, [3, cst_keyword], 0],
    eh = [0, [3, cst_value], 0],
    ei = [2, 1.],
    ej = [0, [2, 2.], 0];
   function sf_scope(args, env){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     rest = Sx_runtime[2].call(null, cst_slice, [0, args, ee]),
     b = [0, Sx_runtime[25].call(null, rest), ef],
     and = Sx_runtime[2].call(null, cst$2, b);
    if(Sx_types[71].call(null, and)){
     var
      c = Sx_runtime[15].call(null, rest),
      d = [0, Sx_runtime[74].call(null, c), eg],
      and$0 = Sx_runtime[2].call(null, cst, d);
     if(Sx_types[71].call(null, and$0))
      var
       e = Sx_runtime[15].call(null, rest),
       f = [0, Sx_types[73].call(null, e), eh],
       a = Sx_runtime[2].call(null, cst, f);
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     var
      g = trampoline(eval_expr(Sx_runtime[18].call(null, rest, ei), env)),
      body_exprs = Sx_runtime[2].call(null, cst_slice, [0, rest, ej]),
      val = g;
    else
     var body_exprs = rest, val = 0;
    Sx_runtime[105].call(null, name, val);
    var h = Sx_runtime[6].call(null, body_exprs), result = [0, 0];
    Stdlib_List[18].call
     (null,
      function(e){result[1] = trampoline(eval_expr(e, env)); return 0;},
      h);
    Sx_runtime[106].call(null, name);
    return result[1];
   }
   var ek = [2, 1.], el = [0, [2, 2.], 0];
   function sf_provide(args, env){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     val = trampoline(eval_expr(Sx_runtime[18].call(null, args, ek), env)),
     body_exprs = Sx_runtime[2].call(null, cst_slice, [0, args, el]);
    Sx_runtime[105].call(null, name, val);
    var a = Sx_runtime[6].call(null, body_exprs), result = [0, 0];
    Stdlib_List[18].call
     (null,
      function(e){result[1] = trampoline(eval_expr(e, env)); return 0;},
      a);
    Sx_runtime[106].call(null, name);
    return result[1];
   }
   var
    cst_sr_literals = "__sr-literals",
    cst_sr_rules = "__sr-rules",
    cst_syntax_rules_body = "__syntax-rules-body__",
    em = [0, [3, cst_syntax_rules_body], 0],
    en = [3, cst_sr_rules],
    eo = [3, cst_sr_literals],
    ep = [2, 1.],
    eq = [2, 1.];
   function expand_macro(mac, raw_args, env){
    var
     body = Sx_types[90].call(null, mac),
     and = Sx_runtime[40].call(null, body);
    if(Sx_types[71].call(null, and))
     var
      b = [0, Sx_types[72].call(null, body), em],
      a = Sx_runtime[2].call(null, cst, b);
    else
     var a = and;
    if(Sx_types[71].call(null, a)){
     var
      closure = Sx_types[91].call(null, mac),
      c = Sx_runtime[77].call(null, closure, en);
     return syntax_rules_expand
             (Sx_runtime[77].call(null, closure, eo), c, raw_args);
    }
    var
     d = Sx_types[91].call(null, mac),
     local = Sx_runtime[82].call(null, d, env),
     e = Sx_types[88].call(null, mac),
     f = Sx_runtime[6].call(null, e),
     g =
       [6,
        Stdlib_List[21].call
         (null,
          function(i, p){var i$0 = [2, i]; return [6, [0, p, [0, i$0, 0]]];},
          f)],
     h = Sx_runtime[6].call(null, g);
    Stdlib_List[18].call
     (null,
      function(pair){
       var
        b = [0, Sx_runtime[25].call(null, raw_args), 0],
        c = [0, Sx_runtime[18].call(null, pair, ep), b],
        d = Sx_runtime[2].call(null, cst$3, c);
       if(Sx_types[71].call(null, d))
        var
         e = Sx_runtime[18].call(null, pair, eq),
         a = Sx_runtime[18].call(null, raw_args, e);
       else
        var a = 0;
       var
        f = Sx_runtime[15].call(null, pair),
        g = Sx_runtime[4].call(null, f);
       Sx_runtime[78].call(null, local, g, a);
       return 0;
      },
      h);
    var i = Sx_types[89].call(null, mac);
    if(Sx_types[71].call(null, i)){
     var
      j = Sx_types[88].call(null, mac),
      k = [0, raw_args, [0, Sx_runtime[25].call(null, j), 0]],
      l = Sx_runtime[2].call(null, cst_slice, k),
      m = Sx_types[89].call(null, mac),
      n = Sx_runtime[4].call(null, m);
     Sx_runtime[78].call(null, local, n, l);
    }
    return trampoline(eval_expr(Sx_types[90].call(null, mac), local));
   }
   function cek_step_loop(state$1){
    var state = state$1;
    for(;;){
     var
      or = cek_terminal_p(state),
      or$0 = Sx_types[71].call(null, or) ? or : cek_suspended_p(state);
     if(Sx_types[71].call(null, or$0)) return state;
     var state$0 = cek_step(state);
     state = state$0;
    }
   }
   var
    cst_IO_suspension_in_non_IO_co = "IO suspension in non-IO context",
    er = [3, cst_IO_suspension_in_non_IO_co];
   function cek_run(state){
    var final = cek_step_loop(state), a = cek_suspended_p(final);
    if(! Sx_types[71].call(null, a)) return cek_value(final);
    var match = Sx_types[13][1];
    if(match){var hook = match[1]; return caml_call1(hook, final);}
    var b = Sx_runtime[3].call(null, er);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   function cek_resume(suspended_state, result){
    var a = cek_kont(suspended_state);
    return cek_step_loop(make_cek_value(result, cek_env(suspended_state), a));
   }
   var es = [0, [3, cst_eval], 0];
   function cek_step(state){
    var a = [0, cek_phase(state), es], b = Sx_runtime[2].call(null, cst, a);
    return Sx_types[71].call(null, b)
            ? step_eval(state)
            : step_continue(state);
   }
   var
    cst_starts_with = "starts-with?",
    et = [3, cst_number],
    eu = [3, cst_string],
    ev = [3, cst_boolean],
    ew = [3, cst_nil],
    ex = [3, cst_symbol],
    ey = [0, [3, cst$13], 0],
    ez = [0, [3, "true"], 0],
    eA = [0, 1],
    eB = [0, [3, "false"], 0],
    eC = [0, 0],
    eD = [0, [3, cst_nil], 0],
    eE = [3, "Undefined symbol: "],
    eF = [3, cst_keyword],
    eG = [3, cst_dict],
    eH = [6, 0],
    eI = [3, cst_list],
    eJ = [6, 0];
   function step_eval(state){
    var
     expr = cek_control(state),
     env = cek_env(state),
     kont = cek_kont(state),
     match_val = Sx_runtime[74].call(null, expr);
    if(caml_equal(match_val, et)) return make_cek_value(expr, env, kont);
    if(caml_equal(match_val, eu)) return make_cek_value(expr, env, kont);
    if(caml_equal(match_val, ev)) return make_cek_value(expr, env, kont);
    if(caml_equal(match_val, ew)) return make_cek_value(0, env, kont);
    if(! caml_equal(match_val, ex)){
     if(caml_equal(match_val, eF))
      return make_cek_value(Sx_types[73].call(null, expr), env, kont);
     if(caml_equal(match_val, eG)){
      var
       ks = Sx_runtime[2].call(null, cst_keys, [0, expr, 0]),
       h = Sx_runtime[34].call(null, ks);
      if(Sx_types[71].call(null, h))
       return make_cek_value
               ([7, Stdlib_Hashtbl[1].call(null, 0, 0)], env, kont);
      var
       first_key = Sx_runtime[15].call(null, ks),
       i = Sx_runtime[16].call(null, ks),
       j = Sx_runtime[6].call(null, i),
       remaining_entries = [0, eH];
      Stdlib_List[18].call
       (null,
        function(k){
         var a = [6, [0, k, [0, Sx_runtime[26].call(null, expr, k), 0]]];
         remaining_entries[1] =
          Sx_runtime[11].call(null, remaining_entries[1], a);
         return 0;
        },
        j);
      var
       k =
         kont_push
          (make_dict_frame
            (remaining_entries[1], [6, [0, [6, [0, first_key, 0]], 0]], env),
           kont);
      return make_cek_state
              (Sx_runtime[26].call(null, expr, first_key), env, k);
     }
     if(! caml_equal(match_val, eI)) return make_cek_value(expr, env, kont);
     var l = Sx_runtime[34].call(null, expr);
     return Sx_types[71].call(null, l)
             ? make_cek_value(eJ, env, kont)
             : step_eval_list(expr, env, kont);
    }
    var
     name = Sx_types[72].call(null, expr),
     a = Sx_runtime[76].call(null, env, name);
    if(Sx_types[71].call(null, a))
     var val = Sx_runtime[77].call(null, env, name);
    else{
     var b = Sx_runtime[92].call(null, name);
     if(Sx_types[71].call(null, b))
      var val = Sx_runtime[93].call(null, name);
     else{
      var c = Sx_runtime[2].call(null, cst, [0, name, ez]);
      if(Sx_types[71].call(null, c))
       var val = eA;
      else{
       var d = Sx_runtime[2].call(null, cst, [0, name, eB]);
       if(Sx_types[71].call(null, d))
        var val = eC;
       else{
        var e = Sx_runtime[2].call(null, cst, [0, name, eD]);
        if(! Sx_types[71].call(null, e)){
         var
          f = [3, Sx_runtime[5].call(null, [0, eE, [0, name, 0]])],
          g = Sx_runtime[3].call(null, f);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
        }
        var val = 0;
       }
      }
     }
    }
    var and = Sx_runtime[84].call(null, val);
    if(Sx_types[71].call(null, and))
     Sx_runtime[2].call(null, cst_starts_with, [0, name, ey]);
    return make_cek_value(val, env, kont);
   }
   var eK = [0, 0];
   function step_sf_raise(args, env, kont){
    var a = kont_push(make_raise_eval_frame(env, eK), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var
    cst$14 = "_",
    cst_guard_k = "__guard-k",
    cst_guard_result = "__guard-result",
    cst_call_cc = "call/cc",
    cst_first = "first",
    cst_handler_bind = "handler-bind",
    cst_raise = "raise",
    eL = [3, "__guard-reraise__"],
    eM =
      [0,
       [6,
        [0,
         [4, cst_raise],
         [0,
          [6, [0, [4, "nth"], [0, [4, cst_guard_result], [0, [2, 1.], 0]]]],
          0]]],
       [0, [4, cst_guard_result], 0]],
    eN = [4, cst_quote],
    eO = [6, [0, [4, cst_first], [0, [4, cst_guard_result], 0]]],
    eP = [4, cst],
    eQ =
      [6,
       [0,
        [4, cst],
        [0,
         [6, [0, [4, "len"], [0, [4, cst_guard_result], 0]]],
         [0, [2, 2.], 0]]]],
    eR = [6, [0, [4, "list?"], [0, [4, cst_guard_result], 0]]],
    eS = [4, cst_and],
    eT = [4, cst_if],
    eU = [4, cst_begin],
    eV = [4, cst_guard_k],
    eW = [4, cst_quote],
    eX = [4, cst_list],
    eY = [4, cst_else],
    eZ = [4, cst_cond],
    e0 = [4, cst_guard_k],
    e1 = [4, cst_fn],
    e2 = [6, [0, [0, 1], 0]],
    e3 = [6, [0, [4, cst$14], 0]],
    e4 = [4, cst_fn],
    e5 = [4, cst_handler_bind],
    e6 = [6, [0, [4, cst_guard_k], 0]],
    e7 = [4, cst_fn],
    e8 = [4, cst_call_cc],
    e9 = [4, cst_guard_result],
    e_ = [4, cst_let];
   function step_sf_guard$0(counter, args, env, kont){
    var
     var_clauses = Sx_runtime[15].call(null, args),
     body = Sx_runtime[16].call(null, args),
     var$ = Sx_runtime[15].call(null, var_clauses),
     clauses = Sx_runtime[16].call(null, var_clauses),
     sentinel = Sx_types[59].call(null, eL),
     b =
       [6, [0, [6, [0, eV, [0, Sx_runtime[19].call(null, eU, body), 0]]], 0]],
     c =
       Sx_runtime[2].call
        (null,
         cst_append,
         [0,
          clauses,
          [0,
           [6,
            [0,
             [6,
              [0,
               eY,
               [0,
                [6,
                 [0, eX, [0, [6, [0, eW, [0, sentinel, 0]]], [0, var$, 0]]]],
                0]]],
             0]],
           0]]),
     d = [6, [0, [6, [0, e0, [0, Sx_runtime[19].call(null, eZ, c), 0]]], 0]],
     e = Sx_runtime[19].call(null, [6, [0, var$, 0]], d),
     f = [0, Sx_runtime[19].call(null, e1, e), 0],
     g = Sx_runtime[19].call(null, e3, e2),
     h = [6, [0, [6, [0, Sx_runtime[19].call(null, e4, g), f]], 0]],
     i = Sx_runtime[19].call(null, h, b),
     j = [6, [0, Sx_runtime[19].call(null, e5, i), 0]],
     k = Sx_runtime[19].call(null, e6, j),
     l = [6, [0, Sx_runtime[19].call(null, e7, k), 0]],
     a =
       [6,
        [0,
         e_,
         [0,
          [6, [0, [6, [0, e9, [0, Sx_runtime[19].call(null, e8, l), 0]]], 0]],
          [0,
           [6,
            [0,
             eT,
             [0,
              [6,
               [0,
                eS,
                [0,
                 eR,
                 [0,
                  eQ,
                  [0,
                   [6,
                    [0, eP, [0, eO, [0, [6, [0, eN, [0, sentinel, 0]]], 0]]]],
                   0]]]]],
              eM]]],
           0]]]];
    return counter < 50
            ? step_eval_list$0(counter + 1 | 0, a, env, kont)
            : caml_trampoline_return(step_eval_list$0, [0, a, env, kont]);
   }
   function step_sf_guard(args, env, kont){
    return caml_trampoline(step_sf_guard$0(0, args, env, kont));
   }
   function step_sf_callcc(args, env, kont){
    var a = kont_push(make_callcc_frame(env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   function step_sf_case(args, env, kont){
    var
     a =
       kont_push
        (make_case_frame(0, Sx_runtime[16].call(null, args), env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var e$ = [2, 1.], fa = [4, cst_begin];
   function step_sf_let_match(args, env, kont){
    var
     pattern = Sx_runtime[15].call(null, args),
     expr = Sx_runtime[18].call(null, args, e$),
     a = Sx_runtime[16].call(null, args),
     body = Sx_runtime[16].call(null, a);
    return step_sf_match
            ([6,
              [0,
               expr,
               [0,
                [6, [0, pattern, [0, Sx_runtime[19].call(null, fa, body), 0]]],
                0]]],
             env,
             kont);
   }
   var
    cst_do_loop = "__do-loop",
    cst_emitted = "emitted",
    cst_every$0 = "every?",
    cst_map_indexed = "map-indexed",
    cst_peek = "peek",
    cst_syntax_rules = "syntax-rules",
    render_check = 0,
    render_fn = 0,
    fb = [0, [3, cst_symbol], 0],
    fc = [6, 0],
    fd = [6, 0],
    fe = [0, [3, cst_symbol], 0],
    ff = [0, [3, cst_if], 0],
    fg = [0, [3, cst_when], 0],
    fh = [0, [3, cst_cond], 0],
    fi = [0, [3, cst_case], 0],
    fj = [0, [3, cst_and], 0],
    fk = [0, [3, cst_or], 0],
    fl = [0, [3, cst_let], 0],
    fm = [0, [3, "let*"], 0],
    fn = [0, [3, cst_lambda], 0],
    fo = [0, [3, cst_fn], 0],
    fp = [0, [3, cst_define], 0],
    fq = [0, [3, "defcomp"], 0],
    fr = [0, [3, "defisland"], 0],
    fs = [0, [3, "defmacro"], 0],
    ft = [0, [3, "defio"], 0],
    fu = [0, [3, cst_define_foreign], 0],
    fv = [0, [3, "io"], 0],
    fw = [0, [3, cst_begin], 0],
    fx = [0, [3, "do"], 0],
    fy = [2, 1.],
    fz = [2, 1.],
    fA = [0, [2, 2.], 0],
    fB = [2, 2.],
    fC = [4, cst_do_loop],
    fD = [4, cst_begin],
    fE = [4, cst_if],
    fF = [2, 1.],
    fG = [4, cst_do_loop],
    fH = [4, cst_let],
    fI = [4, cst_begin],
    fJ = [0, [3, "guard"], 0],
    fK = [0, [3, cst_quote], 0],
    fL = [0, [3, "quasiquote"], 0],
    fM = [0, [3, "->"], 0],
    fN = [0, [3, "->>"], 0],
    fO = [0, [3, "|>"], 0],
    fP = [0, [3, "as->"], 0],
    fQ = [0, [3, "set!"], 0],
    fR = [0, [3, "letrec"], 0],
    fS = [0, [3, cst_reset], 0],
    fT = [0, [3, "shift"], 0],
    fU = [0, [3, cst_deref], 0],
    fV = [0, [3, cst_scope], 0],
    fW = [0, [3, cst_provide], 0],
    fX = [0, [3, cst_peek], 0],
    fY = [0, [3, "provide!"], 0],
    fZ = [0, [3, "context"], 0],
    f0 = [0, [3, cst_bind], 0],
    f1 = [0, [3, "emit!"], 0],
    f2 = [0, [3, cst_emitted], 0],
    f3 = [0, [3, cst_handler_bind], 0],
    f4 = [0, [3, "restart-case"], 0],
    f5 = [0, [3, "signal-condition"], 0],
    f6 = [0, [3, "invoke-restart"], 0],
    f7 = [0, [3, "match"], 0],
    f8 = [0, [3, "let-match"], 0],
    f9 = [0, [3, cst_dynamic_wind], 0],
    f_ = [0, [3, cst_map], 0],
    f$ = [0, [3, cst_map_indexed], 0],
    ga = [0, [3, cst_filter], 0],
    gb = [0, [3, cst_reduce], 0],
    gc = [0, [3, cst_some], 0],
    gd = [0, [3, cst_every$0], 0],
    ge = [0, [3, cst_for_each], 0],
    gf = [0, [3, cst_raise], 0],
    gg = [0, [3, "raise-continuable"], 0],
    gh = [0, 1],
    gi = [0, [3, cst_call_cc], 0],
    gj = [0, [3, "call-with-current-continuation"], 0],
    gk = [0, [3, cst_perform], 0],
    gl = [0, [3, "define-library"], 0],
    gm = [0, [3, cst_import], 0],
    gn = [0, [3, "define-record-type"], 0],
    go = [0, [3, "define-protocol"], 0],
    gp = [0, [3, "implement"], 0],
    gq = [0, [3, cst_parameterize], 0],
    gr = [0, [3, cst_syntax_rules], 0],
    gs = [0, [3, "define-syntax"], 0],
    gt = [0, [3, cst_lambda], 0],
    gu = [0, [3, cst_list], 0];
   function step_eval_list$0(counter, expr$1, env, kont){
    var expr = expr$1;
    for(;;){
     var
      head = Sx_runtime[15].call(null, expr),
      args = Sx_runtime[16].call(null, expr),
      e = [0, Sx_runtime[74].call(null, head), fb],
      or = Sx_runtime[2].call(null, cst, e);
     if(Sx_types[71].call(null, or))
      var or$0 = or;
     else{
      var
       aY = [0, Sx_runtime[74].call(null, head), gt],
       or$1 = Sx_runtime[2].call(null, cst, aY);
      if(Sx_types[71].call(null, or$1))
       var or$0 = or$1;
      else
       var
        aZ = [0, Sx_runtime[74].call(null, head), gu],
        or$0 = Sx_runtime[2].call(null, cst, aZ);
     }
     var f = [0, 1 - Sx_types[71].call(null, or$0)];
     if(Sx_types[71].call(null, f)){
      var g = Sx_runtime[34].call(null, expr);
      if(Sx_types[71].call(null, g)) return make_cek_value(fc, env, kont);
      var
       h =
         kont_push
          (make_map_frame(0, Sx_runtime[16].call(null, expr), fd, env), kont);
      return make_cek_state(Sx_runtime[15].call(null, expr), env, h);
     }
     var
      i = [0, Sx_runtime[74].call(null, head), fe],
      j = Sx_runtime[2].call(null, cst, i);
     if(! Sx_types[71].call(null, j))
      return step_eval_call(head, args, env, kont);
     var
      match_val = Sx_types[72].call(null, head),
      k = Sx_runtime[2].call(null, cst, [0, match_val, ff]);
     if(Sx_types[71].call(null, k)) return step_sf_if(args, env, kont);
     var l = Sx_runtime[2].call(null, cst, [0, match_val, fg]);
     if(Sx_types[71].call(null, l)) return step_sf_when(args, env, kont);
     var m = Sx_runtime[2].call(null, cst, [0, match_val, fh]);
     if(Sx_types[71].call(null, m)) return step_sf_cond(args, env, kont);
     var n = Sx_runtime[2].call(null, cst, [0, match_val, fi]);
     if(Sx_types[71].call(null, n)) return step_sf_case(args, env, kont);
     var o = Sx_runtime[2].call(null, cst, [0, match_val, fj]);
     if(Sx_types[71].call(null, o)) return step_sf_and(args, env, kont);
     var p = Sx_runtime[2].call(null, cst, [0, match_val, fk]);
     if(Sx_types[71].call(null, p)) return step_sf_or(args, env, kont);
     var q = Sx_runtime[2].call(null, cst, [0, match_val, fl]);
     if(Sx_types[71].call(null, q)) return step_sf_let(args, env, kont);
     var r = Sx_runtime[2].call(null, cst, [0, match_val, fm]);
     if(Sx_types[71].call(null, r)) return step_sf_let(args, env, kont);
     var s = Sx_runtime[2].call(null, cst, [0, match_val, fn]);
     if(Sx_types[71].call(null, s)) return step_sf_lambda(args, env, kont);
     var t = Sx_runtime[2].call(null, cst, [0, match_val, fo]);
     if(Sx_types[71].call(null, t)) return step_sf_lambda(args, env, kont);
     var u = Sx_runtime[2].call(null, cst, [0, match_val, fp]);
     if(Sx_types[71].call(null, u)) return step_sf_define(args, env, kont);
     var v = Sx_runtime[2].call(null, cst, [0, match_val, fq]);
     if(Sx_types[71].call(null, v))
      return make_cek_value(sf_defcomp(args, env), env, kont);
     var w = Sx_runtime[2].call(null, cst, [0, match_val, fr]);
     if(Sx_types[71].call(null, w))
      return make_cek_value(sf_defisland(args, env), env, kont);
     var x = Sx_runtime[2].call(null, cst, [0, match_val, fs]);
     if(Sx_types[71].call(null, x))
      return make_cek_value(sf_defmacro(args, env), env, kont);
     var y = Sx_runtime[2].call(null, cst, [0, match_val, ft]);
     if(Sx_types[71].call(null, y))
      return make_cek_value(sf_defio(args, env), env, kont);
     var z = Sx_runtime[2].call(null, cst, [0, match_val, fu]);
     if(Sx_types[71].call(null, z))
      return step_sf_define_foreign(args, env, kont);
     var A = Sx_runtime[2].call(null, cst, [0, match_val, fv]);
     if(Sx_types[71].call(null, A)) return step_sf_io(args, env, kont);
     var B = Sx_runtime[2].call(null, cst, [0, match_val, fw]);
     if(Sx_types[71].call(null, B)) return step_sf_begin(args, env, kont);
     var C = Sx_runtime[2].call(null, cst, [0, match_val, fx]);
     if(! Sx_types[71].call(null, C)) break;
     var
      D = Sx_runtime[34].call(null, args),
      and = [0, 1 - Sx_types[71].call(null, D)];
     if(Sx_types[71].call(null, and)){
      var
       E = Sx_runtime[15].call(null, args),
       and$0 = Sx_runtime[38].call(null, E);
      if(Sx_types[71].call(null, and$0)){
       var
        F = Sx_runtime[15].call(null, args),
        G = Sx_runtime[34].call(null, F),
        and$1 = [0, 1 - Sx_types[71].call(null, G)];
       if(Sx_types[71].call(null, and$1))
        var
         H = Sx_runtime[15].call(null, args),
         I = Sx_runtime[15].call(null, H),
         a = Sx_runtime[38].call(null, I);
       else
        var a = and$1;
      }
      else
       var a = and$0;
     }
     else
      var a = and;
     if(! Sx_types[71].call(null, a)) return step_sf_begin(args, env, kont);
     var
      bindings = Sx_runtime[15].call(null, args),
      test_clause = Sx_runtime[18].call(null, args, fy),
      J = Sx_runtime[16].call(null, args),
      body = Sx_runtime[16].call(null, J),
      K = Sx_runtime[6].call(null, bindings);
     Stdlib_List[20].call
      (null, function(b){return Sx_runtime[15].call(null, b);}, K);
     var L = Sx_runtime[6].call(null, bindings);
     Stdlib_List[20].call
      (null, function(b){return Sx_runtime[18].call(null, b, fz);}, L);
     var
      M = Sx_runtime[6].call(null, bindings),
      steps =
        [6,
         Stdlib_List[20].call
          (null,
           function(b){
            var
             a = [0, Sx_runtime[25].call(null, b), fA],
             c = Sx_runtime[2].call(null, cst$0, a);
            return Sx_types[71].call(null, c)
                    ? Sx_runtime[18].call(null, b, fB)
                    : Sx_runtime[15].call(null, b);
           },
           M)],
      test = Sx_runtime[15].call(null, test_clause),
      result = Sx_runtime[16].call(null, test_clause),
      N = [0, body, [0, [6, [0, Sx_runtime[19].call(null, fC, steps), 0]], 0]],
      O = Sx_runtime[2].call(null, cst_append, N),
      P = [6, [0, Sx_runtime[19].call(null, fD, O), 0]],
      Q = Sx_runtime[34].call(null, result),
      R =
        Sx_types[71].call(null, Q) ? 0 : Sx_runtime[19].call(null, fI, result),
      S = Sx_runtime[19].call(null, R, P),
      T = Sx_runtime[19].call(null, test, S),
      U = [6, [0, Sx_runtime[19].call(null, fE, T), 0]],
      V = Sx_runtime[6].call(null, bindings),
      W =
        [6,
         Stdlib_List[20].call
          (null,
           function(b){
            var a = [0, Sx_runtime[18].call(null, b, fF), 0];
            return [6, [0, Sx_runtime[15].call(null, b), a]];
           },
           V)],
      X = Sx_runtime[19].call(null, W, U),
      Y = Sx_runtime[19].call(null, fG, X),
      expr$0 = Sx_runtime[19].call(null, fH, Y);
     expr = expr$0;
    }
    var Z = Sx_runtime[2].call(null, cst, [0, match_val, fJ]);
    if(Sx_types[71].call(null, Z))
     return counter < 50
             ? step_sf_guard$0(counter + 1 | 0, args, env, kont)
             : caml_trampoline_return(step_sf_guard$0, [0, args, env, kont]);
    var _ = Sx_runtime[2].call(null, cst, [0, match_val, fK]);
    if(Sx_types[71].call(null, _)){
     var
      $ = Sx_runtime[34].call(null, args),
      aa = Sx_types[71].call(null, $) ? 0 : Sx_runtime[15].call(null, args);
     return make_cek_value(aa, env, kont);
    }
    var ab = Sx_runtime[2].call(null, cst, [0, match_val, fL]);
    if(Sx_types[71].call(null, ab))
     return make_cek_value
             (qq_expand(Sx_runtime[15].call(null, args), env), env, kont);
    var ac = Sx_runtime[2].call(null, cst, [0, match_val, fM]);
    if(Sx_types[71].call(null, ac))
     return step_sf_thread_first(args, env, kont);
    var ad = Sx_runtime[2].call(null, cst, [0, match_val, fN]);
    if(Sx_types[71].call(null, ad))
     return step_sf_thread_last(args, env, kont);
    var ae = Sx_runtime[2].call(null, cst, [0, match_val, fO]);
    if(Sx_types[71].call(null, ae))
     return step_sf_thread_last(args, env, kont);
    var af = Sx_runtime[2].call(null, cst, [0, match_val, fP]);
    if(Sx_types[71].call(null, af)) return step_sf_thread_as(args, env, kont);
    var ag = Sx_runtime[2].call(null, cst, [0, match_val, fQ]);
    if(Sx_types[71].call(null, ag)) return step_sf_set_b(args, env, kont);
    var ah = Sx_runtime[2].call(null, cst, [0, match_val, fR]);
    if(Sx_types[71].call(null, ah)) return step_sf_letrec(args, env, kont);
    var ai = Sx_runtime[2].call(null, cst, [0, match_val, fS]);
    if(Sx_types[71].call(null, ai)) return step_sf_reset(args, env, kont);
    var aj = Sx_runtime[2].call(null, cst, [0, match_val, fT]);
    if(Sx_types[71].call(null, aj)) return step_sf_shift(args, env, kont);
    var ak = Sx_runtime[2].call(null, cst, [0, match_val, fU]);
    if(Sx_types[71].call(null, ak)) return step_sf_deref(args, env, kont);
    var al = Sx_runtime[2].call(null, cst, [0, match_val, fV]);
    if(Sx_types[71].call(null, al)) return step_sf_scope(args, env, kont);
    var am = Sx_runtime[2].call(null, cst, [0, match_val, fW]);
    if(Sx_types[71].call(null, am)) return step_sf_provide(args, env, kont);
    var an = Sx_runtime[2].call(null, cst, [0, match_val, fX]);
    if(Sx_types[71].call(null, an)) return step_sf_peek(args, env, kont);
    var ao = Sx_runtime[2].call(null, cst, [0, match_val, fY]);
    if(Sx_types[71].call(null, ao)) return step_sf_provide_b(args, env, kont);
    var ap = Sx_runtime[2].call(null, cst, [0, match_val, fZ]);
    if(Sx_types[71].call(null, ap)) return step_sf_context(args, env, kont);
    var aq = Sx_runtime[2].call(null, cst, [0, match_val, f0]);
    if(Sx_types[71].call(null, aq)) return step_sf_bind(args, env, kont);
    var ar = Sx_runtime[2].call(null, cst, [0, match_val, f1]);
    if(Sx_types[71].call(null, ar)) return step_sf_emit(args, env, kont);
    var as = Sx_runtime[2].call(null, cst, [0, match_val, f2]);
    if(Sx_types[71].call(null, as)) return step_sf_emitted(args, env, kont);
    var at = Sx_runtime[2].call(null, cst, [0, match_val, f3]);
    if(Sx_types[71].call(null, at))
     return step_sf_handler_bind(args, env, kont);
    var au = Sx_runtime[2].call(null, cst, [0, match_val, f4]);
    if(Sx_types[71].call(null, au))
     return step_sf_restart_case(args, env, kont);
    var av = Sx_runtime[2].call(null, cst, [0, match_val, f5]);
    if(Sx_types[71].call(null, av)) return step_sf_signal(args, env, kont);
    var aw = Sx_runtime[2].call(null, cst, [0, match_val, f6]);
    if(Sx_types[71].call(null, aw))
     return step_sf_invoke_restart(args, env, kont);
    var ax = Sx_runtime[2].call(null, cst, [0, match_val, f7]);
    if(Sx_types[71].call(null, ax)) return step_sf_match(args, env, kont);
    var ay = Sx_runtime[2].call(null, cst, [0, match_val, f8]);
    if(Sx_types[71].call(null, ay)) return step_sf_let_match(args, env, kont);
    var az = Sx_runtime[2].call(null, cst, [0, match_val, f9]);
    if(Sx_types[71].call(null, az))
     return step_sf_dynamic_wind(args, env, kont);
    var aA = Sx_runtime[2].call(null, cst, [0, match_val, f_]);
    if(Sx_types[71].call(null, aA)) return step_ho_map(args, env, kont);
    var aB = Sx_runtime[2].call(null, cst, [0, match_val, f$]);
    if(Sx_types[71].call(null, aB))
     return step_ho_map_indexed(args, env, kont);
    var aC = Sx_runtime[2].call(null, cst, [0, match_val, ga]);
    if(Sx_types[71].call(null, aC)) return step_ho_filter(args, env, kont);
    var aD = Sx_runtime[2].call(null, cst, [0, match_val, gb]);
    if(Sx_types[71].call(null, aD)) return step_ho_reduce(args, env, kont);
    var aE = Sx_runtime[2].call(null, cst, [0, match_val, gc]);
    if(Sx_types[71].call(null, aE)) return step_ho_some(args, env, kont);
    var aF = Sx_runtime[2].call(null, cst, [0, match_val, gd]);
    if(Sx_types[71].call(null, aF)) return step_ho_every(args, env, kont);
    var aG = Sx_runtime[2].call(null, cst, [0, match_val, ge]);
    if(Sx_types[71].call(null, aG)) return step_ho_for_each(args, env, kont);
    var aH = Sx_runtime[2].call(null, cst, [0, match_val, gf]);
    if(Sx_types[71].call(null, aH)) return step_sf_raise(args, env, kont);
    var aI = Sx_runtime[2].call(null, cst, [0, match_val, gg]);
    if(Sx_types[71].call(null, aI)){
     var aJ = kont_push(make_raise_eval_frame(env, gh), kont);
     return make_cek_state(Sx_runtime[15].call(null, args), env, aJ);
    }
    var aK = Sx_runtime[2].call(null, cst, [0, match_val, gi]);
    if(Sx_types[71].call(null, aK)) return step_sf_callcc(args, env, kont);
    var aL = Sx_runtime[2].call(null, cst, [0, match_val, gj]);
    if(Sx_types[71].call(null, aL)) return step_sf_callcc(args, env, kont);
    var aM = Sx_runtime[2].call(null, cst, [0, match_val, gk]);
    if(Sx_types[71].call(null, aM)) return step_sf_perform(args, env, kont);
    var aN = Sx_runtime[2].call(null, cst, [0, match_val, gl]);
    if(Sx_types[71].call(null, aN))
     return step_sf_define_library(args, env, kont);
    var aO = Sx_runtime[2].call(null, cst, [0, match_val, gm]);
    if(Sx_types[71].call(null, aO)) return step_sf_import(args, env, kont);
    var aP = Sx_runtime[2].call(null, cst, [0, match_val, gn]);
    if(Sx_types[71].call(null, aP))
     return make_cek_value(sf_define_record_type(args, env), env, kont);
    var aQ = Sx_runtime[2].call(null, cst, [0, match_val, go]);
    if(Sx_types[71].call(null, aQ))
     return make_cek_value(sf_define_protocol(args, env), env, kont);
    var aR = Sx_runtime[2].call(null, cst, [0, match_val, gp]);
    if(Sx_types[71].call(null, aR))
     return make_cek_value(sf_implement(args, env), env, kont);
    var aS = Sx_runtime[2].call(null, cst, [0, match_val, gq]);
    if(Sx_types[71].call(null, aS))
     return step_sf_parameterize(args, env, kont);
    var aT = Sx_runtime[2].call(null, cst, [0, match_val, gr]);
    if(Sx_types[71].call(null, aT))
     return make_cek_value(sf_syntax_rules(args, env), env, kont);
    var aU = Sx_runtime[2].call(null, cst, [0, match_val, gs]);
    if(Sx_types[71].call(null, aU)) return step_sf_define(args, env, kont);
    var
     and$2 =
       Sx_runtime[2].call
        (null, cst_has_key, [0, custom_special_forms, [0, match_val, 0]]);
    if(Sx_types[71].call(null, and$2))
     var
      aV = Sx_runtime[76].call(null, env, match_val),
      b = [0, 1 - Sx_types[71].call(null, aV)];
    else
     var b = and$2;
    if(Sx_types[71].call(null, b))
     return make_cek_value
             (cek_call
               (Sx_runtime[26].call(null, custom_special_forms, match_val),
                [6, [0, args, [0, env, 0]]]),
              env,
              kont);
    var and$3 = Sx_runtime[76].call(null, env, match_val);
    if(Sx_types[71].call(null, and$3))
     var
      aW = Sx_runtime[77].call(null, env, match_val),
      c = Sx_runtime[89].call(null, aW);
    else
     var c = and$3;
    if(Sx_types[71].call(null, c)){
     var mac = Sx_runtime[77].call(null, env, match_val);
     return make_cek_state(expand_macro(mac, args, env), env, kont);
    }
    if(Sx_types[71].call(null, render_check))
     var
      aX = Sx_runtime[76].call(null, env, match_val),
      and$4 = [0, 1 - Sx_types[71].call(null, aX)],
      d =
        Sx_types[71].call(null, and$4)
         ? cek_call(render_check, [6, [0, expr, [0, env, 0]]])
         : and$4;
    else
     var d = render_check;
    return Sx_types[71].call(null, d)
            ? make_cek_value
              (cek_call(render_fn, [6, [0, expr, [0, env, 0]]]), env, kont)
            : step_eval_call(head, args, env, kont);
   }
   function step_eval_list(expr, env, kont){
    return caml_trampoline(step_eval_list$0(0, expr, env, kont));
   }
   var
    gv = [6, 0],
    gw = [0, [3, cst_provide], 0],
    gx = [3, cst_value],
    gy = [6, 0],
    gz = [6, 0],
    gA = [3, cst_name],
    gB = [3, cst_env];
   function kont_extract_provides(kont){
    var a = Sx_runtime[34].call(null, kont);
    if(Sx_types[71].call(null, a)) return gv;
    var
     frame = Sx_runtime[15].call(null, kont),
     rest_frames = kont_extract_provides(Sx_runtime[16].call(null, kont)),
     b = [0, frame_type(frame), gw],
     c = Sx_runtime[2].call(null, cst, b);
    if(! Sx_types[71].call(null, c)) return rest_frames;
    var
     d = Sx_runtime[26].call(null, frame, gx),
     e = Sx_runtime[26].call(null, frame, gA),
     f =
       [23,
        [0,
         cst_provide,
         Sx_runtime[26].call(null, frame, gB),
         e,
         0,
         gz,
         0,
         0,
         gy,
         d,
         0]];
    return Sx_runtime[19].call(null, f, rest_frames);
   }
   var
    cst_contains = "contains?",
    provide_batch_depth_ref = [],
    provide_batch_queue_ref = [],
    provide_subscribers_ref = [],
    gC = [0, [2, 0.], 0],
    gD = [6, [0, 0, 0]];
   function fire_provide_subscribers(name){
    var subs = Sx_runtime[26].call(null, provide_subscribers_ref[1], name);
    if(Sx_types[71].call(null, subs))
     var
      b = Sx_runtime[34].call(null, subs),
      a = [0, 1 - Sx_types[71].call(null, b)];
    else
     var a = subs;
    if(! Sx_types[71].call(null, a)) return 0;
    var
     c = Sx_runtime[2].call(null, cst$0, [0, provide_batch_depth_ref[1], gC]);
    if(Sx_types[71].call(null, c)){
     var d = Sx_runtime[6].call(null, subs);
     Stdlib_List[18].call
      (null,
       function(sub){
        var
         a =
           Sx_runtime[2].call
            (null, cst_contains, [0, provide_batch_queue_ref[1], [0, sub, 0]]),
         b = [0, 1 - Sx_types[71].call(null, a)];
        if(Sx_types[71].call(null, b))
         provide_batch_queue_ref[1] =
          Sx_runtime[11].call(null, provide_batch_queue_ref[1], sub);
        return 0;
       },
       d);
     return 0;
    }
    var e = Sx_runtime[6].call(null, subs);
    Stdlib_List[18].call(null, function(sub){cek_call(sub, gD); return 0;}, e);
    return 0;
   }
   var gE = [0, [2, 1.], 0];
   function batch_begin_b(param){
    provide_batch_depth_ref[1] =
     Sx_runtime[2].call(null, cst$8, [0, provide_batch_depth_ref[1], gE]);
    return 0;
   }
   var
    gF = [0, [2, 1.], 0],
    gG = [0, [2, 0.], 0],
    gH = [6, 0],
    gI = [6, [0, 0, 0]];
   function batch_end_b(param){
    provide_batch_depth_ref[1] =
     Sx_runtime[2].call(null, cst$5, [0, provide_batch_depth_ref[1], gF]);
    var
     a = Sx_runtime[2].call(null, cst, [0, provide_batch_depth_ref[1], gG]);
    if(! Sx_types[71].call(null, a)) return 0;
    var queue = provide_batch_queue_ref[1];
    provide_batch_queue_ref[1] = gH;
    var b = Sx_runtime[6].call(null, queue);
    Stdlib_List[18].call(null, function(sub){cek_call(sub, gI); return 0;}, b);
    return 0;
   }
   var bind_tracking_ref = [], gJ = [6, 0];
   function step_sf_bind(args, env, kont){
    var body = Sx_runtime[15].call(null, args), prev = bind_tracking_ref[1];
    bind_tracking_ref[1] = gJ;
    return make_cek_state
            (body, env, kont_push(make_bind_frame(body, env, prev), kont));
   }
   var gK = [6, 0];
   function step_sf_parameterize(args, env, kont){
    var
     bindings = Sx_runtime[15].call(null, args),
     body = Sx_runtime[16].call(null, args),
     or = Sx_runtime[84].call(null, bindings),
     or$0 =
       Sx_types[71].call(null, or) ? or : Sx_runtime[34].call(null, bindings);
    if(Sx_types[71].call(null, or$0)) return step_sf_begin(body, env, kont);
    var
     first_pair = Sx_runtime[15].call(null, bindings),
     a = kont_push(make_parameterize_frame(bindings, 0, gK, body, env), kont);
    return make_cek_state(Sx_runtime[15].call(null, first_pair), env, a);
   }
   var gL = [0, [3, cst$14], 0], gM = [2, 0.], gN = [2, 0.];
   function syntax_rules_match(pattern, form, literals){
    var and = Sx_runtime[40].call(null, pattern);
    if(Sx_types[71].call(null, and))
     var
      e = [0, Sx_types[72].call(null, pattern), gL],
      a = Sx_runtime[2].call(null, cst, e);
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     return [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
    var and$0 = Sx_runtime[40].call(null, pattern);
    if(Sx_types[71].call(null, and$0))
     var
      f = [0, literals, [0, Sx_types[72].call(null, pattern), 0]],
      b = Sx_runtime[2].call(null, cst_contains, f);
    else
     var b = and$0;
    if(Sx_types[71].call(null, b)){
     var and$1 = Sx_runtime[40].call(null, form);
     if(Sx_types[71].call(null, and$1))
      var
       g = [0, Sx_types[72].call(null, form), 0],
       h = [0, Sx_types[72].call(null, pattern), g],
       c = Sx_runtime[2].call(null, cst, h);
     else
      var c = and$1;
     return Sx_types[71].call(null, c)
             ? [7, Stdlib_Hashtbl[1].call(null, 0, 0)]
             : 0;
    }
    var i = Sx_runtime[40].call(null, pattern);
    if(Sx_types[71].call(null, i)){
     var
      d = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
      j = Sx_types[72].call(null, pattern);
     Sx_runtime[12].call(null, d, j, form);
     return d;
    }
    var
     and$2 = Sx_runtime[38].call(null, pattern),
     k =
       Sx_types[71].call(null, and$2)
        ? Sx_runtime[34].call(null, pattern)
        : and$2;
    if(Sx_types[71].call(null, k)){
     var
      and$3 = Sx_runtime[38].call(null, form),
      l =
        Sx_types[71].call(null, and$3)
         ? Sx_runtime[34].call(null, form)
         : and$3;
     return Sx_types[71].call(null, l)
             ? [7, Stdlib_Hashtbl[1].call(null, 0, 0)]
             : 0;
    }
    var
     and$4 = Sx_runtime[38].call(null, pattern),
     m =
       Sx_types[71].call(null, and$4)
        ? Sx_runtime[38].call(null, form)
        : and$4;
    if(Sx_types[71].call(null, m))
     return syntax_rules_match_list(pattern, gN, form, gM, literals);
    var n = Sx_runtime[2].call(null, cst, [0, pattern, [0, form, 0]]);
    return Sx_types[71].call(null, n)
            ? [7, Stdlib_Hashtbl[1].call(null, 0, 0)]
            : 0;
   }
   var
    cst$15 = "...",
    gO = [0, [2, 1.], 0],
    gP = [0, [2, 1.], 0],
    gQ = [0, [3, cst$15], 0],
    gR = [0, [2, 1.], 0],
    gS = [0, [2, 2.], 0],
    gT = [0, [2, 2.], 0],
    gU = [0, [2, 0.], 0],
    gV = [0, 0, 0],
    gW = [0, [2, 2.], 0],
    gX = [0, [2, 1.], 0],
    gY = [0, [2, 1.], 0];
   function syntax_rules_match_list(pattern, pi, form, fi, literals){
    var
     plen = Sx_runtime[25].call(null, pattern),
     flen = Sx_runtime[25].call(null, form),
     and = Sx_runtime[2].call(null, cst$2, [0, pi, [0, plen, 0]]),
     b =
       Sx_types[71].call(null, and)
        ? Sx_runtime[2].call(null, cst$2, [0, fi, [0, flen, 0]])
        : and;
    if(Sx_types[71].call(null, b))
     return [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
    var c = Sx_runtime[2].call(null, cst$2, [0, pi, [0, plen, 0]]);
    if(Sx_types[71].call(null, c)) return 0;
    var
     d = [0, Sx_runtime[2].call(null, cst$8, [0, pi, gO]), [0, plen, 0]],
     and$0 = Sx_runtime[2].call(null, cst$3, d);
    if(Sx_types[71].call(null, and$0)){
     var
      e = Sx_runtime[2].call(null, cst$8, [0, pi, gP]),
      f = Sx_runtime[18].call(null, pattern, e),
      and$1 = Sx_runtime[40].call(null, f);
     if(Sx_types[71].call(null, and$1))
      var
       g = Sx_runtime[2].call(null, cst$8, [0, pi, gR]),
       h = Sx_runtime[18].call(null, pattern, g),
       i = [0, Sx_types[72].call(null, h), gQ],
       a = Sx_runtime[2].call(null, cst, i);
     else
      var a = and$1;
    }
    else
     var a = and$0;
    if(Sx_types[71].call(null, a)){
     var
      sub_pat = Sx_runtime[18].call(null, pattern, pi),
      j = [0, plen, [0, Sx_runtime[2].call(null, cst$8, [0, pi, gS]), 0]];
     Sx_runtime[2].call(null, cst$5, j);
     Sx_runtime[2].call(null, cst$5, [0, flen, [0, fi, 0]]);
     var
      k = [0, plen, [0, Sx_runtime[2].call(null, cst$8, [0, pi, gT]), 0]],
      l = [0, Sx_runtime[2].call(null, cst$5, k), 0],
      m = [0, Sx_runtime[2].call(null, cst$5, [0, flen, [0, fi, 0]]), l],
      n_ellipsis = Sx_runtime[2].call(null, cst$5, m),
      n = Sx_runtime[2].call(null, cst$3, [0, n_ellipsis, gU]);
     if(Sx_types[71].call(null, n)) return 0;
     var
      o =
        [0,
         form,
         [0,
          fi,
          [0, Sx_runtime[2].call(null, cst$8, [0, fi, [0, n_ellipsis, 0]]), 0]]];
     Sx_runtime[2].call(null, cst_slice, o);
     var
      p =
        [0,
         form,
         [0,
          fi,
          [0, Sx_runtime[2].call(null, cst$8, [0, fi, [0, n_ellipsis, 0]]), 0]]],
      q = Sx_runtime[2].call(null, cst_slice, p),
      r = Sx_runtime[6].call(null, q),
      sub_bindings =
        [6,
         Stdlib_List[20].call
          (null,
           function(f){return syntax_rules_match(sub_pat, f, literals);},
           r)],
      s = Sx_runtime[2].call(null, cst_contains, [0, sub_bindings, gV]);
     if(Sx_types[71].call(null, s)) return 0;
     var
      t = Sx_runtime[2].call(null, cst$8, [0, fi, [0, n_ellipsis, 0]]),
      rest_result =
        syntax_rules_match_list
         (pattern,
          Sx_runtime[2].call(null, cst$8, [0, pi, gW]),
          form,
          t,
          literals),
      u = Sx_runtime[84].call(null, rest_result);
     if(Sx_types[71].call(null, u)) return 0;
     var
      merged = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
      v = Sx_runtime[6].call(null, sub_bindings);
     Stdlib_List[18].call
      (null,
       function(b){
        var
         a = Sx_runtime[2].call(null, cst_keys, [0, b, 0]),
         c = Sx_runtime[6].call(null, a);
        Stdlib_List[18].call
         (null,
          function(key){
           var
            existing = Sx_runtime[57].call(null, merged, key),
            a = Sx_runtime[84].call(null, existing);
           if(Sx_types[71].call(null, a)){
            var c = [6, [0, Sx_runtime[26].call(null, b, key), 0]];
            Sx_runtime[12].call(null, merged, key, c);
           }
           else{
            var
             d =
               [0,
                existing,
                [0, [6, [0, Sx_runtime[26].call(null, b, key), 0]], 0]],
             e = Sx_runtime[2].call(null, cst_append, d);
            Sx_runtime[12].call(null, merged, key, e);
           }
           return 0;
          },
          c);
        return 0;
       },
       v);
     var
      w = Sx_runtime[2].call(null, cst_keys, [0, rest_result, 0]),
      x = Sx_runtime[6].call(null, w);
     Stdlib_List[18].call
      (null,
       function(key){
        var a = Sx_runtime[26].call(null, rest_result, key);
        Sx_runtime[12].call(null, merged, key, a);
        return 0;
       },
       x);
     return merged;
    }
    var y = Sx_runtime[2].call(null, cst$2, [0, fi, [0, flen, 0]]);
    if(Sx_types[71].call(null, y)) return 0;
    var
     z = Sx_runtime[18].call(null, form, fi),
     sub_result =
       syntax_rules_match(Sx_runtime[18].call(null, pattern, pi), z, literals),
     A = Sx_runtime[84].call(null, sub_result);
    if(Sx_types[71].call(null, A)) return 0;
    var
     B = Sx_runtime[2].call(null, cst$8, [0, fi, gX]),
     rest_result$0 =
       syntax_rules_match_list
        (pattern,
         Sx_runtime[2].call(null, cst$8, [0, pi, gY]),
         form,
         B,
         literals),
     C = Sx_runtime[84].call(null, rest_result$0);
    if(Sx_types[71].call(null, C)) return 0;
    var
     D = Sx_runtime[2].call(null, cst_keys, [0, sub_result, 0]),
     E = Sx_runtime[6].call(null, D);
    Stdlib_List[18].call
     (null,
      function(key){
       var a = Sx_runtime[26].call(null, sub_result, key);
       Sx_runtime[12].call(null, rest_result$0, key, a);
       return 0;
      },
      E);
    return rest_result$0;
   }
   function syntax_rules_find_var(template, bindings){
    var and = Sx_runtime[40].call(null, template);
    if(Sx_types[71].call(null, and)){
     var
      b = [0, bindings, [0, Sx_types[72].call(null, template), 0]],
      and$0 = Sx_runtime[2].call(null, cst_has_key, b);
     if(Sx_types[71].call(null, and$0))
      var
       c = Sx_types[72].call(null, template),
       d = Sx_runtime[26].call(null, bindings, c),
       a = Sx_runtime[38].call(null, d);
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a)) return Sx_types[72].call(null, template);
    var e = Sx_runtime[38].call(null, template);
    if(! Sx_types[71].call(null, e)) return 0;
    var f = Sx_runtime[6].call(null, template);
    return Stdlib_List[26].call
            (null,
             function(found, t){
              var a = Sx_runtime[84].call(null, found);
              return Sx_types[71].call(null, a)
                      ? syntax_rules_find_var(t, bindings)
                      : found;
             },
             0,
             f);
   }
   var gZ = [6, 0], g0 = [6, 0];
   function syntax_rules_find_all_vars(template, bindings){
    var and = Sx_runtime[40].call(null, template);
    if(Sx_types[71].call(null, and)){
     var
      b = [0, bindings, [0, Sx_types[72].call(null, template), 0]],
      and$0 = Sx_runtime[2].call(null, cst_has_key, b);
     if(Sx_types[71].call(null, and$0))
      var
       c = Sx_types[72].call(null, template),
       d = Sx_runtime[26].call(null, bindings, c),
       a = Sx_runtime[38].call(null, d);
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     return [6, [0, Sx_types[72].call(null, template), 0]];
    var e = Sx_runtime[38].call(null, template);
    if(! Sx_types[71].call(null, e)) return g0;
    var f = Sx_runtime[6].call(null, template);
    return Stdlib_List[26].call
            (null,
             function(acc, t){
              var
               a = [0, acc, [0, syntax_rules_find_all_vars(t, bindings), 0]];
              return Sx_runtime[2].call(null, cst_append, a);
             },
             gZ,
             f);
   }
   var g1 = [2, 0.];
   function syntax_rules_instantiate(template, bindings){
    var and = Sx_runtime[40].call(null, template);
    if(Sx_types[71].call(null, and))
     var
      b = [0, bindings, [0, Sx_types[72].call(null, template), 0]],
      a = Sx_runtime[2].call(null, cst_has_key, b);
    else
     var a = and;
    if(Sx_types[71].call(null, a)){
     var c = Sx_types[72].call(null, template);
     return Sx_runtime[26].call(null, bindings, c);
    }
    var
     d = Sx_runtime[38].call(null, template),
     e = [0, 1 - Sx_types[71].call(null, d)];
    if(Sx_types[71].call(null, e)) return template;
    var f = Sx_runtime[34].call(null, template);
    return Sx_types[71].call(null, f)
            ? template
            : syntax_rules_instantiate_list(template, g1, bindings);
   }
   var
    g2 = [6, 0],
    g3 = [0, [2, 1.], 0],
    g4 = [0, [2, 1.], 0],
    g5 = [0, [3, cst$15], 0],
    g6 = [0, [2, 1.], 0],
    g7 = [0, [2, 2.], 0],
    g8 = [0, [2, 2.], 0],
    g9 = [0, [2, 1.], 0];
   function syntax_rules_instantiate_list(template, i$1, bindings){
    var i = i$1;
    for(;;){
     var
      a = [0, i, [0, Sx_runtime[25].call(null, template), 0]],
      b = Sx_runtime[2].call(null, cst$2, a);
     if(Sx_types[71].call(null, b)) return g2;
     var
      elem = Sx_runtime[18].call(null, template, i),
      c = [0, Sx_runtime[25].call(null, template), 0],
      d = [0, Sx_runtime[2].call(null, cst$8, [0, i, g3]), c],
      and = Sx_runtime[2].call(null, cst$3, d);
     if(Sx_types[71].call(null, and)){
      var
       e = Sx_runtime[2].call(null, cst$8, [0, i, g4]),
       f = Sx_runtime[18].call(null, template, e),
       and$0 = Sx_runtime[40].call(null, f);
      if(Sx_types[71].call(null, and$0))
       var
        g = Sx_runtime[2].call(null, cst$8, [0, i, g6]),
        h = Sx_runtime[18].call(null, template, g),
        j = [0, Sx_types[72].call(null, h), g5],
        has_ellipsis = Sx_runtime[2].call(null, cst, j);
      else
       var has_ellipsis = and$0;
     }
     else
      var has_ellipsis = and;
     if(! Sx_types[71].call(null, has_ellipsis)){
      var
       p =
         syntax_rules_instantiate_list
          (template, Sx_runtime[2].call(null, cst$8, [0, i, g9]), bindings),
       q = syntax_rules_instantiate(elem, bindings);
      return Sx_runtime[19].call(null, q, p);
     }
     var
      all_vars = syntax_rules_find_all_vars(elem, bindings),
      k = Sx_runtime[34].call(null, all_vars);
     if(! Sx_types[71].call(null, k)) break;
     var i$0 = Sx_runtime[2].call(null, cst$8, [0, i, g7]);
     i = i$0;
    }
    var
     l = Sx_runtime[15].call(null, all_vars),
     m = Sx_runtime[26].call(null, bindings, l),
     count = Sx_runtime[25].call(null, m),
     n = Sx_runtime[2].call(null, cst_range, [0, count, 0]),
     o = Sx_runtime[6].call(null, n),
     expanded =
       [6,
        Stdlib_List[20].call
         (null,
          function(idx){
           var
            b = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
            a = Sx_runtime[2].call(null, cst_keys, [0, bindings, 0]),
            c = Sx_runtime[6].call(null, a);
           Stdlib_List[18].call
            (null,
             function(key){
              var a = Sx_runtime[26].call(null, bindings, key);
              Sx_runtime[12].call(null, b, key, a);
              return 0;
             },
             c);
           var d = Sx_runtime[6].call(null, all_vars);
           Stdlib_List[18].call
            (null,
             function(var_name){
              var
               a = Sx_runtime[26].call(null, bindings, var_name),
               c = Sx_runtime[18].call(null, a, idx);
              Sx_runtime[12].call(null, b, var_name, c);
              return 0;
             },
             d);
           return syntax_rules_instantiate(elem, b);
          },
          o)],
     rest_result =
       syntax_rules_instantiate_list
        (template, Sx_runtime[2].call(null, cst$8, [0, i, g8]), bindings);
    return Sx_runtime[2].call
            (null, cst_append, [0, expanded, [0, rest_result, 0]]);
   }
   var g_ = [3, cst$14];
   function syntax_rules_expand(literals, rules, form){
    var
     a = Sx_types[59].call(null, g_),
     full_form = Sx_runtime[19].call(null, a, form);
    return syntax_rules_try_rules(literals, rules, full_form);
   }
   var g$ = [3, "syntax-rules: no pattern matched for "], ha = [2, 1.];
   function syntax_rules_try_rules(literals, rules$1, full_form){
    var rules = rules$1;
    for(;;){
     var a = Sx_runtime[34].call(null, rules);
     if(Sx_types[71].call(null, a)){
      var
       b = [0, g$, [0, Sx_runtime[69].call(null, full_form), 0]],
       c = [3, Sx_runtime[5].call(null, b)],
       d = Sx_runtime[3].call(null, c);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
     }
     var
      rule = Sx_runtime[15].call(null, rules),
      pattern = Sx_runtime[15].call(null, rule),
      template = Sx_runtime[18].call(null, rule, ha),
      bindings = syntax_rules_match(pattern, full_form, literals),
      e = Sx_runtime[84].call(null, bindings),
      f = [0, 1 - Sx_types[71].call(null, e)];
     if(Sx_types[71].call(null, f))
      return syntax_rules_instantiate(template, bindings);
     var rules$0 = Sx_runtime[16].call(null, rules);
     rules = rules$0;
    }
   }
   var
    hb = [3, cst_sr_literals],
    hc = [3, cst_sr_rules],
    hd = [3, cst_syntax_rules],
    he = [4, cst_syntax_rules_body],
    hf = [3, "__sr-form"],
    hg = [6, 0],
    hh = [6, 0];
   function sf_syntax_rules(args, env){
    var a = Sx_runtime[15].call(null, args), b = Sx_runtime[38].call(null, a);
    if(Sx_types[71].call(null, b))
     var
      c = Sx_runtime[15].call(null, args),
      d = Sx_runtime[6].call(null, c),
      literals =
        [6,
         Stdlib_List[20].call
          (null,
           function(s){
            var a = Sx_runtime[40].call(null, s);
            return Sx_types[71].call(null, a)
                    ? Sx_types[72].call(null, s)
                    : [3, Sx_runtime[5].call(null, [0, s, 0])];
           },
           d)];
    else
     var literals = hh;
    var
     rules = Sx_runtime[16].call(null, args),
     closure = Sx_runtime[81].call(null, env),
     e = Sx_runtime[4].call(null, hb);
    Sx_runtime[78].call(null, closure, e, literals);
    var f = Sx_runtime[4].call(null, hc);
    Sx_runtime[78].call(null, closure, f, rules);
    return Sx_types[57].call(null, hg, hf, he, closure, hd);
   }
   var
    hi = [6, 0],
    hj = [6, 0],
    hk = [0, [3, "export"], 0],
    hl = [0, [3, cst_import], 0],
    hm = [0, [3, cst_begin], 0];
   function step_sf_define_library(args, env, kont){
    var
     lib_spec = Sx_runtime[15].call(null, args),
     decls = Sx_runtime[16].call(null, args),
     lib_env = Sx_runtime[81].call(null, env),
     a = Sx_runtime[6].call(null, decls),
     exports = [0, hi],
     body_forms = [0, hj];
    Stdlib_List[18].call
     (null,
      function(decl){
       var and = Sx_runtime[38].call(null, decl);
       if(Sx_types[71].call(null, and)){
        var
         b = Sx_runtime[34].call(null, decl),
         and$0 = [0, 1 - Sx_types[71].call(null, b)];
        if(Sx_types[71].call(null, and$0))
         var
          c = Sx_runtime[15].call(null, decl),
          a = Sx_runtime[40].call(null, c);
        else
         var a = and$0;
       }
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         d = Sx_runtime[15].call(null, decl),
         kind = Sx_types[72].call(null, d),
         e = Sx_runtime[2].call(null, cst, [0, kind, hk]);
        if(Sx_types[71].call(null, e)){
         var
          f = Sx_runtime[16].call(null, decl),
          g = Sx_runtime[6].call(null, f),
          h =
            [0,
             [6,
              Stdlib_List[20].call
               (null,
                function(s){
                 var a = Sx_runtime[40].call(null, s);
                 return Sx_types[71].call(null, a)
                         ? Sx_types[72].call(null, s)
                         : [3, Sx_runtime[5].call(null, [0, s, 0])];
                },
                g)],
             0];
         exports[1] = Sx_runtime[2].call(null, cst_append, [0, exports[1], h]);
        }
        else{
         var i = Sx_runtime[2].call(null, cst, [0, kind, hl]);
         if(Sx_types[71].call(null, i)){
          var
           j = Sx_runtime[16].call(null, decl),
           k = Sx_runtime[6].call(null, j);
          Stdlib_List[18].call
           (null,
            function(import_set){
             bind_import_set(import_set, lib_env);
             return 0;
            },
            k);
         }
         else{
          var l = Sx_runtime[2].call(null, cst, [0, kind, hm]);
          if(Sx_types[71].call(null, l)){
           var m = [0, Sx_runtime[16].call(null, decl), 0];
           body_forms[1] =
            Sx_runtime[2].call(null, cst_append, [0, body_forms[1], m]);
          }
         }
        }
       }
       return 0;
      },
      a);
    var b = Sx_runtime[6].call(null, body_forms[1]);
    Stdlib_List[18].call
     (null, function(form){eval_expr(form, lib_env); return 0;}, b);
    var
     export_dict = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
     c = Sx_runtime[6].call(null, exports[1]);
    Stdlib_List[18].call
     (null,
      function(name){
       var a = Sx_runtime[76].call(null, lib_env, name);
       if(Sx_types[71].call(null, a)){
        var b = Sx_runtime[77].call(null, lib_env, name);
        Sx_runtime[12].call(null, export_dict, name, b);
       }
       return 0;
      },
      c);
    register_library(lib_spec, export_dict);
    return make_cek_value(0, env, kont);
   }
   var
    cst_except = "except",
    cst_only = "only",
    cst_prefix = "prefix",
    cst_rename = "rename",
    hn = [0, [3, cst_only], 0],
    ho = [2, 1.],
    hp = [0, [3, cst_only], 0],
    hq = [0, [3, cst_prefix], 0],
    hr = [2, 2.],
    hs = [0, [3, cst_except], 0],
    ht = [0, [3, cst_prefix], 0],
    hu = [0, [3, cst_rename], 0];
   function bind_import_set(import_set, env){
    var and = Sx_runtime[38].call(null, import_set);
    if(Sx_types[71].call(null, and)){
     var
      b = Sx_runtime[34].call(null, import_set),
      and$0 = [0, 1 - Sx_types[71].call(null, b)];
     if(Sx_types[71].call(null, and$0))
      var
       c = Sx_runtime[15].call(null, import_set),
       a = Sx_runtime[40].call(null, c);
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     var
      d = Sx_runtime[15].call(null, import_set),
      head = Sx_types[72].call(null, d);
    else
     var head = 0;
    var or = Sx_runtime[2].call(null, cst, [0, head, hn]);
    if(Sx_types[71].call(null, or))
     var or$0 = or;
    else{
     var or$1 = Sx_runtime[2].call(null, cst, [0, head, hs]);
     if(Sx_types[71].call(null, or$1))
      var or$0 = or$1;
     else
      var
       or$2 = Sx_runtime[2].call(null, cst, [0, head, ht]),
       or$0 =
         Sx_types[71].call(null, or$2)
          ? or$2
          : Sx_runtime[2].call(null, cst, [0, head, hu]);
    }
    var
     lib_spec =
       Sx_types[71].call(null, or$0)
        ? Sx_runtime[18].call(null, import_set, ho)
        : import_set,
     exports = library_exports(lib_spec),
     e = Sx_runtime[2].call(null, cst, [0, head, hp]);
    if(Sx_types[71].call(null, e)){
     var
      f = Sx_runtime[16].call(null, import_set),
      g = Sx_runtime[16].call(null, f),
      h = Sx_runtime[6].call(null, g);
     Stdlib_List[18].call
      (null,
       function(s){
        var
         a = Sx_runtime[40].call(null, s),
         id =
           Sx_types[71].call(null, a)
            ? Sx_types[72].call(null, s)
            : [3, Sx_runtime[5].call(null, [0, s, 0])],
         b = Sx_runtime[2].call(null, cst_has_key, [0, exports, [0, id, 0]]);
        if(Sx_types[71].call(null, b)){
         var
          c = Sx_runtime[26].call(null, exports, id),
          d = Sx_runtime[4].call(null, id);
         Sx_runtime[78].call(null, env, d, c);
        }
        return 0;
       },
       h);
     return 0;
    }
    var i = Sx_runtime[2].call(null, cst, [0, head, hq]);
    if(Sx_types[71].call(null, i)){
     var
      j = [0, Sx_runtime[18].call(null, import_set, hr), 0],
      pfx = [3, Sx_runtime[5].call(null, j)],
      k = Sx_runtime[2].call(null, cst_keys, [0, exports, 0]),
      l = Sx_runtime[6].call(null, k);
     Stdlib_List[18].call
      (null,
       function(key){
        var
         a = Sx_runtime[26].call(null, exports, key),
         b = [3, Sx_runtime[5].call(null, [0, pfx, [0, key, 0]])],
         c = Sx_runtime[4].call(null, b);
        Sx_runtime[78].call(null, env, c, a);
        return 0;
       },
       l);
     return 0;
    }
    var
     m = Sx_runtime[2].call(null, cst_keys, [0, exports, 0]),
     n = Sx_runtime[6].call(null, m);
    Stdlib_List[18].call
     (null,
      function(key){
       var
        a = Sx_runtime[26].call(null, exports, key),
        b = Sx_runtime[4].call(null, key);
       Sx_runtime[78].call(null, env, b, a);
       return 0;
      },
      n);
    return 0;
   }
   var
    hv = [0, [3, cst_only], 0],
    hw = [2, 1.],
    hx = [3, cst_import],
    hy = [0, [3, cst_except], 0],
    hz = [0, [3, cst_prefix], 0],
    hA = [0, [3, cst_rename], 0];
   function step_sf_import(args$0, env, kont){
    var args = args$0;
    for(;;){
     var b = Sx_runtime[34].call(null, args);
     if(Sx_types[71].call(null, b)) return make_cek_value(0, env, kont);
     var
      import_set = Sx_runtime[15].call(null, args),
      rest_sets = Sx_runtime[16].call(null, args),
      and = Sx_runtime[38].call(null, import_set);
     if(Sx_types[71].call(null, and)){
      var
       c = Sx_runtime[34].call(null, import_set),
       and$0 = [0, 1 - Sx_types[71].call(null, c)];
      if(Sx_types[71].call(null, and$0))
       var
        e = Sx_runtime[15].call(null, import_set),
        a = Sx_runtime[40].call(null, e);
      else
       var a = and$0;
     }
     else
      var a = and;
     if(Sx_types[71].call(null, a))
      var
       f = Sx_runtime[15].call(null, import_set),
       head = Sx_types[72].call(null, f);
     else
      var head = 0;
     var or = Sx_runtime[2].call(null, cst, [0, head, hv]);
     if(Sx_types[71].call(null, or))
      var or$0 = or;
     else{
      var or$1 = Sx_runtime[2].call(null, cst, [0, head, hy]);
      if(Sx_types[71].call(null, or$1))
       var or$0 = or$1;
      else
       var
        or$2 = Sx_runtime[2].call(null, cst, [0, head, hz]),
        or$0 =
          Sx_types[71].call(null, or$2)
           ? or$2
           : Sx_runtime[2].call(null, cst, [0, head, hA]);
     }
     var
      lib_spec =
        Sx_types[71].call(null, or$0)
         ? Sx_runtime[18].call(null, import_set, hw)
         : import_set,
      g = library_loaded_p(lib_spec);
     if(! Sx_types[71].call(null, g)){
      var
       i = kont_push(make_import_frame(import_set, rest_sets, env), kont),
       d = Stdlib_Hashtbl[1].call(null, 0, 2);
      Stdlib_Hashtbl[11].call(null, d, "library", lib_spec);
      Stdlib_Hashtbl[11].call(null, d, cst_op, hx);
      return make_cek_suspended([7, d], env, i);
     }
     bind_import_set(import_set, env);
     var h = Sx_runtime[34].call(null, rest_sets);
     if(Sx_types[71].call(null, h)) return make_cek_value(0, env, kont);
     args = rest_sets;
    }
   }
   var hB = [3, "perform requires an IO request argument"];
   function step_sf_perform(args, env, kont){
    var a = Sx_runtime[34].call(null, args);
    if(Sx_types[71].call(null, a)){
     var b = Sx_runtime[3].call(null, hB);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
    }
    var c = kont_push(make_perform_frame(env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, c);
   }
   var
    hC = [2, 1.],
    hD = [2, 2.],
    hE = [0, [2, 3.], 0],
    hF = [0, [3, cst$3], 0],
    hG = [0, [3, cst$0], 0],
    hH = [0, [2, 1.], 0],
    hI = [2, 1.],
    hJ = [2, 1.],
    hK = [0, [2, 3.], 0],
    hL = [2, 2.];
   function sf_define_record_type(args, env){
    var
     type_sym = Sx_runtime[15].call(null, args),
     ctor_spec = Sx_runtime[18].call(null, args, hC),
     pred_sym = Sx_runtime[18].call(null, args, hD),
     field_specs = Sx_runtime[2].call(null, cst_slice, [0, args, hE]),
     raw_name = Sx_types[72].call(null, type_sym),
     and = Sx_runtime[2].call(null, cst_starts_with, [0, raw_name, hF]),
     a =
       Sx_types[71].call(null, and)
        ? Sx_runtime[2].call(null, cst_ends_with, [0, raw_name, hG])
        : and;
    if(Sx_types[71].call(null, a))
     var
      b = [0, Sx_runtime[25].call(null, raw_name), hH],
      c = [0, raw_name, [0, hI, [0, Sx_runtime[2].call(null, cst$5, b), 0]]],
      type_name = Sx_runtime[2].call(null, cst_slice, c);
    else
     var type_name = raw_name;
    var
     d = Sx_runtime[15].call(null, ctor_spec),
     ctor_name = Sx_types[72].call(null, d),
     e = Sx_runtime[16].call(null, ctor_spec),
     f = Sx_runtime[6].call(null, e),
     ctor_params =
       [6,
        Stdlib_List[20].call
         (null, function(s){return Sx_types[72].call(null, s);}, f)],
     pred_name = Sx_types[72].call(null, pred_sym),
     g = Sx_runtime[6].call(null, field_specs),
     field_names =
       [6,
        Stdlib_List[20].call
         (null,
          function(fs){
           var a = Sx_runtime[15].call(null, fs);
           return Sx_types[72].call(null, a);
          },
          g)],
     rtd_uid = Sx_types[95].call(null, type_name, field_names, ctor_params),
     h = Sx_types[101].call(null, rtd_uid),
     i = Sx_runtime[4].call(null, ctor_name);
    Sx_runtime[78].call(null, env, i, h);
    var
     j = Sx_types[102].call(null, rtd_uid),
     k = Sx_runtime[4].call(null, pred_name);
    Sx_runtime[78].call(null, env, k, j);
    Sx_runtime[94].call
     (null,
      [15,
       cst$9,
       function(args){
        if(args){
         var a = args[2];
         if(a && ! a[2]){
          var
           fs = a[1],
           idx = args[1],
           b = Sx_runtime[18].call(null, fs, hJ),
           accessor_name = Sx_types[72].call(null, b),
           c = Sx_types[103].call(null, idx),
           d = Sx_runtime[4].call(null, accessor_name);
          Sx_runtime[78].call(null, env, d, c);
          var
           e = [0, Sx_runtime[25].call(null, fs), hK],
           f = Sx_runtime[2].call(null, cst$2, e);
          if(! Sx_types[71].call(null, f)) return 0;
          var
           g = Sx_runtime[18].call(null, fs, hL),
           mutator_name = Sx_types[72].call(null, g),
           h = Sx_types[104].call(null, idx),
           i = Sx_runtime[4].call(null, mutator_name);
          return Sx_runtime[78].call(null, env, i, h);
         }
        }
        return 0;
       }],
      field_specs);
    return 0;
   }
   var
    cst_protocol_registry = "*protocol-registry*",
    cst_impl = "_impl",
    cst_arity = "arity",
    cst_get = "get",
    cst_impls = "impls",
    cst_methods = "methods",
    hM = [3, cst_protocol_registry],
    hN = [3, "satisfies?"],
    hO = [4, "type-of"],
    hP = [0, [3, cst_impls], 0],
    hQ = [4, cst_protocol_registry],
    hR = [4, cst_get],
    hS = [4, cst_get],
    hT = [4, cst_get],
    hU = [4, cst_get],
    hV = [4, cst_impl],
    hW = [0, [3, ": not implemented for this type"], 0],
    hX = [3, cst$1],
    hY = [4, "error"],
    hZ = [6, [0, [4, "nil?"], [0, [4, cst_impl], 0]]],
    h0 = [4, cst_if],
    h1 = [4, cst_impl],
    h2 = [4, cst_let],
    h3 = [4, cst_fn];
   function sf_define_protocol(args, env){
    var
     a = Sx_runtime[15].call(null, args),
     proto_name = Sx_types[72].call(null, a),
     method_specs = Sx_runtime[16].call(null, args),
     b = Sx_runtime[4].call(null, hM);
    Sx_runtime[78].call(null, env, b, protocol_registry);
    var c = Sx_runtime[4].call(null, hN);
    Sx_runtime[78].call
     (null,
      env,
      c,
      [15,
       cst$9,
       function(args){
        if(args){
         var a = args[2];
         if(a && ! a[2]){
          var val = a[1], pname = args[1];
          return satisfies_p(pname, val);
         }
        }
        return 0;
       }]);
    var
     d = Stdlib_Hashtbl[1].call(null, 0, 3),
     e = [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
    Stdlib_Hashtbl[11].call(null, d, cst_impls, e);
    var
     f = Sx_runtime[6].call(null, method_specs),
     g =
       [6,
        Stdlib_List[20].call
         (null,
          function(spec){
           var
            d = Stdlib_Hashtbl[1].call(null, 0, 2),
            a = Sx_runtime[25].call(null, spec);
           Stdlib_Hashtbl[11].call(null, d, cst_arity, a);
           var
            b = Sx_runtime[15].call(null, spec),
            c = Sx_types[72].call(null, b);
           Stdlib_Hashtbl[11].call(null, d, cst_name, c);
           return [7, d];
          },
          f)];
    Stdlib_Hashtbl[11].call(null, d, cst_methods, g);
    Stdlib_Hashtbl[11].call(null, d, cst_name, proto_name);
    Sx_runtime[12].call(null, protocol_registry, proto_name, [7, d]);
    var h = Sx_runtime[6].call(null, method_specs);
    Stdlib_List[18].call
     (null,
      function(spec){
       var
        a = Sx_runtime[15].call(null, spec),
        method_name = Sx_types[72].call(null, a),
        params = Sx_runtime[16].call(null, spec),
        self_sym = Sx_runtime[15].call(null, params),
        b = [0, Sx_runtime[19].call(null, hV, params), 0],
        c =
          eval_expr
           ([6,
             [0,
              h3,
              [0,
               params,
               [0,
                [6,
                 [0,
                  h2,
                  [0,
                   [6,
                    [0,
                     [6,
                      [0,
                       h1,
                       [0,
                        [6,
                         [0,
                          hU,
                          [0,
                           [6,
                            [0,
                             hT,
                             [0,
                              [6,
                               [0, hS, [0, [6, [0, hR, [0, hQ, [0, proto_name, 0]]]], hP]]],
                              [0, [6, [0, hO, [0, self_sym, 0]]], 0]]]],
                           [0, method_name, 0]]]],
                        0]]],
                     0]],
                   [0,
                    [6,
                     [0,
                      h0,
                      [0,
                       hZ,
                       [0,
                        [6,
                         [0,
                          hY,
                          [0,
                           [3,
                            Sx_runtime[5].call
                             (null, [0, proto_name, [0, hX, [0, method_name, hW]]])],
                           0]]],
                        b]]]],
                    0]]]],
                0]]]],
            env),
        d = Sx_runtime[4].call(null, method_name);
       Sx_runtime[78].call(null, env, d, c);
       return 0;
      },
      h);
    return 0;
   }
   var
    h4 = [2, 1.],
    h5 = [0, [2, 1.], 0],
    h6 = [2, 1.],
    h7 = [3, "Unknown protocol: "],
    h8 = [3, cst_impls],
    h9 = [3, cst_methods],
    h_ = [3, cst_name],
    h$ = [3, " in protocol "],
    ia = [3, "Unknown method "],
    ib = [3, cst_arity],
    ic = [2, 1.],
    id = [0, [2, 1.], 0],
    ie = [4, cst_fn],
    ig = [4, cst_begin];
   function sf_implement(args, env){
    var
     a = Sx_runtime[15].call(null, args),
     proto_name = Sx_types[72].call(null, a),
     b = Sx_runtime[18].call(null, args, h4),
     raw_type_name = Sx_types[72].call(null, b),
     c = [0, Sx_runtime[25].call(null, raw_type_name), h5],
     d =
       [0, raw_type_name, [0, h6, [0, Sx_runtime[2].call(null, cst$5, c), 0]]],
     type_name = Sx_runtime[2].call(null, cst_slice, d),
     e = Sx_runtime[16].call(null, args),
     method_defs = Sx_runtime[16].call(null, e),
     proto = Sx_runtime[26].call(null, protocol_registry, proto_name),
     f = Sx_runtime[84].call(null, proto);
    if(Sx_types[71].call(null, f)){
     var
      g = [3, Sx_runtime[5].call(null, [0, h7, [0, proto_name, 0]])],
      h = Sx_runtime[3].call(null, g);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
    }
    var
     impls = Sx_runtime[26].call(null, proto, h8),
     or = Sx_runtime[26].call(null, impls, type_name),
     type_impls =
       Sx_types[71].call(null, or)
        ? or
        : [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
     i = Sx_runtime[6].call(null, method_defs);
    Stdlib_List[18].call
     (null,
      function(method_def){
       var
        a = Sx_runtime[15].call(null, method_def),
        mname = Sx_types[72].call(null, a),
        b = Sx_runtime[26].call(null, proto, h9),
        c = Sx_runtime[6].call(null, b),
        d =
          [6,
           Stdlib_List[44].call
            (null,
             function(m){
              var
               a = [0, Sx_runtime[26].call(null, m, h_), [0, mname, 0]],
               b = Sx_runtime[2].call(null, cst, a);
              return Sx_types[71].call(null, b);
             },
             c)],
        proto_method = Sx_runtime[15].call(null, d),
        e = Sx_runtime[84].call(null, proto_method);
       if(Sx_types[71].call(null, e)){
        var
         f =
           [3,
            Sx_runtime[5].call
             (null, [0, ia, [0, mname, [0, h$, [0, proto_name, 0]]]])],
         g = Sx_runtime[3].call(null, f);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
       }
       var
        arity = Sx_runtime[26].call(null, proto_method, ib),
        params =
          Sx_runtime[2].call
           (null, cst_slice, [0, method_def, [0, ic, [0, arity, 0]]]),
        h = [0, Sx_runtime[2].call(null, cst$8, [0, arity, id]), 0],
        i = [0, Sx_runtime[25].call(null, method_def), h],
        j = Sx_runtime[2].call(null, cst, i);
       if(Sx_types[71].call(null, j))
        var body = Sx_runtime[18].call(null, method_def, arity);
       else
        var
         l =
           Sx_runtime[2].call(null, cst_slice, [0, method_def, [0, arity, 0]]),
         body = Sx_runtime[19].call(null, ig, l);
       var k = eval_expr([6, [0, ie, [0, params, [0, body, 0]]]], env);
       Sx_runtime[12].call(null, type_impls, mname, k);
       return 0;
      },
      i);
    Sx_runtime[12].call(null, impls, type_name, type_impls);
    return 0;
   }
   var ih = [0, 0], ii = [0, 0], ij = [3, cst_impls];
   function satisfies_p(proto_name, value){
    var
     a = Sx_types[100].call(null, value),
     b = [0, 1 - Sx_types[71].call(null, a)];
    if(Sx_types[71].call(null, b)) return ih;
    var
     c = Sx_runtime[40].call(null, proto_name),
     d =
       Sx_types[71].call(null, c)
        ? Sx_types[72].call(null, proto_name)
        : proto_name,
     proto = Sx_runtime[26].call(null, protocol_registry, d),
     e = Sx_runtime[84].call(null, proto);
    if(Sx_types[71].call(null, e)) return ii;
    var
     f = Sx_runtime[74].call(null, value),
     g = Sx_runtime[26].call(null, proto, ij),
     h = Sx_runtime[26].call(null, g, f),
     i = Sx_runtime[84].call(null, h);
    return [0, 1 - Sx_types[71].call(null, i)];
   }
   var
    warnings = [6, 0],
    ik = [0, [0, 1], 0],
    il = [0, [0, 0], 0],
    im = [0, [3, cst_else], 0],
    io = [0, [0, 1], 0],
    ip = [0, [0, 0], 0],
    iq =
      [0,
       [6,
        [0,
         [3, "match may be non-exhaustive (no wildcard or :else pattern)"],
         0]],
       0],
    ir = [3, "match on boolean missing false case"],
    is = [3, "match on boolean missing true case"];
   function check_match_exhaustiveness(clauses){
    var
     b = Sx_runtime[6].call(null, clauses),
     patterns =
       [6,
        Stdlib_List[20].call
         (null, function(c){return Sx_runtime[15].call(null, c);}, b)],
     c = Sx_runtime[6].call(null, patterns),
     has_wildcard =
       [0,
        Stdlib_List[34].call
         (null,
          function(p){
           var and = Sx_runtime[40].call(null, p);
           if(Sx_types[71].call(null, and)){
            var
             b = Sx_runtime[2].call(null, cst, [0, p, ik]),
             and$0 = [0, 1 - Sx_types[71].call(null, b)];
            if(Sx_types[71].call(null, and$0))
             var
              c = Sx_runtime[2].call(null, cst, [0, p, il]),
              a = [0, 1 - Sx_types[71].call(null, c)];
            else
             var a = and$0;
           }
           else
            var a = and;
           return Sx_types[71].call(null, a);
          },
          c)],
     d = Sx_runtime[6].call(null, patterns),
     has_else =
       [0,
        Stdlib_List[34].call
         (null,
          function(p){
           var a = Sx_runtime[2].call(null, cst, [0, p, im]);
           return Sx_types[71].call(null, a);
          },
          d)],
     e = Sx_runtime[6].call(null, patterns),
     has_true =
       [0,
        Stdlib_List[34].call
         (null,
          function(p){
           var a = Sx_runtime[2].call(null, cst, [0, p, io]);
           return Sx_types[71].call(null, a);
          },
          e)],
     f = Sx_runtime[6].call(null, patterns),
     has_false =
       [0,
        Stdlib_List[34].call
         (null,
          function(p){
           var a = Sx_runtime[2].call(null, cst, [0, p, ip]);
           return Sx_types[71].call(null, a);
          },
          f)],
     and = [0, 1 - Sx_types[71].call(null, has_wildcard)],
     g =
       Sx_types[71].call(null, and)
        ? [0, 1 - Sx_types[71].call(null, has_else)]
        : and,
     warnings$0 =
       Sx_types[71].call(null, g)
        ? Sx_runtime[2].call(null, cst_append, [0, warnings, iq])
        : warnings,
     and$0 = Sx_types[71].call(null, has_true) ? has_true : has_false;
    if(Sx_types[71].call(null, and$0)){
     var
      has_false$0 = Sx_types[71].call(null, has_true) ? has_false : has_true,
      and$1 = [0, 1 - Sx_types[71].call(null, has_false$0)];
     if(Sx_types[71].call(null, and$1))
      var
       and$2 = [0, 1 - Sx_types[71].call(null, has_wildcard)],
       a =
         Sx_types[71].call(null, and$2)
          ? [0, 1 - Sx_types[71].call(null, has_else)]
          : and$2;
     else
      var a = and$1;
    }
    else
     var a = and$0;
    if(Sx_types[71].call(null, a))
     var
      h = Sx_types[71].call(null, has_true) ? ir : is,
      warnings$1 =
        Sx_runtime[2].call
         (null, cst_append, [0, warnings$0, [0, [6, [0, h, 0]], 0]]);
    else
     var warnings$1 = warnings$0;
    return warnings$1;
   }
   var it = [2, 1.];
   function match_find_clause(val, clauses$1, env){
    var clauses = clauses$1;
    for(;;){
     var a = Sx_runtime[34].call(null, clauses);
     if(Sx_types[71].call(null, a)) return 0;
     var
      clause = Sx_runtime[15].call(null, clauses),
      pattern = Sx_runtime[15].call(null, clause),
      body = Sx_runtime[18].call(null, clause, it),
      local = Sx_runtime[81].call(null, env),
      b = match_pattern(pattern, val, local);
     if(Sx_types[71].call(null, b)) return [6, [0, local, [0, body, 0]]];
     var clauses$0 = Sx_runtime[16].call(null, clauses);
     clauses = clauses$0;
    }
   }
   var
    cst_adt = "_adt",
    iu = [0, [4, cst$14], 0],
    iv = [0, 1],
    iw = [0, [2, 2.], 0],
    ix = [0, [4, cst$4], 0],
    iy = [2, 1.],
    iz = [0, [4, cst_quote], 0],
    iA = [2, 1.],
    iB = [0, 1],
    iC = [3, cst_adt],
    iD = [3, "_fields"],
    iE = [3, "_ctor"],
    iF = [2, 1.],
    iG = [0, [4, cst_rest], 0],
    iH = [0, [4, cst_rest], 0],
    iI = [2, 0.],
    iJ = [2, 0.],
    iK = [2, 1.],
    iL = [0, [2, 1.], 0],
    iM = [0, 1],
    iN = [0, 0],
    iO = [2, 1.];
   function match_pattern(pattern, value, env){
    var e = Sx_runtime[2].call(null, cst, [0, pattern, iu]);
    if(Sx_types[71].call(null, e)) return iv;
    var and = Sx_runtime[38].call(null, pattern);
    if(Sx_types[71].call(null, and)){
     var
      f = [0, Sx_runtime[25].call(null, pattern), iw],
      and$0 = Sx_runtime[2].call(null, cst, f);
     if(Sx_types[71].call(null, and$0))
      var
       g = [0, Sx_runtime[15].call(null, pattern), ix],
       b = Sx_runtime[2].call(null, cst, g);
     else
      var b = and$0;
    }
    else
     var b = and;
    if(Sx_types[71].call(null, b)){
     var pred = eval_expr(Sx_runtime[18].call(null, pattern, iy), env);
     return cek_call(pred, [6, [0, value, 0]]);
    }
    var and$1 = Sx_runtime[38].call(null, pattern);
    if(Sx_types[71].call(null, and$1)){
     var
      h = Sx_runtime[34].call(null, pattern),
      and$2 = [0, 1 - Sx_types[71].call(null, h)];
     if(Sx_types[71].call(null, and$2))
      var
       i = [0, Sx_runtime[15].call(null, pattern), iz],
       c = Sx_runtime[2].call(null, cst, i);
     else
      var c = and$2;
    }
    else
     var c = and$1;
    if(Sx_types[71].call(null, c)){
     var j = [0, value, [0, Sx_runtime[18].call(null, pattern, iA), 0]];
     return Sx_runtime[2].call(null, cst, j);
    }
    var k = Sx_runtime[40].call(null, pattern);
    if(Sx_types[71].call(null, k)){
     var
      l = Sx_types[72].call(null, pattern),
      m = Sx_runtime[4].call(null, l);
     Sx_runtime[78].call(null, env, m, value);
     return iB;
    }
    var and$3 = Sx_runtime[38].call(null, pattern);
    if(Sx_types[71].call(null, and$3)){
     var
      n = Sx_runtime[34].call(null, pattern),
      and$4 = [0, 1 - Sx_types[71].call(null, n)];
     if(Sx_types[71].call(null, and$4)){
      var
       o = Sx_runtime[15].call(null, pattern),
       and$5 = Sx_runtime[40].call(null, o);
      if(Sx_types[71].call(null, and$5))
       var
        and$6 = Sx_runtime[39].call(null, value),
        a =
          Sx_types[71].call(null, and$6)
           ? Sx_runtime[26].call(null, value, iC)
           : and$6;
      else
       var a = and$5;
     }
     else
      var a = and$4;
    }
    else
     var a = and$3;
    if(Sx_types[71].call(null, a)){
     var
      p = Sx_runtime[15].call(null, pattern),
      ctor_name = Sx_types[72].call(null, p),
      field_patterns = Sx_runtime[16].call(null, pattern),
      fields = Sx_runtime[26].call(null, value, iD),
      q = [0, Sx_runtime[26].call(null, value, iE), [0, ctor_name, 0]],
      and$7 = Sx_runtime[2].call(null, cst, q);
     if(! Sx_types[71].call(null, and$7)) return and$7;
     var
      r = [0, Sx_runtime[25].call(null, fields), 0],
      s = [0, Sx_runtime[25].call(null, field_patterns), r],
      and$8 = Sx_runtime[2].call(null, cst, s);
     if(! Sx_types[71].call(null, and$8)) return and$8;
     var
      t =
        Sx_runtime[2].call(null, cst_zip, [0, field_patterns, [0, fields, 0]]),
      u = Sx_runtime[6].call(null, t);
     return [0,
             Stdlib_List[33].call
              (null,
               function(pair){
                var
                 a = Sx_runtime[18].call(null, pair, iF),
                 b = match_pattern(Sx_runtime[15].call(null, pair), a, env);
                return Sx_types[71].call(null, b);
               },
               u)];
    }
    var
     and$9 = Sx_runtime[39].call(null, pattern),
     v =
       Sx_types[71].call(null, and$9)
        ? Sx_runtime[39].call(null, value)
        : and$9;
    if(Sx_types[71].call(null, v)){
     var
      w = Sx_runtime[2].call(null, cst_keys, [0, pattern, 0]),
      x = Sx_runtime[6].call(null, w);
     return [0,
             Stdlib_List[33].call
              (null,
               function(k){
                var
                 a = Sx_runtime[26].call(null, value, k),
                 b =
                   match_pattern(Sx_runtime[26].call(null, pattern, k), a, env);
                return Sx_types[71].call(null, b);
               },
               x)];
    }
    var and$10 = Sx_runtime[38].call(null, pattern);
    if(Sx_types[71].call(null, and$10))
     var
      and$11 = Sx_runtime[38].call(null, value),
      d =
        Sx_types[71].call(null, and$11)
         ? Sx_runtime[2].call(null, cst_contains, [0, pattern, iG])
         : and$11;
    else
     var d = and$10;
    if(Sx_types[71].call(null, d)){
     var
      rest_idx = Sx_runtime[2].call(null, cst_index_of, [0, pattern, iH]),
      y = [0, Sx_runtime[25].call(null, value), [0, rest_idx, 0]],
      and$12 = Sx_runtime[2].call(null, cst$2, y);
     if(! Sx_types[71].call(null, and$12)) return and$12;
     var
      z =
        [0,
         Sx_runtime[2].call
          (null, cst_slice, [0, value, [0, iI, [0, rest_idx, 0]]]),
         0],
      A =
        [0,
         Sx_runtime[2].call
          (null, cst_slice, [0, pattern, [0, iJ, [0, rest_idx, 0]]]),
         z],
      B = Sx_runtime[2].call(null, cst_zip, A),
      C = Sx_runtime[6].call(null, B),
      and$13 =
        [0,
         Stdlib_List[33].call
          (null,
           function(pair){
            var
             a = Sx_runtime[18].call(null, pair, iK),
             b = match_pattern(Sx_runtime[15].call(null, pair), a, env);
            return Sx_types[71].call(null, b);
           },
           C)];
     if(! Sx_types[71].call(null, and$13)) return and$13;
     var
      D = Sx_runtime[2].call(null, cst$8, [0, rest_idx, iL]),
      rest_name = Sx_runtime[18].call(null, pattern, D),
      E = Sx_runtime[2].call(null, cst_slice, [0, value, [0, rest_idx, 0]]),
      F = Sx_types[72].call(null, rest_name),
      G = Sx_runtime[4].call(null, F);
     Sx_runtime[78].call(null, env, G, E);
     return iM;
    }
    var
     and$14 = Sx_runtime[38].call(null, pattern),
     H =
       Sx_types[71].call(null, and$14)
        ? Sx_runtime[38].call(null, value)
        : and$14;
    if(! Sx_types[71].call(null, H))
     return Sx_runtime[2].call(null, cst, [0, pattern, [0, value, 0]]);
    var
     I = [0, Sx_runtime[25].call(null, value), 0],
     J = [0, Sx_runtime[25].call(null, pattern), I],
     K = Sx_runtime[2].call(null, cst, J),
     L = [0, 1 - Sx_types[71].call(null, K)];
    if(Sx_types[71].call(null, L)) return iN;
    var
     pairs = Sx_runtime[2].call(null, cst_zip, [0, pattern, [0, value, 0]]),
     M = Sx_runtime[6].call(null, pairs);
    return [0,
            Stdlib_List[33].call
             (null,
              function(pair){
               var
                a = Sx_runtime[18].call(null, pair, iO),
                b = match_pattern(Sx_runtime[15].call(null, pair), a, env);
               return Sx_types[71].call(null, b);
              },
              M)];
   }
   var iP = [0, 0], iQ = [3, "match: no clause matched "], iR = [2, 1.];
   function step_sf_match(args, env, kont){
    var
     val = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     clauses = Sx_runtime[16].call(null, args);
    match_check_exhaustiveness(val, clauses, env);
    var
     result = match_find_clause(val, clauses, env),
     a = Sx_runtime[84].call(null, result);
    if(Sx_types[71].call(null, a)){
     var
      b = kont_push(make_raise_eval_frame(env, iP), kont),
      c = [0, iQ, [0, Sx_runtime[69].call(null, val), 0]];
     return make_cek_value([3, Sx_runtime[5].call(null, c)], env, b);
    }
    var d = Sx_runtime[15].call(null, result);
    return make_cek_state(Sx_runtime[18].call(null, result, iR), d, kont);
   }
   var
    cst_adt_registry = "*adt-registry*",
    cst_adt_warned = "*adt-warned*",
    iS = [3, cst_adt_registry],
    iT = [3, cst_adt_registry],
    iU = [3, cst_adt_warned],
    iV = [3, cst_adt_warned],
    iW = [3, cst_adt_warned],
    iX = [0, 1];
   function match_check_exhaustiveness(val, clauses, env){
    function clause_is_else(c){
     if(typeof c !== "number" && 6 === c[0]){
      var match = c[1];
      if(match){
       var p = match[1];
       if(typeof p !== "number")
        switch(p[0]){
          case 4:
           var a = p[1]; if(a !== cst$14 && a !== cst_else) break; return 1;
          case 5:
           if(p[1] === cst_else) return 1; break;
        }
       return 0;
      }
     }
     return 0;
    }
    function clause_ctor_name(c){
     if(typeof c !== "number" && 6 === c[0]){
      var b = c[1];
      if(b){
       var a = b[1];
       if(typeof a !== "number" && 6 === a[0]){
        var d = a[1];
        if(d){
         var match = d[1];
         if(typeof match !== "number" && 4 === match[0]){var n = match[1]; return [0, n];}
        }
       }
      }
     }
     return 0;
    }
    a:
    {
     if(typeof val !== "number")
      switch(val[0]){
        case 7:
         var d = val[1], match$2 = Stdlib_Hashtbl[7].call(null, d, cst_adt);
         if(match$2){
          var c = match$2[1];
          if(typeof c !== "number" && 0 === c[0] && c[1]){
           var match$3 = Stdlib_Hashtbl[7].call(null, d, "_type");
           if(match$3){
            var match$4 = match$3[1];
            if(typeof match$4 !== "number" && 3 === match$4[0]){
             var s = match$4[1], type_name_opt = [0, s];
             break a;
            }
           }
           var type_name_opt = 0;
           break a;
          }
         }
         var type_name_opt = 0;
         break a;
        case 38:
         var a = val[1], type_name_opt = [0, a[1]]; break a;
      }
     var type_name_opt = 0;
    }
    if(! type_name_opt) return 0;
    var type_name = type_name_opt[1], e = Sx_runtime[76].call(null, env, iS);
    if(! Sx_types[71].call(null, e)) return 0;
    var registry = Sx_runtime[77].call(null, env, iT);
    a:
    {
     if(typeof registry !== "number" && 7 === registry[0]){
      var
       r = registry[1],
       match$0 = Stdlib_Hashtbl[7].call(null, r, type_name);
      if(match$0){
       var match$1 = match$0[1];
       if(typeof match$1 !== "number" && 6 === match$1[0]){
        var ctors = match$1[1], registered = [0, ctors];
        break a;
       }
      }
      var registered = 0;
      break a;
     }
     var registered = 0;
    }
    if(! registered) return 0;
    var ctor_vals = registered[1];
    a:
    {
     if(typeof clauses !== "number" && 6 === clauses[0]){var xs = clauses[1], clauses_list = xs; break a;}
     var clauses_list = 0;
    }
    if(Stdlib_List[34].call(null, clause_is_else, clauses_list)) return 0;
    var
     clause_ctors = Stdlib_List[23].call(null, clause_ctor_name, clauses_list),
     registered_names =
       Stdlib_List[23].call
        (null,
         function(param){
          if(typeof param !== "number" && 3 === param[0]){var s = param[1]; return [0, s];}
          return 0;
         },
         ctor_vals),
     missing =
       Stdlib_List[44].call
        (null,
         function(c){return 1 - Stdlib_List[37].call(null, c, clause_ctors);},
         registered_names);
    if(0 === missing) return 0;
    var f = Sx_runtime[76].call(null, env, iU);
    if(1 - Sx_types[71].call(null, f)){
     var g = [7, Stdlib_Hashtbl[1].call(null, 0, 4)];
     Sx_runtime[78].call(null, env, iV, g);
    }
    var
     warned = Sx_runtime[77].call(null, env, iW),
     h = Stdlib_String[7].call(null, ",", missing),
     i = Stdlib[28].call(null, "|", h),
     key = Stdlib[28].call(null, type_name, i);
    a:
    {
     if(typeof warned !== "number" && 7 === warned[0]){
      var w$0 = warned[1], match = Stdlib_Hashtbl[7].call(null, w$0, key);
      if(match){
       var b = match[1];
       if(typeof b !== "number" && 0 === b[0] && b[1]){var already = 1; break a;}
      }
      var already = 0;
      break a;
     }
     var already = 0;
    }
    if(already) return 0;
    if(typeof warned !== "number" && 7 === warned[0]){
     var w = warned[1];
     Stdlib_Hashtbl[11].call(null, w, key, iX);
    }
    var
     j = Stdlib_String[7].call(null, ", ", missing),
     k = Stdlib[28].call(null, ": missing ", j),
     l = Stdlib[28].call(null, type_name, k),
     msg =
       Stdlib[28].call(null, "[sx] match: non-exhaustive \xe2\x80\x94 ", l);
    Sx_runtime[103].call(null, [3, msg]);
    return 0;
   }
   var iY = [2, 1.];
   function step_sf_handler_bind(args, env, kont){
    var
     handler_specs = Sx_runtime[15].call(null, args),
     body = Sx_runtime[16].call(null, args),
     a = Sx_runtime[6].call(null, handler_specs),
     handlers =
       [6,
        Stdlib_List[20].call
         (null,
          function(spec){
           var
            a =
              [0,
               trampoline(eval_expr(Sx_runtime[18].call(null, spec, iY), env)),
               0];
           return [6,
                   [0,
                    trampoline(eval_expr(Sx_runtime[15].call(null, spec), env)),
                    a]];
          },
          a)],
     b = Sx_runtime[34].call(null, body);
    if(Sx_types[71].call(null, b)) return make_cek_value(0, env, kont);
    var
     c =
       kont_push
        (make_handler_frame(handlers, Sx_runtime[16].call(null, body), env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, body), env, c);
   }
   var iZ = [2, 2.], i0 = [2, 1.], i1 = [6, 0];
   function step_sf_restart_case(args, env, kont){
    var
     body = Sx_runtime[15].call(null, args),
     restart_specs = Sx_runtime[16].call(null, args),
     a = Sx_runtime[6].call(null, restart_specs),
     restarts =
       [6,
        Stdlib_List[20].call
         (null,
          function(spec){
           var
            b = [0, Sx_runtime[18].call(null, spec, iZ), 0],
            c = [0, Sx_runtime[18].call(null, spec, i0), b],
            d = Sx_runtime[15].call(null, spec),
            e = Sx_runtime[40].call(null, d);
           if(Sx_types[71].call(null, e))
            var
             f = Sx_runtime[15].call(null, spec),
             a = Sx_types[72].call(null, f);
           else
            var a = Sx_runtime[15].call(null, spec);
           return [6, [0, a, c]];
          },
          a)];
    return make_cek_state
            (body,
             env,
             kont_push(make_restart_frame(restarts, i1, env), kont));
   }
   var i2 = [3, "Unhandled condition: "];
   function step_sf_signal(args, env, kont){
    var
     condition = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     handler_fn = kont_find_handler(kont, condition),
     a = Sx_runtime[84].call(null, handler_fn);
    if(! Sx_types[71].call(null, a))
     return continue_with_call
             (handler_fn,
              [6, [0, condition, 0]],
              env,
              [6, [0, condition, 0]],
              kont_push(make_signal_return_frame(env, kont), kont));
    var
     b = [0, i2, [0, Sx_runtime[69].call(null, condition), 0]],
     c = [3, Sx_runtime[5].call(null, b)],
     d = Sx_runtime[3].call(null, c);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
   }
   var
    i3 = [0, [2, 2.], 0],
    i4 = [2, 1.],
    i5 = [3, "No restart named: "],
    i6 = [2, 1.],
    i7 = [2, 2.],
    i8 = [2, 1.],
    i9 = [2, 2.],
    i_ = [3, cst_env];
   function step_sf_invoke_restart(args, env, kont){
    var a = Sx_runtime[15].call(null, args), b = Sx_runtime[40].call(null, a);
    if(Sx_types[71].call(null, b))
     var c = Sx_runtime[15].call(null, args), rn = Sx_types[72].call(null, c);
    else
     var rn = trampoline(eval_expr(Sx_runtime[15].call(null, args), env));
    var
     d = Sx_runtime[40].call(null, rn),
     restart_name =
       Sx_types[71].call(null, d) ? Sx_types[72].call(null, rn) : rn,
     e = [0, Sx_runtime[25].call(null, args), i3],
     f = Sx_runtime[2].call(null, cst$2, e),
     restart_arg =
       Sx_types[71].call(null, f)
        ? trampoline(eval_expr(Sx_runtime[18].call(null, args, i4), env))
        : 0,
     found = kont_find_restart(kont, restart_name),
     g = Sx_runtime[84].call(null, found);
    if(Sx_types[71].call(null, g)){
     var
      h = [0, i5, [0, Sx_runtime[69].call(null, restart_name), 0]],
      i = [3, Sx_runtime[5].call(null, h)],
      j = Sx_runtime[3].call(null, i);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], j], 1);
    }
    var
     entry = Sx_runtime[15].call(null, found),
     restart_frame = Sx_runtime[18].call(null, found, i6),
     rest_kont = Sx_runtime[18].call(null, found, i7),
     params = Sx_runtime[18].call(null, entry, i8),
     body = Sx_runtime[18].call(null, entry, i9),
     k = Sx_runtime[26].call(null, restart_frame, i_),
     restart_env = Sx_runtime[81].call(null, k),
     l = Sx_runtime[34].call(null, params),
     m = [0, 1 - Sx_types[71].call(null, l)];
    if(Sx_types[71].call(null, m)){
     var
      n = Sx_runtime[15].call(null, params),
      o = Sx_runtime[4].call(null, n);
     Sx_runtime[78].call(null, restart_env, o, restart_arg);
    }
    return make_cek_state(body, restart_env, rest_kont);
   }
   var i$ = [0, [2, 2.], 0], ja = [2, 2.], jb = [2, 1.];
   function step_sf_if(args, env, kont){
    var
     a = [0, Sx_runtime[25].call(null, args), i$],
     b = Sx_runtime[2].call(null, cst$0, a),
     c = Sx_types[71].call(null, b) ? Sx_runtime[18].call(null, args, ja) : 0,
     d =
       kont_push
        (make_if_frame(Sx_runtime[18].call(null, args, jb), c, env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, d);
   }
   function step_sf_when(args, env, kont){
    var
     a =
       kont_push(make_when_frame(Sx_runtime[16].call(null, args), env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var jc = [0, [2, 1.], 0];
   function step_sf_begin(args, env, kont){
    var a = Sx_runtime[34].call(null, args);
    if(Sx_types[71].call(null, a)) return make_cek_value(0, env, kont);
    var
     b = [0, Sx_runtime[25].call(null, args), jc],
     c = Sx_runtime[2].call(null, cst, b);
    if(Sx_types[71].call(null, c))
     return make_cek_state(Sx_runtime[15].call(null, args), env, kont);
    var
     d =
       kont_push(make_begin_frame(Sx_runtime[16].call(null, args), env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, d);
   }
   var
    jd = [0, [3, cst_symbol], 0],
    je = [0, [3, cst_list], 0],
    jf = [0, [2, 2.], 0],
    jg = [0, [3, cst_list], 0],
    jh = [0, [2, 2.], 0],
    ji = [0, [3, cst_symbol], 0],
    jj = [2, 1.],
    jk = [6, 0],
    jl = [0, [2, 2.], 0],
    jm = [2, 1.],
    jn = [0, [2, 2.], 0],
    jo = [0, [2, 2.], 0],
    jp = [2, 1.];
   function step_sf_let(args, env, kont){
    var
     c = Sx_runtime[15].call(null, args),
     d = [0, Sx_runtime[74].call(null, c), jd],
     e = Sx_runtime[2].call(null, cst, d);
    if(Sx_types[71].call(null, e))
     return make_cek_value(sf_named_let(args, env), env, kont);
    var
     bindings = Sx_runtime[15].call(null, args),
     body = Sx_runtime[16].call(null, args),
     local = Sx_runtime[81].call(null, env),
     f = Sx_runtime[34].call(null, bindings);
    if(Sx_types[71].call(null, f)) return step_sf_begin(body, local, kont);
    var
     g = Sx_runtime[15].call(null, bindings),
     h = [0, Sx_runtime[74].call(null, g), je],
     and = Sx_runtime[2].call(null, cst, h);
    if(Sx_types[71].call(null, and))
     var
      i = Sx_runtime[15].call(null, bindings),
      j = [0, Sx_runtime[25].call(null, i), jf],
      a = Sx_runtime[2].call(null, cst, j);
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     var first_binding = Sx_runtime[15].call(null, bindings);
    else
     var
      x = [0, Sx_runtime[18].call(null, bindings, jp), 0],
      first_binding = [6, [0, Sx_runtime[15].call(null, bindings), x]];
    var
     k = Sx_runtime[15].call(null, bindings),
     l = [0, Sx_runtime[74].call(null, k), jg],
     and$0 = Sx_runtime[2].call(null, cst, l);
    if(Sx_types[71].call(null, and$0))
     var
      m = Sx_runtime[15].call(null, bindings),
      n = [0, Sx_runtime[25].call(null, m), jh],
      b = Sx_runtime[2].call(null, cst, n);
    else
     var b = and$0;
    if(Sx_types[71].call(null, b))
     var rest_bindings = Sx_runtime[16].call(null, bindings);
    else{
     var
      t = [0, Sx_runtime[25].call(null, bindings), jl],
      u = [0, jm, [0, Sx_runtime[2].call(null, cst$12, t), 0]],
      v = Sx_runtime[2].call(null, cst_range, u),
      w = Sx_runtime[6].call(null, v),
      pairs = [0, jk];
     Stdlib_List[26].call
      (null,
       function(acc, i){
        var
         a = [0, Sx_runtime[2].call(null, cst$11, [0, i, jn]), 0],
         b = Sx_runtime[2].call(null, cst_inc, a),
         c = [0, Sx_runtime[18].call(null, bindings, b), 0],
         d = Sx_runtime[2].call(null, cst$11, [0, i, jo]),
         e = [6, [0, Sx_runtime[18].call(null, bindings, d), c]];
        pairs[1] = Sx_runtime[11].call(null, pairs[1], e);
        return 0;
       },
       0,
       w);
     var rest_bindings = pairs[1];
    }
    var
     o = Sx_runtime[15].call(null, first_binding),
     p = [0, Sx_runtime[74].call(null, o), ji],
     q = Sx_runtime[2].call(null, cst, p);
    if(Sx_types[71].call(null, q))
     var
      r = Sx_runtime[15].call(null, first_binding),
      vname = Sx_types[72].call(null, r);
    else
     var vname = Sx_runtime[15].call(null, first_binding);
    var
     s = kont_push(make_let_frame(vname, rest_bindings, body, local), kont);
    return make_cek_state
            (Sx_runtime[18].call(null, first_binding, jj), local, s);
   }
   var
    jq = [0, [2, 4.], 0],
    jr = [0, [3, cst_keyword], 0],
    js = [2, 1.],
    jt = [0, [3, cst_effects], 0],
    ju = [2, 1.],
    jv = [0, [2, 4.], 0],
    jw = [0, [3, cst_keyword], 0],
    jx = [2, 1.],
    jy = [0, [3, cst_effects], 0],
    jz = [2, 1.],
    jA = [2, 3.],
    jB = [0, [2, 4.], 0],
    jC = [0, [3, cst_keyword], 0],
    jD = [2, 1.],
    jE = [0, [3, cst_effects], 0],
    jF = [2, 1.],
    jG = [2, 2.],
    jH = [2, 1.],
    jI = [4, cst_fn];
   function step_sf_define(args, env, kont){
    var match = Sx_runtime[15].call(null, args);
    if(typeof match === "number" || ! (6 === match[0]))
     var args$0 = args;
    else{
     var match$0 = match[1];
     if(match$0)
      var
       params = match$0[2],
       fn_name = match$0[1],
       s = Sx_runtime[16].call(null, args),
       body_parts = Sx_runtime[6].call(null, s),
       args$0 =
         [6, [0, fn_name, [0, [6, [0, jI, [0, [6, params], body_parts]]], 0]]];
     else
      var args$0 = args;
    }
    var
     name_sym = Sx_runtime[15].call(null, args$0),
     c = [0, Sx_runtime[25].call(null, args$0), jq],
     and = Sx_runtime[2].call(null, cst$2, c);
    if(Sx_types[71].call(null, and)){
     var
      d = Sx_runtime[18].call(null, args$0, js),
      e = [0, Sx_runtime[74].call(null, d), jr],
      and$0 = Sx_runtime[2].call(null, cst, e);
     if(Sx_types[71].call(null, and$0))
      var
       f = Sx_runtime[18].call(null, args$0, ju),
       g = [0, Sx_types[73].call(null, f), jt],
       has_effects = Sx_runtime[2].call(null, cst, g);
     else
      var has_effects = and$0;
    }
    else
     var has_effects = and;
    var
     h = [0, Sx_runtime[25].call(null, args$0), jv],
     and$1 = Sx_runtime[2].call(null, cst$2, h);
    if(Sx_types[71].call(null, and$1)){
     var
      i = Sx_runtime[18].call(null, args$0, jx),
      j = [0, Sx_runtime[74].call(null, i), jw],
      and$2 = Sx_runtime[2].call(null, cst, j);
     if(Sx_types[71].call(null, and$2))
      var
       k = Sx_runtime[18].call(null, args$0, jz),
       l = [0, Sx_types[73].call(null, k), jy],
       a = Sx_runtime[2].call(null, cst, l);
     else
      var a = and$2;
    }
    else
     var a = and$1;
    var
     val_idx = Sx_types[71].call(null, a) ? jA : jH,
     m = [0, Sx_runtime[25].call(null, args$0), jB],
     and$3 = Sx_runtime[2].call(null, cst$2, m);
    if(Sx_types[71].call(null, and$3)){
     var
      n = Sx_runtime[18].call(null, args$0, jD),
      o = [0, Sx_runtime[74].call(null, n), jC],
      and$4 = Sx_runtime[2].call(null, cst, o);
     if(Sx_types[71].call(null, and$4))
      var
       p = Sx_runtime[18].call(null, args$0, jF),
       q = [0, Sx_types[73].call(null, p), jE],
       b = Sx_runtime[2].call(null, cst, q);
     else
      var b = and$4;
    }
    else
     var b = and$3;
    var
     effect_list =
       Sx_types[71].call(null, b) ? Sx_runtime[18].call(null, args$0, jG) : 0,
     r =
       kont_push
        (make_define_frame
          (Sx_types[72].call(null, name_sym), env, has_effects, effect_list),
         kont);
    return make_cek_state(Sx_runtime[18].call(null, args$0, val_idx), env, r);
   }
   var jJ = [2, 1.];
   function step_sf_set_b(args, env, kont){
    var
     a = Sx_runtime[15].call(null, args),
     b = kont_push(make_set_frame(Sx_types[72].call(null, a), env), kont);
    return make_cek_state(Sx_runtime[18].call(null, args, jJ), env, b);
   }
   var jK = [0, 1];
   function step_sf_and(args, env, kont){
    var a = Sx_runtime[34].call(null, args);
    if(Sx_types[71].call(null, a)) return make_cek_value(jK, env, kont);
    var
     b = kont_push(make_and_frame(Sx_runtime[16].call(null, args), env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, b);
   }
   var jL = [0, 0];
   function step_sf_or(args, env, kont){
    var a = Sx_runtime[34].call(null, args);
    if(Sx_types[71].call(null, a)) return make_cek_value(jL, env, kont);
    var
     b = kont_push(make_or_frame(Sx_runtime[16].call(null, args), env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, b);
   }
   var
    jM = [2, 1.],
    jN = [0, 1],
    jO = [0, [2, 2.], 0],
    jP = [2, 1.],
    jQ = [0, 0];
   function step_sf_cond(args, env, kont){
    var scheme_p = cond_scheme_p(args);
    if(Sx_types[71].call(null, scheme_p)){
     var a = Sx_runtime[34].call(null, args);
     if(Sx_types[71].call(null, a)) return make_cek_value(0, env, kont);
     var
      clause = Sx_runtime[15].call(null, args),
      test = Sx_runtime[15].call(null, clause),
      b = is_else_clause(test);
     return Sx_types[71].call(null, b)
             ? make_cek_state
               (Sx_runtime[18].call(null, clause, jM), env, kont)
             : make_cek_state
               (test, env, kont_push(make_cond_frame(args, env, jN), kont));
    }
    var
     c = [0, Sx_runtime[25].call(null, args), jO],
     d = Sx_runtime[2].call(null, cst$3, c);
    if(Sx_types[71].call(null, d)) return make_cek_value(0, env, kont);
    var test$0 = Sx_runtime[15].call(null, args), e = is_else_clause(test$0);
    return Sx_types[71].call(null, e)
            ? make_cek_state(Sx_runtime[18].call(null, args, jP), env, kont)
            : make_cek_state
              (test$0, env, kont_push(make_cond_frame(args, env, jQ), kont));
   }
   var jR = [3, cst_first];
   function step_sf_thread_first(args, env, kont){
    var
     a =
       kont_push
        (make_thread_frame(Sx_runtime[16].call(null, args), env, jR, 0), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var cst_last = "last", jS = [3, cst_last];
   function step_sf_thread_last(args, env, kont){
    var
     a =
       kont_push
        (make_thread_frame(Sx_runtime[16].call(null, args), env, jS, 0), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var jT = [2, 1.], jU = [3, cst_as];
   function step_sf_thread_as(args, env, kont){
    var
     init = Sx_runtime[15].call(null, args),
     name = Sx_runtime[18].call(null, args, jT),
     a = Sx_runtime[16].call(null, args),
     forms = Sx_runtime[16].call(null, a);
    return make_cek_state
            (init,
             env,
             kont_push(make_thread_frame(forms, env, jU, name), kont));
   }
   function step_sf_lambda(args, env, kont){
    return make_cek_value(sf_lambda(args, env), env, kont);
   }
   var
    jV = [0, [2, 1.], 0],
    jW = [0, [2, 2.], 0],
    jX = [0, [3, cst_keyword], 0],
    jY = [0, [3, cst_value], 0],
    jZ = [2, 1.],
    j0 = [0, [2, 2.], 0];
   function step_sf_scope(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     rest_args = Sx_runtime[2].call(null, cst_slice, [0, args, jV]),
     b = [0, Sx_runtime[25].call(null, rest_args), jW],
     and = Sx_runtime[2].call(null, cst$2, b);
    if(Sx_types[71].call(null, and)){
     var
      c = Sx_runtime[15].call(null, rest_args),
      d = [0, Sx_runtime[74].call(null, c), jX],
      and$0 = Sx_runtime[2].call(null, cst, d);
     if(Sx_types[71].call(null, and$0))
      var
       e = Sx_runtime[15].call(null, rest_args),
       f = [0, Sx_types[73].call(null, e), jY],
       a = Sx_runtime[2].call(null, cst, f);
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     var
      g = trampoline(eval_expr(Sx_runtime[18].call(null, rest_args, jZ), env)),
      body = Sx_runtime[2].call(null, cst_slice, [0, rest_args, j0]),
      val = g;
    else
     var body = rest_args, val = 0;
    var h = Sx_runtime[34].call(null, body);
    if(Sx_types[71].call(null, h)) return make_cek_value(0, env, kont);
    var
     i =
       kont_push
        (make_scope_acc_frame(name, val, Sx_runtime[16].call(null, body), env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, body), env, i);
   }
   var j1 = [2, 1.], j2 = [0, [2, 2.], 0];
   function step_sf_provide(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     val = trampoline(eval_expr(Sx_runtime[18].call(null, args, j1), env)),
     body = Sx_runtime[2].call(null, cst_slice, [0, args, j2]);
    Sx_runtime[105].call(null, name, val);
    var a = Sx_runtime[34].call(null, body);
    if(Sx_types[71].call(null, a)){
     Sx_runtime[106].call(null, name);
     return make_cek_value(0, env, kont);
    }
    var
     b =
       kont_push
        (make_provide_frame(name, val, Sx_runtime[16].call(null, body), env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, body), env, b);
   }
   var j3 = [0, [2, 2.], 0], j4 = [2, 1.], j5 = [3, cst_value];
   function step_sf_context(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     a = [0, Sx_runtime[25].call(null, args), j3],
     b = Sx_runtime[2].call(null, cst$2, a),
     default_val =
       Sx_types[71].call(null, b)
        ? trampoline(eval_expr(Sx_runtime[18].call(null, args, j4), env))
        : 0,
     frame = kont_find_provide(kont, name);
    if(Sx_types[71].call(null, bind_tracking_ref[1])){
     var
      c =
        Sx_runtime[2].call
         (null, cst_contains, [0, bind_tracking_ref[1], [0, name, 0]]),
      d = [0, 1 - Sx_types[71].call(null, c)];
     if(Sx_types[71].call(null, d))
      bind_tracking_ref[1] =
       Sx_runtime[11].call(null, bind_tracking_ref[1], name);
    }
    var
     sv = Sx_runtime[107].call(null, name),
     e = Sx_runtime[84].call(null, sv),
     f =
       Sx_types[71].call(null, e)
        ? Sx_types
            [71].call
           (null, frame)
          ? Sx_runtime[26].call(null, frame, j5)
          : default_val
        : sv;
    return make_cek_value(f, env, kont);
   }
   var
    j6 = [0, [2, 2.], 0],
    j7 = [2, 1.],
    j8 = [3, cst_value],
    j9 = [3, cst_peek],
    j_ = [3, cst_peek];
   function step_sf_peek(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     b = [0, Sx_runtime[25].call(null, args), j6],
     c = Sx_runtime[2].call(null, cst$2, b),
     default_val =
       Sx_types[71].call(null, c)
        ? trampoline(eval_expr(Sx_runtime[18].call(null, args, j7), env))
        : 0,
     frame = kont_find_provide(kont, name);
    if(Sx_types[71].call(null, frame))
     var a = Sx_runtime[26].call(null, frame, j8);
    else{
     var d = Sx_runtime[76].call(null, env, j9);
     if(Sx_types[71].call(null, d))
      var
       e = Sx_runtime[77].call(null, env, j_),
       a = Sx_runtime[8].call(null, e, [6, [0, name, [0, default_val, 0]]]);
     else
      var a = default_val;
    }
    return make_cek_value(a, env, kont);
   }
   var j$ = [2, 1.];
   function step_sf_provide_b(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     a = kont_push(make_provide_set_frame(name, env), kont);
    return make_cek_state(Sx_runtime[18].call(null, args, j$), env, a);
   }
   var
    cst_scope_emit = "scope-emit!",
    ka = [2, 1.],
    kb = [3, cst_emitted],
    kc = [3, cst_emitted],
    kd = [3, cst_scope_emit],
    ke = [3, cst_scope_emit];
   function step_sf_emit(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     val = trampoline(eval_expr(Sx_runtime[18].call(null, args, ka), env)),
     frame = kont_find_scope_acc(kont, name);
    if(Sx_types[71].call(null, frame)){
     var
      a = [0, Sx_runtime[26].call(null, frame, kb), [0, [6, [0, val, 0]], 0]],
      b = Sx_runtime[2].call(null, cst_append, a);
     Sx_runtime[12].call(null, frame, kc, b);
     return make_cek_value(0, env, kont);
    }
    var c = Sx_runtime[76].call(null, env, kd);
    if(Sx_types[71].call(null, c)){
     var d = Sx_runtime[77].call(null, env, ke);
     Sx_runtime[8].call(null, d, [6, [0, name, [0, val, 0]]]);
    }
    return make_cek_value(0, env, kont);
   }
   var
    kf = [3, cst_emitted],
    kg = [3, cst_emitted],
    kh = [3, cst_emitted],
    ki = [6, 0];
   function step_sf_emitted(args, env, kont){
    var
     name = trampoline(eval_expr(Sx_runtime[15].call(null, args), env)),
     frame = kont_find_scope_acc(kont, name);
    if(Sx_types[71].call(null, frame))
     var a = Sx_runtime[26].call(null, frame, kf);
    else{
     var b = Sx_runtime[76].call(null, env, kg);
     if(Sx_types[71].call(null, b))
      var
       c = Sx_runtime[77].call(null, env, kh),
       a = Sx_runtime[8].call(null, c, [6, [0, name, 0]]);
     else
      var a = ki;
    }
    return make_cek_value(a, env, kont);
   }
   function step_sf_reset(args, env, kont){
    var a = kont_push(make_reset_frame(env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var kj = [2, 1.], kk = [2, 1.];
   function step_sf_shift(args, env, kont){
    var
     a = Sx_runtime[15].call(null, args),
     k_name = Sx_types[72].call(null, a),
     body = Sx_runtime[18].call(null, args, kj),
     captured_result = kont_capture_to_reset(kont),
     captured = Sx_runtime[15].call(null, captured_result),
     rest_kont = Sx_runtime[18].call(null, captured_result, kk),
     k = Sx_runtime[96].call(null, captured, rest_kont),
     shift_env = Sx_runtime[81].call(null, env),
     b = Sx_runtime[4].call(null, k_name);
    Sx_runtime[78].call(null, shift_env, b, k);
    return make_cek_state(body, shift_env, rest_kont);
   }
   function step_sf_deref(args, env, kont){
    var a = kont_push(make_deref_frame(env), kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var kl = [6, 0], km = [6, 0];
   function cek_call(f, args){
    var
     b = Sx_runtime[84].call(null, args),
     a = Sx_types[71].call(null, b) ? kl : args,
     c = Sx_runtime[84].call(null, f);
    if(Sx_types[71].call(null, c)) return 0;
    var
     or = Sx_runtime[86].call(null, f),
     or$0 = Sx_types[71].call(null, or) ? or : Sx_runtime[91].call(null, f);
    return Sx_types[71].call(null, or$0)
            ? cek_run
              (continue_with_call(f, a, Sx_runtime[80].call(null, 0), a, km))
            : 0;
   }
   var
    cst_update_fn = "update-fn",
    kn = [2, 1.],
    ko = [2, 2.],
    kp = [3, cst_update_fn],
    kq = [0, 0];
   function reactive_shift_deref(sig, env, kont){
    var
     scan_result = kont_capture_to_reactive_reset(kont),
     captured_frames = Sx_runtime[15].call(null, scan_result),
     reset_frame = Sx_runtime[18].call(null, scan_result, kn),
     remaining_kont = Sx_runtime[18].call(null, scan_result, ko),
     update_fn = Sx_runtime[26].call(null, reset_frame, kp),
     subscriber =
       [15,
        cst$9,
        function(args){
         var a = Sx_runtime[6].call(null, 0);
         Stdlib_List[18].call(null, function(d){cek_call(d, 0); return 0;}, a);
         var
          new_reset = make_reactive_reset_frame(env, update_fn, kq),
          new_kont =
            Sx_runtime[2].call
             (null,
              cst_concat,
              [0,
               captured_frames,
               [0, [6, [0, new_reset, 0]], [0, remaining_kont, 0]]]);
         return Sx_runtime[119].call
                 (null,
                  [15,
                   cst$9,
                   function(args){
                    if(args && ! args[2]){
                     var d = args[1];
                     Sx_runtime[11].call(null, 0, d);
                     return 0;
                    }
                    return 0;
                   }],
                  [15,
                   cst$9,
                   function(args){
                    return cek_run
                            (make_cek_value
                              (Sx_runtime[116].call(null, sig), env, new_kont));
                   }]);
        }];
    Sx_runtime[117].call(null, sig, subscriber);
    var
     initial_kont =
       Sx_runtime[2].call
        (null,
         cst_concat,
         [0,
          captured_frames,
          [0, [6, [0, reset_frame, 0]], [0, remaining_kont, 0]]]);
    return make_cek_value(Sx_runtime[116].call(null, sig), env, initial_kont);
   }
   var kr = [0, [3, cst_symbol], 0], ks = [6, 0];
   function step_eval_call(head, args, env, kont){
    var
     a = [0, Sx_runtime[74].call(null, head), kr],
     b = Sx_runtime[2].call(null, cst, a),
     hname = Sx_types[71].call(null, b) ? Sx_types[72].call(null, head) : 0;
    return make_cek_state
            (head,
             env,
             kont_push(make_arg_frame(0, ks, args, env, args, hname), kont));
   }
   var
    kt = [0, [3, cst_map], 0],
    ku = [0, [3, cst_map_indexed], 0],
    kv = [0, [3, cst_filter], 0],
    kw = [0, [3, cst_reduce], 0],
    kx = [0, [3, cst_some], 0],
    ky = [0, [3, cst_every$0], 0],
    kz = [0, [3, cst_for_each], 0];
   function ho_form_name_p(name){
    var or = Sx_runtime[2].call(null, cst, [0, name, kt]);
    if(Sx_types[71].call(null, or)) return or;
    var or$0 = Sx_runtime[2].call(null, cst, [0, name, ku]);
    if(Sx_types[71].call(null, or$0)) return or$0;
    var or$1 = Sx_runtime[2].call(null, cst, [0, name, kv]);
    if(Sx_types[71].call(null, or$1)) return or$1;
    var or$2 = Sx_runtime[2].call(null, cst, [0, name, kw]);
    if(Sx_types[71].call(null, or$2)) return or$2;
    var or$3 = Sx_runtime[2].call(null, cst, [0, name, kx]);
    if(Sx_types[71].call(null, or$3)) return or$3;
    var or$4 = Sx_runtime[2].call(null, cst, [0, name, ky]);
    return Sx_types[71].call(null, or$4)
            ? or$4
            : Sx_runtime[2].call(null, cst, [0, name, kz]);
   }
   function ho_fn_p(v){
    var or = Sx_runtime[91].call(null, v);
    return Sx_types[71].call(null, or) ? or : Sx_runtime[86].call(null, v);
   }
   var kA = [0, [3, cst_reduce], 0], kB = [2, 1.], kC = [2, 2.], kD = [2, 1.];
   function ho_swap_args(ho_type, evaled){
    var c = Sx_runtime[2].call(null, cst, [0, ho_type, kA]);
    if(Sx_types[71].call(null, c)){
     var
      a = Sx_runtime[15].call(null, evaled),
      b = Sx_runtime[18].call(null, evaled, kB),
      d = ho_fn_p(a),
      and = [0, 1 - Sx_types[71].call(null, d)],
      e = Sx_types[71].call(null, and) ? ho_fn_p(b) : and;
     return Sx_types[71].call(null, e)
             ? [6,
               [0, b, [0, Sx_runtime[18].call(null, evaled, kC), [0, a, 0]]]]
             : evaled;
    }
    var
     a$0 = Sx_runtime[15].call(null, evaled),
     b$0 = Sx_runtime[18].call(null, evaled, kD),
     f = ho_fn_p(a$0),
     and$0 = [0, 1 - Sx_types[71].call(null, f)],
     g = Sx_types[71].call(null, and$0) ? ho_fn_p(b$0) : and$0;
    return Sx_types[71].call(null, g) ? [6, [0, b$0, [0, a$0, 0]]] : evaled;
   }
   var
    kE = [0, [3, cst_map], 0],
    kF = [0, [2, 2.], 0],
    kG = [6, 0],
    kH = [6, 0],
    kI = [6, 0],
    kJ = [2, 1.],
    kK = [6, 0],
    kL = [6, 0],
    kM = [6, 0],
    kN = [0, [3, cst_map_indexed], 0],
    kO = [2, 1.],
    kP = [6, 0],
    kQ = [6, 0],
    kR = [6, 0],
    kS = [2, 0.],
    kT = [0, [3, cst_filter], 0],
    kU = [2, 1.],
    kV = [6, 0],
    kW = [6, 0],
    kX = [6, 0],
    kY = [0, [3, cst_reduce], 0],
    kZ = [2, 1.],
    k0 = [2, 2.],
    k1 = [6, 0],
    k2 = [0, [3, cst_some], 0],
    k3 = [2, 1.],
    k4 = [0, 0],
    k5 = [6, 0],
    k6 = [0, [3, cst_every], 0],
    k7 = [2, 1.],
    k8 = [0, 1],
    k9 = [6, 0],
    k_ = [0, [3, cst_for_each], 0],
    k$ = [2, 1.],
    la = [6, 0],
    lb = [3, "Unknown HO type: "];
   function ho_setup_dispatch(ho_type, evaled, env, kont){
    var
     ordered = ho_swap_args(ho_type, evaled),
     f = Sx_runtime[15].call(null, ordered),
     a = Sx_runtime[2].call(null, cst, [0, ho_type, kE]);
    if(Sx_types[71].call(null, a)){
     var
      b = [0, Sx_runtime[25].call(null, ordered), kF],
      c = Sx_runtime[2].call(null, cst$0, b);
     if(Sx_types[71].call(null, c)){
      var
       colls = Sx_runtime[16].call(null, ordered),
       d = Sx_runtime[6].call(null, colls),
       e =
         [0,
          Stdlib_List[34].call
           (null,
            function(c){
             var a = Sx_runtime[34].call(null, c);
             return Sx_types[71].call(null, a);
            },
            d)];
      if(Sx_types[71].call(null, e)) return make_cek_value(kG, env, kont);
      var
       g = Sx_runtime[6].call(null, colls),
       heads =
         [6,
          Stdlib_List[20].call
           (null, function(c){return Sx_runtime[15].call(null, c);}, g)],
       h = Sx_runtime[6].call(null, colls),
       tails =
         [6,
          Stdlib_List[20].call
           (null, function(c){return Sx_runtime[16].call(null, c);}, h)];
      return continue_with_call
              (f,
               heads,
               env,
               kI,
               kont_push(make_multi_map_frame(f, tails, kH, env), kont));
     }
     var
      coll = seq_to_list(Sx_runtime[18].call(null, ordered, kJ)),
      i = Sx_runtime[34].call(null, coll);
     if(Sx_types[71].call(null, i)) return make_cek_value(kK, env, kont);
     var
      j =
        kont_push
         (make_map_frame(f, Sx_runtime[16].call(null, coll), kL, env), kont);
     return continue_with_call
             (f, [6, [0, Sx_runtime[15].call(null, coll), 0]], env, kM, j);
    }
    var k = Sx_runtime[2].call(null, cst, [0, ho_type, kN]);
    if(Sx_types[71].call(null, k)){
     var
      coll$0 = seq_to_list(Sx_runtime[18].call(null, ordered, kO)),
      l = Sx_runtime[34].call(null, coll$0);
     if(Sx_types[71].call(null, l)) return make_cek_value(kP, env, kont);
     var
      m =
        kont_push
         (make_map_indexed_frame
           (f, Sx_runtime[16].call(null, coll$0), kQ, env),
          kont);
     return continue_with_call
             (f,
              [6, [0, kS, [0, Sx_runtime[15].call(null, coll$0), 0]]],
              env,
              kR,
              m);
    }
    var n = Sx_runtime[2].call(null, cst, [0, ho_type, kT]);
    if(Sx_types[71].call(null, n)){
     var
      coll$1 = seq_to_list(Sx_runtime[18].call(null, ordered, kU)),
      o = Sx_runtime[34].call(null, coll$1);
     if(Sx_types[71].call(null, o)) return make_cek_value(kV, env, kont);
     var
      p = Sx_runtime[15].call(null, coll$1),
      q =
        kont_push
         (make_filter_frame(f, Sx_runtime[16].call(null, coll$1), kW, p, env),
          kont);
     return continue_with_call
             (f, [6, [0, Sx_runtime[15].call(null, coll$1), 0]], env, kX, q);
    }
    var r = Sx_runtime[2].call(null, cst, [0, ho_type, kY]);
    if(Sx_types[71].call(null, r)){
     var
      init = Sx_runtime[18].call(null, ordered, kZ),
      coll$2 = seq_to_list(Sx_runtime[18].call(null, ordered, k0)),
      s = Sx_runtime[34].call(null, coll$2);
     if(Sx_types[71].call(null, s)) return make_cek_value(init, env, kont);
     var
      t =
        kont_push
         (make_reduce_frame(f, Sx_runtime[16].call(null, coll$2), env), kont);
     return continue_with_call
             (f,
              [6, [0, init, [0, Sx_runtime[15].call(null, coll$2), 0]]],
              env,
              k1,
              t);
    }
    var u = Sx_runtime[2].call(null, cst, [0, ho_type, k2]);
    if(Sx_types[71].call(null, u)){
     var
      coll$3 = seq_to_list(Sx_runtime[18].call(null, ordered, k3)),
      v = Sx_runtime[34].call(null, coll$3);
     if(Sx_types[71].call(null, v)) return make_cek_value(k4, env, kont);
     var
      w =
        kont_push
         (make_some_frame(f, Sx_runtime[16].call(null, coll$3), env), kont);
     return continue_with_call
             (f, [6, [0, Sx_runtime[15].call(null, coll$3), 0]], env, k5, w);
    }
    var x = Sx_runtime[2].call(null, cst, [0, ho_type, k6]);
    if(Sx_types[71].call(null, x)){
     var
      coll$4 = seq_to_list(Sx_runtime[18].call(null, ordered, k7)),
      y = Sx_runtime[34].call(null, coll$4);
     if(Sx_types[71].call(null, y)) return make_cek_value(k8, env, kont);
     var
      z =
        kont_push
         (make_every_frame(f, Sx_runtime[16].call(null, coll$4), env), kont);
     return continue_with_call
             (f, [6, [0, Sx_runtime[15].call(null, coll$4), 0]], env, k9, z);
    }
    var A = Sx_runtime[2].call(null, cst, [0, ho_type, k_]);
    if(! Sx_types[71].call(null, A)){
     var
      D = [3, Sx_runtime[5].call(null, [0, lb, [0, ho_type, 0]])],
      E = Sx_runtime[3].call(null, D);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], E], 1);
    }
    var
     coll$5 = seq_to_list(Sx_runtime[18].call(null, ordered, k$)),
     B = Sx_runtime[34].call(null, coll$5);
    if(Sx_types[71].call(null, B)) return make_cek_value(0, env, kont);
    var
     C =
       kont_push
        (make_for_each_frame(f, Sx_runtime[16].call(null, coll$5), env), kont);
    return continue_with_call
            (f, [6, [0, Sx_runtime[15].call(null, coll$5), 0]], env, la, C);
   }
   var lc = [6, 0], ld = [3, cst_map];
   function step_ho_map(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(ld, Sx_runtime[16].call(null, args), lc, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var le = [6, 0], lf = [3, cst_map_indexed];
   function step_ho_map_indexed(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(lf, Sx_runtime[16].call(null, args), le, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var lg = [6, 0], lh = [3, cst_filter];
   function step_ho_filter(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(lh, Sx_runtime[16].call(null, args), lg, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var li = [6, 0], lj = [3, cst_reduce];
   function step_ho_reduce(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(lj, Sx_runtime[16].call(null, args), li, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var lk = [6, 0], ll = [3, cst_some];
   function step_ho_some(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(ll, Sx_runtime[16].call(null, args), lk, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var lm = [6, 0], ln = [3, cst_every];
   function step_ho_every(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(ln, Sx_runtime[16].call(null, args), lm, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var lo = [6, 0], lp = [3, cst_for_each];
   function step_ho_for_each(args, env, kont){
    var
     a =
       kont_push
        (make_ho_setup_frame(lp, Sx_runtime[16].call(null, args), lo, env),
         kont);
    return make_cek_state(Sx_runtime[15].call(null, args), env, a);
   }
   var
    cst_vm_suspended = "__vm_suspended",
    cst_body = "body",
    cst_evaled = "evaled",
    cst_match_val = "match-val",
    cst_remaining = "remaining",
    cst_results = "results",
    cst_resume = "resume",
    cst_scheme = "scheme",
    cst_subscribers = "subscribers",
    last_error_kont_ref = [0, 0],
    lq = [0, [3, cst_if], 0],
    lr = [3, cst_env],
    ls = [3, "then"],
    lt = [3, cst_else],
    lu = [3, cst_env],
    lv = [3, cst_else],
    lw = [0, [3, cst_when], 0],
    lx = [3, cst_body],
    ly = [3, cst_env],
    lz = [0, [2, 1.], 0],
    lA = [0, [3, cst_begin], 0],
    lB = [3, cst_remaining],
    lC = [3, cst_env],
    lD = [0, [2, 1.], 0],
    lE = [0, [3, cst_let], 0],
    lF = [3, cst_name],
    lG = [3, cst_remaining],
    lH = [3, cst_body],
    lI = [3, cst_env],
    lJ = [0, [3, cst_symbol], 0],
    lK = [2, 1.],
    lL = [0, [3, cst_define], 0],
    lM = [3, cst_name],
    lN = [3, cst_env],
    lO = [3, "has-effects"],
    lP = [3, "effect-list"],
    lQ = [0, [3, cst_symbol], 0],
    lR = [3, cst_effect_annotations],
    lS = [3, cst_effect_annotations],
    lT = [3, cst_effect_annotations],
    lU = [0, [3, cst_define_foreign], 0],
    lV = [3, cst_name],
    lW = [3, cst_env],
    lX = [0, [3, cst_set], 0],
    lY = [3, cst_name],
    lZ = [3, cst_env],
    l0 = [0, [3, cst_and], 0],
    l1 = [3, cst_remaining],
    l2 = [0, [2, 1.], 0],
    l3 = [3, cst_env],
    l4 = [3, cst_env],
    l5 = [0, [3, cst_or], 0],
    l6 = [3, cst_remaining],
    l7 = [0, 0],
    l8 = [0, [2, 1.], 0],
    l9 = [3, cst_env],
    l_ = [3, cst_env],
    l$ = [0, [3, cst_cond], 0],
    ma = [3, cst_remaining],
    mb = [3, cst_env],
    mc = [3, cst_scheme],
    md = [0, [2, 2.], 0],
    me = [0, [3, cst_symbol], 0],
    mf = [2, 1.],
    mg = [0, [3, cst$10], 0],
    mh = [2, 1.],
    mi = [2, 2.],
    mj = [2, 1.],
    mk = [2, 1.],
    ml = [0, 1],
    mm = [2, 1.],
    mn = [2, 2.],
    mo = [0, [2, 2.], 0],
    mp = [2, 1.],
    mq = [0, 0],
    mr = [0, [3, cst_case], 0],
    ms = [3, cst_match_val],
    mt = [3, cst_remaining],
    mu = [3, cst_env],
    mv = [0, [3, cst_thread], 0],
    mw = [3, cst_remaining],
    mx = [3, cst_env],
    my = [3, "extra"],
    mz = [3, cst_name],
    mA = [0, [3, cst_as], 0],
    mB = [0, [3, cst_list], 0],
    mC = [0, [3, cst_symbol], 0],
    mD = [4, cst_quote],
    mE = [0, [3, cst_last], 0],
    mF = [0, [3, cst_arg], 0],
    mG = [3, cst_f],
    mH = [3, cst_evaled],
    mI = [3, cst_remaining],
    mJ = [3, cst_env],
    mK = [3, "raw-args"],
    mL = [3, "head-name"],
    mM = [6, 0],
    mN = [6, 0],
    mO = [6, 0],
    mP = [0, [3, cst_dict], 0],
    mQ = [3, cst_remaining],
    mR = [3, cst_results],
    mS = [3, cst_env],
    mT = [2, 0.],
    mU = [2, 1.],
    mV = [2, 1.],
    mW = [0, [3, cst_ho_setup], 0],
    mX = [3, "ho-type"],
    mY = [3, cst_remaining],
    mZ = [3, cst_evaled],
    m0 = [3, cst_env],
    m1 = [0, [3, cst_reset], 0],
    m2 = [0, [3, cst_deref], 0],
    m3 = [3, cst_env],
    m4 = [3, "sx-reactive"],
    m5 = [3, "deps"],
    m6 = [3, "notify"],
    m7 = [0, [3, cst_reactive_reset], 0],
    m8 = [3, cst_update_fn],
    m9 = [3, "first-render"],
    m_ = [0, [3, cst_scope], 0],
    m$ = [3, cst_name],
    na = [3, cst_remaining],
    nb = [3, cst_env],
    nc = [0, [3, cst_provide], 0],
    nd = [3, cst_remaining],
    ne = [3, cst_env],
    nf = [3, cst_name],
    ng = [3, cst_value],
    nh = [3, cst_name],
    ni = [3, cst_subscribers],
    nj = [3, cst_subscribers],
    nk = [0, [3, cst_bind], 0],
    nl = [3, cst_body],
    nm = [3, cst_env],
    nn = [3, "prev-tracking"],
    no = [6, 0],
    np = [6, 0],
    nq = [0, [3, cst_provide_set], 0],
    nr = [3, cst_name],
    ns = [3, cst_env],
    nt = [3, cst_value],
    nu = [3, cst_value],
    nv = [0, [3, cst_scope_acc], 0],
    nw = [3, cst_remaining],
    nx = [3, cst_env],
    ny = [3, cst_value],
    nz = [3, cst_name],
    nA = [3, cst_emitted],
    nB = [3, cst_emitted],
    nC = [0, [3, cst_map], 0],
    nD = [3, cst_f],
    nE = [3, cst_remaining],
    nF = [3, cst_results],
    nG = [3, "indexed"],
    nH = [3, cst_env],
    nI = [6, 0],
    nJ = [0, [3, cst_filter], 0],
    nK = [3, cst_f],
    nL = [3, cst_remaining],
    nM = [3, cst_results],
    nN = [3, "current-item"],
    nO = [3, cst_env],
    nP = [6, 0],
    nQ = [0, [3, cst_reduce], 0],
    nR = [3, cst_f],
    nS = [3, cst_remaining],
    nT = [3, cst_env],
    nU = [6, 0],
    nV = [0, [3, cst_for_each], 0],
    nW = [3, cst_f],
    nX = [3, cst_remaining],
    nY = [3, cst_env],
    nZ = [6, 0],
    n0 = [0, [3, cst_some], 0],
    n1 = [3, cst_f],
    n2 = [3, cst_remaining],
    n3 = [3, cst_env],
    n4 = [0, 0],
    n5 = [6, 0],
    n6 = [0, [3, cst_every], 0],
    n7 = [3, cst_f],
    n8 = [3, cst_remaining],
    n9 = [3, cst_env],
    n_ = [0, 0],
    n$ = [0, 1],
    oa = [6, 0],
    ob = [0, [3, cst_handler], 0],
    oc = [3, cst_remaining],
    od = [3, cst_env],
    oe = [3, cst_f],
    of = [0, [3, cst_restart], 0],
    og = [0, [3, cst_signal_return], 0],
    oh = [3, "saved-kont"],
    oi = [3, cst_env],
    oj = [0, [3, cst_comp_trace], 0],
    ok = [0, [3, cst_cond_arrow], 0],
    ol = [3, cst_match_val],
    om = [3, cst_env],
    on = [0, [3, cst_wind_after], 0],
    oo = [3, cst_after_thunk],
    op = [3, cst_winders_len],
    oq = [3, cst_env],
    or = [6, 0],
    os = [6, 0],
    ot = [0, [3, cst_wind_return], 0],
    ou = [3, cst_env],
    ov = [3, "body-result"],
    ow = [0, [3, cst_raise_eval], 0],
    ox = [3, cst_env],
    oy = [3, cst_scheme],
    oz = [3, cst_handler],
    oA = [3, cst_kont],
    oB = [3, "Unhandled exception: "],
    oC = [0, [3, cst_raise_guard], 0],
    oD = [3, "exception handler returned from non-continuable raise"],
    oE = [0, [3, cst_multi_map], 0],
    oF = [3, cst_f],
    oG = [3, cst_remaining],
    oH = [3, cst_results],
    oI = [3, cst_env],
    oJ = [6, 0],
    oK = [0, [3, cst_callcc], 0],
    oL = [3, cst_env],
    oM = [0, [3, cst_vm_resume], 0],
    oN = [3, cst_f],
    oO = [3, cst_vm_suspended],
    oP = [3, cst_env],
    oQ = [3, cst_resume],
    oR = [3, cst_env],
    oS = [3, cst_request],
    oT = [3, cst_env],
    oU = [0, [3, cst_perform], 0],
    oV = [3, cst_env],
    oW = [0, [3, cst_import], 0],
    oX = [3, cst_args],
    oY = [3, cst_remaining],
    oZ = [3, cst_env],
    o0 = [0, [3, cst_parameterize], 0],
    o1 = [3, cst_remaining],
    o2 = [3, cst_f],
    o3 = [3, cst_results],
    o4 = [3, cst_body],
    o5 = [3, cst_env],
    o6 = [2, 1.],
    o7 = [0, [2, 1.], 0],
    o8 = [4, cst_begin],
    o9 = [3, "Unknown frame type: "];
   function step_continue(state){
    var
     converted_val = cek_value(state),
     env = cek_env(state),
     kont = cek_kont(state),
     i = kont_empty_p(kont);
    if(Sx_types[71].call(null, i)) return state;
    var
     frame = kont_top(kont),
     rest_k = kont_pop(kont),
     match_val = frame_type(frame),
     j = Sx_runtime[2].call(null, cst, [0, match_val, lq]);
    if(Sx_types[71].call(null, j)){
     if(Sx_types[71].call(null, converted_val))
      var
       l = Sx_runtime[84].call(null, converted_val),
       c = [0, 1 - Sx_types[71].call(null, l)];
     else
      var c = converted_val;
     if(Sx_types[71].call(null, c)){
      var m = Sx_runtime[26].call(null, frame, lr);
      return make_cek_state(Sx_runtime[26].call(null, frame, ls), m, rest_k);
     }
     var
      n = Sx_runtime[26].call(null, frame, lt),
      o = Sx_runtime[84].call(null, n);
     if(Sx_types[71].call(null, o)) return make_cek_value(0, env, rest_k);
     var p = Sx_runtime[26].call(null, frame, lu);
     return make_cek_state(Sx_runtime[26].call(null, frame, lv), p, rest_k);
    }
    var q = Sx_runtime[2].call(null, cst, [0, match_val, lw]);
    if(Sx_types[71].call(null, q)){
     if(Sx_types[71].call(null, converted_val))
      var
       r = Sx_runtime[84].call(null, converted_val),
       e = [0, 1 - Sx_types[71].call(null, r)];
     else
      var e = converted_val;
     if(! Sx_types[71].call(null, e)) return make_cek_value(0, env, rest_k);
     var
      body = Sx_runtime[26].call(null, frame, lx),
      fenv = Sx_runtime[26].call(null, frame, ly),
      s = Sx_runtime[34].call(null, body);
     if(Sx_types[71].call(null, s)) return make_cek_value(0, fenv, rest_k);
     var
      t = [0, Sx_runtime[25].call(null, body), lz],
      u = Sx_runtime[2].call(null, cst, t);
     if(Sx_types[71].call(null, u))
      return make_cek_state(Sx_runtime[15].call(null, body), fenv, rest_k);
     var
      v =
        kont_push
         (make_begin_frame(Sx_runtime[16].call(null, body), fenv), rest_k);
     return make_cek_state(Sx_runtime[15].call(null, body), fenv, v);
    }
    var w = Sx_runtime[2].call(null, cst, [0, match_val, lA]);
    if(Sx_types[71].call(null, w)){
     var
      remaining = Sx_runtime[26].call(null, frame, lB),
      fenv$0 = Sx_runtime[26].call(null, frame, lC),
      x = Sx_runtime[34].call(null, remaining);
     if(Sx_types[71].call(null, x))
      return make_cek_value(converted_val, fenv$0, rest_k);
     var
      y = [0, Sx_runtime[25].call(null, remaining), lD],
      z = Sx_runtime[2].call(null, cst, y);
     if(Sx_types[71].call(null, z))
      return make_cek_state
              (Sx_runtime[15].call(null, remaining), fenv$0, rest_k);
     var
      A =
        kont_push
         (make_begin_frame(Sx_runtime[16].call(null, remaining), fenv$0),
          rest_k);
     return make_cek_state(Sx_runtime[15].call(null, remaining), fenv$0, A);
    }
    var B = Sx_runtime[2].call(null, cst, [0, match_val, lE]);
    if(Sx_types[71].call(null, B)){
     var
      name = Sx_runtime[26].call(null, frame, lF),
      remaining$0 = Sx_runtime[26].call(null, frame, lG),
      body$0 = Sx_runtime[26].call(null, frame, lH),
      local = Sx_runtime[26].call(null, frame, lI),
      C = Sx_runtime[4].call(null, name);
     Sx_runtime[78].call(null, local, C, converted_val);
     var D = Sx_runtime[34].call(null, remaining$0);
     if(Sx_types[71].call(null, D))
      return step_sf_begin(body$0, local, rest_k);
     var
      next_binding = Sx_runtime[15].call(null, remaining$0),
      E = Sx_runtime[15].call(null, next_binding),
      F = [0, Sx_runtime[74].call(null, E), lJ],
      G = Sx_runtime[2].call(null, cst, F);
     if(Sx_types[71].call(null, G))
      var
       H = Sx_runtime[15].call(null, next_binding),
       vname = Sx_types[72].call(null, H);
     else
      var vname = Sx_runtime[15].call(null, next_binding);
     var
      I =
        kont_push
         (make_let_frame
           (vname, Sx_runtime[16].call(null, remaining$0), body$0, local),
          rest_k);
     return make_cek_state
             (Sx_runtime[18].call(null, next_binding, lK), local, I);
    }
    var J = Sx_runtime[2].call(null, cst, [0, match_val, lL]);
    if(Sx_types[71].call(null, J)){
     var
      name$0 = Sx_runtime[26].call(null, frame, lM),
      fenv$1 = Sx_runtime[26].call(null, frame, lN),
      has_effects = Sx_runtime[26].call(null, frame, lO),
      effect_list = Sx_runtime[26].call(null, frame, lP),
      and = Sx_runtime[86].call(null, converted_val);
     if(Sx_types[71].call(null, and))
      var
       K = Sx_types[77].call(null, converted_val),
       g = Sx_runtime[84].call(null, K);
     else
      var g = and;
     if(Sx_types[71].call(null, g)){
      var L = Sx_runtime[4].call(null, name$0);
      Sx_runtime[83].call(null, converted_val, L);
     }
     var M = Sx_runtime[4].call(null, name$0);
     Sx_runtime[78].call(null, fenv$1, M, converted_val);
     if(Sx_types[71].call(null, has_effects)){
      var
       N = Sx_runtime[6].call(null, effect_list),
       effect_names =
         [6,
          Stdlib_List[20].call
           (null,
            function(e){
             var
              a = [0, Sx_runtime[74].call(null, e), lQ],
              b = Sx_runtime[2].call(null, cst, a);
             return Sx_types[71].call(null, b)
                     ? Sx_types[72].call(null, e)
                     : e;
            },
            N)],
       O = Sx_runtime[76].call(null, fenv$1, lR),
       effect_anns =
         Sx_types[71].call(null, O)
          ? Sx_runtime[77].call(null, fenv$1, lS)
          : [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
      Sx_runtime[12].call(null, effect_anns, name$0, effect_names);
      var P = Sx_runtime[4].call(null, lT);
      Sx_runtime[78].call(null, fenv$1, P, effect_anns);
     }
     return make_cek_value(converted_val, fenv$1, rest_k);
    }
    var Q = Sx_runtime[2].call(null, cst, [0, match_val, lU]);
    if(Sx_types[71].call(null, Q)){
     var
      name$1 = Sx_runtime[26].call(null, frame, lV),
      fenv$2 = Sx_runtime[26].call(null, frame, lW),
      and$0 = Sx_runtime[86].call(null, converted_val);
     if(Sx_types[71].call(null, and$0))
      var
       R = Sx_types[77].call(null, converted_val),
       h = Sx_runtime[84].call(null, R);
     else
      var h = and$0;
     if(Sx_types[71].call(null, h)){
      var S = Sx_runtime[4].call(null, name$1);
      Sx_runtime[83].call(null, converted_val, S);
     }
     var T = Sx_runtime[4].call(null, name$1);
     Sx_runtime[78].call(null, fenv$2, T, converted_val);
     return make_cek_value(converted_val, fenv$2, rest_k);
    }
    var U = Sx_runtime[2].call(null, cst, [0, match_val, lX]);
    if(Sx_types[71].call(null, U)){
     var
      name$2 = Sx_runtime[26].call(null, frame, lY),
      fenv$3 = Sx_runtime[26].call(null, frame, lZ),
      V = Sx_runtime[4].call(null, name$2);
     Sx_runtime[79].call(null, fenv$3, V, converted_val);
     return make_cek_value(converted_val, env, rest_k);
    }
    var W = Sx_runtime[2].call(null, cst, [0, match_val, l0]);
    if(Sx_types[71].call(null, W)){
     var X = [0, 1 - Sx_types[71].call(null, converted_val)];
     if(Sx_types[71].call(null, X))
      return make_cek_value(converted_val, env, rest_k);
     var
      remaining$1 = Sx_runtime[26].call(null, frame, l1),
      Y = Sx_runtime[34].call(null, remaining$1);
     if(Sx_types[71].call(null, Y))
      return make_cek_value(converted_val, env, rest_k);
     var
      Z = [0, Sx_runtime[25].call(null, remaining$1), l2],
      _ = Sx_runtime[2].call(null, cst, Z);
     if(Sx_types[71].call(null, _))
      var rest_k$0 = rest_k;
     else
      var
       aa = Sx_runtime[26].call(null, frame, l4),
       rest_k$0 =
         kont_push
          (make_and_frame(Sx_runtime[16].call(null, remaining$1), aa), rest_k);
     var $ = Sx_runtime[26].call(null, frame, l3);
     return make_cek_state
             (Sx_runtime[15].call(null, remaining$1), $, rest_k$0);
    }
    var ab = Sx_runtime[2].call(null, cst, [0, match_val, l5]);
    if(Sx_types[71].call(null, ab)){
     if(Sx_types[71].call(null, converted_val))
      return make_cek_value(converted_val, env, rest_k);
     var
      remaining$2 = Sx_runtime[26].call(null, frame, l6),
      ac = Sx_runtime[34].call(null, remaining$2);
     if(Sx_types[71].call(null, ac)) return make_cek_value(l7, env, rest_k);
     var
      ad = [0, Sx_runtime[25].call(null, remaining$2), l8],
      ae = Sx_runtime[2].call(null, cst, ad);
     if(Sx_types[71].call(null, ae))
      var rest_k$1 = rest_k;
     else
      var
       ag = Sx_runtime[26].call(null, frame, l_),
       rest_k$1 =
         kont_push
          (make_or_frame(Sx_runtime[16].call(null, remaining$2), ag), rest_k);
     var af = Sx_runtime[26].call(null, frame, l9);
     return make_cek_state
             (Sx_runtime[15].call(null, remaining$2), af, rest_k$1);
    }
    var ah = Sx_runtime[2].call(null, cst, [0, match_val, l$]);
    if(Sx_types[71].call(null, ah)){
     var
      remaining$3 = Sx_runtime[26].call(null, frame, ma),
      fenv$4 = Sx_runtime[26].call(null, frame, mb),
      scheme_p = Sx_runtime[26].call(null, frame, mc);
     if(! Sx_types[71].call(null, scheme_p)){
      if(Sx_types[71].call(null, converted_val))
       return make_cek_state
               (Sx_runtime[18].call(null, remaining$3, mm), fenv$4, rest_k);
      var
       aq =
         [0,
          remaining$3,
          [0, mn, [0, Sx_runtime[25].call(null, remaining$3), 0]]],
       next = Sx_runtime[2].call(null, cst_slice, aq),
       ar = [0, Sx_runtime[25].call(null, next), mo],
       as = Sx_runtime[2].call(null, cst$3, ar);
      if(Sx_types[71].call(null, as))
       return make_cek_value(0, fenv$4, rest_k);
      var
       next_test$0 = Sx_runtime[15].call(null, next),
       at = is_else_clause(next_test$0);
      return Sx_types[71].call(null, at)
              ? make_cek_state
                (Sx_runtime[18].call(null, next, mp), fenv$4, rest_k)
              : make_cek_state
                (next_test$0,
                 fenv$4,
                 kont_push(make_cond_frame(next, fenv$4, mq), rest_k));
     }
     if(! Sx_types[71].call(null, converted_val)){
      var
       next_clauses = Sx_runtime[16].call(null, remaining$3),
       ao = Sx_runtime[34].call(null, next_clauses);
      if(Sx_types[71].call(null, ao))
       return make_cek_value(0, fenv$4, rest_k);
      var
       next_clause = Sx_runtime[15].call(null, next_clauses),
       next_test = Sx_runtime[15].call(null, next_clause),
       ap = is_else_clause(next_test);
      return Sx_types[71].call(null, ap)
              ? make_cek_state
                (Sx_runtime[18].call(null, next_clause, mk), fenv$4, rest_k)
              : make_cek_state
                (next_test,
                 fenv$4,
                 kont_push(make_cond_frame(next_clauses, fenv$4, ml), rest_k));
     }
     var
      clause = Sx_runtime[15].call(null, remaining$3),
      ai = [0, Sx_runtime[25].call(null, clause), md],
      and$1 = Sx_runtime[2].call(null, cst$0, ai);
     if(Sx_types[71].call(null, and$1)){
      var
       aj = Sx_runtime[18].call(null, clause, mf),
       ak = [0, Sx_runtime[74].call(null, aj), me],
       and$2 = Sx_runtime[2].call(null, cst, ak);
      if(Sx_types[71].call(null, and$2))
       var
        al = Sx_runtime[18].call(null, clause, mh),
        am = [0, Sx_types[72].call(null, al), mg],
        b = Sx_runtime[2].call(null, cst, am);
      else
       var b = and$2;
     }
     else
      var b = and$1;
     if(! Sx_types[71].call(null, b))
      return make_cek_state
              (Sx_runtime[18].call(null, clause, mj), fenv$4, rest_k);
     var an = kont_push(make_cond_arrow_frame(converted_val, fenv$4), rest_k);
     return make_cek_state(Sx_runtime[18].call(null, clause, mi), fenv$4, an);
    }
    var au = Sx_runtime[2].call(null, cst, [0, match_val, mr]);
    if(Sx_types[71].call(null, au)){
     var
      match_val$0 = Sx_runtime[26].call(null, frame, ms),
      remaining$4 = Sx_runtime[26].call(null, frame, mt),
      fenv$5 = Sx_runtime[26].call(null, frame, mu),
      av = Sx_runtime[84].call(null, match_val$0);
     return Sx_types[71].call(null, av)
             ? sf_case_step_loop(converted_val, remaining$4, fenv$5, rest_k)
             : sf_case_step_loop(match_val$0, remaining$4, fenv$5, rest_k);
    }
    var aw = Sx_runtime[2].call(null, cst, [0, match_val, mv]);
    if(Sx_types[71].call(null, aw)){
     var
      remaining$5 = Sx_runtime[26].call(null, frame, mw),
      fenv$6 = Sx_runtime[26].call(null, frame, mx),
      mode = Sx_runtime[26].call(null, frame, my),
      bind_name = Sx_runtime[26].call(null, frame, mz),
      ax = Sx_runtime[34].call(null, remaining$5);
     if(Sx_types[71].call(null, ax))
      return make_cek_value(converted_val, fenv$6, rest_k);
     var
      form = Sx_runtime[15].call(null, remaining$5),
      rest_forms = Sx_runtime[16].call(null, remaining$5),
      ay = Sx_runtime[16].call(null, remaining$5),
      az = Sx_runtime[34].call(null, ay),
      new_kont =
        Sx_types[71].call(null, az)
         ? rest_k
         : kont_push
           (make_thread_frame
             (Sx_runtime[16].call(null, remaining$5), fenv$6, mode, bind_name),
            rest_k),
      aA = Sx_runtime[2].call(null, cst, [0, mode, mA]);
     if(Sx_types[71].call(null, aA)){
      var
       new_env = Sx_runtime[81].call(null, fenv$6),
       aB = Sx_types[72].call(null, bind_name),
       aC = Sx_runtime[4].call(null, aB);
      Sx_runtime[78].call(null, new_env, aC, converted_val);
      return make_cek_state(form, new_env, new_kont);
     }
     var
      aD = [0, Sx_runtime[74].call(null, form), mB],
      and$3 = Sx_runtime[2].call(null, cst, aD);
     if(Sx_types[71].call(null, and$3)){
      var
       aE = Sx_runtime[34].call(null, form),
       and$4 = [0, 1 - Sx_types[71].call(null, aE)];
      if(Sx_types[71].call(null, and$4)){
       var
        aF = Sx_runtime[15].call(null, form),
        aG = [0, Sx_runtime[74].call(null, aF), mC],
        and$5 = Sx_runtime[2].call(null, cst, aG);
       if(Sx_types[71].call(null, and$5))
        var
         aH = Sx_runtime[15].call(null, form),
         a = ho_form_name_p(Sx_types[72].call(null, aH));
       else
        var a = and$5;
      }
      else
       var a = and$4;
     }
     else
      var a = and$3;
     if(Sx_types[71].call(null, a)){
      var
       aI = Sx_runtime[16].call(null, form),
       aJ = Sx_runtime[19].call(null, [6, [0, mD, [0, converted_val, 0]]], aI),
       aK = Sx_runtime[15].call(null, form);
      return make_cek_state
              (Sx_runtime[19].call(null, aK, aJ), fenv$6, new_kont);
     }
     var aL = Sx_runtime[2].call(null, cst, [0, mode, mE]);
     if(Sx_types[71].call(null, aL)){
      var
       result = thread_insert_arg_last(form, converted_val, fenv$6),
       aM = Sx_runtime[34].call(null, rest_forms);
      return Sx_types[71].call(null, aM)
              ? make_cek_value(result, fenv$6, rest_k)
              : make_cek_value
                (result,
                 fenv$6,
                 kont_push
                  (make_thread_frame(rest_forms, fenv$6, mode, bind_name),
                   rest_k));
     }
     var
      result$0 = thread_insert_arg(form, converted_val, fenv$6),
      aN = Sx_runtime[34].call(null, rest_forms);
     return Sx_types[71].call(null, aN)
             ? make_cek_value(result$0, fenv$6, rest_k)
             : make_cek_value
               (result$0,
                fenv$6,
                kont_push
                 (make_thread_frame(rest_forms, fenv$6, mode, bind_name),
                  rest_k));
    }
    var aO = Sx_runtime[2].call(null, cst, [0, match_val, mF]);
    if(Sx_types[71].call(null, aO)){
     var
      f = Sx_runtime[26].call(null, frame, mG),
      evaled = Sx_runtime[26].call(null, frame, mH),
      remaining$6 = Sx_runtime[26].call(null, frame, mI),
      fenv$7 = Sx_runtime[26].call(null, frame, mJ),
      raw_args = Sx_runtime[26].call(null, frame, mK),
      hname = Sx_runtime[26].call(null, frame, mL),
      aP = Sx_runtime[84].call(null, f);
     if(Sx_types[71].call(null, aP)){
      var
       and$6 = strict_ref[1],
       hname$0 = Sx_types[71].call(null, and$6) ? hname : and$6;
      if(Sx_types[71].call(null, hname$0)) strict_check_args(hname, mM);
      var aQ = Sx_runtime[34].call(null, remaining$6);
      if(Sx_types[71].call(null, aQ))
       return continue_with_call(converted_val, mN, fenv$7, raw_args, rest_k);
      var
       aR =
         kont_push
          (make_arg_frame
            (converted_val,
             mO,
             Sx_runtime[16].call(null, remaining$6),
             fenv$7,
             raw_args,
             hname),
           rest_k);
      return make_cek_state
              (Sx_runtime[15].call(null, remaining$6), fenv$7, aR);
     }
     var
      new_evaled =
        Sx_runtime[2].call
         (null, cst_append, [0, evaled, [0, [6, [0, converted_val, 0]], 0]]),
      aS = Sx_runtime[34].call(null, remaining$6);
     if(! Sx_types[71].call(null, aS)){
      var
       aT =
         kont_push
          (make_arg_frame
            (f,
             new_evaled,
             Sx_runtime[16].call(null, remaining$6),
             fenv$7,
             raw_args,
             hname),
           rest_k);
      return make_cek_state
              (Sx_runtime[15].call(null, remaining$6), fenv$7, aT);
     }
     var
      and$7 = strict_ref[1],
      hname$1 = Sx_types[71].call(null, and$7) ? hname : and$7;
     if(Sx_types[71].call(null, hname$1))
      strict_check_args(hname, new_evaled);
     return continue_with_call(f, new_evaled, fenv$7, raw_args, rest_k);
    }
    var aU = Sx_runtime[2].call(null, cst, [0, match_val, mP]);
    if(Sx_types[71].call(null, aU)){
     var
      remaining$7 = Sx_runtime[26].call(null, frame, mQ),
      results = Sx_runtime[26].call(null, frame, mR),
      fenv$8 = Sx_runtime[26].call(null, frame, mS),
      last_result = Sx_runtime[17].call(null, results),
      aV =
        [0,
         [6,
          [0,
           [6,
            [0, Sx_runtime[15].call(null, last_result), [0, converted_val, 0]]],
           0]],
         0],
      aW = [0, Sx_runtime[25].call(null, results), 0],
      aX =
        [0, results, [0, mT, [0, Sx_runtime[2].call(null, cst_dec, aW), 0]]],
      aY = [0, Sx_runtime[2].call(null, cst_slice, aX), aV],
      completed = Sx_runtime[2].call(null, cst_append, aY),
      aZ = Sx_runtime[34].call(null, remaining$7);
     if(Sx_types[71].call(null, aZ)){
      var
       d = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
       a0 = Sx_runtime[6].call(null, completed);
      Stdlib_List[18].call
       (null,
        function(pair){
         var
          a = Sx_runtime[18].call(null, pair, mU),
          b = Sx_runtime[15].call(null, pair);
         Sx_runtime[12].call(null, d, b, a);
         return 0;
        },
        a0);
      return make_cek_value(d, fenv$8, rest_k);
     }
     var
      next_entry = Sx_runtime[15].call(null, remaining$7),
      a1 =
        [0,
         completed,
         [0,
          [6, [0, [6, [0, Sx_runtime[15].call(null, next_entry), 0]], 0]],
          0]],
      a2 = Sx_runtime[2].call(null, cst_append, a1),
      a3 =
        kont_push
         (make_dict_frame(Sx_runtime[16].call(null, remaining$7), a2, fenv$8),
          rest_k);
     return make_cek_state
             (Sx_runtime[18].call(null, next_entry, mV), fenv$8, a3);
    }
    var a4 = Sx_runtime[2].call(null, cst, [0, match_val, mW]);
    if(Sx_types[71].call(null, a4)){
     var
      ho_type = Sx_runtime[26].call(null, frame, mX),
      remaining$8 = Sx_runtime[26].call(null, frame, mY),
      a5 =
        [0,
         Sx_runtime[26].call(null, frame, mZ),
         [0, [6, [0, converted_val, 0]], 0]],
      evaled$0 = Sx_runtime[2].call(null, cst_append, a5),
      fenv$9 = Sx_runtime[26].call(null, frame, m0),
      a6 = Sx_runtime[34].call(null, remaining$8);
     if(Sx_types[71].call(null, a6))
      return ho_setup_dispatch(ho_type, evaled$0, fenv$9, rest_k);
     var
      a7 =
        kont_push
         (make_ho_setup_frame
           (ho_type, Sx_runtime[16].call(null, remaining$8), evaled$0, fenv$9),
          rest_k);
     return make_cek_state(Sx_runtime[15].call(null, remaining$8), fenv$9, a7);
    }
    var a8 = Sx_runtime[2].call(null, cst, [0, match_val, m1]);
    if(Sx_types[71].call(null, a8))
     return make_cek_value(converted_val, env, rest_k);
    var a9 = Sx_runtime[2].call(null, cst, [0, match_val, m2]);
    if(Sx_types[71].call(null, a9)){
     var
      fenv$10 = Sx_runtime[26].call(null, frame, m3),
      a_ = Sx_runtime[90].call(null, converted_val),
      a$ = [0, 1 - Sx_types[71].call(null, a_)];
     if(Sx_types[71].call(null, a$))
      return make_cek_value(converted_val, fenv$10, rest_k);
     var ba = has_reactive_reset_frame_p(rest_k);
     if(Sx_types[71].call(null, ba))
      return reactive_shift_deref(converted_val, fenv$10, rest_k);
     var ctx = Sx_runtime[72].call(null, m4, 0);
     if(Sx_types[71].call(null, ctx)){
      var
       dep_list = Sx_runtime[26].call(null, ctx, m5),
       notify_fn = Sx_runtime[26].call(null, ctx, m6),
       bb =
         Sx_runtime[2].call
          (null, cst_contains, [0, dep_list, [0, converted_val, 0]]),
       bc = [0, 1 - Sx_types[71].call(null, bb)];
      if(Sx_types[71].call(null, bc)){
       Sx_runtime[11].call(null, dep_list, converted_val);
       Sx_runtime[117].call(null, converted_val, notify_fn);
      }
     }
     return make_cek_value
             (Sx_runtime[116].call(null, converted_val), fenv$10, rest_k);
    }
    var bd = Sx_runtime[2].call(null, cst, [0, match_val, m7]);
    if(Sx_types[71].call(null, bd)){
     var
      update_fn = Sx_runtime[26].call(null, frame, m8),
      first_p = Sx_runtime[26].call(null, frame, m9),
      be =
        Sx_types[71].call(null, update_fn)
         ? [0, 1 - Sx_types[71].call(null, first_p)]
         : update_fn;
     if(Sx_types[71].call(null, be))
      cek_call(update_fn, [6, [0, converted_val, 0]]);
     return make_cek_value(converted_val, env, rest_k);
    }
    var bf = Sx_runtime[2].call(null, cst, [0, match_val, m_]);
    if(Sx_types[71].call(null, bf)){
     var
      name$3 = Sx_runtime[26].call(null, frame, m$),
      remaining$9 = Sx_runtime[26].call(null, frame, na),
      fenv$11 = Sx_runtime[26].call(null, frame, nb),
      bg = Sx_runtime[34].call(null, remaining$9);
     if(Sx_types[71].call(null, bg)){
      Sx_runtime[106].call(null, name$3);
      return make_cek_value(converted_val, fenv$11, rest_k);
     }
     var
      bh =
        kont_push
         (make_scope_frame
           (name$3, Sx_runtime[16].call(null, remaining$9), fenv$11),
          rest_k);
     return make_cek_state
             (Sx_runtime[15].call(null, remaining$9), fenv$11, bh);
    }
    var bi = Sx_runtime[2].call(null, cst, [0, match_val, nc]);
    if(Sx_types[71].call(null, bi)){
     var
      remaining$10 = Sx_runtime[26].call(null, frame, nd),
      fenv$12 = Sx_runtime[26].call(null, frame, ne),
      bj = Sx_runtime[34].call(null, remaining$10);
     if(Sx_types[71].call(null, bj)){
      var bk = Sx_runtime[26].call(null, frame, nf);
      Sx_runtime[106].call(null, bk);
      return make_cek_value(converted_val, fenv$12, rest_k);
     }
     var
      bl = Sx_runtime[16].call(null, remaining$10),
      bm = Sx_runtime[26].call(null, frame, ng),
      new_frame =
        make_provide_frame
         (Sx_runtime[26].call(null, frame, nh), bm, bl, fenv$12),
      bn = Sx_runtime[26].call(null, frame, ni);
     Sx_runtime[12].call(null, new_frame, nj, bn);
     var bo = kont_push(new_frame, rest_k);
     return make_cek_state
             (Sx_runtime[15].call(null, remaining$10), fenv$12, bo);
    }
    var bp = Sx_runtime[2].call(null, cst, [0, match_val, nk]);
    if(Sx_types[71].call(null, bp)){
     var
      tracked = bind_tracking_ref[1],
      body$1 = Sx_runtime[26].call(null, frame, nl),
      fenv$13 = Sx_runtime[26].call(null, frame, nm),
      prev = Sx_runtime[26].call(null, frame, nn);
     bind_tracking_ref[1] = prev;
     var
      subscriber =
        [15,
         cst$9,
         function(args){
          if(args && ! args[2])
           return cek_run(make_cek_state(body$1, fenv$13, no));
          return 0;
         }],
      bq = Sx_runtime[6].call(null, tracked);
     Stdlib_List[18].call
      (null,
       function(name){
        var
         existing =
           Sx_runtime[26].call(null, provide_subscribers_ref[1], name),
         existing$0 = Sx_types[71].call(null, existing) ? existing : np,
         a =
           Sx_runtime[2].call
            (null,
             cst_append,
             [0, existing$0, [0, [6, [0, subscriber, 0]], 0]]);
        Sx_runtime[12].call(null, provide_subscribers_ref[1], name, a);
        return 0;
       },
       bq);
     return make_cek_value(converted_val, fenv$13, rest_k);
    }
    var br = Sx_runtime[2].call(null, cst, [0, match_val, nq]);
    if(Sx_types[71].call(null, br)){
     var
      name$4 = Sx_runtime[26].call(null, frame, nr),
      fenv$14 = Sx_runtime[26].call(null, frame, ns),
      target = kont_find_provide(rest_k, name$4),
      old_val =
        Sx_types[71].call(null, target)
         ? Sx_runtime[26].call(null, target, nt)
         : Sx_runtime[107].call(null, name$4);
     if(Sx_types[71].call(null, target))
      Sx_runtime[12].call(null, target, nu, converted_val);
     Sx_runtime[106].call(null, name$4);
     Sx_runtime[105].call(null, name$4, converted_val);
     var
      bs = Sx_runtime[2].call(null, cst, [0, old_val, [0, converted_val, 0]]),
      bt = [0, 1 - Sx_types[71].call(null, bs)];
     if(Sx_types[71].call(null, bt)) fire_provide_subscribers(name$4);
     return make_cek_value(converted_val, fenv$14, rest_k);
    }
    var bu = Sx_runtime[2].call(null, cst, [0, match_val, nv]);
    if(Sx_types[71].call(null, bu)){
     var
      remaining$11 = Sx_runtime[26].call(null, frame, nw),
      fenv$15 = Sx_runtime[26].call(null, frame, nx),
      bv = Sx_runtime[34].call(null, remaining$11);
     if(Sx_types[71].call(null, bv))
      return make_cek_value(converted_val, fenv$15, rest_k);
     var
      bw = Sx_runtime[16].call(null, remaining$11),
      bx = Sx_runtime[26].call(null, frame, ny),
      new_frame$0 =
        make_scope_acc_frame
         (Sx_runtime[26].call(null, frame, nz), bx, bw, fenv$15),
      by = Sx_runtime[26].call(null, frame, nA);
     Sx_runtime[12].call(null, new_frame$0, nB, by);
     var bz = kont_push(new_frame$0, rest_k);
     return make_cek_state
             (Sx_runtime[15].call(null, remaining$11), fenv$15, bz);
    }
    var bA = Sx_runtime[2].call(null, cst, [0, match_val, nC]);
    if(Sx_types[71].call(null, bA)){
     var
      f$0 = Sx_runtime[26].call(null, frame, nD),
      remaining$12 = Sx_runtime[26].call(null, frame, nE),
      results$0 = Sx_runtime[26].call(null, frame, nF),
      indexed = Sx_runtime[26].call(null, frame, nG),
      fenv$16 = Sx_runtime[26].call(null, frame, nH),
      new_results =
        Sx_runtime[2].call
         (null,
          cst_append,
          [0, results$0, [0, [6, [0, converted_val, 0]], 0]]),
      bB = Sx_runtime[34].call(null, remaining$12);
     if(Sx_types[71].call(null, bB))
      return make_cek_value(new_results, fenv$16, rest_k);
     if(Sx_types[71].call(null, indexed))
      var
       bC = [0, Sx_runtime[15].call(null, remaining$12), 0],
       call_args = [6, [0, Sx_runtime[25].call(null, new_results), bC]];
     else
      var call_args = [6, [0, Sx_runtime[15].call(null, remaining$12), 0]];
     var
      next_frame =
        Sx_types[71].call(null, indexed)
         ? make_map_indexed_frame
           (f$0,
            Sx_runtime[16].call(null, remaining$12),
            new_results,
            fenv$16)
         : make_map_frame
           (f$0,
            Sx_runtime[16].call(null, remaining$12),
            new_results,
            fenv$16);
     return continue_with_call
             (f$0, call_args, fenv$16, nI, kont_push(next_frame, rest_k));
    }
    var bD = Sx_runtime[2].call(null, cst, [0, match_val, nJ]);
    if(Sx_types[71].call(null, bD)){
     var
      f$1 = Sx_runtime[26].call(null, frame, nK),
      remaining$13 = Sx_runtime[26].call(null, frame, nL),
      results$1 = Sx_runtime[26].call(null, frame, nM),
      current_item = Sx_runtime[26].call(null, frame, nN),
      fenv$17 = Sx_runtime[26].call(null, frame, nO),
      new_results$0 =
        Sx_types[71].call(null, converted_val)
         ? Sx_runtime
            [2].call
           (null,
            cst_append,
            [0, results$1, [0, [6, [0, current_item, 0]], 0]])
         : results$1,
      bE = Sx_runtime[34].call(null, remaining$13);
     if(Sx_types[71].call(null, bE))
      return make_cek_value(new_results$0, fenv$17, rest_k);
     var
      bF = Sx_runtime[15].call(null, remaining$13),
      bG =
        kont_push
         (make_filter_frame
           (f$1,
            Sx_runtime[16].call(null, remaining$13),
            new_results$0,
            bF,
            fenv$17),
          rest_k);
     return continue_with_call
             (f$1,
              [6, [0, Sx_runtime[15].call(null, remaining$13), 0]],
              fenv$17,
              nP,
              bG);
    }
    var bH = Sx_runtime[2].call(null, cst, [0, match_val, nQ]);
    if(Sx_types[71].call(null, bH)){
     var
      f$2 = Sx_runtime[26].call(null, frame, nR),
      remaining$14 = Sx_runtime[26].call(null, frame, nS),
      fenv$18 = Sx_runtime[26].call(null, frame, nT),
      bI = Sx_runtime[34].call(null, remaining$14);
     if(Sx_types[71].call(null, bI))
      return make_cek_value(converted_val, fenv$18, rest_k);
     var
      bJ =
        kont_push
         (make_reduce_frame
           (f$2, Sx_runtime[16].call(null, remaining$14), fenv$18),
          rest_k);
     return continue_with_call
             (f$2,
              [6,
               [0,
                converted_val,
                [0, Sx_runtime[15].call(null, remaining$14), 0]]],
              fenv$18,
              nU,
              bJ);
    }
    var bK = Sx_runtime[2].call(null, cst, [0, match_val, nV]);
    if(Sx_types[71].call(null, bK)){
     var
      f$3 = Sx_runtime[26].call(null, frame, nW),
      remaining$15 = Sx_runtime[26].call(null, frame, nX),
      fenv$19 = Sx_runtime[26].call(null, frame, nY),
      bL = Sx_runtime[34].call(null, remaining$15);
     if(Sx_types[71].call(null, bL))
      return make_cek_value(0, fenv$19, rest_k);
     var
      bM =
        kont_push
         (make_for_each_frame
           (f$3, Sx_runtime[16].call(null, remaining$15), fenv$19),
          rest_k);
     return continue_with_call
             (f$3,
              [6, [0, Sx_runtime[15].call(null, remaining$15), 0]],
              fenv$19,
              nZ,
              bM);
    }
    var bN = Sx_runtime[2].call(null, cst, [0, match_val, n0]);
    if(Sx_types[71].call(null, bN)){
     var
      f$4 = Sx_runtime[26].call(null, frame, n1),
      remaining$16 = Sx_runtime[26].call(null, frame, n2),
      fenv$20 = Sx_runtime[26].call(null, frame, n3);
     if(Sx_types[71].call(null, converted_val))
      return make_cek_value(converted_val, fenv$20, rest_k);
     var bO = Sx_runtime[34].call(null, remaining$16);
     if(Sx_types[71].call(null, bO))
      return make_cek_value(n4, fenv$20, rest_k);
     var
      bP =
        kont_push
         (make_some_frame
           (f$4, Sx_runtime[16].call(null, remaining$16), fenv$20),
          rest_k);
     return continue_with_call
             (f$4,
              [6, [0, Sx_runtime[15].call(null, remaining$16), 0]],
              fenv$20,
              n5,
              bP);
    }
    var bQ = Sx_runtime[2].call(null, cst, [0, match_val, n6]);
    if(Sx_types[71].call(null, bQ)){
     var
      f$5 = Sx_runtime[26].call(null, frame, n7),
      remaining$17 = Sx_runtime[26].call(null, frame, n8),
      fenv$21 = Sx_runtime[26].call(null, frame, n9),
      bR = [0, 1 - Sx_types[71].call(null, converted_val)];
     if(Sx_types[71].call(null, bR))
      return make_cek_value(n_, fenv$21, rest_k);
     var bS = Sx_runtime[34].call(null, remaining$17);
     if(Sx_types[71].call(null, bS))
      return make_cek_value(n$, fenv$21, rest_k);
     var
      bT =
        kont_push
         (make_every_frame
           (f$5, Sx_runtime[16].call(null, remaining$17), fenv$21),
          rest_k);
     return continue_with_call
             (f$5,
              [6, [0, Sx_runtime[15].call(null, remaining$17), 0]],
              fenv$21,
              oa,
              bT);
    }
    var bU = Sx_runtime[2].call(null, cst, [0, match_val, ob]);
    if(Sx_types[71].call(null, bU)){
     var
      remaining$18 = Sx_runtime[26].call(null, frame, oc),
      fenv$22 = Sx_runtime[26].call(null, frame, od),
      bV = Sx_runtime[34].call(null, remaining$18);
     if(Sx_types[71].call(null, bV))
      return make_cek_value(converted_val, fenv$22, rest_k);
     var
      bW = Sx_runtime[16].call(null, remaining$18),
      bX =
        kont_push
         (make_handler_frame
           (Sx_runtime[26].call(null, frame, oe), bW, fenv$22),
          rest_k);
     return make_cek_state
             (Sx_runtime[15].call(null, remaining$18), fenv$22, bX);
    }
    var bY = Sx_runtime[2].call(null, cst, [0, match_val, of]);
    if(Sx_types[71].call(null, bY))
     return make_cek_value(converted_val, env, rest_k);
    var bZ = Sx_runtime[2].call(null, cst, [0, match_val, og]);
    if(Sx_types[71].call(null, bZ)){
     var saved_kont = Sx_runtime[26].call(null, frame, oh);
     return make_cek_value
             (converted_val, Sx_runtime[26].call(null, frame, oi), saved_kont);
    }
    var b0 = Sx_runtime[2].call(null, cst, [0, match_val, oj]);
    if(Sx_types[71].call(null, b0))
     return make_cek_value(converted_val, env, rest_k);
    var b1 = Sx_runtime[2].call(null, cst, [0, match_val, ok]);
    if(Sx_types[71].call(null, b1)){
     var
      test_value = Sx_runtime[26].call(null, frame, ol),
      fenv$23 = Sx_runtime[26].call(null, frame, om);
     return continue_with_call
             (converted_val,
              [6, [0, test_value, 0]],
              fenv$23,
              [6, [0, test_value, 0]],
              rest_k);
    }
    var b2 = Sx_runtime[2].call(null, cst, [0, match_val, on]);
    if(Sx_types[71].call(null, b2)){
     var
      after_thunk = Sx_runtime[26].call(null, frame, oo),
      winders_len = Sx_runtime[26].call(null, frame, op),
      fenv$24 = Sx_runtime[26].call(null, frame, oq),
      b3 = [0, Sx_runtime[25].call(null, winders_ref[1]), [0, winders_len, 0]],
      b4 = Sx_runtime[2].call(null, cst$0, b3);
     if(Sx_types[71].call(null, b4))
      winders_ref[1] = Sx_runtime[16].call(null, winders_ref[1]);
     return continue_with_call
             (after_thunk,
              os,
              fenv$24,
              or,
              kont_push
               (make_wind_return_frame(converted_val, fenv$24), rest_k));
    }
    var b5 = Sx_runtime[2].call(null, cst, [0, match_val, ot]);
    if(Sx_types[71].call(null, b5)){
     var b6 = Sx_runtime[26].call(null, frame, ou);
     return make_cek_value(Sx_runtime[26].call(null, frame, ov), b6, rest_k);
    }
    var b7 = Sx_runtime[2].call(null, cst, [0, match_val, ow]);
    if(Sx_types[71].call(null, b7)){
     var
      fenv$25 = Sx_runtime[26].call(null, frame, ox),
      continuable_p = Sx_runtime[26].call(null, frame, oy),
      unwind_result = kont_unwind_to_handler(rest_k, converted_val),
      handler_fn = Sx_runtime[26].call(null, unwind_result, oz),
      unwound_k = Sx_runtime[26].call(null, unwind_result, oA),
      b8 = Sx_runtime[84].call(null, handler_fn);
     if(Sx_types[71].call(null, b8)){
      last_error_kont_ref[1] = unwound_k;
      var
       b9 = [0, oB, [0, Sx_runtime[69].call(null, converted_val), 0]],
       b_ = [3, Sx_runtime[5].call(null, b9)];
      return Sx_runtime[102].call(null, b_);
     }
     var
      b$ =
        Sx_types[71].call(null, continuable_p)
         ? kont_push(make_signal_return_frame(fenv$25, unwound_k), unwound_k)
         : kont_push(make_raise_guard_frame(fenv$25, unwound_k), unwound_k);
     return continue_with_call
             (handler_fn,
              [6, [0, converted_val, 0]],
              fenv$25,
              [6, [0, converted_val, 0]],
              b$);
    }
    var ca = Sx_runtime[2].call(null, cst, [0, match_val, oC]);
    if(Sx_types[71].call(null, ca)){
     last_error_kont_ref[1] = rest_k;
     return Sx_runtime[102].call(null, oD);
    }
    var cb = Sx_runtime[2].call(null, cst, [0, match_val, oE]);
    if(Sx_types[71].call(null, cb)){
     var
      f$6 = Sx_runtime[26].call(null, frame, oF),
      remaining$19 = Sx_runtime[26].call(null, frame, oG),
      cc =
        [0,
         Sx_runtime[26].call(null, frame, oH),
         [0, [6, [0, converted_val, 0]], 0]],
      new_results$1 = Sx_runtime[2].call(null, cst_append, cc),
      fenv$26 = Sx_runtime[26].call(null, frame, oI),
      cd = Sx_runtime[6].call(null, remaining$19),
      ce =
        [0,
         Stdlib_List[34].call
          (null,
           function(c){
            var a = Sx_runtime[34].call(null, c);
            return Sx_types[71].call(null, a);
           },
           cd)];
     if(Sx_types[71].call(null, ce))
      return make_cek_value(new_results$1, fenv$26, rest_k);
     var
      cf = Sx_runtime[6].call(null, remaining$19),
      heads =
        [6,
         Stdlib_List[20].call
          (null, function(c){return Sx_runtime[15].call(null, c);}, cf)],
      cg = Sx_runtime[6].call(null, remaining$19),
      tails =
        [6,
         Stdlib_List[20].call
          (null, function(c){return Sx_runtime[16].call(null, c);}, cg)];
     return continue_with_call
             (f$6,
              heads,
              fenv$26,
              oJ,
              kont_push
               (make_multi_map_frame(f$6, tails, new_results$1, fenv$26),
                rest_k));
    }
    var ch = Sx_runtime[2].call(null, cst, [0, match_val, oK]);
    if(Sx_types[71].call(null, ch)){
     var
      ci = Sx_runtime[25].call(null, winders_ref[1]),
      k = Sx_runtime[99].call(null, rest_k, ci);
     return continue_with_call
             (converted_val,
              [6, [0, k, 0]],
              Sx_runtime[26].call(null, frame, oL),
              [6, [0, k, 0]],
              rest_k);
    }
    var cj = Sx_runtime[2].call(null, cst, [0, match_val, oM]);
    if(Sx_types[71].call(null, cj)){
     var
      resume_fn = Sx_runtime[26].call(null, frame, oN),
      result$1 =
        Sx_runtime[8].call(null, resume_fn, [6, [0, converted_val, 0]]),
      and$8 = Sx_runtime[39].call(null, result$1),
      ck =
        Sx_types[71].call(null, and$8)
         ? Sx_runtime[26].call(null, result$1, oO)
         : and$8;
     if(! Sx_types[71].call(null, ck))
      return make_cek_value
              (result$1, Sx_runtime[26].call(null, frame, oT), rest_k);
     var
      cl = Sx_runtime[26].call(null, frame, oP),
      cm =
        kont_push
         (make_vm_resume_frame(Sx_runtime[26].call(null, result$1, oQ), cl),
          rest_k),
      cn = Sx_runtime[26].call(null, frame, oR);
     return make_cek_suspended
             (Sx_runtime[26].call(null, result$1, oS), cn, cm);
    }
    var co = Sx_runtime[2].call(null, cst, [0, match_val, oU]);
    if(Sx_types[71].call(null, co))
     return make_cek_suspended
             (converted_val, Sx_runtime[26].call(null, frame, oV), rest_k);
    var cp = Sx_runtime[2].call(null, cst, [0, match_val, oW]);
    if(Sx_types[71].call(null, cp)){
     var
      import_set = Sx_runtime[26].call(null, frame, oX),
      remaining_sets = Sx_runtime[26].call(null, frame, oY),
      fenv$27 = Sx_runtime[26].call(null, frame, oZ);
     bind_import_set(import_set, fenv$27);
     var cq = Sx_runtime[34].call(null, remaining_sets);
     return Sx_types[71].call(null, cq)
             ? make_cek_value(0, fenv$27, rest_k)
             : step_sf_import(remaining_sets, fenv$27, rest_k);
    }
    var cr = Sx_runtime[2].call(null, cst, [0, match_val, o0]);
    if(! Sx_types[71].call(null, cr)){
     last_error_kont_ref[1] = rest_k;
     var
      cA = [3, Sx_runtime[5].call(null, [0, o9, [0, match_val, 0]])],
      cB = Sx_runtime[3].call(null, cA);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], cB], 1);
    }
    var
     remaining$20 = Sx_runtime[26].call(null, frame, o1),
     current_param = Sx_runtime[26].call(null, frame, o2),
     results$2 = Sx_runtime[26].call(null, frame, o3),
     body$2 = Sx_runtime[26].call(null, frame, o4),
     fenv$28 = Sx_runtime[26].call(null, frame, o5),
     cs = Sx_runtime[84].call(null, current_param);
    if(Sx_types[71].call(null, cs)){
     var
      ct = Sx_runtime[15].call(null, remaining$20),
      val_expr = Sx_runtime[18].call(null, ct, o6);
     return make_cek_state
             (val_expr,
              fenv$28,
              kont_push
               (make_parameterize_frame
                 (remaining$20, converted_val, results$2, body$2, fenv$28),
                rest_k));
    }
    var
     cu =
       [0,
        results$2,
        [0,
         [6,
          [0,
           [6,
            [0,
             Sx_types[106].call(null, current_param),
             [0, converted_val, 0]]],
           0]],
         0]],
     new_results$2 = Sx_runtime[2].call(null, cst_append, cu),
     rest_bindings = Sx_runtime[16].call(null, remaining$20),
     cv = Sx_runtime[34].call(null, rest_bindings);
    if(Sx_types[71].call(null, cv)){
     var
      cw = [0, Sx_runtime[25].call(null, body$2), o7],
      cx = Sx_runtime[2].call(null, cst, cw),
      body_expr =
        Sx_types[71].call(null, cx)
         ? Sx_runtime[15].call(null, body$2)
         : Sx_runtime[19].call(null, o8, body$2),
      provide_kont = kont_push_provides(new_results$2, fenv$28, rest_k);
     return make_cek_state(body_expr, fenv$28, provide_kont);
    }
    var
     cy =
       kont_push
        (make_parameterize_frame
          (rest_bindings, 0, new_results$2, body$2, fenv$28),
         rest_k),
     cz = Sx_runtime[15].call(null, rest_bindings);
    return make_cek_state(Sx_runtime[15].call(null, cz), fenv$28, cy);
   }
   var
    o_ = [3, cst_value],
    o$ = [3, "captured"],
    pa = [0, 0],
    pb = [3, "message"],
    pc = [3, cst_vm_suspended],
    pd = [3, cst_resume],
    pe = [3, cst_request],
    pf = [3, cst_args_got],
    pg = [3, cst_expects],
    ph = [3, cst_lambda],
    pi = [2, 1.],
    pj = [3, cst_vm_suspended],
    pk = [3, cst_resume],
    pl = [3, cst_request],
    pm = [2, 1.],
    pn = [3, cst_children],
    po = [3, "Not callable: "];
   function continue_with_call(f, args, env, raw_args, kont){
    var b = Sx_types[105].call(null, f);
    if(Sx_types[71].call(null, b)){
     var
      uid = Sx_types[106].call(null, f),
      frame = kont_find_provide(kont, uid),
      c =
        Sx_types[71].call(null, frame)
         ? Sx_runtime[26].call(null, frame, o_)
         : Sx_types[107].call(null, f);
     return make_cek_value(c, env, kont);
    }
    var d = Sx_runtime[98].call(null, f);
    if(Sx_types[71].call(null, d)){
     var
      e = Sx_runtime[34].call(null, args),
      arg = Sx_types[71].call(null, e) ? 0 : Sx_runtime[15].call(null, args),
      captured = Sx_runtime[100].call(null, f),
      w_len = Sx_runtime[101].call(null, f);
     wind_escape_to(w_len);
     return make_cek_value(arg, env, captured);
    }
    var g = Sx_runtime[95].call(null, f);
    if(Sx_types[71].call(null, g)){
     var
      h = Sx_runtime[34].call(null, args),
      arg$0 = Sx_types[71].call(null, h) ? 0 : Sx_runtime[15].call(null, args),
      cont_data = Sx_runtime[97].call(null, f),
      captured$0 = Sx_runtime[26].call(null, cont_data, o$),
      result = cek_run(make_cek_value(arg$0, env, captured$0));
     return make_cek_value(result, env, kont);
    }
    var and = Sx_runtime[91].call(null, f);
    if(Sx_types[71].call(null, and)){
     var
      i = Sx_runtime[86].call(null, f),
      and$0 = [0, 1 - Sx_types[71].call(null, i)];
     if(Sx_types[71].call(null, and$0)){
      var
       j = Sx_runtime[87].call(null, f),
       and$1 = [0, 1 - Sx_types[71].call(null, j)];
      if(Sx_types[71].call(null, and$1))
       var
        k = Sx_runtime[88].call(null, f),
        a = [0, 1 - Sx_types[71].call(null, k)];
      else
       var a = and$1;
     }
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a)){
     var
      result$0 = Sx_runtime[9].call(null, f, args),
      l = [0, Sx_runtime[10].call(null, result$0)];
     if(Sx_types[71].call(null, l)){
      var m = kont_push(make_raise_eval_frame(env, pa), kont);
      return make_cek_value(Sx_runtime[26].call(null, result$0, pb), env, m);
     }
     var
      and$2 = Sx_runtime[39].call(null, result$0),
      n =
        Sx_types[71].call(null, and$2)
         ? Sx_runtime[26].call(null, result$0, pc)
         : and$2;
     if(! Sx_types[71].call(null, n))
      return make_cek_value(result$0, env, kont);
     var
      o =
        kont_push
         (make_vm_resume_frame(Sx_runtime[26].call(null, result$0, pd), env),
          kont);
     return make_cek_suspended
             (Sx_runtime[26].call(null, result$0, pe), env, o);
    }
    var p = Sx_runtime[86].call(null, f);
    if(! Sx_types[71].call(null, p)){
     var
      or$1 = Sx_runtime[87].call(null, f),
      or$2 =
        Sx_types[71].call(null, or$1) ? or$1 : Sx_runtime[88].call(null, f);
     if(! Sx_types[71].call(null, or$2)){
      var
       P = [0, po, [0, Sx_runtime[69].call(null, f), 0]],
       Q = [3, Sx_runtime[5].call(null, P)],
       R = Sx_runtime[3].call(null, Q);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], R], 1);
     }
     var
      parsed = parse_keyword_args(raw_args, env),
      kwargs = Sx_runtime[15].call(null, parsed),
      children = Sx_runtime[18].call(null, parsed, pm),
      I = Sx_types[85].call(null, f),
      local$0 = Sx_runtime[82].call(null, I, env),
      J = Sx_types[83].call(null, f),
      K = Sx_runtime[6].call(null, J);
     Stdlib_List[18].call
      (null,
       function(p){
        var
         or = Sx_runtime[57].call(null, kwargs, p),
         or$0 = Sx_types[71].call(null, or) ? or : 0,
         a = Sx_runtime[4].call(null, p);
        Sx_runtime[78].call(null, local$0, a, or$0);
        return 0;
       },
       K);
     var L = Sx_types[86].call(null, f);
     if(Sx_types[71].call(null, L)){
      var M = Sx_runtime[4].call(null, pn);
      Sx_runtime[78].call(null, local$0, M, children);
     }
     var
      N = Sx_types[80].call(null, f),
      O =
        kont_push(make_comp_trace_frame(Sx_types[79].call(null, f), N), kont);
     return make_cek_state(Sx_types[84].call(null, f), local$0, O);
    }
    var
     params = Sx_types[74].call(null, f),
     q = Sx_types[76].call(null, f),
     local = Sx_runtime[82].call(null, q, env),
     r = bind_lambda_params(params, args, local),
     s = [0, 1 - Sx_types[71].call(null, r)];
    if(Sx_types[71].call(null, s)){
     var
      t = [0, Sx_runtime[25].call(null, params), 0],
      u = [0, Sx_runtime[25].call(null, args), t],
      v = Sx_runtime[2].call(null, cst$0, u);
     if(Sx_types[71].call(null, v)){
      var
       w = [0, pf, [0, Sx_runtime[25].call(null, args), 0]],
       x = [0, pg, [0, Sx_runtime[25].call(null, params), w]],
       or = Sx_types[77].call(null, f),
       or$0 = Sx_types[71].call(null, or) ? or : ph,
       y = [3, Sx_runtime[5].call(null, [0, or$0, x])],
       z = Sx_runtime[3].call(null, y);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], z], 1);
     }
     var
      A = Sx_runtime[2].call(null, cst_zip, [0, params, [0, args, 0]]),
      B = Sx_runtime[6].call(null, A);
     Stdlib_List[18].call
      (null,
       function(pair){
        var
         a = Sx_runtime[18].call(null, pair, pi),
         b = Sx_runtime[15].call(null, pair),
         c = Sx_runtime[4].call(null, b);
        Sx_runtime[78].call(null, local, c, a);
        return 0;
       },
       B);
     var
      C = [0, params, [0, Sx_runtime[25].call(null, args), 0]],
      D = Sx_runtime[2].call(null, cst_slice, C),
      E = Sx_runtime[6].call(null, D);
     Stdlib_List[18].call
      (null,
       function(p){
        var a = Sx_runtime[4].call(null, p);
        Sx_runtime[78].call(null, local, a, 0);
        return 0;
       },
       E);
    }
    var
     jit_result = Sx_runtime[139].call(null, f, args),
     F = Sx_runtime[138].call(null, jit_result);
    if(Sx_types[71].call(null, F))
     return make_cek_state(Sx_types[75].call(null, f), local, kont);
    var
     and$3 = Sx_runtime[39].call(null, jit_result),
     G =
       Sx_types[71].call(null, and$3)
        ? Sx_runtime[26].call(null, jit_result, pj)
        : and$3;
    if(! Sx_types[71].call(null, G))
     return make_cek_value(jit_result, local, kont);
    var
     H =
       kont_push
        (make_vm_resume_frame(Sx_runtime[26].call(null, jit_result, pk), env),
         kont);
    return make_cek_suspended
            (Sx_runtime[26].call(null, jit_result, pl), env, H);
   }
   var pp = [0, [2, 2.], 0], pq = [2, 1.], pr = [0, [2, 2.], 0];
   function sf_case_step_loop(match_val, clauses$1, env, kont){
    var clauses = clauses$1;
    for(;;){
     var
      a = [0, Sx_runtime[25].call(null, clauses), pp],
      b = Sx_runtime[2].call(null, cst$3, a);
     if(Sx_types[71].call(null, b)) return make_cek_value(0, env, kont);
     var
      test = Sx_runtime[15].call(null, clauses),
      body = Sx_runtime[18].call(null, clauses, pq),
      c = is_else_clause(test);
     if(Sx_types[71].call(null, c)) return make_cek_state(body, env, kont);
     var
      test_val = trampoline(eval_expr(test, env)),
      d = Sx_runtime[2].call(null, cst, [0, match_val, [0, test_val, 0]]);
     if(Sx_types[71].call(null, d)) return make_cek_state(body, env, kont);
     var clauses$0 = Sx_runtime[2].call(null, cst_slice, [0, clauses, pr]);
     clauses = clauses$0;
    }
   }
   var ps = [6, 0];
   function eval_expr_cek(expr, env){
    return cek_run(make_cek_state(expr, env, ps));
   }
   function trampoline_cek(val){
    var a = Sx_runtime[85].call(null, val);
    if(! Sx_types[71].call(null, a)) return val;
    var b = Sx_types[93].call(null, val);
    return eval_expr_cek(Sx_types[92].call(null, val), b);
   }
   function make_coroutine(thunk){
    return [23, [0, "coroutine", 0, 0, 0, 0, 0, 0, 0, 0, 0]];
   }
   var pt = [6, 0];
   function eval_expr(expr, env){
    return cek_run(make_cek_state(expr, env, pt));
   }
   caml_update_dummy
    (custom_special_forms, [7, Stdlib_Hashtbl[1].call(null, 0, 0)]);
   caml_update_dummy(bind_tracking_ref, [0, 0]);
   caml_update_dummy(provide_batch_depth_ref, [0, [2, 0.]]);
   caml_update_dummy(provide_batch_queue_ref, [0, [6, 0]]);
   caml_update_dummy
    (provide_subscribers_ref, [0, [7, Stdlib_Hashtbl[1].call(null, 0, 0)]]);
   var provide_subscribers = [];
   caml_update_dummy
    (provide_subscribers, [7, Stdlib_Hashtbl[1].call(null, 0, 0)]);
   caml_update_dummy(winders_ref, [0, [6, 0]]);
   caml_update_dummy
    (library_registry, [7, Stdlib_Hashtbl[1].call(null, 0, 0)]);
   caml_update_dummy(io_registry, [7, Stdlib_Hashtbl[1].call(null, 0, 0)]);
   caml_update_dummy
    (foreign_registry, [7, Stdlib_Hashtbl[1].call(null, 0, 0)]);
   caml_update_dummy(strict_ref, [0, [0, 0]]);
   caml_update_dummy(prim_param_types_ref, [0, 0]);
   trampoline_fn[1] =
    function(v){
     if(typeof v !== "number" && 12 === v[0]){
      var env = v[2], expr = v[1];
      return eval_expr(expr, [20, env]);
     }
     return v;
    };
   Sx_primitives[3][1] = trampoline_fn[1];
   function cek_run_iterative(state){
    var s = [0, state];
    try{
     for(;;){
      var match = cek_terminal_p(s[1]);
      a:
      {
       if(typeof match !== "number" && 0 === match[0] && match[1]){var a = 1; break a;}
       var a = 0;
      }
      if(! a){
       var match$2 = cek_suspended_p(s[1]);
       a:
       {
        if(typeof match$2 !== "number" && 0 === match$2[0] && match$2[1]){var c = 1; break a;}
        var c = 0;
       }
       if(! c){s[1] = cek_step(s[1]); continue;}
      }
      var match$0 = cek_suspended_p(s[1]);
      a:
      {
       if(typeof match$0 !== "number" && 0 === match$0[0] && match$0[1]){
        var match$1 = Sx_types[13][1];
        if(! match$1)
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], cst_IO_suspension_in_non_IO_co], 1);
        var hook = match$1[1], b = caml_call1(hook, s[1]);
        break a;
       }
       var b = cek_value(s[1]);
      }
      return b;
     }
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg = exn[2];
     last_error_kont_ref[1] = cek_kont(s[1]);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], msg], 1);
    }
   }
   var cst$16 = "", a = [6, 0];
   function collect_comp_trace(kont){
    var k = kont, trace = 0;
    for(;;){
     a:
     {
      if(typeof k !== "number" && 6 === k[0] && k[1]){var c = 1; break a;}
      var c = 0;
     }
     if(! c) return Stdlib_List[10].call(null, trace);
     if(typeof k === "number" || ! (6 === k[0]))
      k = a;
     else{
      var match = k[1];
      if(match){
       var rest = match[2], frame = match[1];
       if(typeof frame === "number")
        var trace$0 = trace;
       else
        switch(frame[0]){
          case 7:
           var
            d = frame[1],
            match$0 = Stdlib_Hashtbl[7].call(null, d, cst_type);
           a:
           {
            if(match$0){
             var b = match$0[1];
             if
              (typeof b !== "number" && 3 === b[0] && b[1] === cst_comp_trace){var e = 1; break a;}
            }
            var e = 0;
           }
           if(e){
            var
             match$1 = Stdlib_Hashtbl[7].call(null, d, cst_name),
             cst = cst$4;
            if(match$1){
             var match$2 = match$1[1];
             if(typeof match$2 === "number" || ! (3 === match$2[0]))
              var name = cst;
             else
              var s$0 = match$2[1], name = s$0;
            }
            else
             var name = cst;
            var
             match$3 = Stdlib_Hashtbl[7].call(null, d, cst_file),
             cst$0 = cst$16;
            if(match$3){
             var match$4 = match$3[1];
             if(typeof match$4 === "number" || ! (3 === match$4[0]))
              var file = cst$0;
             else
              var s = match$4[1], file = s;
            }
            else
             var file = cst$0;
            var trace$0 = [0, [0, name, file], trace];
           }
           else
            var trace$0 = trace;
           break;
          case 23:
           var f = frame[1];
           if(f[1] === cst_comp_trace){
            var match$5 = f[3];
            if(typeof match$5 === "number" || ! (3 === match$5[0]))
             var name$0 = cst$4;
            else
             var s$2 = match$5[1], name$0 = s$2;
            var match$6 = f[2], cst$1 = cst$16;
            if(typeof match$6 === "number")
             var file$0 = 0 === match$6 ? cst$16 : cst$1;
            else if(3 === match$6[0])
             var s$1 = match$6[1], file$0 = s$1;
            else
             var file$0 = cst$1;
            var trace$0 = [0, [0, name$0, file$0], trace];
           }
           else
            var trace$0 = trace;
           break;
          default: var trace$0 = trace;
        }
       k = [6, rest];
       trace = trace$0;
      }
      else
       k = a;
     }
    }
   }
   function format_comp_trace(trace){
    if(! trace) return cst$16;
    var
     lines =
       Stdlib_List[21].call
        (null,
         function(i, param){
          var
           file = param[2],
           name = param[1],
           prefix = 0 === i ? "  in " : "  called from ";
          if(file === cst$16){
           var a = Stdlib[28].call(null, cst$13, name);
           return Stdlib[28].call(null, prefix, a);
          }
          var
           b = Stdlib[28].call(null, file, cst$6),
           c = Stdlib[28].call(null, cst$7, b),
           d = Stdlib[28].call(null, name, c),
           e = Stdlib[28].call(null, cst$13, d);
          return Stdlib[28].call(null, prefix, e);
         },
         trace),
     cst = "\n",
     a = Stdlib_String[7].call(null, cst, lines);
    return Stdlib[28].call(null, cst, a);
   }
   function enhance_error_with_trace(msg){
    var trace = collect_comp_trace(last_error_kont_ref[1]);
    last_error_kont_ref[1] = 0;
    var a = format_comp_trace(trace);
    return Stdlib[28].call(null, msg, a);
   }
   var
    pu = [0, 0],
    pv = [0, 0],
    pw =
      [0,
       [2,
        0,
        [11, cst_expected, [4, 0, 0, 0, [11, cst_args_got, [4, 0, 0, 0, 0]]]]],
       "%s: expected %d args, got %d"],
    px = [0, 0],
    py = [0, 0];
   function sf_define_type(args, env_val){
    a:
    {
     if(typeof args !== "number" && 6 === args[0]){var l = args[1], items = l; break a;}
     var items = 0;
    }
    var
     type_sym = Stdlib_List[8].call(null, items, 0),
     type_name = Sx_types[35].call(null, type_sym),
     ctor_specs = Stdlib_List[7].call(null, items);
    function env_bind_v(k, v){
     Sx_runtime[78].call(null, env_val, [3, k], v);
     return 0;
    }
    var a = Sx_runtime[76].call(null, env_val, [3, cst_adt_registry]);
    if(1 - Sx_types[71].call(null, a))
     env_bind_v(cst_adt_registry, [7, Stdlib_Hashtbl[1].call(null, 0, 8)]);
    var
     registry = Sx_runtime[77].call(null, env_val, [3, cst_adt_registry]),
     ctor_names =
       Stdlib_List[20].call
        (null,
         function(spec){
          if(typeof spec !== "number" && 6 === spec[0]){
           var match = spec[1];
           if(match){
            var sym = match[1];
            return [3, Sx_types[35].call(null, sym)];
           }
          }
          return 0;
         },
         ctor_specs);
    if(typeof registry !== "number" && 7 === registry[0]){
     var d = registry[1];
     Stdlib_Hashtbl[11].call(null, d, type_name, [6, ctor_names]);
    }
    var
     b =
       [15,
        Stdlib[28].call(null, type_name, cst$4),
        function(pargs){
         if(pargs && ! pargs[2]){
          var v = pargs[1];
          if(typeof v !== "number" && 38 === v[0]){
           var a = v[1];
           return [0, a[1] === type_name ? 1 : 0];
          }
          return pv;
         }
         return pu;
        }];
    env_bind_v(Stdlib[28].call(null, type_name, cst$4), b);
    Stdlib_List[18].call
     (null,
      function(spec){
       if(typeof spec !== "number" && 6 === spec[0]){
        var match = spec[1];
        if(match){
         var
          fields = match[2],
          sym = match[1],
          cn = Sx_types[35].call(null, sym),
          field_names = Stdlib_List[20].call(null, Sx_types[35], fields),
          arity = Stdlib_List[1].call(null, fields);
         env_bind_v
          (cn,
           [15,
            cn,
            function(ctor_args){
             if(Stdlib_List[1].call(null, ctor_args) === arity)
              return [38,
                      [0, type_name, cn, Stdlib_Array[11].call(null, ctor_args)]];
             var
              a = Stdlib_List[1].call(null, ctor_args),
              b = caml_call3(Stdlib_Printf[4].call(null, pw), cn, arity, a);
             throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
            }]);
         var
          a =
            [15,
             Stdlib[28].call(null, cn, cst$4),
             function(pargs){
              if(pargs && ! pargs[2]){
               var v = pargs[1];
               if(typeof v !== "number" && 38 === v[0]){
                var a = v[1];
                return [0, a[2] === cn ? 1 : 0];
               }
               return py;
              }
              return px;
             }];
         env_bind_v(Stdlib[28].call(null, cn, cst$4), a);
         return Stdlib_List[19].call
                 (null,
                  function(idx, fname){
                   var
                    a = Stdlib[28].call(null, cst$5, fname),
                    b =
                      [15,
                       Stdlib[28].call(null, cn, a),
                       function(pargs){
                        if(pargs && ! pargs[2]){
                         var v = pargs[1];
                         if(typeof v !== "number" && 38 === v[0]){
                          var a = v[1];
                          if(idx < a[3].length - 1)
                           return runtime.caml_check_bound(a[3], idx)[idx + 1];
                          var
                           h = Stdlib[28].call(null, fname, ": index out of bounds"),
                           i = Stdlib[28].call(null, cst$5, h),
                           j = Stdlib[28].call(null, cn, i);
                          throw caml_maybe_attach_backtrace([0, Sx_types[9], j], 1);
                         }
                         var
                          e = Stdlib[28].call(null, fname, ": not an ADT"),
                          f = Stdlib[28].call(null, cst$5, e),
                          g = Stdlib[28].call(null, cn, f);
                         throw caml_maybe_attach_backtrace([0, Sx_types[9], g], 1);
                        }
                        var
                         b = Stdlib[28].call(null, fname, ": expected 1 arg"),
                         c = Stdlib[28].call(null, cst$5, b),
                         d = Stdlib[28].call(null, cn, c);
                        throw caml_maybe_attach_backtrace([0, Sx_types[9], d], 1);
                       }],
                    c = Stdlib[28].call(null, cst$5, fname);
                   return env_bind_v(Stdlib[28].call(null, cn, c), b);
                  },
                  field_names);
        }
       }
       return 0;
      },
      ctor_specs);
    return 0;
   }
   var cst_define_type = "define-type";
   register_special_form
    ([3, cst_define_type],
     [15,
      cst_define_type,
      function(call_args){
       if(call_args){
        var a = call_args[2];
        if(a && ! a[2]){
         var env = a[1], args = call_args[1];
         return sf_define_type(args, env);
        }
       }
       return 0;
      }]);
   var cst_list$0 = "_list", cst_values = "_values", pz = [0, 1];
   function make_values_dict(vs){
    var d = Stdlib_Hashtbl[1].call(null, 0, 2);
    Stdlib_Hashtbl[11].call(null, d, cst_values, pz);
    Stdlib_Hashtbl[11].call(null, d, cst_list$0, [6, vs]);
    return [7, d];
   }
   function values_to_list(result){
    if(typeof result !== "number" && 7 === result[0]){
     var d = result[1], match = Stdlib_Hashtbl[7].call(null, d, cst_values);
     a:
     {
      if(match){
       var a = match[1];
       if(typeof a !== "number" && 0 === a[0] && a[1]){var b = 1; break a;}
      }
      var b = 0;
     }
     if(b){
      var match$0 = Stdlib_Hashtbl[7].call(null, d, cst_list$0);
      if(match$0){
       var match$1 = match$0[1];
       if(typeof match$1 !== "number" && 6 === match$1[0]){var l = match$1[1]; return l;}
      }
      return [0, result, 0];
     }
    }
    return [0, result, 0];
   }
   function sf_let_values(args, env_val){
    a:
    {
     if(typeof args !== "number" && 6 === args[0]){var l$0 = args[1], items = l$0; break a;}
     var items = 0;
    }
    var match = Stdlib_List[9].call(null, items, 0);
    a:
    {
     if(match){
      var match$0 = match[1];
      if(typeof match$0 !== "number" && 6 === match$0[0]){var l = match$0[1], clauses = l; break a;}
     }
     var clauses = 0;
    }
    var
     body =
       1 < Stdlib_List[1].call(null, items)
        ? Stdlib_List[7].call(null, items)
        : 0,
     local_env = Sx_runtime[81].call(null, env_val);
    Stdlib_List[18].call
     (null,
      function(clause){
       a:
       {
        if(typeof clause !== "number" && 6 === clause[0]){
         var b = clause[1];
         if(b){
          var match$0 = b[1];
          if(typeof match$0 !== "number" && 6 === match$0[0]){var ns = match$0[1], names = ns; break a;}
         }
        }
        var names = 0;
       }
       a:
       {
        if(typeof clause !== "number" && 6 === clause[0]){
         var a = clause[1];
         if(a){
          var match = a[2];
          if(match){var e = match[1], val_expr = e; break a;}
         }
        }
        var val_expr = 0;
       }
       var
        result = eval_expr(val_expr, local_env),
        vs = values_to_list(result);
       return Stdlib_List[19].call
               (null,
                function(idx, name){
                 a:
                 {
                  if(typeof name !== "number" && name[0] - 3 >>> 0 < 2){var s = name[1], n = s; break a;}
                  var n = Sx_types[35].call(null, name);
                 }
                 var
                  v =
                    idx < Stdlib_List[1].call(null, vs)
                     ? Stdlib_List[8].call(null, vs, idx)
                     : 0;
                 Sx_runtime[78].call(null, local_env, [3, n], v);
                 return 0;
                },
                names);
      },
      clauses);
    var last_val = [0, 0];
    Stdlib_List[18].call
     (null,
      function(e){last_val[1] = eval_expr(e, local_env); return 0;},
      body);
    return last_val[1];
   }
   function sf_define_values(args, env_val){
    a:
    {
     if(typeof args !== "number" && 6 === args[0]){var l$0 = args[1], items = l$0; break a;}
     var items = 0;
    }
    var match = Stdlib_List[9].call(null, items, 0);
    a:
    {
     if(match){
      var match$0 = match[1];
      if(typeof match$0 !== "number" && 6 === match$0[0]){var l = match$0[1], names = l; break a;}
     }
     var names = 0;
    }
    var match$1 = Stdlib_List[9].call(null, items, 1);
    if(match$1) var e = match$1[1], val_expr = e; else var val_expr = 0;
    var result = eval_expr(val_expr, env_val), vs = values_to_list(result);
    Stdlib_List[19].call
     (null,
      function(idx, name){
       a:
       {
        if(typeof name !== "number" && name[0] - 3 >>> 0 < 2){var s = name[1], n = s; break a;}
        var n = Sx_types[35].call(null, name);
       }
       var
        v =
          idx < Stdlib_List[1].call(null, vs)
           ? Stdlib_List[8].call(null, vs, idx)
           : 0;
       Sx_runtime[78].call(null, env_val, [3, n], v);
       return 0;
      },
      names);
    return 0;
   }
   var cst_let_values = "let-values";
   register_special_form
    ([3, cst_let_values],
     [15,
      cst_let_values,
      function(call_args){
       if(call_args){
        var a = call_args[2];
        if(a && ! a[2]){
         var env = a[1], args = call_args[1];
         return sf_let_values(args, env);
        }
       }
       return 0;
      }]);
   var cst_define_values = "define-values";
   register_special_form
    ([3, cst_define_values],
     [15,
      cst_define_values,
      function(call_args){
       if(call_args){
        var a = call_args[2];
        if(a && ! a[2]){
         var env = a[1], args = call_args[1];
         return sf_define_values(args, env);
        }
       }
       return 0;
      }]);
   var
    cst_iterative = "_iterative",
    cst_promise = "_promise",
    cst_forced = "forced",
    cst_thunk = "thunk",
    pA = [0, 1],
    pB = [0, 0],
    pC = [0, 1];
   function make_promise_dict(opt, thunk){
    var iterative = opt ? opt[1] : 0, d = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, d, cst_promise, pA);
    Stdlib_Hashtbl[11].call(null, d, cst_forced, pB);
    Stdlib_Hashtbl[11].call(null, d, cst_thunk, thunk);
    Stdlib_Hashtbl[11].call(null, d, cst_value, 0);
    if(iterative) Stdlib_Hashtbl[11].call(null, d, cst_iterative, pC);
    return [7, d];
   }
   var pD = [6, 0];
   function sf_delay(args, env_val){
    a:
    {
     if(typeof args !== "number" && 6 === args[0]){
      var match = args[1];
      if(match){var e = match[1], expr = e; break a;}
     }
     var expr = 0;
    }
    var thunk = Sx_types[42].call(null, pD, expr, env_val);
    return make_promise_dict(0, thunk);
   }
   var pE = [6, 0], pF = [0, 1];
   function sf_delay_force(args, env_val){
    a:
    {
     if(typeof args !== "number" && 6 === args[0]){
      var match = args[1];
      if(match){var e = match[1], expr = e; break a;}
     }
     var expr = 0;
    }
    var thunk = Sx_types[42].call(null, pE, expr, env_val);
    return make_promise_dict(pF, thunk);
   }
   function is_promise(v){
    if(typeof v !== "number" && 7 === v[0]){
     var d = v[1], match = Stdlib_Hashtbl[7].call(null, d, cst_promise);
     if(match){
      var a = match[1];
      if(typeof a !== "number" && 0 === a[0] && a[1]) return 1;
     }
     return 0;
    }
    return 0;
   }
   var pG = [6, 0], pH = [0, 1];
   function force_promise(p){
    if(! is_promise(p)) return p;
    if(typeof p !== "number" && 7 === p[0]){
     var d = p[1], match = Stdlib_Hashtbl[7].call(null, d, cst_forced);
     if(match){
      var a = match[1];
      if(typeof a !== "number" && 0 === a[0] && a[1]){
       var match$2 = Stdlib_Hashtbl[7].call(null, d, cst_value);
       if(! match$2) return 0;
       var v = match$2[1];
       return v;
      }
     }
     var match$0 = Stdlib_Hashtbl[7].call(null, d, cst_thunk);
     if(match$0) var t = match$0[1], thunk = t; else var thunk = 0;
     var
      result = cek_call(thunk, pG),
      match$1 = Stdlib_Hashtbl[7].call(null, d, cst_iterative);
     a:
     {
      if(match$1){
       var b = match$1[1];
       if(typeof b !== "number" && 0 === b[0] && b[1]){var iterative = 1; break a;}
      }
      var iterative = 0;
     }
     var
      final_val =
        iterative
         ? is_promise(result) ? force_promise(result) : result
         : result;
     Stdlib_Hashtbl[11].call(null, d, cst_forced, pH);
     Stdlib_Hashtbl[11].call(null, d, cst_value, final_val);
     return final_val;
    }
    return p;
   }
   var cst_delay = "delay";
   register_special_form
    ([3, cst_delay],
     [15,
      cst_delay,
      function(call_args){
       if(call_args){
        var a = call_args[2];
        if(a && ! a[2]){
         var env = a[1], args = call_args[1];
         return sf_delay(args, env);
        }
       }
       return 0;
      }]);
   var cst_delay_force = "delay-force";
   register_special_form
    ([3, cst_delay_force],
     [15,
      cst_delay_force,
      function(call_args){
       if(call_args){
        var a = call_args[2];
        if(a && ! a[2]){
         var env = a[1], args = call_args[1];
         return sf_delay_force(args, env);
        }
       }
       return 0;
      }]);
   runtime.caml_register_global
    (1734,
     [0,
      trampoline_fn,
      trampoline,
      [0, 0],
      [0, 0],
      last_error_kont_ref,
      protocol_registry,
      seq_to_list,
      make_cek_state,
      make_cek_value,
      make_cek_suspended,
      cek_terminal_p,
      cek_suspended_p,
      cek_control,
      cek_env,
      cek_kont,
      cek_phase,
      cek_io_request,
      cek_value,
      make_if_frame,
      make_when_frame,
      make_begin_frame,
      make_let_frame,
      make_define_frame,
      make_define_foreign_frame,
      make_set_frame,
      make_arg_frame,
      make_call_frame,
      make_cond_frame,
      make_cond_arrow_frame,
      make_case_frame,
      make_thread_frame,
      thread_insert_arg,
      thread_insert_arg_last,
      make_map_frame,
      make_map_indexed_frame,
      make_multi_map_frame,
      make_filter_frame,
      make_reduce_frame,
      make_for_each_frame,
      make_some_frame,
      make_every_frame,
      make_scope_frame,
      make_provide_frame,
      make_bind_frame,
      make_provide_set_frame,
      make_scope_acc_frame,
      make_reset_frame,
      make_dict_frame,
      make_and_frame,
      make_or_frame,
      make_dynamic_wind_frame,
      make_reactive_reset_frame,
      make_callcc_frame,
      make_wind_after_frame,
      make_wind_return_frame,
      make_deref_frame,
      make_ho_setup_frame,
      make_comp_trace_frame,
      kont_collect_comp_trace,
      make_handler_frame,
      make_restart_frame,
      make_signal_return_frame,
      make_raise_eval_frame,
      make_raise_guard_frame,
      make_perform_frame,
      make_vm_resume_frame,
      make_import_frame,
      make_parameterize_frame,
      find_matching_handler,
      kont_find_handler,
      kont_unwind_to_handler,
      wind_escape_to,
      find_named_restart,
      kont_find_restart,
      frame_type,
      kont_push,
      kont_top,
      kont_pop,
      kont_empty_p,
      kont_capture_to_reset,
      kont_push_provides,
      kont_find_provide,
      kont_find_scope_acc,
      has_reactive_reset_frame_p,
      kont_capture_to_reactive_reset,
      custom_special_forms,
      register_special_form,
      render_check,
      render_fn,
      bind_tracking_ref,
      0,
      provide_batch_depth_ref,
      [2, 0.],
      provide_batch_queue_ref,
      [6, 0],
      provide_subscribers_ref,
      provide_subscribers,
      winders_ref,
      [6, 0],
      library_registry,
      library_name_key,
      library_loaded_p,
      library_exports,
      register_library,
      io_registry,
      io_register_b,
      io_registered_p,
      io_lookup,
      io_names,
      foreign_registry,
      foreign_register_b,
      foreign_registered_p,
      foreign_lookup,
      foreign_names,
      foreign_parse_params,
      foreign_parse_kwargs_b,
      foreign_resolve_binding,
      foreign_check_args,
      foreign_build_lambda,
      sf_define_foreign,
      step_sf_define_foreign,
      foreign_dispatch,
      foreign_parse_params_loop,
      step_sf_io,
      strict_ref,
      [0, 0],
      set_strict_b,
      prim_param_types_ref,
      0,
      set_prim_param_types_b,
      value_matches_type_p,
      strict_check_args,
      bind_lambda_params,
      call_lambda,
      call_component,
      parse_keyword_args,
      cond_scheme_p,
      is_else_clause,
      sf_named_let,
      sf_lambda,
      sf_defcomp,
      defcomp_kwarg,
      parse_comp_params,
      sf_defisland,
      defio_parse_kwargs_b,
      sf_defio,
      sf_defmacro,
      parse_macro_params,
      qq_expand,
      sf_letrec,
      step_sf_letrec,
      step_sf_dynamic_wind,
      sf_scope,
      sf_provide,
      expand_macro,
      cek_step_loop,
      cek_run,
      cek_resume,
      cek_step,
      step_eval,
      step_sf_raise,
      step_sf_guard,
      step_sf_callcc,
      step_sf_case,
      step_sf_let_match,
      step_eval_list,
      kont_extract_provides,
      fire_provide_subscribers,
      batch_begin_b,
      batch_end_b,
      step_sf_bind,
      step_sf_parameterize,
      syntax_rules_match,
      syntax_rules_match_list,
      syntax_rules_find_var,
      syntax_rules_find_all_vars,
      syntax_rules_instantiate,
      syntax_rules_instantiate_list,
      syntax_rules_expand,
      syntax_rules_try_rules,
      sf_syntax_rules,
      step_sf_define_library,
      bind_import_set,
      step_sf_import,
      step_sf_perform,
      sf_define_record_type,
      sf_define_protocol,
      sf_implement,
      satisfies_p,
      check_match_exhaustiveness,
      match_find_clause,
      match_pattern,
      step_sf_match,
      match_check_exhaustiveness,
      step_sf_handler_bind,
      step_sf_restart_case,
      step_sf_signal,
      step_sf_invoke_restart,
      step_sf_if,
      step_sf_when,
      step_sf_begin,
      step_sf_let,
      step_sf_define,
      step_sf_set_b,
      step_sf_and,
      step_sf_or,
      step_sf_cond,
      step_sf_thread_first,
      step_sf_thread_last,
      step_sf_thread_as,
      step_sf_lambda,
      step_sf_scope,
      step_sf_provide,
      step_sf_context,
      step_sf_peek,
      step_sf_provide_b,
      step_sf_emit,
      step_sf_emitted,
      step_sf_reset,
      step_sf_shift,
      step_sf_deref,
      cek_call,
      reactive_shift_deref,
      step_eval_call,
      ho_form_name_p,
      ho_fn_p,
      ho_swap_args,
      ho_setup_dispatch,
      step_ho_map,
      step_ho_map_indexed,
      step_ho_filter,
      step_ho_reduce,
      step_ho_some,
      step_ho_every,
      step_ho_for_each,
      step_continue,
      continue_with_call,
      sf_case_step_loop,
      eval_expr_cek,
      trampoline_cek,
      make_coroutine,
      eval_expr,
      cek_run_iterative,
      collect_comp_trace,
      format_comp_trace,
      enhance_error_with_trace,
      sf_define_type,
      make_values_dict,
      values_to_list,
      sf_let_values,
      sf_define_values,
      make_promise_dict,
      sf_delay,
      sf_delay_force,
      is_promise,
      force_promise],
     "Sx_ref");
   return;
  }
  (globalThis));

//# 28169 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_vm:[N,N,N,N,N,N,F(1)*,N,F(1)*,F(2),F(1),F(1),F(1),F(1),F(1),F(1)*,F(2),N,N,N,N,N,F(1),F(1),N,F(3),F(1),F(6),F(3),F(3),F(2),F(3),F(1),F(2),F(2),F(2),F(1)*,F(3),F(2),F(1),F(1),F(2),F(1),F(1)*,F(2),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_fresh_oo_id = runtime.caml_fresh_oo_id,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   function caml_call5(f, a0, a1, a2, a3, a4){
    return (f.l >= 0 ? f.l : f.l = f.length) === 5
            ? f(a0, a1, a2, a3, a4)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]);
   }
   function caml_call8(f, a0, a1, a2, a3, a4, a5, a6, a7){
    return (f.l >= 0 ? f.l : f.l = f.length) === 8
            ? f(a0, a1, a2, a3, a4, a5, a6, a7)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5, a6, a7]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Stdlib_List = global_data.Stdlib__List,
    Sx_types = global_data.Sx_types,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib_Queue = global_data.Stdlib__Queue,
    Stdlib = global_data.Stdlib,
    Sx_runtime = global_data.Sx_runtime,
    Sx_primitives = global_data.Sx_primitives,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Sx_ref = global_data.Sx_ref,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Array = global_data.Stdlib__Array,
    Sx_parser = global_data.Sx_parser,
    Stdlib_Printexc = global_data.Stdlib__Printexc,
    VmSuspended = [248, "Sx_vm.VmSuspended", caml_fresh_oo_id(0)],
    Invalid_opcode = [248, "Sx_vm.Invalid_opcode", caml_fresh_oo_id(0)];
   Sx_types[15][1] =
    function(exn){
     if(exn[1] !== VmSuspended) return 0;
     var request = exn[2];
     throw caml_maybe_attach_backtrace([0, Sx_types[11], request], 1);
    };
   var
    jit_compile_ref = [0, function(a, param){return 0;}],
    extension_dispatch_ref =
      [0,
       function(op, vm, frame){
        throw caml_maybe_attach_backtrace([0, Invalid_opcode, op], 1);
       }],
    extension_opcode_name_ref = [0, function(param){return 0;}],
    jit_failed_sentinel =
      [0,
       [0, -1, -1, 0, [0], [0], 0, 0],
       [0],
       [0, "__jit_failed__"],
       Stdlib_Hashtbl[1].call(null, 0, 0),
       0];
   function is_jit_failed(cl){return -1 === cl[1][1] ? 1 : 0;}
   function create(globals){
    return [0, caml_make_vect(4096, 0), 0, 0, globals, 0, 0, 0];
   }
   function push(vm, v){
    if(vm[1].length - 1 <= vm[2]){
     var ns = caml_make_vect(vm[2] * 2 | 0, 0);
     Stdlib_Array[9].call(null, vm[1], 0, ns, 0, vm[2]);
     vm[1] = ns;
    }
    var a = vm[2];
    caml_check_bound(vm[1], a)[a + 1] = v;
    vm[2] = vm[2] + 1 | 0;
    return 0;
   }
   function pop(vm){
    vm[2] = vm[2] - 1 | 0;
    var a = vm[2];
    return caml_check_bound(vm[1], a)[a + 1];
   }
   function peek(vm){
    var a = vm[2] - 1 | 0;
    return caml_check_bound(vm[1], a)[a + 1];
   }
   function read_u8(f){
    var a = f[2], v = caml_check_bound(f[1][1][4], a)[a + 1];
    f[2] = f[2] + 1 | 0;
    return v;
   }
   function read_u16(f){
    var
     a = f[2],
     lo = caml_check_bound(f[1][1][4], a)[a + 1],
     b = f[2] + 1 | 0,
     hi = caml_check_bound(f[1][1][4], b)[b + 1];
    f[2] = f[2] + 2 | 0;
    return lo | hi << 8;
   }
   function read_i16(f){
    var v = read_u16(f);
    return 32768 <= v ? v - 65536 | 0 : v;
   }
   function closure_to_value(cl){
    var match = cl[3];
    function a(args){
     var
      a = Stdlib_List[20].call(null, Sx_runtime[3], args),
      b = Stdlib_String[7].call(null, ",", a),
      c = Stdlib[28].call(null, "VM_CLOSURE_CALL:", b);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], c], 1);
    }
    if(match) var n = match[1], n$0 = n; else var n$0 = "anon";
    return [15, Stdlib[28].call(null, "vm:", n$0), a];
   }
   function parse_keyword_args(params, args){
    var
     a = Stdlib_List[1].call(null, params),
     param_set = Stdlib_Hashtbl[1].call(null, 0, a);
    Stdlib_List[18].call
     (null,
      function(p){return Stdlib_Hashtbl[11].call(null, param_set, p, 1);},
      params);
    var
     kwargs = Stdlib_Hashtbl[1].call(null, 0, 8),
     children = 0,
     param = args;
    for(;;){
     if(! param) return [0, kwargs, Stdlib_List[10].call(null, children)];
     var v = param[1];
     if(typeof v !== "number")
      switch(v[0]){
        case 3:
        case 5:
         var k = v[1], match = param[2];
         if(match){
          var rest$0 = match[2], v$0 = match[1];
          if(Stdlib_Hashtbl[9].call(null, param_set, k)){
           Stdlib_Hashtbl[11].call(null, kwargs, k, v$0);
           param = rest$0;
           continue;
          }
         }
         break;
      }
     var rest = param[2];
     children = [0, v, children];
     param = rest;
    }
   }
   var
    vm_comp_jit_count = [0, 0],
    vm_comp_cek_count = [0, 0],
    vm_insn_count = [0, 0],
    vm_call_count = [0, 0],
    vm_cek_count = [0, 0];
   function vm_reset_counters(param){
    vm_insn_count[1] = 0;
    vm_call_count[1] = 0;
    vm_cek_count[1] = 0;
    vm_comp_jit_count[1] = 0;
    vm_comp_cek_count[1] = 0;
    return 0;
   }
   var
    d =
      [0,
       [11,
        "[vm-perf] insns=",
        [4,
         0,
         0,
         0,
         [11,
          " calls=",
          [4,
           0,
           0,
           0,
           [11,
            " cek_fallbacks=",
            [4,
             0,
             0,
             0,
             [11,
              " comp_jit=",
              [4,
               0,
               0,
               0,
               [11, " comp_cek=", [4, 0, 0, 0, [12, 10, [10, 0]]]]]]]]]]]],
       "[vm-perf] insns=%d calls=%d cek_fallbacks=%d comp_jit=%d comp_cek=%d\n%!"];
   function vm_report_counters(param){
    var
     a = vm_comp_cek_count[1],
     b = vm_comp_jit_count[1],
     c = vm_cek_count[1],
     e = vm_call_count[1],
     f = vm_insn_count[1];
    return caml_call5(Stdlib_Printf[3].call(null, d), f, e, c, b, a);
   }
   var e = [6, 0];
   function push_closure_frame(vm, cl, args){
    var
     g = Stdlib_Hashtbl[1].call(null, 0, 4),
     frame = [0, cl, 0, vm[2], g],
     rest_arity = cl[1][2];
    if(0 <= rest_arity){
     var nargs = Stdlib_List[1].call(null, args);
     a:
     {
      b:
      {
       var i = 0, param = args;
       for(;;){
        if(! param) break;
        var remaining = param[2], a = param[1];
        if(i >= rest_arity) break b;
        push(vm, a);
        var i$0 = i + 1 | 0;
        i = i$0;
        param = remaining;
       }
       var b = rest_arity - 1 | 0;
       if(b >= i){
        var for$ = i;
        for(;;){
         push(vm, 0);
         var h = for$ + 1 | 0;
         if(b === for$) break;
         for$ = h;
        }
       }
       push(vm, e);
       break a;
      }
      push(vm, [6, [0, a, remaining]]);
     }
     var
      used = rest_arity < nargs ? rest_arity + 1 | 0 : nargs + 1 | 0,
      c = cl[1][3] - 1 | 0;
     if(c >= used){
      var for$0 = used;
      for(;;){
       push(vm, 0);
       var j = for$0 + 1 | 0;
       if(c === for$0) break;
       for$0 = j;
      }
     }
    }
    else{
     Stdlib_List[18].call(null, function(a){return push(vm, a);}, args);
     var d = Stdlib_List[1].call(null, args), f = cl[1][3] - 1 | 0;
     if(f >= d){
      var for$1 = d;
      for(;;){
       push(vm, 0);
       var k = for$1 + 1 | 0;
       if(f === for$1) break;
       for$1 = k;
      }
     }
    }
    vm[3] = [0, frame, vm[3]];
    return 0;
   }
   var
    cst_arity = "arity",
    cst_bytecode = "bytecode",
    cst_constants = "constants",
    cst_vc_bytecode = "vc-bytecode";
   function code_from_value(v){
    if(typeof v !== "number" && 7 === v[0]){
     var
      d = v[1],
      find2 =
        function(k1, k2){
         var r = Stdlib_Hashtbl[7].call(null, d, k1);
         return r ? r : Stdlib_Hashtbl[7].call(null, d, k2);
        },
      match = find2(cst_bytecode, cst_vc_bytecode);
     a:
     {
      b:
      if(match){
       var a = match[1];
       if(typeof a !== "number"){
        switch(a[0]){
          case 6:
           var l$0 = a[1]; break;
          case 21:
           var l$0 = a[1][1]; break;
          default: break b;
        }
        var
         e =
           Stdlib_List[20].call
            (null,
             function(x){
              if(typeof x !== "number")
               switch(x[0]){
                 case 1:
                  var n = x[1]; return n;
                 case 2:
                  var n$0 = x[1]; return n$0 | 0;
               }
              return 0;
             },
             l$0),
         bc_list = Stdlib_Array[11].call(null, e);
        break a;
       }
      }
      var bc_list = [0];
     }
     var match$0 = find2(cst_constants, "vc-constants");
     a:
     {
      b:
      if(match$0){
       var b = match$0[1];
       if(typeof b !== "number"){
        switch(b[0]){
          case 6:
           var l = b[1]; break;
          case 21:
           var l = b[1][1]; break;
          default: break b;
        }
        var entries = Stdlib_Array[11].call(null, l);
        break a;
       }
      }
      var entries = [0];
     }
     var
      constants =
        Stdlib_Array[14].call
         (null,
          function(entry){
           a:
           if(typeof entry !== "number" && 7 === entry[0]){
            var ed = entry[1];
            if
             (!
              Stdlib_Hashtbl[9].call(null, ed, cst_bytecode)
              && ! Stdlib_Hashtbl[9].call(null, ed, cst_vc_bytecode))
             break a;
            return entry;
           }
           return entry;
          },
          entries),
      match$1 = find2(cst_arity, "vc-arity");
     a:
     {
      if(match$1){
       var match$2 = match$1[1];
       if(typeof match$2 !== "number")
        switch(match$2[0]){
          case 1:
           var n$1 = match$2[1], arity = n$1; break a;
          case 2:
           var n$2 = match$2[1], arity = n$2 | 0; break a;
        }
      }
      var arity = 0;
     }
     var match$3 = find2("rest-arity", "vc-rest-arity");
     a:
     {
      if(match$3){
       var match$4 = match$3[1];
       if(typeof match$4 !== "number")
        switch(match$4[0]){
          case 1:
           var n = match$4[1], rest_arity = n; break a;
          case 2:
           var n$0 = match$4[1], rest_arity = n$0 | 0; break a;
        }
      }
      var rest_arity = -1;
     }
     var len = bc_list.length - 1, i = 0, max_local = arity - 1 | 0;
     for(;;){
      if(i >= len){
       var locals = (max_local + 1 | 0) + 16 | 0;
       return [0, arity, rest_arity, locals, bc_list, constants, 0, 0];
      }
      var op = caml_check_bound(bc_list, i)[i + 1];
      a:
      {
       if(16 !== op && 17 !== op) break a;
       if((i + 1 | 0) < len){
        var
         c = i + 1 | 0,
         slot = caml_check_bound(bc_list, c)[c + 1],
         max_local$0 = max_local < slot ? slot : max_local;
        i = i + 2 | 0;
        max_local = max_local$0;
        continue;
       }
      }
      if(18 !== op && 19 !== op && 8 !== op && 33 !== op && 34 !== op){
       if
        (1 !== op
         &&
          20 !== op
          &&
           21 !== op
           && 32 !== op && 51 !== op && 52 !== op && 64 !== op && 65 !== op){i = i + 1 | 0; continue;}
       i = i + 3 | 0;
       continue;
      }
      i = i + 2 | 0;
     }
    }
    return [0, 0, -1, 16, [0], [0], 0, 0];
   }
   var
    cst$2 = ": ",
    cst_JIT_compiler_not_loaded = "JIT: compiler not loaded",
    cst_compile = "compile",
    cst_fn = "fn",
    cst_quote = "quote",
    f =
      [0,
       [11,
        "[jit-comp] FAIL ",
        [2, 0, [11, cst$2, [2, 0, [12, 10, [10, 0]]]]]],
       "[jit-comp] FAIL %s: %s\n%!"],
    g = [0, "children", 0],
    h = [4, cst_fn],
    i = [4, cst_quote],
    j = [4, cst_compile];
   function jit_compile_comp
   (name, params, has_children, body, closure, globals){
    try{
     try{Stdlib_Hashtbl[6].call(null, globals, cst_compile);}
     catch(exn$0){
      var exn = caml_wrap_exception(exn$0);
      if(exn === Stdlib[8])
       throw caml_maybe_attach_backtrace
              ([0, Sx_types[9], cst_JIT_compiler_not_loaded], 1);
      throw caml_maybe_attach_backtrace(exn, 0);
     }
     var
      c = has_children ? g : 0,
      param_names = Stdlib[37].call(null, params, c),
      param_syms =
        [6,
         Stdlib_List[20].call(null, function(s){return [4, s];}, param_names)],
      fn_expr = [6, [0, h, [0, param_syms, [0, body, 0]]]],
      k = Sx_types[20].call(null, 0),
      compile_env = Sx_types[21].call(null, k);
     Stdlib_Hashtbl[12].call
      (null,
       function(k, v){
        var a = Sx_types[4].call(null, k);
        return Stdlib_Hashtbl[11].call(null, compile_env[1], a, v);
       },
       globals);
     var
      result =
        Sx_ref[242].call
         (null,
          [6, [0, j, [0, [6, [0, i, [0, fn_expr, 0]]], 0]]],
          [20, compile_env]);
     a:
     {
      if(typeof result !== "number" && 7 === result[0]){
       var d = result[1];
       if(Stdlib_Hashtbl[9].call(null, d, cst_bytecode)){
        var outer_code = code_from_value(result), bc = outer_code[4];
        if(4 <= bc.length - 1 && 51 === caml_check_bound(bc, 0)[1]){
         var
          l = caml_check_bound(bc, 2)[3] << 8,
          idx = caml_check_bound(bc, 1)[2] | l;
         if(idx < outer_code[5].length - 1){
          var
           inner_val = caml_check_bound(outer_code[5], idx)[idx + 1],
           code = code_from_value(inner_val),
           a = [0, [0, code, [0], [0, name], globals, [0, closure]]];
          break a;
         }
         var a = 0;
         break a;
        }
        var a = 0;
        break a;
       }
      }
      var a = 0;
     }
     return a;
    }
    catch(e$0){
     var e = caml_wrap_exception(e$0), b = Stdlib_Printexc[1].call(null, e);
     caml_call2(Stdlib_Printf[3].call(null, f), name, b);
     return 0;
    }
   }
   var
    cst_io_suspended = "io-suspended",
    cst_phase = "phase",
    cst_request = "request",
    active_vm = [0, 0],
    k = [6, 0],
    l = [3, cst_phase],
    m = [3, cst_request];
   function cek_call_or_suspend(vm, f, args){
    vm_cek_count[1]++;
    a:
    {
     if(typeof args === "number"){
      if(0 === args){var a = 0; break a;}
     }
     else if(6 === args[0]){var l$0 = args[1], a = l$0; break a;}
     var a = [0, args, 0];
    }
    var saved_active = active_vm[1];
    active_vm[1] = [0, create(vm[4])];
    var
     b = [20, Sx_types[20].call(null, 0)],
     state = Sx_ref[237].call(null, f, [6, a], b, [6, a], k),
     final = Sx_ref[156].call(null, state);
    active_vm[1] = saved_active;
    var match = Sx_runtime[13].call(null, final, l);
    if
     (typeof match !== "number"
      && 3 === match[0] && match[1] === cst_io_suspended){
     vm[5] = [0, final];
     throw caml_maybe_attach_backtrace
            ([0, VmSuspended, Sx_runtime[13].call(null, final, m), vm], 1);
    }
    return Sx_ref[18].call(null, final);
   }
   function call_closure(cl, args, globals){
    vm_call_count[1]++;
    var prev_vm = active_vm[1], vm = create(globals);
    active_vm[1] = [0, vm];
    push_closure_frame(vm, cl, args);
    try{run(vm);}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     active_vm[1] = prev_vm;
     throw caml_maybe_attach_backtrace(e, 0);
    }
    active_vm[1] = prev_vm;
    return pop(vm);
   }
   function call_closure_reuse(cl, args){
    var match = active_vm[1];
    if(! match) return call_closure(cl, args, cl[4]);
    var vm = match[1], saved_sp = vm[2];
    push_closure_frame(vm, cl, args);
    var saved_frames = Stdlib_List[7].call(null, vm[3]);
    vm[3] = [0, Stdlib_List[6].call(null, vm[3]), 0];
    try{
     run(vm);
     if(saved_sp < vm[2])
      var a = vm[2] - 1 | 0, b = caml_check_bound(vm[1], a)[a + 1];
     else
      var b = 0;
     var result = b;
    }
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     if(e[1] !== VmSuspended){
      vm[3] = saved_frames;
      vm[2] = saved_sp;
      throw caml_maybe_attach_backtrace(e, 0);
     }
     var req = e[2], match$0 = Sx_types[12][1];
     if(! match$0){
      vm[7] = [0, [0, saved_frames, saved_sp], vm[7]];
      throw caml_maybe_attach_backtrace(e, 0);
     }
     var resolver = match$0[1], saved_reuse = vm[7];
     vm[7] = 0;
     var req$0 = req;
     for(;;){
      var r = caml_call2(resolver, req$0, 0);
      try{var cb = resume_vm(vm, r);}
      catch(exn$0){
       var exn = caml_wrap_exception(exn$0);
       if(exn[1] !== VmSuspended) throw caml_maybe_attach_backtrace(exn, 0);
       var req2 = exn[2];
       req$0 = req2;
       continue;
      }
      vm[7] = saved_reuse;
      var result = cb;
      break;
     }
    }
    vm[3] = saved_frames;
    vm[2] = saved_sp;
    return result;
   }
   function vm_call(vm, f, args){
    if(typeof f !== "number")
     switch(f[0]){
       case 8:
        var l = f[1], match = l[5];
        if(match){
         var cl = match[1];
         return is_jit_failed(cl)
                 ? push(vm, cek_call_or_suspend(vm, f, [6, args]))
                 : push_closure_frame(vm, cl, args);
        }
        if(0 === l[4]) return push(vm, cek_call_or_suspend(vm, f, [6, args]));
        l[6] = l[6] + 1 | 0;
        if(Sx_types[43][1] <= l[6] && 0 < Sx_types[51][1]){
         l[5] = [0, jit_failed_sentinel];
         var match$0 = caml_call2(jit_compile_ref[1], l, vm[4]);
         if(! match$0){
          Sx_types[45][1]++;
          return push(vm, cek_call_or_suspend(vm, f, [6, args]));
         }
         var cl$0 = match$0[1];
         Sx_types[44][1]++;
         l[5] = [0, cl$0];
         Stdlib_Queue[3].call(null, [0, l[7], [8, l]], Sx_types[53]);
         for(;;){
          var d = Sx_types[51][1];
          if(d >= Stdlib_Queue[14].call(null, Sx_types[53]))
           return push_closure_frame(vm, cl$0, args);
          var match$1 = Stdlib_Queue[7].call(null, Sx_types[53])[2];
          if(typeof match$1 !== "number" && 8 === match$1[0]){
           var ev_l = match$1[1];
           ev_l[5] = 0;
           Sx_types[52][1]++;
          }
         }
        }
        Sx_types[46][1]++;
        return push(vm, cek_call_or_suspend(vm, f, [6, args]));
       case 9:
        var
         c = f[1],
         match$2 = parse_keyword_args(c[2], args),
         children = match$2[2],
         kwargs = match$2[1],
         match$3 = c[8];
        if(match$3)
         var
          cl$1 = match$3[1],
          compiled = is_jit_failed(cl$1) ? 0 : [0, cl$1];
        else{
         c[8] = [0, jit_failed_sentinel];
         var result = jit_compile_comp(c[1], c[2], c[3], c[4], c[5], vm[4]);
         if(result){
          var cl$3 = result[1];
          c[8] = [0, cl$3];
          var compiled = result;
         }
         else
          var compiled = result;
        }
        if(! compiled){
         vm_cek_count[1]++;
         vm_comp_cek_count[1]++;
         return push(vm, cek_call_or_suspend(vm, f, [6, args]));
        }
        var cl$2 = compiled[1];
        vm_comp_jit_count[1]++;
        var
         call_args =
           Stdlib_List[20].call
            (null,
             function(p){
              var match = Stdlib_Hashtbl[7].call(null, kwargs, p);
              if(! match) return 0;
              var v = match[1];
              return v;
             },
             c[2]),
         call_args$0 =
           c[3]
            ? Stdlib[37].call(null, call_args, [0, [6, children], 0])
            : call_args;
        try{
         var e = push(vm, call_closure(cl$2, call_args$0, cl$2[4]));
         return e;
        }
        catch(exn){
         vm_cek_count[1]++;
         vm_comp_cek_count[1]++;
         return push(vm, cek_call_or_suspend(vm, f, [6, args]));
        }
       case 10:
        var
         i = f[1],
         match$4 = parse_keyword_args(i[2], args),
         children$0 = match$4[2],
         kwargs$0 = match$4[1],
         match$5 = i[7];
        if(match$5)
         var
          cl$4 = match$5[1],
          compiled$0 = is_jit_failed(cl$4) ? 0 : [0, cl$4];
        else{
         i[7] = [0, jit_failed_sentinel];
         var result$0 = jit_compile_comp(i[1], i[2], i[3], i[4], i[5], vm[4]);
         if(result$0){
          var cl$6 = result$0[1];
          i[7] = [0, cl$6];
          var compiled$0 = result$0;
         }
         else
          var compiled$0 = result$0;
        }
        if(! compiled$0){
         vm_cek_count[1]++;
         vm_comp_cek_count[1]++;
         return push(vm, cek_call_or_suspend(vm, f, [6, args]));
        }
        var cl$5 = compiled$0[1];
        vm_comp_jit_count[1]++;
        var
         call_args$1 =
           Stdlib_List[20].call
            (null,
             function(p){
              var match = Stdlib_Hashtbl[7].call(null, kwargs$0, p);
              if(! match) return 0;
              var v = match[1];
              return v;
             },
             i[2]),
         call_args$2 =
           i[3]
            ? Stdlib[37].call(null, call_args$1, [0, [6, children$0], 0])
            : call_args$1;
        try{
         var g = push(vm, call_closure(cl$5, call_args$2, cl$5[4]));
         return g;
        }
        catch(exn){
         vm_cek_count[1]++;
         vm_comp_cek_count[1]++;
         return push(vm, cek_call_or_suspend(vm, f, [6, args]));
        }
       case 15:
        var fn = f[2], result$1 = caml_call1(fn, args);
        return push(vm, result$1);
       case 24:
        var cl$7 = f[1]; return push_closure_frame(vm, cl$7, args);
     }
    var
     a = Sx_runtime[3].call(null, f),
     b = Stdlib[28].call(null, "VM: not callable: ", a);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   var
    cst$1 = "",
    cst_base = " (base=",
    cst_at_ip = " at ip=",
    cst_sp = " sp=",
    cst$0 = ")\n",
    cst = "?",
    cst_VM_undefined = "VM undefined: ",
    cst_VM_unknown_primitive = "VM: unknown primitive ",
    cst_upvalue_count = "upvalue-count",
    b = [6, 0],
    n =
      [0,
       [11,
        "[vm] WARN: bytecode exhausted without RETURN in ",
        [2,
         0,
         [11,
          cst_base,
          [4,
           0,
           0,
           0,
           [11,
            cst_sp,
            [4, 0, 0, 0, [11, " frames=", [4, 0, 0, 0, [11, cst$0, [10, 0]]]]]]]]]],
       "[vm] WARN: bytecode exhausted without RETURN in %s (base=%d sp=%d frames=%d)\n%!"],
    o =
      [0,
       [11,
        "VM: ",
        [2,
         0,
         [11,
          cst_at_ip,
          [4,
           0,
           0,
           0,
           [11,
            " op=",
            [4,
             0,
             0,
             0,
             [11,
              " in ",
              [2,
               0,
               [11,
                cst_base,
                [4,
                 0,
                 0,
                 0,
                 [11,
                  cst_sp,
                  [4,
                   0,
                   0,
                   0,
                   [11,
                    " bc_len=",
                    [4, 0, 0, 0, [11, " consts=", [4, 0, 0, 0, [12, 41, 0]]]]]]]]]]]]]]]]],
       "VM: %s at ip=%d op=%d in %s (base=%d sp=%d bc_len=%d consts=%d)"],
    p =
      [0,
       [11,
        "VM: unknown opcode ",
        [4, 0, 0, 0, [11, cst_at_ip, [4, 0, 0, 0, 0]]]],
       "VM: unknown opcode %d at ip=%d"],
    q = [0, 1],
    r = [1, 0],
    s =
      [0,
       [11,
        "VM: CONST index ",
        [4,
         0,
         0,
         0,
         [11, " out of bounds (pool size ", [4, 0, 0, 0, [12, 41, 0]]]]],
       "VM: CONST index %d out of bounds (pool size %d)"],
    t = [0, 1],
    u = [0, 0],
    v =
      [0,
       [11,
        "VM: LOCAL_GET slot=",
        [4,
         0,
         0,
         0,
         [11,
          " base=",
          [4, 0, 0, 0, [11, cst_sp, [4, 0, 0, 0, [11, " out of bounds", 0]]]]]]],
       "VM: LOCAL_GET slot=%d base=%d sp=%d out of bounds"],
    w =
      [0,
       [11,
        "VM: UPVALUE_GET idx=",
        [4, 0, 0, 0, [11, " out of bounds (have ", [4, 0, 0, 0, [12, 41, 0]]]]],
       "VM: UPVALUE_GET idx=%d out of bounds (have %d)"],
    x =
      [0, [11, "Unhandled exception: ", [2, 0, 0]], "Unhandled exception: %s"],
    y =
      [0,
       [11,
        "VM: CLOSURE idx ",
        [4, 0, 0, 0, [11, " >= consts ", [4, 0, 0, 0, 0]]]],
       "VM: CLOSURE idx %d >= consts %d"],
    z =
      [0,
       [2,
        0,
        [11,
         ' (in CALL_PRIM "',
         [2, 0, [11, '" with ', [4, 0, 0, 0, [11, " args)", 0]]]]]],
       '%s (in CALL_PRIM "%s" with %d args)'];
   function run(vm){
    for(;;){
     if(0 === vm[3]) return 0;
     var match = vm[3];
     if(match){
      var
       rest_frames = match[2],
       frame = match[1],
       bc = frame[1][1][4],
       consts = frame[1][1][5];
      if(bc.length - 1 <= frame[2]){
       var match$0 = frame[1][3];
       if(match$0)
        var n$0 = match$0[1], fn_name = n$0;
       else
        var fn_name = cst;
       var
        T = Stdlib_List[1].call(null, rest_frames),
        U = vm[2],
        V = frame[3];
       caml_call4(Stdlib_Printf[3].call(null, n), fn_name, V, U, T);
       var result = frame[3] < vm[2] ? pop(vm) : 0;
       vm[3] = rest_frames;
       vm[2] = frame[3];
       if(0 !== rest_frames) push(vm, result);
      }
      else{
       var
        saved_ip = frame[2],
        H = frame[2],
        op = caml_check_bound(bc, H)[H + 1];
       frame[2] = frame[2] + 1 | 0;
       vm_insn_count[1]++;
       var I = 0 === (vm_insn_count[1] & 65535);
       if(I)
        var J = 0 < Sx_ref[3][1], K = J ? Sx_ref[3][1] < vm_insn_count[1] : J;
       else
        var K = I;
       if(K)
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], "TIMEOUT: step limit exceeded"], 1);
       try{
        a:
        {
         if(66 <= op){
          var switcher = op - 112 | 0;
          if(63 >= switcher >>> 0){
           var cst$0 = "-";
           switch(switcher){
             case 0:
              var request = pop(vm);
              throw caml_maybe_attach_backtrace
                     ([0, VmSuspended, request, vm], 1);
             case 16:
              var
               idx = read_u16(frame),
               match$2 = caml_check_bound(consts, idx)[idx + 1];
              if(typeof match$2 === "number" || ! (3 === match$2[0]))
               var name = cst$1;
              else
               var s$0 = match$2[1], name = s$0;
              var v$0 = peek(vm);
              Stdlib_Hashtbl[11].call(null, vm[4], name, v$0);
              var match$3 = Sx_types[23][1];
              if(! match$3) break a;
              var f = match$3[1];
              caml_call2(f, name, v$0);
              break a;
             case 32:
              var
               count = read_u8(frame),
               $ =
                 Stdlib_List[11].call
                  (null, count, function(param){return pop(vm);}),
               parts = Stdlib_List[10].call(null, $),
               aa = Stdlib_List[20].call(null, Sx_runtime[3], parts),
               s$1 = Stdlib_String[7].call(null, cst$1, aa);
              push(vm, [3, s$1]);
              break a;
             case 48:
              var b$0 = pop(vm), a = pop(vm);
              b:
              {
               if(typeof a !== "number")
                switch(a[0]){
                  case 1:
                   var x$0 = a[1];
                   if(typeof b$0 !== "number")
                    switch(b$0[0]){
                      case 1:
                       var y$0 = b$0[1], j = [1, x$0 + y$0 | 0]; break b;
                      case 2:
                       var y$1 = b$0[1], j = [2, x$0 + y$1]; break b;
                    }
                   break;
                  case 2:
                   var x$1 = a[1];
                   if(typeof b$0 !== "number")
                    switch(b$0[0]){
                      case 1:
                       var y$2 = b$0[1], j = [2, x$1 + y$2]; break b;
                      case 2:
                       var y$3 = b$0[1], j = [2, x$1 + y$3]; break b;
                    }
                   break;
                }
               var
                j =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "+"),
                    [0, a, [0, b$0, 0]]);
              }
              push(vm, j);
              break a;
             case 49:
              var b$1 = pop(vm), a$0 = pop(vm);
              b:
              {
               if(typeof a$0 !== "number")
                switch(a$0[0]){
                  case 1:
                   var x$2 = a$0[1];
                   if(typeof b$1 !== "number")
                    switch(b$1[0]){
                      case 1:
                       var y$4 = b$1[1], m = [1, x$2 - y$4 | 0]; break b;
                      case 2:
                       var y$5 = b$1[1], m = [2, x$2 - y$5]; break b;
                    }
                   break;
                  case 2:
                   var x$3 = a$0[1];
                   if(typeof b$1 !== "number")
                    switch(b$1[0]){
                      case 1:
                       var y$6 = b$1[1], m = [2, x$3 - y$6]; break b;
                      case 2:
                       var y$7 = b$1[1], m = [2, x$3 - y$7]; break b;
                    }
                   break;
                }
               var
                m =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], cst$0),
                    [0, a$0, [0, b$1, 0]]);
              }
              push(vm, m);
              break a;
             case 50:
              var b$2 = pop(vm), a$1 = pop(vm);
              b:
              {
               if(typeof a$1 !== "number")
                switch(a$1[0]){
                  case 1:
                   var x$4 = a$1[1];
                   if(typeof b$2 !== "number")
                    switch(b$2[0]){
                      case 1:
                       var y$8 = b$2[1], A = [1, runtime.caml_mul(x$4, y$8)];
                       break b;
                      case 2:
                       var y$9 = b$2[1], A = [2, x$4 * y$9]; break b;
                    }
                   break;
                  case 2:
                   var x$5 = a$1[1];
                   if(typeof b$2 !== "number")
                    switch(b$2[0]){
                      case 1:
                       var y$10 = b$2[1], A = [2, x$5 * y$10]; break b;
                      case 2:
                       var y$11 = b$2[1], A = [2, x$5 * y$11]; break b;
                    }
                   break;
                }
               var
                A =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "*"),
                    [0, a$1, [0, b$2, 0]]);
              }
              push(vm, A);
              break a;
             case 51:
              var b$3 = pop(vm), a$2 = pop(vm);
              b:
              {
               if(typeof a$2 !== "number")
                switch(a$2[0]){
                  case 1:
                   var x$6 = a$2[1];
                   if(typeof b$3 !== "number")
                    switch(b$3[0]){
                      case 1:
                       var y$12 = b$3[1];
                       if(0 !== y$12 && 0 === runtime.caml_mod(x$6, y$12)){var B = [1, runtime.caml_div(x$6, y$12)]; break b;
                       }
                       break;
                      case 2:
                       var y$13 = b$3[1], B = [2, x$6 / y$13]; break b;
                    }
                   break;
                  case 2:
                   var x$7 = a$2[1];
                   if(typeof b$3 !== "number")
                    switch(b$3[0]){
                      case 1:
                       var y$14 = b$3[1], B = [2, x$7 / y$14]; break b;
                      case 2:
                       var y$15 = b$3[1], B = [2, x$7 / y$15]; break b;
                    }
                   break;
                }
               var
                B =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "/"),
                    [0, a$2, [0, b$3, 0]]);
              }
              push(vm, B);
              break a;
             case 52:
              var b$4 = pop(vm), a$3 = pop(vm);
              b:
              {
               if(typeof a$3 === "number"){
                if(0 === a$3 && typeof b$4 === "number" && ! b$4){var c = q; break b;}
               }
               else
                switch(a$3[0]){
                  case 0:
                   if(typeof b$4 !== "number" && 0 === b$4[0]){
                    var
                     y$16 = b$4[1],
                     x$8 = a$3[1],
                     c = [0, x$8 === y$16 ? 1 : 0];
                    break b;
                   }
                   break;
                  case 1:
                   var x$9 = a$3[1];
                   if(typeof b$4 !== "number")
                    switch(b$4[0]){
                      case 1:
                       var y$17 = b$4[1], c = [0, x$9 === y$17 ? 1 : 0]; break b;
                      case 2:
                       var y$18 = b$4[1], c = [0, x$9 === y$18 ? 1 : 0]; break b;
                    }
                   break;
                  case 2:
                   var x$10 = a$3[1];
                   if(typeof b$4 !== "number")
                    switch(b$4[0]){
                      case 1:
                       var y$19 = b$4[1], c = [0, x$10 === y$19 ? 1 : 0]; break b;
                      case 2:
                       var y$20 = b$4[1], c = [0, x$10 === y$20 ? 1 : 0]; break b;
                    }
                   break;
                  case 3:
                   if(typeof b$4 !== "number" && 3 === b$4[0]){
                    var
                     y$21 = b$4[1],
                     x$11 = a$3[1],
                     c = [0, x$11 === y$21 ? 1 : 0];
                    break b;
                   }
                   break;
                  case 4:
                   if(typeof b$4 !== "number" && 4 === b$4[0]){
                    var
                     y$22 = b$4[1],
                     x$12 = a$3[1],
                     c = [0, x$12 === y$22 ? 1 : 0];
                    break b;
                   }
                   break;
                  case 5:
                   if(typeof b$4 !== "number" && 5 === b$4[0]){
                    var
                     y$23 = b$4[1],
                     x$13 = a$3[1],
                     c = [0, x$13 === y$23 ? 1 : 0];
                    break b;
                   }
                   break;
                }
               var
                c =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "="),
                    [0, a$3, [0, b$4, 0]]);
              }
              push(vm, c);
              break a;
             case 53:
              var b$5 = pop(vm), a$4 = pop(vm);
              b:
              {
               if(typeof a$4 !== "number")
                switch(a$4[0]){
                  case 1:
                   var x$14 = a$4[1];
                   if(typeof b$5 !== "number")
                    switch(b$5[0]){
                      case 1:
                       var y$24 = b$5[1], g = [0, x$14 < y$24 ? 1 : 0]; break b;
                      case 2:
                       var y$25 = b$5[1], g = [0, x$14 < y$25 ? 1 : 0]; break b;
                    }
                   break;
                  case 2:
                   var x$15 = a$4[1];
                   if(typeof b$5 !== "number")
                    switch(b$5[0]){
                      case 1:
                       var y$26 = b$5[1], g = [0, x$15 < y$26 ? 1 : 0]; break b;
                      case 2:
                       var y$27 = b$5[1], g = [0, x$15 < y$27 ? 1 : 0]; break b;
                    }
                   break;
                  case 3:
                   if(typeof b$5 !== "number" && 3 === b$5[0]){
                    var
                     y$28 = b$5[1],
                     x$16 = a$4[1],
                     g = [0, runtime.caml_string_lessthan(x$16, y$28)];
                    break b;
                   }
                   break;
                }
               var g = Sx_runtime[2].call(null, "<", [0, a$4, [0, b$5, 0]]);
              }
              push(vm, g);
              break a;
             case 54:
              var b$6 = pop(vm), a$5 = pop(vm);
              b:
              {
               if(typeof a$5 !== "number")
                switch(a$5[0]){
                  case 1:
                   var x$17 = a$5[1];
                   if(typeof b$6 !== "number")
                    switch(b$6[0]){
                      case 1:
                       var y$29 = b$6[1], h = [0, y$29 < x$17 ? 1 : 0]; break b;
                      case 2:
                       var y$30 = b$6[1], h = [0, y$30 < x$17 ? 1 : 0]; break b;
                    }
                   break;
                  case 2:
                   var x$18 = a$5[1];
                   if(typeof b$6 !== "number")
                    switch(b$6[0]){
                      case 1:
                       var y$31 = b$6[1], h = [0, y$31 < x$18 ? 1 : 0]; break b;
                      case 2:
                       var y$32 = b$6[1], h = [0, y$32 < x$18 ? 1 : 0]; break b;
                    }
                   break;
                  case 3:
                   if(typeof b$6 !== "number" && 3 === b$6[0]){
                    var
                     y$33 = b$6[1],
                     x$19 = a$5[1],
                     h = [0, runtime.caml_string_greaterthan(x$19, y$33)];
                    break b;
                   }
                   break;
                }
               var h = Sx_runtime[2].call(null, ">", [0, a$5, [0, b$6, 0]]);
              }
              push(vm, h);
              break a;
             case 55:
              var v$1 = pop(vm);
              push(vm, [0, 1 - Sx_types[71].call(null, v$1)]);
              break a;
             case 56:
              var v$2 = pop(vm);
              b:
              {
               c:
               {
                if(typeof v$2 !== "number"){
                 switch(v$2[0]){
                   case 3:
                    var s$2 = v$2[1], C = [1, caml_ml_string_length(s$2)];
                    break b;
                   case 6:
                    var l = v$2[1]; break;
                   case 7:
                    var d = v$2[1], C = [1, Stdlib_Hashtbl[15].call(null, d)];
                    break b;
                   case 21:
                    var l = v$2[1][1]; break;
                   default: break c;
                 }
                 var C = [1, Stdlib_List[1].call(null, l)];
                 break b;
                }
                if(0 === v$2){var C = r; break b;}
               }
               var
                C =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "len"),
                    [0, v$2, 0]);
              }
              push(vm, C);
              break a;
             case 57:
              var v$3 = pop(vm);
              b:
              {
               c:
               {
                if(typeof v$3 === "number"){if(0 !== v$3) break c;}
                else
                 switch(v$3[0]){
                   case 6:
                    var L = v$3[1]; if(L){var F = L[1]; break b;} break;
                   case 21:
                    var M = v$3[1][1]; if(M){var F = M[1]; break b;} break;
                   default: break c;
                 }
                var F = 0;
                break b;
               }
               var
                F =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "first"),
                    [0, v$3, 0]);
              }
              push(vm, F);
              break a;
             case 58:
              var v$4 = pop(vm);
              b:
              {
               c:
               {
                if(typeof v$4 !== "number"){
                 switch(v$4[0]){
                   case 6:
                    var N = v$4[1];
                    if(! N){var D = b; break b;}
                    var xs = N[2];
                    break;
                   case 21:
                    var O = v$4[1][1];
                    if(! O){var D = b; break b;}
                    var xs = O[2];
                    break;
                   default: break c;
                 }
                 var D = [6, xs];
                 break b;
                }
                if(0 === v$4){var D = b; break b;}
               }
               var
                D =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "rest"),
                    [0, v$4, 0]);
              }
              push(vm, D);
              break a;
             case 59:
              var n$2 = pop(vm), coll = pop(vm);
              b:
              {
               c:
               if(typeof coll !== "number"){
                switch(coll[0]){
                  case 3:
                   if(typeof n$2 === "number") break c;
                   if(2 !== n$2[0]) break c;
                   var f$0 = n$2[1], s$3 = coll[1], i = f$0 | 0;
                   if(0 <= i && i < caml_ml_string_length(s$3)){
                    var
                     ab = runtime.caml_string_get(s$3, i),
                     E = [3, Stdlib_String[1].call(null, 1, ab)];
                    break b;
                   }
                   var E = 0;
                   break b;
                  case 6:
                   var l$0 = coll[1]; break;
                  case 21:
                   var l$0 = coll[1][1]; break;
                  default: break c;
                }
                if(typeof n$2 !== "number" && 2 === n$2[0]){
                 var f$1 = n$2[1];
                 try{
                  var ac = Stdlib_List[8].call(null, l$0, f$1 | 0), E = ac;
                  break b;
                 }
                 catch(exn){var E = 0; break b;}
                }
               }
               var
                E =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "nth"),
                    [0, coll, [0, n$2, 0]]);
              }
              push(vm, E);
              break a;
             case 60:
              var coll$0 = pop(vm), x$20 = pop(vm);
              b:
              {
               if(typeof coll$0 === "number"){
                if(0 === coll$0){var G = [6, [0, x$20, 0]]; break b;}
               }
               else
                switch(coll$0[0]){
                  case 6:
                   var l$1 = coll$0[1], G = [6, [0, x$20, l$1]]; break b;
                  case 21:
                   var l$2 = coll$0[1][1], G = [6, [0, x$20, l$2]]; break b;
                }
               var
                G =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "cons"),
                    [0, x$20, [0, coll$0, 0]]);
              }
              push(vm, G);
              break a;
             case 61:
              var v$5 = pop(vm);
              b:
              {
               if(typeof v$5 !== "number" && 2 === v$5[0]){
                var x$21 = v$5[1], P = [2, - x$21];
                break b;
               }
               var
                P =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], cst$0),
                    [0, v$5, 0]);
              }
              push(vm, P);
              break a;
             case 62:
              var v$6 = pop(vm);
              b:
              {
               if(typeof v$6 !== "number" && 2 === v$6[0]){
                var x$22 = v$6[1], Q = [2, x$22 + 1.];
                break b;
               }
               var
                Q =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "inc"),
                    [0, v$6, 0]);
              }
              push(vm, Q);
              break a;
             case 63:
              var v$7 = pop(vm);
              b:
              {
               if(typeof v$7 !== "number" && 2 === v$7[0]){
                var x$23 = v$7[1], R = [2, x$23 - 1.];
                break b;
               }
               var
                R =
                  caml_call1
                   (Stdlib_Hashtbl[6].call(null, Sx_primitives[1], "dec"),
                    [0, v$7, 0]);
              }
              push(vm, R);
              break a;
           }
          }
         }
         else if(0 < op)
          switch(op - 1 | 0){
            case 0:
             var idx$0 = read_u16(frame);
             if(consts.length - 1 <= idx$0){
              var
               ad =
                 caml_call2
                  (Stdlib_Printf[4].call(null, s), idx$0, consts.length - 1);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], ad], 1);
             }
             push(vm, caml_check_bound(consts, idx$0)[idx$0 + 1]);
             break a;
            case 1:
             push(vm, 0); break a;
            case 2:
             push(vm, t); break a;
            case 3:
             push(vm, u); break a;
            case 4:
             pop(vm); break a;
            case 5:
             push(vm, peek(vm)); break a;
            case 6:
             var a$6 = pop(vm), b$7 = pop(vm);
             push(vm, a$6);
             push(vm, b$7);
             break a;
            case 15:
             var
              slot = read_u8(frame),
              match$4 = Stdlib_Hashtbl[7].call(null, frame[4], slot);
             if(match$4)
              var cell = match$4[1], v$8 = cell[1];
             else{
              var idx$1 = frame[3] + slot | 0;
              if(vm[2] <= idx$1){
               var
                ae = vm[2],
                af = frame[3],
                ag = caml_call3(Stdlib_Printf[4].call(null, v), slot, af, ae);
               throw caml_maybe_attach_backtrace([0, Sx_types[9], ag], 1);
              }
              var v$8 = caml_check_bound(vm[1], idx$1)[idx$1 + 1];
             }
             push(vm, v$8);
             break a;
            case 16:
             var
              slot$0 = read_u8(frame),
              v$9 = peek(vm),
              match$5 = Stdlib_Hashtbl[7].call(null, frame[4], slot$0);
             if(match$5){var cell$0 = match$5[1]; cell$0[1] = v$9; break a;}
             var S = frame[3] + slot$0 | 0;
             caml_check_bound(vm[1], S)[S + 1] = v$9;
             break a;
            case 17:
             var idx$2 = read_u8(frame);
             if(frame[1][2].length - 1 <= idx$2){
              var
               ah = frame[1][2].length - 1,
               ai = caml_call2(Stdlib_Printf[4].call(null, w), idx$2, ah);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], ai], 1);
             }
             push(vm, caml_check_bound(frame[1][2], idx$2)[idx$2 + 1][1]);
             break a;
            case 18:
             var idx$3 = read_u8(frame), aj = peek(vm);
             caml_check_bound(frame[1][2], idx$3)[idx$3 + 1][1] = aj;
             break a;
            case 19:
             var
              idx$4 = read_u16(frame),
              match$6 = caml_check_bound(consts, idx$4)[idx$4 + 1];
             if(typeof match$6 === "number" || ! (3 === match$6[0]))
              var name$0 = cst$1;
             else
              var s$4 = match$6[1], name$0 = s$4;
             var id = Sx_types[4].call(null, name$0), match$7 = frame[1][5];
             if(match$7){
              var env = match$7[1], e = env;
              for(;;)
               try{
                var
                 ak = [0, Stdlib_Hashtbl[6].call(null, e[1], id)],
                 found_in_env = ak;
                break;
               }
               catch(exn){
                var exn$0 = caml_wrap_exception(exn);
                if(exn$0 !== Stdlib[8])
                 throw caml_maybe_attach_backtrace(exn$0, 0);
                var match$8 = e[2];
                if(! match$8){var found_in_env = 0; break;}
                var p$0 = match$8[1];
                e = p$0;
               }
             }
             else
              var found_in_env = 0;
             if(found_in_env)
              var v$10 = found_in_env[1], v$11 = v$10;
             else
              try{
               var
                ap = Stdlib_Hashtbl[6].call(null, vm[4], name$0),
                v$11 = ap;
              }
              catch(exn){
               var exn$1 = caml_wrap_exception(exn);
               if(exn$1 !== Stdlib[8])
                throw caml_maybe_attach_backtrace(exn$1, 0);
               try{var ao = Sx_primitives[15].call(null, name$0), v$11 = ao;}
               catch(exn){
                try{
                 var
                  resolve_fn =
                    Stdlib_Hashtbl[6].call(null, vm[4], "__resolve-symbol");
                 Sx_runtime[7].call(null, resolve_fn, [0, [3, name$0], 0]);
                 try{var an = Stdlib_Hashtbl[6].call(null, vm[4], name$0);}
                 catch(exn){
                  var exn$3 = caml_wrap_exception(exn);
                  if(exn$3 !== Stdlib[8])
                   throw caml_maybe_attach_backtrace(exn$3, 0);
                  var am = Stdlib[28].call(null, cst_VM_undefined, name$0);
                  throw caml_maybe_attach_backtrace([0, Sx_types[9], am], 1);
                 }
                 var v$11 = an;
                }
                catch(exn){
                 var exn$2 = caml_wrap_exception(exn);
                 if(exn$2 !== Stdlib[8])
                  throw caml_maybe_attach_backtrace(exn$2, 0);
                 var al = Stdlib[28].call(null, cst_VM_undefined, name$0);
                 throw caml_maybe_attach_backtrace([0, Sx_types[9], al], 1);
                }
               }
              }
             push(vm, v$11);
             break a;
            case 20:
             var
              idx$5 = read_u16(frame),
              match$9 = caml_check_bound(consts, idx$5)[idx$5 + 1];
             if(typeof match$9 === "number" || ! (3 === match$9[0]))
              var name$1 = cst$1;
             else
              var s$5 = match$9[1], name$1 = s$5;
             var match$10 = frame[1][5];
             if(match$10){
              var
               env$0 = match$10[1],
               id$0 = Sx_types[4].call(null, name$1),
               e$0 = env$0;
              for(;;){
               if(Stdlib_Hashtbl[9].call(null, e$0[1], id$0)){
                var aq = peek(vm);
                Stdlib_Hashtbl[11].call(null, e$0[1], id$0, aq);
                var written = 1;
                break;
               }
               var match$11 = e$0[2];
               if(! match$11){var written = 0; break;}
               var p$1 = match$11[1];
               e$0 = p$1;
              }
             }
             else
              var written = 0;
             if(! (1 - written)) break a;
             var v$12 = peek(vm);
             Stdlib_Hashtbl[11].call(null, vm[4], name$1, v$12);
             var match$12 = Sx_types[23][1];
             if(! match$12) break a;
             var f$2 = match$12[1];
             caml_call2(f$2, name$1, v$12);
             break a;
            case 31:
             var offset = read_i16(frame);
             frame[2] = frame[2] + offset | 0;
             break a;
            case 32:
             var offset$0 = read_i16(frame), v$13 = pop(vm);
             if(! (1 - Sx_types[71].call(null, v$13))) break a;
             frame[2] = frame[2] + offset$0 | 0;
             break a;
            case 33:
             var offset$1 = read_i16(frame), v$14 = pop(vm);
             if(! Sx_types[71].call(null, v$14)) break a;
             frame[2] = frame[2] + offset$1 | 0;
             break a;
            case 34:
             var
              catch_offset = read_i16(frame),
              ar = vm[2],
              as = Stdlib_List[1].call(null, vm[3]),
              entry = [0, frame[2] + catch_offset | 0, as, ar, frame];
             vm[6] = [0, entry, vm[6]];
             break a;
            case 35:
             var match$13 = vm[6];
             if(! match$13) break a;
             var rest = match$13[2];
             vm[6] = rest;
             break a;
            case 36:
             var exn_val = pop(vm), match$14 = vm[6];
             if(! match$14){
              var
               au = Sx_runtime[3].call(null, exn_val),
               av = caml_call1(Stdlib_Printf[4].call(null, x), au);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], av], 1);
             }
             var rest$0 = match$14[2], entry$0 = match$14[1];
             vm[6] = rest$0;
             for(;;){
              var at = entry$0[2];
              if(at >= Stdlib_List[1].call(null, vm[3])){
               vm[2] = entry$0[3];
               entry$0[4][2] = entry$0[1];
               push(vm, exn_val);
               break a;
              }
              var match$15 = vm[3];
              if(match$15){var fs = match$15[2]; vm[3] = fs;}
             }
             break;
            case 47:
             var
              argc = read_u8(frame),
              args =
                Stdlib_Array[1].call
                 (null, argc, function(param){return pop(vm);}),
              f$3 = pop(vm),
              aw = Stdlib_Array[10].call(null, args),
              args_list = Stdlib_List[10].call(null, aw);
             vm_call(vm, f$3, args_list);
             break a;
            case 48:
             var
              argc$0 = read_u8(frame),
              args$0 =
                Stdlib_Array[1].call
                 (null, argc$0, function(param){return pop(vm);}),
              f$4 = pop(vm),
              ax = Stdlib_Array[10].call(null, args$0),
              args_list$0 = Stdlib_List[10].call(null, ax);
             vm[3] = rest_frames;
             vm[2] = frame[3];
             vm_call(vm, f$4, args_list$0);
             break a;
            case 49:
             var result$0 = pop(vm);
             vm[3] = rest_frames;
             vm[2] = frame[3];
             push(vm, result$0);
             break a;
            case 50:
             var idx$6 = read_u16(frame);
             if(consts.length - 1 <= idx$6){
              var
               ay =
                 caml_call2
                  (Stdlib_Printf[4].call(null, y), idx$6, consts.length - 1);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], ay], 1);
             }
             var
              code_val = caml_check_bound(consts, idx$6)[idx$6 + 1],
              code = code_from_value(code_val);
             b:
             {
              if(typeof code_val !== "number" && 7 === code_val[0]){
               var
                d$0 = code_val[1],
                match$16 =
                  Stdlib_Hashtbl[7].call(null, d$0, cst_upvalue_count);
               if(match$16){
                var match$17 = match$16[1];
                if(typeof match$17 !== "number")
                 switch(match$17[0]){
                   case 1:
                    var n$3 = match$17[1], uv_count = n$3; break b;
                   case 2:
                    var n$4 = match$17[1], uv_count = n$4 | 0; break b;
                 }
               }
               var uv_count = 0;
               break b;
              }
              var uv_count = 0;
             }
             let frame$0 = frame;
             var
              upvalues =
                Stdlib_Array[1].call
                 (null,
                  uv_count,
                  function(param){
                   var is_local = read_u8(frame$0), index = read_u8(frame$0);
                   if(1 !== is_local)
                    return caml_check_bound(frame$0[1][2], index)[index + 1];
                   var match = Stdlib_Hashtbl[7].call(null, frame$0[4], index);
                   if(match)
                    var existing = match[1], cell = existing;
                   else{
                    var
                     a = frame$0[3] + index | 0,
                     c = [0, caml_check_bound(vm[1], a)[a + 1]];
                    Stdlib_Hashtbl[11].call(null, frame$0[4], index, c);
                    var cell = c;
                   }
                   return cell;
                  }),
              cl = [0, code, upvalues, 0, vm[4], frame[1][5]];
             push(vm, [24, cl]);
             break a;
            case 51:
             var
              idx$7 = read_u16(frame),
              argc$1 = read_u8(frame),
              match$18 = caml_check_bound(consts, idx$7)[idx$7 + 1];
             if(typeof match$18 === "number" || ! (3 === match$18[0]))
              var name$2 = cst$1;
             else
              var s$6 = match$18[1], name$2 = s$6;
             var
              az =
                Stdlib_List[11].call
                 (null, argc$1, function(param){return pop(vm);}),
              args$1 = Stdlib_List[10].call(null, az),
              args$2 =
                Stdlib_List[20].call
                 (null,
                  function(v){
                   if(typeof v !== "number" && 12 === v[0])
                    return caml_call1(Sx_primitives[3][1], v);
                   return v;
                  },
                  args$1);
             try{
              try{
               var
                aD = Stdlib_Hashtbl[6].call(null, vm[4], name$2),
                fn_val = aD;
              }
              catch(exn){
               var exn$5 = caml_wrap_exception(exn);
               if(exn$5 !== Stdlib[8])
                throw caml_maybe_attach_backtrace(exn$5, 0);
               try{var aC = Sx_primitives[15].call(null, name$2), fn_val = aC;
               }
               catch(exn){
                var
                 aB = Stdlib[28].call(null, cst_VM_unknown_primitive, name$2);
                throw caml_maybe_attach_backtrace([0, Sx_types[9], aB], 1);
               }
              }
              b:
              {
               if(typeof fn_val !== "number")
                switch(fn_val[0]){
                  case 15:
                   var fn = fn_val[2], result$1 = caml_call1(fn, args$2);
                   break b;
                  case 8:
                  case 9:
                  case 10:
                  case 24:
                   var result$1 = Sx_ref[222].call(null, fn_val, [6, args$2]);
                   break b;
                }
               var result$1 = 0;
              }
             }
             catch(exn){
              var exn$4 = caml_wrap_exception(exn);
              if(exn$4[1] !== Sx_types[9])
               throw caml_maybe_attach_backtrace(exn$4, 0);
              var
               msg$0 = exn$4[2],
               aA =
                 caml_call3
                  (Stdlib_Printf[4].call(null, z), msg$0, name$2, argc$1);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], aA], 1);
             }
             push(vm, result$1);
             break a;
            case 63:
             var
              count$0 = read_u16(frame),
              aE =
                Stdlib_List[11].call
                 (null, count$0, function(param){return pop(vm);}),
              items = Stdlib_List[10].call(null, aE);
             push(vm, [6, items]);
             break a;
            case 64:
             var
              count$1 = read_u16(frame),
              d$1 = Stdlib_Hashtbl[1].call(null, 0, count$1);
             if(count$1 >= 1){
              var for$ = 1;
              for(;;){
               var v$15 = pop(vm), k = pop(vm);
               b:
               {
                if(typeof k !== "number")
                 switch(k[0]){
                   case 3:
                   case 5:
                    var s$7 = k[1], key = s$7; break b;
                 }
                var key = Sx_runtime[3].call(null, k);
               }
               Stdlib_Hashtbl[11].call(null, d$1, key, v$15);
               var aF = for$ + 1 | 0;
               if(count$1 === for$) break;
               for$ = aF;
              }
             }
             push(vm, [7, d$1]);
             break a;
          }
         if(200 > op){
          var
           Z = frame[2] - 1 | 0,
           _ = caml_call2(Stdlib_Printf[4].call(null, p), op, Z);
          throw caml_maybe_attach_backtrace([0, Sx_types[9], _], 1);
         }
         caml_call3(extension_dispatch_ref[1], op, vm, frame);
        }
       }
       catch(exn$0){var exn = caml_wrap_exception(exn$0); break;}
      }
     }
    }
    if(exn[1] !== Stdlib[6]) throw caml_maybe_attach_backtrace(exn, 0);
    var msg = exn[2], match$1 = frame[1][3];
    if(match$1)
     var n$1 = match$1[1], fn_name$0 = n$1;
    else
     var fn_name$0 = cst;
    var
     W = vm[2],
     X = frame[3],
     Y =
       caml_call8
        (Stdlib_Printf[4].call(null, o),
         msg,
         saved_ip,
         op,
         fn_name$0,
         X,
         W,
         bc.length - 1,
         consts.length - 1);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], Y], 1);
   }
   var A = [3, cst_phase], B = [3, cst_request];
   function resume_vm(vm, result){
    var prev_active = active_vm[1];
    active_vm[1] = [0, vm];
    function restore(param){active_vm[1] = prev_active;}
    try{
     var match = vm[5];
     if(match){
      var cek_state = match[1];
      vm[5] = 0;
      var
       final = Sx_ref[158].call(null, cek_state, result),
       match$0 = Sx_runtime[13].call(null, final, A);
      if
       (typeof match$0 !== "number"
        && 3 === match$0[0] && match$0[1] === cst_io_suspended){
       vm[5] = [0, final];
       throw caml_maybe_attach_backtrace
              ([0, VmSuspended, Sx_runtime[13].call(null, final, B), vm], 1);
      }
      push(vm, Sx_ref[18].call(null, final));
     }
     else
      push(vm, result);
     try{run(vm);}
     catch(e){
      var e$0 = caml_wrap_exception(e);
      if(e$0[1] === VmSuspended) throw caml_maybe_attach_backtrace(e$0, 0);
      if(e$0[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(e$0, 0);
      var msg = e$0[2], match$1 = vm[6];
      if(! match$1)
       throw caml_maybe_attach_backtrace([0, Sx_types[9], msg], 1);
      var rest = match$1[2], entry = match$1[1];
      vm[6] = rest;
      for(;;){
       var a = entry[2];
       if(a >= Stdlib_List[1].call(null, vm[3])){
        vm[2] = entry[3];
        entry[4][2] = entry[1];
        push(vm, [3, msg]);
        run(vm);
        break;
       }
       var match$2 = vm[3];
       if(match$2){var fs = match$2[2]; vm[3] = fs;}
      }
     }
     vm[7] = 0;
     var
      restore_reuse =
        function(pending){
         if(! pending) return;
         var
          rest = pending[2],
          match = pending[1],
          saved_sp = match[2],
          saved_frames = match[1],
          callback_result = pop(vm);
         vm[3] = saved_frames;
         if(saved_sp < vm[2]) vm[2] = saved_sp;
         push(vm, callback_result);
         try{
          run(vm);
          var new_pending = Stdlib_List[10].call(null, vm[7]);
          vm[7] = 0;
          restore_reuse(Stdlib[37].call(null, new_pending, rest));
          return;
         }
         catch(e$0){
          var e = caml_wrap_exception(e$0);
          if(e[1] !== VmSuspended) throw caml_maybe_attach_backtrace(e, 0);
          var a = vm[7], b = Stdlib_List[10].call(null, rest);
          vm[7] = Stdlib[37].call(null, b, a);
          throw caml_maybe_attach_backtrace(e, 0);
         }
        },
      pending = Stdlib_List[10].call(null, vm[7]);
     vm[7] = 0;
     restore_reuse(pending);
     var r = pop(vm);
     restore(0);
     return r;
    }
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     restore(0);
     throw caml_maybe_attach_backtrace(e, 0);
    }
   }
   var C = [0, "module"];
   function execute_module(code, globals){
    var
     cl = [0, code, [0], C, globals, 0],
     vm = create(globals),
     frame = [0, cl, 0, 0, Stdlib_Hashtbl[1].call(null, 0, 4)],
     a = code[3] - 1 | 0;
    if(a >= 0){
     var for$ = 0;
     for(;;){
      push(vm, 0);
      var b = for$ + 1 | 0;
      if(a === for$) break;
      for$ = b;
     }
    }
    vm[3] = [0, frame, 0];
    run(vm);
    return pop(vm);
   }
   function execute_module_safe(code, globals){
    try{var result = execute_module(code, globals); return [0, result];}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== VmSuspended) throw caml_maybe_attach_backtrace(exn, 0);
     var vm = exn[3], request = exn[2];
     return [1, [0, request, vm]];
    }
   }
   function jit_is_broken_name(n){
    var b = n === "parse-bind" ? 1 : 0;
    if(b)
     var a = b;
    else{
     var c = n === "seq" ? 1 : 0;
     if(c)
      var a = c;
     else{
      var d = n === "seq2" ? 1 : 0;
      if(d)
       var a = d;
      else{
       var e = n === "many" ? 1 : 0;
       if(e)
        var a = e;
       else{
        var f = n === "many1" ? 1 : 0;
        if(f)
         var a = f;
        else{
         var g = n === "satisfy" ? 1 : 0;
         if(g)
          var a = g;
         else{
          var h = n === "fmap" ? 1 : 0;
          if(h)
           var a = h;
          else{
           var i = n === "alt" ? 1 : 0;
           if(i)
            var a = i;
           else{
            var j = n === "alt2" ? 1 : 0;
            if(j)
             var a = j;
            else{
             var k = n === "skip-left" ? 1 : 0;
             if(k)
              var a = k;
             else{
              var l = n === "skip-right" ? 1 : 0;
              if(l)
               var a = l;
              else{
               var m = n === "skip-many" ? 1 : 0;
               if(m)
                var a = m;
               else{
                var o = n === "optional" ? 1 : 0;
                if(o)
                 var a = o;
                else{
                 var p = n === "between" ? 1 : 0;
                 if(p)
                  var a = p;
                 else{
                  var q = n === "sep-by" ? 1 : 0;
                  if(q)
                   var a = q;
                  else{
                   var r = n === "sep-by1" ? 1 : 0;
                   if(r)
                    var a = r;
                   else{
                    var s = n === "parse-char" ? 1 : 0;
                    if(s)
                     var a = s;
                    else{
                     var t = n === "parse-string" ? 1 : 0;
                     if(t)
                      var a = t;
                     else{
                      var u = n === "lazy-parser" ? 1 : 0;
                      if(u)
                       var a = u;
                      else{
                       var v = n === "label" ? 1 : 0;
                       if(v)
                        var a = v;
                       else{
                        var w = n === "not-followed-by" ? 1 : 0;
                        if(w)
                         var a = w;
                        else{
                         var x = n === "look-ahead" ? 1 : 0;
                         if(x)
                          var a = x;
                         else{
                          var y = n === "hs-tokenize" ? 1 : 0;
                          if(y)
                           var a = y;
                          else{
                           var z = n === "hs-parse" ? 1 : 0;
                           if(z)
                            var a = z;
                           else{
                            var A = n === "hs-compile" ? 1 : 0;
                            if(A)
                             var a = A;
                            else{
                             var B = n === "hs-to-sx" ? 1 : 0;
                             if(B)
                              var a = B;
                             else{
                              var C = n === "hs-to-sx-from-source" ? 1 : 0;
                              if(C)
                               var a = C;
                              else{
                               var D = n === "eval-hs" ? 1 : 0;
                               if(D)
                                var a = D;
                               else{
                                var E = n === "eval-hs-inner" ? 1 : 0;
                                if(E)
                                 var a = E;
                                else{
                                 var F = n === "eval-hs-with-me" ? 1 : 0;
                                 if(F)
                                  var a = F;
                                 else{
                                  var G = n === "run-hs-fixture" ? 1 : 0;
                                  if(G)
                                   var a = G;
                                  else{
                                   var H = n === "tw-resolve-style" ? 1 : 0;
                                   if(H)
                                    var a = H;
                                   else{
                                    var I = n === "tw-resolve-layout" ? 1 : 0;
                                    if(I)
                                     var a = I;
                                    else{
                                     var J = n === "gql-ws?" ? 1 : 0;
                                     if(J)
                                      var a = J;
                                     else{
                                      var K = n === "gql-parse-tokens" ? 1 : 0;
                                      if(K)
                                       var a = K;
                                      else{
                                       var L = n === "gql-execute-operation" ? 1 : 0;
                                       if(L)
                                        var a = L;
                                       else{
                                        var M = n === "hs-repeat-times" ? 1 : 0;
                                        if(M)
                                         var a = M;
                                        else{
                                         var N = n === "hs-repeat-forever" ? 1 : 0;
                                         if(N)
                                          var a = N;
                                         else{
                                          var O = n === "hs-repeat-while" ? 1 : 0;
                                          if(O)
                                           var a = O;
                                          else{
                                           var P = n === "hs-repeat-until" ? 1 : 0;
                                           if(P)
                                            var a = P;
                                           else
                                            var
                                             Q = n === "hs-for-each" ? 1 : 0,
                                             a = Q || (n === "hs-put!" ? 1 : 0);
                                          }
                                         }
                                        }
                                       }
                                      }
                                     }
                                    }
                                   }
                                  }
                                 }
                                }
                               }
                              }
                             }
                            }
                           }
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
    return a;
   }
   function bytecode_find_opcode(pred, bc, consts){
    var len = bc.length - 1, found = 0, ip$0 = 0;
    for(;;){
     if(! found && ip$0 < len){
      var op = caml_check_bound(bc, ip$0)[ip$0 + 1];
      if(caml_call1(pred, op)){found = 1; continue;}
      var ip = ip$0 + 1 | 0;
      a:
      {
       if(51 === op && (ip + 1 | 0) < len){
        var
         lo = caml_check_bound(bc, ip)[ip + 1],
         b = ip + 1 | 0,
         hi = caml_check_bound(bc, b)[b + 1],
         idx = lo | hi << 8;
        b:
        if(idx < consts.length - 1){
         var match = caml_check_bound(consts, idx)[idx + 1];
         if(typeof match !== "number" && 7 === match[0]){
          var
           d = match[1],
           match$0 = Stdlib_Hashtbl[7].call(null, d, cst_upvalue_count);
          if(match$0){
           var match$1 = match$0[1];
           if(typeof match$1 !== "number")
            switch(match$1[0]){
              case 1:
               var n = match$1[1], uv_count = n; break b;
              case 2:
               var n$0 = match$1[1], uv_count = n$0 | 0; break b;
            }
          }
          var uv_count = 0;
          break b;
         }
         var uv_count = 0;
        }
        else
         var uv_count = 0;
        var extra = 2 + (uv_count * 2 | 0) | 0;
        break a;
       }
       b:
       {
        c:
        {
         if(50 <= op){
          if(66 > op){
           if(52 === op){var extra = 3; break a;}
           if(64 <= op) break c;
           break b;
          }
          if(128 === op) break c;
          if(144 !== op) break b;
         }
         else if(20 <= op){
          var a = op - 22 | 0;
          if(25 >= a >>> 0){
           if(3 < a - 10 >>> 0) break b;
           var extra = 2;
           break a;
          }
          if(26 > a) break c;
         }
         else{if(1 === op) break c; if(16 > op) break b;}
         var extra = 1;
         break a;
        }
        var extra = 2;
        break a;
       }
       var extra = 0;
      }
      ip$0 = ip + extra | 0;
      continue;
     }
     return found;
    }
   }
   function bytecode_uses_extension_opcode(bc, consts){
    return bytecode_find_opcode
            (function(op){return 200 <= op ? 1 : 0;}, bc, consts);
   }
   function code_uses_handler(code){
    var
     a =
       bytecode_find_opcode
        (function(op){return 35 === op ? 1 : 0;}, code[4], code[5]);
    return a
            ? a
            : Stdlib_Array
               [24].call
              (null,
               function(c){
                a:
                if(typeof c !== "number" && 7 === c[0]){
                 var d = c[1];
                 if
                  (!
                   Stdlib_Hashtbl[9].call(null, d, cst_bytecode)
                   && ! Stdlib_Hashtbl[9].call(null, d, cst_vc_bytecode))
                  break a;
                 try{var a = code_uses_handler(code_from_value(c)); return a;}
                 catch(exn){return 0;}
                }
                return 0;
               },
               code[5]);
   }
   function code_refs_escaping_caller(code){
    return Stdlib_Array[24].call
            (null,
             function(c){
              if(typeof c !== "number")
               switch(c[0]){
                 case 3:
                  var s = c[1];
                  return Stdlib_Hashtbl[9].call(null, Sx_types[50], s);
                 case 7:
                  var d = c[1];
                  if
                   (!
                    Stdlib_Hashtbl[9].call(null, d, cst_bytecode)
                    && ! Stdlib_Hashtbl[9].call(null, d, cst_vc_bytecode))
                   break;
                  try{
                   var a = code_refs_escaping_caller(code_from_value(c));
                   return a;
                  }
                  catch(exn){return 0;}
               }
              return 0;
             },
             code[5]);
   }
   var
    cst_jit_FAIL = "[jit] FAIL ",
    cst_jit_SKIP = "[jit] SKIP ",
    jit_compiling = [0, 0],
    D =
      [0,
       [11, cst_jit_FAIL, [2, 0, [11, cst$2, [2, 0, [12, 10, [10, 0]]]]]],
       "[jit] FAIL %s: %s\n%!"],
    E = [4, cst_fn],
    F = [4, cst_quote],
    G = [4, cst_compile],
    H =
      [0,
       [11,
        cst_jit_FAIL,
        [2, 0, [11, ": compiler returned ", [2, 0, [12, 10, [10, 0]]]]]],
       "[jit] FAIL %s: compiler returned %s\n%!"],
    I =
      [0,
       [11,
        cst_jit_SKIP,
        [2,
         0,
         [11,
          ": bytecode uses extension opcodes (interpret-only in v1)\n",
          [10, 0]]]],
       "[jit] SKIP %s: bytecode uses extension opcodes (interpret-only in v1)\n%!"],
    J =
      [0,
       [11,
        cst_jit_SKIP,
        [2,
         0,
         [11,
          ": installs an exception handler (guard) \xe2\x80\x94 interpret-only\n",
          [10, 0]]]],
       "[jit] SKIP %s: installs an exception handler (guard) \xe2\x80\x94 interpret-only\n%!"],
    K =
      [0,
       [11,
        cst_jit_SKIP,
        [2,
         0,
         [11,
          ": calls a call/cc-establishing form \xe2\x80\x94 interpret-only\n",
          [10, 0]]]],
       "[jit] SKIP %s: calls a call/cc-establishing form \xe2\x80\x94 interpret-only\n%!"],
    L =
      [0,
       [11,
        cst_jit_FAIL,
        [2,
         0,
         [11,
          ": closure index ",
          [4,
           0,
           0,
           0,
           [11, " out of bounds (pool=", [4, 0, 0, 0, [11, cst$0, [10, 0]]]]]]]],
       "[jit] FAIL %s: closure index %d out of bounds (pool=%d)\n%!"],
    M =
      [0,
       [11,
        cst_jit_SKIP,
        [2,
         0,
         [11,
          ": non-closure execution failed (bc[0]=",
          [4, 0, 0, 0, [11, ", len=", [4, 0, 0, 0, [11, cst$0, [10, 0]]]]]]]],
       "[jit] SKIP %s: non-closure execution failed (bc[0]=%d, len=%d)\n%!"],
    N =
      [0,
       [11,
        "[jit] RESOLVED ",
        [2,
         0,
         [11,
          cst$2,
          [2, 0, [11, " (bc[0]=", [4, 0, 0, 0, [11, cst$0, [10, 0]]]]]]]],
       "[jit] RESOLVED %s: %s (bc[0]=%d)\n%!"];
   function jit_compile_lambda(l, globals){
    var match = l[4];
    if(match) var n = match[1], fn_name = n; else var fn_name = "<anon>";
    if(jit_compiling[1]) return 0;
    if
     (!
      Stdlib_List[37].call(null, "&key", l[1])
      && ! Stdlib_List[37].call(null, ":as", l[1])){
     if(0 !== l[4] && 0 === l[3][2]){
      if(jit_is_broken_name(fn_name)) return 0;
      if(Sx_types[49].call(null, fn_name)) return 0;
      try{
       jit_compiling[1] = 1;
       try{
        var compile_fn = Stdlib_Hashtbl[6].call(null, globals, cst_compile);
       }
       catch(exn$0){
        var exn = caml_wrap_exception(exn$0);
        if(exn !== Stdlib[8]) throw caml_maybe_attach_backtrace(exn, 0);
        jit_compiling[1] = 0;
        throw caml_maybe_attach_backtrace
               ([0, Sx_types[9], cst_JIT_compiler_not_loaded], 1);
       }
       var
        param_syms =
          [6, Stdlib_List[20].call(null, function(s){return [4, s];}, l[1])],
        fn_expr = [6, [0, E, [0, param_syms, [0, l[2], 0]]]];
       a:
       {
        if(typeof compile_fn !== "number" && 8 === compile_fn[0]){
         var match$1 = compile_fn[1][5];
         if(match$1){
          var cl = match$1[1];
          if(! is_jit_failed(cl)){
           var result = call_closure(cl, [0, fn_expr, 0], globals);
           break a;
          }
         }
        }
        var
         c = Sx_types[20].call(null, 0),
         compile_env = Sx_types[21].call(null, c);
        Stdlib_Hashtbl[12].call
         (null,
          function(k, v){
           var a = Sx_types[4].call(null, k);
           return Stdlib_Hashtbl[11].call(null, compile_env[1], a, v);
          },
          globals);
        var
         result =
           Sx_ref[242].call
            (null,
             [6, [0, G, [0, [6, [0, F, [0, fn_expr, 0]]], 0]]],
             [20, compile_env]);
       }
       jit_compiling[1] = 0;
       if(0 < Stdlib_Hashtbl[15].call(null, l[3][1])){
        var
         merged = Stdlib_Hashtbl[4].call(null, globals),
         env$1 = l[3],
         env = env$1;
        for(;;){
         Stdlib_Hashtbl[12].call
          (null,
           function(id, v){
            var
             name = Sx_types[5].call(null, id),
             a = 1 - Stdlib_Hashtbl[9].call(null, merged, name);
            return a ? Stdlib_Hashtbl[11].call(null, merged, name, v) : a;
           },
           env[1]);
         var match$0 = env[2];
         if(! match$0){var effective_globals = merged; break;}
         var env$0 = match$0[1];
         env = env$0;
        }
       }
       else
        var effective_globals = globals;
       a:
       {
        b:
        if(typeof result !== "number" && 7 === result[0]){
         var d = result[1];
         if
          (!
           Stdlib_Hashtbl[9].call(null, d, cst_bytecode)
           && ! Stdlib_Hashtbl[9].call(null, d, cst_vc_bytecode))
          break b;
         var outer_code = code_from_value(result), bc = outer_code[4];
         if(4 <= bc.length - 1 && 51 === caml_check_bound(bc, 0)[1]){
          var
           g = caml_check_bound(bc, 2)[3] << 8,
           idx = caml_check_bound(bc, 1)[2] | g;
          if(idx >= outer_code[5].length - 1){
           var h = outer_code[5].length - 1;
           caml_call3(Stdlib_Printf[3].call(null, L), fn_name, idx, h);
           var a = 0;
           break a;
          }
          var
           inner_val = caml_check_bound(outer_code[5], idx)[idx + 1],
           code = code_from_value(inner_val);
          if(bytecode_uses_extension_opcode(code[4], code[5])){
           caml_call1(Stdlib_Printf[3].call(null, I), fn_name);
           var a = 0;
           break a;
          }
          if(code_uses_handler(code)){
           caml_call1(Stdlib_Printf[3].call(null, J), fn_name);
           var a = 0;
           break a;
          }
          if
           (0 < Stdlib_Hashtbl[15].call(null, Sx_types[50])
            && code_refs_escaping_caller(code)){
           caml_call1(Stdlib_Printf[3].call(null, K), fn_name);
           var a = 0;
           break a;
          }
          var a = [0, [0, code, [0], l[4], effective_globals, [0, l[3]]]];
          break a;
         }
         try{
          var
           value = execute_module(outer_code, globals),
           k = 0 < bc.length - 1 ? caml_check_bound(bc, 0)[1] : -1,
           m = Sx_types[61].call(null, value);
          caml_call3(Stdlib_Printf[3].call(null, N), fn_name, m, k);
          var a = 0;
          break a;
         }
         catch(exn){
          var
           i = bc.length - 1,
           j = 0 < bc.length - 1 ? caml_check_bound(bc, 0)[1] : -1;
          caml_call3(Stdlib_Printf[3].call(null, M), fn_name, j, i);
          var a = 0;
          break a;
         }
        }
        var f = Sx_types[61].call(null, result);
        caml_call2(Stdlib_Printf[3].call(null, H), fn_name, f);
        var a = 0;
       }
       return a;
      }
      catch(e$0){
       var e = caml_wrap_exception(e$0);
       jit_compiling[1] = 0;
       var b = Stdlib_Printexc[1].call(null, e);
       caml_call2(Stdlib_Printf[3].call(null, D), fn_name, b);
       return 0;
      }
     }
     return 0;
    }
    return 0;
   }
   jit_compile_ref[1] = jit_compile_lambda;
   Sx_types[6][1] = function(cl, args){return call_closure_reuse(cl, args);};
   var O = [0, 1];
   Sx_types[16][1] =
    function(exn){
     if(exn[1] !== VmSuspended) return 0;
     var
      vm = exn[3],
      request = exn[2],
      saved_cek = vm[5],
      saved_reuse = vm[7],
      d = Stdlib_Hashtbl[1].call(null, 0, 3);
     Stdlib_Hashtbl[11].call(null, d, "__vm_suspended", O);
     Stdlib_Hashtbl[11].call(null, d, cst_request, request);
     Stdlib_Hashtbl[11].call
      (null,
       d,
       "resume",
       [15,
        "vm-resume",
        function(args){
         if(args && ! args[2]){
          var result = args[1];
          vm[5] = saved_cek;
          vm[7] = saved_reuse;
          try{var a = resume_vm(vm, result); return a;}
          catch(exn2$0){
           var
            exn2 = caml_wrap_exception(exn2$0),
            match = caml_call1(Sx_types[16][1], exn2);
           if(! match) throw caml_maybe_attach_backtrace(exn2, 0);
           var marker = match[1];
           return marker;
          }
         }
         return 0;
        }]);
     return [0, [7, d]];
    };
   Sx_types[13][1] =
    [0,
     function(suspended_state){
      var
       request = Sx_ref[17].call(null, suspended_state),
       vm = create(Sx_types[14][1]);
      vm[5] = [0, suspended_state];
      var match = active_vm[1];
      if(match){
       var active = match[1];
       if(0 !== active[7]){vm[7] = active[7]; active[7] = 0;}
      }
      throw caml_maybe_attach_backtrace([0, VmSuspended, request, vm], 1);
     }];
   var P = [6, 0], Q = [3, cst_phase], R = [3, cst_request];
   Sx_types[8][1] =
    function(f, args){
     var
      a = [20, Sx_types[20].call(null, 0)],
      state = Sx_ref[237].call(null, f, [6, args], a, [6, args], P),
      final = Sx_ref[156].call(null, state),
      match = Sx_runtime[13].call(null, final, Q);
     if
      (typeof match !== "number"
       && 3 === match[0] && match[1] === cst_io_suspended){
      var vm = create(Stdlib_Hashtbl[1].call(null, 0, 0));
      vm[5] = [0, final];
      var match$0 = active_vm[1];
      if(match$0){
       var active = match$0[1];
       if(0 !== active[7]){vm[7] = active[7]; active[7] = 0;}
      }
      throw caml_maybe_attach_backtrace
             ([0, VmSuspended, Sx_runtime[13].call(null, final, R), vm], 1);
     }
     return Sx_ref[18].call(null, final);
    };
   var S = [0, [11, "UNKNOWN_", [4, 0, 0, 0, 0]], "UNKNOWN_%d"];
   function opcode_name(n){
    if(66 <= n){
     var switcher = n - 128 | 0;
     if(47 >= switcher >>> 0)
      switch(switcher){
        case 0:
         return "DEFINE";
        case 16:
         return "STR_CONCAT";
        case 32:
         return "ADD";
        case 33:
         return "SUB";
        case 34:
         return "MUL";
        case 35:
         return "DIV";
        case 36:
         return "EQ";
        case 37:
         return "LT";
        case 38:
         return "GT";
        case 39:
         return "NOT";
        case 40:
         return "LEN";
        case 41:
         return "FIRST";
        case 42:
         return "REST";
        case 43:
         return "NTH";
        case 44:
         return "CONS";
        case 45:
         return "NEG";
        case 46:
         return "INC";
        case 47:
         return "DEC";
      }
    }
    else if(0 < n)
     switch(n - 1 | 0){
       case 0:
        return "CONST";
       case 1:
        return "NIL";
       case 2:
        return "TRUE";
       case 3:
        return "FALSE";
       case 4:
        return "POP";
       case 5:
        return "DUP";
       case 6:
        return "SWAP";
       case 15:
        return "LOCAL_GET";
       case 16:
        return "LOCAL_SET";
       case 17:
        return "UPVALUE_GET";
       case 18:
        return "UPVALUE_SET";
       case 19:
        return "GLOBAL_GET";
       case 20:
        return "GLOBAL_SET";
       case 31:
        return "JUMP";
       case 32:
        return "JUMP_IF_FALSE";
       case 33:
        return "JUMP_IF_TRUE";
       case 34:
        return "PUSH_HANDLER";
       case 35:
        return "POP_HANDLER";
       case 36:
        return "RAISE";
       case 47:
        return "CALL";
       case 48:
        return "TAIL_CALL";
       case 49:
        return "RETURN";
       case 50:
        return "CLOSURE";
       case 51:
        return "CALL_PRIM";
       case 63:
        return "LIST";
       case 64:
        return "DICT";
     }
    var match = caml_call1(extension_opcode_name_ref[1], n);
    if(! match) return caml_call1(Stdlib_Printf[4].call(null, S), n);
    var name = match[1];
    return name;
   }
   function opcode_operand_size(param){
    a:
    {
     b:
     {
      if(36 <= param){
       if(128 !== param){
        if(66 <= param){if(144 === param) break b; break a;}
        if(48 > param) break a;
        switch(param - 48 | 0){
          case 3:
           return 2;
          case 4:
           return 3;
          case 16:
          case 17: break;
          case 0:
          case 1:
           break b;
          default: break a;
        }
       }
      }
      else if(16 <= param){
       if(22 <= param){if(32 <= param) return 2; break a;}
       if(20 > param) break b;
      }
      else if(1 !== param) break a;
      return 2;
     }
     return 1;
    }
    return 0;
   }
   var
    cst_opcode = "opcode",
    W = [0, 0],
    X = [0, 0],
    c = [2, 0.],
    a = [6, 0],
    T = [4, "do"],
    U = [4, cst_quote],
    V = [0, "trace"],
    Y = [0, 1],
    Z = [0, 0];
   function trace_run(src, globals){
    try{var compile_fn = Stdlib_Hashtbl[6].call(null, globals, cst_compile);}
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn === Stdlib[8])
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "trace: compiler not loaded"], 1);
     throw caml_maybe_attach_backtrace(exn, 0);
    }
    var exprs = Sx_parser[17].call(null, src);
    a:
    {
     if(exprs && ! exprs[2]){var e = exprs[1], expr = e; break a;}
     var expr = [6, [0, T, exprs]];
    }
    var
     quoted = [6, [0, U, [0, expr, 0]]],
     K = [20, Sx_types[20].call(null, 0)],
     code_val =
       Sx_ref[242].call(null, [6, [0, compile_fn, [0, quoted, 0]]], K),
     code = code_from_value(code_val),
     cl = [0, code, [0], V, globals, 0],
     vm = create(globals),
     frame0 = [0, cl, 0, 0, Stdlib_Hashtbl[1].call(null, 0, 4)],
     m = code[3] - 1 | 0;
    if(m >= 0){
     var for$0 = 0;
     for(;;){
      push(vm, 0);
      var ao = for$0 + 1 | 0;
      if(m === for$0) break;
      for$0 = ao;
     }
    }
    vm[3] = [0, frame0, 0];
    var trace = [0, 0];
    try{
     var steps = [0, 0];
     for(;;){
      if(0 !== vm[3] && steps[1] < 10000){
       var match = vm[3];
       if(! match) continue;
       var frame = match[1], bc = frame[1][1][4];
       if(bc.length - 1 <= frame[2]){vm[3] = 0; continue;}
       var
        o = frame[2],
        op = caml_check_bound(bc, o)[o + 1],
        L = Stdlib[16].call(null, 5, vm[2]),
        stack_snap =
          Stdlib_List[11].call
           (null,
            L,
            function(i){
             var
              a = (vm[2] - 1 | 0) - i | 0,
              v = caml_check_bound(vm[1], a)[a + 1];
             return [3, Sx_types[117].call(null, v)];
            }),
        entry = Stdlib_Hashtbl[1].call(null, 0, 4),
        M = [3, opcode_name(op)];
       Stdlib_Hashtbl[11].call(null, entry, cst_opcode, M);
       Stdlib_Hashtbl[11].call(null, entry, "stack", [6, stack_snap]);
       var N = [2, Stdlib_List[1].call(null, vm[3])];
       Stdlib_Hashtbl[11].call(null, entry, "depth", N);
       trace[1] = [0, [7, entry], trace[1]];
       steps[1]++;
       frame[2] = frame[2] + 1 | 0;
       var rest_frames = Stdlib_List[7].call(null, vm[3]);
       try{
        if(66 <= op){
         var switcher = op - 128 | 0;
         if(47 >= switcher >>> 0)
          switch(switcher){
            case 0:
             var
              idx = read_u16(frame),
              match$0 = caml_check_bound(frame[1][1][5], idx)[idx + 1];
             if(typeof match$0 === "number" || ! (3 === match$0[0]))
              var name = cst$1;
             else
              var s = match$0[1], name = s;
             var O = peek(vm);
             Stdlib_Hashtbl[11].call(null, vm[4], name, O);
             break;
            case 16:
             var
              count = read_u8(frame),
              P =
                Stdlib_List[11].call
                 (null, count, function(param){return pop(vm);}),
              parts = Stdlib_List[10].call(null, P),
              Q = Stdlib_List[20].call(null, Sx_runtime[3], parts);
             push(vm, [3, Stdlib_String[7].call(null, cst$1, Q)]);
             break;
            case 32:
             var b = pop(vm), a$0 = pop(vm);
             a:
             {
              if
               (typeof a$0 !== "number"
                && 2 === a$0[0] && typeof b !== "number" && 2 === b[0]){var y = b[1], x = a$0[1], p = [2, x + y]; break a;}
              var p = 0;
             }
             push(vm, p);
             break;
            case 33:
             var b$0 = pop(vm), a$1 = pop(vm);
             a:
             {
              if
               (typeof a$1 !== "number"
                && 2 === a$1[0] && typeof b$0 !== "number" && 2 === b$0[0]){
               var y$0 = b$0[1], x$0 = a$1[1], q = [2, x$0 - y$0];
               break a;
              }
              var q = 0;
             }
             push(vm, q);
             break;
            case 34:
             var b$1 = pop(vm), a$2 = pop(vm);
             a:
             {
              if
               (typeof a$2 !== "number"
                && 2 === a$2[0] && typeof b$1 !== "number" && 2 === b$1[0]){
               var y$1 = b$1[1], x$1 = a$2[1], t = [2, x$1 * y$1];
               break a;
              }
              var t = 0;
             }
             push(vm, t);
             break;
            case 35:
             var b$2 = pop(vm), a$3 = pop(vm);
             a:
             {
              if
               (typeof a$3 !== "number"
                && 2 === a$3[0] && typeof b$2 !== "number" && 2 === b$2[0]){
               var y$2 = b$2[1], x$2 = a$3[1], u = [2, x$2 / y$2];
               break a;
              }
              var u = 0;
             }
             push(vm, u);
             break;
            case 36:
             var b$3 = pop(vm), a$4 = pop(vm);
             push(vm, [0, runtime.caml_equal(a$4, b$3)]);
             break;
            case 37:
             var b$4 = pop(vm), a$5 = pop(vm);
             if
              (typeof a$5 === "number"
               ||
                !
                (2 === a$5[0]
                && ! (typeof b$4 === "number" || ! (2 === b$4[0]))))
              var w = W;
             else
              var y$3 = b$4[1], x$3 = a$5[1], w = [0, x$3 < y$3 ? 1 : 0];
             push(vm, w);
             break;
            case 38:
             var b$5 = pop(vm), a$6 = pop(vm);
             if
              (typeof a$6 === "number"
               ||
                !
                (2 === a$6[0]
                && ! (typeof b$5 === "number" || ! (2 === b$5[0]))))
              var z = X;
             else
              var y$4 = b$5[1], x$4 = a$6[1], z = [0, y$4 < x$4 ? 1 : 0];
             push(vm, z);
             break;
            case 39:
             var v = pop(vm);
             push(vm, [0, 1 - Sx_types[71].call(null, v)]);
             break;
            case 40:
             var v$0 = pop(vm);
             a:
             if(typeof v$0 === "number")
              var h = c;
             else{
              switch(v$0[0]){
                case 3:
                 var s$0 = v$0[1], h = [2, caml_ml_string_length(s$0)];
                 break a;
                case 6:
                 var l = v$0[1]; break;
                case 21:
                 var l = v$0[1][1]; break;
                default: var h = c; break a;
              }
              var h = [2, Stdlib_List[1].call(null, l)];
             }
             push(vm, h);
             break;
            case 41:
             var v$1 = pop(vm);
             a:
             {
              if(typeof v$1 !== "number")
               switch(v$1[0]){
                 case 6:
                  var A = v$1[1]; if(A){var i = A[1]; break a;} break;
                 case 21:
                  var B = v$1[1][1]; if(B){var i = B[1]; break a;} break;
               }
              var i = 0;
             }
             push(vm, i);
             break;
            case 42:
             var v$2 = pop(vm);
             a:
             if(typeof v$2 === "number")
              var g = a;
             else{
              switch(v$2[0]){
                case 6:
                 var C = v$2[1];
                 if(! C){var g = a; break a;}
                 var xs = C[2];
                 break;
                case 21:
                 var D = v$2[1][1];
                 if(! D){var g = a; break a;}
                 var xs = D[2];
                 break;
                default: var g = a; break a;
              }
              var g = [6, xs];
             }
             push(vm, g);
             break;
            case 43:
             var n = pop(vm), coll = pop(vm);
             a:
             {
              b:
              if(typeof coll !== "number"){
               switch(coll[0]){
                 case 6:
                  var l$0 = coll[1]; break;
                 case 21:
                  var l$0 = coll[1][1]; break;
                 default: break b;
               }
               if(typeof n !== "number" && 2 === n[0]){
                var f = n[1];
                try{
                 var R = Stdlib_List[8].call(null, l$0, f | 0), j = R;
                 break a;
                }
                catch(exn){var j = 0; break a;}
               }
              }
              var j = 0;
             }
             push(vm, j);
             break;
            case 44:
             var coll$0 = pop(vm), x$5 = pop(vm);
             a:
             {
              if(typeof coll$0 !== "number" && 6 === coll$0[0]){
               var l$1 = coll$0[1], E = [6, [0, x$5, l$1]];
               break a;
              }
              var E = [6, [0, x$5, 0]];
             }
             push(vm, E);
             break;
            case 45:
             var v$3 = pop(vm);
             a:
             {
              if(typeof v$3 !== "number" && 2 === v$3[0]){var x$6 = v$3[1], F = [2, - x$6]; break a;
              }
              var F = 0;
             }
             push(vm, F);
             break;
            case 46:
             var v$4 = pop(vm);
             a:
             {
              if(typeof v$4 !== "number" && 2 === v$4[0]){
               var x$7 = v$4[1], G = [2, x$7 + 1.];
               break a;
              }
              var G = 0;
             }
             push(vm, G);
             break;
            case 47:
             var v$5 = pop(vm);
             a:
             {
              if(typeof v$5 !== "number" && 2 === v$5[0]){
               var x$8 = v$5[1], H = [2, x$8 - 1.];
               break a;
              }
              var H = 0;
             }
             push(vm, H);
             break;
          }
        }
        else if(0 < op)
         switch(op - 1 | 0){
           case 0:
            var idx$0 = read_u16(frame);
            push(vm, caml_check_bound(frame[1][1][5], idx$0)[idx$0 + 1]);
            break;
           case 1:
            push(vm, 0); break;
           case 2:
            push(vm, Y); break;
           case 3:
            push(vm, Z); break;
           case 4:
            pop(vm); break;
           case 5:
            push(vm, peek(vm)); break;
           case 6:
            var a$7 = pop(vm), b$6 = pop(vm);
            push(vm, a$7);
            push(vm, b$6);
            break;
           case 15:
            var
             slot = read_u8(frame),
             match$1 = Stdlib_Hashtbl[7].call(null, frame[4], slot);
            if(match$1)
             var cell = match$1[1], v$6 = cell[1];
            else
             var
              I = frame[3] + slot | 0,
              v$6 = caml_check_bound(vm[1], I)[I + 1];
            push(vm, v$6);
            break;
           case 16:
            var
             slot$0 = read_u8(frame),
             v$7 = peek(vm),
             match$2 = Stdlib_Hashtbl[7].call(null, frame[4], slot$0);
            if(match$2){
             var cell$0 = match$2[1];
             cell$0[1] = v$7;
            }
            else{
             var J = frame[3] + slot$0 | 0;
             caml_check_bound(vm[1], J)[J + 1] = v$7;
            }
            break;
           case 17:
            var idx$1 = read_u8(frame);
            push(vm, caml_check_bound(frame[1][2], idx$1)[idx$1 + 1][1]);
            break;
           case 18:
            var idx$2 = read_u8(frame), S = peek(vm);
            caml_check_bound(frame[1][2], idx$2)[idx$2 + 1][1] = S;
            break;
           case 19:
            var
             idx$3 = read_u16(frame),
             match$3 = caml_check_bound(frame[1][1][5], idx$3)[idx$3 + 1];
            if(typeof match$3 === "number" || ! (3 === match$3[0]))
             var name$0 = cst$1;
            else
             var s$1 = match$3[1], name$0 = s$1;
            try{
             var aa = Stdlib_Hashtbl[6].call(null, vm[4], name$0), v$8 = aa;
            }
            catch(exn){
             var exn$0 = caml_wrap_exception(exn);
             if(exn$0 !== Stdlib[8])
              throw caml_maybe_attach_backtrace(exn$0, 0);
             try{var $ = Sx_primitives[15].call(null, name$0), v$8 = $;}
             catch(exn){
              var _ = Stdlib[28].call(null, cst_VM_undefined, name$0);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], _], 1);
             }
            }
            push(vm, v$8);
            break;
           case 20:
            var
             idx$4 = read_u16(frame),
             match$4 = caml_check_bound(frame[1][1][5], idx$4)[idx$4 + 1];
            if(typeof match$4 === "number" || ! (3 === match$4[0]))
             var name$1 = cst$1;
            else
             var s$2 = match$4[1], name$1 = s$2;
            var ab = peek(vm);
            Stdlib_Hashtbl[11].call(null, vm[4], name$1, ab);
            break;
           case 31:
            var offset = read_i16(frame);
            frame[2] = frame[2] + offset | 0;
            break;
           case 32:
            var offset$0 = read_i16(frame), v$9 = pop(vm);
            if(1 - Sx_types[71].call(null, v$9))
             frame[2] = frame[2] + offset$0 | 0;
            break;
           case 33:
            var offset$1 = read_i16(frame), v$10 = pop(vm);
            if(Sx_types[71].call(null, v$10))
             frame[2] = frame[2] + offset$1 | 0;
            break;
           case 34:
            var
             catch_offset = read_i16(frame),
             ac = vm[6],
             ad = vm[2],
             ae = Stdlib_List[1].call(null, vm[3]);
            vm[6] = [0, [0, frame[2] + catch_offset | 0, ae, ad, frame], ac];
            break;
           case 35:
            var match$5 = vm[6];
            if(match$5){var r = match$5[2]; vm[6] = r;}
            break;
           case 36:
            var exn_val = pop(vm), match$6 = vm[6];
            if(match$6){
             var rest = match$6[2], entry$0 = match$6[1];
             vm[6] = rest;
             for(;;){
              var af = entry$0[2];
              if(af >= Stdlib_List[1].call(null, vm[3])){
               vm[2] = entry$0[3];
               entry$0[4][2] = entry$0[1];
               push(vm, exn_val);
               break;
              }
              var match$7 = vm[3];
              if(match$7){var fs = match$7[2]; vm[3] = fs;}
             }
            }
            else
             vm[3] = 0;
            break;
           case 47:
            var
             argc = read_u8(frame),
             args =
               Stdlib_Array[1].call
                (null, argc, function(param){return pop(vm);}),
             f$0 = pop(vm),
             ag = Stdlib_Array[10].call(null, args);
            vm_call(vm, f$0, Stdlib_List[10].call(null, ag));
            break;
           case 48:
            var
             argc$0 = read_u8(frame),
             args$0 =
               Stdlib_Array[1].call
                (null, argc$0, function(param){return pop(vm);}),
             f$1 = pop(vm);
            vm[3] = rest_frames;
            vm[2] = frame[3];
            var ah = Stdlib_Array[10].call(null, args$0);
            vm_call(vm, f$1, Stdlib_List[10].call(null, ah));
            break;
           case 49:
            var result = pop(vm);
            vm[3] = rest_frames;
            vm[2] = frame[3];
            push(vm, result);
            break;
           case 50:
            var
             idx$5 = read_u16(frame),
             code_val2 = caml_check_bound(frame[1][1][5], idx$5)[idx$5 + 1];
            a:
            {
             if(typeof code_val2 !== "number" && 7 === code_val2[0]){
              var
               d = code_val2[1],
               match$8 = Stdlib_Hashtbl[7].call(null, d, cst_upvalue_count);
              if(match$8){
               var match$9 = match$8[1];
               if(typeof match$9 !== "number")
                switch(match$9[0]){
                  case 1:
                   var n$0 = match$9[1], uv_count = n$0; break a;
                  case 2:
                   var n$1 = match$9[1], uv_count = n$1 | 0; break a;
                }
              }
              var uv_count = 0;
              break a;
             }
             var uv_count = 0;
            }
            let frame$0 = frame;
            var
             upvalues =
               Stdlib_Array[1].call
                (null,
                 uv_count,
                 function(param){
                  var is_local = read_u8(frame$0), index = read_u8(frame$0);
                  if(1 !== is_local)
                   return caml_check_bound(frame$0[1][2], index)[index + 1];
                  var match = Stdlib_Hashtbl[7].call(null, frame$0[4], index);
                  if(match)
                   var existing = match[1], cell = existing;
                  else{
                   var
                    a = frame$0[3] + index | 0,
                    c = [0, caml_check_bound(vm[1], a)[a + 1]];
                   Stdlib_Hashtbl[11].call(null, frame$0[4], index, c);
                   var cell = c;
                  }
                  return cell;
                 }),
             inner_code = code_from_value(code_val2),
             c$0 = [0, inner_code, upvalues, 0, vm[4], frame[1][5]];
            push(vm, [24, c$0]);
            break;
           case 51:
            var
             idx$6 = read_u16(frame),
             argc$1 = read_u8(frame),
             match$10 = caml_check_bound(frame[1][1][5], idx$6)[idx$6 + 1];
            if(typeof match$10 === "number" || ! (3 === match$10[0]))
             var name$2 = cst$1;
            else
             var s$3 = match$10[1], name$2 = s$3;
            var
             ai =
               Stdlib_List[11].call
                (null, argc$1, function(param){return pop(vm);}),
             args$1 = Stdlib_List[10].call(null, ai);
            try{var al = Sx_primitives[15].call(null, name$2), fn_val = al;}
            catch(exn){
             try{
              var
               ak = Stdlib_Hashtbl[6].call(null, vm[4], name$2),
               fn_val = ak;
             }
             catch(exn){
              var exn$1 = caml_wrap_exception(exn);
              if(exn$1 !== Stdlib[8])
               throw caml_maybe_attach_backtrace(exn$1, 0);
              var
               aj = Stdlib[28].call(null, cst_VM_unknown_primitive, name$2);
              throw caml_maybe_attach_backtrace([0, Sx_types[9], aj], 1);
             }
            }
            if(typeof fn_val !== "number" && 15 === fn_val[0]){
             var fn = fn_val[2];
             push(vm, caml_call1(fn, args$1));
             break;
            }
            push(vm, 0);
            break;
           case 63:
            var
             count$0 = read_u16(frame),
             am =
               Stdlib_List[11].call
                (null, count$0, function(param){return pop(vm);}),
             items = Stdlib_List[10].call(null, am);
            push(vm, [6, items]);
            break;
           case 64:
            var
             count$1 = read_u16(frame),
             d$0 = Stdlib_Hashtbl[1].call(null, 0, count$1);
            if(count$1 >= 1){
             var for$ = 1;
             for(;;){
              var v$11 = pop(vm), k = pop(vm);
              a:
              {
               if(typeof k !== "number")
                switch(k[0]){
                  case 3:
                  case 5:
                   var s$4 = k[1], key = s$4; break a;
                }
               var key = Sx_runtime[3].call(null, k);
              }
              Stdlib_Hashtbl[11].call(null, d$0, key, v$11);
              var an = for$ + 1 | 0;
              if(count$1 === for$) break;
              for$ = an;
             }
            }
            push(vm, [7, d$0]);
            break;
         }
        continue;
       }
       catch(e){vm[3] = 0; continue;}
      }
      break;
     }
    }
    catch(exn){}
    return [6, Stdlib_List[10].call(null, trace[1])];
   }
   function disassemble(code){
    var
     bc = code[4],
     len = bc.length - 1,
     consts = code[5],
     ip$3 = 0,
     instrs = 0;
    for(;;){
     if(ip$3 >= len) break;
     var
      op = caml_check_bound(bc, ip$3)[ip$3 + 1],
      ip = ip$3 + 1 | 0,
      name = opcode_name(op);
     a:
     {
      var operands = 0;
      b:
      {
       if(35 <= op){
        if(128 !== op){
         if(66 <= op){
          if(144 === op) break b;
          var operands$1 = operands, ip$4 = ip;
          break a;
         }
         if(48 > op){var operands$1 = operands, ip$4 = ip; break a;}
         switch(op - 48 | 0){
           case 4:
            if((ip + 2 | 0) >= len){
             var operands$1 = operands, ip$4 = ip;
             break a;
            }
            var
             lo$1 = caml_check_bound(bc, ip)[ip + 1],
             e = ip + 1 | 0,
             hi$1 = caml_check_bound(bc, e)[e + 1],
             idx$1 = lo$1 | hi$1 << 8,
             f = ip + 2 | 0,
             argc = caml_check_bound(bc, f)[f + 1],
             ip$2 = ip + 3 | 0;
            if(idx$1 < consts.length - 1){
             var match$2 = caml_check_bound(consts, idx$1)[idx$1 + 1];
             if(typeof match$2 === "number" || ! (3 === match$2[0]))
              var prim_name = cst;
             else
              var s = match$2[1], prim_name = s;
            }
            else
             var prim_name = cst;
            var
             operands$1 =
               [0, [2, idx$1], [0, [3, prim_name], [0, [2, argc], 0]]],
             ip$4 = ip$2;
            break a;
           case 0:
           case 1:
            break b;
           case 3:
           case 16:
           case 17:
            if((ip + 1 | 0) >= len){
             var operands$1 = operands, ip$4 = ip;
             break a;
            }
            var
             lo$0 = caml_check_bound(bc, ip)[ip + 1],
             b = ip + 1 | 0,
             hi$0 = caml_check_bound(bc, b)[b + 1],
             idx$0 = lo$0 | hi$0 << 8,
             ip$1 = ip + 2 | 0,
             c = 51 === op,
             i = c ? idx$0 < consts.length - 1 : c,
             operands$0 = [0, [2, idx$0], 0];
            if(! i){var operands$1 = operands$0, ip$4 = ip$1; break a;}
            var match = caml_check_bound(consts, idx$0)[idx$0 + 1];
            c:
            {
             if(typeof match !== "number" && 7 === match[0]){
              var
               d = match[1],
               match$0 = Stdlib_Hashtbl[7].call(null, d, cst_upvalue_count);
              if(match$0){
               var match$1 = match$0[1];
               if(typeof match$1 !== "number")
                switch(match$1[0]){
                  case 1:
                   var n = match$1[1], uv_count = n; break c;
                  case 2:
                   var n$0 = match$1[1], uv_count = n$0 | 0; break c;
                }
              }
              var uv_count = 0;
              break c;
             }
             var uv_count = 0;
            }
            var operands$1 = operands$0, ip$4 = ip$1 + (uv_count * 2 | 0) | 0;
            break a;
           default: var operands$1 = operands, ip$4 = ip; break a;
         }
        }
       }
       else if(16 <= op){
        if(22 <= op){
         if(32 > op){var operands$1 = operands, ip$4 = ip; break a;}
         if((ip + 1 | 0) < len){
          var
           lo$2 = caml_check_bound(bc, ip)[ip + 1],
           g = ip + 1 | 0,
           hi$2 = caml_check_bound(bc, g)[g + 1],
           raw = lo$2 | hi$2 << 8,
           signed = 32768 <= raw ? raw - 65536 | 0 : raw,
           operands$1 = [0, [2, signed], 0],
           ip$4 = ip + 2 | 0;
          break a;
         }
         var operands$1 = operands, ip$4 = ip;
         break a;
        }
        if(20 > op) break b;
       }
       else if(1 !== op){var operands$1 = operands, ip$4 = ip; break a;}
       if((ip + 1 | 0) >= len){var operands$1 = operands, ip$4 = ip; break a;}
       var
        lo = caml_check_bound(bc, ip)[ip + 1],
        a = ip + 1 | 0,
        hi = caml_check_bound(bc, a)[a + 1],
        idx = lo | hi << 8,
        ip$0 = ip + 2 | 0;
       if(idx < consts.length - 1)
        var
         h = caml_check_bound(consts, idx)[idx + 1],
         const_str = Sx_types[117].call(null, h);
       else
        var const_str = cst;
       var operands$1 = [0, [2, idx], [0, [3, const_str], 0]], ip$4 = ip$0;
       break a;
      }
      if(ip < len)
       var
        v = caml_check_bound(bc, ip)[ip + 1],
        operands$1 = [0, [2, v], 0],
        ip$4 = ip + 1 | 0;
      else
       var operands$1 = operands, ip$4 = ip;
     }
     var entry = Stdlib_Hashtbl[1].call(null, 0, 4);
     Stdlib_Hashtbl[11].call(null, entry, "offset", [2, ip$3]);
     Stdlib_Hashtbl[11].call(null, entry, cst_opcode, [3, name]);
     Stdlib_Hashtbl[11].call(null, entry, "operands", [6, operands$1]);
     ip$3 = ip$4;
     instrs = [0, [7, entry], instrs];
    }
    var result = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, result, cst_arity, [2, code[1]]);
    Stdlib_Hashtbl[11].call(null, result, "num_locals", [2, code[3]]);
    var
     j =
       Stdlib_Array[14].call
        (null, function(v){return [3, Sx_types[117].call(null, v)];}, consts),
     k = [6, Stdlib_Array[10].call(null, j)];
    Stdlib_Hashtbl[11].call(null, result, cst_constants, k);
    var l = [6, Stdlib_List[10].call(null, instrs)];
    Stdlib_Hashtbl[11].call(null, result, cst_bytecode, l);
    return [7, result];
   }
   runtime.caml_register_global
    (247,
     [0,
      VmSuspended,
      Invalid_opcode,
      jit_compile_ref,
      extension_dispatch_ref,
      extension_opcode_name_ref,
      jit_failed_sentinel,
      is_jit_failed,
      active_vm,
      create,
      push,
      pop,
      peek,
      read_u8,
      read_u16,
      read_i16,
      closure_to_value,
      parse_keyword_args,
      vm_comp_jit_count,
      vm_comp_cek_count,
      vm_insn_count,
      vm_call_count,
      vm_cek_count,
      vm_reset_counters,
      vm_report_counters,
      jit_compiling,
      push_closure_frame,
      code_from_value,
      jit_compile_comp,
      cek_call_or_suspend,
      call_closure,
      call_closure_reuse,
      vm_call,
      run,
      resume_vm,
      execute_module,
      execute_module_safe,
      jit_is_broken_name,
      bytecode_find_opcode,
      bytecode_uses_extension_opcode,
      code_uses_handler,
      code_refs_escaping_caller,
      jit_compile_lambda,
      opcode_name,
      opcode_operand_size,
      trace_run,
      disassemble],
     "Sx_vm");
   return;
  }
  (globalThis));

//# 32147 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_vm_ref:[F(2),F(2),F(1),F(1)*,N,F(2),F(1),F(1),F(1),F(1)*,F(1)*,F(2),F(1)*,F(1)*,F(2)*,F(4),F(5),F(2),F(1),F(2),F(1),F(1),F(1),F(1),F(1),F(3),F(4),F(2),F(3),F(1),F(2),F(1),F(1),F(1),F(1),F(1)*,F(1),F(1),F(1),F(1),F(2),F(1),F(2)*,F(1),F(2),F(1),F(3),F(4),F(3),F(1)*,F(3),N,F(1)*,F(1)*,F(1)*,F(2),F(1)*,F(3),F(2),F(3),N,N,N,F(3),F(3),F(2),F(2),F(2),F(3),F(2),F(3),F(1),F(5),F(2),F(2),F(1),F(3),F(1),N,N,F(1)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_check_bound = runtime.caml_check_bound,
    caml_make_vect = runtime.caml_make_vect,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Sx_types = global_data.Sx_types,
    Sx_runtime = global_data.Sx_runtime,
    Stdlib_List = global_data.Stdlib__List,
    Sx_vm = global_data.Sx_vm,
    Sx_ref = global_data.Sx_ref,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib = global_data.Stdlib,
    cek_call = Sx_ref[222],
    eval_expr = Sx_ref[242];
   function trampoline(v){
    if(typeof v !== "number" && 12 === v[0]){
     var env = v[2], expr = v[1];
     return Sx_ref[242].call(null, expr, [20, env]);
    }
    return v;
   }
   function to_ocaml_list(v){
    if(typeof v === "number"){if(0 === v) return 0;}
    else if(6 === v[0]){var l = v[1]; return l;}
    return [0, v, 0];
   }
   var
    str =
      [15, "str", function(args){return [3, Sx_runtime[5].call(null, args)];}];
   function call_primitive(name, args){
    var n = Sx_types[35].call(null, name), a = to_ocaml_list(args);
    return Sx_runtime[2].call(null, n, a);
   }
   function unwrap_vm(v){
    if(typeof v !== "number" && 26 === v[0]){var m = v[1]; return m;}
    throw caml_maybe_attach_backtrace([0, Sx_types[9], "not a vm"], 1);
   }
   function unwrap_frame(v){
    if(typeof v !== "number" && 25 === v[0]){var f = v[1]; return f;}
    throw caml_maybe_attach_backtrace([0, Sx_types[9], "not a frame"], 1);
   }
   function unwrap_closure(v){
    if(typeof v !== "number" && 24 === v[0]){var c = v[1]; return c;}
    throw caml_maybe_attach_backtrace([0, Sx_types[9], "not a closure"], 1);
   }
   function make_uv_cell(v){return [0, v];}
   function uv_get(c){return c[1];}
   function uv_set(c, v){c[1] = v; return 0;}
   function make_upvalue_cell(v){return 0;}
   function uv_get$0(param){return 0;}
   function uv_set_b(a, param){return 0;}
   function code_from_value(v){return Sx_vm[27].call(null, v);}
   function make_vm_code(arity, locals, bytecode, constants){
    var d = Stdlib_Hashtbl[1].call(null, 0, 4);
    Stdlib_Hashtbl[11].call(null, d, "arity", arity);
    Stdlib_Hashtbl[11].call(null, d, "bytecode", bytecode);
    Stdlib_Hashtbl[11].call(null, d, "constants", constants);
    return [7, d];
   }
   function make_vm_closure(code, upvalues, name, globals, closure_env){
    a:
    {
     if(typeof upvalues !== "number" && 6 === upvalues[0]){
      var
       l = upvalues[1],
       f = Stdlib_List[20].call(null, function(v){return [0, v];}, l),
       uv = Stdlib_Array[11].call(null, f);
      break a;
     }
     var uv = [0];
    }
    a:
    {
     if(typeof closure_env !== "number" && 20 === closure_env[0]){var e = closure_env[1], b = [0, e]; break a;}
     var b = 0;
    }
    a:
    {
     if(typeof globals !== "number" && 7 === globals[0]){var d = globals[1], c = d; break a;}
     var c = Stdlib_Hashtbl[1].call(null, 0, 0);
    }
    a:
    {
     if(typeof name === "number"){
      if(0 === name){var a = 0; break a;}
     }
     else if(3 === name[0]){var s = name[1], a = [0, s]; break a;}
     var a = 0;
    }
    return [24, [0, code_from_value(code), uv, a, c, b]];
   }
   function make_vm_frame(closure, base){
    var cl = unwrap_closure(closure), a = Stdlib_Hashtbl[1].call(null, 0, 4);
    return [25, [0, cl, 0, Sx_types[94].call(null, base), a]];
   }
   function make_vm(globals){
    a:
    {
     if(typeof globals !== "number" && 7 === globals[0]){var d = globals[1], g = d; break a;}
     var g = Stdlib_Hashtbl[1].call(null, 0, 0);
    }
    return [26, [0, caml_make_vect(4096, 0), 0, 0, g, 0]];
   }
   function vm_push(vm_val, v){
    var m = unwrap_vm(vm_val);
    if(m[1].length - 1 <= m[2]){
     var ns = caml_make_vect(m[2] * 2 | 0, 0);
     Stdlib_Array[9].call(null, m[1], 0, ns, 0, m[2]);
     m[1] = ns;
    }
    var a = m[2];
    caml_check_bound(m[1], a)[a + 1] = v;
    m[2] = m[2] + 1 | 0;
    return 0;
   }
   function vm_pop(vm_val){
    var m = unwrap_vm(vm_val);
    m[2] = m[2] - 1 | 0;
    var a = m[2];
    return caml_check_bound(m[1], a)[a + 1];
   }
   function vm_peek(vm_val){
    var m = unwrap_vm(vm_val), a = m[2] - 1 | 0;
    return caml_check_bound(m[1], a)[a + 1];
   }
   function frame_read_u8(frame_val){
    var
     f = unwrap_frame(frame_val),
     a = f[2],
     v = caml_check_bound(f[1][1][4], a)[a + 1];
    f[2] = f[2] + 1 | 0;
    return [2, v];
   }
   function frame_read_u16(frame_val){
    var
     f = unwrap_frame(frame_val),
     a = f[2],
     lo = caml_check_bound(f[1][1][4], a)[a + 1],
     b = f[2] + 1 | 0,
     hi = caml_check_bound(f[1][1][4], b)[b + 1];
    f[2] = f[2] + 2 | 0;
    return [2, lo | hi << 8];
   }
   function frame_read_i16(frame_val){
    var
     f = unwrap_frame(frame_val),
     a = f[2],
     lo = caml_check_bound(f[1][1][4], a)[a + 1],
     b = f[2] + 1 | 0,
     hi = caml_check_bound(f[1][1][4], b)[b + 1];
    f[2] = f[2] + 2 | 0;
    var v = lo | hi << 8, c = 32768 <= v ? v - 65536 | 0 : v;
    return [2, c];
   }
   function frame_local_get(vm_val, frame_val, slot){
    var
     m = unwrap_vm(vm_val),
     f = unwrap_frame(frame_val),
     a = Sx_types[94].call(null, slot),
     idx = f[3] + a | 0,
     b = Sx_types[94].call(null, slot),
     match = Stdlib_Hashtbl[7].call(null, f[4], b);
    if(! match) return caml_check_bound(m[1], idx)[idx + 1];
    var cell = match[1];
    return cell[1];
   }
   function frame_local_set(vm_val, frame_val, slot, v){
    var
     m = unwrap_vm(vm_val),
     f = unwrap_frame(frame_val),
     s = Sx_types[94].call(null, slot),
     match = Stdlib_Hashtbl[7].call(null, f[4], s);
    if(match){
     var cell = match[1];
     cell[1] = v;
    }
    else{var a = f[3] + s | 0; caml_check_bound(m[1], a)[a + 1] = v;}
    return 0;
   }
   function frame_upvalue_get(frame_val, idx){
    var f = unwrap_frame(frame_val), a = Sx_types[94].call(null, idx);
    return caml_check_bound(f[1][2], a)[a + 1][1];
   }
   function frame_upvalue_set(frame_val, idx, v){
    var f = unwrap_frame(frame_val), a = Sx_types[94].call(null, idx);
    caml_check_bound(f[1][2], a)[a + 1][1] = v;
    return 0;
   }
   function frame_ip(f){var fr = unwrap_frame(f); return [2, fr[2]];}
   function frame_set_ip_b(f, v){
    var fr = unwrap_frame(f);
    fr[2] = Sx_types[94].call(null, v);
    return 0;
   }
   function frame_base(f){var fr = unwrap_frame(f); return [2, fr[3]];}
   function frame_closure(f){var fr = unwrap_frame(f); return [24, fr[1]];}
   var
    cst_vc_bytecode = "vc-bytecode",
    cst_vc_constants = "vc-constants",
    cst_vc_locals = "vc-locals";
   function closure_code(cl){
    var
     c = unwrap_closure(cl),
     d = Stdlib_Hashtbl[1].call(null, 0, 4),
     a = Stdlib_Array[14].call(null, function(i){return [2, i];}, c[1][4]),
     b = [6, Stdlib_Array[10].call(null, a)];
    Stdlib_Hashtbl[11].call(null, d, cst_vc_bytecode, b);
    var e = [6, Stdlib_Array[10].call(null, c[1][5])];
    Stdlib_Hashtbl[11].call(null, d, cst_vc_constants, e);
    Stdlib_Hashtbl[11].call(null, d, "vc-arity", [2, c[1][1]]);
    Stdlib_Hashtbl[11].call(null, d, cst_vc_locals, [2, c[1][3]]);
    return [7, d];
   }
   function closure_upvalues(cl){
    var
     c = unwrap_closure(cl),
     a = Stdlib_Array[14].call(null, function(cell){return cell[1];}, c[2]);
    return [6, Stdlib_Array[10].call(null, a)];
   }
   function closure_env(cl){
    if(typeof cl !== "number" && 24 === cl[0]){
     var c = cl[1], match = c[5];
     if(! match) return 0;
     var e = match[1];
     return [20, e];
    }
    return 0;
   }
   var a = [3, cst_vc_bytecode];
   function code_bytecode(code){return Sx_runtime[13].call(null, code, a);}
   var b = [3, cst_vc_constants];
   function code_constants(code){return Sx_runtime[13].call(null, code, b);}
   var c = [3, cst_vc_locals];
   function code_locals(code){return Sx_runtime[13].call(null, code, c);}
   function vm_sp(v){var m = unwrap_vm(v); return [2, m[2]];}
   function vm_set_sp_b(v, s){
    var m = unwrap_vm(v);
    m[2] = Sx_types[94].call(null, s);
    return 0;
   }
   function vm_stack(v){unwrap_vm(v); return 0;}
   function vm_set_stack_b(v, s){return 0;}
   function vm_frames(v){
    var m = unwrap_vm(v);
    return [6, Stdlib_List[20].call(null, function(f){return [25, f];}, m[3])];
   }
   function vm_set_frames_b(v, fs){
    var m = unwrap_vm(v);
    a:
    {
     if(typeof fs !== "number" && 6 === fs[0]){
      var l = fs[1], a = Stdlib_List[20].call(null, unwrap_frame, l);
      break a;
     }
     var a = 0;
    }
    m[3] = a;
    return 0;
   }
   function vm_globals_ref(v){var m = unwrap_vm(v); return [7, m[4]];}
   var cst_VM_undefined = "VM undefined: ";
   function vm_global_get(vm_val, frame_val, name){
    var
     m = unwrap_vm(vm_val),
     n = Sx_types[35].call(null, name),
     f = unwrap_frame(frame_val),
     match = f[1][5];
    if(match){
     var env = match[1], id = Sx_types[4].call(null, n), e = env;
     for(;;){
      var match$0 = Stdlib_Hashtbl[7].call(null, e[1], id);
      if(match$0){var v = match$0[1], found_in_env = [0, v]; break;}
      var match$1 = e[2];
      if(! match$1){var found_in_env = 0; break;}
      var p = match$1[1];
      e = p;
     }
    }
    else
     var found_in_env = 0;
    if(found_in_env){var v$0 = found_in_env[1]; return v$0;}
    var match$2 = Stdlib_Hashtbl[7].call(null, m[4], n);
    if(match$2){var v$1 = match$2[1]; return v$1;}
    try{var c = Sx_runtime[2].call(null, n, 0); return c;}
    catch(exn){
     var match$3 = Sx_types[25][1];
     if(! match$3){
      var b = Stdlib[28].call(null, cst_VM_undefined, n);
      throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
     }
     var hook = match$3[1], match$4 = caml_call1(hook, n);
     if(match$4){var v$2 = match$4[1]; return v$2;}
     var a = Stdlib[28].call(null, cst_VM_undefined, n);
     throw caml_maybe_attach_backtrace([0, Sx_types[9], a], 1);
    }
   }
   function vm_global_set(vm_val, frame_val, name, v){
    var
     m = unwrap_vm(vm_val),
     n = Sx_types[35].call(null, name),
     f = unwrap_frame(frame_val),
     match = f[1][5];
    if(match){
     var env = match[1], id = Sx_types[4].call(null, n), e = env;
     for(;;){
      if(Stdlib_Hashtbl[9].call(null, e[1], id)){
       Stdlib_Hashtbl[11].call(null, e[1], id, v);
       var written = 1;
       break;
      }
      var match$0 = e[2];
      if(! match$0){var written = 0; break;}
      var p = match$0[1];
      e = p;
     }
    }
    else
     var written = 0;
    if(1 - written){
     Stdlib_Hashtbl[11].call(null, m[4], n, v);
     var match$1 = Sx_types[23][1];
     if(match$1){var f$0 = match$1[1]; caml_call2(f$0, n, v);}
    }
    return 0;
   }
   function vm_push_frame(vm_val, closure_val, args){
    var
     m = unwrap_vm(vm_val),
     cl = unwrap_closure(closure_val),
     d = Stdlib_Hashtbl[1].call(null, 0, 4),
     f = [0, cl, 0, m[2], d],
     arg_list = to_ocaml_list(args);
    Stdlib_List[18].call
     (null,
      function(a){
       var b = m[2];
       caml_check_bound(m[1], b)[b + 1] = a;
       m[2] = m[2] + 1 | 0;
       return 0;
      },
      arg_list);
    var a = Stdlib_List[1].call(null, arg_list), b = cl[1][3] - 1 | 0;
    if(b >= a){
     var for$ = a;
     for(;;){
      var c = m[2];
      caml_check_bound(m[1], c)[c + 1] = 0;
      m[2] = m[2] + 1 | 0;
      var e = for$ + 1 | 0;
      if(b === for$) break;
      for$ = e;
     }
    }
    m[3] = [0, f, m[3]];
    return 0;
   }
   var d = [0, 0], e = [0, 1];
   function vm_closure_p(v){
    if(typeof v !== "number" && 24 === v[0]) return e;
    return d;
   }
   function vm_create_closure(vm_val, frame_val, code_val){
    var m = unwrap_vm(vm_val), f = unwrap_frame(frame_val);
    a:
    {
     if(typeof code_val !== "number" && 7 === code_val[0]){
      var
       d = code_val[1],
       match = Stdlib_Hashtbl[7].call(null, d, "upvalue-count");
      if(match){
       var match$0 = match[1];
       if(typeof match$0 !== "number")
        switch(match$0[0]){
          case 1:
           var n = match$0[1], uv_count = n; break a;
          case 2:
           var n$0 = match$0[1], uv_count = n$0 | 0; break a;
        }
      }
      var uv_count = 0;
      break a;
     }
     var uv_count = 0;
    }
    var
     upvalues =
       Stdlib_Array[1].call
        (null,
         uv_count,
         function(param){
          var a = f[2], is_local = caml_check_bound(f[1][1][4], a)[a + 1];
          f[2] = f[2] + 1 | 0;
          var b = f[2], index = caml_check_bound(f[1][1][4], b)[b + 1];
          f[2] = f[2] + 1 | 0;
          if(1 !== is_local)
           return caml_check_bound(f[1][2], index)[index + 1];
          var match = Stdlib_Hashtbl[7].call(null, f[4], index);
          if(match){var existing = match[1]; return existing;}
          var d = f[3] + index | 0, c = [0, caml_check_bound(m[1], d)[d + 1]];
          Stdlib_Hashtbl[11].call(null, f[4], index, c);
          return c;
         }),
     code = code_from_value(code_val);
    return [24, [0, code, upvalues, 0, m[4], f[1][5]]];
   }
   var
    jit_failed_sentinel =
      [0,
       [0, -1, -1, 0, [0], [0], 0, 0],
       [0],
       [0, "__jit_failed__"],
       Stdlib_Hashtbl[1].call(null, 0, 0),
       0];
   function is_jit_failed(cl){return -1 === cl[1][1] ? 1 : 0;}
   var f = [0, 0], g = [0, 1];
   function is_lambda(v){
    if(typeof v !== "number" && 8 === v[0]) return g;
    return f;
   }
   function lambda_compiled(v){
    if(typeof v !== "number" && 8 === v[0]){
     var l = v[1], match = l[5];
     if(! match) return 0;
     var c = match[1];
     return [24, c];
    }
    return 0;
   }
   function lambda_set_compiled_b(v, c){
    if(typeof v !== "number" && 8 === v[0]){
     var l = v[1];
     if(typeof c !== "number")
      switch(c[0]){
        case 3:
         if(c[1] === "jit-failed"){l[5] = [0, jit_failed_sentinel]; return 0;}
         break;
        case 24:
         var cl = c[1]; l[5] = [0, cl]; return 0;
      }
     l[5] = 0;
     return 0;
    }
    return 0;
   }
   function lambda_name(v){
    if(typeof v !== "number" && 8 === v[0]){
     var l = v[1], match = l[4];
     if(! match) return 0;
     var n = match[1];
     return [3, n];
    }
    return 0;
   }
   var
    cst_request = "request",
    h = [6, 0],
    i = [3, "phase"],
    j = [3, cst_request];
   function cek_call_or_suspend(vm_val, f, args){
    var
     a = to_ocaml_list(args),
     b = [20, Sx_types[20].call(null, 0)],
     state = Sx_ref[237].call(null, f, [6, a], b, [6, a], h),
     final = Sx_ref[156].call(null, state),
     match = Sx_runtime[13].call(null, final, i);
    if
     (typeof match !== "number"
      && 3 === match[0] && match[1] === "io-suspended"){
     var m = unwrap_vm(vm_val);
     m[5] = [0, final];
     var
      c = Sx_vm[9].call(null, m[4]),
      d = Sx_runtime[13].call(null, final, j);
     throw caml_maybe_attach_backtrace([0, Sx_vm[1], d, c], 1);
    }
    return Sx_ref[18].call(null, final);
   }
   function env_walk(env, name){
    if(typeof env === "number"){if(0 === env) return 0;}
    else if(20 === env[0]){
     var
      e = env[1],
      a = Sx_types[35].call(null, name),
      id = Sx_types[4].call(null, a),
      e$0 = e;
     for(;;){
      var match = Stdlib_Hashtbl[7].call(null, e$0[1], id);
      if(match){var v = match[1]; return v;}
      var match$0 = e$0[2];
      if(! match$0) return 0;
      var p = match$0[1];
      e$0 = p;
     }
    }
    return 0;
   }
   function env_walk_set_b(env, name, value){
    if(typeof env !== "number" && 20 === env[0]){
     var
      e = env[1],
      b = Sx_types[35].call(null, name),
      id = Sx_types[4].call(null, b),
      e$0 = e;
     for(;;){
      if(Stdlib_Hashtbl[9].call(null, e$0[1], id)){
       Stdlib_Hashtbl[11].call(null, e$0[1], id, value);
       var a = 1;
      }
      else{
       var match = e$0[2];
       if(match){var p = match[1]; e$0 = p; continue;}
       var a = 0;
      }
      return a ? 0 : 0;
     }
    }
    return 0;
   }
   var
    vm_run_fn = [0, function(param){return 0;}],
    vm_call_fn = [0, function(b, a, param){return 0;}],
    active_vm = [0, 0];
   function vm_call_closure(closure_val, args, globals){
    unwrap_closure(closure_val);
    var prev_vm = active_vm[1];
    a:
    {
     if(typeof globals !== "number" && 7 === globals[0]){var d = globals[1], g = d; break a;}
     var g = Stdlib_Hashtbl[1].call(null, 0, 0);
    }
    var m = [0, caml_make_vect(4096, 0), 0, 0, g, 0];
    active_vm[1] = [0, m];
    var vm_val = [26, m];
    vm_push_frame(vm_val, closure_val, args);
    try{caml_call1(vm_run_fn[1], vm_val);}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     active_vm[1] = prev_vm;
     throw caml_maybe_attach_backtrace(e, 0);
    }
    active_vm[1] = prev_vm;
    return vm_pop(vm_val);
   }
   function try_jit_call(vm_val, f, args){
    var m = unwrap_vm(vm_val);
    if(typeof f !== "number" && 8 === f[0]){
     var l = f[1], match = l[5];
     if(match){
      var cl = match[1];
      if(is_jit_failed(cl))
       return vm_push(vm_val, cek_call_or_suspend(vm_val, f, args));
      try{
       var a = vm_push(vm_val, vm_call_closure([24, cl], args, [7, cl[4]]));
       return a;
      }
      catch(exn){return vm_push(vm_val, cek_call_or_suspend(vm_val, f, args));
      }
     }
     if(0 === l[4])
      return vm_push(vm_val, cek_call_or_suspend(vm_val, f, args));
     l[5] = [0, jit_failed_sentinel];
     var match$0 = caml_call2(Sx_vm[3][1], l, m[4]);
     if(! match$0)
      return vm_push(vm_val, cek_call_or_suspend(vm_val, f, args));
     var cl$0 = match$0[1];
     l[5] = [0, cl$0];
     try{
      var
       b = vm_push(vm_val, vm_call_closure([24, cl$0], args, [7, cl$0[4]]));
      return b;
     }
     catch(exn){return vm_push(vm_val, cek_call_or_suspend(vm_val, f, args));}
    }
    return vm_push(vm_val, cek_call_or_suspend(vm_val, f, args));
   }
   function collect_n_from_stack(vm_val, n){
    var m = unwrap_vm(vm_val), count = Sx_types[94].call(null, n), a = 0;
    if(count < 1)
     var result$0 = a;
    else{
     var result = a, for$ = 1;
     for(;;){
      m[2] = m[2] - 1 | 0;
      var
       b = m[2],
       c = [0, caml_check_bound(m[1], b)[b + 1], result],
       d = for$ + 1 | 0;
      if(count === for$){var result$0 = c; break;}
      result = c;
      for$ = d;
     }
    }
    return [6, result$0];
   }
   function collect_n_pairs(vm_val, n){
    var
     m = unwrap_vm(vm_val),
     count = Sx_types[94].call(null, n),
     d = Stdlib_Hashtbl[1].call(null, 0, count);
    if(count >= 1){
     var for$ = 1;
     for(;;){
      m[2] = m[2] - 1 | 0;
      var a = m[2], v = caml_check_bound(m[1], a)[a + 1];
      m[2] = m[2] - 1 | 0;
      var
       b = m[2],
       c = caml_check_bound(m[1], b)[b + 1],
       k = Sx_types[35].call(null, c);
      Stdlib_Hashtbl[11].call(null, d, k, v);
      var e = for$ + 1 | 0;
      if(count === for$) break;
      for$ = e;
     }
    }
    return [7, d];
   }
   function pad_n_nils(vm_val, n){
    var m = unwrap_vm(vm_val), count = Sx_types[94].call(null, n);
    if(count >= 1){
     var for$ = 1;
     for(;;){
      var a = m[2];
      caml_check_bound(m[1], a)[a + 1] = 0;
      m[2] = m[2] + 1 | 0;
      var b = for$ + 1 | 0;
      if(count === for$) break;
      for$ = b;
     }
    }
    return 0;
   }
   var
    cst = "=",
    k = [0, [3, "component"], 0],
    l = [3, "VM: not callable: "],
    m = [0, [3, "island"], 0];
   function vm_call(vm, f, args){
    var a = vm_closure_p(f);
    if(Sx_types[71].call(null, a)) return vm_push_frame(vm, f, args);
    var b = is_lambda(f);
    if(Sx_types[71].call(null, b)) return try_jit_call(vm, f, args);
    var
     c = [0, Sx_runtime[74].call(null, f), k],
     or = Sx_runtime[2].call(null, cst, c);
    if(Sx_types[71].call(null, or))
     var or$0 = or;
    else
     var
      i = [0, Sx_runtime[74].call(null, f), m],
      or$0 = Sx_runtime[2].call(null, cst, i);
    if(Sx_types[71].call(null, or$0))
     return vm_push(vm, cek_call_or_suspend(vm, f, args));
    var d = Sx_runtime[91].call(null, f);
    if(Sx_types[71].call(null, d))
     return vm_push(vm, Sx_runtime[8].call(null, f, args));
    var
     e = [0, l, [0, Sx_runtime[74].call(null, f), 0]],
     g = [3, Sx_runtime[5].call(null, e)],
     h = Sx_runtime[3].call(null, g);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], h], 1);
   }
   var
    n = [0, [3, "for-each"], 0],
    o = [0, [3, "map"], 0],
    p = [0, [3, "map-indexed"], 0],
    q = [0, [3, "filter"], 0],
    r = [0, [3, "reduce"], 0],
    s = [0, [3, "some"], 0],
    t = [0, [3, "every?"], 0],
    u = [3, cst_VM_undefined];
   function vm_resolve_ho_form(vm, name){
    var a = Sx_runtime[2].call(null, cst, [0, name, n]), cst$0 = "\xce\xbb";
    if(Sx_types[71].call(null, a))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a && ! a[2]){
                var
                 coll = a[1],
                 f = args[1],
                 b = Sx_runtime[6].call(null, coll);
                Stdlib_List[18].call
                 (null,
                  function(x){
                   vm_call_external(vm, f, [6, [0, x, 0]]);
                   return 0;
                  },
                  b);
                return 0;
               }
              }
              return 0;
             }];
    var b = Sx_runtime[2].call(null, cst, [0, name, o]);
    if(Sx_types[71].call(null, b))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a && ! a[2]){
                var
                 coll = a[1],
                 f = args[1],
                 b = Sx_runtime[6].call(null, coll);
                return [6,
                        Stdlib_List[20].call
                         (null,
                          function(x){return vm_call_external(vm, f, [6, [0, x, 0]]);},
                          b)];
               }
              }
              return 0;
             }];
    var c = Sx_runtime[2].call(null, cst, [0, name, p]);
    if(Sx_types[71].call(null, c))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a && ! a[2]){
                var
                 coll = a[1],
                 f = args[1],
                 b = Sx_runtime[6].call(null, coll);
                return [6,
                        Stdlib_List[21].call
                         (null,
                          function(i, x){
                           var i$0 = [2, i];
                           return vm_call_external(vm, f, [6, [0, i$0, [0, x, 0]]]);
                          },
                          b)];
               }
              }
              return 0;
             }];
    var d = Sx_runtime[2].call(null, cst, [0, name, q]);
    if(Sx_types[71].call(null, d))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a && ! a[2]){
                var
                 coll = a[1],
                 f = args[1],
                 b = Sx_runtime[6].call(null, coll);
                return [6,
                        Stdlib_List[44].call
                         (null,
                          function(x){
                           var a = vm_call_external(vm, f, [6, [0, x, 0]]);
                           return Sx_types[71].call(null, a);
                          },
                          b)];
               }
              }
              return 0;
             }];
    var e = Sx_runtime[2].call(null, cst, [0, name, r]);
    if(Sx_types[71].call(null, e))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a){
                var b = a[2];
                if(b && ! b[2]){
                 var
                  coll = b[1],
                  init = a[1],
                  f = args[1],
                  c = Sx_runtime[6].call(null, coll);
                 return Stdlib_List[26].call
                         (null,
                          function(acc, x){
                           return vm_call_external(vm, f, [6, [0, acc, [0, x, 0]]]);
                          },
                          init,
                          c);
                }
               }
              }
              return 0;
             }];
    var f = Sx_runtime[2].call(null, cst, [0, name, s]);
    if(Sx_types[71].call(null, f))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a && ! a[2]){
                var
                 coll = a[1],
                 f = args[1],
                 b = Sx_runtime[6].call(null, coll);
                return [0,
                        Stdlib_List[34].call
                         (null,
                          function(x){
                           var a = vm_call_external(vm, f, [6, [0, x, 0]]);
                           return Sx_types[71].call(null, a);
                          },
                          b)];
               }
              }
              return 0;
             }];
    var g = Sx_runtime[2].call(null, cst, [0, name, t]);
    if(Sx_types[71].call(null, g))
     return [15,
             cst$0,
             function(args){
              if(args){
               var a = args[2];
               if(a && ! a[2]){
                var
                 coll = a[1],
                 f = args[1],
                 b = Sx_runtime[6].call(null, coll);
                return [0,
                        Stdlib_List[33].call
                         (null,
                          function(x){
                           var a = vm_call_external(vm, f, [6, [0, x, 0]]);
                           return Sx_types[71].call(null, a);
                          },
                          b)];
               }
              }
              return 0;
             }];
    var
     h = [3, Sx_runtime[5].call(null, [0, u, [0, name, 0]])],
     i = Sx_runtime[3].call(null, h);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], i], 1);
   }
   function vm_call_external(vm, f, args){
    var a = vm_closure_p(f);
    return Sx_types[71].call(null, a)
            ? vm_call_closure(f, args, vm_globals_ref(vm))
            : cek_call(f, args);
   }
   var cst_io_request = "__io_request", v = [6, 0], w = [3, cst_io_request];
   function vm_run(vm){
    for(;;){
     var
      a = vm_frames(vm),
      b = Sx_runtime[34].call(null, a),
      c = [0, 1 - Sx_types[71].call(null, b)];
     if(! Sx_types[71].call(null, c)) return 0;
     var
      d = vm_frames(vm),
      frame = Sx_runtime[15].call(null, d),
      e = vm_frames(vm),
      rest_frames = Sx_runtime[16].call(null, e),
      bc = code_bytecode(closure_code(frame_closure(frame))),
      consts = code_constants(closure_code(frame_closure(frame))),
      f = [0, Sx_runtime[25].call(null, bc), 0],
      g = [0, frame_ip(frame), f],
      h = Sx_runtime[2].call(null, ">=", g);
     if(Sx_types[71].call(null, h)) return vm_set_frames_b(vm, v);
     vm_step(vm, frame, rest_frames, bc, consts);
     var
      i = vm_globals_ref(vm),
      j = Sx_runtime[26].call(null, i, w),
      k = Sx_runtime[84].call(null, j);
     if(! Sx_types[71].call(null, k)) return 0;
    }
   }
   var
    x = [0, [2, 1.], 0],
    y = [0, [2, 2.], 0],
    z = [0, [2, 3.], 0],
    A = [0, 1],
    B = [0, [2, 4.], 0],
    C = [0, 0],
    D = [0, [2, 5.], 0],
    E = [0, [2, 6.], 0],
    F = [0, [2, 16.], 0],
    G = [0, [2, 17.], 0],
    H = [0, [2, 18.], 0],
    I = [0, [2, 19.], 0],
    J = [0, [2, 20.], 0],
    K = [0, [2, 21.], 0],
    L = [0, [2, 32.], 0],
    M = [0, [2, 33.], 0],
    N = [0, [2, 34.], 0],
    O = [0, [2, 48.], 0],
    P = [0, [2, 49.], 0],
    Q = [0, [2, 50.], 0],
    R = [0, [2, 51.], 0],
    S = [0, [2, 52.], 0],
    T = [0, [2, 64.], 0],
    U = [0, [2, 65.], 0],
    V = [0, [2, 144.], 0],
    W = [0, [2, 128.], 0],
    X = [0, [2, 160.], 0],
    Y = [0, [2, 161.], 0],
    Z = [0, [2, 162.], 0],
    _ = [0, [2, 163.], 0],
    $ = [0, [2, 164.], 0],
    aa = [0, [2, 165.], 0],
    ab = [0, [2, 166.], 0],
    ac = [0, [2, 167.], 0],
    ad = [0, [2, 168.], 0],
    ae = [0, [2, 169.], 0],
    af = [0, [2, 170.], 0],
    ag = [0, [2, 171.], 0],
    ah = [0, [2, 172.], 0],
    ai = [0, [2, 173.], 0],
    aj = [2, 0.],
    ak = [0, [2, 174.], 0],
    al = [0, [2, 175.], 0],
    am = [0, [2, 112.], 0],
    an = [3, cst_io_request],
    ao = [3, "VM: unknown opcode "];
   function vm_step(vm, frame, rest_frames, bc, consts){
    var
     op = frame_read_u8(frame),
     c = Sx_runtime[2].call(null, cst, [0, op, x]);
    if(Sx_types[71].call(null, c)){
     var idx = frame_read_u16(frame);
     return vm_push(vm, Sx_runtime[18].call(null, consts, idx));
    }
    var e = Sx_runtime[2].call(null, cst, [0, op, y]);
    if(Sx_types[71].call(null, e)) return vm_push(vm, 0);
    var g = Sx_runtime[2].call(null, cst, [0, op, z]);
    if(Sx_types[71].call(null, g)) return vm_push(vm, A);
    var h = Sx_runtime[2].call(null, cst, [0, op, B]);
    if(Sx_types[71].call(null, h)) return vm_push(vm, C);
    var i = Sx_runtime[2].call(null, cst, [0, op, D]);
    if(Sx_types[71].call(null, i)) return vm_pop(vm);
    var j = Sx_runtime[2].call(null, cst, [0, op, E]);
    if(Sx_types[71].call(null, j)) return vm_push(vm, vm_peek(vm));
    var k = Sx_runtime[2].call(null, cst, [0, op, F]);
    if(Sx_types[71].call(null, k)){
     var slot = frame_read_u8(frame);
     return vm_push(vm, frame_local_get(vm, frame, slot));
    }
    var l = Sx_runtime[2].call(null, cst, [0, op, G]);
    if(Sx_types[71].call(null, l)){
     var slot$0 = frame_read_u8(frame);
     return frame_local_set(vm, frame, slot$0, vm_peek(vm));
    }
    var m = Sx_runtime[2].call(null, cst, [0, op, H]);
    if(Sx_types[71].call(null, m)){
     var idx$0 = frame_read_u8(frame);
     return vm_push(vm, frame_upvalue_get(frame, idx$0));
    }
    var o = Sx_runtime[2].call(null, cst, [0, op, I]);
    if(Sx_types[71].call(null, o)){
     var idx$1 = frame_read_u8(frame);
     return frame_upvalue_set(frame, idx$1, vm_peek(vm));
    }
    var p = Sx_runtime[2].call(null, cst, [0, op, J]);
    if(Sx_types[71].call(null, p)){
     var
      idx$2 = frame_read_u16(frame),
      name = Sx_runtime[18].call(null, consts, idx$2);
     return vm_push(vm, vm_global_get(vm, frame, name));
    }
    var q = Sx_runtime[2].call(null, cst, [0, op, K]);
    if(Sx_types[71].call(null, q)){
     var
      idx$3 = frame_read_u16(frame),
      name$0 = Sx_runtime[18].call(null, consts, idx$3);
     return vm_global_set(vm, frame, name$0, vm_peek(vm));
    }
    var r = Sx_runtime[2].call(null, cst, [0, op, L]), cst$0 = "+";
    if(Sx_types[71].call(null, r)){
     var
      offset = frame_read_i16(frame),
      s = [0, frame_ip(frame), [0, offset, 0]];
     return frame_set_ip_b(frame, Sx_runtime[2].call(null, cst$0, s));
    }
    var t = Sx_runtime[2].call(null, cst, [0, op, M]);
    if(Sx_types[71].call(null, t)){
     var
      offset$0 = frame_read_i16(frame),
      v = vm_pop(vm),
      u = [0, 1 - Sx_types[71].call(null, v)];
     if(! Sx_types[71].call(null, u)) return 0;
     var w = [0, frame_ip(frame), [0, offset$0, 0]];
     return frame_set_ip_b(frame, Sx_runtime[2].call(null, cst$0, w));
    }
    var ap = Sx_runtime[2].call(null, cst, [0, op, N]);
    if(Sx_types[71].call(null, ap)){
     var offset$1 = frame_read_i16(frame), v$0 = vm_pop(vm);
     if(! Sx_types[71].call(null, v$0)) return 0;
     var aq = [0, frame_ip(frame), [0, offset$1, 0]];
     return frame_set_ip_b(frame, Sx_runtime[2].call(null, cst$0, aq));
    }
    var ar = Sx_runtime[2].call(null, cst, [0, op, O]);
    if(Sx_types[71].call(null, ar)){
     var
      argc = frame_read_u8(frame),
      args = collect_n_from_stack(vm, argc),
      f = vm_pop(vm);
     return vm_call(vm, f, args);
    }
    var as = Sx_runtime[2].call(null, cst, [0, op, P]);
    if(Sx_types[71].call(null, as)){
     var
      argc$0 = frame_read_u8(frame),
      args$0 = collect_n_from_stack(vm, argc$0),
      f$0 = vm_pop(vm);
     vm_set_frames_b(vm, rest_frames);
     vm_set_sp_b(vm, frame_base(frame));
     return vm_call(vm, f$0, args$0);
    }
    var at = Sx_runtime[2].call(null, cst, [0, op, Q]);
    if(Sx_types[71].call(null, at)){
     var result = vm_pop(vm);
     vm_set_frames_b(vm, rest_frames);
     vm_set_sp_b(vm, frame_base(frame));
     return vm_push(vm, result);
    }
    var au = Sx_runtime[2].call(null, cst, [0, op, R]);
    if(Sx_types[71].call(null, au)){
     var
      idx$4 = frame_read_u16(frame),
      code_val = Sx_runtime[18].call(null, consts, idx$4),
      cl = vm_create_closure(vm, frame, code_val);
     return vm_push(vm, cl);
    }
    var av = Sx_runtime[2].call(null, cst, [0, op, S]);
    if(Sx_types[71].call(null, av)){
     var
      idx$5 = frame_read_u16(frame),
      argc$1 = frame_read_u8(frame),
      name$1 = Sx_runtime[18].call(null, consts, idx$5),
      args$1 = collect_n_from_stack(vm, argc$1);
     return vm_push(vm, call_primitive(name$1, args$1));
    }
    var aw = Sx_runtime[2].call(null, cst, [0, op, T]);
    if(Sx_types[71].call(null, aw)){
     var
      count = frame_read_u16(frame),
      items = collect_n_from_stack(vm, count);
     return vm_push(vm, items);
    }
    var ax = Sx_runtime[2].call(null, cst, [0, op, U]);
    if(Sx_types[71].call(null, ax)){
     var count$0 = frame_read_u16(frame), d = collect_n_pairs(vm, count$0);
     return vm_push(vm, d);
    }
    var ay = Sx_runtime[2].call(null, cst, [0, op, V]);
    if(Sx_types[71].call(null, ay)){
     var
      count$1 = frame_read_u8(frame),
      parts = collect_n_from_stack(vm, count$1);
     return vm_push(vm, Sx_runtime[8].call(null, str, parts));
    }
    var az = Sx_runtime[2].call(null, cst, [0, op, W]);
    if(Sx_types[71].call(null, az)){
     var
      idx$6 = frame_read_u16(frame),
      name$2 = Sx_runtime[18].call(null, consts, idx$6),
      aA = vm_peek(vm),
      aB = vm_globals_ref(vm);
     return Sx_runtime[12].call(null, aB, name$2, aA);
    }
    var aC = Sx_runtime[2].call(null, cst, [0, op, X]);
    if(Sx_types[71].call(null, aC)){
     var b = vm_pop(vm), a = vm_pop(vm);
     return vm_push(vm, Sx_runtime[2].call(null, cst$0, [0, a, [0, b, 0]]));
    }
    var aD = Sx_runtime[2].call(null, cst, [0, op, Y]), cst$1 = "-";
    if(Sx_types[71].call(null, aD)){
     var b$0 = vm_pop(vm), a$0 = vm_pop(vm);
     return vm_push
             (vm, Sx_runtime[2].call(null, cst$1, [0, a$0, [0, b$0, 0]]));
    }
    var aE = Sx_runtime[2].call(null, cst, [0, op, Z]);
    if(Sx_types[71].call(null, aE)){
     var b$1 = vm_pop(vm), a$1 = vm_pop(vm);
     return vm_push(vm, Sx_runtime[2].call(null, "*", [0, a$1, [0, b$1, 0]]));
    }
    var aF = Sx_runtime[2].call(null, cst, [0, op, _]);
    if(Sx_types[71].call(null, aF)){
     var b$2 = vm_pop(vm), a$2 = vm_pop(vm);
     return vm_push(vm, Sx_runtime[2].call(null, "/", [0, a$2, [0, b$2, 0]]));
    }
    var aG = Sx_runtime[2].call(null, cst, [0, op, $]);
    if(Sx_types[71].call(null, aG)){
     var b$3 = vm_pop(vm), a$3 = vm_pop(vm);
     return vm_push(vm, Sx_runtime[2].call(null, cst, [0, a$3, [0, b$3, 0]]));
    }
    var aH = Sx_runtime[2].call(null, cst, [0, op, aa]);
    if(Sx_types[71].call(null, aH)){
     var b$4 = vm_pop(vm), a$4 = vm_pop(vm);
     return vm_push(vm, Sx_runtime[2].call(null, "<", [0, a$4, [0, b$4, 0]]));
    }
    var aI = Sx_runtime[2].call(null, cst, [0, op, ab]);
    if(Sx_types[71].call(null, aI)){
     var b$5 = vm_pop(vm), a$5 = vm_pop(vm);
     return vm_push(vm, Sx_runtime[2].call(null, ">", [0, a$5, [0, b$5, 0]]));
    }
    var aJ = Sx_runtime[2].call(null, cst, [0, op, ac]);
    if(Sx_types[71].call(null, aJ)){
     var aK = vm_pop(vm);
     return vm_push(vm, [0, 1 - Sx_types[71].call(null, aK)]);
    }
    var aL = Sx_runtime[2].call(null, cst, [0, op, ad]);
    if(Sx_types[71].call(null, aL)){
     var aM = vm_pop(vm);
     return vm_push(vm, Sx_runtime[25].call(null, aM));
    }
    var aN = Sx_runtime[2].call(null, cst, [0, op, ae]);
    if(Sx_types[71].call(null, aN)){
     var aO = vm_pop(vm);
     return vm_push(vm, Sx_runtime[15].call(null, aO));
    }
    var aP = Sx_runtime[2].call(null, cst, [0, op, af]);
    if(Sx_types[71].call(null, aP)){
     var aQ = vm_pop(vm);
     return vm_push(vm, Sx_runtime[16].call(null, aQ));
    }
    var aR = Sx_runtime[2].call(null, cst, [0, op, ag]);
    if(Sx_types[71].call(null, aR)){
     var n = vm_pop(vm), coll = vm_pop(vm);
     return vm_push(vm, Sx_runtime[18].call(null, coll, n));
    }
    var aS = Sx_runtime[2].call(null, cst, [0, op, ah]);
    if(Sx_types[71].call(null, aS)){
     var coll$0 = vm_pop(vm), x$0 = vm_pop(vm);
     return vm_push(vm, Sx_runtime[19].call(null, x$0, coll$0));
    }
    var aT = Sx_runtime[2].call(null, cst, [0, op, ai]);
    if(Sx_types[71].call(null, aT)){
     var aU = [0, aj, [0, vm_pop(vm), 0]];
     return vm_push(vm, Sx_runtime[2].call(null, cst$1, aU));
    }
    var aV = Sx_runtime[2].call(null, cst, [0, op, ak]);
    if(Sx_types[71].call(null, aV)){
     var aW = [0, vm_pop(vm), 0];
     return vm_push(vm, Sx_runtime[2].call(null, "inc", aW));
    }
    var aX = Sx_runtime[2].call(null, cst, [0, op, al]);
    if(Sx_types[71].call(null, aX)){
     var aY = [0, vm_pop(vm), 0];
     return vm_push(vm, Sx_runtime[2].call(null, "dec", aY));
    }
    var aZ = Sx_runtime[2].call(null, cst, [0, op, am]);
    if(Sx_types[71].call(null, aZ)){
     var request = vm_pop(vm), a0 = vm_globals_ref(vm);
     return Sx_runtime[12].call(null, a0, an, request);
    }
    var
     a1 = [3, Sx_runtime[5].call(null, [0, ao, [0, op, 0]])],
     a2 = Sx_runtime[3].call(null, a1);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], a2], 1);
   }
   vm_run_fn[1] = vm_run;
   vm_call_fn[1] = vm_call;
   var cst_vm = "vm", ap = [0, 1], aq = [3, "import"];
   function check_io_suspension(globals, vm_val){
    var match = Stdlib_Hashtbl[7].call(null, globals, cst_io_request);
    if(match){
     var req = match[1];
     if(Sx_types[71].call(null, req)){
      var d = Stdlib_Hashtbl[1].call(null, 0, 4);
      Stdlib_Hashtbl[11].call(null, d, "suspended", ap);
      Stdlib_Hashtbl[11].call(null, d, "op", aq);
      Stdlib_Hashtbl[11].call(null, d, cst_request, req);
      Stdlib_Hashtbl[11].call(null, d, cst_vm, vm_val);
      return [0, [7, d]];
     }
    }
    return 0;
   }
   var ar = [0, "module"];
   function execute_module(code, globals){
    var
     cl = [0, code, [0], ar, globals, 0],
     m = [0, caml_make_vect(4096, 0), 0, 0, globals, 0],
     frame = [0, cl, 0, 0, Stdlib_Hashtbl[1].call(null, 0, 4)],
     a = code[3] - 1 | 0;
    if(a >= 0){
     var for$ = 0;
     for(;;){
      var b = m[2];
      caml_check_bound(m[1], b)[b + 1] = 0;
      m[2] = m[2] + 1 | 0;
      var c = for$ + 1 | 0;
      if(a === for$) break;
      for$ = c;
     }
    }
    m[3] = [0, frame, 0];
    var vm_val = [26, m];
    vm_run(vm_val);
    var match = check_io_suspension(globals, vm_val);
    if(! match) return vm_pop(vm_val);
    var suspension = match[1];
    return suspension;
   }
   function resume_module(suspended){
    if(typeof suspended !== "number" && 7 === suspended[0]){
     var d = suspended[1], vm_val = Stdlib_Hashtbl[6].call(null, d, cst_vm);
     if(typeof vm_val !== "number" && 26 === vm_val[0]){
      var m = vm_val[1], globals = m[4];
      Stdlib_Hashtbl[11].call(null, globals, cst_io_request, 0);
      vm_push(vm_val, 0);
      vm_run(vm_val);
      var match = check_io_suspension(globals, vm_val);
      if(! match) return vm_pop(vm_val);
      var suspension = match[1];
      return suspension;
     }
     throw caml_maybe_attach_backtrace
            ([0, Sx_types[9], "resume_module: expected VmMachine"], 1);
    }
    throw caml_maybe_attach_backtrace
           ([0, Sx_types[9], "resume_module: expected suspension dict"], 1);
   }
   function call_closure(cl, args, globals){
    return vm_call_closure([24, cl], [6, args], [7, globals]);
   }
   var jit_compile_ref = Sx_vm[3];
   runtime.caml_register_global
    (178,
     [0,
      cek_call,
      eval_expr,
      trampoline,
      to_ocaml_list,
      str,
      call_primitive,
      unwrap_vm,
      unwrap_frame,
      unwrap_closure,
      make_uv_cell,
      uv_get,
      uv_set,
      make_upvalue_cell,
      uv_get$0,
      uv_set_b,
      make_vm_code,
      make_vm_closure,
      make_vm_frame,
      make_vm,
      vm_push,
      vm_pop,
      vm_peek,
      frame_read_u8,
      frame_read_u16,
      frame_read_i16,
      frame_local_get,
      frame_local_set,
      frame_upvalue_get,
      frame_upvalue_set,
      frame_ip,
      frame_set_ip_b,
      frame_base,
      frame_closure,
      closure_code,
      closure_upvalues,
      closure_env,
      code_bytecode,
      code_constants,
      code_locals,
      vm_sp,
      vm_set_sp_b,
      vm_stack,
      vm_set_stack_b,
      vm_frames,
      vm_set_frames_b,
      vm_globals_ref,
      vm_global_get,
      vm_global_set,
      vm_push_frame,
      vm_closure_p,
      vm_create_closure,
      jit_failed_sentinel,
      is_jit_failed,
      is_lambda,
      lambda_compiled,
      lambda_set_compiled_b,
      lambda_name,
      cek_call_or_suspend,
      env_walk,
      env_walk_set_b,
      active_vm,
      vm_run_fn,
      vm_call_fn,
      vm_call_closure,
      try_jit_call,
      collect_n_from_stack,
      collect_n_pairs,
      pad_n_nils,
      vm_call,
      vm_resolve_ho_form,
      vm_call_external,
      vm_run,
      vm_step,
      check_io_suspension,
      execute_module,
      resume_module,
      call_closure,
      code_from_value,
      jit_compile_ref,
      jit_failed_sentinel,
      is_jit_failed],
     "Sx_vm_ref");
   return;
  }
  (globalThis));

//# 33485 "../lib/.sx.objs/jsoo/default/sx.cma.js"
//# shape: Sx_render:[F(2),F(1),F(1)*,F(1)*,F(2),F(1),F(2),F(2),F(1),F(1),F(1),F(1),F(1),N,N,N,F(2),F(2),F(3),F(2),F(1),F(3),F(2),F(1)*,N,F(1),N,N,N,N,N,N,N,N,F(1),F(1),F(1),F(1),F(1),N,F(1),N,N,F(1),F(2),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(1),F(2),F(3),F(3),F(3),F(3),F(2),F(2),F(3),F(3),F(2),F(2),F(3),F(1),F(1),F(1),F(1)]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_equal = runtime.caml_equal,
    caml_list_of_js_array = runtime.caml_list_of_js_array,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_ml_string_length = runtime.caml_ml_string_length,
    caml_trampoline = runtime.caml_trampoline,
    caml_trampoline_return = runtime.caml_trampoline_return,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call3(f, a0, a1, a2){
    return (f.l >= 0 ? f.l : f.l = f.length) === 3
            ? f(a0, a1, a2)
            : runtime.caml_call_gen(f, [a0, a1, a2]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    boolean_attrs_set =
      caml_list_of_js_array
       (["async",
         "autofocus",
         "autoplay",
         "checked",
         "controls",
         "default",
         "defer",
         "disabled",
         "formnovalidate",
         "hidden",
         "inert",
         "ismap",
         "loop",
         "multiple",
         "muted",
         "nomodule",
         "novalidate",
         "open",
         "playsinline",
         "readonly",
         "required",
         "reversed",
         "selected"]),
    cst_br = "br",
    cst_col = "col",
    cst_filter = "filter",
    cst_hr = "hr",
    cst_i = "i",
    cst_img = "img",
    cst_input = "input",
    cst_link = "link",
    cst_meta = "meta",
    cst_source = "source",
    cst_style = "style",
    cst_wbr = "wbr",
    html_tags_list =
      caml_list_of_js_array
       (["html",
         "head",
         "body",
         "title",
         cst_meta,
         cst_link,
         "script",
         cst_style,
         "noscript",
         "header",
         "nav",
         "main",
         "section",
         "article",
         "aside",
         "footer",
         "h1",
         "h2",
         "h3",
         "h4",
         "h5",
         "h6",
         "hgroup",
         "div",
         "p",
         "blockquote",
         "pre",
         "figure",
         "figcaption",
         "address",
         cst_hr,
         "ul",
         "ol",
         "li",
         "dl",
         "dt",
         "dd",
         "menu",
         "details",
         "summary",
         "dialog",
         "a",
         "span",
         "em",
         "strong",
         "small",
         "b",
         cst_i,
         "u",
         "s",
         "sub",
         "sup",
         "mark",
         "abbr",
         "cite",
         "code",
         "kbd",
         "samp",
         "var",
         "time",
         cst_br,
         cst_wbr,
         "table",
         "thead",
         "tbody",
         "tfoot",
         "tr",
         "th",
         "td",
         "caption",
         "colgroup",
         cst_col,
         "form",
         cst_input,
         "textarea",
         "select",
         "option",
         "optgroup",
         "button",
         "label",
         "fieldset",
         "legend",
         "datalist",
         "output",
         cst_img,
         "video",
         "audio",
         cst_source,
         "picture",
         "canvas",
         "iframe",
         "svg",
         "path",
         "circle",
         "rect",
         "line",
         "polyline",
         "polygon",
         "ellipse",
         "g",
         "defs",
         "use",
         "text",
         "tspan",
         "clipPath",
         "mask",
         "pattern",
         "linearGradient",
         "radialGradient",
         "stop",
         cst_filter,
         "feGaussianBlur",
         "feOffset",
         "feBlend",
         "feColorMatrix",
         "feComposite",
         "feMerge",
         "feMergeNode",
         "feTurbulence",
         "feComponentTransfer",
         "feFuncR",
         "feFuncG",
         "feFuncB",
         "feFuncA",
         "feDisplacementMap",
         "feFlood",
         "feImage",
         "feMorphology",
         "feSpecularLighting",
         "feDiffuseLighting",
         "fePointLight",
         "feSpotLight",
         "feDistantLight",
         "animate",
         "animateTransform",
         "foreignObject",
         "template",
         "slot"]),
    void_elements_list =
      caml_list_of_js_array
       (["area",
         "base",
         cst_br,
         cst_col,
         "embed",
         cst_hr,
         cst_img,
         cst_input,
         cst_link,
         cst_meta,
         "param",
         cst_source,
         "track",
         cst_wbr]),
    cst_begin = "begin",
    cst_case = "case",
    cst_cond = "cond",
    cst_defcomp = "defcomp",
    cst_defeffect = "defeffect",
    cst_define = "define",
    cst_defisland = "defisland",
    cst_defmacro = "defmacro",
    cst_defstyle = "defstyle",
    cst_deftype = "deftype",
    cst_do = "do",
    cst_for_each = "for-each",
    cst_if = "if",
    cst_let = "let",
    cst_let$0 = "let*",
    cst_letrec = "letrec",
    cst_map = "map",
    cst_map_indexed = "map-indexed",
    cst_provide = "provide",
    cst_scope = "scope",
    cst_when = "when",
    render_html_forms =
      [6,
       caml_list_of_js_array
        ([[3, cst_if],
          [3, cst_when],
          [3, cst_cond],
          [3, cst_case],
          [3, cst_let],
          [3, cst_let$0],
          [3, cst_letrec],
          [3, cst_begin],
          [3, cst_do],
          [3, cst_define],
          [3, cst_defcomp],
          [3, cst_defmacro],
          [3, cst_defisland],
          [3, "defpage"],
          [3, "defhandler"],
          [3, "defquery"],
          [3, "defaction"],
          [3, "defrelation"],
          [3, cst_deftype],
          [3, cst_defeffect],
          [3, cst_defstyle],
          [3, cst_map],
          [3, cst_map_indexed],
          [3, cst_filter],
          [3, cst_for_each],
          [3, cst_scope],
          [3, cst_provide]])],
    Sx_runtime = global_data.Sx_runtime,
    Sx_types = global_data.Sx_types,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib_List = global_data.Stdlib__List,
    Sx_parser = global_data.Sx_parser,
    Sx_ref = global_data.Sx_ref,
    Stdlib_Buffer = global_data.Stdlib__Buffer,
    Stdlib_String = global_data.Stdlib__String,
    Sx_vm = global_data.Sx_vm,
    Stdlib_Printexc = global_data.Stdlib__Printexc;
   function eval_expr(expr, env){return Sx_ref[242].call(null, expr, env);}
   var cond_scheme_p = Sx_ref[137], cst$6 = "", a = [3, cst$6];
   function raw_html_content(v){
    if(typeof v !== "number" && 17 === v[0]){var s = v[1]; return [3, s];}
    return a;
   }
   function make_raw_html(v){
    if(typeof v !== "number" && 3 === v[0]){var s = v[1]; return [17, s];}
    return 0;
   }
   function scope_emit(v1, v2){
    return Sx_runtime[2].call(null, "scope-emit!", [0, v1, [0, v2, 0]]);
   }
   function init(v){return Sx_runtime[2].call(null, "init", [0, v, 0]);}
   function dict_has(a, b){
    return Sx_runtime[2].call(null, "dict-has?", [0, a, [0, b, 0]]);
   }
   function dict_get(a, b){
    return Sx_runtime[2].call(null, "dict-get", [0, a, [0, b, 0]]);
   }
   function is_component(v){
    return Sx_runtime[2].call(null, "component?", [0, v, 0]);
   }
   function is_island(v){
    return Sx_runtime[2].call(null, "island?", [0, v, 0]);
   }
   function is_macro(v){return Sx_runtime[2].call(null, "macro?", [0, v, 0]);}
   function is_lambda(v){
    return Sx_runtime[2].call(null, "lambda?", [0, v, 0]);
   }
   function is_nil(v){return Sx_runtime[2].call(null, "nil?", [0, v, 0]);}
   var
    b = [3, cst$6],
    render_html_lake_ref = [0, function(a, param){return b;}],
    c = [3, cst$6],
    render_html_marsh_ref = [0, function(a, param){return c;}],
    d = [3, cst$6],
    render_html_island_ref = [0, function(b, a, param){return d;}];
   function render_html_lake(args, env){
    return caml_call2(render_html_lake_ref[1], args, env);
   }
   function render_html_marsh(args, env){
    return caml_call2(render_html_marsh_ref[1], args, env);
   }
   function render_html_island(comp, args, env){
    return caml_call3(render_html_island_ref[1], comp, args, env);
   }
   var cek_call = Sx_ref[222];
   function trampoline(v){
    if(typeof v !== "number" && 12 === v[0]){
     var env = v[2], expr = v[1];
     return Sx_ref[242].call(null, expr, [20, env]);
    }
    return v;
   }
   function expand_macro(m, args_val, env){
    if(typeof m !== "number" && 11 === m[0]){
     var mac = m[1];
     a:
     {
      if(typeof args_val !== "number")
       switch(args_val[0]){
         case 6:
          var args = args_val[1]; break a;
         case 21:
          var args = args_val[1][1]; break a;
       }
      var args = 0;
     }
     var
      local = Sx_runtime[81].call(null, [20, mac[4]]),
      ps$0 = Stdlib_List[20].call(null, function(p){return [3, p];}, mac[1]);
     a:
     {
      var ps = ps$0, as = args;
      for(;;){
       if(! ps){
        var match = mac[2];
        if(! match) break a;
        var rp = match[1];
        Sx_runtime[78].call(null, local, [3, rp], [6, as]);
        break a;
       }
       var ps_rest = ps[2], p = ps[1];
       if(! as) break;
       var as_rest = as[2], a = as[1];
       Sx_runtime[78].call(null, local, p, a);
       ps = ps_rest;
       as = as_rest;
      }
      var b = Stdlib_List[10].call(null, ps);
      Stdlib_List[18].call
       (null,
        function(p){Sx_runtime[78].call(null, local, p, 0); return 0;},
        b);
     }
     return Sx_ref[242].call(null, mac[3], local);
    }
    return 0;
   }
   function try_catch(try_fn, catch_fn){
    try{var b = Sx_runtime[7].call(null, try_fn, 0); return b;}
    catch(e$0){
     var e = caml_wrap_exception(e$0);
     if(e[1] === Sx_vm[1]) throw caml_maybe_attach_backtrace(e, 0);
     if(e[1] === Sx_types[9]){
      var msg = e[2];
      return Sx_runtime[7].call(null, catch_fn, [0, [3, msg], 0]);
     }
     var a = [0, [3, Stdlib_Printexc[1].call(null, e)], 0];
     return Sx_runtime[7].call(null, catch_fn, a);
    }
   }
   function set_render_active_b(v){return 0;}
   function is_boolean_attr(name){
    return Stdlib_List[37].call(null, name, boolean_attrs_set);
   }
   var
    html_tags_val =
      [6,
       Stdlib_List[20].call(null, function(s){return [3, s];}, html_tags_list)],
    void_elements_val =
      [6,
       Stdlib_List[20].call
        (null, function(s){return [3, s];}, void_elements_list)],
    boolean_attrs_val =
      [6,
       Stdlib_List[20].call
        (null, function(s){return [3, s];}, boolean_attrs_set)],
    cst_amp = "&amp;",
    cst_gt = "&gt;",
    cst_lt = "&lt;",
    cst_quot = "&quot;";
   function escape_html_raw(s){
    var buf = Stdlib_Buffer[1].call(null, caml_ml_string_length(s));
    Stdlib_String[30].call
     (null,
      function(c){
       if(34 === c) return Stdlib_Buffer[16].call(null, buf, cst_quot);
       if(60 <= c){
        if(63 > c)
         switch(c - 60 | 0){
           case 0:
            return Stdlib_Buffer[16].call(null, buf, cst_lt);
           case 2:
            return Stdlib_Buffer[16].call(null, buf, cst_gt);
         }
       }
       else if(38 === c) return Stdlib_Buffer[16].call(null, buf, cst_amp);
       return Stdlib_Buffer[12].call(null, buf, c);
      },
      s);
    return Stdlib_Buffer[2].call(null, buf);
   }
   function escape_html_val(v){
    a:
    {
     if(typeof v !== "number" && 3 === v[0]){var s$0 = v[1], s = s$0; break a;}
     var s = Sx_types[35].call(null, v);
    }
    return [3, escape_html_raw(s)];
   }
   function escape_attr_val(v){return escape_html_val(v);}
   var cst$8 = '="', e = [3, cst$6];
   function render_attrs(attrs){
    if(typeof attrs !== "number" && 7 === attrs[0]){
     var d = attrs[1], buf = Stdlib_Buffer[1].call(null, 64);
     Stdlib_Hashtbl[12].call
      (null,
       function(k, v){
        if(is_boolean_attr(k)){
         var a = Sx_types[71].call(null, v);
         return a
                 ? (Stdlib_Buffer
                     [12].call
                    (null, buf, 32),
                   Stdlib_Buffer[16].call(null, buf, k))
                 : a;
        }
        var b = 0 !== v ? 1 : 0;
        if(! b) return b;
        Stdlib_Buffer[12].call(null, buf, 32);
        Stdlib_Buffer[16].call(null, buf, k);
        Stdlib_Buffer[16].call(null, buf, cst$8);
        var c = escape_html_raw(Sx_types[35].call(null, v));
        Stdlib_Buffer[16].call(null, buf, c);
        return Stdlib_Buffer[12].call(null, buf, 34);
       },
       d);
     return [3, Stdlib_Buffer[2].call(null, buf)];
    }
    return e;
   }
   var
    f = [3, cst$6],
    render_to_html_ref = [0, function(expr, env){return f;}];
   function scope_emitted(name){
    return Sx_runtime[2].call(null, "scope-emitted", [0, name, 0]);
   }
   var
    cst = "=",
    cst_contains = "contains?",
    definition_form_extensions = [6, 0],
    g = [0, [3, cst_define], 0],
    h = [0, [3, cst_defcomp], 0],
    i = [0, [3, cst_defisland], 0],
    j = [0, [3, cst_defmacro], 0],
    k = [0, [3, cst_defstyle], 0],
    l = [0, [3, cst_deftype], 0],
    m = [0, [3, cst_defeffect], 0];
   function definition_form_p(name){
    var or = Sx_runtime[2].call(null, cst, [0, name, g]);
    if(Sx_types[71].call(null, or)) return or;
    var or$0 = Sx_runtime[2].call(null, cst, [0, name, h]);
    if(Sx_types[71].call(null, or$0)) return or$0;
    var or$1 = Sx_runtime[2].call(null, cst, [0, name, i]);
    if(Sx_types[71].call(null, or$1)) return or$1;
    var or$2 = Sx_runtime[2].call(null, cst, [0, name, j]);
    if(Sx_types[71].call(null, or$2)) return or$2;
    var or$3 = Sx_runtime[2].call(null, cst, [0, name, k]);
    if(Sx_types[71].call(null, or$3)) return or$3;
    var or$4 = Sx_runtime[2].call(null, cst, [0, name, l]);
    if(Sx_types[71].call(null, or$4)) return or$4;
    var or$5 = Sx_runtime[2].call(null, cst, [0, name, m]);
    return Sx_types[71].call(null, or$5)
            ? or$5
            : Sx_runtime
               [2].call
              (null,
               cst_contains,
               [0, definition_form_extensions, [0, name, 0]]);
   }
   var
    cst$0 = "<",
    cst_assoc = "assoc",
    cst_inc = "inc",
    cst_keyword = "keyword",
    cst_skip = "skip",
    n = [6, 0],
    o = [2, 0.],
    p = [3, cst_i],
    q = [0, 0],
    r = [3, cst_skip],
    s = [3, cst_skip],
    t = [3, cst_i],
    u = [3, cst_i],
    v = [0, 0],
    w = [3, cst_skip],
    x = [0, [3, cst_keyword], 0],
    y = [3, cst_i],
    z = [3, cst_i],
    A = [3, cst_i],
    B = [3, cst_i],
    C = [0, 1],
    D = [3, cst_skip],
    E = [3, cst_i],
    F = [3, cst_i];
   function parse_element_args(args, env){
    var
     attrs = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
     a = Sx_runtime[6].call(null, args),
     d = Stdlib_Hashtbl[1].call(null, 0, 2),
     b = Sx_runtime[3].call(null, p);
    Stdlib_Hashtbl[11].call(null, d, b, o);
    var c = Sx_runtime[3].call(null, r);
    Stdlib_Hashtbl[11].call(null, d, c, q);
    var children = [0, n];
    Stdlib_List[26].call
     (null,
      function(state, arg){
       var skip = Sx_runtime[26].call(null, state, s);
       if(Sx_types[71].call(null, skip)){
        var
         b = [0, Sx_runtime[26].call(null, state, t), 0],
         c =
           [0,
            state,
            [0,
             w,
             [0, v, [0, u, [0, Sx_runtime[2].call(null, cst_inc, b), 0]]]]];
        return Sx_runtime[2].call(null, cst_assoc, c);
       }
       var
        d = [0, Sx_runtime[74].call(null, arg), x],
        and = Sx_runtime[2].call(null, cst, d);
       if(Sx_types[71].call(null, and))
        var
         e = [0, Sx_runtime[25].call(null, args), 0],
         f = [0, Sx_runtime[26].call(null, state, y), 0],
         g = [0, Sx_runtime[2].call(null, cst_inc, f), e],
         a = Sx_runtime[2].call(null, cst$0, g);
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         h = [0, Sx_runtime[26].call(null, state, z), 0],
         i = Sx_runtime[2].call(null, cst_inc, h),
         val = trampoline(eval_expr(Sx_runtime[18].call(null, args, i), env)),
         j = Sx_types[73].call(null, arg);
        Sx_runtime[12].call(null, attrs, j, val);
        var
         k = [0, Sx_runtime[26].call(null, state, A), 0],
         l =
           [0,
            state,
            [0,
             D,
             [0, C, [0, B, [0, Sx_runtime[2].call(null, cst_inc, k), 0]]]]];
        return Sx_runtime[2].call(null, cst_assoc, l);
       }
       children[1] = Sx_runtime[11].call(null, children[1], arg);
       var
        m = [0, Sx_runtime[26].call(null, state, E), 0],
        n = [0, state, [0, F, [0, Sx_runtime[2].call(null, cst_inc, m), 0]]];
       return Sx_runtime[2].call(null, cst_assoc, n);
      },
      [7, d],
      a);
    return [6, [0, attrs, [0, children[1], 0]]];
   }
   function eval_cond(clauses, env){
    var a = cond_scheme_p(clauses);
    return Sx_types[71].call(null, a)
            ? eval_cond_scheme(clauses, env)
            : eval_cond_clojure(clauses, env);
   }
   var G = [2, 1.];
   function eval_cond_scheme(clauses$1, env){
    var clauses = clauses$1;
    for(;;){
     var a = Sx_runtime[34].call(null, clauses);
     if(Sx_types[71].call(null, a)) return 0;
     var
      clause = Sx_runtime[15].call(null, clauses),
      test = Sx_runtime[15].call(null, clause),
      body = Sx_runtime[18].call(null, clause, G),
      b = Sx_runtime[115].call(null, test);
     if(Sx_types[71].call(null, b)) return body;
     var c = trampoline(eval_expr(test, env));
     if(Sx_types[71].call(null, c)) return body;
     var clauses$0 = Sx_runtime[16].call(null, clauses);
     clauses = clauses$0;
    }
   }
   var
    cst_slice = "slice",
    H = [0, [2, 2.], 0],
    I = [2, 1.],
    J = [0, [2, 2.], 0];
   function eval_cond_clojure(clauses$1, env){
    var clauses = clauses$1;
    for(;;){
     var
      a = [0, Sx_runtime[25].call(null, clauses), H],
      b = Sx_runtime[2].call(null, cst$0, a);
     if(Sx_types[71].call(null, b)) return 0;
     var
      test = Sx_runtime[15].call(null, clauses),
      body = Sx_runtime[18].call(null, clauses, I),
      c = Sx_runtime[115].call(null, test);
     if(Sx_types[71].call(null, c)) return body;
     var d = trampoline(eval_expr(test, env));
     if(Sx_types[71].call(null, d)) return body;
     var clauses$0 = Sx_runtime[2].call(null, cst_slice, [0, clauses, J]);
     clauses = clauses$0;
    }
   }
   var
    cst$1 = ">=",
    cst_list = "list",
    cst_symbol = "symbol",
    K = [0, [3, cst_list], 0],
    L = [0, [2, 2.], 0],
    M = [0, [3, cst_symbol], 0],
    N = [2, 1.];
   function process_bindings(bindings, env){
    var
     local = Sx_runtime[81].call(null, env),
     a = Sx_runtime[6].call(null, bindings);
    Stdlib_List[18].call
     (null,
      function(pair){
       var
        b = [0, Sx_runtime[74].call(null, pair), K],
        and = Sx_runtime[2].call(null, cst, b);
       if(Sx_types[71].call(null, and))
        var
         c = [0, Sx_runtime[25].call(null, pair), L],
         a = Sx_runtime[2].call(null, cst$1, c);
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         d = Sx_runtime[15].call(null, pair),
         e = [0, Sx_runtime[74].call(null, d), M],
         f = Sx_runtime[2].call(null, cst, e);
        if(Sx_types[71].call(null, f))
         var
          g = Sx_runtime[15].call(null, pair),
          name = Sx_types[72].call(null, g);
        else
         var
          j = [0, Sx_runtime[15].call(null, pair), 0],
          name = [3, Sx_runtime[5].call(null, j)];
        var
         h = trampoline(eval_expr(Sx_runtime[18].call(null, pair, N), local)),
         i = Sx_runtime[4].call(null, name);
        Sx_runtime[78].call(null, local, i, h);
       }
       return 0;
      },
      a);
    return local;
   }
   var
    cst$4 = "-",
    cst$2 = "<>",
    cst$5 = ">",
    cst_raw = "raw!",
    cst_starts_with = "starts-with?",
    cst$3 = "~",
    O = [0, [3, cst_list], 0],
    P = [0, 0],
    Q = [0, [3, cst_symbol], 0],
    R = [0, 0],
    S = [0, [3, cst$2], 0],
    T = [0, [3, cst_raw], 0],
    U = [0, [3, cst$3], 0],
    V = [0, [3, "html:"], 0],
    W = [0, [2, 0.], 0],
    X = [0, [3, cst$4], 0],
    Y = [0, [2, 1.], 0],
    Z = [0, [3, cst_keyword], 0],
    _ = [2, 1.];
   function is_render_expr_p(expr){
    var
     a = [0, Sx_runtime[74].call(null, expr), O],
     b = Sx_runtime[2].call(null, cst, a),
     or = [0, 1 - Sx_types[71].call(null, b)],
     or$0 = Sx_types[71].call(null, or) ? or : Sx_runtime[34].call(null, expr);
    if(Sx_types[71].call(null, or$0)) return P;
    var
     h = Sx_runtime[15].call(null, expr),
     c = [0, Sx_runtime[74].call(null, h), Q],
     d = Sx_runtime[2].call(null, cst, c),
     e = [0, 1 - Sx_types[71].call(null, d)];
    if(Sx_types[71].call(null, e)) return R;
    var
     n = Sx_types[72].call(null, h),
     or$1 = Sx_runtime[2].call(null, cst, [0, n, S]);
    if(Sx_types[71].call(null, or$1)) return or$1;
    var or$2 = Sx_runtime[2].call(null, cst, [0, n, T]);
    if(Sx_types[71].call(null, or$2)) return or$2;
    var or$3 = Sx_runtime[2].call(null, cst_starts_with, [0, n, U]);
    if(Sx_types[71].call(null, or$3)) return or$3;
    var or$4 = Sx_runtime[2].call(null, cst_starts_with, [0, n, V]);
    if(Sx_types[71].call(null, or$4)) return or$4;
    var
     or$5 =
       Sx_runtime[2].call(null, cst_contains, [0, html_tags_val, [0, n, 0]]);
    if(Sx_types[71].call(null, or$5)) return or$5;
    var
     f = [0, Sx_runtime[2].call(null, "index-of", [0, n, X]), W],
     and = Sx_runtime[2].call(null, cst$5, f);
    if(! Sx_types[71].call(null, and)) return and;
    var
     g = [0, Sx_runtime[25].call(null, expr), Y],
     and$0 = Sx_runtime[2].call(null, cst$5, g);
    if(! Sx_types[71].call(null, and$0)) return and$0;
    var
     i = Sx_runtime[18].call(null, expr, _),
     j = [0, Sx_runtime[74].call(null, i), Z];
    return Sx_runtime[2].call(null, cst, j);
   }
   var
    cst_class = "class",
    $ = [0, [3, cst_class], 0],
    aa = [3, cst_class],
    ab = [0, [3, cst$6], 0],
    ac = [3, " "],
    ad = [3, cst_class],
    ae = [0, [3, cst_style], 0],
    af = [3, cst_style],
    ag = [0, [3, cst$6], 0],
    ah = [3, ";"],
    ai = [3, cst_style];
   function merge_spread_attrs(target, spread_dict){
    var
     a = Sx_runtime[2].call(null, "keys", [0, spread_dict, 0]),
     b = Sx_runtime[6].call(null, a);
    Stdlib_List[18].call
     (null,
      function(key){
       var
        val = dict_get(spread_dict, key),
        c = Sx_runtime[2].call(null, cst, [0, key, $]);
       if(Sx_types[71].call(null, c)){
        var existing = dict_get(target, aa);
        if(Sx_types[71].call(null, existing))
         var
          d = Sx_runtime[2].call(null, cst, [0, existing, ab]),
          a = [0, 1 - Sx_types[71].call(null, d)];
        else
         var a = existing;
        var
         e =
           Sx_types[71].call(null, a)
            ? [3,
              Sx_runtime[5].call(null, [0, existing, [0, ac, [0, val, 0]]])]
            : val;
        Sx_runtime[12].call(null, target, ad, e);
       }
       else{
        var f = Sx_runtime[2].call(null, cst, [0, key, ae]);
        if(Sx_types[71].call(null, f)){
         var existing$0 = dict_get(target, af);
         if(Sx_types[71].call(null, existing$0))
          var
           g = Sx_runtime[2].call(null, cst, [0, existing$0, ag]),
           b = [0, 1 - Sx_types[71].call(null, g)];
         else
          var b = existing$0;
         var
          h =
            Sx_types[71].call(null, b)
             ? [3,
               Sx_runtime[5].call(null, [0, existing$0, [0, ah, [0, val, 0]]])]
             : val;
         Sx_runtime[12].call(null, target, ai, h);
        }
        else
         Sx_runtime[12].call(null, target, key, val);
       }
       return 0;
      },
      b);
    return 0;
   }
   var
    cst_boolean = "boolean",
    cst_element_attrs = "element-attrs",
    cst_false = "false",
    cst_nil = "nil",
    cst_number = "number",
    cst_raw_html = "raw-html",
    cst_spread = "spread",
    cst_string = "string",
    cst_thunk = "thunk",
    cst_true = "true",
    aj = [3, cst_nil],
    ak = [3, cst$6],
    al = [3, cst_string],
    am = [3, cst_number],
    an = [3, cst_boolean],
    ao = [3, cst_true],
    ap = [3, cst_false],
    aq = [3, cst_list],
    ar = [3, cst$6],
    as = [3, cst_symbol],
    at = [3, cst_keyword],
    au = [3, cst_raw_html],
    av = [3, cst_spread],
    aw = [3, cst_element_attrs],
    ax = [3, cst$6],
    ay = [3, cst_thunk];
   function render_to_html$0(counter, expr$1, env$1){
    var expr = expr$1, env = env$1;
    for(;;){
     var match_val = Sx_runtime[74].call(null, expr);
     if(caml_equal(match_val, aj)) return ak;
     if(caml_equal(match_val, al)) return escape_html_val(expr);
     if(caml_equal(match_val, am))
      return [3, Sx_runtime[5].call(null, [0, expr, 0])];
     if(caml_equal(match_val, an))
      return Sx_types[71].call(null, expr) ? ao : ap;
     if(caml_equal(match_val, aq)){
      var c = Sx_runtime[34].call(null, expr);
      return Sx_types[71].call(null, c)
              ? ar
              : counter
                < 50
                ? render_list_to_html$0(counter + 1 | 0, expr, env)
                : caml_trampoline_return
                  (render_list_to_html$0, [0, expr, env]);
     }
     if(caml_equal(match_val, as)){
      var a = trampoline(eval_expr(expr, env));
      return counter < 50
              ? render_value_to_html$0(counter + 1 | 0, a, env)
              : caml_trampoline_return(render_value_to_html$0, [0, a, env]);
     }
     if(caml_equal(match_val, at))
      return escape_html_val(Sx_types[73].call(null, expr));
     if(caml_equal(match_val, au)) return raw_html_content(expr);
     if(caml_equal(match_val, av)){
      scope_emit(aw, Sx_runtime[71].call(null, expr));
      return ax;
     }
     if(! caml_equal(match_val, ay)){
      var b = trampoline(eval_expr(expr, env));
      return counter < 50
              ? render_value_to_html$0(counter + 1 | 0, b, env)
              : caml_trampoline_return(render_value_to_html$0, [0, b, env]);
     }
     var
      env$0 = Sx_types[93].call(null, expr),
      expr$0 = Sx_types[92].call(null, expr);
     expr = expr$0;
     env = env$0;
    }
   }
   function render_to_html(expr, env){
    return caml_trampoline(render_to_html$0(0, expr, env));
   }
   var
    az = [3, cst_nil],
    aA = [3, cst$6],
    aB = [3, cst_string],
    aC = [3, cst_number],
    aD = [3, cst_boolean],
    aE = [3, cst_true],
    aF = [3, cst_false],
    aG = [3, cst_list],
    aH = [3, cst_raw_html],
    aI = [3, cst_spread],
    aJ = [3, cst_element_attrs],
    aK = [3, cst$6],
    aL = [3, cst_thunk];
   function render_value_to_html$0(counter, val, env){
    var match_val = Sx_runtime[74].call(null, val);
    if(caml_equal(match_val, az)) return aA;
    if(caml_equal(match_val, aB)) return escape_html_val(val);
    if(caml_equal(match_val, aC))
     return [3, Sx_runtime[5].call(null, [0, val, 0])];
    if(caml_equal(match_val, aD))
     return Sx_types[71].call(null, val) ? aE : aF;
    if(caml_equal(match_val, aG))
     return counter < 50
             ? render_list_to_html$0(counter + 1 | 0, val, env)
             : caml_trampoline_return(render_list_to_html$0, [0, val, env]);
    if(caml_equal(match_val, aH)) return raw_html_content(val);
    if(caml_equal(match_val, aI)){
     scope_emit(aJ, Sx_runtime[71].call(null, val));
     return aK;
    }
    if(! caml_equal(match_val, aL))
     return escape_html_val([3, Sx_runtime[5].call(null, [0, val, 0])]);
    var a = Sx_types[93].call(null, val), b = Sx_types[92].call(null, val);
    return counter < 50
            ? render_to_html$0(counter + 1 | 0, b, a)
            : caml_trampoline_return(render_to_html$0, [0, b, a]);
   }
   function render_value_to_html(val, env){
    return caml_trampoline(render_value_to_html$0(0, val, env));
   }
   function render_html_form_p(name){
    return Sx_runtime[2].call
            (null, cst_contains, [0, render_html_forms, [0, name, 0]]);
   }
   var
    cst$7 = "\xce\xbb",
    cst_div = "<\/div>",
    cst_div_class_sx_render_error_ =
      '<div class="sx-render-error" style="color:red;font-size:0.875rem;padding:0.5rem;border:1px solid red;border-radius:0.25rem;margin:0.5rem 0;">Render error: ',
    cst_join = "join",
    aM = [3, cst$6],
    aN = [0, [3, cst_symbol], 0],
    aO = [3, cst$6],
    aP = [0, [3, cst$2], 0],
    aQ = [3, cst$6],
    aR = [0, [3, cst_raw], 0],
    aS = [3, cst$6],
    aT = [0, [3, "lake"], 0],
    aU = [0, [3, "marsh"], 0],
    aV = [0, [3, "error-boundary"], 0],
    aW = [0, [2, 1.], 0],
    aX = [0, [3, cst_div], 0],
    aY = [0, [3, cst$5], [0, [3, cst_gt], 0]],
    aZ = [0, [3, cst$0], [0, [3, cst_lt], 0]],
    a0 = [0, [3, cst_div], 0],
    a1 = [3, cst_div_class_sx_render_error_],
    a2 = [0, 0, 0],
    a3 = [0, [3, cst_div], 0],
    a4 = [3, cst_div_class_sx_render_error_],
    a5 = [3, cst$6],
    a6 = [3, '<div data-sx-boundary="true">'],
    a7 = [0, [3, "portal"], 0],
    a8 = [3, cst$6],
    a9 = [0, [3, cst$3], 0],
    a_ = [0, [3, cst$3], 0],
    a$ = [0, [3, " -->"], 0],
    ba = [3, "<!-- unknown component: "],
    bb = [0, [3, "promise-delayed"], 0];
   function render_list_to_html$0(counter, expr, env){
    var e = Sx_runtime[34].call(null, expr);
    if(Sx_types[71].call(null, e)) return aM;
    var
     head = Sx_runtime[15].call(null, expr),
     f = [0, Sx_runtime[74].call(null, head), aN],
     g = Sx_runtime[2].call(null, cst, f),
     h = [0, 1 - Sx_types[71].call(null, g)];
    if(Sx_types[71].call(null, h)){
     var
      i = Sx_runtime[6].call(null, expr),
      j =
        [0,
         aO,
         [0,
          [6,
           Stdlib_List[20].call
            (null, function(x){return render_value_to_html(x, env);}, i)],
          0]];
     return Sx_runtime[2].call(null, cst_join, j);
    }
    var
     name = Sx_types[72].call(null, head),
     args = Sx_runtime[16].call(null, expr),
     k = Sx_runtime[2].call(null, cst, [0, name, aP]);
    if(Sx_types[71].call(null, k)){
     var
      l = Sx_runtime[6].call(null, args),
      m =
        [0,
         aQ,
         [0,
          [6,
           Stdlib_List[20].call
            (null, function(x){return render_to_html(x, env);}, l)],
          0]];
     return Sx_runtime[2].call(null, cst_join, m);
    }
    var n = Sx_runtime[2].call(null, cst, [0, name, aR]);
    if(Sx_types[71].call(null, n)){
     var
      o = Sx_runtime[6].call(null, args),
      p =
        [0,
         aS,
         [0,
          [6,
           Stdlib_List[20].call
            (null,
             function(x){
              var a = [0, trampoline(eval_expr(x, env)), 0];
              return [3, Sx_runtime[5].call(null, a)];
             },
             o)],
          0]];
     return Sx_runtime[2].call(null, cst_join, p);
    }
    var q = Sx_runtime[2].call(null, cst, [0, name, aT]);
    if(Sx_types[71].call(null, q)) return render_html_lake(args, env);
    var r = Sx_runtime[2].call(null, cst, [0, name, aU]);
    if(Sx_types[71].call(null, r)) return render_html_marsh(args, env);
    var s = Sx_runtime[2].call(null, cst, [0, name, aV]);
    if(Sx_types[71].call(null, s)){
     var
      t = [0, Sx_runtime[25].call(null, args), aW],
      has_fallback = Sx_runtime[2].call(null, cst$5, t),
      body_exprs =
        Sx_types[71].call(null, has_fallback)
         ? Sx_runtime[16].call(null, args)
         : args,
      fallback_expr =
        Sx_types[71].call(null, has_fallback)
         ? Sx_runtime[15].call(null, args)
         : 0,
      u =
        [0,
         a6,
         [0,
          try_catch
           ([15,
             cst$7,
             function(args){
              var
               a = Sx_runtime[6].call(null, body_exprs),
               b =
                 [0,
                  a5,
                  [0,
                   [6,
                    Stdlib_List[20].call
                     (null, function(x){return render_to_html(x, env);}, a)],
                   0]];
              return Sx_runtime[2].call(null, cst_join, b);
             }],
            [15,
             cst$7,
             function(args){
              if(args && ! args[2]){
               var
                err = args[1],
                b = [0, [3, Sx_runtime[5].call(null, [0, err, 0])], aZ],
                cst_replace = "replace",
                c = [0, Sx_runtime[2].call(null, cst_replace, b), aY],
                safe_err = Sx_runtime[2].call(null, cst_replace, c);
               if(Sx_types[71].call(null, fallback_expr))
                var
                 d = is_nil(fallback_expr),
                 a = [0, 1 - Sx_types[71].call(null, d)];
               else
                var a = fallback_expr;
               return Sx_types[71].call(null, a)
                       ? try_catch
                         ([15,
                           cst$7,
                           function(args){
                            return render_to_html
                                    ([6,
                                      [0, trampoline(eval_expr(fallback_expr, env)), [0, err, a2]]],
                                     env);
                           }],
                          [15,
                           cst$7,
                           function(args){
                            if(args && ! args[2])
                             return [3,
                                     Sx_runtime[5].call(null, [0, a1, [0, safe_err, a0]])];
                            return 0;
                           }])
                       : [3, Sx_runtime[5].call(null, [0, a4, [0, safe_err, a3]])];
              }
              return 0;
             }]),
          aX]];
     return [3, Sx_runtime[5].call(null, u)];
    }
    var
     or = Sx_runtime[2].call(null, cst, [0, name, a7]),
     or$0 =
       Sx_types[71].call(null, or)
        ? or
        : Sx_runtime[2].call(null, cst, [0, name, bb]);
    if(Sx_types[71].call(null, or$0)){
     var
      v = Sx_runtime[6].call(null, args),
      w =
        [0,
         a8,
         [0,
          [6,
           Stdlib_List[20].call
            (null, function(x){return render_to_html(x, env);}, v)],
          0]];
     return Sx_runtime[2].call(null, cst_join, w);
    }
    var
     x =
       Sx_runtime[2].call
        (null, cst_contains, [0, html_tags_val, [0, name, 0]]);
    if(Sx_types[71].call(null, x))
     return render_html_element(name, args, env);
    var and = Sx_runtime[2].call(null, cst_starts_with, [0, name, a9]);
    if(Sx_types[71].call(null, and))
     var
      and$0 = Sx_runtime[76].call(null, env, name),
      a =
        Sx_types[71].call(null, and$0)
         ? is_island(Sx_runtime[77].call(null, env, name))
         : and$0;
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     return render_html_island
             (Sx_runtime[77].call(null, env, name), args, env);
    var y = Sx_runtime[2].call(null, cst_starts_with, [0, name, a_]);
    if(Sx_types[71].call(null, y)){
     var val = Sx_runtime[77].call(null, env, name), z = is_component(val);
     if(Sx_types[71].call(null, z))
      return counter < 50
              ? render_html_component$0(counter + 1 | 0, val, args, env)
              : caml_trampoline_return
                (render_html_component$0, [0, val, args, env]);
     var A = is_macro(val);
     if(! Sx_types[71].call(null, A))
      return [3, Sx_runtime[5].call(null, [0, ba, [0, name, a$]])];
     var b = expand_macro(val, args, env);
     return counter < 50
             ? render_to_html$0(counter + 1 | 0, b, env)
             : caml_trampoline_return(render_to_html$0, [0, b, env]);
    }
    var B = render_html_form_p(name);
    if(Sx_types[71].call(null, B))
     return counter < 50
             ? dispatch_html_form$0(counter + 1 | 0, name, expr, env)
             : caml_trampoline_return
               (dispatch_html_form$0, [0, name, expr, env]);
    var
     and$1 = Sx_runtime[76].call(null, env, name),
     C =
       Sx_types[71].call(null, and$1)
        ? is_macro(Sx_runtime[77].call(null, env, name))
        : and$1;
    if(Sx_types[71].call(null, C)){
     var c = expand_macro(Sx_runtime[77].call(null, env, name), args, env);
     return counter < 50
             ? render_to_html$0(counter + 1 | 0, c, env)
             : caml_trampoline_return(render_to_html$0, [0, c, env]);
    }
    var d = trampoline(eval_expr(expr, env));
    return counter < 50
            ? render_value_to_html$0(counter + 1 | 0, d, env)
            : caml_trampoline_return(render_value_to_html$0, [0, d, env]);
   }
   function render_list_to_html(expr, env){
    return caml_trampoline(render_list_to_html$0(0, expr, env));
   }
   var
    body_start = [2, 3.],
    bc = [0, [3, cst_if], 0],
    bd = [2, 1.],
    be = [2, 2.],
    bf = [0, [2, 3.], 0],
    bg = [2, 3.],
    bh = [3, cst$6],
    bi = [0, [3, cst_when], 0],
    bj = [2, 1.],
    bk = [3, cst$6],
    bl = [0, [2, 3.], 0],
    bm = [2, 2.],
    bn = [2, 2.],
    bo = [3, cst$6],
    bp = [0, [3, cst_cond], 0],
    bq = [3, cst$6],
    br = [0, [3, cst_case], 0],
    bs = [0, [3, cst_letrec], 0],
    bt = [2, 1.],
    bu = [0, [2, 2.], 0],
    bv = [0, [3, cst_symbol], 0],
    bw = [0, [3, cst_symbol], 0],
    bx = [2, 1.],
    by = [0, [2, 1.], 0],
    bz = [0, [3, cst_let], 0],
    bA = [2, 1.],
    bB = [0, [2, 3.], 0],
    bC = [2, 2.],
    bD = [2, 2.],
    bE = [3, cst$6],
    bF = [0, [3, cst_begin], 0],
    bG = [0, [2, 2.], 0],
    bH = [2, 1.],
    bI = [2, 1.],
    bJ = [3, cst$6],
    bK = [3, cst$6],
    bL = [0, [3, cst_map], 0],
    bM = [2, 1.],
    bN = [2, 2.],
    bO = [3, cst$6],
    bP = [0, [3, cst_map_indexed], 0],
    bQ = [2, 1.],
    bR = [2, 2.],
    bS = [3, cst$6],
    bT = [0, [3, cst_filter], 0],
    bU = [0, [3, cst_for_each], 0],
    bV = [2, 1.],
    bW = [2, 2.],
    bX = [3, cst$6],
    bY = [0, [3, cst_scope], 0],
    bZ = [2, 1.],
    b0 = [0, [2, 2.], 0],
    b1 = [0, [2, 2.], 0],
    b2 = [0, [3, cst_keyword], 0],
    b3 = [0, [3, "value"], 0],
    b4 = [2, 1.],
    b5 = [0, [2, 2.], 0],
    b6 = [0, [2, 1.], 0],
    b7 = [3, cst$6],
    b8 = [0, [3, cst_provide], 0],
    b9 = [2, 1.],
    b_ = [2, 2.],
    b$ = [0, [2, 3.], 0],
    ca = [0, [2, 1.], 0],
    cb = [3, cst$6],
    cc = [0, [3, cst_do], 0],
    cd = [0, [3, cst_let$0], 0];
   function dispatch_html_form$0(counter, name, expr, env){
    var l = Sx_runtime[2].call(null, cst, [0, name, bc]);
    if(Sx_types[71].call(null, l)){
     var
      cond_val =
        trampoline(eval_expr(Sx_runtime[18].call(null, expr, bd), env));
     if(Sx_types[71].call(null, cond_val)){
      var b = Sx_runtime[18].call(null, expr, be);
      return counter < 50
              ? render_to_html$0(counter + 1 | 0, b, env)
              : caml_trampoline_return(render_to_html$0, [0, b, env]);
     }
     var
      m = [0, Sx_runtime[25].call(null, expr), bf],
      n = Sx_runtime[2].call(null, cst$5, m);
     if(! Sx_types[71].call(null, n)) return bh;
     var c = Sx_runtime[18].call(null, expr, bg);
     return counter < 50
             ? render_to_html$0(counter + 1 | 0, c, env)
             : caml_trampoline_return(render_to_html$0, [0, c, env]);
    }
    var o = Sx_runtime[2].call(null, cst, [0, name, bi]), cst_range = "range";
    if(Sx_types[71].call(null, o)){
     var
      p = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bj), env)),
      q = [0, 1 - Sx_types[71].call(null, p)];
     if(Sx_types[71].call(null, q)) return bk;
     var
      r = [0, Sx_runtime[25].call(null, expr), bl],
      s = Sx_runtime[2].call(null, cst, r);
     if(Sx_types[71].call(null, s)){
      var d = Sx_runtime[18].call(null, expr, bm);
      return counter < 50
              ? render_to_html$0(counter + 1 | 0, d, env)
              : caml_trampoline_return(render_to_html$0, [0, d, env]);
     }
     var
      t = [0, bn, [0, Sx_runtime[25].call(null, expr), 0]],
      u = Sx_runtime[2].call(null, cst_range, t),
      v = Sx_runtime[6].call(null, u),
      w =
        [0,
         bo,
         [0,
          [6,
           Stdlib_List[20].call
            (null,
             function(i){
              return render_to_html(Sx_runtime[18].call(null, expr, i), env);
             },
             v)],
          0]];
     return Sx_runtime[2].call(null, cst_join, w);
    }
    var x = Sx_runtime[2].call(null, cst, [0, name, bp]);
    if(Sx_types[71].call(null, x)){
     var branch = eval_cond(Sx_runtime[16].call(null, expr), env);
     return Sx_types[71].call(null, branch)
             ? counter
               < 50
               ? render_to_html$0(counter + 1 | 0, branch, env)
               : caml_trampoline_return(render_to_html$0, [0, branch, env])
             : bq;
    }
    var y = Sx_runtime[2].call(null, cst, [0, name, br]);
    if(Sx_types[71].call(null, y)){
     var e = trampoline(eval_expr(expr, env));
     return counter < 50
             ? render_to_html$0(counter + 1 | 0, e, env)
             : caml_trampoline_return(render_to_html$0, [0, e, env]);
    }
    var z = Sx_runtime[2].call(null, cst, [0, name, bs]);
    if(Sx_types[71].call(null, z)){
     var
      bindings = Sx_runtime[18].call(null, expr, bt),
      body = Sx_runtime[2].call(null, cst_slice, [0, expr, bu]),
      local = Sx_runtime[81].call(null, env),
      A = Sx_runtime[6].call(null, bindings);
     Stdlib_List[18].call
      (null,
       function(pair){
        var
         a = Sx_runtime[15].call(null, pair),
         b = [0, Sx_runtime[74].call(null, a), bv],
         c = Sx_runtime[2].call(null, cst, b);
        if(Sx_types[71].call(null, c))
         var
          d = Sx_runtime[15].call(null, pair),
          pname = Sx_types[72].call(null, d);
        else
         var
          f = [0, Sx_runtime[15].call(null, pair), 0],
          pname = [3, Sx_runtime[5].call(null, f)];
        var e = Sx_runtime[4].call(null, pname);
        Sx_runtime[78].call(null, local, e, 0);
        return 0;
       },
       A);
     var B = Sx_runtime[6].call(null, bindings);
     Stdlib_List[18].call
      (null,
       function(pair){
        var
         a = Sx_runtime[15].call(null, pair),
         b = [0, Sx_runtime[74].call(null, a), bw],
         c = Sx_runtime[2].call(null, cst, b);
        if(Sx_types[71].call(null, c))
         var
          d = Sx_runtime[15].call(null, pair),
          pname = Sx_types[72].call(null, d);
        else
         var
          g = [0, Sx_runtime[15].call(null, pair), 0],
          pname = [3, Sx_runtime[5].call(null, g)];
        var
         e = trampoline(eval_expr(Sx_runtime[18].call(null, pair, bx), local)),
         f = Sx_runtime[4].call(null, pname);
        Sx_runtime[79].call(null, local, f, e);
        return 0;
       },
       B);
     var
      C = [0, Sx_runtime[25].call(null, body), by],
      D = Sx_runtime[2].call(null, cst$5, C);
     if(Sx_types[71].call(null, D)){
      var E = init(body), F = Sx_runtime[6].call(null, E);
      Stdlib_List[18].call
       (null, function(e){trampoline(eval_expr(e, local)); return 0;}, F);
     }
     var g = Sx_runtime[17].call(null, body);
     return counter < 50
             ? render_to_html$0(counter + 1 | 0, g, local)
             : caml_trampoline_return(render_to_html$0, [0, g, local]);
    }
    var
     or = Sx_runtime[2].call(null, cst, [0, name, bz]),
     or$0 =
       Sx_types[71].call(null, or)
        ? or
        : Sx_runtime[2].call(null, cst, [0, name, cd]);
    if(Sx_types[71].call(null, or$0)){
     var
      local$0 = process_bindings(Sx_runtime[18].call(null, expr, bA), env),
      G = [0, Sx_runtime[25].call(null, expr), bB],
      H = Sx_runtime[2].call(null, cst, G);
     if(Sx_types[71].call(null, H)){
      var h = Sx_runtime[18].call(null, expr, bC);
      return counter < 50
              ? render_to_html$0(counter + 1 | 0, h, local$0)
              : caml_trampoline_return(render_to_html$0, [0, h, local$0]);
     }
     var
      I = [0, bD, [0, Sx_runtime[25].call(null, expr), 0]],
      J = Sx_runtime[2].call(null, cst_range, I),
      K = Sx_runtime[6].call(null, J),
      L =
        [0,
         bE,
         [0,
          [6,
           Stdlib_List[20].call
            (null,
             function(i){
              return render_to_html
                      (Sx_runtime[18].call(null, expr, i), local$0);
             },
             K)],
          0]];
     return Sx_runtime[2].call(null, cst_join, L);
    }
    var
     or$1 = Sx_runtime[2].call(null, cst, [0, name, bF]),
     or$2 =
       Sx_types[71].call(null, or$1)
        ? or$1
        : Sx_runtime[2].call(null, cst, [0, name, cc]);
    if(Sx_types[71].call(null, or$2)){
     var
      M = [0, Sx_runtime[25].call(null, expr), bG],
      N = Sx_runtime[2].call(null, cst, M);
     if(Sx_types[71].call(null, N)){
      var i = Sx_runtime[18].call(null, expr, bH);
      return counter < 50
              ? render_to_html$0(counter + 1 | 0, i, env)
              : caml_trampoline_return(render_to_html$0, [0, i, env]);
     }
     var
      O = [0, bI, [0, Sx_runtime[25].call(null, expr), 0]],
      P = Sx_runtime[2].call(null, cst_range, O),
      Q = Sx_runtime[6].call(null, P),
      R =
        [0,
         bJ,
         [0,
          [6,
           Stdlib_List[20].call
            (null,
             function(i){
              return render_to_html(Sx_runtime[18].call(null, expr, i), env);
             },
             Q)],
          0]];
     return Sx_runtime[2].call(null, cst_join, R);
    }
    var S = definition_form_p(name);
    if(Sx_types[71].call(null, S)){
     trampoline(eval_expr(expr, env));
     return bK;
    }
    var T = Sx_runtime[2].call(null, cst, [0, name, bL]);
    if(Sx_types[71].call(null, T)){
     var
      f = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bM), env)),
      coll = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bN), env)),
      U = Sx_runtime[6].call(null, coll),
      V =
        [0,
         bO,
         [0,
          [6,
           Stdlib_List[20].call
            (null,
             function(item){
              var a = is_lambda(f);
              return Sx_types[71].call(null, a)
                      ? render_lambda_html(f, [6, [0, item, 0]], env)
                      : render_to_html
                        (Sx_runtime[8].call(null, f, [6, [0, item, 0]]), env);
             },
             U)],
          0]];
     return Sx_runtime[2].call(null, cst_join, V);
    }
    var W = Sx_runtime[2].call(null, cst, [0, name, bP]);
    if(Sx_types[71].call(null, W)){
     var
      f$0 = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bQ), env)),
      coll$0 = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bR), env)),
      X = Sx_runtime[6].call(null, coll$0),
      Y =
        [0,
         bS,
         [0,
          [6,
           Stdlib_List[21].call
            (null,
             function(i, item){
              var i$0 = [2, i], a = is_lambda(f$0);
              return Sx_types[71].call(null, a)
                      ? render_lambda_html(f$0, [6, [0, i$0, [0, item, 0]]], env)
                      : render_to_html
                        (Sx_runtime[8].call(null, f$0, [6, [0, i$0, [0, item, 0]]]),
                         env);
             },
             X)],
          0]];
     return Sx_runtime[2].call(null, cst_join, Y);
    }
    var Z = Sx_runtime[2].call(null, cst, [0, name, bT]);
    if(Sx_types[71].call(null, Z)){
     var j = trampoline(eval_expr(expr, env));
     return counter < 50
             ? render_to_html$0(counter + 1 | 0, j, env)
             : caml_trampoline_return(render_to_html$0, [0, j, env]);
    }
    var _ = Sx_runtime[2].call(null, cst, [0, name, bU]);
    if(Sx_types[71].call(null, _)){
     var
      f$1 = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bV), env)),
      coll$1 = trampoline(eval_expr(Sx_runtime[18].call(null, expr, bW), env)),
      $ = Sx_runtime[6].call(null, coll$1),
      aa =
        [0,
         bX,
         [0,
          [6,
           Stdlib_List[20].call
            (null,
             function(item){
              var a = is_lambda(f$1);
              return Sx_types[71].call(null, a)
                      ? render_lambda_html(f$1, [6, [0, item, 0]], env)
                      : render_to_html
                        (Sx_runtime[8].call(null, f$1, [6, [0, item, 0]]), env);
             },
             $)],
          0]];
     return Sx_runtime[2].call(null, cst_join, aa);
    }
    var ab = Sx_runtime[2].call(null, cst, [0, name, bY]);
    if(! Sx_types[71].call(null, ab)){
     var am = Sx_runtime[2].call(null, cst, [0, name, b8]);
     if(! Sx_types[71].call(null, am)){
      var k = trampoline(eval_expr(expr, env));
      return counter < 50
              ? render_value_to_html$0(counter + 1 | 0, k, env)
              : caml_trampoline_return(render_value_to_html$0, [0, k, env]);
     }
     var
      prov_name =
        trampoline(eval_expr(Sx_runtime[18].call(null, expr, b9), env)),
      prov_val =
        trampoline(eval_expr(Sx_runtime[18].call(null, expr, b_), env)),
      an = [0, Sx_runtime[25].call(null, expr), b$],
      body_count = Sx_runtime[2].call(null, cst$4, an);
     Sx_runtime[105].call(null, prov_name, prov_val);
     var ao = Sx_runtime[2].call(null, cst, [0, body_count, ca]);
     if(Sx_types[71].call(null, ao))
      var
       result$0 =
         render_to_html(Sx_runtime[18].call(null, expr, body_start), env);
     else
      var
       ap =
         [0,
          body_start,
          [0,
           Sx_runtime[2].call(null, "+", [0, body_start, [0, body_count, 0]]),
           0]],
       aq = Sx_runtime[2].call(null, cst_range, ap),
       ar = Sx_runtime[6].call(null, aq),
       as =
         [0,
          cb,
          [0,
           [6,
            Stdlib_List[20].call
             (null,
              function(i){
               return render_to_html(Sx_runtime[18].call(null, expr, i), env);
              },
              ar)],
           0]],
       result$0 = Sx_runtime[2].call(null, cst_join, as);
     Sx_runtime[106].call(null, prov_name);
     return result$0;
    }
    var
     scope_name =
       trampoline(eval_expr(Sx_runtime[18].call(null, expr, bZ), env)),
     rest_args = Sx_runtime[2].call(null, cst_slice, [0, expr, b0]),
     ac = [0, Sx_runtime[25].call(null, rest_args), b1],
     and = Sx_runtime[2].call(null, cst$1, ac);
    if(Sx_types[71].call(null, and)){
     var
      ad = Sx_runtime[15].call(null, rest_args),
      ae = [0, Sx_runtime[74].call(null, ad), b2],
      and$0 = Sx_runtime[2].call(null, cst, ae);
     if(Sx_types[71].call(null, and$0))
      var
       af = Sx_runtime[15].call(null, rest_args),
       ag = [0, Sx_types[73].call(null, af), b3],
       a = Sx_runtime[2].call(null, cst, ag);
     else
      var a = and$0;
    }
    else
     var a = and;
    if(Sx_types[71].call(null, a))
     var
      ah =
        trampoline(eval_expr(Sx_runtime[18].call(null, rest_args, b4), env)),
      body_exprs = Sx_runtime[2].call(null, cst_slice, [0, rest_args, b5]),
      scope_val = ah;
    else
     var body_exprs = rest_args, scope_val = 0;
    Sx_runtime[105].call(null, scope_name, scope_val);
    var
     ai = [0, Sx_runtime[25].call(null, body_exprs), b6],
     aj = Sx_runtime[2].call(null, cst, ai);
    if(Sx_types[71].call(null, aj))
     var result = render_to_html(Sx_runtime[15].call(null, body_exprs), env);
    else
     var
      ak = Sx_runtime[6].call(null, body_exprs),
      al =
        [0,
         b7,
         [0,
          [6,
           Stdlib_List[20].call
            (null, function(e){return render_to_html(e, env);}, ak)],
          0]],
      result = Sx_runtime[2].call(null, cst_join, al);
    Sx_runtime[106].call(null, scope_name);
    return result;
   }
   function dispatch_html_form(name, expr, env){
    return caml_trampoline(dispatch_html_form$0(0, name, expr, env));
   }
   function render_lambda_html(f, args, env){
    var
     a = Sx_types[76].call(null, f),
     local = Sx_runtime[82].call(null, a, env),
     b = Sx_types[74].call(null, f);
    Sx_runtime[94].call
     (null,
      [15,
       cst$7,
       function(args$0){
        if(args$0){
         var a = args$0[2];
         if(a && ! a[2]){
          var
           p = a[1],
           i = args$0[1],
           b = Sx_runtime[18].call(null, args, i),
           c = Sx_runtime[4].call(null, p);
          return Sx_runtime[78].call(null, local, c, b);
         }
        }
        return 0;
       }],
      b);
    return render_to_html(Sx_types[75].call(null, f), local);
   }
   var
    ce = [6, 0],
    cf = [2, 0.],
    cg = [3, cst_i],
    ch = [0, 0],
    ci = [3, cst_skip],
    cj = [3, cst_skip],
    ck = [3, cst_i],
    cl = [3, cst_i],
    cm = [0, 0],
    cn = [3, cst_skip],
    co = [0, [3, cst_keyword], 0],
    cp = [3, cst_i],
    cq = [3, cst_i],
    cr = [3, cst_i],
    cs = [3, cst_i],
    ct = [0, 1],
    cu = [3, cst_skip],
    cv = [3, cst_i],
    cw = [3, cst_i],
    cx = [3, cst$6],
    cy = [3, "children"];
   function render_html_component$0(counter, comp, args, env){
    var
     kwargs = [7, Stdlib_Hashtbl[1].call(null, 0, 0)],
     b = Sx_runtime[6].call(null, args),
     d = Stdlib_Hashtbl[1].call(null, 0, 2),
     c = Sx_runtime[3].call(null, cg);
    Stdlib_Hashtbl[11].call(null, d, c, cf);
    var e = Sx_runtime[3].call(null, ci);
    Stdlib_Hashtbl[11].call(null, d, e, ch);
    var children = [0, ce];
    Stdlib_List[26].call
     (null,
      function(state, arg){
       var skip = Sx_runtime[26].call(null, state, cj);
       if(Sx_types[71].call(null, skip)){
        var
         b = [0, Sx_runtime[26].call(null, state, ck), 0],
         c =
           [0,
            state,
            [0,
             cn,
             [0, cm, [0, cl, [0, Sx_runtime[2].call(null, cst_inc, b), 0]]]]];
        return Sx_runtime[2].call(null, cst_assoc, c);
       }
       var
        d = [0, Sx_runtime[74].call(null, arg), co],
        and = Sx_runtime[2].call(null, cst, d);
       if(Sx_types[71].call(null, and))
        var
         e = [0, Sx_runtime[25].call(null, args), 0],
         f = [0, Sx_runtime[26].call(null, state, cp), 0],
         g = [0, Sx_runtime[2].call(null, cst_inc, f), e],
         a = Sx_runtime[2].call(null, cst$0, g);
       else
        var a = and;
       if(Sx_types[71].call(null, a)){
        var
         h = [0, Sx_runtime[26].call(null, state, cq), 0],
         i = Sx_runtime[2].call(null, cst_inc, h),
         val = trampoline(eval_expr(Sx_runtime[18].call(null, args, i), env)),
         j = Sx_types[73].call(null, arg);
        Sx_runtime[12].call(null, kwargs, j, val);
        var
         k = [0, Sx_runtime[26].call(null, state, cr), 0],
         l =
           [0,
            state,
            [0,
             cu,
             [0, ct, [0, cs, [0, Sx_runtime[2].call(null, cst_inc, k), 0]]]]];
        return Sx_runtime[2].call(null, cst_assoc, l);
       }
       children[1] = Sx_runtime[11].call(null, children[1], arg);
       var
        m = [0, Sx_runtime[26].call(null, state, cv), 0],
        n = [0, state, [0, cw, [0, Sx_runtime[2].call(null, cst_inc, m), 0]]];
       return Sx_runtime[2].call(null, cst_assoc, n);
      },
      [7, d],
      b);
    var
     f = Sx_types[85].call(null, comp),
     local = Sx_runtime[82].call(null, f, env),
     g = Sx_types[83].call(null, comp),
     h = Sx_runtime[6].call(null, g);
    Stdlib_List[18].call
     (null,
      function(p){
       var
        a = dict_has(kwargs, p),
        b = Sx_types[71].call(null, a) ? dict_get(kwargs, p) : 0,
        c = Sx_runtime[4].call(null, p);
       Sx_runtime[78].call(null, local, c, b);
       return 0;
      },
      h);
    var i = Sx_types[86].call(null, comp);
    if(Sx_types[71].call(null, i)){
     var
      j = Sx_runtime[6].call(null, children[1]),
      k =
        [0,
         cx,
         [0,
          [6,
           Stdlib_List[20].call
            (null, function(c){return render_to_html(c, env);}, j)],
          0]],
      l = make_raw_html(Sx_runtime[2].call(null, cst_join, k)),
      m = Sx_runtime[4].call(null, cy);
     Sx_runtime[78].call(null, local, m, l);
    }
    var a = Sx_types[84].call(null, comp);
    return counter < 50
            ? render_to_html$0(counter + 1 | 0, a, local)
            : caml_trampoline_return(render_to_html$0, [0, a, local]);
   }
   function render_html_component(comp, args, env){
    return caml_trampoline(render_html_component$0(0, comp, args, env));
   }
   var
    cz = [2, 1.],
    cA = [0, [3, " />"], 0],
    cB = [3, cst$0],
    cC = [3, cst_element_attrs],
    cD = [3, cst$6],
    cE = [3, cst_element_attrs],
    cF = [3, cst_element_attrs],
    cG = [0, [3, cst$5], 0],
    cH = [3, "<\/"],
    cI = [3, cst$5],
    cJ = [3, cst$0];
   function render_html_element(tag, args, env){
    var
     parsed = parse_element_args(args, env),
     attrs = Sx_runtime[15].call(null, parsed),
     children = Sx_runtime[18].call(null, parsed, cz),
     is_void =
       Sx_runtime[2].call
        (null, cst_contains, [0, void_elements_val, [0, tag, 0]]);
    if(Sx_types[71].call(null, is_void)){
     var a = [0, cB, [0, tag, [0, render_attrs(attrs), cA]]];
     return [3, Sx_runtime[5].call(null, a)];
    }
    Sx_runtime[105].call(null, cC, 0);
    var
     b = Sx_runtime[6].call(null, children),
     c =
       [0,
        cD,
        [0,
         [6,
          Stdlib_List[20].call
           (null, function(c){return render_to_html(c, env);}, b)],
         0]],
     content = Sx_runtime[2].call(null, cst_join, c),
     d = scope_emitted(cE),
     e = Sx_runtime[6].call(null, d);
    Stdlib_List[18].call
     (null,
      function(spread_dict){merge_spread_attrs(attrs, spread_dict); return 0;},
      e);
    Sx_runtime[106].call(null, cF);
    var
     f =
       [0,
        cJ,
        [0,
         tag,
         [0,
          render_attrs(attrs),
          [0, cI, [0, content, [0, cH, [0, tag, cG]]]]]]];
    return [3, Sx_runtime[5].call(null, f)];
   }
   render_to_html_ref[1] = render_to_html;
   function escape_html_buf(buf, s){
    var a = caml_ml_string_length(s) - 1 | 0;
    if(a >= 0){
     var i = 0;
     for(;;){
      var c = runtime.caml_string_unsafe_get(s, i);
      a:
      if(34 === c)
       Stdlib_Buffer[16].call(null, buf, cst_quot);
      else{
       if(60 <= c){
        if(63 > c)
         switch(c - 60 | 0){
           case 0:
            Stdlib_Buffer[16].call(null, buf, cst_lt); break a;
           case 2:
            Stdlib_Buffer[16].call(null, buf, cst_gt); break a;
         }
       }
       else if(38 === c){Stdlib_Buffer[16].call(null, buf, cst_amp); break a;}
       Stdlib_Buffer[12].call(null, buf, c);
      }
      var b = i + 1 | 0;
      if(a === i) break;
      i = b;
     }
    }
    return 0;
   }
   function render_attrs_buf(buf, attrs){
    return Stdlib_Hashtbl[12].call
            (null,
             function(k, v){
              if(is_boolean_attr(k)){
               var a = Sx_types[71].call(null, v);
               return a
                       ? (Stdlib_Buffer
                           [12].call
                          (null, buf, 32),
                         Stdlib_Buffer[16].call(null, buf, k))
                       : a;
              }
              var b = 0 !== v ? 1 : 0;
              return b
                      ? (Stdlib_Buffer
                          [12].call
                         (null, buf, 32),
                        Stdlib_Buffer[16].call(null, buf, k),
                        Stdlib_Buffer[16].call(null, buf, cst$8),
                        escape_html_buf(buf, Sx_types[35].call(null, v)),
                        Stdlib_Buffer[12].call(null, buf, 34))
                      : b;
             },
             attrs);
   }
   function render_to_buf(buf, expr, env){
    var v = caml_call2(render_to_html_ref[1], expr, [20, env]);
    if(typeof v !== "number")
     switch(v[0]){
       case 3:
       case 17:
        var s = v[1]; return Stdlib_Buffer[16].call(null, buf, s);
     }
    var a = Sx_runtime[3].call(null, v);
    return Stdlib_Buffer[16].call(null, buf, a);
   }
   function render_to_buffer(buf, expr, env){return render_to_buf(buf, expr, env);
   }
   function render_to_html_streaming(expr, env){
    var v = caml_call2(render_to_html_ref[1], expr, [20, env]);
    if(typeof v !== "number")
     switch(v[0]){case 3:case 17: var s = v[1]; return s;}
    return Sx_runtime[3].call(null, v);
   }
   function do_render_to_html(expr, env_val){
    var v = caml_call2(render_to_html_ref[1], expr, env_val);
    if(typeof v !== "number")
     switch(v[0]){case 3:case 17: var s = v[1]; return s;}
    return Sx_runtime[3].call(null, v);
   }
   var cst_render_to_html = "render-to-html";
   function sx_render_to_html(render_env, expr, eval_env){
    if(! Sx_types[28].call(null, render_env, cst_render_to_html))
     return do_render_to_html(expr, [20, eval_env]);
    var
     fn = Sx_types[30].call(null, render_env, cst_render_to_html),
     result =
       Sx_ref[222].call(null, fn, [6, [0, expr, [0, [20, eval_env], 0]]]);
    if(typeof result !== "number")
     switch(result[0]){case 3:case 17: var s = result[1]; return s;}
    return Sx_runtime[3].call(null, result);
   }
   function is_html_tag(name){
    return Stdlib_List[37].call(null, name, html_tags_list);
   }
   function is_void(name){
    return Stdlib_List[37].call(null, name, void_elements_list);
   }
   var cK = [3, cst$6], cL = [4, cst_do], cM = [3, cst$6], cN = [4, cst_do];
   function setup_render_env(raw_env){
    var env = [20, raw_env];
    function bind(name, fn){
     Sx_types[26].call(null, raw_env, name, [15, name, fn]);
     return 0;
    }
    bind
     ("render-html",
      function(args){
       if(args){
        var expr = args[1];
        if(typeof expr !== "number" && 3 === expr[0] && ! args[2]){
         var src = expr[1], exprs = Sx_parser[17].call(null, src);
         if(exprs)
          if(exprs[2])
           var expr$0 = [6, [0, cL, exprs]];
          else
           var e$0 = exprs[1], expr$0 = e$0;
         else
          var expr$0 = 0;
         return caml_call2(render_to_html_ref[1], expr$0, env);
        }
        var match = args[2];
        if(! match) return caml_call2(render_to_html_ref[1], expr, env);
        var a = match[1];
        if(typeof a !== "number" && 20 === a[0] && ! match[2]){
         var e = a[1];
         return caml_call2(render_to_html_ref[1], expr, [20, e]);
        }
       }
       return cK;
      });
    return bind
            (cst_render_to_html,
             function(args){
              if(args){
               var expr = args[1];
               if(typeof expr !== "number" && 3 === expr[0] && ! args[2]){
                var src = expr[1], exprs = Sx_parser[17].call(null, src);
                if(exprs)
                 if(exprs[2])
                  var expr$0 = [6, [0, cN, exprs]];
                 else
                  var e$0 = exprs[1], expr$0 = e$0;
                else
                 var expr$0 = 0;
                return caml_call2(render_to_html_ref[1], expr$0, env);
               }
               var match = args[2];
               if(! match)
                return caml_call2(render_to_html_ref[1], expr, env);
               var a = match[1];
               if(typeof a !== "number" && 20 === a[0] && ! match[2]){
                var e = a[1];
                return caml_call2(render_to_html_ref[1], expr, [20, e]);
               }
              }
              return cM;
             });
   }
   runtime.caml_register_global
    (384,
     [0,
      eval_expr,
      cond_scheme_p,
      raw_html_content,
      make_raw_html,
      scope_emit,
      init,
      dict_has,
      dict_get,
      is_component,
      is_island,
      is_macro,
      is_lambda,
      is_nil,
      render_html_lake_ref,
      render_html_marsh_ref,
      render_html_island_ref,
      render_html_lake,
      render_html_marsh,
      render_html_island,
      cek_call,
      trampoline,
      expand_macro,
      try_catch,
      set_render_active_b,
      boolean_attrs_set,
      is_boolean_attr,
      html_tags_list,
      html_tags_list,
      html_tags_val,
      void_elements_list,
      void_elements_list,
      void_elements_val,
      boolean_attrs_set,
      boolean_attrs_val,
      escape_html_raw,
      escape_html_raw,
      escape_html_val,
      escape_attr_val,
      render_attrs,
      render_to_html_ref,
      scope_emitted,
      render_html_forms,
      definition_form_extensions,
      definition_form_p,
      parse_element_args,
      eval_cond,
      eval_cond_scheme,
      eval_cond_clojure,
      process_bindings,
      is_render_expr_p,
      merge_spread_attrs,
      render_to_html,
      render_value_to_html,
      render_html_form_p,
      render_list_to_html,
      dispatch_html_form,
      render_lambda_html,
      render_html_component,
      render_html_element,
      escape_html_buf,
      render_attrs_buf,
      render_to_buf,
      render_to_buffer,
      render_to_html_streaming,
      do_render_to_html,
      sx_render_to_html,
      is_html_tag,
      is_void,
      escape_html_raw,
      setup_render_env],
     "Sx_render");
   return;
  }
  (globalThis));

//# 15 "../.js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js"
//# shape: Jsoo_runtime__Runtime_version:[N,N]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   runtime.caml_register_global
    (2, [0, "6.3.2", ""], "Jsoo_runtime__Runtime_version");
   return;
  }
  (globalThis));

//# 28 "../.js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js"
//# shape: Jsoo_runtime:[[],[[F(1)],N,N],[F(1),F(2),F(1),N],[],[[]],[],[]]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    global_data = runtime.caml_get_global_data(),
    Assert_failure = global_data.Assert_failure,
    Jsoo_runtime_Runtime_version = global_data.Jsoo_runtime__Runtime_version,
    Stdlib_Callback = global_data.Stdlib__Callback,
    a = [0, "lib/runtime/jsoo_runtime.ml", 166, 13];
   function effects(param){
    var match = runtime.caml_jsoo_flags_effects(0);
    if(match === "cps") return 3356934;
    if(match === "disabled") return -709493348;
    if(match !== "double-translation")
     throw caml_maybe_attach_backtrace([0, Assert_failure, a], 1);
    return -766114909;
   }
   var
    version = Jsoo_runtime_Runtime_version[1],
    git_version = Jsoo_runtime_Runtime_version[2],
    Exn = [248, "Jsoo_runtime.Error.Exn", runtime.caml_fresh_oo_id(0)];
   Stdlib_Callback[2].call(null, "jsError", [0, Exn, [0]]);
   var
    Error =
      [0,
       runtime.caml_throw_js_exception,
       runtime.caml_exn_with_js_backtrace,
       runtime.caml_js_error_option_of_exception,
       Exn];
   runtime.caml_register_global
    (9,
     [0,
      [0],
      [0, [0, effects], version, git_version],
      Error,
      [0],
      [0, [0]],
      [0],
      [0]],
     "Jsoo_runtime");
   return;
  }
  (globalThis));

//# 16 "../.js/default/js_of_ocaml/js_of_ocaml.cma.js"
//# shape: Js_of_ocaml__Import:[[],[F(2)*,F(2)*],[F(2),F(2),N,F(1),F(1),F(5),F(2),F(2)*,F(2)*,F(2),F(2),F(3),F(3),F(2),F(3),F(2),F(2),F(2),F(3),F(3),F(2),F(2),F(1),F(1),F(1),F(1),F(1),F(1),F(2),F(2),F(3),F(3),F(3),F(3),F(2),F(2),F(2),F(2),F(1)*,F(1)*,F(1),F(2),F(1),F(2),F(1),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(2),F(1),F(2),F(2),F(2),F(2),F(2),F(2),F(2)*],[F(1),F(1),F(1)*,F(1)*,F(2)*,F(2)*,F(1)*,F(2)*],F(2)*,F(2)*]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    global_data = runtime.caml_get_global_data(),
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Char = global_data.Stdlib__Char;
   function max(x, y){return y <= x ? x : y;}
   function min(x, y){return x <= y ? x : y;}
   var
    make = Stdlib_String[1],
    init = Stdlib_String[2],
    empty = Stdlib_String[3],
    of_bytes = Stdlib_String[4],
    to_bytes = Stdlib_String[5],
    blit = Stdlib_String[6],
    concat = Stdlib_String[7],
    cat = Stdlib_String[8],
    compare = Stdlib_String[10],
    starts_with = Stdlib_String[11],
    ends_with = Stdlib_String[12],
    contains_from = Stdlib_String[13],
    rcontains_from = Stdlib_String[14],
    contains = Stdlib_String[15],
    sub = Stdlib_String[16],
    split_on_char = Stdlib_String[17],
    map = Stdlib_String[18],
    mapi = Stdlib_String[19],
    fold_left = Stdlib_String[20],
    fold_right = Stdlib_String[21],
    for_all = Stdlib_String[22],
    exists = Stdlib_String[23],
    trim = Stdlib_String[24],
    escaped = Stdlib_String[25],
    uppercase_ascii = Stdlib_String[26],
    lowercase_ascii = Stdlib_String[27],
    capitalize_ascii = Stdlib_String[28],
    uncapitalize_ascii = Stdlib_String[29],
    iter = Stdlib_String[30],
    iteri = Stdlib_String[31],
    index_from = Stdlib_String[32],
    index_from_opt = Stdlib_String[33],
    rindex_from = Stdlib_String[34],
    rindex_from_opt = Stdlib_String[35],
    index = Stdlib_String[36],
    index_opt = Stdlib_String[37],
    rindex = Stdlib_String[38],
    rindex_opt = Stdlib_String[39],
    to_seq = Stdlib_String[40],
    to_seqi = Stdlib_String[41],
    of_seq = Stdlib_String[42],
    get_utf_8_uchar = Stdlib_String[43],
    is_valid_utf_8 = Stdlib_String[44],
    get_utf_16be_uchar = Stdlib_String[45],
    is_valid_utf_16be = Stdlib_String[46],
    get_utf_16le_uchar = Stdlib_String[47],
    is_valid_utf_16le = Stdlib_String[48],
    get_uint8 = Stdlib_String[49],
    get_int8 = Stdlib_String[50],
    get_uint16_ne = Stdlib_String[51],
    get_uint16_be = Stdlib_String[52],
    get_uint16_le = Stdlib_String[53],
    get_int16_ne = Stdlib_String[54],
    get_int16_be = Stdlib_String[55],
    get_int16_le = Stdlib_String[56],
    get_int32_ne = Stdlib_String[57],
    hash = Stdlib_String[58],
    seeded_hash = Stdlib_String[59],
    get_int32_be = Stdlib_String[60],
    get_int32_le = Stdlib_String[61],
    get_int64_ne = Stdlib_String[62],
    get_int64_be = Stdlib_String[63],
    get_int64_le = Stdlib_String[64],
    equal = runtime.caml_string_equal,
    chr = Stdlib_Char[1],
    escaped$0 = Stdlib_Char[2],
    lowercase_ascii$0 = Stdlib_Char[3],
    uppercase_ascii$0 = Stdlib_Char[4],
    compare$0 = Stdlib_Char[5],
    seeded_hash$0 = Stdlib_Char[7],
    hash$0 = Stdlib_Char[8];
   function equal$0(x, y){return x === y ? 1 : 0;}
   runtime.caml_register_global
    (2,
     [0,
      [0],
      [0, max, min],
      [0,
       make,
       init,
       empty,
       of_bytes,
       to_bytes,
       blit,
       concat,
       cat,
       compare,
       starts_with,
       ends_with,
       contains_from,
       rcontains_from,
       contains,
       sub,
       split_on_char,
       map,
       mapi,
       fold_left,
       fold_right,
       for_all,
       exists,
       trim,
       escaped,
       uppercase_ascii,
       lowercase_ascii,
       capitalize_ascii,
       uncapitalize_ascii,
       iter,
       iteri,
       index_from,
       index_from_opt,
       rindex_from,
       rindex_from_opt,
       index,
       index_opt,
       rindex,
       rindex_opt,
       to_seq,
       to_seqi,
       of_seq,
       get_utf_8_uchar,
       is_valid_utf_8,
       get_utf_16be_uchar,
       is_valid_utf_16be,
       get_utf_16le_uchar,
       is_valid_utf_16le,
       get_uint8,
       get_int8,
       get_uint16_ne,
       get_uint16_be,
       get_uint16_le,
       get_int16_ne,
       get_int16_be,
       get_int16_le,
       get_int32_ne,
       hash,
       seeded_hash,
       get_int32_be,
       get_int32_le,
       get_int64_ne,
       get_int64_be,
       get_int64_le,
       equal],
      [0,
       chr,
       escaped$0,
       lowercase_ascii$0,
       uppercase_ascii$0,
       compare$0,
       seeded_hash$0,
       hash$0,
       equal$0],
      max,
      min],
     "Js_of_ocaml__Import");
   return;
  }
  (globalThis));

//# 188 "../.js/default/js_of_ocaml/js_of_ocaml.cma.js"
//# shape: Js_of_ocaml__Js:[N,F(1)*,N,F(1)*,[N,F(1)*,F(2),F(2),F(1)*,F(2),F(3),F(2),F(1)*,F(1)*],[N,F(1)*,F(2),F(2),F(1)*,F(2),F(3),F(2),F(1)*,F(1)*],N,N,N,N,N,N,N,N,N,N,F(1),N,N,F(2),F(3),F(2),F(2),F(1)*,F(1)*,N,N,N,N,N,N,N,N,N,N,N,N,N,F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(3),F(2),F(1),[N],F(1),F(1),F(2),F(1),N]
(function
  (globalThis){
   "use strict";
   var
    jsoo_exports = typeof module === "object" && module.exports || globalThis,
    runtime = globalThis.jsoo_runtime,
    caml_js_get = runtime.caml_js_get,
    caml_js_set = runtime.caml_js_set,
    caml_js_wrap_callback = runtime.caml_js_wrap_callback,
    caml_string_of_jsstring = runtime.caml_string_of_jsstring;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   var
    global_data = runtime.caml_get_global_data(),
    Js_of_ocaml_Import = global_data.Js_of_ocaml__Import,
    Stdlib = global_data.Stdlib,
    Jsoo_runtime = global_data.Jsoo_runtime,
    Stdlib_Printexc = global_data.Stdlib__Printexc,
    global = globalThis,
    null$ = null,
    undefined$ = undefined;
   function return$(a){return a;}
   function map(x, f){return x == null$ ? null$ : caml_call1(f, x);}
   function bind(x, f){return x == null$ ? null$ : caml_call1(f, x);}
   function test(x){return 1 - (x == null$);}
   function iter(x, f){
    var a = 1 - (x == null$);
    return a ? caml_call1(f, x) : a;
   }
   function case$(x, f, g){
    return x == null$ ? caml_call1(f, 0) : caml_call1(g, x);
   }
   function get(x, f){return x == null$ ? caml_call1(f, 0) : x;}
   function option(x){if(! x) return null$; var x$0 = x[1]; return x$0;}
   function to_option(x){return x == null$ ? 0 : [0, x];}
   function return$0(a){return a;}
   function map$0(x, f){
    return x === undefined$ ? undefined$ : caml_call1(f, x);
   }
   function bind$0(x, f){
    return x === undefined$ ? undefined$ : caml_call1(f, x);
   }
   function test$0(x){return 1 - (x === undefined$);}
   function iter$0(x, f){
    var a = 1 - (x === undefined$);
    return a ? caml_call1(f, x) : a;
   }
   function case$0(x, f, g){
    return x === undefined$ ? caml_call1(f, 0) : caml_call1(g, x);
   }
   function get$0(x, f){return x === undefined$ ? caml_call1(f, 0) : x;}
   function option$0(x){
    if(! x) return undefined$;
    var x$0 = x[1];
    return x$0;
   }
   function to_option$0(x){return x === undefined$ ? 0 : [0, x];}
   function coerce(x, f, g){
    var x$0 = caml_call1(f, x);
    return x$0 == null$ ? caml_call1(g, x) : x$0;
   }
   function coerce_opt(x, f, g){
    var x$0 = bind(x, f);
    return x$0 == null$ ? caml_call1(g, x) : x$0;
   }
   var
    string_constr = global.String,
    regExp = global.RegExp,
    object_constructor = global.Object;
   function object_keys(t4){return object_constructor.keys(t4);}
   var array_constructor = global.Array;
   function array_map(f, t6){
    var
     cb =
       caml_js_wrap_callback
        (function(x, idx, param){return caml_call1(f, x);});
    return t6.map(cb);
   }
   function array_mapi(f, t6){
    var
     cb =
       caml_js_wrap_callback
        (function(x, idx, param){return caml_call2(f, idx, x);});
    return t6.map(cb);
   }
   function str_array(a){return a;}
   function match_result(a){return a;}
   var
    date_constr = global.Date,
    math = global.Math,
    error_constr = global.Error,
    include = Jsoo_runtime[3],
    raise = include[1],
    exn_with_js_backtrace = include[2],
    of_exn = include[3],
    Error = include[4];
   function name(t11){return caml_string_of_jsstring(t11.name);}
   function message(t12){return caml_string_of_jsstring(t12.message);}
   function stack(t13){
    var x = t13.stack, a = x == null$ ? null$ : caml_string_of_jsstring(x);
    return to_option(a);
   }
   function to_string(t14){return caml_string_of_jsstring(t14.toString());}
   function raise_js_error(e){return raise(e);}
   function string_of_error(e){return to_string(e);}
   var JSON = global.JSON;
   function decodeURI(s){return global.decodeURI(s);}
   function decodeURIComponent(s){return global.decodeURIComponent(s);}
   function encodeURI(s){return global.encodeURI(s);}
   function encodeURIComponent(s){return global.encodeURIComponent(s);}
   function escape(s){return global.escape(s);}
   function unescape(s){return global.unescape(s);}
   function isNaN(i){return global.isNaN(i) | 0;}
   function parseInt(s){
    var s$0 = global.parseInt(s);
    return isNaN(s$0) ? Stdlib[2].call(null, "parseInt") : s$0;
   }
   function parseFloat(s){
    var s$0 = global.parseFloat(s);
    return isNaN(s$0) ? Stdlib[2].call(null, "parseFloat") : s$0;
   }
   Stdlib_Printexc[9].call
    (null,
     function(e){
      if(e instanceof error_constr) return [0, to_string(e)];
      if(e[1] !== Error) return 0;
      var e$0 = e[2];
      return [0, to_string(e$0)];
     });
   function export_js(field, x){
    var
     a = caml_string_of_jsstring(typeof x),
     b =
       Js_of_ocaml_Import[3][64].call(null, a, "function")
        ? 0 < x.length ? caml_js_wrap_callback(x) : x
        : x;
    return jsoo_exports[field] = b;
   }
   function export$(field, x){
    return export_js(runtime.caml_jsstring_of_string(field), x);
   }
   function export_all(obj){
    var
     keys = object_constructor.keys(obj),
     t26 =
       caml_js_wrap_callback
        (function(key, a, param){return export_js(key, obj[key]);});
    return keys.forEach(t26);
   }
   var
    Js_of_ocaml_Js =
      [0,
       null$,
       function(a){return a;},
       undefined$,
       function(a){return a;},
       [0,
        null$,
        return$,
        map,
        bind,
        test,
        iter,
        case$,
        get,
        option,
        to_option],
       [0,
        undefined$,
        return$0,
        map$0,
        bind$0,
        test$0,
        iter$0,
        case$0,
        get$0,
        option$0,
        to_option$0],
       true,
       false,
       "NFD",
       "NFC",
       "NFKD",
       "NFKC",
       string_constr,
       regExp,
       regExp,
       regExp,
       object_keys,
       array_constructor,
       array_constructor,
       caml_js_get,
       caml_js_set,
       array_map,
       array_mapi,
       str_array,
       match_result,
       date_constr,
       date_constr,
       date_constr,
       date_constr,
       date_constr,
       date_constr,
       date_constr,
       date_constr,
       date_constr,
       math,
       error_constr,
       [0,
        to_string,
        name,
        message,
        stack,
        raise,
        exn_with_js_backtrace,
        of_exn,
        Error,
        function(a){return a;},
        function(a){return a;}],
       JSON,
       decodeURI,
       decodeURIComponent,
       encodeURI,
       encodeURIComponent,
       escape,
       unescape,
       isNaN,
       parseInt,
       parseFloat,
       coerce,
       coerce_opt,
       export$,
       export_all,
       [0, global],
       string_of_error,
       raise_js_error,
       exn_with_js_backtrace,
       runtime.caml_js_error_of_exception,
       Error];
   runtime.caml_register_global(42, Js_of_ocaml_Js, "Js_of_ocaml__Js");
   return;
  }
  (globalThis));

//# 5 ".sx_browser.eobjs/jsoo/dune__exe__Sx_browser.cmo.js"
//# shape: Dune__exe__Sx_browser:[]
(function
  (globalThis){
   "use strict";
   var
    runtime = globalThis.jsoo_runtime,
    caml_int_of_string = runtime.caml_int_of_string,
    caml_js_from_array = runtime.caml_js_from_array,
    caml_js_wrap_callback = runtime.caml_js_wrap_callback,
    caml_jsstring_of_string = runtime.caml_jsstring_of_string,
    caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace,
    caml_string_of_jsstring = runtime.caml_string_of_jsstring,
    caml_wrap_exception = runtime.caml_wrap_exception;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   function caml_call2(f, a0, a1){
    return (f.l >= 0 ? f.l : f.l = f.length) === 2
            ? f(a0, a1)
            : runtime.caml_call_gen(f, [a0, a1]);
   }
   function caml_call4(f, a0, a1, a2, a3){
    return (f.l >= 0 ? f.l : f.l = f.length) === 4
            ? f(a0, a1, a2, a3)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3]);
   }
   function caml_call5(f, a0, a1, a2, a3, a4){
    return (f.l >= 0 ? f.l : f.l = f.length) === 5
            ? f(a0, a1, a2, a3, a4)
            : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]);
   }
   var
    dummy = 0,
    global_data = runtime.caml_get_global_data(),
    Sx_vm = global_data.Sx_vm,
    Sx_types = global_data.Sx_types,
    Stdlib_List = global_data.Stdlib__List,
    Stdlib_String = global_data.Stdlib__String,
    Stdlib_Printf = global_data.Stdlib__Printf,
    Stdlib = global_data.Stdlib,
    Js_of_ocaml_Js = global_data.Js_of_ocaml__Js,
    Stdlib_Printexc = global_data.Stdlib__Printexc,
    Stdlib_Hashtbl = global_data.Stdlib__Hashtbl,
    Stdlib_Array = global_data.Stdlib__Array,
    Stdlib_Option = global_data.Stdlib__Option,
    Sx_vm_ref = global_data.Sx_vm_ref,
    Sx_ref = global_data.Sx_ref,
    Sx_primitives = global_data.Sx_primitives,
    Sx_runtime = global_data.Sx_runtime,
    Sx_render = global_data.Sx_render,
    Sx_parser = global_data.Sx_parser,
    handle_table = Stdlib_Hashtbl[1].call(null, 0, 256),
    next_handle = [0, 0];
   function alloc_handle(v){
    var id = next_handle[1];
    next_handle[1]++;
    Stdlib_Hashtbl[11].call(null, handle_table, id, v);
    return id;
   }
   var
    a =
      [0,
       [11, "Invalid SX handle: ", [4, 0, 0, 0, 0]],
       "Invalid SX handle: %d"];
   function get_handle(id){
    var match = Stdlib_Hashtbl[7].call(null, handle_table, id);
    if(match){var v = match[1]; return v;}
    var b = caml_call1(Stdlib_Printf[4].call(null, a), id);
    throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
   }
   var
    alloc_host_handle =
      function(){
        var t = {}, n = 0;
        return {put: function(obj){var id = n++; t[id] = obj; return id;},
                get: function(id){return t[id];}};
       }
       (),
    next_host_handle = [0, 0];
   function host_put(obj){
    var id = next_host_handle[1];
    next_host_handle[1]++;
    alloc_host_handle.put(obj);
    return id;
   }
   Sx_primitives[12].call(null, 0);
   var global_env = Sx_types[20].call(null, 0);
   function call_sx_fn(fn, args){
    var result = Sx_runtime[7].call(null, fn, args);
    return caml_call1(Sx_primitives[3][1], result);
   }
   function tag_fn(fn, handle, type){
    fn.__sx_handle = handle;
    fn._type = type;
    return fn;
   }
   var
    cst_callback = " [callback ",
    cst_callback_s_handle_d = " [callback %s handle=%d]",
    cst_vm_pending_cek = " [vm: pending_cek=",
    cst_vm_pending_cek_b_reuse_d_f =
      " [vm: pending_cek=%b reuse=%d frames=[%s] sp=%d]",
    cst_frames = " frames=[",
    cst_handle = " handle=",
    cst_reuse = " reuse=",
    cst$0 = ",",
    cst = "?",
    cst_sx_resume = "[sx] resume: ",
    cst_sp = "] sp=",
    cst_host_handle = "__host_handle",
    cst_dict = "dict",
    cst_keyword = "keyword",
    cst_list = "list",
    cst_symbol = "symbol",
    b =
      [0,
       [11,
        cst_vm_pending_cek,
        [9,
         0,
         [11,
          cst_reuse,
          [4,
           0,
           0,
           0,
           [11, cst_frames, [2, 0, [11, cst_sp, [4, 0, 0, 0, [12, 93, 0]]]]]]]]],
       cst_vm_pending_cek_b_reuse_d_f],
    c =
      [0,
       [11, cst_callback, [2, 0, [11, cst_handle, [4, 0, 0, 0, [12, 93, 0]]]]],
       cst_callback_s_handle_d],
    d =
      [0,
       [11, cst_callback, [2, 0, [11, cst_handle, [4, 0, 0, 0, [12, 93, 0]]]]],
       cst_callback_s_handle_d];
   function value_to_js(v){
    a:
    {
     if(typeof v !== "number"){
      switch(v[0]){
        case 0:
         var b$0 = v[1]; return ! ! b$0;
        case 1:
         var n = v[1]; return n;
        case 2:
         var n$0 = v[1]; return n$0;
        case 4:
         var s$0 = v[1];
         return {_type: cst_symbol, name: caml_jsstring_of_string(s$0)};
        case 5:
         var k = v[1];
         return {_type: cst_keyword, name: caml_jsstring_of_string(k)};
        case 6:
         var items = v[1]; break;
        case 7:
         var
          d$0 = v[1],
          match = Stdlib_Hashtbl[7].call(null, d$0, cst_host_handle);
         if(match){
          var match$0 = match[1];
          if(typeof match$0 !== "number" && 2 === match$0[0]){
           var n$1 = match$0[1], id = n$1 | 0;
           return alloc_host_handle.get(id);
          }
         }
         var obj = {};
         obj._type = cst_dict;
         Stdlib_Hashtbl[12].call
          (null,
           function(k, v){
            return obj[caml_jsstring_of_string(k)] = value_to_js(v);
           },
           d$0);
         return obj;
        case 21:
         var items = v[1][1]; break;
        case 3:
        case 17:
         var s = v[1]; return caml_jsstring_of_string(s);
        case 8:
        case 13:
        case 14:
        case 15:
        case 24:
         var
          handle$0 = alloc_handle(v),
          inner =
            caml_js_wrap_callback
             (function(args_js){
               try{
                var arg = js_to_value(args_js);
                a:
                {
                 if(typeof arg === "number" && ! arg){var args = 0; break a;}
                 var args = [0, arg, 0];
                }
                var result = call_sx_fn(v, args), k = value_to_js(result);
                return k;
               }
               catch(exn$0){
                var exn = caml_wrap_exception(exn$0);
                if(exn[1] !== Sx_vm[1]){
                 if(exn[1] === Sx_types[9]){
                  var
                   msg = exn[2],
                   a = Sx_types[61].call(null, v),
                   fn_info =
                     caml_call2(Stdlib_Printf[4].call(null, c), a, handle$0),
                   e = Stdlib[28].call(null, msg, fn_info),
                   f =
                     caml_jsstring_of_string(Stdlib[28].call(null, "[sx] ", e));
                  Js_of_ocaml_Js[52][1].console.error(f);
                  return Js_of_ocaml_Js[1];
                 }
                 var
                  g = Sx_types[61].call(null, v),
                  fn_info$0 =
                    caml_call2(Stdlib_Printf[4].call(null, d), g, handle$0),
                  h = Stdlib_Printexc[1].call(null, exn),
                  i = Stdlib[28].call(null, h, fn_info$0),
                  j =
                    caml_jsstring_of_string
                     (Stdlib[28].call(null, "[sx] UNCAUGHT: ", i));
                 Js_of_ocaml_Js[52][1].console.error(j);
                 return Js_of_ocaml_Js[1];
                }
                var vm = exn[3], request = exn[2], match = Sx_vm[8][1];
                if(match){
                 var active = match[1];
                 if(0 !== active[7]){
                  vm[7] = Stdlib[37].call(null, vm[7], active[7]);
                  active[7] = 0;
                 }
                }
                var
                 make_suspension =
                   function(req, v){
                    var obj = {};
                    obj.suspended = Js_of_ocaml_Js[7];
                    obj.request = value_to_js(req);
                    obj.resume =
                     caml_js_wrap_callback
                      (function(result_js){
                        var result = js_to_value(result_js);
                        try{
                         var h = value_to_js(Sx_vm[34].call(null, v, result));
                         return h;
                        }
                        catch(exn$0){
                         var exn = caml_wrap_exception(exn$0);
                         if(exn[1] === Sx_vm[1]){
                          var vm2 = exn[3], req2 = exn[2];
                          return make_suspension(req2, vm2);
                         }
                         if(exn[1] !== Sx_types[9])
                          throw caml_maybe_attach_backtrace(exn, 0);
                         var
                          msg = exn[2],
                          a =
                            Stdlib_List[20].call
                             (null,
                              function(f){
                               var match = f[1][3];
                               if(! match) return cst;
                               var n = match[1];
                               return n;
                              },
                              v[3]),
                          vm_frame_names = Stdlib_String[7].call(null, cst$0, a),
                          c = v[2],
                          d = Stdlib_List[1].call(null, v[7]),
                          e = 0 !== v[5] ? 1 : 0,
                          extra =
                            caml_call4
                             (Stdlib_Printf[4].call(null, b), e, d, vm_frame_names, c),
                          f = Stdlib[28].call(null, msg, extra),
                          g =
                            caml_jsstring_of_string
                             (Stdlib[28].call(null, cst_sx_resume, f));
                         Js_of_ocaml_Js[52][1].console.error(g);
                         return Js_of_ocaml_Js[1];
                        }
                       });
                    return obj;
                   },
                 s = make_suspension(request, vm),
                 drive = Js_of_ocaml_Js[52][1]._driveAsync;
                if(1 - (drive == Js_of_ocaml_Js[3])) drive(s);
                return s;
               }
              });
         return tag_fn
                 (inner,
                  handle$0,
                  caml_jsstring_of_string(Sx_types[61].call(null, v)));
        default: break a;
      }
      var
       a = Stdlib_List[20].call(null, value_to_js, items),
       arr = Stdlib_Array[11].call(null, a);
      return {_type: cst_list, items: caml_js_from_array(arr)};
     }
     if(0 === v) return Js_of_ocaml_Js[1];
    }
    var handle = alloc_handle(v);
    return {_type: caml_jsstring_of_string(Sx_types[61].call(null, v)),
            __sx_handle: handle};
   }
   function js_to_value(js){
    if(js != Js_of_ocaml_Js[1] && js != Js_of_ocaml_Js[3]){
     var ty = caml_string_of_jsstring(typeof js);
     if(ty === "boolean") return [0, js | 0];
     if(ty === "function"){
      var h$0 = js.__sx_handle, has_host_cb = js.__host_callback | 0;
      if(h$0 != Js_of_ocaml_Js[3] && ! has_host_cb)
       return get_handle(h$0 | 0);
      var id$0 = host_put(js), d$1 = Stdlib_Hashtbl[1].call(null, 0, 2);
      Stdlib_Hashtbl[11].call(null, d$1, cst_host_handle, [2, id$0]);
      return [7, d$1];
     }
     if(ty === "number") return [2, js];
     if(ty !== "object")
      return ty !== "string" ? 0 : [3, caml_string_of_jsstring(js)];
     var h = js.__sx_handle;
     if(h != Js_of_ocaml_Js[3]) return get_handle(h | 0);
     var type_field = js._type;
     if(type_field == Js_of_ocaml_Js[3]){
      var t0 = Js_of_ocaml_Js[52][1], t1 = t0.Array;
      if(t1.isArray(js) | 0){
       var n = js.length | 0;
       return [6,
               Stdlib_List[11].call
                (null,
                 n,
                 function(i){
                  var
                   a = Js_of_ocaml_Js[20].call(null, js, i),
                   b = Js_of_ocaml_Js[6][10].call(null, a);
                  return js_to_value(Stdlib_Option[4].call(null, b));
                 })];
      }
      var id = host_put(js), d = Stdlib_Hashtbl[1].call(null, 0, 2);
      Stdlib_Hashtbl[11].call(null, d, cst_host_handle, [2, id]);
      return [7, d];
     }
     var tag = caml_string_of_jsstring(type_field);
     if(tag !== cst_dict){
      if(tag === cst_keyword) return [5, caml_string_of_jsstring(js.name)];
      if(tag !== cst_list)
       return tag !== cst_symbol ? 0 : [4, caml_string_of_jsstring(js.name)];
      var items_js = js.items, n$0 = items_js.length | 0;
      return [6,
              Stdlib_List[11].call
               (null,
                n$0,
                function(i){
                 var
                  a = Js_of_ocaml_Js[20].call(null, items_js, i),
                  b = Js_of_ocaml_Js[6][10].call(null, a);
                 return js_to_value(Stdlib_Option[4].call(null, b));
                })];
     }
     var
      d$0 = Stdlib_Hashtbl[1].call(null, 0, 8),
      t3 = Js_of_ocaml_Js[52][1],
      t4 = t3.Object,
      keys = t4.keys(js),
      len = keys.length,
      a = len - 1 | 0;
     if(a >= 0){
      var i = 0;
      for(;;){
       var
        b = Js_of_ocaml_Js[20].call(null, keys, i),
        c = Js_of_ocaml_Js[6][10].call(null, b),
        k = caml_string_of_jsstring(Stdlib_Option[4].call(null, c));
       if(k !== "_type"){
        var e = js_to_value(js[caml_jsstring_of_string(k)]);
        Stdlib_Hashtbl[11].call(null, d$0, k, e);
       }
       var f = i + 1 | 0;
       if(a === i) break;
       i = f;
      }
     }
     return [7, d$0];
    }
    return 0;
   }
   function return_via_side_channel(v){
    Js_of_ocaml_Js[52][1].__sxR = v;
    return v;
   }
   var vm_globals = Stdlib_Hashtbl[1].call(null, 0, 512);
   Sx_types[14][1] = vm_globals;
   function sync_env_to_vm(param){
    return Stdlib_Hashtbl[12].call
            (null,
             function(id, v){
              var a = Sx_types[5].call(null, id);
              return Stdlib_Hashtbl[11].call(null, vm_globals, a, v);
             },
             global_env[1]);
   }
   Sx_types[22][1] =
    [0,
     function(env, name, v){
      var a = env === global_env ? 1 : 0;
      return a ? Stdlib_Hashtbl[11].call(null, vm_globals, name, v) : a;
     }];
   Sx_types[23][1] =
    [0,
     function(name, v){
      var a = Sx_types[4].call(null, name);
      return Stdlib_Hashtbl[11].call(null, global_env[1], a, v);
     }];
   Sx_types[25][1] =
    [0,
     function(name){
      var
       match =
         Stdlib_Hashtbl[7].call(null, Sx_primitives[1], "__resolve-symbol");
      if(! match) return 0;
      var resolve_fn = match[1];
      try{caml_call1(resolve_fn, [0, [3, name], 0]);}catch(exn){}
      var match$0 = Stdlib_Hashtbl[7].call(null, vm_globals, name);
      if(match$0){var v = match$0[1]; return [0, v];}
      var a = Sx_types[4].call(null, name);
      return Stdlib_Hashtbl[7].call(null, global_env[1], a);
     }];
   var cst_Parse_error = "Parse error: ";
   function api_parse(src_js){
    var src = caml_string_of_jsstring(src_js);
    try{
     var
      values = Sx_parser[17].call(null, src),
      b = Stdlib_List[20].call(null, value_to_js, values),
      a = caml_js_from_array(Stdlib_Array[11].call(null, b));
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Sx_types[10]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg = exn[2];
     return caml_jsstring_of_string
             (Stdlib[28].call(null, cst_Parse_error, msg));
    }
   }
   var
    cst_Error = "Error: ",
    cst_Error_IO_suspension_in_non =
      "Error: IO suspension in non-IO context (use callFn for IO-aware paths)";
   function api_eval(src_js){
    var src = caml_string_of_jsstring(src_js);
    try{
     var
      exprs = Sx_parser[17].call(null, src),
      env = [20, global_env],
      result =
        Stdlib_List[26].call
         (null,
          function(acc, expr){return Sx_ref[242].call(null, expr, env);},
          0,
          exprs);
     sync_env_to_vm(0);
     var a = return_via_side_channel(value_to_js(result));
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Sx_vm[1]) return cst_Error_IO_suspension_in_non;
     if(exn[1] === Sx_types[9]){
      var msg = exn[2];
      return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
     }
     if(exn[1] !== Sx_types[10]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg$0 = exn[2];
     return caml_jsstring_of_string
             (Stdlib[28].call(null, cst_Parse_error, msg$0));
    }
   }
   var
    cst_Error_compile_module_not_l = "Error: compile-module not loaded",
    cst_compile_module = "compile-module";
   function api_eval_vm(src_js){
    var src = caml_string_of_jsstring(src_js);
    try{
     var
      exprs = Sx_parser[17].call(null, src),
      match = Stdlib_Hashtbl[7].call(null, vm_globals, cst_compile_module);
     if(match)
      var v = match[1], compile_fn = v;
     else
      var
       compile_fn = Sx_types[30].call(null, global_env, cst_compile_module);
     var
      a = Sx_runtime[7].call(null, compile_fn, [0, [6, exprs], 0]),
      code_val = Sx_ref[2].call(null, a),
      code = Sx_vm[27].call(null, code_val),
      result = Sx_vm_ref[75].call(null, code, vm_globals);
     Stdlib_Hashtbl[12].call
      (null,
       function(name, v){
        var id = Sx_types[4].call(null, name);
        if(! Stdlib_Hashtbl[9].call(null, global_env[1], id))
         return Stdlib_Hashtbl[11].call(null, global_env[1], id, v);
        var match = Stdlib_Hashtbl[6].call(null, global_env[1], id);
        a:
        {
         if
          (typeof match !== "number"
           && 24 === match[0] && typeof v !== "number" && 24 === v[0])
          break a;
         if(typeof v !== "number" && 24 === v[0]) break a;
         return 0;
        }
        return Stdlib_Hashtbl[11].call(null, global_env[1], id, v);
       },
       vm_globals);
     var b = return_via_side_channel(value_to_js(result));
     return b;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Sx_vm[1]) return cst_Error_IO_suspension_in_non;
     if(exn[1] === Sx_types[9]){
      var msg = exn[2];
      return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
     }
     if(exn[1] === Sx_types[10]){
      var msg$0 = exn[2];
      return caml_jsstring_of_string
              (Stdlib[28].call(null, cst_Parse_error, msg$0));
     }
     if(exn === Stdlib[8]) return cst_Error_compile_module_not_l;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   function api_eval_expr(expr_js, env_js){
    var expr = js_to_value(expr_js);
    try{
     var result = Sx_ref[242].call(null, expr, [20, global_env]);
     sync_env_to_vm(0);
     var a = return_via_side_channel(value_to_js(result));
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Sx_vm[1]) return cst_Error_IO_suspension_in_non;
     if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg = exn[2];
     return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
    }
   }
   var cst$3 = "", cst_import = "import", e = [0, 0], f = [6, 0];
   function api_load(src_js){
    var src = caml_string_of_jsstring(src_js);
    try{
     var
      exprs = Sx_parser[17].call(null, src),
      env = [20, global_env],
      count = [0, 0];
     Stdlib_List[18].call
      (null,
       function(expr){
        var
         state = Sx_ref[8].call(null, expr, env, f),
         final = Sx_ref[156].call(null, state);
        for(;;){
         var b = Sx_ref[12].call(null, final);
         if(! Sx_types[71].call(null, b)){
          Sx_ref[18].call(null, final);
          count[1]++;
          return 0;
         }
         var request = Sx_ref[17].call(null, final);
         if(typeof request === "number" || ! (7 === request[0]))
          var op = cst$3;
         else{
          var
           d$0 = request[1],
           match$1 = Stdlib_Hashtbl[7].call(null, d$0, "op"),
           cst = cst$3;
          if(match$1){
           var match$2 = match$1[1];
           if(typeof match$2 === "number" || ! (3 === match$2[0]))
            var op = cst;
           else
            var s = match$2[1], op = s;
          }
          else
           var op = cst;
         }
         if(op === cst_import){
          a:
          {
           if(typeof request !== "number" && 7 === request[0]){
            var
             d = request[1],
             match = Stdlib_Hashtbl[7].call(null, d, "library");
            if(match){var v = match[1], lib_spec = v; break a;}
            var lib_spec = 0;
            break a;
           }
           var lib_spec = 0;
          }
          var
           a = Sx_ref[102].call(null, lib_spec),
           match$0 = Sx_types[71].call(null, a) ? e : 0;
          if(match$0)
           var v$0 = match$0[1], response = v$0;
          else
           var response = 0;
         }
         else
          var response = 0;
         final = Sx_ref[158].call(null, final, response);
        }
       },
       exprs);
     sync_env_to_vm(0);
     var a = count[1];
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Sx_types[9]){
      var msg = exn[2];
      return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
     }
     if(exn[1] !== Sx_types[10]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg$0 = exn[2];
     return caml_jsstring_of_string
             (Stdlib[28].call(null, cst_Parse_error, msg$0));
    }
   }
   function sync_vm_to_env(param){
    return Stdlib_Hashtbl[12].call
            (null,
             function(name, v){
              var id = Sx_types[4].call(null, name);
              if(! Stdlib_Hashtbl[9].call(null, global_env[1], id))
               return Stdlib_Hashtbl[11].call(null, global_env[1], id, v);
              var existing = Stdlib_Hashtbl[6].call(null, global_env[1], id);
              if
               (typeof existing !== "number"
                && 24 === existing[0] && typeof v !== "number" && 24 === v[0])
               return Stdlib_Hashtbl[11].call(null, global_env[1], id, v);
              if(typeof v !== "number" && 24 === v[0])
               return Stdlib_Hashtbl[11].call(null, global_env[1], id, v);
              return 0;
             },
             vm_globals);
   }
   var cst_suspended = "suspended";
   function make_js_import_suspension(d){
    var obj = {};
    obj.suspended = Js_of_ocaml_Js[7];
    obj.op = cst_import;
    var match = Stdlib_Hashtbl[7].call(null, d, "request");
    if(match) var v = match[1], request = v; else var request = 0;
    obj.request = value_to_js(request);
    obj.resume =
     caml_js_wrap_callback
      (function(result_js){
        var resumed = Sx_vm_ref[76].call(null, [7, d]);
        sync_vm_to_env(0);
        if(typeof resumed !== "number" && 7 === resumed[0]){
         var
          d2 = resumed[1],
          match = Stdlib_Hashtbl[7].call(null, d2, cst_suspended);
         a:
         {
          if(match){
           var a = match[1];
           if(typeof a !== "number" && 0 === a[0] && a[1]){var b = 1; break a;}
          }
          var b = 0;
         }
         if(b) return make_js_import_suspension(d2);
        }
        return value_to_js(resumed);
       });
    return obj;
   }
   function api_load_module(module_js){
    try{
     var
      code_val = js_to_value(module_js),
      code = Sx_vm[27].call(null, code_val),
      result = Sx_vm_ref[75].call(null, code, vm_globals);
     a:
     {
      if(typeof result !== "number" && 7 === result[0]){
       var
        d = result[1],
        match = Stdlib_Hashtbl[7].call(null, d, cst_suspended);
       b:
       {
        if(match){
         var a = match[1];
         if(typeof a !== "number" && 0 === a[0] && a[1]){var c = 1; break b;}
        }
        var c = 0;
       }
       if(c){var b = make_js_import_suspension(d); break a;}
      }
      sync_vm_to_env(0);
      var b = Stdlib_Hashtbl[15].call(null, vm_globals);
     }
     return b;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Sx_types[9]){
      var msg = exn[2];
      return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
     }
     var e = Stdlib_Printexc[1].call(null, exn);
     return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, e));
    }
   }
   var
    g =
      [0,
       [2,
        0,
        [12,
         32,
         [2,
          0,
          [11,
           " (env=",
           [4, 0, 0, 0, [11, " vm=", [4, 0, 0, 0, [12, 41, 0]]]]]]]],
       "%s %s (env=%d vm=%d)"];
   function api_debug_env(name_js){
    var
     name = caml_string_of_jsstring(name_js),
     id = Sx_types[4].call(null, name),
     found_env = Stdlib_Hashtbl[7].call(null, global_env[1], id),
     found_vm = Stdlib_Hashtbl[7].call(null, vm_globals, name),
     total_env = Stdlib_Hashtbl[15].call(null, global_env[1]),
     total_vm = Stdlib_Hashtbl[15].call(null, vm_globals);
    if(found_env)
     var
      v = found_env[1],
      a = Sx_types[61].call(null, v),
      env_s = Stdlib[28].call(null, "env:", a);
    else
     var env_s = "env:MISSING";
    if(found_vm)
     var
      v$0 = found_vm[1],
      b = Sx_types[61].call(null, v$0),
      vm_s = Stdlib[28].call(null, "vm:", b);
    else
     var vm_s = "vm:MISSING";
    return caml_jsstring_of_string
            (caml_call4
              (Stdlib_Printf[4].call(null, g),
               env_s,
               vm_s,
               total_env,
               total_vm));
   }
   function api_compile_module(src_js){
    var src = caml_string_of_jsstring(src_js);
    try{
     var
      exprs = Sx_parser[17].call(null, src),
      compile_fn = Sx_types[30].call(null, global_env, cst_compile_module),
      code =
        Sx_ref[242].call
         (null, [6, [0, compile_fn, [0, [6, exprs], 0]]], [20, global_env]),
      a = return_via_side_channel(value_to_js(code));
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] === Sx_types[9]){
      var msg = exn[2];
      return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
     }
     if(exn[1] === Sx_types[10]){
      var msg$0 = exn[2];
      return caml_jsstring_of_string
              (Stdlib[28].call(null, cst_Parse_error, msg$0));
     }
     if(exn === Stdlib[8]) return cst_Error_compile_module_not_l;
     throw caml_maybe_attach_backtrace(exn, 0);
    }
   }
   var sx_render_mode = [0, 0];
   function api_render_to_html(expr_js){
    var expr = js_to_value(expr_js), prev = sx_render_mode[1];
    sx_render_mode[1] = 1;
    try{
     var html = Sx_render[66].call(null, global_env, expr, global_env);
     sx_render_mode[1] = prev;
     var a = caml_jsstring_of_string(html);
     return a;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
     var msg = exn[2];
     sx_render_mode[1] = prev;
     return caml_jsstring_of_string(Stdlib[28].call(null, cst_Error, msg));
    }
   }
   function api_stringify(v_js){
    var a = js_to_value(v_js);
    return caml_jsstring_of_string(Sx_types[117].call(null, a));
   }
   function api_type_of(v_js){
    var a = js_to_value(v_js);
    return caml_jsstring_of_string(Sx_types[61].call(null, a));
   }
   function api_inspect(v_js){
    var a = js_to_value(v_js);
    return caml_jsstring_of_string(Sx_types[117].call(null, a));
   }
   function api_engine(param){return "ocaml-vm-wasm";}
   function api_register_native(name_js, callback_js){
    var name = caml_string_of_jsstring(name_js);
    function native_fn(args){
     var
      a = Stdlib_List[20].call(null, value_to_js, args),
      js_args = Stdlib_Array[11].call(null, a);
     return js_to_value(callback_js(caml_js_from_array(js_args)));
    }
    Sx_primitives[13].call(null, name, native_fn);
    var v = [15, name, native_fn];
    Sx_types[26].call(null, global_env, name, v);
    Stdlib_Hashtbl[11].call(null, vm_globals, name, v);
    return Js_of_ocaml_Js[1];
   }
   var
    h =
      [0,
       [11,
        cst_vm_pending_cek,
        [9,
         0,
         [11,
          cst_reuse,
          [4,
           0,
           0,
           0,
           [11, cst_frames, [2, 0, [11, cst_sp, [4, 0, 0, 0, [12, 93, 0]]]]]]]]],
       cst_vm_pending_cek_b_reuse_d_f];
   function make_js_callFn_suspension(request, vm){
    var obj = {};
    obj.suspended = Js_of_ocaml_Js[7];
    obj.request = value_to_js(request);
    obj.resume =
     caml_js_wrap_callback
      (function(result_js){
        var result = js_to_value(result_js);
        try{
         var v = Sx_vm[34].call(null, vm, result);
         sync_vm_to_env(0);
         var g = value_to_js(v);
         return g;
        }
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] === Sx_vm[1]){
          var vm2 = exn[3], req2 = exn[2];
          return make_js_callFn_suspension(req2, vm2);
         }
         if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
         var
          msg = exn[2],
          a =
            Stdlib_List[20].call
             (null,
              function(f){
               var match = f[1][3];
               if(! match) return cst;
               var n = match[1];
               return n;
              },
              vm[3]),
          vm_frame_names = Stdlib_String[7].call(null, cst$0, a),
          b = vm[2],
          c = Stdlib_List[1].call(null, vm[7]),
          d = 0 !== vm[5] ? 1 : 0,
          extra =
            caml_call4
             (Stdlib_Printf[4].call(null, h), d, c, vm_frame_names, b),
          e = Stdlib[28].call(null, msg, extra),
          f = caml_jsstring_of_string(Stdlib[28].call(null, cst_sx_resume, e));
         Js_of_ocaml_Js[52][1].console.error(f);
         return Js_of_ocaml_Js[1];
        }
       });
    return obj;
   }
   function api_call_fn(fn_js, args_js){
    try{
     var
      fn = js_to_value(fn_js),
      b =
        Stdlib_Array[14].call
         (null, js_to_value, runtime.caml_js_to_array(args_js)),
      args = Stdlib_Array[10].call(null, b),
      c = return_via_side_channel(value_to_js(call_sx_fn(fn, args)));
     return c;
    }
    catch(exn$0){
     var exn = caml_wrap_exception(exn$0);
     if(exn[1] !== Sx_vm[1]){
      if(exn[1] === Sx_types[9]){
       var
        msg = exn[2],
        err_obj =
          {__sx_error: Js_of_ocaml_Js[7],
           message: caml_jsstring_of_string(msg)};
       return err_obj;
      }
      var
       a = caml_jsstring_of_string(Stdlib_Printexc[1].call(null, exn)),
       err_obj$0 = {__sx_error: Js_of_ocaml_Js[7], message: a};
      return err_obj$0;
     }
     var vm = exn[3], request = exn[2], match = Sx_vm[8][1];
     if(match){
      var active = match[1];
      if(0 !== active[7]){
       vm[7] = Stdlib[37].call(null, vm[7], active[7]);
       active[7] = 0;
      }
     }
     sync_vm_to_env(0);
     return make_js_callFn_suspension(request, vm);
    }
   }
   function api_is_callable(fn_js){
    if(fn_js != Js_of_ocaml_Js[1] && fn_js != Js_of_ocaml_Js[3]){
     var h = fn_js.__sx_handle;
     if(h == Js_of_ocaml_Js[3]) return ! ! 0;
     var a = get_handle(h | 0);
     return ! ! Sx_types[70].call(null, a);
    }
    return ! ! 0;
   }
   function api_fn_arity(fn_js){
    var h = fn_js.__sx_handle;
    if(h == Js_of_ocaml_Js[3]) return -1.;
    var v = get_handle(h | 0);
    if(typeof v !== "number" && 8 === v[0]){
     var l = v[1];
     return Stdlib_List[1].call(null, l[1]);
    }
    return -1.;
   }
   function bind(name, fn){
    Sx_types[26].call(null, global_env, name, [15, name, fn]);
   }
   Sx_primitives[4][1] = 1;
   var cst_cek_eval = "cek-eval";
   bind
    (cst_cek_eval,
     function(args){
      if(args){
       var expr = args[1];
       if(typeof expr !== "number" && 3 === expr[0] && ! args[2]){
        var s = expr[1], e = Sx_parser[17].call(null, s);
        if(! e) return 0;
        var h = e[1];
        return Sx_ref[242].call(null, h, [20, global_env]);
       }
       var match = args[2];
       if(! match) return Sx_ref[242].call(null, expr, [20, global_env]);
       if(! match[2]){
        var env_val = match[1];
        return Sx_ref[242].call(null, expr, env_val);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "cek-eval: expected 1-2 args"], 1);
     });
   bind
    ("eval-expr-cek",
     function(args){
      if(args){
       var match = args[2], expr = args[1];
       if(! match) return Sx_ref[242].call(null, expr, [20, global_env]);
       if(! match[2]){
        var e = match[1];
        return Sx_ref[242].call(null, expr, e);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "eval-expr-cek: expected 1-2 args"], 1);
     });
   var
    cst_cek_call = "cek-call",
    cst_cek_call_expected_fn_args = "cek-call: expected (fn args)",
    cst_cek_call_not_callable = "cek-call: not callable: ";
   bind
    (cst_cek_call,
     function(args){
      if(args){
       var b = args[2];
       if(b && ! b[2]){
        var a = b[1], f = args[1];
        if(! Sx_types[70].call(null, f)){
         var
          d = Sx_types[61].call(null, f),
          e = Stdlib[28].call(null, cst_cek_call_not_callable, d);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
        }
        a:
        {
         if(typeof a === "number"){
          if(0 === a){var arg_list = 0; break a;}
         }
         else if(6 === a[0]){var l = a[1], arg_list = l; break a;}
         var arg_list = [0, a, 0];
        }
        var c = Sx_runtime[7].call(null, f, arg_list);
        return Sx_ref[2].call(null, c);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_cek_call_expected_fn_args], 1);
     });
   bind
    ("sx-parse",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var src = a[1];
        return [6, Sx_parser[17].call(null, src)];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sx-parse: expected string"], 1);
     });
   bind
    ("parse",
     function(args){
      a:
      if(args){
       var v = args[1];
       if(typeof v !== "number")
        switch(v[0]){
          case 3:
          case 19:
           if(args[2]) break a;
           var src = v[1], exprs = Sx_parser[17].call(null, src);
           if(exprs && ! exprs[2]){var e = exprs[1]; return e;}
           return [6, exprs];
        }
       if(! args[2]) return v;
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "parse: expected string"], 1);
     });
   bind
    ("sx-serialize",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       return [3, Sx_types[117].call(null, v)];
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "sx-serialize: expected 1 arg"], 1);
     });
   function deep_equal(a, b){
    a:
    if(typeof a === "number"){
     if(0 === a && typeof b === "number" && ! b) return 1;
    }
    else{
     switch(a[0]){
       case 0:
        if(typeof b === "number") break a;
        if(0 !== b[0]) break a;
        var b$0 = b[1], a$0 = a[1];
        return a$0 === b$0 ? 1 : 0;
       case 1:
        var a$1 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var b$1 = b[1]; return a$1 === b$1 ? 1 : 0;
          case 2:
           var b$2 = b[1]; return a$1 === b$2 ? 1 : 0;
          default: break a;
        }
       case 2:
        var a$2 = a[1];
        if(typeof b === "number") break a;
        switch(b[0]){
          case 1:
           var b$3 = b[1]; return a$2 === b$3 ? 1 : 0;
          case 2:
           var b$4 = b[1]; return a$2 === b$4 ? 1 : 0;
          default: break a;
        }
       case 3:
        if(typeof b === "number") break a;
        if(3 !== b[0]) break a;
        var b$5 = b[1], a$3 = a[1];
        return a$3 === b$5 ? 1 : 0;
       case 4:
        if(typeof b === "number") break a;
        if(4 !== b[0]) break a;
        var b$6 = b[1], a$4 = a[1];
        return a$4 === b$6 ? 1 : 0;
       case 5:
        if(typeof b === "number") break a;
        if(5 !== b[0]) break a;
        var b$7 = b[1], a$5 = a[1];
        return a$5 === b$7 ? 1 : 0;
       case 6:
        var a$6 = a[1]; break;
       case 7:
        if(typeof b === "number") break a;
        if(7 !== b[0]) break a;
        var
         b$9 = b[1],
         a$7 = a[1],
         ka =
           Stdlib_Hashtbl[14].call
            (null, function(k, param, acc){return [0, k, acc];}, a$7, 0),
         kb =
           Stdlib_Hashtbl[14].call
            (null, function(k, param, acc){return [0, k, acc];}, b$9, 0),
         f = Stdlib_List[1].call(null, kb),
         d = Stdlib_List[1].call(null, ka) === f ? 1 : 0;
        return d
                ? Stdlib_List
                   [33].call
                  (null,
                   function(k){
                    var a = Stdlib_Hashtbl[9].call(null, b$9, k);
                    if(! a) return a;
                    var b = Stdlib_Hashtbl[6].call(null, b$9, k);
                    return deep_equal(Stdlib_Hashtbl[6].call(null, a$7, k), b);
                   },
                   ka)
                : d;
       case 21:
        var a$6 = a[1][1]; break;
       default: break a;
     }
     if(typeof b !== "number"){
      switch(b[0]){
        case 6:
         var b$8 = b[1]; break;
        case 21:
         var b$8 = b[1][1]; break;
        default: break a;
      }
      var
       e = Stdlib_List[1].call(null, b$8),
       c = Stdlib_List[1].call(null, a$6) === e ? 1 : 0;
      return c ? Stdlib_List[35].call(null, deep_equal, a$6, b$8) : c;
     }
    }
    return 0;
   }
   bind
    ("equal?",
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1];
        return [0, deep_equal(a, b)];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], "equal?: 2 args"], 1);
     });
   var i = [0, 1], j = [0, 1];
   bind
    ("assert",
     function(args){
      if(args){
       var match = args[2], cond = args[1];
       if(! match){
        if(1 - Sx_types[71].call(null, cond))
         throw caml_maybe_attach_backtrace
                ([0, Sx_types[9], "Assertion failed"], 1);
        return j;
       }
       if(! match[2]){
        var msg = match[1];
        if(! (1 - Sx_types[71].call(null, cond))) return i;
        var
         a = Sx_types[35].call(null, msg),
         b = Stdlib[28].call(null, "Assertion: ", a);
        throw caml_maybe_attach_backtrace([0, Sx_types[9], b], 1);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "assert: 1-2 args"], 1);
     });
   var cst_error = "error", cst_ok = "ok", k = [0, 0], l = [0, 1];
   bind
    ("try-call",
     function(args){
      if(args && ! args[2]){
       var thunk = args[1];
       try{
        Sx_ref[242].call(null, [6, [0, thunk, 0]], [20, global_env]);
        var d$0 = Stdlib_Hashtbl[1].call(null, 0, 2);
        Stdlib_Hashtbl[11].call(null, d$0, cst_ok, l);
        return [7, d$0];
       }
       catch(exn$0){
        var exn = caml_wrap_exception(exn$0);
        if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
        var msg = exn[2], d = Stdlib_Hashtbl[1].call(null, 0, 2);
        Stdlib_Hashtbl[11].call(null, d, cst_ok, k);
        Stdlib_Hashtbl[11].call(null, d, cst_error, [3, msg]);
        return [7, d];
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "try-call: 1 arg"], 1);
     });
   bind
    ("load-sxbc",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 6 === a[0]){
        var c = a[1];
        if(c){
         var d = c[2];
         if(d){
          var b = d[2];
          if(b){
           var e = b[2], f = b[1];
           if(e){
            if(args[2]) break a;
            var code_form = e[1];
           }
           else{if(args[2]) break a; var code_form = f;}
           var
            cst_code = "code",
            convert_code =
              function(form){
               if(typeof form !== "number" && 6 === form[0]){
                var a = form[1];
                if(a){
                 var b = a[1];
                 if(typeof b !== "number" && 4 === b[0] && b[1] === cst_code){
                  var
                   rest = a[2],
                   d = Stdlib_Hashtbl[1].call(null, 0, 8),
                   parse_kv =
                     function(param$0){
                      var param = param$0;
                      for(;;){
                       if(! param) return;
                       var b = param[1];
                       if(typeof b !== "number" && 5 === b[0]){
                        var a = b[1], cst_arity = "arity";
                        if(a !== cst_arity){
                         var cst_bytecode = "bytecode";
                         if(a !== cst_bytecode){
                          var cst_constants = "constants";
                          if(a !== cst_constants){
                           var cst_upvalue_count = "upvalue-count";
                           if(a === cst_upvalue_count){
                            var match = param[2];
                            if(match){
                             var n = match[1];
                             if(typeof n !== "number")
                              switch(n[0]){
                                case 1:
                                 var rest$0 = match[2];
                                 Stdlib_Hashtbl[11].call(null, d, cst_upvalue_count, n);
                                 param = rest$0;
                                 continue;
                                case 2:
                                 var rest$1 = match[2];
                                 Stdlib_Hashtbl[11].call(null, d, cst_upvalue_count, n);
                                 param = rest$1;
                                 continue;
                              }
                            }
                           }
                          }
                          else{
                           var c = param[2];
                           if(c){
                            var match$0 = c[1];
                            if(typeof match$0 !== "number" && 6 === match$0[0]){
                             var
                              rest$2 = c[2],
                              consts = match$0[1],
                              f = [6, Stdlib_List[20].call(null, convert_const, consts)];
                             Stdlib_Hashtbl[11].call(null, d, cst_constants, f);
                             param = rest$2;
                             continue;
                            }
                           }
                          }
                         }
                         else{
                          var e = param[2];
                          if(e){
                           var match$1 = e[1];
                           if(typeof match$1 !== "number" && 6 === match$1[0]){
                            var rest$3 = e[2], nums = match$1[1];
                            Stdlib_Hashtbl[11].call(null, d, cst_bytecode, [6, nums]);
                            param = rest$3;
                            continue;
                           }
                          }
                         }
                        }
                        else{
                         var match$2 = param[2];
                         if(match$2){
                          var n$0 = match$2[1];
                          if(typeof n$0 !== "number")
                           switch(n$0[0]){
                             case 1:
                              var rest$4 = match$2[2];
                              Stdlib_Hashtbl[11].call(null, d, cst_arity, n$0);
                              param = rest$4;
                              continue;
                             case 2:
                              var rest$5 = match$2[2];
                              Stdlib_Hashtbl[11].call(null, d, cst_arity, n$0);
                              param = rest$5;
                              continue;
                           }
                         }
                        }
                       }
                       var rest = param[2];
                       param = rest;
                      }
                     };
                  parse_kv(rest);
                  return [7, d];
                 }
                }
               }
               var
                c = Sx_types[61].call(null, form),
                e =
                  Stdlib[28].call
                   (null, "load-sxbc: expected (code ...), got ", c);
               throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
              },
            convert_const =
              function(form){
               if(typeof form !== "number" && 6 === form[0]){
                var a = form[1];
                if(a){
                 var b = a[1];
                 if(typeof b !== "number" && 4 === b[0]){
                  var match = b[1];
                  if(match === cst_code) return convert_code(form);
                  if(match === cst_list){
                   var items = a[2];
                   return [6, Stdlib_List[20].call(null, convert_const, items)];
                  }
                 }
                }
               }
               return form;
              },
            module_val = convert_code(code_form),
            code = Sx_vm[27].call(null, module_val);
           try{Sx_vm[35].call(null, code, vm_globals);}catch(exn){}
           sync_vm_to_env(0);
           return [2, Stdlib_Hashtbl[15].call(null, vm_globals)];
          }
         }
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0,
               Sx_types[9],
               "load-sxbc: expected (sxbc version hash (code ...))"],
              1);
     });
   bind
    ("append!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           var b = args[2];
           if(b && ! b[2]){
            var v = b[1], items = a[1];
            return [6, Stdlib[37].call(null, items, [0, v, 0])];
           }
           break;
          case 21:
           var c = args[2];
           if(c && ! c[2]){
            var v$0 = c[1], r = a[1];
            r[1] = Stdlib[37].call(null, r[1], [0, v$0, 0]);
            return [21, r];
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "append!: expected list and value"], 1);
     });
   bind
    ("remove!",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 6:
           var b = args[2];
           if(b && ! b[2]){
            var target = b[1], items = a[1];
            return [6,
                    Stdlib_List[44].call
                     (null, function(x){return x !== target ? 1 : 0;}, items)];
           }
           break;
          case 21:
           var c = args[2];
           if(c && ! c[2]){
            var target$0 = c[1], r = a[1];
            r[1] =
             Stdlib_List[44].call
              (null, function(x){return x !== target$0 ? 1 : 0;}, r[1]);
            return [21, r];
           }
           break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "append!: list and value"], 1);
     });
   var uw = Sx_runtime[75];
   bind("make-env", function(param){return [20, Sx_types[20].call(null, 0)];});
   bind("global-env", function(param){return [20, global_env];});
   var cst_env_has = "env-has?";
   bind
    (cst_env_has,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1], e = args[1];
        if(typeof b !== "number")
         switch(b[0]){
           case 3:
           case 5:
            if(! a[2]){
             var k = b[1], c = uw(e);
             return [0, Sx_types[28].call(null, c, k)];
            }
            break;
         }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_env_has], 1);
     });
   var cst_env_get = "env-get";
   bind
    (cst_env_get,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1], e = args[1];
        if(typeof b !== "number")
         switch(b[0]){
           case 3:
           case 5:
            if(! a[2]){
             var k = b[1], c = uw(e);
             return Sx_types[30].call(null, c, k);
            }
            break;
         }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_env_get], 1);
     });
   var cst_env_bind = "env-bind!";
   bind
    (cst_env_bind,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1], e = args[1];
        if(typeof b !== "number")
         switch(b[0]){
           case 3:
           case 5:
            var c = a[2];
            if(c && ! c[2]){
             var v = c[1], k = b[1], d = uw(e);
             return Sx_types[26].call(null, d, k, v);
            }
            break;
         }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_env_bind], 1);
     });
   var cst_env_set = "env-set!";
   bind
    (cst_env_set,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[1], e = args[1];
        if(typeof b !== "number")
         switch(b[0]){
           case 3:
           case 5:
            var c = a[2];
            if(c && ! c[2]){
             var v = c[1], k = b[1], d = uw(e);
             return Sx_types[32].call(null, d, k, v);
            }
            break;
         }
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_env_set], 1);
     });
   var cst_env_extend = "env-extend";
   bind
    (cst_env_extend,
     function(args){
      if(args && ! args[2]){
       var e = args[1], a = uw(e);
       return [20, Sx_types[21].call(null, a)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_env_extend], 1);
     });
   var cst_env_merge = "env-merge";
   bind
    (cst_env_merge,
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1];
        return Sx_runtime[82].call(null, a, b);
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_env_merge], 1);
     });
   var cst_make_symbol = "make-symbol";
   bind
    (cst_make_symbol,
     function(args){
      a:
      if(args){
       var v = args[1];
       if(typeof v !== "number" && 3 === v[0]){
        if(args[2]) break a;
        var s = v[1];
        return [4, s];
       }
       if(! args[2]) return [4, Sx_types[35].call(null, v)];
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_make_symbol], 1);
     });
   var cst_make_keyword = "make-keyword";
   bind
    (cst_make_keyword,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [5, s];}
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_make_keyword], 1);
     });
   var cst_keyword_name = "keyword-name";
   bind
    (cst_keyword_name,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 5 === a[0] && ! args[2]){var k = a[1]; return [3, k];}
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_keyword_name], 1);
     });
   var cst_symbol_name = "symbol-name";
   bind
    (cst_symbol_name,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 4 === a[0] && ! args[2]){var s = a[1]; return [3, s];}
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_symbol_name], 1);
     });
   var m = [3, cst$3];
   bind
    ("component-name",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return [3, c[1]];} break;
          case 10:
           if(! args[2]){var i = a[1]; return [3, i[1]];} break;
        }
      }
      return m;
     });
   bind
    ("component-closure",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return [20, c[5]];} break;
          case 10:
           if(! args[2]){var i = a[1]; return [20, i[5]];} break;
        }
      }
      return [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
     });
   bind
    ("component-params",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){
            var c = a[1];
            return [6,
                    Stdlib_List[20].call
                     (null, function(s){return [3, s];}, c[2])];
           }
           break;
          case 10:
           if(! args[2]){
            var i = a[1];
            return [6,
                    Stdlib_List[20].call
                     (null, function(s){return [3, s];}, i[2])];
           }
           break;
        }
      }
      return 0;
     });
   bind
    ("component-body",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return c[4];} break;
          case 10:
           if(! args[2]){var i = a[1]; return i[4];} break;
        }
      }
      return 0;
     });
   var
    cst_component_has_children = "component-has-children?",
    n = [0, 0],
    has_children_impl =
      [15,
       cst_component_has_children,
       function(args){
        if(args){
         var a = args[1];
         if(typeof a !== "number")
          switch(a[0]){
            case 9:
             if(! args[2]){var c = a[1]; return [0, c[3]];} break;
            case 10:
             if(! args[2]){var i = a[1]; return [0, i[3]];} break;
          }
        }
        return n;
       }];
   Sx_types[26].call
    (null, global_env, "component-has-children", has_children_impl);
   Sx_types[26].call
    (null, global_env, cst_component_has_children, has_children_impl);
   var o = [3, "auto"], p = [3, "client"];
   bind
    ("component-affinity",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 9:
           if(! args[2]){var c = a[1]; return [3, c[6]];} break;
          case 10:
           if(! args[2]) return p; break;
        }
      }
      return o;
     });
   bind("component-param-types", function(param){return 0;});
   bind("component-set-param-types!", function(param){return 0;});
   var cst_make_cek_state = "make-cek-state";
   bind
    (cst_make_cek_state,
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var b = a[2];
        if(b && ! b[2]){
         var k = b[1], e = a[1], c = args[1];
         return Sx_ref[8].call(null, c, e, k);
        }
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_make_cek_state], 1);
     });
   var cst_cek_step = "cek-step";
   bind
    (cst_cek_step,
     function(args){
      if(args && ! args[2]){
       var s = args[1];
       return Sx_ref[159].call(null, s);
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_cek_step], 1);
     });
   var cst_cek_phase = "cek-phase";
   bind
    (cst_cek_phase,
     function(args){
      if(args && ! args[2]){var s = args[1]; return Sx_ref[16].call(null, s);}
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_cek_phase], 1);
     });
   var cst_cek_value = "cek-value";
   bind
    (cst_cek_value,
     function(args){
      if(args && ! args[2]){var s = args[1]; return Sx_ref[18].call(null, s);}
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_cek_value], 1);
     });
   var cst_cek_terminal = "cek-terminal?";
   bind
    (cst_cek_terminal,
     function(args){
      if(args && ! args[2]){var s = args[1]; return Sx_ref[11].call(null, s);}
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_cek_terminal], 1);
     });
   var cst_cek_kont = "cek-kont";
   bind
    (cst_cek_kont,
     function(args){
      if(args && ! args[2]){var s = args[1]; return Sx_ref[15].call(null, s);}
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_cek_kont], 1);
     });
   var cst_frame_type = "frame-type";
   bind
    (cst_frame_type,
     function(args){
      if(args && ! args[2]){var f = args[1]; return Sx_ref[75].call(null, f);}
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_frame_type], 1);
     });
   var cst_strict = "*strict*";
   Sx_types[26].call(null, global_env, cst_strict, [0, 0]);
   var cst_prim_param_types = "*prim-param-types*";
   Sx_types[26].call(null, global_env, cst_prim_param_types, 0);
   bind
    ("set-strict!",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       Sx_ref[125][1] = v;
       Sx_types[32].call(null, global_env, cst_strict, v);
       return 0;
      }
      return 0;
     });
   bind
    ("set-prim-param-types!",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       Sx_ref[128][1] = v;
       Sx_types[32].call(null, global_env, cst_prim_param_types, v);
       return 0;
      }
      return 0;
     });
   bind
    ("value-matches-type?",
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var t = a[1], v = args[1];
        return Sx_ref[131].call(null, v, t);
       }
      }
      return 0;
     });
   var cst_apply = "apply";
   bind
    (cst_apply,
     function(args){
      if(! args)
       throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_apply], 1);
      var
       rest = args[2],
       f = args[1],
       match = Stdlib_List[10].call(null, rest);
      if(match){
       var match$0 = match[1];
       if(typeof match$0 === "number" || ! (6 === match$0[0]))
        var all_args = rest;
       else
        var
         prefix = match[2],
         last = match$0[1],
         a = Stdlib_List[10].call(null, prefix),
         all_args = Stdlib[37].call(null, a, last);
      }
      else
       var all_args = rest;
      return Sx_runtime[7].call(null, f, all_args);
     });
   var cst_provide_push = "provide-push!";
   bind
    (cst_provide_push,
     function(args){
      if(args){
       var a = args[2];
       if(a && ! a[2]){
        var v = a[1], n = args[1];
        return Sx_runtime[109].call(null, n, v);
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_provide_push], 1);
     });
   var cst_provide_pop = "provide-pop!";
   bind
    (cst_provide_pop,
     function(args){
      if(args && ! args[2]){
       var n = args[1];
       return Sx_runtime[110].call(null, n);
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_provide_pop], 1);
     });
   bind
    ("eval-defcomp",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 6 === a[0]){
        var b = a[1];
        if(b && ! args[2]){
         var rest = b[2];
         return Sx_ref[141].call(null, [6, rest], [20, global_env]);
        }
       }
      }
      return 0;
     });
   bind
    ("eval-defisland",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 6 === a[0]){
        var b = a[1];
        if(b && ! args[2]){
         var rest = b[2];
         return Sx_ref[144].call(null, [6, rest], [20, global_env]);
        }
       }
      }
      return 0;
     });
   bind
    ("eval-defmacro",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 6 === a[0]){
        var b = a[1];
        if(b && ! args[2]){
         var rest = b[2];
         return Sx_ref[147].call(null, [6, rest], [20, global_env]);
        }
       }
      }
      return 0;
     });
   bind
    ("<>",
     function(args){
      var
       a =
         Stdlib_List[20].call
          (null,
           function(a){
            if(typeof a === "number"){
             if(0 === a) return cst$3;
            }
            else
             switch(a[0]){
               case 6:
                return Sx_render[66].call(null, global_env, a, global_env);
               case 3:
               case 17:
                var s = a[1]; return s;
             }
            return Sx_types[35].call(null, a);
           },
           args);
      return [17, Stdlib_String[7].call(null, cst$3, a)];
     });
   bind
    ("raw!",
     function(args){
      var
       a =
         Stdlib_List[20].call
          (null,
           function(a){
            if(typeof a !== "number")
             switch(a[0]){case 3:case 17: var s = a[1]; return s;}
            return Sx_types[35].call(null, a);
           },
           args);
      return [17, Stdlib_String[7].call(null, cst$3, a)];
     });
   bind("define-page-helper", function(param){return 0;});
   Sx_types[26].call(null, global_env, "__io-registry", Sx_ref[105]);
   Sx_render[70].call(null, global_env);
   bind("set-render-active!", function(param){return 0;});
   var q = [0, 1];
   bind("render-active?", function(param){return q;});
   var r = [0, 0];
   bind
    ("is-html-tag?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var s = a[1];
        return [0, Sx_render[67].call(null, s)];
       }
      }
      return r;
     });
   var
    html_tags =
      [6,
       Stdlib_List[20].call(null, function(s){return [3, s];}, Sx_render[28])],
    void_elements =
      [6,
       Stdlib_List[20].call(null, function(s){return [3, s];}, Sx_render[31])],
    boolean_attrs =
      [6,
       Stdlib_List[20].call(null, function(s){return [3, s];}, Sx_render[33])];
   Sx_types[26].call(null, global_env, "HTML_TAGS", html_tags);
   Sx_types[26].call(null, global_env, "VOID_ELEMENTS", void_elements);
   Sx_types[26].call(null, global_env, "BOOLEAN_ATTRS", boolean_attrs);
   function eval_tag_args(raw_args, env){
    var args = Sx_runtime[6].call(null, raw_args);
    function process(param){
     if(! param) return 0;
     var kw = param[1];
     if(typeof kw !== "number" && 5 === kw[0]){
      var match = param[2];
      if(! match) return [0, kw, 0];
      var rest$0 = match[2], value = match[1], b = process(rest$0);
      return [0, kw, [0, Sx_ref[242].call(null, value, env), b]];
     }
     var rest = param[2], a = process(rest);
     return [0, Sx_ref[242].call(null, kw, env), a];
    }
    return process(args);
   }
   Stdlib_List[18].call
    (null,
     function(tag){
      var
       a =
         [15,
          Stdlib[28].call(null, "sf:", tag),
          function(handler_args){
           if(handler_args){
            var a = handler_args[2];
            if(a && ! a[2]){
             var env = a[1], raw_args = handler_args[1];
             return [6, [0, [4, tag], eval_tag_args(raw_args, env)]];
            }
           }
           return 0;
          }];
      Sx_ref[87].call(null, [3, tag], a);
      return 0;
     },
     Sx_render[28]);
   var s = [4, cst_error], t = [4, cst_ok];
   bind
    ("cek-try",
     function(args){
      if(args){
       var match = args[2], thunk = args[1];
       if(! match)
        try{
         var r = Sx_ref[222].call(null, thunk, 0);
         return [6, [0, t, [0, r, 0]]];
        }
        catch(exn){
         var exn$0 = caml_wrap_exception(exn);
         if(exn$0[1] !== Sx_types[9])
          throw caml_maybe_attach_backtrace(exn$0, 0);
         var msg$0 = exn$0[2];
         return [6, [0, s, [0, [3, msg$0], 0]]];
        }
       if(! match[2]){
        var handler = match[1];
        try{var a = Sx_ref[222].call(null, thunk, 0); return a;}
        catch(exn$0){
         var exn = caml_wrap_exception(exn$0);
         if(exn[1] !== Sx_types[9]) throw caml_maybe_attach_backtrace(exn, 0);
         var msg = exn[2];
         return Sx_ref[222].call(null, handler, [6, [0, [3, msg], 0]]);
        }
       }
      }
      return 0;
     });
   bind
    ("eval-expr",
     function(args){
      if(args){
       var match = args[2], expr = args[1];
       if(! match) return Sx_ref[242].call(null, expr, [20, global_env]);
       if(! match[2]){
        var e = match[1];
        return Sx_ref[242].call(null, expr, e);
       }
      }
      return 0;
     });
   bind
    ("trampoline",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       return caml_call1(Sx_primitives[3][1], v);
      }
      return 0;
     });
   bind
    ("expand-macro",
     function(args){
      if(args){
       var a = args[2];
       if(a){
        var match = a[2], raw = a[1], mac = args[1];
        if(! match) return Sx_ref[155].call(null, mac, raw, [20, global_env]);
        var b = match[1];
        if(typeof b !== "number" && 20 === b[0] && ! match[2]){
         var e = b[1];
         return Sx_ref[155].call(null, mac, raw, [20, e]);
        }
       }
      }
      return 0;
     });
   bind
    ("call-lambda",
     function(args){
      a:
      if(args){
       var b = args[2];
       if(b){
        var c = b[2], a = b[1], f = args[1];
        if(c && c[2]) break a;
        if(Sx_types[70].call(null, f)) return Sx_ref[222].call(null, f, a);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], "call-lambda: expected (fn args env?)"], 1);
     });
   bind
    (cst_cek_call,
     function(args){
      if(args){
       var b = args[2];
       if(b && ! b[2]){
        var a = b[1], f = args[1];
        if(! Sx_types[70].call(null, f)){
         var
          d = Sx_types[61].call(null, f),
          e = Stdlib[28].call(null, cst_cek_call_not_callable, d);
         throw caml_maybe_attach_backtrace([0, Sx_types[9], e], 1);
        }
        a:
        {
         if(typeof a === "number"){
          if(0 === a){var arg_list = 0; break a;}
         }
         else if(6 === a[0]){var l = a[1], arg_list = l; break a;}
         var arg_list = [0, a, 0];
        }
        var c = Sx_runtime[7].call(null, f, arg_list);
        return Sx_ref[2].call(null, c);
       }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_cek_call_expected_fn_args], 1);
     });
   bind
    (cst_cek_eval,
     function(args){
      if(args){
       var match = args[2], expr = args[1];
       if(! match) return Sx_ref[242].call(null, expr, [20, global_env]);
       if(! match[2]){
        var e = match[1];
        return Sx_ref[242].call(null, expr, e);
       }
      }
      return 0;
     });
   bind
    ("qq-expand-runtime",
     function(args){
      if(args){
       var match = args[2], template = args[1];
       if(! match) return Sx_ref[149].call(null, template, [20, global_env]);
       var a = match[1];
       if(typeof a !== "number" && 20 === a[0] && ! match[2]){
        var e = a[1];
        return Sx_ref[149].call(null, template, [20, e]);
       }
      }
      return 0;
     });
   var u = [0, 0], v = [0, 1];
   bind
    ("thunk?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 12 === a[0] && ! args[2]) return v;
      }
      return u;
     });
   bind
    ("thunk-expr",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       return Sx_types[92].call(null, v);
      }
      return 0;
     });
   bind
    ("thunk-env",
     function(args){
      if(args && ! args[2]){
       var v = args[1];
       return Sx_types[93].call(null, v);
      }
      return 0;
     });
   var w = [0, 0], x = [0, 1];
   bind
    ("lambda?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]) return x;
      }
      return w;
     });
   var y = [0, 0], z = [0, 1];
   bind
    ("macro?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 11 === a[0] && ! args[2]) return z;
      }
      return y;
     });
   var A = [0, 0], B = [0, 1];
   bind
    ("island?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 10 === a[0] && ! args[2]) return B;
      }
      return A;
     });
   var C = [0, 0], D = [0, 1];
   bind
    ("component?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && a[0] - 9 >>> 0 < 2 && ! args[2]) return D;
      }
      return C;
     });
   var E = [0, 0], F = [0, 1];
   bind
    ("callable?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 8:
          case 9:
          case 10:
          case 15:
           if(! args[2]) return F; break;
        }
      }
      return E;
     });
   var G = [0, 0], H = [0, 1];
   bind
    ("spread?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 18 === a[0] && ! args[2]) return H;
      }
      return G;
     });
   var I = [0, 0], J = [0, 1];
   bind
    ("continuation?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 13 === a[0] && ! args[2]) return J;
      }
      return I;
     });
   var K = [6, 0];
   bind
    ("lambda-params",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]){
        var l = a[1];
        return [6,
                Stdlib_List[20].call(null, function(s){return [3, s];}, l[1])];
       }
      }
      return K;
     });
   bind
    ("lambda-body",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]){var l = a[1]; return l[2];}
      }
      return 0;
     });
   bind
    ("lambda-closure",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 8 === a[0] && ! args[2]){var l = a[1]; return [20, l[3]];}
      }
      return [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
     });
   bind
    ("spread-attrs",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 18 === a[0] && ! args[2]){
        var pairs = a[1], d = Stdlib_Hashtbl[1].call(null, 0, 4);
        Stdlib_List[18].call
         (null,
          function(param){
           var v = param[2], k = param[1];
           return Stdlib_Hashtbl[11].call(null, d, k, v);
          },
          pairs);
        return [7, d];
       }
      }
      return [7, Stdlib_Hashtbl[1].call(null, 0, 0)];
     });
   bind
    ("make-spread",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0] && ! args[2]){
        var d = a[1];
        return [18,
                Stdlib_Hashtbl[14].call
                 (null,
                  function(k, v, acc){return [0, [0, k, v], acc];},
                  d,
                  0)];
       }
      }
      return 0;
     });
   bind
    ("make-raw-html",
     function(args){
      a:
      if(args){
       var v = args[1];
       if(typeof v !== "number" && 3 === v[0]){
        if(args[2]) break a;
        var s = v[1];
        return [17, s];
       }
       if(! args[2]) return [17, Sx_types[35].call(null, v)];
      }
      return 0;
     });
   var L = [3, cst$3];
   bind
    ("raw-html-content",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 3:
           if(! args[2]){var s = a[1]; return [3, s];} break;
          case 17:
           if(! args[2]){var s$0 = a[1]; return [3, s$0];} break;
        }
      }
      return L;
     });
   var M = [0, 1];
   bind
    ("empty-dict?",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 7 === a[0] && ! args[2]){
        var d = a[1];
        return [0, 0 === Stdlib_Hashtbl[15].call(null, d) ? 1 : 0];
       }
      }
      return M;
     });
   var cst_identical = "identical?";
   bind
    (cst_identical,
     function(args){
      if(args){
       var c = args[2];
       if(c && ! c[2]){
        var b = c[1], a = args[1];
        return [0, a === b ? 1 : 0];
       }
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_identical], 1);
     });
   bind
    ("for-each-indexed",
     function(args){
      a:
      if(args){
       var a = args[2];
       if(a){
        var b = a[1], fn_val = args[1];
        if(typeof b !== "number"){
         switch(b[0]){
           case 6:
            if(a[2]) break a; var items = b[1]; break;
           case 21:
            var c = b[1][1]; if(a[2]) break a; var items = c; break;
           default: break a;
         }
         Stdlib_List[19].call
          (null,
           function(i, item){
            Sx_ref[242].call
             (null,
              [6, [0, fn_val, [0, [2, i], [0, item, 0]]]],
              [20, global_env]);
            return 0;
           },
           items);
         return 0;
        }
       }
      }
      return 0;
     });
   var cst_make_sx_expr = "make-sx-expr";
   bind
    (cst_make_sx_expr,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){var s = a[1]; return [19, s];}
      }
      throw caml_maybe_attach_backtrace([0, Sx_types[9], cst_make_sx_expr], 1);
     });
   var cst_sx_expr_source = "sx-expr-source";
   bind
    (cst_sx_expr_source,
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 3:
           if(! args[2]){var s = a[1]; return [3, s];} break;
          case 19:
           if(! args[2]){var s$0 = a[1]; return [3, s$0];} break;
        }
      }
      throw caml_maybe_attach_backtrace
             ([0, Sx_types[9], cst_sx_expr_source], 1);
     });
   bind
    ("parse-int",
     function(args){
      a:
      if(args){
       var a = args[1];
       if(typeof a !== "number")
        switch(a[0]){
          case 2:
           var c = args[2], n = a[1];
           if(c && c[2]) break a;
           return [2, runtime.caml_round_float(n)];
          case 3:
           var match = args[2], s = a[1];
           if(! match)
            try{var e = [2, caml_int_of_string(s)]; return e;}
            catch(exn){return 0;}
           if(match[2]) break a;
           var default_val$0 = match[1];
           try{var d = [2, caml_int_of_string(s)]; return d;}
           catch(exn){return default_val$0;}
        }
       var b = args[2];
       if(b && ! b[2]){var default_val = b[1]; return default_val;}
      }
      return 0;
     });
   bind
    ("parse-number",
     function(args){
      if(args){
       var a = args[1];
       if(typeof a !== "number" && 3 === a[0] && ! args[2]){
        var s = a[1];
        try{var b = [2, runtime.caml_float_of_string(s)]; return b;}
        catch(exn){return 0;}
       }
      }
      return 0;
     });
   bind("query", function(param){return 0;});
   bind("action", function(param){return 0;});
   bind
    ("request-arg",
     function(args){
      if(args){var a = args[2]; if(a && ! a[2]){var d = a[1]; return d;}}
      return 0;
     });
   var N = [3, "GET"];
   bind("request-method", function(param){return N;});
   bind("ctx", function(param){return 0;});
   bind("helper", function(param){return 0;});
   var
    cst_bc = " (bc=",
    cst_consts = " consts=",
    cst_upv = " upv=",
    cst$2 = ")\n",
    cst$1 = ": ",
    cst_jit_FAIL = "[jit] FAIL ",
    cst_jit_FAIL_s_s_bc_d_consts_d =
      "[jit] FAIL %s: %s (bc=%d consts=%d upv=%d)\n%!",
    jit_compiling = [0, 0],
    jit_enabled = [0, 0],
    O =
      [0,
       [11,
        cst_jit_FAIL,
        [2,
         0,
         [11,
          cst$1,
          [2,
           0,
           [11,
            cst_bc,
            [4,
             0,
             0,
             0,
             [11,
              cst_consts,
              [4, 0, 0, 0, [11, cst_upv, [4, 0, 0, 0, [11, cst$2, [10, 0]]]]]]]]]]]],
       cst_jit_FAIL_s_s_bc_d_consts_d],
    P =
      [0,
       [11,
        cst_jit_FAIL,
        [2,
         0,
         [11,
          cst$1,
          [2,
           0,
           [11,
            cst_bc,
            [4,
             0,
             0,
             0,
             [11,
              cst_consts,
              [4, 0, 0, 0, [11, cst_upv, [4, 0, 0, 0, [11, cst$2, [10, 0]]]]]]]]]]]],
       cst_jit_FAIL_s_s_bc_d_consts_d];
   Sx_runtime[131][1] =
    [0,
     function(f, args){
      if(typeof f !== "number" && 8 === f[0]){
       var l = f[1];
       if(jit_enabled[1]){
        var match = l[5];
        if(match){
         var cl = match[1];
         if(Sx_vm[7].call(null, cl)) return 0;
         try{
          var d = [0, Sx_vm[30].call(null, cl, args, vm_globals)];
          return d;
         }
         catch(exn$0){
          var exn = caml_wrap_exception(exn$0);
          if(exn[1] !== Sx_types[9])
           throw caml_maybe_attach_backtrace(exn, 0);
          var msg = exn[2], match$0 = l[4];
          if(match$0) var n = match$0[1], fn_name = n; else var fn_name = cst;
          var
           a = cl[2].length - 1,
           b = cl[1][5].length - 1,
           c = cl[1][4].length - 1;
          caml_call5(Stdlib_Printf[3].call(null, O), fn_name, msg, c, b, a);
          l[5] = [0, Sx_vm[6]];
          return 0;
         }
        }
        if(jit_compiling[1]) return 0;
        jit_compiling[1] = 1;
        var compiled = Sx_vm[42].call(null, l, vm_globals);
        jit_compiling[1] = 0;
        if(! compiled) return 0;
        var cl$0 = compiled[1];
        l[5] = [0, cl$0];
        try{
         var i = [0, Sx_vm[30].call(null, cl$0, args, vm_globals)];
         return i;
        }
        catch(exn){
         var exn$0 = caml_wrap_exception(exn);
         if(exn$0[1] !== Sx_types[9])
          throw caml_maybe_attach_backtrace(exn$0, 0);
         var msg$0 = exn$0[2], match$1 = l[4];
         if(match$1)
          var n$0 = match$1[1], fn_name2 = n$0;
         else
          var fn_name2 = cst;
         var
          e = cl$0[2].length - 1,
          g = cl$0[1][5].length - 1,
          h = cl$0[1][4].length - 1;
         caml_call5(Stdlib_Printf[3].call(null, P), fn_name2, msg$0, h, g, e);
         l[5] = [0, Sx_vm[6]];
         return 0;
        }
       }
      }
      return 0;
     }];
   var cst_enable_jit = "enable-jit!";
   Sx_types[26].call
    (null,
     global_env,
     cst_enable_jit,
     [15, cst_enable_jit, function(param){jit_enabled[1] = 1; return 0;}]);
   Stdlib_Hashtbl[12].call
    (null,
     function(name, fn){
      var v = [15, name, fn];
      Stdlib_Hashtbl[11].call(null, vm_globals, name, v);
      var a = Sx_types[4].call(null, name);
      return Stdlib_Hashtbl[11].call(null, global_env[1], a, v);
     },
     Sx_primitives[1]);
   function wrap(fn){
    return function(fn){
             return function(){
              globalThis.__sxR = undefined;
              var r = fn.apply(null, arguments);
              return globalThis.__sxR !== undefined ? globalThis.__sxR : r;};
            }
            (caml_js_wrap_callback(fn));
   }
   var sx = {};
   sx.parse = caml_js_wrap_callback(api_parse);
   sx.stringify = caml_js_wrap_callback(api_stringify);
   sx.eval = wrap(api_eval);
   sx.evalVM = wrap(api_eval_vm);
   sx.evalExpr = wrap(api_eval_expr);
   sx.renderToHtml = caml_js_wrap_callback(api_render_to_html);
   sx.load = caml_js_wrap_callback(api_load);
   sx.loadModule = caml_js_wrap_callback(api_load_module);
   var in_batch = [0, 0];
   sx.beginModuleLoad =
    caml_js_wrap_callback
     (function(param){
       Stdlib_Hashtbl[2].call(null, vm_globals);
       Stdlib_Hashtbl[12].call
        (null,
         function(id, v){
          var a = Sx_types[5].call(null, id);
          return Stdlib_Hashtbl[11].call(null, vm_globals, a, v);
         },
         global_env[1]);
       in_batch[1] = 1;
       return 1;
      });
   sx.endModuleLoad =
    caml_js_wrap_callback
     (function(param){
       if(in_batch[1]){
        Stdlib_Hashtbl[12].call
         (null,
          function(k, v){
           var a = Sx_types[4].call(null, k);
           return Stdlib_Hashtbl[11].call(null, global_env[1], a, v);
          },
          vm_globals);
        in_batch[1] = 0;
       }
       return 1;
      });
   sx.compileModule = wrap(api_compile_module);
   sx.typeOf = caml_js_wrap_callback(api_type_of);
   sx.inspect = caml_js_wrap_callback(api_inspect);
   sx.engine = caml_js_wrap_callback(api_engine);
   sx.registerNative = caml_js_wrap_callback(api_register_native);
   sx.loadSource = caml_js_wrap_callback(api_load);
   sx.callFn = wrap(api_call_fn);
   sx.isCallable = caml_js_wrap_callback(api_is_callable);
   sx.fnArity = caml_js_wrap_callback(api_fn_arity);
   sx.debugEnv = caml_js_wrap_callback(api_debug_env);
   sx.scopeTraceOn =
    caml_js_wrap_callback
     (function(param){
       Sx_primitives[8].call(null, 0);
       return Js_of_ocaml_Js[1];
      });
   sx.scopeTraceOff =
    caml_js_wrap_callback
     (function(param){
       Sx_primitives[9].call(null, 0);
       return Js_of_ocaml_Js[1];
      });
   sx.scopeTraceDrain =
    caml_js_wrap_callback
     (function(param){
       var
        log = Sx_primitives[10].call(null, 0),
        a = Stdlib_List[20].call(null, caml_jsstring_of_string, log);
       return caml_js_from_array(Stdlib_Array[11].call(null, a));
      });
   sx.setStepLimit =
    caml_js_wrap_callback
     (function(n){
       var limit = n | 0;
       Sx_ref[3][1] = limit;
       Sx_ref[4][1] = 0;
       Sx_vm[23].call(null, 0);
       return Js_of_ocaml_Js[1];
      });
   sx.resetStepCount =
    caml_js_wrap_callback
     (function(param){
       Sx_ref[4][1] = 0;
       Sx_vm[23].call(null, 0);
       return Js_of_ocaml_Js[1];
      });
   Js_of_ocaml_Js[52][1].SxKernel = sx;
   runtime.caml_register_global(378, [0], "Dune__exe__Sx_browser");
   return;
  }
  (globalThis));

//# 5 "../.js/default/stdlib/std_exit.cmo.js"
//# shape: Std_exit:[]
(function
  (globalThis){
   "use strict";
   var runtime = globalThis.jsoo_runtime;
   function caml_call1(f, a0){
    return (f.l >= 0 ? f.l : f.l = f.length) === 1
            ? f(a0)
            : runtime.caml_call_gen(f, [a0]);
   }
   var Stdlib = runtime.caml_get_global_data().Stdlib;
   caml_call1(Stdlib[103], 0);
   runtime.caml_register_global(1, [0], "Std_exit");
   return;
  }
  (globalThis));

//# sourceMappingURL=data:application/json;base64,[encoded data, 3804676 characters]
