9212 lines
3.3 MiB
JavaScript
9212 lines
3.3 MiB
JavaScript
|
var input_data="JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAFFjrEKwkAQRHu/4pVJYbJ3mqzXKjYWQmDBQizkMF2E5P4f3CBitW9md4adGZjRiErfxBQT+/5A2DUqGgLLixtv2lMJ5IJQsp9LkzSJps4NYfuXa0+UTZ44GiF+1z47vMsmWrOA08id6lqv0Uj1/MEy1jywC2fzt4YPXCAhiwplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKMTI3CmVuZG9iagoyIDAgb2JqCjw8IC9UeXBlIC9QYWdlIC9QYXJlbnQgMyAwIFIgL1Jlc291cmNlcyA2IDAgUiAvQ29udGVudHMgNCAwIFIgL01lZGlhQm94IFswIDAgNjEyIDc5Ml0KPj4KZW5kb2JqCjYgMCBvYmoKPDwgL1Byb2NTZXQgWyAvUERGIC9UZXh0IF0gL0NvbG9yU3BhY2UgPDwgL0NzMSA3IDAgUiA+PiAvRm9udCA8PCAvVFQxIDggMCBSCj4+ID4+CmVuZG9iago5IDAgb2JqCjw8IC9MZW5ndGggMTAgMCBSIC9OIDEgL0FsdGVybmF0ZSAvRGV2aWNlR3JheSAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGFVV1oHFUUPrszO3mJQxFtSyt18K8hpGFSrSYWtdtNurtN2K6bjTZVqtPZ2e50JzPjndm0CX0Kgm9aEMRXRXwSLYjQasTkxb60VKiJFIsgKLRYQRD6IAp+Z3ayOxuRzHBnvjn3O+ee8917GKK+ZcP3nbRGNOeGIl/Jzh6fPaH1fUdpUqmfcBlm4GfL5SnGruda/O697q1Tii039nGs3rktvzI1KzDBWsHwaoE5R5TSiZRh0xchUd/rsI+eDX3G7wM/0KxWcsCfAKuxLyA9mLdcS9imlhfGglYWXt12krluNc8xtrzmnBbnytcejP6gOT2J9yByPlczxhk/BfyhaUxMAw8Br/vh4Uqbk063mjPZtj09VBdHZmL78UarwHiYKL202Ki+DLwN+KJ7qnQs5q+YQe4E8GOw321YRd4PjUjaZofFKjB8JV14FeaDI52sWeMTwM8CLzW9Sc5hJ/ByMD/NduZ/v9jIlYCxlpw+YxwtA28Hvt9y8sxHHHnAD8sccxR4ynVKvC7qld+0gqjGAeBPw0a1EPPXQ1Fl30dg/6tuHykCQ4fMQw1RYDvyyRR8JzpPTwMviVaFa38C+JIhJvLAiJn5yXJnWENgRaGXUgZZ5NEpPE1y6R/UHpBN8xHySWCujm+H8mC4GALDAes00K8UYp6t7B9QEzb2ZUaAZxlDxP4a1fDV9rMxy4gj3o58zE3cHOK4tEgGeO2V78Q8T94h6/KTGAflKfk5eVQeI01+QT4kPy+PwzomH4x8BHwXELVbAa94B1Hbkd6gVk8+q8g5hI9DP4PjRRkGyOBvRGhGzIQaF3a1Bnz/vbeXxGu2ef2dPxLqcG3NuM6uPglfOpZUO9K/tlntzC+Z25k1PG9mbiWq0TI/Zm7hvtlTlxevZqM+G5lvKMva29hVr4e9sQObWVlU7kR7ModqWX3eUVaflWwBh3jWYXVpXzLilfPLOzu8BdLW5Euv3ui/cv5/NWF9WGeLEqrU3Qu7fP/kx6ym9VbpXomWhvSL+l39I/0H/Xd9Tf8A6DfpXekL6WvpsvSldJU0aUValb6RvpU+k77C1+ewrkqXkVvy1LVPWef0INP2OTTjE8b18CkOiBVgNtfP1g2lzmCumymf7c0rsM7dE91ZSz2s7lYfVcfVh9XH1Sl1UD2gHlJ3qPsxRtSCuhczuzsqcU+x1jbeZbw3+s6m2Uir9o5wVg2oJ5ClgbubF/eo3YmGOKn7oDNH63J4jXZ324iixd3roWMNmkHFNp2NtAvw7eAbu/kfb+5JZJd6BSfLlvfII3Ix7sGsfABdONnTj6PcpcqEMq5kSVMGlTFlRDnKOKqVO1RT9mJ2DM+JZPaInuD0KIK/T2idw3+LKOf5C8I+3Qi1/br+jJbFb9LSiq45PKQZjqNFU4EmrMAS81ZtmPgfzH5Ef74Y/VtT26+aLTHftlEqdY3oX/q6h3sKZW5kc3RyZWFtCmVuZG9iagoxMCAwIG9iagoxMDg4CmVuZG9iago3IDAgb2JqClsgL0lDQ0Jhc2VkIDkgMCBSIF0KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9NZWRpYUJveCBbMCAwIDYxMiA3OTJdIC9Db3VudCAxIC9LaWRzIFsgMiAwIFIgXSA+PgplbmRvYmoKMTEgMCBvYmoKPDwgL1R5cGUgL0NhdGFsb2cgL1BhZ2VzIDMgMCBSID4+CmVuZG9iago4IDAgb2JqCjw8IC9UeXBlIC9Gb250IC9TdWJ0eXBlIC9UcnVlVHlwZSAvQmFzZUZvbnQgL05QUEdTRCtIZWx2ZXRpY2EgL0ZvbnREZXNjcmlwdG9yCjEyIDAgUiAvRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcgL0ZpcnN0Q2hhciA3OCAvTGFzdENoYXIgMTE0IC9XaWR0aHMgWyA3MjIKMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgNTU2IDAgMCAwIDAgMjc4IDAgMCAwIDAgMCAwIDAgMCAwIDAgMAozMzMgXSA+PgplbmRvYmoKMTIgMCBvYmoKPDwgL1R5cGUgL0ZvbnREZXNjcmlwdG9yIC9Gb250TmFtZSAvTlBQR1NEK0hlbHZldGljYSAvRmxhZ3MgMzIgL0ZvbnRCQm94IFstOTUxIC00ODEgMTQ0NSAxMTIyXQovSXRhbGljQW5nbGUgMCAvQXNjZW50IDc3MCAvRGVzY2VudCAtMjMwIC9DYXBIZWlnaHQgNzE3IC9TdGVtViA5OCAvWEhlaWdodAo1MjMgL1N0ZW1IIDg1IC9BdmdXaWR0aCAtNDQxIC9NYXhXaWR0aCAxNTAwIC9Gb250RmlsZTIgMTMgMCBSID4+CmVuZG9iagoxMyAwIG9iago8PCAvTGVuZ3RoIDE0IDAgUiAvTGVuZ3RoMSA2MDgwIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4Ab1Ye3QT15n/vjszkvzASLKN5IeQxCC/3wY/sIOFkYwN2DEYWIngINkIbAc3PsR4A11YJw1NEIRtQiFp4KShTVkeSxhsJ5FhoU4O2SZnNwlJ2/SVnjQbkvbs1if7CN00YM9+d2SrmNPk8Acnc3Xne957v/u739zR3P5t20MwCwZBgNb1wb7NoF0WH5Guzt5gX1Q2v060o3Og3xGVpRwAYevmvi29UdnwXYB425atO6baJ1eR/UpXKLgpaocbRCu6SBGVcQHR+V29/Q9GZfMI0ZSt93dO2ZMLSE7sDT44NT68T7LjG8HeUNTforXvu/+B/inZQLSgb1toyh8pfuFtQNJK8CTEwX2gBwZGKu0A+j/E20AkK7fTVfLWb368cXbtNTDxbgA2Nv+DRt8cPf/y56Eb2QlPGP5Mirhpf051uZO5FCKSfTzhiZhFa0c3KQJt+RFoolpHdSHV/PwlVhjE4/Adqs9RFaAb98EOqnupfo+qGONOkjSK+4ZEg/s87oB0XO5OEO1rUtLs1vgE+7sR1I08a/+V9aMLmEar9yGmDc2CuCXx+Bx+HzaBHX8ELtwJjZCDzwznbrUHyHQS+qgOUhW0O+LJobll9ktYAC4RqU0WzBXxJfvvSwvtH5dGGA7ZX82OiERemUuSe7Z9zPas/ce2LfZLVE9HTadyyeMl+0nbVvvBuRF8Zsj+pC2C1OaJKNluo6Yv2XtzD9s3lWr2lYcj7PSQvZrs69wJ9ooqp32h7aq9ODtiQJILbSvteaVv2udTQ3JzUKcut8meaTtoX0SmuTZv9iKqF/AUHoE8PDLkWm4/TyxNd7gpt+pwBL853JhT6orgTndFY87h3MZsV+5Kuyu3ITub+HWv6x/R36Nfoi/
|
||
|
|
||
|
function base64DecToArr(sBase64, nBlocksSize) {
|
||
|
function b64ToUint6 (nChr) {
|
||
|
return nChr > 64 && nChr < 91 ?
|
||
|
nChr - 65
|
||
|
: nChr > 96 && nChr < 123 ?
|
||
|
nChr - 71
|
||
|
: nChr > 47 && nChr < 58 ?
|
||
|
nChr + 4
|
||
|
: nChr === 43 ?
|
||
|
62
|
||
|
: nChr === 47 ?
|
||
|
63
|
||
|
:
|
||
|
0;
|
||
|
}
|
||
|
var
|
||
|
sB64Enc = sBase64.replace(/[^A-Za-z0-9\+\/]/g, ""), nInLen = sB64Enc.length,
|
||
|
nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2, taBytes = new Uint8Array(nOutLen);
|
||
|
for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {
|
||
|
nMod4 = nInIdx & 3;
|
||
|
nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 6 * (3 - nMod4);
|
||
|
if (nMod4 === 3 || nInLen - nInIdx === 1) {
|
||
|
for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
|
||
|
taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;
|
||
|
}
|
||
|
nUint24 = 0;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
return taBytes;
|
||
|
}
|
||
|
|
||
|
var Module = {
|
||
|
arguments: ['-scale-to', '512', 'input.pdf'],
|
||
|
print: function() {},
|
||
|
preRun: function() {
|
||
|
var input = new Int8Array(base64DecToArr(input_data).buffer);
|
||
|
FS.createDataFile('/', 'input.pdf', input, true, false);
|
||
|
}
|
||
|
};
|
||
|
// The Module object: Our interface to the outside world. We import
|
||
|
// and export values on it, and do the work to get that through
|
||
|
// closure compiler if necessary. There are various ways Module can be used:
|
||
|
// 1. Not defined. We create it here
|
||
|
// 2. A function parameter, function(Module) { ..generated code.. }
|
||
|
// 3. pre-run appended it, var Module = {}; ..generated code..
|
||
|
// 4. External script tag defines var Module.
|
||
|
// We need to do an eval in order to handle the closure compiler
|
||
|
// case, where this code here is minified but Module was defined
|
||
|
// elsewhere (e.g. case 4 above). We also need to check if Module
|
||
|
// already exists (e.g. case 3 above).
|
||
|
// Note that if you want to run closure, and also to use Module
|
||
|
// after the generated code, you will need to define var Module = {};
|
||
|
// before the code. Then that object will be used in the code, and you
|
||
|
// can continue to use Module afterwards as well.
|
||
|
var Module;
|
||
|
if (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');
|
||
|
|
||
|
// Sometimes an existing Module object exists with properties
|
||
|
// meant to overwrite the default module functionality. Here
|
||
|
// we collect those properties and reapply _after_ we configure
|
||
|
// the current environment's defaults to avoid having to be so
|
||
|
// defensive during initialization.
|
||
|
var moduleOverrides = {};
|
||
|
for (var key in Module) {
|
||
|
if (Module.hasOwnProperty(key)) {
|
||
|
moduleOverrides[key] = Module[key];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// The environment setup code below is customized to use Module.
|
||
|
// *** Environment setup code ***
|
||
|
var ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';
|
||
|
var ENVIRONMENT_IS_WEB = typeof window === 'object';
|
||
|
var ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
|
||
|
var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
|
||
|
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
// Expose functionality in the same simple way that the shells work
|
||
|
// Note that we pollute the global namespace here, otherwise we break in node
|
||
|
if (!Module['print']) Module['print'] = function print(x) {
|
||
|
process['stdout'].write(x + '\n');
|
||
|
};
|
||
|
if (!Module['printErr']) Module['printErr'] = function printErr(x) {
|
||
|
process['stderr'].write(x + '\n');
|
||
|
};
|
||
|
|
||
|
var nodeFS = require('fs');
|
||
|
var nodePath = require('path');
|
||
|
|
||
|
Module['read'] = function read(filename, binary) {
|
||
|
filename = nodePath['normalize'](filename);
|
||
|
var ret = nodeFS['readFileSync'](filename);
|
||
|
// The path is absolute if the normalized version is the same as the resolved.
|
||
|
if (!ret && filename != nodePath['resolve'](filename)) {
|
||
|
filename = path.join(__dirname, '..', 'src', filename);
|
||
|
ret = nodeFS['readFileSync'](filename);
|
||
|
}
|
||
|
if (ret && !binary) ret = ret.toString();
|
||
|
return ret;
|
||
|
};
|
||
|
|
||
|
Module['readBinary'] = function readBinary(filename) { return Module['read'](filename, true) };
|
||
|
|
||
|
Module['load'] = function load(f) {
|
||
|
globalEval(read(f));
|
||
|
};
|
||
|
|
||
|
Module['arguments'] = process['argv'].slice(2);
|
||
|
|
||
|
module['exports'] = Module;
|
||
|
}
|
||
|
else if (ENVIRONMENT_IS_SHELL) {
|
||
|
if (!Module['print']) Module['print'] = print;
|
||
|
if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
|
||
|
|
||
|
if (typeof read != 'undefined') {
|
||
|
Module['read'] = read;
|
||
|
} else {
|
||
|
Module['read'] = function read() { throw 'no read() available (jsc?)' };
|
||
|
}
|
||
|
|
||
|
Module['readBinary'] = function readBinary(f) {
|
||
|
return read(f, 'binary');
|
||
|
};
|
||
|
|
||
|
if (typeof scriptArgs != 'undefined') {
|
||
|
Module['arguments'] = scriptArgs;
|
||
|
} else if (typeof arguments != 'undefined') {
|
||
|
Module['arguments'] = arguments;
|
||
|
}
|
||
|
|
||
|
this['Module'] = Module;
|
||
|
|
||
|
eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined"); // wipe out the SpiderMonkey shell 'gc' function, which can confuse closure (uses it as a minified name, and it is then initted to a non-falsey value unexpectedly)
|
||
|
}
|
||
|
else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
||
|
Module['read'] = function read(url) {
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open('GET', url, false);
|
||
|
xhr.send(null);
|
||
|
return xhr.responseText;
|
||
|
};
|
||
|
|
||
|
if (typeof arguments != 'undefined') {
|
||
|
Module['arguments'] = arguments;
|
||
|
}
|
||
|
|
||
|
if (typeof console !== 'undefined') {
|
||
|
if (!Module['print']) Module['print'] = function print(x) {
|
||
|
console.log(x);
|
||
|
};
|
||
|
if (!Module['printErr']) Module['printErr'] = function printErr(x) {
|
||
|
console.log(x);
|
||
|
};
|
||
|
} else {
|
||
|
// Probably a worker, and without console.log. We can do very little here...
|
||
|
var TRY_USE_DUMP = false;
|
||
|
if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
|
||
|
dump(x);
|
||
|
}) : (function(x) {
|
||
|
// self.postMessage(x); // enable this if you want stdout to be sent as messages
|
||
|
}));
|
||
|
}
|
||
|
|
||
|
if (ENVIRONMENT_IS_WEB) {
|
||
|
this['Module'] = Module;
|
||
|
} else {
|
||
|
Module['load'] = importScripts;
|
||
|
}
|
||
|
}
|
||
|
else {
|
||
|
// Unreachable because SHELL is dependant on the others
|
||
|
throw 'Unknown runtime environment. Where are we?';
|
||
|
}
|
||
|
|
||
|
function globalEval(x) {
|
||
|
eval.call(null, x);
|
||
|
}
|
||
|
if (!Module['load'] == 'undefined' && Module['read']) {
|
||
|
Module['load'] = function load(f) {
|
||
|
globalEval(Module['read'](f));
|
||
|
};
|
||
|
}
|
||
|
if (!Module['print']) {
|
||
|
Module['print'] = function(){};
|
||
|
}
|
||
|
if (!Module['printErr']) {
|
||
|
Module['printErr'] = Module['print'];
|
||
|
}
|
||
|
if (!Module['arguments']) {
|
||
|
Module['arguments'] = [];
|
||
|
}
|
||
|
// *** Environment setup code ***
|
||
|
|
||
|
// Closure helpers
|
||
|
Module.print = Module['print'];
|
||
|
Module.printErr = Module['printErr'];
|
||
|
|
||
|
// Callbacks
|
||
|
Module['preRun'] = [];
|
||
|
Module['postRun'] = [];
|
||
|
|
||
|
// Merge back in the overrides
|
||
|
for (var key in moduleOverrides) {
|
||
|
if (moduleOverrides.hasOwnProperty(key)) {
|
||
|
Module[key] = moduleOverrides[key];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
// === Auto-generated preamble library stuff ===
|
||
|
|
||
|
//========================================
|
||
|
// Runtime code shared with compiler
|
||
|
//========================================
|
||
|
|
||
|
var Runtime = {
|
||
|
stackSave: function () {
|
||
|
return STACKTOP;
|
||
|
},
|
||
|
stackRestore: function (stackTop) {
|
||
|
STACKTOP = stackTop;
|
||
|
},
|
||
|
forceAlign: function (target, quantum) {
|
||
|
quantum = quantum || 4;
|
||
|
if (quantum == 1) return target;
|
||
|
if (isNumber(target) && isNumber(quantum)) {
|
||
|
return Math.ceil(target/quantum)*quantum;
|
||
|
} else if (isNumber(quantum) && isPowerOfTwo(quantum)) {
|
||
|
return '(((' +target + ')+' + (quantum-1) + ')&' + -quantum + ')';
|
||
|
}
|
||
|
return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;
|
||
|
},
|
||
|
isNumberType: function (type) {
|
||
|
return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;
|
||
|
},
|
||
|
isPointerType: function isPointerType(type) {
|
||
|
return type[type.length-1] == '*';
|
||
|
},
|
||
|
isStructType: function isStructType(type) {
|
||
|
if (isPointerType(type)) return false;
|
||
|
if (isArrayType(type)) return true;
|
||
|
if (/<?{ ?[^}]* ?}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
|
||
|
// See comment in isStructPointerType()
|
||
|
return type[0] == '%';
|
||
|
},
|
||
|
INT_TYPES: {"i1":0,"i8":0,"i16":0,"i32":0,"i64":0},
|
||
|
FLOAT_TYPES: {"float":0,"double":0},
|
||
|
or64: function (x, y) {
|
||
|
var l = (x | 0) | (y | 0);
|
||
|
var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;
|
||
|
return l + h;
|
||
|
},
|
||
|
and64: function (x, y) {
|
||
|
var l = (x | 0) & (y | 0);
|
||
|
var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;
|
||
|
return l + h;
|
||
|
},
|
||
|
xor64: function (x, y) {
|
||
|
var l = (x | 0) ^ (y | 0);
|
||
|
var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;
|
||
|
return l + h;
|
||
|
},
|
||
|
getNativeTypeSize: function (type) {
|
||
|
switch (type) {
|
||
|
case 'i1': case 'i8': return 1;
|
||
|
case 'i16': return 2;
|
||
|
case 'i32': return 4;
|
||
|
case 'i64': return 8;
|
||
|
case 'float': return 4;
|
||
|
case 'double': return 8;
|
||
|
default: {
|
||
|
if (type[type.length-1] === '*') {
|
||
|
return Runtime.QUANTUM_SIZE; // A pointer
|
||
|
} else if (type[0] === 'i') {
|
||
|
var bits = parseInt(type.substr(1));
|
||
|
assert(bits % 8 === 0);
|
||
|
return bits/8;
|
||
|
} else {
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
getNativeFieldSize: function (type) {
|
||
|
return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);
|
||
|
},
|
||
|
dedup: function dedup(items, ident) {
|
||
|
var seen = {};
|
||
|
if (ident) {
|
||
|
return items.filter(function(item) {
|
||
|
if (seen[item[ident]]) return false;
|
||
|
seen[item[ident]] = true;
|
||
|
return true;
|
||
|
});
|
||
|
} else {
|
||
|
return items.filter(function(item) {
|
||
|
if (seen[item]) return false;
|
||
|
seen[item] = true;
|
||
|
return true;
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
set: function set() {
|
||
|
var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;
|
||
|
var ret = {};
|
||
|
for (var i = 0; i < args.length; i++) {
|
||
|
ret[args[i]] = 0;
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
STACK_ALIGN: 8,
|
||
|
getAlignSize: function (type, size, vararg) {
|
||
|
// we align i64s and doubles on 64-bit boundaries, unlike x86
|
||
|
if (!vararg && (type == 'i64' || type == 'double')) return 8;
|
||
|
if (!type) return Math.min(size, 8); // align structures internally to 64 bits
|
||
|
return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);
|
||
|
},
|
||
|
calculateStructAlignment: function calculateStructAlignment(type) {
|
||
|
type.flatSize = 0;
|
||
|
type.alignSize = 0;
|
||
|
var diffs = [];
|
||
|
var prev = -1;
|
||
|
var index = 0;
|
||
|
type.flatIndexes = type.fields.map(function(field) {
|
||
|
index++;
|
||
|
var size, alignSize;
|
||
|
if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {
|
||
|
size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.
|
||
|
alignSize = Runtime.getAlignSize(field, size);
|
||
|
} else if (Runtime.isStructType(field)) {
|
||
|
if (field[1] === '0') {
|
||
|
// this is [0 x something]. When inside another structure like here, it must be at the end,
|
||
|
// and it adds no size
|
||
|
// XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');
|
||
|
size = 0;
|
||
|
if (Types.types[field]) {
|
||
|
alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);
|
||
|
} else {
|
||
|
alignSize = type.alignSize || QUANTUM_SIZE;
|
||
|
}
|
||
|
} else {
|
||
|
size = Types.types[field].flatSize;
|
||
|
alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);
|
||
|
}
|
||
|
} else if (field[0] == 'b') {
|
||
|
// bN, large number field, like a [N x i8]
|
||
|
size = field.substr(1)|0;
|
||
|
alignSize = 1;
|
||
|
} else if (field[0] === '<') {
|
||
|
// vector type
|
||
|
size = alignSize = Types.types[field].flatSize; // fully aligned
|
||
|
} else if (field[0] === 'i') {
|
||
|
// illegal integer field, that could not be legalized because it is an internal structure field
|
||
|
// it is ok to have such fields, if we just use them as markers of field size and nothing more complex
|
||
|
size = alignSize = parseInt(field.substr(1))/8;
|
||
|
assert(size % 1 === 0, 'cannot handle non-byte-size field ' + field);
|
||
|
} else {
|
||
|
assert(false, 'invalid type for calculateStructAlignment');
|
||
|
}
|
||
|
if (type.packed) alignSize = 1;
|
||
|
type.alignSize = Math.max(type.alignSize, alignSize);
|
||
|
var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory
|
||
|
type.flatSize = curr + size;
|
||
|
if (prev >= 0) {
|
||
|
diffs.push(curr-prev);
|
||
|
}
|
||
|
prev = curr;
|
||
|
return curr;
|
||
|
});
|
||
|
if (type.name_ && type.name_[0] === '[') {
|
||
|
// arrays have 2 elements, so we get the proper difference. then we scale here. that way we avoid
|
||
|
// allocating a potentially huge array for [999999 x i8] etc.
|
||
|
type.flatSize = parseInt(type.name_.substr(1))*type.flatSize/2;
|
||
|
}
|
||
|
type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);
|
||
|
if (diffs.length == 0) {
|
||
|
type.flatFactor = type.flatSize;
|
||
|
} else if (Runtime.dedup(diffs).length == 1) {
|
||
|
type.flatFactor = diffs[0];
|
||
|
}
|
||
|
type.needsFlattening = (type.flatFactor != 1);
|
||
|
return type.flatIndexes;
|
||
|
},
|
||
|
generateStructInfo: function (struct, typeName, offset) {
|
||
|
var type, alignment;
|
||
|
if (typeName) {
|
||
|
offset = offset || 0;
|
||
|
type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];
|
||
|
if (!type) return null;
|
||
|
if (type.fields.length != struct.length) {
|
||
|
printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');
|
||
|
return null;
|
||
|
}
|
||
|
alignment = type.flatIndexes;
|
||
|
} else {
|
||
|
var type = { fields: struct.map(function(item) { return item[0] }) };
|
||
|
alignment = Runtime.calculateStructAlignment(type);
|
||
|
}
|
||
|
var ret = {
|
||
|
__size__: type.flatSize
|
||
|
};
|
||
|
if (typeName) {
|
||
|
struct.forEach(function(item, i) {
|
||
|
if (typeof item === 'string') {
|
||
|
ret[item] = alignment[i] + offset;
|
||
|
} else {
|
||
|
// embedded struct
|
||
|
var key;
|
||
|
for (var k in item) key = k;
|
||
|
ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);
|
||
|
}
|
||
|
});
|
||
|
} else {
|
||
|
struct.forEach(function(item, i) {
|
||
|
ret[item[1]] = alignment[i];
|
||
|
});
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
dynCall: function (sig, ptr, args) {
|
||
|
if (args && args.length) {
|
||
|
if (!args.splice) args = Array.prototype.slice.call(args);
|
||
|
args.splice(0, 0, ptr);
|
||
|
return Module['dynCall_' + sig].apply(null, args);
|
||
|
} else {
|
||
|
return Module['dynCall_' + sig].call(null, ptr);
|
||
|
}
|
||
|
},
|
||
|
functionPointers: [],
|
||
|
addFunction: function (func) {
|
||
|
for (var i = 0; i < Runtime.functionPointers.length; i++) {
|
||
|
if (!Runtime.functionPointers[i]) {
|
||
|
Runtime.functionPointers[i] = func;
|
||
|
return 2*(1 + i);
|
||
|
}
|
||
|
}
|
||
|
throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';
|
||
|
},
|
||
|
removeFunction: function (index) {
|
||
|
Runtime.functionPointers[(index-2)/2] = null;
|
||
|
},
|
||
|
getAsmConst: function (code, numArgs) {
|
||
|
// code is a constant string on the heap, so we can cache these
|
||
|
if (!Runtime.asmConstCache) Runtime.asmConstCache = {};
|
||
|
var func = Runtime.asmConstCache[code];
|
||
|
if (func) return func;
|
||
|
var args = [];
|
||
|
for (var i = 0; i < numArgs; i++) {
|
||
|
args.push(String.fromCharCode(36) + i); // $0, $1 etc
|
||
|
}
|
||
|
code = Pointer_stringify(code);
|
||
|
if (code[0] === '"') {
|
||
|
// tolerate EM_ASM("..code..") even though EM_ASM(..code..) is correct
|
||
|
if (code.indexOf('"', 1) === code.length-1) {
|
||
|
code = code.substr(1, code.length-2);
|
||
|
} else {
|
||
|
// something invalid happened, e.g. EM_ASM("..code($0)..", input)
|
||
|
abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');
|
||
|
}
|
||
|
}
|
||
|
return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node
|
||
|
},
|
||
|
warnOnce: function (text) {
|
||
|
if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};
|
||
|
if (!Runtime.warnOnce.shown[text]) {
|
||
|
Runtime.warnOnce.shown[text] = 1;
|
||
|
Module.printErr(text);
|
||
|
}
|
||
|
},
|
||
|
funcWrappers: {},
|
||
|
getFuncWrapper: function (func, sig) {
|
||
|
assert(sig);
|
||
|
if (!Runtime.funcWrappers[func]) {
|
||
|
Runtime.funcWrappers[func] = function dynCall_wrapper() {
|
||
|
return Runtime.dynCall(sig, func, arguments);
|
||
|
};
|
||
|
}
|
||
|
return Runtime.funcWrappers[func];
|
||
|
},
|
||
|
UTF8Processor: function () {
|
||
|
var buffer = [];
|
||
|
var needed = 0;
|
||
|
this.processCChar = function (code) {
|
||
|
code = code & 0xFF;
|
||
|
|
||
|
if (buffer.length == 0) {
|
||
|
if ((code & 0x80) == 0x00) { // 0xxxxxxx
|
||
|
return String.fromCharCode(code);
|
||
|
}
|
||
|
buffer.push(code);
|
||
|
if ((code & 0xE0) == 0xC0) { // 110xxxxx
|
||
|
needed = 1;
|
||
|
} else if ((code & 0xF0) == 0xE0) { // 1110xxxx
|
||
|
needed = 2;
|
||
|
} else { // 11110xxx
|
||
|
needed = 3;
|
||
|
}
|
||
|
return '';
|
||
|
}
|
||
|
|
||
|
if (needed) {
|
||
|
buffer.push(code);
|
||
|
needed--;
|
||
|
if (needed > 0) return '';
|
||
|
}
|
||
|
|
||
|
var c1 = buffer[0];
|
||
|
var c2 = buffer[1];
|
||
|
var c3 = buffer[2];
|
||
|
var c4 = buffer[3];
|
||
|
var ret;
|
||
|
if (buffer.length == 2) {
|
||
|
ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));
|
||
|
} else if (buffer.length == 3) {
|
||
|
ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));
|
||
|
} else {
|
||
|
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||
|
var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |
|
||
|
((c3 & 0x3F) << 6) | (c4 & 0x3F);
|
||
|
ret = String.fromCharCode(
|
||
|
Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,
|
||
|
(codePoint - 0x10000) % 0x400 + 0xDC00);
|
||
|
}
|
||
|
buffer.length = 0;
|
||
|
return ret;
|
||
|
}
|
||
|
this.processJSString = function processJSString(string) {
|
||
|
string = unescape(encodeURIComponent(string));
|
||
|
var ret = [];
|
||
|
for (var i = 0; i < string.length; i++) {
|
||
|
ret.push(string.charCodeAt(i));
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
},
|
||
|
stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+7)&-8); return ret; },
|
||
|
staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + size)|0;STATICTOP = (((STATICTOP)+7)&-8); return ret; },
|
||
|
dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + size)|0;DYNAMICTOP = (((DYNAMICTOP)+7)&-8); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },
|
||
|
alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },
|
||
|
makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*(+4294967296))) : ((+((low>>>0)))+((+((high|0)))*(+4294967296)))); return ret; },
|
||
|
GLOBAL_BASE: 8,
|
||
|
QUANTUM_SIZE: 4,
|
||
|
__dummy__: 0
|
||
|
}
|
||
|
|
||
|
|
||
|
Module['Runtime'] = Runtime;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//========================================
|
||
|
// Runtime essentials
|
||
|
//========================================
|
||
|
|
||
|
var __THREW__ = 0; // Used in checking for thrown exceptions.
|
||
|
|
||
|
var ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()
|
||
|
var EXITSTATUS = 0;
|
||
|
|
||
|
var undef = 0;
|
||
|
// tempInt is used for 32-bit signed values or smaller. tempBigInt is used
|
||
|
// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt
|
||
|
var tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD, tempDouble, tempFloat;
|
||
|
var tempI64, tempI64b;
|
||
|
var tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;
|
||
|
|
||
|
function assert(condition, text) {
|
||
|
if (!condition) {
|
||
|
abort('Assertion failed: ' + text);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var globalScope = this;
|
||
|
|
||
|
// C calling interface. A convenient way to call C functions (in C files, or
|
||
|
// defined with extern "C").
|
||
|
//
|
||
|
// Note: LLVM optimizations can inline and remove functions, after which you will not be
|
||
|
// able to call them. Closure can also do so. To avoid that, add your function to
|
||
|
// the exports using something like
|
||
|
//
|
||
|
// -s EXPORTED_FUNCTIONS='["_main", "_myfunc"]'
|
||
|
//
|
||
|
// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern "C")
|
||
|
// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and
|
||
|
// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).
|
||
|
// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,
|
||
|
// except that 'array' is not possible (there is no way for us to know the length of the array)
|
||
|
// @param args An array of the arguments to the function, as native JS values (as in returnType)
|
||
|
// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).
|
||
|
// @return The return value, as a native JS value (as in returnType)
|
||
|
function ccall(ident, returnType, argTypes, args) {
|
||
|
return ccallFunc(getCFunc(ident), returnType, argTypes, args);
|
||
|
}
|
||
|
Module["ccall"] = ccall;
|
||
|
|
||
|
// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
|
||
|
function getCFunc(ident) {
|
||
|
try {
|
||
|
var func = Module['_' + ident]; // closure exported function
|
||
|
if (!func) func = eval('_' + ident); // explicit lookup
|
||
|
} catch(e) {
|
||
|
}
|
||
|
assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');
|
||
|
return func;
|
||
|
}
|
||
|
|
||
|
// Internal function that does a C call using a function, not an identifier
|
||
|
function ccallFunc(func, returnType, argTypes, args) {
|
||
|
var stack = 0;
|
||
|
function toC(value, type) {
|
||
|
if (type == 'string') {
|
||
|
if (value === null || value === undefined || value === 0) return 0; // null string
|
||
|
value = intArrayFromString(value);
|
||
|
type = 'array';
|
||
|
}
|
||
|
if (type == 'array') {
|
||
|
if (!stack) stack = Runtime.stackSave();
|
||
|
var ret = Runtime.stackAlloc(value.length);
|
||
|
writeArrayToMemory(value, ret);
|
||
|
return ret;
|
||
|
}
|
||
|
return value;
|
||
|
}
|
||
|
function fromC(value, type) {
|
||
|
if (type == 'string') {
|
||
|
return Pointer_stringify(value);
|
||
|
}
|
||
|
assert(type != 'array');
|
||
|
return value;
|
||
|
}
|
||
|
var i = 0;
|
||
|
var cArgs = args ? args.map(function(arg) {
|
||
|
return toC(arg, argTypes[i++]);
|
||
|
}) : [];
|
||
|
var ret = fromC(func.apply(null, cArgs), returnType);
|
||
|
if (stack) Runtime.stackRestore(stack);
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
// Returns a native JS wrapper for a C function. This is similar to ccall, but
|
||
|
// returns a function you can call repeatedly in a normal way. For example:
|
||
|
//
|
||
|
// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);
|
||
|
// alert(my_function(5, 22));
|
||
|
// alert(my_function(99, 12));
|
||
|
//
|
||
|
function cwrap(ident, returnType, argTypes) {
|
||
|
var func = getCFunc(ident);
|
||
|
return function() {
|
||
|
return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));
|
||
|
}
|
||
|
}
|
||
|
Module["cwrap"] = cwrap;
|
||
|
|
||
|
// Sets a value in memory in a dynamic way at run-time. Uses the
|
||
|
// type data. This is the same as makeSetValue, except that
|
||
|
// makeSetValue is done at compile-time and generates the needed
|
||
|
// code then, whereas this function picks the right code at
|
||
|
// run-time.
|
||
|
// Note that setValue and getValue only do *aligned* writes and reads!
|
||
|
// Note that ccall uses JS types as for defining types, while setValue and
|
||
|
// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation
|
||
|
function setValue(ptr, value, type, noSafe) {
|
||
|
type = type || 'i8';
|
||
|
if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
|
||
|
switch(type) {
|
||
|
case 'i1': HEAP8[(ptr)]=value; break;
|
||
|
case 'i8': HEAP8[(ptr)]=value; break;
|
||
|
case 'i16': HEAP16[((ptr)>>1)]=value; break;
|
||
|
case 'i32': HEAP32[((ptr)>>2)]=value; break;
|
||
|
case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
|
||
|
case 'float': HEAPF32[((ptr)>>2)]=value; break;
|
||
|
case 'double': HEAPF64[((ptr)>>3)]=value; break;
|
||
|
default: abort('invalid type for setValue: ' + type);
|
||
|
}
|
||
|
}
|
||
|
Module['setValue'] = setValue;
|
||
|
|
||
|
// Parallel to setValue.
|
||
|
function getValue(ptr, type, noSafe) {
|
||
|
type = type || 'i8';
|
||
|
if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
|
||
|
switch(type) {
|
||
|
case 'i1': return HEAP8[(ptr)];
|
||
|
case 'i8': return HEAP8[(ptr)];
|
||
|
case 'i16': return HEAP16[((ptr)>>1)];
|
||
|
case 'i32': return HEAP32[((ptr)>>2)];
|
||
|
case 'i64': return HEAP32[((ptr)>>2)];
|
||
|
case 'float': return HEAPF32[((ptr)>>2)];
|
||
|
case 'double': return HEAPF64[((ptr)>>3)];
|
||
|
default: abort('invalid type for setValue: ' + type);
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
Module['getValue'] = getValue;
|
||
|
|
||
|
var ALLOC_NORMAL = 0; // Tries to use _malloc()
|
||
|
var ALLOC_STACK = 1; // Lives for the duration of the current function call
|
||
|
var ALLOC_STATIC = 2; // Cannot be freed
|
||
|
var ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk
|
||
|
var ALLOC_NONE = 4; // Do not allocate
|
||
|
Module['ALLOC_NORMAL'] = ALLOC_NORMAL;
|
||
|
Module['ALLOC_STACK'] = ALLOC_STACK;
|
||
|
Module['ALLOC_STATIC'] = ALLOC_STATIC;
|
||
|
Module['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;
|
||
|
Module['ALLOC_NONE'] = ALLOC_NONE;
|
||
|
|
||
|
// allocate(): This is for internal use. You can use it yourself as well, but the interface
|
||
|
// is a little tricky (see docs right below). The reason is that it is optimized
|
||
|
// for multiple syntaxes to save space in generated code. So you should
|
||
|
// normally not use allocate(), and instead allocate memory using _malloc(),
|
||
|
// initialize it with setValue(), and so forth.
|
||
|
// @slab: An array of data, or a number. If a number, then the size of the block to allocate,
|
||
|
// in *bytes* (note that this is sometimes confusing: the next parameter does not
|
||
|
// affect this!)
|
||
|
// @types: Either an array of types, one for each byte (or 0 if no type at that position),
|
||
|
// or a single type which is used for the entire block. This only matters if there
|
||
|
// is initial data - if @slab is a number, then this does not matter at all and is
|
||
|
// ignored.
|
||
|
// @allocator: How to allocate memory, see ALLOC_*
|
||
|
function allocate(slab, types, allocator, ptr) {
|
||
|
var zeroinit, size;
|
||
|
if (typeof slab === 'number') {
|
||
|
zeroinit = true;
|
||
|
size = slab;
|
||
|
} else {
|
||
|
zeroinit = false;
|
||
|
size = slab.length;
|
||
|
}
|
||
|
|
||
|
var singleType = typeof types === 'string' ? types : null;
|
||
|
|
||
|
var ret;
|
||
|
if (allocator == ALLOC_NONE) {
|
||
|
ret = ptr;
|
||
|
} else {
|
||
|
ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));
|
||
|
}
|
||
|
|
||
|
if (zeroinit) {
|
||
|
var ptr = ret, stop;
|
||
|
assert((ret & 3) == 0);
|
||
|
stop = ret + (size & ~3);
|
||
|
for (; ptr < stop; ptr += 4) {
|
||
|
HEAP32[((ptr)>>2)]=0;
|
||
|
}
|
||
|
stop = ret + size;
|
||
|
while (ptr < stop) {
|
||
|
HEAP8[((ptr++)|0)]=0;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
if (singleType === 'i8') {
|
||
|
if (slab.subarray || slab.slice) {
|
||
|
HEAPU8.set(slab, ret);
|
||
|
} else {
|
||
|
HEAPU8.set(new Uint8Array(slab), ret);
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
var i = 0, type, typeSize, previousType;
|
||
|
while (i < size) {
|
||
|
var curr = slab[i];
|
||
|
|
||
|
if (typeof curr === 'function') {
|
||
|
curr = Runtime.getFunctionIndex(curr);
|
||
|
}
|
||
|
|
||
|
type = singleType || types[i];
|
||
|
if (type === 0) {
|
||
|
i++;
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later
|
||
|
|
||
|
setValue(ret+i, curr, type);
|
||
|
|
||
|
// no need to look up size unless type changes, so cache it
|
||
|
if (previousType !== type) {
|
||
|
typeSize = Runtime.getNativeTypeSize(type);
|
||
|
previousType = type;
|
||
|
}
|
||
|
i += typeSize;
|
||
|
}
|
||
|
|
||
|
return ret;
|
||
|
}
|
||
|
Module['allocate'] = allocate;
|
||
|
|
||
|
function Pointer_stringify(ptr, /* optional */ length) {
|
||
|
// TODO: use TextDecoder
|
||
|
// Find the length, and check for UTF while doing so
|
||
|
var hasUtf = false;
|
||
|
var t;
|
||
|
var i = 0;
|
||
|
while (1) {
|
||
|
t = HEAPU8[(((ptr)+(i))|0)];
|
||
|
if (t >= 128) hasUtf = true;
|
||
|
else if (t == 0 && !length) break;
|
||
|
i++;
|
||
|
if (length && i == length) break;
|
||
|
}
|
||
|
if (!length) length = i;
|
||
|
|
||
|
var ret = '';
|
||
|
|
||
|
if (!hasUtf) {
|
||
|
var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack
|
||
|
var curr;
|
||
|
while (length > 0) {
|
||
|
curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
|
||
|
ret = ret ? ret + curr : curr;
|
||
|
ptr += MAX_CHUNK;
|
||
|
length -= MAX_CHUNK;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
var utf8 = new Runtime.UTF8Processor();
|
||
|
for (i = 0; i < length; i++) {
|
||
|
t = HEAPU8[(((ptr)+(i))|0)];
|
||
|
ret += utf8.processCChar(t);
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
Module['Pointer_stringify'] = Pointer_stringify;
|
||
|
|
||
|
// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns
|
||
|
// a copy of that string as a Javascript String object.
|
||
|
function UTF16ToString(ptr) {
|
||
|
var i = 0;
|
||
|
|
||
|
var str = '';
|
||
|
while (1) {
|
||
|
var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];
|
||
|
if (codeUnit == 0)
|
||
|
return str;
|
||
|
++i;
|
||
|
// fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.
|
||
|
str += String.fromCharCode(codeUnit);
|
||
|
}
|
||
|
}
|
||
|
Module['UTF16ToString'] = UTF16ToString;
|
||
|
|
||
|
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
|
||
|
// null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.
|
||
|
function stringToUTF16(str, outPtr) {
|
||
|
for(var i = 0; i < str.length; ++i) {
|
||
|
// charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
|
||
|
var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
|
||
|
HEAP16[(((outPtr)+(i*2))>>1)]=codeUnit;
|
||
|
}
|
||
|
// Null-terminate the pointer to the HEAP.
|
||
|
HEAP16[(((outPtr)+(str.length*2))>>1)]=0;
|
||
|
}
|
||
|
Module['stringToUTF16'] = stringToUTF16;
|
||
|
|
||
|
// Given a pointer 'ptr' to a null-terminated UTF32LE-encoded string in the emscripten HEAP, returns
|
||
|
// a copy of that string as a Javascript String object.
|
||
|
function UTF32ToString(ptr) {
|
||
|
var i = 0;
|
||
|
|
||
|
var str = '';
|
||
|
while (1) {
|
||
|
var utf32 = HEAP32[(((ptr)+(i*4))>>2)];
|
||
|
if (utf32 == 0)
|
||
|
return str;
|
||
|
++i;
|
||
|
// Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.
|
||
|
if (utf32 >= 0x10000) {
|
||
|
var ch = utf32 - 0x10000;
|
||
|
str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
|
||
|
} else {
|
||
|
str += String.fromCharCode(utf32);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
Module['UTF32ToString'] = UTF32ToString;
|
||
|
|
||
|
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
|
||
|
// null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP,
|
||
|
// but can use less, since str.length does not return the number of characters in the string, but the number of UTF-16 code units in the string.
|
||
|
function stringToUTF32(str, outPtr) {
|
||
|
var iChar = 0;
|
||
|
for(var iCodeUnit = 0; iCodeUnit < str.length; ++iCodeUnit) {
|
||
|
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
|
||
|
var codeUnit = str.charCodeAt(iCodeUnit); // possibly a lead surrogate
|
||
|
if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {
|
||
|
var trailSurrogate = str.charCodeAt(++iCodeUnit);
|
||
|
codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);
|
||
|
}
|
||
|
HEAP32[(((outPtr)+(iChar*4))>>2)]=codeUnit;
|
||
|
++iChar;
|
||
|
}
|
||
|
// Null-terminate the pointer to the HEAP.
|
||
|
HEAP32[(((outPtr)+(iChar*4))>>2)]=0;
|
||
|
}
|
||
|
Module['stringToUTF32'] = stringToUTF32;
|
||
|
|
||
|
function demangle(func) {
|
||
|
try {
|
||
|
// Special-case the entry point, since its name differs from other name mangling.
|
||
|
if (func == 'Object._main' || func == '_main') {
|
||
|
return 'main()';
|
||
|
}
|
||
|
if (typeof func === 'number') func = Pointer_stringify(func);
|
||
|
if (func[0] !== '_') return func;
|
||
|
if (func[1] !== '_') return func; // C function
|
||
|
if (func[2] !== 'Z') return func;
|
||
|
switch (func[3]) {
|
||
|
case 'n': return 'operator new()';
|
||
|
case 'd': return 'operator delete()';
|
||
|
}
|
||
|
var i = 3;
|
||
|
// params, etc.
|
||
|
var basicTypes = {
|
||
|
'v': 'void',
|
||
|
'b': 'bool',
|
||
|
'c': 'char',
|
||
|
's': 'short',
|
||
|
'i': 'int',
|
||
|
'l': 'long',
|
||
|
'f': 'float',
|
||
|
'd': 'double',
|
||
|
'w': 'wchar_t',
|
||
|
'a': 'signed char',
|
||
|
'h': 'unsigned char',
|
||
|
't': 'unsigned short',
|
||
|
'j': 'unsigned int',
|
||
|
'm': 'unsigned long',
|
||
|
'x': 'long long',
|
||
|
'y': 'unsigned long long',
|
||
|
'z': '...'
|
||
|
};
|
||
|
function dump(x) {
|
||
|
//return;
|
||
|
if (x) Module.print(x);
|
||
|
Module.print(func);
|
||
|
var pre = '';
|
||
|
for (var a = 0; a < i; a++) pre += ' ';
|
||
|
Module.print (pre + '^');
|
||
|
}
|
||
|
var subs = [];
|
||
|
function parseNested() {
|
||
|
i++;
|
||
|
if (func[i] === 'K') i++; // ignore const
|
||
|
var parts = [];
|
||
|
while (func[i] !== 'E') {
|
||
|
if (func[i] === 'S') { // substitution
|
||
|
i++;
|
||
|
var next = func.indexOf('_', i);
|
||
|
var num = func.substring(i, next) || 0;
|
||
|
parts.push(subs[num] || '?');
|
||
|
i = next+1;
|
||
|
continue;
|
||
|
}
|
||
|
if (func[i] === 'C') { // constructor
|
||
|
parts.push(parts[parts.length-1]);
|
||
|
i += 2;
|
||
|
continue;
|
||
|
}
|
||
|
var size = parseInt(func.substr(i));
|
||
|
var pre = size.toString().length;
|
||
|
if (!size || !pre) { i--; break; } // counter i++ below us
|
||
|
var curr = func.substr(i + pre, size);
|
||
|
parts.push(curr);
|
||
|
subs.push(curr);
|
||
|
i += pre + size;
|
||
|
}
|
||
|
i++; // skip E
|
||
|
return parts;
|
||
|
}
|
||
|
var first = true;
|
||
|
function parse(rawList, limit, allowVoid) { // main parser
|
||
|
limit = limit || Infinity;
|
||
|
var ret = '', list = [];
|
||
|
function flushList() {
|
||
|
return '(' + list.join(', ') + ')';
|
||
|
}
|
||
|
var name;
|
||
|
if (func[i] === 'N') {
|
||
|
// namespaced N-E
|
||
|
name = parseNested().join('::');
|
||
|
limit--;
|
||
|
if (limit === 0) return rawList ? [name] : name;
|
||
|
} else {
|
||
|
// not namespaced
|
||
|
if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'
|
||
|
var size = parseInt(func.substr(i));
|
||
|
if (size) {
|
||
|
var pre = size.toString().length;
|
||
|
name = func.substr(i + pre, size);
|
||
|
i += pre + size;
|
||
|
}
|
||
|
}
|
||
|
first = false;
|
||
|
if (func[i] === 'I') {
|
||
|
i++;
|
||
|
var iList = parse(true);
|
||
|
var iRet = parse(true, 1, true);
|
||
|
ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';
|
||
|
} else {
|
||
|
ret = name;
|
||
|
}
|
||
|
paramLoop: while (i < func.length && limit-- > 0) {
|
||
|
//dump('paramLoop');
|
||
|
var c = func[i++];
|
||
|
if (c in basicTypes) {
|
||
|
list.push(basicTypes[c]);
|
||
|
} else {
|
||
|
switch (c) {
|
||
|
case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer
|
||
|
case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference
|
||
|
case 'L': { // literal
|
||
|
i++; // skip basic type
|
||
|
var end = func.indexOf('E', i);
|
||
|
var size = end - i;
|
||
|
list.push(func.substr(i, size));
|
||
|
i += size + 2; // size + 'EE'
|
||
|
break;
|
||
|
}
|
||
|
case 'A': { // array
|
||
|
var size = parseInt(func.substr(i));
|
||
|
i += size.toString().length;
|
||
|
if (func[i] !== '_') throw '?';
|
||
|
i++; // skip _
|
||
|
list.push(parse(true, 1, true)[0] + ' [' + size + ']');
|
||
|
break;
|
||
|
}
|
||
|
case 'E': break paramLoop;
|
||
|
default: ret += '?' + c; break paramLoop;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)
|
||
|
return rawList ? list : ret + flushList();
|
||
|
}
|
||
|
return parse();
|
||
|
} catch(e) {
|
||
|
return func;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function demangleAll(text) {
|
||
|
return text.replace(/__Z[\w\d_]+/g, function(x) { var y = demangle(x); return x === y ? x : (x + ' [' + y + ']') });
|
||
|
}
|
||
|
|
||
|
function stackTrace() {
|
||
|
var stack = new Error().stack;
|
||
|
return stack ? demangleAll(stack) : '(no stack trace available)'; // Stack trace is not available at least on IE10 and Safari 6.
|
||
|
}
|
||
|
|
||
|
// Memory management
|
||
|
|
||
|
var PAGE_SIZE = 4096;
|
||
|
function alignMemoryPage(x) {
|
||
|
return (x+4095)&-4096;
|
||
|
}
|
||
|
|
||
|
var HEAP;
|
||
|
var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
|
||
|
|
||
|
var STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area
|
||
|
var STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area
|
||
|
var DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk
|
||
|
|
||
|
function enlargeMemory() {
|
||
|
abort('Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', or (2) set Module.TOTAL_MEMORY before the program runs.');
|
||
|
}
|
||
|
|
||
|
var TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;
|
||
|
var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;
|
||
|
var FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;
|
||
|
|
||
|
var totalMemory = 4096;
|
||
|
while (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) {
|
||
|
if (totalMemory < 16*1024*1024) {
|
||
|
totalMemory *= 2;
|
||
|
} else {
|
||
|
totalMemory += 16*1024*1024
|
||
|
}
|
||
|
}
|
||
|
if (totalMemory !== TOTAL_MEMORY) {
|
||
|
Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be more reasonable');
|
||
|
TOTAL_MEMORY = totalMemory;
|
||
|
}
|
||
|
|
||
|
// Initialize the runtime's memory
|
||
|
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
|
||
|
assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
|
||
|
'Cannot fallback to non-typed array case: Code is too specialized');
|
||
|
|
||
|
var buffer = new ArrayBuffer(TOTAL_MEMORY);
|
||
|
HEAP8 = new Int8Array(buffer);
|
||
|
HEAP16 = new Int16Array(buffer);
|
||
|
HEAP32 = new Int32Array(buffer);
|
||
|
HEAPU8 = new Uint8Array(buffer);
|
||
|
HEAPU16 = new Uint16Array(buffer);
|
||
|
HEAPU32 = new Uint32Array(buffer);
|
||
|
HEAPF32 = new Float32Array(buffer);
|
||
|
HEAPF64 = new Float64Array(buffer);
|
||
|
|
||
|
// Endianness check (note: assumes compiler arch was little-endian)
|
||
|
HEAP32[0] = 255;
|
||
|
assert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');
|
||
|
|
||
|
Module['HEAP'] = HEAP;
|
||
|
Module['HEAP8'] = HEAP8;
|
||
|
Module['HEAP16'] = HEAP16;
|
||
|
Module['HEAP32'] = HEAP32;
|
||
|
Module['HEAPU8'] = HEAPU8;
|
||
|
Module['HEAPU16'] = HEAPU16;
|
||
|
Module['HEAPU32'] = HEAPU32;
|
||
|
Module['HEAPF32'] = HEAPF32;
|
||
|
Module['HEAPF64'] = HEAPF64;
|
||
|
|
||
|
function callRuntimeCallbacks(callbacks) {
|
||
|
while(callbacks.length > 0) {
|
||
|
var callback = callbacks.shift();
|
||
|
if (typeof callback == 'function') {
|
||
|
callback();
|
||
|
continue;
|
||
|
}
|
||
|
var func = callback.func;
|
||
|
if (typeof func === 'number') {
|
||
|
if (callback.arg === undefined) {
|
||
|
Runtime.dynCall('v', func);
|
||
|
} else {
|
||
|
Runtime.dynCall('vi', func, [callback.arg]);
|
||
|
}
|
||
|
} else {
|
||
|
func(callback.arg === undefined ? null : callback.arg);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var __ATPRERUN__ = []; // functions called before the runtime is initialized
|
||
|
var __ATINIT__ = []; // functions called during startup
|
||
|
var __ATMAIN__ = []; // functions called when main() is to be run
|
||
|
var __ATEXIT__ = []; // functions called during shutdown
|
||
|
var __ATPOSTRUN__ = []; // functions called after the runtime has exited
|
||
|
|
||
|
var runtimeInitialized = false;
|
||
|
|
||
|
function preRun() {
|
||
|
// compatibility - merge in anything from Module['preRun'] at this time
|
||
|
if (Module['preRun']) {
|
||
|
if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
|
||
|
while (Module['preRun'].length) {
|
||
|
addOnPreRun(Module['preRun'].shift());
|
||
|
}
|
||
|
}
|
||
|
callRuntimeCallbacks(__ATPRERUN__);
|
||
|
}
|
||
|
|
||
|
function ensureInitRuntime() {
|
||
|
if (runtimeInitialized) return;
|
||
|
runtimeInitialized = true;
|
||
|
callRuntimeCallbacks(__ATINIT__);
|
||
|
}
|
||
|
|
||
|
function preMain() {
|
||
|
callRuntimeCallbacks(__ATMAIN__);
|
||
|
}
|
||
|
|
||
|
function exitRuntime() {
|
||
|
callRuntimeCallbacks(__ATEXIT__);
|
||
|
}
|
||
|
|
||
|
function postRun() {
|
||
|
// compatibility - merge in anything from Module['postRun'] at this time
|
||
|
if (Module['postRun']) {
|
||
|
if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
|
||
|
while (Module['postRun'].length) {
|
||
|
addOnPostRun(Module['postRun'].shift());
|
||
|
}
|
||
|
}
|
||
|
callRuntimeCallbacks(__ATPOSTRUN__);
|
||
|
}
|
||
|
|
||
|
function addOnPreRun(cb) {
|
||
|
__ATPRERUN__.unshift(cb);
|
||
|
}
|
||
|
Module['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;
|
||
|
|
||
|
function addOnInit(cb) {
|
||
|
__ATINIT__.unshift(cb);
|
||
|
}
|
||
|
Module['addOnInit'] = Module.addOnInit = addOnInit;
|
||
|
|
||
|
function addOnPreMain(cb) {
|
||
|
__ATMAIN__.unshift(cb);
|
||
|
}
|
||
|
Module['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;
|
||
|
|
||
|
function addOnExit(cb) {
|
||
|
__ATEXIT__.unshift(cb);
|
||
|
}
|
||
|
Module['addOnExit'] = Module.addOnExit = addOnExit;
|
||
|
|
||
|
function addOnPostRun(cb) {
|
||
|
__ATPOSTRUN__.unshift(cb);
|
||
|
}
|
||
|
Module['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;
|
||
|
|
||
|
// Tools
|
||
|
|
||
|
// This processes a JS string into a C-line array of numbers, 0-terminated.
|
||
|
// For LLVM-originating strings, see parser.js:parseLLVMString function
|
||
|
function intArrayFromString(stringy, dontAddNull, length /* optional */) {
|
||
|
var ret = (new Runtime.UTF8Processor()).processJSString(stringy);
|
||
|
if (length) {
|
||
|
ret.length = length;
|
||
|
}
|
||
|
if (!dontAddNull) {
|
||
|
ret.push(0);
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
Module['intArrayFromString'] = intArrayFromString;
|
||
|
|
||
|
function intArrayToString(array) {
|
||
|
var ret = [];
|
||
|
for (var i = 0; i < array.length; i++) {
|
||
|
var chr = array[i];
|
||
|
if (chr > 0xFF) {
|
||
|
chr &= 0xFF;
|
||
|
}
|
||
|
ret.push(String.fromCharCode(chr));
|
||
|
}
|
||
|
return ret.join('');
|
||
|
}
|
||
|
Module['intArrayToString'] = intArrayToString;
|
||
|
|
||
|
// Write a Javascript array to somewhere in the heap
|
||
|
function writeStringToMemory(string, buffer, dontAddNull) {
|
||
|
var array = intArrayFromString(string, dontAddNull);
|
||
|
var i = 0;
|
||
|
while (i < array.length) {
|
||
|
var chr = array[i];
|
||
|
HEAP8[(((buffer)+(i))|0)]=chr;
|
||
|
i = i + 1;
|
||
|
}
|
||
|
}
|
||
|
Module['writeStringToMemory'] = writeStringToMemory;
|
||
|
|
||
|
function writeArrayToMemory(array, buffer) {
|
||
|
for (var i = 0; i < array.length; i++) {
|
||
|
HEAP8[(((buffer)+(i))|0)]=array[i];
|
||
|
}
|
||
|
}
|
||
|
Module['writeArrayToMemory'] = writeArrayToMemory;
|
||
|
|
||
|
function writeAsciiToMemory(str, buffer, dontAddNull) {
|
||
|
for (var i = 0; i < str.length; i++) {
|
||
|
HEAP8[(((buffer)+(i))|0)]=str.charCodeAt(i);
|
||
|
}
|
||
|
if (!dontAddNull) HEAP8[(((buffer)+(str.length))|0)]=0;
|
||
|
}
|
||
|
Module['writeAsciiToMemory'] = writeAsciiToMemory;
|
||
|
|
||
|
function unSign(value, bits, ignore, sig) {
|
||
|
if (value >= 0) {
|
||
|
return value;
|
||
|
}
|
||
|
return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts
|
||
|
: Math.pow(2, bits) + value;
|
||
|
}
|
||
|
function reSign(value, bits, ignore, sig) {
|
||
|
if (value <= 0) {
|
||
|
return value;
|
||
|
}
|
||
|
var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32
|
||
|
: Math.pow(2, bits-1);
|
||
|
if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that
|
||
|
// but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors
|
||
|
// TODO: In i64 mode 1, resign the two parts separately and safely
|
||
|
value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts
|
||
|
}
|
||
|
return value;
|
||
|
}
|
||
|
|
||
|
// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )
|
||
|
if (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {
|
||
|
var ah = a >>> 16;
|
||
|
var al = a & 0xffff;
|
||
|
var bh = b >>> 16;
|
||
|
var bl = b & 0xffff;
|
||
|
return (al*bl + ((ah*bl + al*bh) << 16))|0;
|
||
|
};
|
||
|
Math.imul = Math['imul'];
|
||
|
|
||
|
|
||
|
var Math_abs = Math.abs;
|
||
|
var Math_cos = Math.cos;
|
||
|
var Math_sin = Math.sin;
|
||
|
var Math_tan = Math.tan;
|
||
|
var Math_acos = Math.acos;
|
||
|
var Math_asin = Math.asin;
|
||
|
var Math_atan = Math.atan;
|
||
|
var Math_atan2 = Math.atan2;
|
||
|
var Math_exp = Math.exp;
|
||
|
var Math_log = Math.log;
|
||
|
var Math_sqrt = Math.sqrt;
|
||
|
var Math_ceil = Math.ceil;
|
||
|
var Math_floor = Math.floor;
|
||
|
var Math_pow = Math.pow;
|
||
|
var Math_imul = Math.imul;
|
||
|
var Math_fround = Math.fround;
|
||
|
var Math_min = Math.min;
|
||
|
|
||
|
// A counter of dependencies for calling run(). If we need to
|
||
|
// do asynchronous work before running, increment this and
|
||
|
// decrement it. Incrementing must happen in a place like
|
||
|
// PRE_RUN_ADDITIONS (used by emcc to add file preloading).
|
||
|
// Note that you can add dependencies in preRun, even though
|
||
|
// it happens right before run - run will be postponed until
|
||
|
// the dependencies are met.
|
||
|
var runDependencies = 0;
|
||
|
var runDependencyWatcher = null;
|
||
|
var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
|
||
|
|
||
|
function addRunDependency(id) {
|
||
|
runDependencies++;
|
||
|
if (Module['monitorRunDependencies']) {
|
||
|
Module['monitorRunDependencies'](runDependencies);
|
||
|
}
|
||
|
}
|
||
|
Module['addRunDependency'] = addRunDependency;
|
||
|
function removeRunDependency(id) {
|
||
|
runDependencies--;
|
||
|
if (Module['monitorRunDependencies']) {
|
||
|
Module['monitorRunDependencies'](runDependencies);
|
||
|
}
|
||
|
if (runDependencies == 0) {
|
||
|
if (runDependencyWatcher !== null) {
|
||
|
clearInterval(runDependencyWatcher);
|
||
|
runDependencyWatcher = null;
|
||
|
}
|
||
|
if (dependenciesFulfilled) {
|
||
|
var callback = dependenciesFulfilled;
|
||
|
dependenciesFulfilled = null;
|
||
|
callback(); // can add another dependenciesFulfilled
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
Module['removeRunDependency'] = removeRunDependency;
|
||
|
|
||
|
Module["preloadedImages"] = {}; // maps url to image data
|
||
|
Module["preloadedAudios"] = {}; // maps url to audio data
|
||
|
|
||
|
|
||
|
var memoryInitializer = null;
|
||
|
|
||
|
// === Body ===
|
||
|
var __ZTVN10__cxxabiv117__class_type_infoE = 291152;
|
||
|
var __ZTVN10__cxxabiv120__si_class_type_infoE = 291192;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
STATIC_BASE = 8;
|
||
|
|
||
|
STATICTOP = STATIC_BASE + Runtime.alignMemory(291923);
|
||
|
/* global initializers */ __ATINIT__.push();
|
||
|
|
||
|
|
||
|
/* memory initializer */ allocate([8,5,0,0,1,0,0,0,120,4,0,0,0,0,0,0,16,5,0,0,40,5,0,0,1,0,0,0,128,4,0,0,0,0,0,0,48,5,0,0,72,5,0,0,0,0,0,0,168,4,0,0,0,0,0,0,80,5,0,0,104,5,0,0,0,0,0,0,160,4,0,0,0,0,0,0,112,5,0,0,136,5,0,0,2,0,0,0,112,2,0,0,0,0,0,0,144,5,0,0,184,5,0,0,2,0,0,0,120,2,0,0,0,0,0,0,192,5,0,0,232,5,0,0,2,0,0,0,128,2,0,0,0,0,0,0,240,5,0,0,24,6,0,0,1,0,0,0,184,4,0,0,0,0,0,0,40,6,0,0,104,6,0,0,1,0,0,0,192,4,0,0,0,0,0,0,120,6,0,0,184,6,0,0,1,0,0,0,200,4,0,0,0,0,0,0,200,6,0,0,0,7,0,0,1,0,0,0,248,4,0,0,0,0,0,0,8,7,0,0,56,7,0,0,1,0,0,0,0,5,0,0,0,0,0,0,64,7,0,0,112,7,0,0,1,0,0,0,152,4,0,0,0,0,0,0,120,7,0,0,168,7,0,0,1,0,0,0,144,4,0,0,0,0,0,0,176,7,0,0,224,7,0,0,1,0,0,0,136,4,0,0,0,0,0,0,232,7,0,0,24,8,0,0,0,0,0,0,176,4,0,0,0,0,0,0,40,8,0,0,80,8,0,0,0,0,0,0,96,2,0,0,0,0,0,0,88,8,0,0,120,8,0,0,0,0,0,0,104,2,0,0,0,0,0,0,128,8,0,0,160,8,0,0,3,0,0,0,104,3,0,0,16,0,0,0,176,8,0,0,224,8,0,0,3,0,0,0,160,3,0,0,16,0,0,0,232,8,0,0,16,9,0,0,3,0,0,0,216,3,0,0,16,0,0,0,32,9,0,0,72,9,0,0,3,0,0,0,24,4,0,0,33,0,0,0,80,9,0,0,120,9,0,0,3,0,0,0,64,4,0,0,33,0,0,0,128,9,0,0,168,9,0,0,0,0,0,0,16,4,0,0,0,0,0,0,176,9,0,0,216,9,0,0,0,0,0,0,136,2,0,0,0,0,0,0,224,9,0,0,8,10,0,0,0,0,0,0,144,2,0,0,0,0,0,0,16,10,0,0,40,10,0,0,0,0,0,0,144,2,0,0,0,0,0,0,16,10,0,0,48,10,0,0,0,0,0,0,144,2,0,0,0,0,0,0,16,10,0,0,56,10,0,0,0,0,0,0,144,2,0,0,0,0,0,0,16,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,98,64,0,0,0,0,0,192,98,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,100,102,116,111,112,112,109,32,118,101,114,115,105,111,110,32,37,115,10,0,0,0,0,48,46,49,54,46,51,0,0,37,115,10,0,0,0,0,0,67,111,112,121,114,105,103,104,116,32,50,48,48,53,45,50,48,49,48,32,84,104,101,32,80,111,112,112,108,101,114,32,68,101,118,101,108,111,112,101,114,115,32,45,32,104,116,116,112,58,47,47,112,111,112,112,108,101,114,46,102,114,101,101,100,101,115,107,116,111,112,46,111,114,103,0,0,0,0,0,67,111,112,121,114,105,103,104,116,32,49,57,57,54,45,50,48,48,52,32,71,108,121,112,104,32,38,32,67,111,103,44,32,76,76,67,0,0,0,0,112,100,102,116,111,112,112,109,0,0,0,0,0,0,0,0,91,80,68,70,45,102,105,108,101,32,91,80,80,77,45,102,105,108,101,45,112,114,101,102,105,120,93,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,97,100,32,39,45,102,114,101,101,116,121,112,101,39,32,118,97,108,117,101,32,111,110,32,99,111,109,109,97,110,100,32,108,105,110,101,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,97,100,32,39,45,97,97,39,32,118,97,108,117,101,32,111,110,32,99,111,109,109,97,110,100,32,108,105,110,101,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,97,100,32,39,45,97,97,86,101,99,116,111,114,39,32,118,97,108,117,101,32,111,110,32,99,111,109,109,97,110,100,32,108,105,110,101,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,100,58,47,47,48,0,0,45,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,46,42,115,45,37,48,42,100,46,37,115,0,0,0,0,112,98,109,0,0,0,0,0,112,103,109,0,0,0,0,0,112,112,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,102,0,0,0,0,0,0,102,105,114,115,116,32,112,97,103,101,32,116,111,32,112,114,105,110,116,0,0,0,0,0,45,108,0,0,0,0,0,0,108,97,115,116,32,112,97,103,101,32,116,111,32,112,114,105,110,116,0,0,0,0,0,0,45,111,0,0,0,0,0,0,112,114,105,110,116,32,111,110,108,121,32,111,100,100,32,112,97,103,101,115,0,0,0,0,45,101,0,0,0,0,0,0,112,114,105,110,116,32,111,110,108,121,32,101,118,101,110,32,112,97,103,101,115,0,0,0,45,114,0,0,0,0,0,0,114,101,115,111,108,117,116,105,111,110,44,32,105,110,32,68,80,73,32,40,100,101,102,97,117,108,116,32,105,115,32,49,53,48,41,0,0,0,0,0,45,114,120,0,0,0,0,0,88,32,114,101,115,111,108,117,116,105,111,110,44,32,105,110,32,68,80,73,32,40,100,101,102,97,117,108,116,32,105,115,32,49,53,48,41,0,0,0,45,114,121,0,0,0,0,0,89,32,114,101,115,111,108,117,116,105,111,110,44,32,105,110,32,68,80,73,32,40,100,101,102,97,117,108,116,32,105,115
|
||
|
/* memory initializer */ allocate([57,0,0,0,216,114,0,0,137,32,0,0,224,114,0,0,57,247,0,0,240,114,0,0,121,32,0,0,0,115,0,0,160,0,0,0,16,115,0,0,9,34,0,0,40,115,0,0,96,34,0,0,56,115,0,0,132,34,0,0,72,115,0,0,127,32,0,0,88,115,0,0,241,0,0,0,104,115,0,0,189,3,0,0,112,115,0,0,35,0,0,0,120,115,0,0,111,0,0,0,136,115,0,0,243,0,0,0,144,115,0,0,79,1,0,0,152,115,0,0,244,0,0,0,160,115,0,0,246,0,0,0,176,115,0,0,83,1,0,0,192,115,0,0,219,2,0,0,200,115,0,0,242,0,0,0,208,115,0,0,161,1,0,0,216,115,0,0,81,1,0,0,224,115,0,0,77,1,0,0,240,115,0,0,201,3,0,0,248,115,0,0,214,3,0,0,0,116,0,0,206,3,0,0,8,116,0,0,191,3,0,0,24,116,0,0,204,3,0,0,32,116,0,0,49,0,0,0,48,116,0,0,36,32,0,0,56,116,0,0,91,33,0,0,72,116,0,0,220,246,0,0,88,116,0,0,189,0,0,0,104,116,0,0,129,32,0,0,112,116,0,0,49,247,0,0,128,116,0,0,188,0,0,0,144,116,0,0,185,0,0,0,160,116,0,0,83,33,0,0,176,116,0,0,230,37,0,0,192,116,0,0,170,0,0,0,208,116,0,0,186,0,0,0,224,116,0,0,31,34,0,0,240,116,0,0,248,0,0,0,0,117,0,0,255,1,0,0,8,117,0,0,240,246,0,0,24,117,0,0,245,0,0,0,40,117,0,0,112,0,0,0,48,117,0,0,182,0,0,0,56,117,0,0,40,0,0,0,72,117,0,0,237,248,0,0,88,117,0,0,236,248,0,0,104,117,0,0,141,32,0,0,120,117,0,0,125,32,0,0,144,117,0,0,235,248,0,0,168,117,0,0,41,0,0,0,184,117,0,0,248,248,0,0,200,117,0,0,247,248,0,0,216,117,0,0,142,32,0,0,232,117,0,0,126,32,0,0,0,118,0,0,246,248,0,0,24,118,0,0,2,34,0,0,40,118,0,0,37,0,0,0,56,118,0,0,46,0,0,0,64,118,0,0,183,0,0,0,72,118,0,0,231,246,0,0,88,118,0,0,232,246,0,0,104,118,0,0,165,34,0,0,120,118,0,0,48,32,0,0,136,118,0,0,167,32,0,0,152,118,0,0,198,3,0,0,160,118,0,0,213,3,0,0,168,118,0,0,192,3,0,0,176,118,0,0,43,0,0,0,184,118,0,0,177,0,0,0,192,118,0,0,30,33,0,0,208,118,0,0,15,34,0,0,224,118,0,0,130,34,0,0,232,118,0,0,131,34,0,0,248,118,0,0,29,34,0,0,8,119,0,0,200,3,0,0,24,119,0,0,113,0,0,0,32,119,0,0,63,0,0,0,40,119,0,0,191,0,0,0,56,119,0,0,191,247,0,0,72,119,0,0,63,247,0,0,96,119,0,0,34,0,0,0,112,119,0,0,30,32,0,0,128,119,0,0,28,32,0,0,144,119,0,0,29,32,0,0,160,119,0,0,24,32,0,0,176,119,0,0,27,32,0,0,192,119,0,0,25,32,0,0,208,119,0,0,26,32,0,0,224,119,0,0,39,0,0,0,240,119,0,0,114,0,0,0,192,68,0,0,85,1,0,0,0,120,0,0,26,34,0,0,8,120,0,0,229,248,0,0,16,120,0,0,89,1,0,0,32,120,0,0,87,1,0,0,40,120,0,0,134,34,0,0,56,120,0,0,135,34,0,0,72,120,0,0,174,0,0,0,88,120,0,0,174,0,0,0,104,120,0,0,174,0,0,0,120,120,0,0,16,35,0,0,136,120,0,0,193,3,0,0,152,120,0,0,218,2,0,0,160,120,0,0,241,246,0,0,168,120,0,0,144,37,0,0,184,120,0,0,221,246,0,0,192,120,0,0,115,0,0,0,200,120,0,0,91,1,0,0,208,120,0,0,97,1,0,0,216,120,0,0,95,1,0,0,224,120,0,0,93,1,0,0,240,120,0,0,25,2,0,0,0,121,0,0,51,32,0,0,16,121,0,0,167,0,0,0,24,121,0,0,59,0,0,0,32,121,0,0,55,0,0,0,48,121,0,0,94,33,0,0,56,121,0,0,135,32,0,0,72,121,0,0,55,247,0,0,88,121,0,0,119,32,0,0,104,121,0,0,146,37,0,0,120,121,0,0,195,3,0,0,128,121,0,0,194,3,0,0,136,121,0,0,60,34,0,0,144,121,0,0,54,0,0,0,152,121,0,0,134,32,0,0,160,121,0,0,54,247,0,0,176,121,0,0,118,32,0,0,192,121,0,0,47,0,0,0,208,121,0,0,58,38,0,0,216,121,0,0,32,0,0,0,232,121,0,0,96,38,0,0,240,121,0,0,242,246,0,0,248,121,0,0,163,0,0,0,8,122,0,0,11,34,0,0,24,122,0,0,17,34,0,0,40,122,0,0,60,38,0,0,56,122,0,0,116,0,0,0,64,122,0,0,196,3,0,0,72,122,0,0,103,1,0,0,80,122,0,0,101,1,0,0,88,122,0,0,99,1,0,0,96,122,0,0,52,34,0,0,112,122,0,0,184,3,0,0,128,122,0,0,209,3,0,0,136,122,0,0,254,0,0,0,144,122,0,0,51,0,0,0,152,122,0,0,92,33,0,0,160,122,0,0,131,32,0,0,176,122,0,0,51,247,0,0,192,122,0,0,190,0,0,0,208,122,0,0,222,246,0,0,224,122,0,0,179,0,0,0,248,122,0,0,220,2,0,0,8,123,0,0,3,3,0,0,16,123,0,0,132,3,0,0,32,123,0,0,34,33,0,0,40,123,0,0,34,33,0,0,56,123,0,0,34,33,0,0,72,123,0,0,188,37,0,0,88,123,0,0,196,37,0,0,96,123,0,0,186,37,0,0,104,123,0,0,178,37,0,0,112,123,0,0,243,246,0,0,120,123,0,0,50,0,0,0,136,123,0,0,37,32,0,0,144,123,0,0,130,32,0,0,160,123,0,0,50,247,0,0,176,123,0,0,178,0,0,0,192,123,0,0,84,33,0,0,208,123,0,0,117,0,0,0,224,123,0,0,250,0,0,0,232,123,0,0,109,1,0,0,240,123,0,0,251,0,0,0,248,123,0,0,252,0,0,0,8,124,0,0,249,0,0,0,24,124,0,0,176,1,0,0,32,124,0,0,113,1,0,0,40,124,0,0,107,1,0,0,56,124,0,0,95,0,0,0,64,124,0,0,23,32,0,0,80,124,0,0,42,34,0,0,96,124,0,0,0,34
|
||
|
/* memory initializer */ allocate([0,0,0,0,0,0,0,0,82,104,111,0,0,0,0,0,82,105,110,103,115,109,97,108,108,0,0,0,0,0,0,0,82,115,109,97,108,108,0,0,83,0,0,0,0,0,0,0,83,70,48,49,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,50,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,51,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,52,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,53,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,54,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,55,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,56,48,48,48,48,0,0,0,0,0,0,0,0,83,70,48,57,48,48,48,48,0,0,0,0,0,0,0,0,83,70,49,48,48,48,48,48,0,0,0,0,0,0,0,0,83,70,49,49,48,48,48,48,0,0,0,0,0,0,0,0,83,70,49,57,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,48,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,49,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,50,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,51,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,52,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,53,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,54,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,55,48,48,48,48,0,0,0,0,0,0,0,0,83,70,50,56,48,48,48,48,0,0,0,0,0,0,0,0,83,70,51,54,48,48,48,48,0,0,0,0,0,0,0,0,83,70,51,55,48,48,48,48,0,0,0,0,0,0,0,0,83,70,51,56,48,48,48,48,0,0,0,0,0,0,0,0,83,70,51,57,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,48,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,49,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,50,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,51,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,52,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,53,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,54,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,55,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,56,48,48,48,48,0,0,0,0,0,0,0,0,83,70,52,57,48,48,48,48,0,0,0,0,0,0,0,0,83,70,53,48,48,48,48,48,0,0,0,0,0,0,0,0,83,70,53,49,48,48,48,48,0,0,0,0,0,0,0,0,83,70,53,50,48,48,48,48,0,0,0,0,0,0,0,0,83,70,53,51,48,48,48,48,0,0,0,0,0,0,0,0,83,70,53,52,48,48,48,48,0,0,0,0,0,0,0,0,83,97,99,117,116,101,0,0,83,99,97,114,111,110,0,0,83,99,97,114,111,110,115,109,97,108,108,0,0,0,0,0,83,99,101,100,105,108,108,97,0,0,0,0,0,0,0,0,83,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,83,99,111,109,109,97,97,99,99,101,110,116,0,0,0,0,83,105,103,109,97,0,0,0,83,115,109,97,108,108,0,0,84,0,0,0,0,0,0,0,84,97,117,0,0,0,0,0,84,98,97,114,0,0,0,0,84,99,97,114,111,110,0,0,84,99,111,109,109,97,97,99,99,101,110,116,0,0,0,0,84,104,101,116,97,0,0,0,84,104,111,114,110,0,0,0,84,104,111,114,110,115,109,97,108,108,0,0,0,0,0,0,84,105,108,100,101,115,109,97,108,108,0,0,0,0,0,0,84,115,109,97,108,108,0,0,85,0,0,0,0,0,0,0,85,97,99,117,116,101,0,0,85,97,99,117,116,101,115,109,97,108,108,0,0,0,0,0,85,98,114,101,118,101,0,0,85,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,85,99,105,114,99,117,109,102,108,101,120,115,109,97,108,108,0,0,0,0,0,0,0,0,85,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,85,100,105,101,114,101,115,105,115,115,109,97,108,108,0,0,85,103,114,97,118,101,0,0,85,103,114,97,118,101,115,109,97,108,108,0,0,0,0,0,85,104,111,114,110,0,0,0,85,104,117,110,103,97,114,117,109,108,97,117,116,0,0,0,85,109,97,99,114,111,110,0,85,111,103,111,110,101,107,0,85,112,115,105,108,111,110,0,85,112,115,105,108,111,110,49,0,0,0,0,0,0,0,0,85,112,115,105,108,111,110,100,105,101,114,101,115,105,115,0,85,112,115,105,108,111,110,116,111,110,111,115,0,0,0,0,85,114,105,110,103,0,0,0,85,115,109,97,108,108,0,0,85,116,105,108,100,101,0,0,86,0,0,0,0,0,0,0,86,115,109,97,108,108,0,0,87,0,0,0,0,0,0,0,87,97,99,117,116,101,0,0,87,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,87,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,87,103,114,97,118,101,0,0,87,115,109,97,108,108,0,0,88,0,0,0,0,0,0,0,88,105,0,0,0,0,0,0,88,115,109,97,108,108,0,0,89,0,0,0,0,0,0,0,89,97,99,117,116,101,0,0,89,97,99,117,116,101,115,109,97,108,108,0,0,0,0,0,89,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,89,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,89,100,105,101,114,101,115,105,115,115,109,97,108,108,0,0,89,103,114,97,118,101,0,0,89,115,109,97,108,108,0,0,90,0,0,0,0,0,0,0,90,97,99,117,116,101,0,0,90,99,97,114,111,110,0,0,90,99,97,114,111,110,115,109,97,108,108,0,0,0,0,0,90,100,111,116,97,99,99,101,110,116,0,0,0,0,0,0,90,101,116,97,0,0,0,0,90,115,109,97,108,108,0,0,34,0,0,0,0,0,0,0,92,0,0,0,0,0,0,0,93,0,0,0,0,0,0,0,94,0,0,0,0,0,0,0,95,0,0,0,0,0
|
||
|
/* memory initializer */ allocate([114,97,100,105,99,97,108,0,114,97,100,105,99,97,108,101,120,0,0,0,0,0,0,0,114,99,97,114,111,110,0,0,114,99,111,109,109,97,97,99,99,101,110,116,0,0,0,0,114,101,102,108,101,120,115,117,98,115,101,116,0,0,0,0,114,101,102,108,101,120,115,117,112,101,114,115,101,116,0,0,114,101,103,105,115,116,101,114,101,100,0,0,0,0,0,0,114,101,103,105,115,116,101,114,115,97,110,115,0,0,0,0,114,101,103,105,115,116,101,114,115,101,114,105,102,0,0,0,114,101,118,108,111,103,105,99,97,108,110,111,116,0,0,0,114,104,111,0,0,0,0,0,114,105,110,103,0,0,0,0,114,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,114,116,98,108,111,99,107,0,114,117,112,105,97,104,0,0,115,0,0,0,0,0,0,0,115,97,99,117,116,101,0,0,115,99,97,114,111,110,0,0,115,99,101,100,105,108,108,97,0,0,0,0,0,0,0,0,115,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,115,99,111,109,109,97,97,99,99,101,110,116,0,0,0,0,115,101,99,111,110,100,0,0,115,101,99,116,105,111,110,0,115,101,109,105,99,111,108,111,110,0,0,0,0,0,0,0,115,101,118,101,110,0,0,0,115,101,118,101,110,101,105,103,104,116,104,115,0,0,0,0,115,101,118,101,110,105,110,102,101,114,105,111,114,0,0,0,115,101,118,101,110,111,108,100,115,116,121,108,101,0,0,0,115,101,118,101,110,115,117,112,101,114,105,111,114,0,0,0,115,104,97,100,101,0,0,0,115,105,103,109,97,0,0,0,115,105,103,109,97,49,0,0,115,105,109,105,108,97,114,0,115,105,120,0,0,0,0,0,115,105,120,105,110,102,101,114,105,111,114,0,0,0,0,0,115,105,120,111,108,100,115,116,121,108,101,0,0,0,0,0,115,105,120,115,117,112,101,114,105,111,114,0,0,0,0,0,115,108,97,115,104,0,0,0,115,109,105,108,101,102,97,99,101,0,0,0,0,0,0,0,115,112,97,99,101,0,0,0,115,112,97,100,101,0,0,0,115,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,115,116,101,114,108,105,110,103,0,0,0,0,0,0,0,0,115,117,99,104,116,104,97,116,0,0,0,0,0,0,0,0,115,117,109,109,97,116,105,111,110,0,0,0,0,0,0,0,115,117,110,0,0,0,0,0,116,0,0,0,0,0,0,0,116,97,117,0,0,0,0,0,116,98,97,114,0,0,0,0,116,99,97,114,111,110,0,0,116,99,111,109,109,97,97,99,99,101,110,116,0,0,0,0,116,104,101,114,101,102,111,114,101,0,0,0,0,0,0,0,116,104,101,116,97,0,0,0,116,104,101,116,97,49,0,0,116,104,111,114,110,0,0,0,116,104,114,101,101,0,0,0,116,104,114,101,101,101,105,103,104,116,104,115,0,0,0,0,116,104,114,101,101,105,110,102,101,114,105,111,114,0,0,0,116,104,114,101,101,111,108,100,115,116,121,108,101,0,0,0,116,104,114,101,101,113,117,97,114,116,101,114,115,0,0,0,116,104,114,101,101,113,117,97,114,116,101,114,115,101,109,100,97,115,104,0,0,0,0,0,116,104,114,101,101,115,117,112,101,114,105,111,114,0,0,0,116,105,108,100,101,0,0,0,116,105,108,100,101,99,111,109,98,0,0,0,0,0,0,0,116,111,110,111,115,0,0,0,116,114,97,100,101,109,97,114,107,0,0,0,0,0,0,0,116,114,97,100,101,109,97,114,107,115,97,110,115,0,0,0,116,114,97,100,101,109,97,114,107,115,101,114,105,102,0,0,116,114,105,97,103,100,110,0,116,114,105,97,103,108,102,0,116,114,105,97,103,114,116,0,116,114,105,97,103,117,112,0,116,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,116,119,111,0,0,0,0,0,116,119,111,100,111,116,101,110,108,101,97,100,101,114,0,0,116,119,111,105,110,102,101,114,105,111,114,0,0,0,0,0,116,119,111,111,108,100,115,116,121,108,101,0,0,0,0,0,116,119,111,115,117,112,101,114,105,111,114,0,0,0,0,0,116,119,111,116,104,105,114,100,115,0,0,0,0,0,0,0,117,0,0,0,0,0,0,0,117,97,99,117,116,101,0,0,117,98,114,101,118,101,0,0,117,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,117,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,117,103,114,97,118,101,0,0,117,104,111,114,110,0,0,0,117,104,117,110,103,97,114,117,109,108,97,117,116,0,0,0,117,109,97,99,114,111,110,0,117,110,100,101,114,115,99,111,114,101,0,0,0,0,0,0,117,110,100,101,114,115,99,111,114,101,100,98,108,0,0,0,117,110,105,111,110,0,0,0,117,110,105,118,101,114,115,97,108,0,0,0,0,0,0,0,117,111,103,111,110,101,107,0,117,112,98,108,111,99,107,0,117,112,115,105,108,111,110,0,117,112,115,105,108,111,110,100,105,101,114,101,115,105,115,0,117,112,115,105,108,111,110,100,105,101,114,101,115,105,115,116,111,110,111,115,0,0,0,0,117,112,115,105,108,111,110,116,111,110,111,115,0,0,0,0,117,114,105,110,103,0,0,0,117,116,105,108,100,10
|
||
|
/* memory initializer */ allocate([6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,4,0,7,0,66,97,100,32,119,104,105,116,101,32,99,111,100,101,32,40,37,48,52,120,41,32,105,110,32,67,67,73,84,84,70,97,120,32,115,116,114,101,97,109,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,12,0,254,255,12,0,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,11,0,0,7,11,0,0,7,11,0,0,7,11,0,0,7,12,0,192,7,12,0,192,7,12,0,0,8,12,0,0,8,12,0,64,8,12,0,64,8,12,0,128,8,12,0,128,8,12,0,192,8,12,0,192,8,12,0,0,9,12,0,0,9,11,0,64,7,11,0,64,7,11,0,64,7,11,0,64,7,11,0,128,7,11,0,128,7,11,0,128,7,11,0,128,7,12,0,64,9,12,0,64,9,12,0,128,9,12,0,128,9,12,0,192,9,12,0,192,9,12,0,0,10,12,0,0,10,10,0,18,0,10,0,18,0,10,0,18,0,10,0,18,0,10,0,18,0,10,0,18,0,10,0,18,0,10,0,18,0,12,0,52,0,12,0,52,0,13,0,128,2,13,0,192,2,13,0,0,3,13,0,64,3,12,0,55,0,12,0,55,0,12,0,56,0,12,0,56,0,13,0,0,5,13,0,64,5,13,0,128,5,13,0,192,5,12,0,59,0,12,0,59,0,12,0,60,0,12,0,60,0,13,0,0,6,13,0,64,6,11,0,24,0,11,0,24,0,11,0,24,0,11,0,24,0,11,0,25,0,11,0,25,0,11,0,25,0,11,0,25,0,13,0,128,6,13,0,192,6,12,0,64,1,12,0,64,1,12,0,128,1,12,0,128,1,12,0,192,1,12,0,192,1,13,0,0,2,13,0,64,2,12,0,53,0,12,0,53,0,12,0,54,0,12,0,54,0,13,0,128,3,13,0,192,3,13,0,0,4,13,0,64,4,13,0,128,4,13,0,192,4,10,0,64,0,10,0,64,0,10,0,64,0,10,0,64,0,10,0,64,0,10,0,64,0,10,0,64,0,10,0,64,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,8,0,13,0,11,0,23,0,11,0,23,0,12,0,50,0,12,0,51,0,12,0,44,0,12,0,45,0,12,0,46,0,12,0,47,0,12,0,57,0,12,0,58,0,12,0,61,0,12,0,0,1,10,0,16,0,10,0,16,0,10,0,16,0,10,0,16,0,10,0,17,0,10,0,17,0,10,0,17,0,10,0,17,0,12,0,48,0,12,0,49,0,12,0,62,0,12,0,63,0,12,0,30,0,12,0,31,0,12,0,32,0,12,0,33,0,12,0,40,0,12,0,41,0,11,0,22,0,11,0,22,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,8,0,14,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,10,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,7,0,11,0,9,0,15,0,9,0,15,0,9,0,15,0,9,0,15,0,9,0,15,0,9,0,15,0,9,0,15,0,9,0,15,0,12,0,128,0,12,0,192,0,12,0,26,0,12,0,27,0,12,0,28,0,12,0,29,0,11,0,19,0,11,0,19,0,11,0,20,0,11,0,20,0,12,0,34,0,12,0,35,0,12,0,36,0,12,0,37,0,12,0,38,0,12,0,39,0,11,0,21,0,11,0,21,0,12,0,42,0,12,0,43,0,10,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12,0,7,0,12
|
||
|
/* memory initializer */ allocate([102,105,118,101,0,0,0,0,115,105,120,0,0,0,0,0,115,101,118,101,110,0,0,0,101,105,103,104,116,0,0,0,110,105,110,101,0,0,0,0,99,111,108,111,110,0,0,0,115,101,109,105,99,111,108,111,110,0,0,0,0,0,0,0,108,101,115,115,0,0,0,0,101,113,117,97,108,0,0,0,103,114,101,97,116,101,114,0,113,117,101,115,116,105,111,110,0,0,0,0,0,0,0,0,97,116,0,0,0,0,0,0,65,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,69,0,0,0,0,0,0,0,70,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,73,0,0,0,0,0,0,0,74,0,0,0,0,0,0,0,75,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,78,0,0,0,0,0,0,0,79,0,0,0,0,0,0,0,80,0,0,0,0,0,0,0,81,0,0,0,0,0,0,0,82,0,0,0,0,0,0,0,83,0,0,0,0,0,0,0,84,0,0,0,0,0,0,0,85,0,0,0,0,0,0,0,86,0,0,0,0,0,0,0,87,0,0,0,0,0,0,0,88,0,0,0,0,0,0,0,89,0,0,0,0,0,0,0,90,0,0,0,0,0,0,0,98,114,97,99,107,101,116,108,101,102,116,0,0,0,0,0,98,97,99,107,115,108,97,115,104,0,0,0,0,0,0,0,98,114,97,99,107,101,116,114,105,103,104,116,0,0,0,0,97,115,99,105,105,99,105,114,99,117,109,0,0,0,0,0,117,110,100,101,114,115,99,111,114,101,0,0,0,0,0,0,103,114,97,118,101,0,0,0,97,0,0,0,0,0,0,0,98,0,0,0,0,0,0,0,99,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,101,0,0,0,0,0,0,0,102,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,104,0,0,0,0,0,0,0,105,0,0,0,0,0,0,0,106,0,0,0,0,0,0,0,107,0,0,0,0,0,0,0,108,0,0,0,0,0,0,0,109,0,0,0,0,0,0,0,110,0,0,0,0,0,0,0,111,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,113,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,115,0,0,0,0,0,0,0,116,0,0,0,0,0,0,0,117,0,0,0,0,0,0,0,118,0,0,0,0,0,0,0,119,0,0,0,0,0,0,0,120,0,0,0,0,0,0,0,121,0,0,0,0,0,0,0,122,0,0,0,0,0,0,0,98,114,97,99,101,108,101,102,116,0,0,0,0,0,0,0,98,97,114,0,0,0,0,0,98,114,97,99,101,114,105,103,104,116,0,0,0,0,0,0,97,115,99,105,105,116,105,108,100,101,0,0,0,0,0,0,65,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,65,114,105,110,103,0,0,0,67,99,101,100,105,108,108,97,0,0,0,0,0,0,0,0,69,97,99,117,116,101,0,0,78,116,105,108,100,101,0,0,79,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,85,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,97,97,99,117,116,101,0,0,97,103,114,97,118,101,0,0,97,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,97,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,97,116,105,108,100,101,0,0,97,114,105,110,103,0,0,0,99,99,101,100,105,108,108,97,0,0,0,0,0,0,0,0,101,97,99,117,116,101,0,0,101,103,114,97,118,101,0,0,101,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,101,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,105,97,99,117,116,101,0,0,105,103,114,97,118,101,0,0,105,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,105,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,110,116,105,108,100,101,0,0,111,97,99,117,116,101,0,0,111,103,114,97,118,101,0,0,111,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,111,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,111,116,105,108,100,101,0,0,117,97,99,117,116,101,0,0,117,103,114,97,118,101,0,0,117,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,117,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,100,97,103,103,101,114,0,0,100,101,103,114,101,101,0,0,99,101,110,116,0,0,0,0,115,116,101,114,108,105,110,103,0,0,0,0,0,0,0,0,115,101,99,116,105,111,110,0,98,117,108,108,101,116,0,0,112,97,114,97,103,114,97,112,104,0,0,0,0,0,0,0,103,101,114,109,97,110,100,98,108,115,0,0,0,0,0,0,114,101,103,105,115,116,101,114,101,100,0,0,0,0,0,0,99,111,112,121,114,105,103,104,116,0,0,0,0,0,0,0,116,114,97,100,101,109,97,114,107,0,0,0,0,0,0,0,97,99,117,116,101,0,0,0,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,0,110,111,116,101,113,117,97,108,0,0,0,0,0,0,0,0,65,69,0,0,0,0,0,0,79,115,108,97,115,104,0,0,105,110,102,105,110,105,116,121,0,0,0,0,0,0,0,0,112,108,117,115,109,105,110,117,115,0,0,0,0,0,0,0,108,101,115,115,101,113,117,97,108,0,0,0,0,0,0,0,103,114,101,97,116,101,114,101,113,117,97,108,0,0,0,0,121,101,110,0,0,0,0,0,109,117,49,0,0,0,0,0,112,97,114,116,105,97,108,100,105,102,102,0,0,0,0,0,115,117,109,109,97,116,105,111,110,0,0,0,0,0,0,0,112,114,111,100,117,99,116,0,112,105,0,0,0,0,0,0,105,110,116,101,103,114,97,108,0,0,0,0,0,0,0,0,111,114,100,102,101,109,105,110,105,110,101,0,0,0,0,0,111,114,100,109,97,115,99,117,108,105,110,101,0,0,0,0,79,104,109,0,0,0,0,0,97,101,0,0,0,0,0
|
||
|
/* memory initializer */ allocate([57,51,32,54,46,57,57,54,32,57,46,48,55,32,54,46,57,57,54,32,57,46,50,49,49,32,55,46,48,49,50,32,99,32,83,32,81,10,49,46,48,48,52,52,49,51,32,119,10,49,32,74,10,49,32,106,10,113,32,49,32,48,32,48,32,45,48,46,57,57,49,50,51,50,32,48,32,50,52,32,99,109,10,49,56,46,48,55,32,49,48,46,53,48,50,32,109,32,49,53,46,49,49,51,32,57,46,48,48,53,32,108,32,49,50,46,49,57,57,32,49,48,46,53,57,51,32,108,32,49,50,46,55,49,49,32,55,46,51,49,52,32,108,32,49,48,46,51,48,49,10,53,46,48,51,54,32,108,32,49,51,46,53,55,52,32,52,46,53,48,56,32,108,32,49,52,46,57,57,54,32,49,46,53,49,51,32,108,32,49,54,46,53,49,50,32,52,46,52,54,53,32,108,32,49,57,46,56,48,49,32,52,46,56,57,49,32,108,10,49,55,46,52,54,49,32,55,46,50,52,51,32,108,32,49,56,46,48,55,32,49,48,46,53,48,50,32,108,32,104,10,49,56,46,48,55,32,49,48,46,53,48,50,32,109,32,83,32,81,10,50,32,119,10,48,32,106,10,49,49,32,49,56,32,109,32,49,48,32,49,56,32,108,32,49,48,32,52,32,108,32,83,10,49,52,32,52,32,109,32,49,52,32,49,52,32,108,32,83,10,0,0,0,0,0,0,0,0,80,97,114,97,103,114,97,112,104,0,0,0,0,0,0,0,52,46,51,48,49,32,50,51,32,109,32,49,57,46,54,57,57,32,50,51,32,108,32,50,49,46,53,50,51,32,50,51,32,50,51,32,50,49,46,53,50,51,32,50,51,32,49,57,46,54,57,57,32,99,32,50,51,32,52,46,51,48,49,32,108,32,50,51,10,50,46,52,55,55,32,50,49,46,53,50,51,32,49,32,49,57,46,54,57,57,32,49,32,99,32,52,46,51,48,49,32,49,32,108,32,50,46,52,55,55,32,49,32,49,32,50,46,52,55,55,32,49,32,52,46,51,48,49,32,99,32,49,32,49,57,46,54,57,57,10,108,32,49,32,50,49,46,53,50,51,32,50,46,52,55,55,32,50,51,32,52,46,51,48,49,32,50,51,32,99,32,104,10,52,46,51,48,49,32,50,51,32,109,32,102,10,48,46,53,51,51,51,51,51,32,48,46,53,52,49,49,55,54,32,48,46,53,50,49,53,54,57,32,82,71,32,50,32,119,10,49,32,74,10,49,32,106,10,91,93,32,48,46,48,32,100,10,52,32,77,32,49,53,32,51,32,109,32,49,53,32,49,56,32,108,32,49,49,32,49,56,32,108,32,49,49,32,51,32,108,32,83,10,52,32,119,10,113,32,49,32,48,32,48,32,45,49,32,48,32,50,52,32,99,109,10,57,46,55,55,55,32,49,48,46,57,56,56,32,109,32,56,46,55,52,54,32,49,48,46,56,55,49,32,55,46,57,55,51,32,57,46,57,56,56,32,56,32,56,46,57,52,57,32,99,32,56,46,48,50,55,32,55,46,57,49,32,56,46,56,52,52,10,55,46,48,54,54,32,57,46,56,55,57,32,55,46,48,48,52,32,99,32,83,32,81,10,48,46,55,50,57,52,49,50,32,48,46,55,52,49,49,55,54,32,48,46,55,49,51,55,50,53,32,82,71,32,50,32,119,10,49,53,32,52,32,109,32,49,53,32,49,57,32,108,32,49,49,32,49,57,32,108,32,49,49,32,52,32,108,32,83,10,52,32,119,10,113,32,49,32,48,32,48,32,45,49,32,48,32,50,52,32,99,109,10,57,46,55,55,55,32,57,46,57,56,56,32,109,32,56,46,55,52,54,32,57,46,56,55,49,32,55,46,57,55,51,32,56,46,57,56,56,32,56,32,55,46,57,52,57,32,99,32,56,46,48,50,55,32,54,46,57,49,32,56,46,56,52,52,32,54,46,48,54,54,10,57,46,56,55,57,32,54,46,48,48,52,32,99,32,83,32,81,10,0,0,0,73,110,115,101,114,116,0,0,52,46,51,48,49,32,50,51,32,109,32,49,57,46,54,57,57,32,50,51,32,108,32,50,49,46,53,50,51,32,50,51,32,50,51,32,50,49,46,53,50,51,32,50,51,32,49,57,46,54,57,57,32,99,32,50,51,32,52,46,51,48,49,32,108,32,50,51,10,50,46,52,55,55,32,50,49,46,53,50,51,32,49,32,49,57,46,54,57,57,32,49,32,99,32,52,46,51,48,49,32,49,32,108,32,50,46,52,55,55,32,49,32,49,32,50,46,52,55,55,32,49,32,52,46,51,48,49,32,99,32,49,32,49,57,46,54,57,57,10,108,32,49,32,50,49,46,53,50,51,32,50,46,52,55,55,32,50,51,32,52,46,51,48,49,32,50,51,32,99,32,104,10,52,46,51,48,49,32,50,51,32,109,32,102,10,48,46,53,51,51,51,51,51,32,48,46,53,52,49,49,55,54,32,48,46,53,50,49,53,54,57,32,82,71,32,50,32,119,10,49,32,74,10,48,32,106,10,91,93,32,48,46,48,32,100,10,52,32,77,32,49,50,32,49,56,46,48,49,50,32,109,32,50,48,32,49,56,32,108,32,83,10,57,32,49,48,32,109,32,49,55,32,49,48,32,108,32,83,10,49,50,32,49,52,46,48,49,50,32,109,32,50,48,32,49,52,32,108,32,83,10,49,50,32,54,46,48,49,50,32,109,32,50,48,32,54,46,48,49,50,32,108,32,83,10,52,32,49,50,32,109,32,54,32,49,48,32,108,32,52,32,56,32,108,32,83,10,52,32,49,50,32,109,32,52,32,56,32,108,32,83,10,48,46,55,50,57,52,49,50,32,48,46,55,52,49,49,55,54,32,48,46,55,49,51,55,50,53,32,82,71,32,49,50,32,49,57,46,48,49,50,32,109,32,50,48,32,49,57,32,
|
||
|
/* memory initializer */ allocate([78,80,0,0,0,0,0,0,87,105,100,103,101,116,0,0,80,114,105,110,116,101,114,77,97,114,107,0,0,0,0,0,84,114,97,112,78,101,116,0,87,97,116,101,114,109,97,114,107,0,0,0,0,0,0,0,49,49,65,110,110,111,116,66,111,114,100,101,114,0,0,0,88,113,4,0,64,24,1,0,53,65,110,110,111,116,0,0,88,113,4,0,88,24,1,0,49,48,65,110,110,111,116,80,111,112,117,112,0,0,0,0,128,113,4,0,104,24,1,0,96,24,1,0,0,0,0,0,49,49,65,110,110,111,116,77,97,114,107,117,112,0,0,0,128,113,4,0,136,24,1,0,96,24,1,0,0,0,0,0,57,65,110,110,111,116,84,101,120,116,0,0,0,0,0,0,128,113,4,0,168,24,1,0,152,24,1,0,0,0,0,0,57,65,110,110,111,116,76,105,110,107,0,0,0,0,0,0,128,113,4,0,200,24,1,0,96,24,1,0,0,0,0,0,49,51,65,110,110,111,116,70,114,101,101,84,101,120,116,0,128,113,4,0,232,24,1,0,152,24,1,0,0,0,0,0,57,65,110,110,111,116,76,105,110,101,0,0,0,0,0,0,128,113,4,0,8,25,1,0,152,24,1,0,0,0,0,0,49,53,65,110,110,111,116,84,101,120,116,77,97,114,107,117,112,0,0,0,0,0,0,0,128,113,4,0,40,25,1,0,152,24,1,0,0,0,0,0,49,49,65,110,110,111,116,87,105,100,103,101,116,0,0,0,128,113,4,0,80,25,1,0,96,24,1,0,0,0,0,0,49,48,65,110,110,111,116,77,111,118,105,101,0,0,0,0,128,113,4,0,112,25,1,0,96,24,1,0,0,0,0,0,49,49,65,110,110,111,116,83,99,114,101,101,110,0,0,0,128,113,4,0,144,25,1,0,96,24,1,0,0,0,0,0,49,48,65,110,110,111,116,83,116,97,109,112,0,0,0,0,128,113,4,0,176,25,1,0,152,24,1,0,0,0,0,0,49,51,65,110,110,111,116,71,101,111,109,101,116,114,121,0,128,113,4,0,208,25,1,0,152,24,1,0,0,0,0,0,49,50,65,110,110,111,116,80,111,108,121,103,111,110,0,0,128,113,4,0,240,25,1,0,152,24,1,0,0,0,0,0,49,48,65,110,110,111,116,67,97,114,101,116,0,0,0,0,128,113,4,0,16,26,1,0,152,24,1,0,0,0,0,0,56,65,110,110,111,116,73,110,107,0,0,0,0,0,0,0,128,113,4,0,48,26,1,0,152,24,1,0,0,0,0,0,49,57,65,110,110,111,116,70,105,108,101,65,116,116,97,99,104,109,101,110,116,0,0,0,128,113,4,0,80,26,1,0,152,24,1,0,0,0,0,0,49,48,65,110,110,111,116,83,111,117,110,100,0,0,0,0,128,113,4,0,120,26,1,0,152,24,1,0,0,0,0,0,55,65,110,110,111,116,51,68,0,0,0,0,0,0,0,0,128,113,4,0,152,26,1,0,96,24,1,0,0,0,0,0,49,54,65,110,110,111,116,67,97,108,108,111,117,116,76,105,110,101,0,0,0,0,0,0,88,113,4,0,184,26,1,0,50,49,65,110,110,111,116,67,97,108,108,111,117,116,77,117,108,116,105,76,105,110,101,0,128,113,4,0,216,26,1,0,208,26,1,0,0,0,0,0,49,54,65,110,110,111,116,66,111,114,100,101,114,65,114,114,97,121,0,0,0,0,0,0,128,113,4,0,0,27,1,0,80,24,1,0,0,0,0,0,49,51,65,110,110,111,116,66,111,114,100,101,114,66,83,0,128,113,4,0,40,27,1,0,80,24,1,0,0,0,0,0,67,97,108,108,32,116,111,32,79,98,106,101,99,116,32,119,104,101,114,101,32,116,104,101,32,111,98,106,101,99,116,32,119,97,115,32,116,121,112,101,32,37,100,44,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,116,121,112,101,32,37,100,0,0,0,77,97,114,107,117,112,51,68,0,0,0,0,0,0,0,0,67,97,108,108,32,116,111,32,79,98,106,101,99,116,32,119,104,101,114,101,32,116,104,101,32,111,98,106,101,99,116,32,119,97,115,32,116,121,112,101,32,37,100,44,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,116,121,112,101,32,37,100,32,111,114,32,37,100,0,0,0,0,0,67,111,117,114,105,101,114,0,67,111,117,114,105,101,114,45,66,111,108,100,0,0,0,0,67,111,117,114,105,101,114,45,66,111,108,100,79,98,108,105,113,117,101,0,0,0,0,0,67,111,117,114,105,101,114,45,79,98,108,105,113,117,101,0,72,101,108,118,101,116,105,99,97,0,0,0,0,0,0,0,72,101,108,118,101,116,105,99,97,45,66,111,108,100,0,0,72,101,108,118,101,116,105,99,97,45,66,111,108,100,79,98,108,105,113,117,101,0,0,0,72,101,108,118,101,116,105,99,97,45,79,98,108,105,113,117,101,0,0,0,0,0,0,0,83,121,109,98,111,108,0,0,84,105,109,101,115,45,66,111,108,100,0,0,0,0,0,0,84,105,109,101,115,45,66,111,108,100,73,116,97,108,105,99,0,0,0,0,0,0,0,0,84,105,109,101,115,45,73,116,97,108,105,99,0,0,0,0,84,105,109,101,115,45,82,111,109,97,110,0,0,0,0,0,90,97,112,102,68,105,110,103,98,97,116,115,0,0,0,0,240,27,1,0,176,36,2,0,117,2,99,255,233,255,6,255,203,2,37,3,0,0,0,0,248,27,1,0,176,36,2,0,117,2,99,255,143,255,6,255,237,2,33,3,0,0,0,0,8,28,1,0,176,36,2,0,117,2,99,255,199,255,6,255,101,3,33,3,0,0,0,0,32,28,1,0,176,36,2,0,117,2,99,
|
||
|
/* memory initializer */ allocate([88,2,0,0,0,0,0,0,184,235,1,0,88,2,0,0,0,0,0,0,192,235,1,0,88,2,0,0,0,0,0,0,208,235,1,0,88,2,0,0,0,0,0,0,216,235,1,0,88,2,0,0,0,0,0,0,232,235,1,0,88,2,0,0,0,0,0,0,240,235,1,0,88,2,0,0,0,0,0,0,248,235,1,0,88,2,0,0,0,0,0,0,0,236,1,0,88,2,0,0,0,0,0,0,16,236,1,0,88,2,0,0,0,0,0,0,24,236,1,0,88,2,0,0,0,0,0,0,40,236,1,0,88,2,0,0,0,0,0,0,48,236,1,0,88,2,0,0,0,0,0,0,56,236,1,0,88,2,0,0,0,0,0,0,64,236,1,0,88,2,0,0,0,0,0,0,72,236,1,0,88,2,0,0,0,0,0,0,80,236,1,0,88,2,0,0,0,0,0,0,88,236,1,0,88,2,0,0,0,0,0,0,96,236,1,0,88,2,0,0,0,0,0,0,104,236,1,0,88,2,0,0,0,0,0,0,112,236,1,0,88,2,0,0,0,0,0,0,120,236,1,0,88,2,0,0,0,0,0,0,128,236,1,0,88,2,0,0,0,0,0,0,136,236,1,0,88,2,0,0,0,0,0,0,144,236,1,0,88,2,0,0,0,0,0,0,160,236,1,0,88,2,0,0,0,0,0,0,176,236,1,0,88,2,0,0,0,0,0,0,192,236,1,0,88,2,0,0,0,0,0,0,200,236,1,0,88,2,0,0,0,0,0,0,216,236,1,0,88,2,0,0,0,0,0,0,232,236,1,0,88,2,0,0,0,0,0,0,240,236,1,0,88,2,0,0,0,0,0,0,0,237,1,0,88,2,0,0,0,0,0,0,8,237,1,0,88,2,0,0,0,0,0,0,16,237,1,0,88,2,0,0,0,0,0,0,32,237,1,0,88,2,0,0,0,0,0,0,40,237,1,0,88,2,0,0,0,0,0,0,56,237,1,0,88,2,0,0,0,0,0,0,64,237,1,0,88,2,0,0,0,0,0,0,80,237,1,0,88,2,0,0,0,0,0,0,88,237,1,0,88,2,0,0,0,0,0,0,104,237,1,0,88,2,0,0,0,0,0,0,112,237,1,0,88,2,0,0,0,0,0,0,128,237,1,0,88,2,0,0,0,0,0,0,144,237,1,0,88,2,0,0,0,0,0,0,152,237,1,0,88,2,0,0,0,0,0,0,160,237,1,0,88,2,0,0,0,0,0,0,168,237,1,0,88,2,0,0,0,0,0,0,176,237,1,0,88,2,0,0,0,0,0,0,192,237,1,0,88,2,0,0,0,0,0,0,200,237,1,0,88,2,0,0,0,0,0,0,208,237,1,0,88,2,0,0,0,0,0,0,224,237,1,0,88,2,0,0,0,0,0,0,232,237,1,0,88,2,0,0,0,0,0,0,248,237,1,0,88,2,0,0,0,0,0,0,8,238,1,0,88,2,0,0,0,0,0,0,16,238,1,0,88,2,0,0,0,0,0,0,32,238,1,0,88,2,0,0,0,0,0,0,40,238,1,0,88,2,0,0,0,0,0,0,56,238,1,0,88,2,0,0,0,0,0,0,64,238,1,0,88,2,0,0,0,0,0,0,72,238,1,0,88,2,0,0,0,0,0,0,80,238,1,0,88,2,0,0,0,0,0,0,88,238,1,0,88,2,0,0,0,0,0,0,104,238,1,0,88,2,0,0,0,0,0,0,120,238,1,0,88,2,0,0,0,0,0,0,136,238,1,0,88,2,0,0,0,0,0,0,144,238,1,0,88,2,0,0,0,0,0,0,152,238,1,0,88,2,0,0,0,0,0,0,168,238,1,0,88,2,0,0,0,0,0,0,176,238,1,0,88,2,0,0,0,0,0,0,192,238,1,0,88,2,0,0,0,0,0,0,208,238,1,0,88,2,0,0,0,0,0,0,216,238,1,0,88,2,0,0,0,0,0,0,224,238,1,0,88,2,0,0,0,0,0,0,240,238,1,0,88,2,0,0,0,0,0,0,0,239,1,0,88,2,0,0,0,0,0,0,16,239,1,0,88,2,0,0,0,0,0,0,24,239,1,0,88,2,0,0,0,0,0,0,40,239,1,0,88,2,0,0,0,0,0,0,56,239,1,0,88,2,0,0,0,0,0,0,72,239,1,0,88,2,0,0,0,0,0,0,88,239,1,0,88,2,0,0,0,0,0,0,96,239,1,0,88,2,0,0,0,0,0,0,104,239,1,0,88,2,0,0,0,0,0,0,112,239,1,0,88,2,0,0,0,0,0,0,128,239,1,0,88,2,0,0,0,0,0,0,136,239,1,0,88,2,0,0,0,0,0,0,152,239,1,0,88,2,0,0,0,0,0,0,168,239,1,0,88,2,0,0,0,0,0,0,176,239,1,0,88,2,0,0,0,0,0,0,184,239,1,0,88,2,0,0,0,0,0,0,200,239,1,0,88,2,0,0,0,0,0,0,216,239,1,0,88,2,0,0,0,0,0,0,224,239,1,0,88,2,0,0,0,0,0,0,232,239,1,0,88,2,0,0,0,0,0,0,240,239,1,0,88,2,0,0,0,0,0,0,248,239,1,0,88,2,0,0,0,0,0,0,8,240,1,0,88,2,0,0,0,0,0,0,16,240,1,0,88,2,0,0,0,0,0,0,32,240,1,0,88,2,0,0,0,0,0,0,48,240,1,0,88,2,0,0,0,0,0,0,64,240,1,0,88,2,0,0,0,0,0,0,80,240,1,0,88,2,0,0,0,0,0,0,96,240,1,0,88,2,0,0,0,0,0,0,104,240,1,0,88,2,0,0,0,0,0,0,112,240,1,0,88,2,0,0,0,0,0,0,120,240,1,0,88,2,0,0,0,0,0,0,136,240,1,0,88,2,0,0,0,0,0,0,144,240,1,0,88,2,0,0,0,0,0,0,152,240,1,0,88,2,0,0,0,0,0,0,168,240,1,0,88,2,0,0,0,0,0,0,176,240,1,0,88,2,0,0,0,0,0,0,184,240,1,0,88,2,0,0,0,0,0,0,200,240,1,0,88,2,0,0,0,0,0,0,208,240,1,0,88,2,0,0,0,0,0,0,216,240,1,0,88,2,0,0,0,0,0,0,232,240,1,0,88,2,0,0,0,0,0,0,240,240,1,0,88,2,0,0,0,0,0,0,0,241,1,0,88,2,0,0,0,0,0,0,8,241,1,0,88,2,0,0,0,0,0,0,16,241,1,0,88,2,0,0,0,0,0,0,32,241,1,0,88,2,0,0,0,0,0,0,48,241,1,0,88,2,0,0,0,0,0,0,56,241,1,0,88,2,0,0,0,0,0,0,64,241,1,0,88,2,0,0,0,0,0,0,80,241,1,0,88,2,0,0,0,0,0,0,88,241,1,0,88,2,0,0,0,0,0,0,104,241,1,0,88,2,0,0,0,0,0,0,112,241,1,0,88,2,0,0,0,0,0,0,120,241,1,0,88,2,0,0,0,0,0,0,128,241,1,0,88,2,0,0,0,0,0,0,136,241,1,0,88,2,0,0,0,0,0,0,144,241,1,0,88,2,0,0,0,0,0,0,152,241,1,0,88,2,0,0,0,0,0,0,160,241,1,0,88,2,0,0,0,0,0,0,176,241,1,0,88,2,0,0,0,0,0,0,184,241,1,0,88,2,0,0,0,0,0,0,192,241,1,0,88,2,0,0,0,0,0,0,200,241,1,0,88,2,0,0,0,0,0,0,208,241,1,0,88,2,0,0,0,0,0,0,224,241,1,0,88,2,0,0,0,0,0,0,232,241,1,0,88,
|
||
|
/* memory initializer */ allocate([128,245,1,0,44,2,0,0,0,0,0,0,136,245,1,0,4,1,0,0,0,0,0,0,152,245,1,0,222,0,0,0,0,0,0,0,168,245,1,0,155,2,0,0,0,0,0,0,184,245,1,0,77,1,0,0,0,0,0,0,0,0,0,0,120,232,1,0,210,2,0,0,0,0,0,0,128,232,1,0,133,1,0,0,0,0,0,0,136,232,1,0,44,2,0,0,0,0,0,0,152,232,1,0,210,2,0,0,0,0,0,0,168,232,1,0,99,2,0,0,0,0,0,0,176,232,1,0,22,1,0,0,0,0,0,0,184,232,1,0,77,1,0,0,0,0,0,0,192,232,1,0,72,2,0,0,0,0,0,0,208,232,1,0,77,1,0,0,0,0,0,0,224,232,1,0,77,1,0,0,0,0,0,0,240,232,1,0,44,2,0,0,0,0,0,0,0,233,1,0,72,2,0,0,0,0,0,0,16,233,1,0,77,1,0,0,0,0,0,0,24,233,1,0,66,3,0,0,0,0,0,0,32,233,1,0,44,2,0,0,0,0,0,0,40,233,1,0,99,2,0,0,0,0,0,0,48,233,1,0,99,2,0,0,0,0,0,0,56,233,1,0,210,2,0,0,0,0,0,0,64,233,1,0,99,2,0,0,0,0,0,0,80,233,1,0,72,2,0,0,0,0,0,0,88,233,1,0,22,1,0,0,0,0,0,0,96,233,1,0,244,1,0,0,0,0,0,0,104,233,1,0,44,2,0,0,0,0,0,0,216,226,1,0,22,1,0,0,0,0,0,0,112,233,1,0,10,3,0,0,0,0,0,0,120,233,1,0,99,2,0,0,0,0,0,0,136,233,1,0,232,3,0,0,0,0,0,0,144,233,1,0,210,2,0,0,0,0,0,0,152,233,1,0,44,2,0,0,0,0,0,0,160,233,1,0,44,2,0,0,0,0,0,0,176,233,1,0,144,1,0,0,0,0,0,0,184,233,1,0,210,2,0,0,0,0,0,0,192,233,1,0,210,2,0,0,0,0,0,0,200,233,1,0,210,2,0,0,0,0,0,0,208,233,1,0,44,2,0,0,0,0,0,0,216,233,1,0,210,2,0,0,0,0,0,0,224,233,1,0,155,2,0,0,0,0,0,0,232,233,1,0,66,3,0,0,0,0,0,0,248,233,1,0,99,2,0,0,0,0,0,0,0,234,1,0,10,3,0,0,0,0,0,0,8,234,1,0,210,2,0,0,0,0,0,0,16,234,1,0,22,1,0,0,0,0,0,0,24,234,1,0,44,2,0,0,0,0,0,0,32,234,1,0,210,2,0,0,0,0,0,0,40,234,1,0,22,1,0,0,0,0,0,0,48,234,1,0,22,1,0,0,0,0,0,0,64,234,1,0,99,2,0,0,0,0,0,0,72,234,1,0,22,1,0,0,0,0,0,0,88,234,1,0,65,3,0,0,0,0,0,0,96,234,1,0,210,2,0,0,0,0,0,0,104,234,1,0,99,2,0,0,0,0,0,0,112,234,1,0,99,2,0,0,0,0,0,0,128,234,1,0,10,3,0,0,0,0,0,0,136,234,1,0,155,2,0,0,0,0,0,0,144,234,1,0,10,3,0,0,0,0,0,0,152,234,1,0,210,2,0,0,0,0,0,0,168,234,1,0,210,2,0,0,0,0,0,0,176,234,1,0,210,2,0,0,0,0,0,0,184,234,1,0,77,1,0,0,0,0,0,0,192,234,1,0,155,2,0,0,0,0,0,0,200,234,1,0,99,2,0,0,0,0,0,0,208,234,1,0,210,2,0,0,0,0,0,0,216,234,1,0,44,2,0,0,0,0,0,0,224,234,1,0,155,2,0,0,0,0,0,0,232,234,1,0,176,3,0,0,0,0,0,0,240,234,1,0,155,2,0,0,0,0,0,0,248,234,1,0,99,2,0,0,0,0,0,0,8,235,1,0,72,2,0,0,0,0,0,0,16,235,1,0,155,2,0,0,0,0,0,0,24,235,1,0,99,2,0,0,0,0,0,0,32,235,1,0,44,2,0,0,0,0,0,0,40,235,1,0,44,2,0,0,0,0,0,0,48,235,1,0,10,3,0,0,0,0,0,0,64,235,1,0,99,2,0,0,0,0,0,0,72,235,1,0,44,2,0,0,0,0,0,0,80,235,1,0,99,2,0,0,0,0,0,0,88,235,1,0,44,2,0,0,0,0,0,0,96,235,1,0,77,1,0,0,0,0,0,0,104,235,1,0,99,2,0,0,0,0,0,0,112,235,1,0,94,1,0,0,0,0,0,0,120,235,1,0,99,2,0,0,0,0,0,0,128,235,1,0,22,1,0,0,0,0,0,0,136,235,1,0,10,3,0,0,0,0,0,0,144,235,1,0,44,2,0,0,0,0,0,0,152,235,1,0,22,1,0,0,0,0,0,0,160,235,1,0,44,2,0,0,0,0,0,0,168,235,1,0,22,1,0,0,0,0,0,0,176,235,1,0,121,3,0,0,0,0,0,0,184,235,1,0,99,2,0,0,0,0,0,0,192,235,1,0,77,1,0,0,0,0,0,0,208,235,1,0,99,2,0,0,0,0,0,0,216,235,1,0,114,1,0,0,0,0,0,0,232,235,1,0,77,1,0,0,0,0,0,0,240,235,1,0,99,2,0,0,0,0,0,0,248,235,1,0,99,2,0,0,0,0,0,0,0,236,1,0,99,2,0,0,0,0,0,0,16,236,1,0,133,1,0,0,0,0,0,0,24,236,1,0,77,1,0,0,0,0,0,0,40,236,1,0,44,2,0,0,0,0,0,0,48,236,1,0,44,2,0,0,0,0,0,0,56,236,1,0,232,3,0,0,0,0,0,0,64,236,1,0,77,1,0,0,0,0,0,0,72,236,1,0,72,2,0,0,0,0,0,0,80,236,1,0,99,2,0,0,0,0,0,0,88,236,1,0,210,2,0,0,0,0,0,0,96,236,1,0,44,2,0,0,0,0,0,0,104,236,1,0,10,3,0,0,0,0,0,0,112,236,1,0,44,2,0,0,0,0,0,0,120,236,1,0,44,2,0,0,0,0,0,0,128,236,1,0,244,1,0,0,0,0,0,0,136,236,1,0,10,3,0,0,0,0,0,0,144,236,1,0,250,0,0,0,0,0,0,0,160,236,1,0,77,1,0,0,0,0,0,0,176,236,1,0,22,1,0,0,0,0,0,0,192,236,1,0,210,2,0,0,0,0,0,0,200,236,1,0,218,1,0,0,0,0,0,0,216,236,1,0,99,2,0,0,0,0,0,0,232,236,1,0,99,2,0,0,0,0,0,0,240,236,1,0,37,2,0,0,0,0,0,0,0,237,1,0,155,2,0,0,0,0,0,0,8,237,1,0,99,2,0,0,0,0,0,0,16,237,1,0,77,1,0,0,0,0,0,0,32,237,1,0,99,2,0,0,0,0,0,0,40,237,1,0,37,2,0,0,0,0,0,0,56,237,1,0,238,1,0,0,0,0,0,0,64,237,1,0,77,1,0,0,0,0,0,0,80,237,1,0,44,2,0,0,0,0,0,0,88,237,1,0,155,2,0,0,0,0,0,0,104,237,1,0,99,2,0,0,0,0,0,0,112,237,1,0,232,3,0,0,0,0,0,0,128,237,1,0,44,2,0,0,0,0,0,0,144,237,1,0,99,2,0,0,0,0,0,0,152,237,1,0,77,1,0,0,0,0,0,0,160,237,1,0,10,3,0,0,0,0,0,0,168,237,1,0,155,2,0,0,0,0,0,0,176,237,1,0
|
||
|
/* memory initializer */ allocate([120,241,1,0,77,1,0,0,0,0,0,0,128,241,1,0,99,2,0,0,0,0,0,0,136,241,1,0,155,2,0,0,0,0,0,0,144,241,1,0,44,2,0,0,0,0,0,0,152,241,1,0,144,1,0,0,0,0,0,0,160,241,1,0,225,2,0,0,0,0,0,0,176,241,1,0,197,1,0,0,0,0,0,0,184,241,1,0,155,2,0,0,0,0,0,0,192,241,1,0,121,3,0,0,0,0,0,0,200,241,1,0,44,2,0,0,0,0,0,0,208,241,1,0,25,2,0,0,0,0,0,0,224,241,1,0,131,2,0,0,0,0,0,0,232,241,1,0,210,2,0,0,0,0,0,0,240,241,1,0,44,2,0,0,0,0,0,0,248,241,1,0,88,2,0,0,0,0,0,0,8,242,1,0,22,1,0,0,0,0,0,0,16,242,1,0,44,2,0,0,0,0,0,0,24,242,1,0,44,2,0,0,0,0,0,0,40,242,1,0,44,2,0,0,0,0,0,0,48,242,1,0,210,2,0,0,0,0,0,0,56,242,1,0,44,2,0,0,0,0,0,0,72,242,1,0,61,1,0,0,0,0,0,0,80,242,1,0,44,2,0,0,0,0,0,0,88,242,1,0,100,2,0,0,0,0,0,0,96,242,1,0,10,3,0,0,0,0,0,0,112,242,1,0,213,1,0,0,0,0,0,0,128,242,1,0,44,2,0,0,0,0,0,0,136,242,1,0,77,1,0,0,0,0,0,0,144,242,1,0,44,2,0,0,0,0,0,0,152,242,1,0,22,1,0,0,0,0,0,0,168,242,1,0,22,1,0,0,0,0,0,0,176,242,1,0,155,2,0,0,0,0,0,0,192,242,1,0,22,1,0,0,0,0,0,0,200,242,1,0,222,0,0,0,0,0,0,0,208,242,1,0,210,2,0,0,0,0,0,0,216,242,1,0,72,2,0,0,0,0,0,0,224,242,1,0,44,2,0,0,0,0,0,0,232,242,1,0,222,0,0,0,0,0,0,0,248,242,1,0,222,0,0,0,0,0,0,0,8,243,1,0,155,2,0,0,0,0,0,0,16,243,1,0,44,2,0,0,0,0,0,0,32,243,1,0,77,1,0,0,0,0,0,0,48,243,1,0,77,1,0,0,0,0,0,0,56,243,1,0,44,2,0,0,0,0,0,0,64,243,1,0,77,1,0,0,0,0,0,0,80,243,1,0,22,1,0,0,0,0,0,0,88,243,1,0,77,1,0,0,0,0,0,0,104,243,1,0,44,2,0,0,0,0,0,0,112,243,1,0,44,2,0,0,0,0,0,0,120,243,1,0,244,1,0,0,0,0,0,0,128,243,1,0,210,2,0,0,0,0,0,0,144,243,1,0,244,1,0,0,0,0,0,0,152,243,1,0,244,1,0,0,0,0,0,0,160,243,1,0,155,2,0,0,0,0,0,0,176,243,1,0,210,2,0,0,0,0,0,0,184,243,1,0,22,1,0,0,0,0,0,0,200,243,1,0,44,2,0,0,0,0,0,0,216,243,1,0,99,2,0,0,0,0,0,0,232,243,1,0,155,2,0,0,0,0,0,0,240,243,1,0,44,2,0,0,0,0,0,0,248,243,1,0,155,2,0,0,0,0,0,0,0,244,1,0,109,1,0,0,0,0,0,0,16,244,1,0,22,1,0,0,0,0,0,0,32,244,1,0,44,2,0,0,0,0,0,0,48,244,1,0,37,2,0,0,0,0,0,0,64,244,1,0,22,1,0,0,0,0,0,0,72,244,1,0,77,1,0,0,0,0,0,0,88,244,1,0,99,2,0,0,0,0,0,0,104,244,1,0,44,2,0,0,0,0,0,0,120,244,1,0,244,1,0,0,0,0,0,0,128,244,1,0,155,2,0,0,0,0,0,0,136,244,1,0,22,1,0,0,0,0,0,0,152,244,1,0,78,1,0,0,0,0,0,0,168,244,1,0,77,1,0,0,0,0,0,0,184,244,1,0,44,2,0,0,0,0,0,0,192,244,1,0,244,1,0,0,0,0,0,0,200,244,1,0,22,1,0,0,0,0,0,0,208,244,1,0,44,2,0,0,0,0,0,0,216,244,1,0,44,2,0,0,0,0,0,0,232,244,1,0,72,2,0,0,0,0,0,0,248,244,1,0,244,1,0,0,0,0,0,0,8,245,1,0,155,2,0,0,0,0,0,0,16,245,1,0,77,1,0,0,0,0,0,0,24,245,1,0,4,1,0,0,0,0,0,0,32,245,1,0,167,0,0,0,0,0,0,0,48,245,1,0,72,2,0,0,0,0,0,0,56,245,1,0,44,2,0,0,0,0,0,0,64,245,1,0,77,1,0,0,0,0,0,0,80,245,1,0,22,1,0,0,0,0,0,0,88,245,1,0,22,1,0,0,0,0,0,0,96,245,1,0,210,2,0,0,0,0,0,0,104,245,1,0,155,2,0,0,0,0,0,0,120,245,1,0,72,2,0,0,0,0,0,0,128,245,1,0,44,2,0,0,0,0,0,0,136,245,1,0,4,1,0,0,0,0,0,0,152,245,1,0,222,0,0,0,0,0,0,0,168,245,1,0,155,2,0,0,0,0,0,0,184,245,1,0,77,1,0,0,0,0,0,0,0,0,0,0,200,245,1,0,128,1,0,0,0,0,0,0,216,245,1,0,119,2,0,0,0,0,0,0,224,245,1,0,0,3,0,0,0,0,0,0,232,245,1,0,201,2,0,0,0,0,0,0,176,232,1,0,250,0,0,0,0,0,0,0,248,245,1,0,22,3,0,0,0,0,0,0,192,232,1,0,37,2,0,0,0,0,0,0,8,246,1,0,91,2,0,0,0,0,0,0,16,246,1,0,22,3,0,0,0,0,0,0,24,246,1,0,128,1,0,0,0,0,0,0,40,246,1,0,201,2,0,0,0,0,0,0,16,233,1,0,22,1,0,0,0,0,0,0,56,246,1,0,37,2,0,0,0,0,0,0,64,246,1,0,238,1,0,0,0,0,0,0,80,246,1,0,174,2,0,0,0,0,0,0,88,246,1,0,251,2,0,0,0,0,0,0,80,233,1,0,37,2,0,0,0,0,0,0,216,226,1,0,250,0,0,0,0,0,0,0,96,246,1,0,80,2,0,0,0,0,0,0,104,246,1,0,37,2,0,0,0,0,0,0,120,246,1,0,247,0,0,0,0,0,0,0,128,246,1,0,0,3,0,0,0,0,0,0,144,246,1,0,210,2,0,0,0,0,0,0,152,233,1,0,244,1,0,0,0,0,0,0,160,233,1,0,244,1,0,0,0,0,0,0,152,246,1,0,37,2,0,0,0,0,0,0,160,246,1,0,9,2,0,0,0,0,0,0,168,246,1,0,55,3,0,0,0,0,0,0,176,246,1,0,99,2,0,0,0,0,0,0,184,246,1,0,241,2,0,0,0,0,0,0,192,246,1,0,91,2,0,0,0,0,0,0,208,246,1,0,91,2,0,0,0,0,0,0,216,246,1,0,201,2,0,0,0,0,0,0,232,246,1,0,37,2,0,0,0,0,0,0,248,234,1,0,188,1,0,0,0,0,0,0,8,235,1,0,37,2,0,0,0,0,0,0,240,246,1,0,99,2,0,0,0,0,0,0,248,246,1,0,55,3,0,0,0,0,0,0,8,247,1,0,241,2,0,0,0,0,0,0,32,235,1,0,244,1,0,0,0,0,0,0,16,247,1,0,121,3,0,0,0,0,0,0,24,247,1,0,128,1,0,0,0,0,0,
|
||
|
/* memory initializer */ allocate([200,242,1,0,22,1,0,0,0,0,0,0,208,242,1,0,210,2,0,0,0,0,0,0,216,242,1,0,58,2,0,0,0,0,0,0,224,242,1,0,44,2,0,0,0,0,0,0,232,242,1,0,77,1,0,0,0,0,0,0,248,242,1,0,22,1,0,0,0,0,0,0,8,243,1,0,99,2,0,0,0,0,0,0,16,243,1,0,244,1,0,0,0,0,0,0,32,243,1,0,44,1,0,0,0,0,0,0,48,243,1,0,77,1,0,0,0,0,0,0,56,243,1,0,244,1,0,0,0,0,0,0,64,243,1,0,77,1,0,0,0,0,0,0,80,243,1,0,22,1,0,0,0,0,0,0,88,243,1,0,244,1,0,0,0,0,0,0,104,243,1,0,44,2,0,0,0,0,0,0,112,243,1,0,244,1,0,0,0,0,0,0,120,243,1,0,188,1,0,0,0,0,0,0,128,243,1,0,155,2,0,0,0,0,0,0,144,243,1,0,44,2,0,0,0,0,0,0,152,243,1,0,44,2,0,0,0,0,0,0,160,243,1,0,155,2,0,0,0,0,0,0,176,243,1,0,155,2,0,0,0,0,0,0,184,243,1,0,133,1,0,0,0,0,0,0,200,243,1,0,244,1,0,0,0,0,0,0,216,243,1,0,244,1,0,0,0,0,0,0,232,243,1,0,155,2,0,0,0,0,0,0,240,243,1,0,244,1,0,0,0,0,0,0,248,243,1,0,44,2,0,0,0,0,0,0,0,244,1,0,44,1,0,0,0,0,0,0,16,244,1,0,22,1,0,0,0,0,0,0,32,244,1,0,244,1,0,0,0,0,0,0,48,244,1,0,37,2,0,0,0,0,0,0,64,244,1,0,133,1,0,0,0,0,0,0,72,244,1,0,133,1,0,0,0,0,0,0,88,244,1,0,99,2,0,0,0,0,0,0,104,244,1,0,244,1,0,0,0,0,0,0,120,244,1,0,188,1,0,0,0,0,0,0,128,244,1,0,155,2,0,0,0,0,0,0,136,244,1,0,22,1,0,0,0,0,0,0,152,244,1,0,92,1,0,0,0,0,0,0,168,244,1,0,244,1,0,0,0,0,0,0,184,244,1,0,244,1,0,0,0,0,0,0,192,244,1,0,133,1,0,0,0,0,0,0,200,244,1,0,22,1,0,0,0,0,0,0,208,244,1,0,244,1,0,0,0,0,0,0,216,244,1,0,244,1,0,0,0,0,0,0,232,244,1,0,94,2,0,0,0,0,0,0,248,244,1,0,133,1,0,0,0,0,0,0,8,245,1,0,155,2,0,0,0,0,0,0,16,245,1,0,77,1,0,0,0,0,0,0,24,245,1,0,220,0,0,0,0,0,0,0,32,245,1,0,167,0,0,0,0,0,0,0,48,245,1,0,58,2,0,0,0,0,0,0,56,245,1,0,188,1,0,0,0,0,0,0,64,245,1,0,77,1,0,0,0,0,0,0,80,245,1,0,133,1,0,0,0,0,0,0,88,245,1,0,250,0,0,0,0,0,0,0,96,245,1,0,155,2,0,0,0,0,0,0,104,245,1,0,155,2,0,0,0,0,0,0,120,245,1,0,58,2,0,0,0,0,0,0,128,245,1,0,244,1,0,0,0,0,0,0,136,245,1,0,220,0,0,0,0,0,0,0,152,245,1,0,77,1,0,0,0,0,0,0,168,245,1,0,155,2,0,0,0,0,0,0,184,245,1,0,44,1,0,0,0,0,0,0,0,0,0,0,120,232,1,0,155,2,0,0,0,0,0,0,128,232,1,0,133,1,0,0,0,0,0,0,136,232,1,0,188,1,0,0,0,0,0,0,152,232,1,0,155,2,0,0,0,0,0,0,168,232,1,0,44,2,0,0,0,0,0,0,176,232,1,0,250,0,0,0,0,0,0,0,184,232,1,0,77,1,0,0,0,0,0,0,192,232,1,0,163,2,0,0,0,0,0,0,208,232,1,0,77,1,0,0,0,0,0,0,224,232,1,0,77,1,0,0,0,0,0,0,240,232,1,0,188,1,0,0,0,0,0,0,0,233,1,0,29,2,0,0,0,0,0,0,16,233,1,0,77,1,0,0,0,0,0,0,24,233,1,0,238,2,0,0,0,0,0,0,32,233,1,0,244,1,0,0,0,0,0,0,40,233,1,0,99,2,0,0,0,0,0,0,48,233,1,0,244,1,0,0,0,0,0,0,56,233,1,0,99,2,0,0,0,0,0,0,64,233,1,0,244,1,0,0,0,0,0,0,80,233,1,0,163,2,0,0,0,0,0,0,88,233,1,0,77,1,0,0,0,0,0,0,96,233,1,0,133,1,0,0,0,0,0,0,104,233,1,0,244,1,0,0,0,0,0,0,216,226,1,0,250,0,0,0,0,0,0,0,112,233,1,0,210,2,0,0,0,0,0,0,120,233,1,0,244,1,0,0,0,0,0,0,136,233,1,0,121,3,0,0,0,0,0,0,144,233,1,0,99,2,0,0,0,0,0,0,152,233,1,0,244,1,0,0,0,0,0,0,160,233,1,0,244,1,0,0,0,0,0,0,176,233,1,0,44,1,0,0,0,0,0,0,184,233,1,0,99,2,0,0,0,0,0,0,192,233,1,0,99,2,0,0,0,0,0,0,200,233,1,0,155,2,0,0,0,0,0,0,208,233,1,0,244,1,0,0,0,0,0,0,216,233,1,0,210,2,0,0,0,0,0,0,224,233,1,0,99,2,0,0,0,0,0,0,232,233,1,0,238,2,0,0,0,0,0,0,248,233,1,0,99,2,0,0,0,0,0,0,0,234,1,0,210,2,0,0,0,0,0,0,8,234,1,0,210,2,0,0,0,0,0,0,16,234,1,0,77,1,0,0,0,0,0,0,24,234,1,0,188,1,0,0,0,0,0,0,32,234,1,0,155,2,0,0,0,0,0,0,40,234,1,0,22,1,0,0,0,0,0,0,48,234,1,0,22,1,0,0,0,0,0,0,64,234,1,0,44,2,0,0,0,0,0,0,72,234,1,0,250,0,0,0,0,0,0,0,88,234,1,0,65,3,0,0,0,0,0,0,96,234,1,0,155,2,0,0,0,0,0,0,104,234,1,0,244,1,0,0,0,0,0,0,112,234,1,0,44,2,0,0,0,0,0,0,128,234,1,0,210,2,0,0,0,0,0,0,136,234,1,0,99,2,0,0,0,0,0,0,144,234,1,0,210,2,0,0,0,0,0,0,152,234,1,0,210,2,0,0,0,0,0,0,168,234,1,0,99,2,0,0,0,0,0,0,176,234,1,0,99,2,0,0,0,0,0,0,184,234,1,0,77,1,0,0,0,0,0,0,192,234,1,0,244,1,0,0,0,0,0,0,200,234,1,0,44,2,0,0,0,0,0,0,208,234,1,0,210,2,0,0,0,0,0,0,216,234,1,0,244,1,0,0,0,0,0,0,224,234,1,0,99,2,0,0,0,0,0,0,232,234,1,0,65,3,0,0,0,0,0,0,240,234,1,0,99,2,0,0,0,0,0,0,248,234,1,0,244,1,0,0,0,0,0,0,8,235,1,0,163,2,0,0,0,0,0,0,16,235,1,0,44,2,0,0,0,0,0,0,24,235,1,0,44,2,0,0,0,0,0,0,32,235,1,0,244,1,0,0,0,0,0,0,40,235,1,0,244,1,0,0,0,0,0,0,48,235,1,0,210,2,0,0,0,0,0,0,64,235,1,0,244,1,0,0,0,0,0,0,72
|
||
|
/* memory initializer */ allocate([195,2,0,0,0,0,0,0,24,231,1,0,175,2,0,0,0,0,0,0,32,231,1,0,184,2,0,0,0,0,0,0,40,231,1,0,177,2,0,0,0,0,0,0,48,231,1,0,18,3,0,0,0,0,0,0,56,231,1,0,19,3,0,0,0,0,0,0,64,231,1,0,201,2,0,0,0,0,0,0,72,231,1,0,23,3,0,0,0,0,0,0,80,231,1,0,184,2,0,0,0,0,0,0,88,231,1,0,106,3,0,0,0,0,0,0,96,231,1,0,20,3,0,0,0,0,0,0,104,231,1,0,20,3,0,0,0,0,0,0,112,231,1,0,206,3,0,0,0,0,0,0,120,231,1,0,20,3,0,0,0,0,0,0,128,231,1,0,250,2,0,0,0,0,0,0,136,231,1,0,20,3,0,0,0,0,0,0,144,231,1,0,247,2,0,0,0,0,0,0,152,231,1,0,20,3,0,0,0,0,0,0,160,231,1,0,253,1,0,0,0,0,0,0,168,231,1,0,20,3,0,0,0,0,0,0,176,231,1,0,154,1,0,0,0,0,0,0,184,231,1,0,20,3,0,0,0,0,0,0,192,231,1,0,20,3,0,0,0,0,0,0,200,231,1,0,20,3,0,0,0,0,0,0,208,231,1,0,20,3,0,0,0,0,0,0,216,231,1,0,17,3,0,0,0,0,0,0,224,231,1,0,23,3,0,0,0,0,0,0,232,231,1,0,105,3,0,0,0,0,0,0,240,231,1,0,249,2,0,0,0,0,0,0,248,231,1,0,250,2,0,0,0,0,0,0,0,232,1,0,247,2,0,0,0,0,0,0,8,232,1,0,124,3,0,0,0,0,0,0,16,232,1,0,124,3,0,0,0,0,0,0,24,232,1,0,20,3,0,0,0,0,0,0,32,232,1,0,16,3,0,0,0,0,0,0,40,232,1,0,20,3,0,0,0,0,0,0,48,232,1,0,20,3,0,0,0,0,0,0,56,232,1,0,20,3,0,0,0,0,0,0,64,232,1,0,20,3,0,0,0,0,0,0,72,232,1,0,20,3,0,0,0,0,0,0,80,232,1,0,20,3,0,0,0,0,0,0,88,232,1,0,20,3,0,0,0,0,0,0,96,232,1,0,20,3,0,0,0,0,0,0,104,232,1,0,20,3,0,0,0,0,0,0,112,232,1,0,20,3,0,0,0,0,0,0,97,56,49,0,0,0,0,0,97,56,50,0,0,0,0,0,97,56,51,0,0,0,0,0,97,56,52,0,0,0,0,0,97,56,53,0,0,0,0,0,97,56,54,0,0,0,0,0,97,56,55,0,0,0,0,0,97,56,56,0,0,0,0,0,97,56,57,0,0,0,0,0,97,49,52,48,0,0,0,0,97,49,52,49,0,0,0,0,97,49,52,50,0,0,0,0,97,49,52,51,0,0,0,0,97,49,52,52,0,0,0,0,97,49,52,53,0,0,0,0,97,49,52,54,0,0,0,0,97,49,52,55,0,0,0,0,97,49,52,56,0,0,0,0,97,49,52,57,0,0,0,0,97,57,48,0,0,0,0,0,97,57,49,0,0,0,0,0,97,57,50,0,0,0,0,0,115,112,97,99,101,0,0,0,97,57,51,0,0,0,0,0,97,57,52,0,0,0,0,0,97,57,53,0,0,0,0,0,97,57,54,0,0,0,0,0,97,57,55,0,0,0,0,0,97,57,56,0,0,0,0,0,97,57,57,0,0,0,0,0,97,49,53,48,0,0,0,0,97,49,53,49,0,0,0,0,97,49,53,50,0,0,0,0,97,49,53,51,0,0,0,0,97,49,53,52,0,0,0,0,97,49,53,53,0,0,0,0,97,49,53,54,0,0,0,0,97,49,53,55,0,0,0,0,97,49,53,56,0,0,0,0,97,49,53,57,0,0,0,0,97,49,54,48,0,0,0,0,97,49,54,49,0,0,0,0,97,49,54,50,0,0,0,0,97,49,54,51,0,0,0,0,97,49,54,52,0,0,0,0,97,49,54,53,0,0,0,0,97,49,54,54,0,0,0,0,97,49,54,55,0,0,0,0,97,49,54,56,0,0,0,0,97,49,54,57,0,0,0,0,97,49,55,48,0,0,0,0,97,49,55,49,0,0,0,0,97,49,55,50,0,0,0,0,97,49,55,51,0,0,0,0,97,49,55,52,0,0,0,0,97,49,55,53,0,0,0,0,97,49,55,54,0,0,0,0,97,49,55,55,0,0,0,0,97,49,55,56,0,0,0,0,97,49,55,57,0,0,0,0,97,49,56,48,0,0,0,0,97,49,56,49,0,0,0,0,97,49,56,50,0,0,0,0,97,49,56,51,0,0,0,0,97,49,56,52,0,0,0,0,97,49,56,53,0,0,0,0,97,49,56,54,0,0,0,0,97,49,56,55,0,0,0,0,97,49,56,56,0,0,0,0,97,49,56,57,0,0,0,0,97,49,0,0,0,0,0,0,97,50,0,0,0,0,0,0,97,51,0,0,0,0,0,0,97,52,0,0,0,0,0,0,97,53,0,0,0,0,0,0,97,54,0,0,0,0,0,0,97,55,0,0,0,0,0,0,97,56,0,0,0,0,0,0,97,57,0,0,0,0,0,0,97,49,57,48,0,0,0,0,97,49,57,49,0,0,0,0,97,49,57,50,0,0,0,0,97,49,57,51,0,0,0,0,97,49,57,52,0,0,0,0,97,49,57,53,0,0,0,0,97,49,57,54,0,0,0,0,97,49,57,55,0,0,0,0,97,49,57,56,0,0,0,0,97,49,57,57,0,0,0,0,97,49,48,0,0,0,0,0,97,49,49,0,0,0,0,0,97,49,50,0,0,0,0,0,97,49,51,0,0,0,0,0,97,49,52,0,0,0,0,0,97,49,53,0,0,0,0,0,97,49,54,0,0,0,0,0,97,49,55,0,0,0,0,0,97,49,56,0,0,0,0,0,97,49,57,0,0,0,0,0,97,50,48,0,0,0,0,0,97,50,49,0,0,0,0,0,97,50,50,0,0,0,0,0,97,50,51,0,0,0,0,0,97,50,52,0,0,0,0,0,97,50,53,0,0,0,0,0,97,50,54,0,0,0,0,0,97,50,55,0,0,0,0,0,97,50,56,0,0,0,0,0,97,50,57,0,0,0,0,0,97,51,48,0,0,0,0,0,97,51,49,0,0,0,0,0,97,51,50,0,0,0,0,0,97,51,51,0,0,0,0,0,97,51,52,0,0,0,0,0,97,51,53,0,0,0,0,0,97,51,54,0,0,0,0,0,97,51,55,0,0,0,0,0,97,51,56,0,0,0,0,0,97,51,57,0,0,0,0,0,97,52,48,0,0,0,0,0,97,52,49,0,0,0,0,0,97,52,50,0,0,0,0,0,97,52,51,0,0,0,0,0,97,52,52,0,0,0,0,0,97,52,53,0,0,0,0,0,97,52,54,0,0,0,0,0,97,52,55,0,0,0,0,0,97,52,56,0,0,0,0,0,97,52,57,0,0,0,0,0,97,49,48,48,0,0,0,0,97,49,48,49,0,0,0,0,97,49,48,50,0,0,0,0,97,49,48,51,0,0,0,0,97,49,48,52,0,0,0,0,97,49,48,53,0,0,0,0,97,49,48,54,0,0,0,0,97,49,48,55,0,0,0,0,97,49,48,56,0,0,0,0,97,49,48,57,0,0,0,0,97,53,48,0,0,0,0,0,97,53,49,0,0,0,0,0,97,53,50,0,0,0,0,0,97,53,51,0
|
||
|
/* memory initializer */ allocate([98,0,0,0,0,0,0,0,99,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,101,0,0,0,0,0,0,0,102,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,104,0,0,0,0,0,0,0,105,0,0,0,0,0,0,0,106,0,0,0,0,0,0,0,107,0,0,0,0,0,0,0,108,0,0,0,0,0,0,0,109,0,0,0,0,0,0,0,110,0,0,0,0,0,0,0,111,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,113,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,115,0,0,0,0,0,0,0,116,0,0,0,0,0,0,0,117,0,0,0,0,0,0,0,118,0,0,0,0,0,0,0,119,0,0,0,0,0,0,0,120,0,0,0,0,0,0,0,121,0,0,0,0,0,0,0,122,0,0,0,0,0,0,0,98,114,97,99,101,108,101,102,116,0,0,0,0,0,0,0,98,97,114,0,0,0,0,0,98,114,97,99,101,114,105,103,104,116,0,0,0,0,0,0,97,115,99,105,105,116,105,108,100,101,0,0,0,0,0,0,65,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,65,114,105,110,103,0,0,0,67,99,101,100,105,108,108,97,0,0,0,0,0,0,0,0,69,97,99,117,116,101,0,0,78,116,105,108,100,101,0,0,79,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,85,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,97,97,99,117,116,101,0,0,97,103,114,97,118,101,0,0,97,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,97,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,97,116,105,108,100,101,0,0,97,114,105,110,103,0,0,0,99,99,101,100,105,108,108,97,0,0,0,0,0,0,0,0,101,97,99,117,116,101,0,0,101,103,114,97,118,101,0,0,101,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,101,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,105,97,99,117,116,101,0,0,105,103,114,97,118,101,0,0,105,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,105,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,110,116,105,108,100,101,0,0,111,97,99,117,116,101,0,0,111,103,114,97,118,101,0,0,111,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,111,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,111,116,105,108,100,101,0,0,117,97,99,117,116,101,0,0,117,103,114,97,118,101,0,0,117,99,105,114,99,117,109,102,108,101,120,0,0,0,0,0,117,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,100,97,103,103,101,114,0,0,100,101,103,114,101,101,0,0,99,101,110,116,0,0,0,0,115,116,101,114,108,105,110,103,0,0,0,0,0,0,0,0,115,101,99,116,105,111,110,0,98,117,108,108,101,116,0,0,112,97,114,97,103,114,97,112,104,0,0,0,0,0,0,0,103,101,114,109,97,110,100,98,108,115,0,0,0,0,0,0,114,101,103,105,115,116,101,114,101,100,0,0,0,0,0,0,99,111,112,121,114,105,103,104,116,0,0,0,0,0,0,0,116,114,97,100,101,109,97,114,107,0,0,0,0,0,0,0,97,99,117,116,101,0,0,0,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,0,110,111,116,101,113,117,97,108,0,0,0,0,0,0,0,0,65,69,0,0,0,0,0,0,79,115,108,97,115,104,0,0,105,110,102,105,110,105,116,121,0,0,0,0,0,0,0,0,112,108,117,115,109,105,110,117,115,0,0,0,0,0,0,0,108,101,115,115,101,113,117,97,108,0,0,0,0,0,0,0,103,114,101,97,116,101,114,101,113,117,97,108,0,0,0,0,121,101,110,0,0,0,0,0,109,117,0,0,0,0,0,0,112,97,114,116,105,97,108,100,105,102,102,0,0,0,0,0,115,117,109,109,97,116,105,111,110,0,0,0,0,0,0,0,112,114,111,100,117,99,116,0,112,105,0,0,0,0,0,0,105,110,116,101,103,114,97,108,0,0,0,0,0,0,0,0,111,114,100,102,101,109,105,110,105,110,101,0,0,0,0,0,111,114,100,109,97,115,99,117,108,105,110,101,0,0,0,0,79,109,101,103,97,0,0,0,97,101,0,0,0,0,0,0,111,115,108,97,115,104,0,0,113,117,101,115,116,105,111,110,100,111,119,110,0,0,0,0,101,120,99,108,97,109,100,111,119,110,0,0,0,0,0,0,108,111,103,105,99,97,108,110,111,116,0,0,0,0,0,0,114,97,100,105,99,97,108,0,102,108,111,114,105,110,0,0,97,112,112,114,111,120,101,113,117,97,108,0,0,0,0,0,68,101,108,116,97,0,0,0,103,117,105,108,108,101,109,111,116,108,101,102,116,0,0,0,103,117,105,108,108,101,109,111,116,114,105,103,104,116,0,0,101,108,108,105,112,115,105,115,0,0,0,0,0,0,0,0,65,103,114,97,118,101,0,0,65,116,105,108,100,101,0,0,79,116,105,108,100,101,0,0,79,69,0,0,0,0,0,0,111,101,0,0,0,0,0,0,101,110,100,97,115,104,0,0,101,109,100,97,115,104,0,0,113,117,111,116,101,100,98,108,108,101,102,116,0,0,0,0,113,117,111,116,101,100,98,108,114,105,103,104,116,0,0,0,113,117,111,116,101,108,101,102,116,0,0,0,0,0,0,0,113,117,111,116,101,114,105,103,104,116,0,0,0,0,0,0,100,105,118,105,100,101,0,0,108,111,122,101,110,103,101,0,121,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,89,100,105,101,114,101,115,105,115,0,0,0,0,0,0,0,102,114,97,99,116,105,111,110,0,0,0,0,0,0,0,0,99
|
||
|
/* memory initializer */ allocate([72,41,2,0,80,41,2,0,88,41,2,0,96,41,2,0,104,41,2,0,112,41,2,0,120,41,2,0,128,41,2,0,136,41,2,0,144,41,2,0,152,41,2,0,160,41,2,0,168,41,2,0,248,11,2,0,176,41,2,0,184,41,2,0,192,41,2,0,176,7,2,0,200,41,2,0,208,7,2,0,216,41,2,0,240,7,2,0,232,41,2,0,248,41,2,0,0,42,2,0,8,42,2,0,16,42,2,0,24,42,2,0,32,42,2,0,40,42,2,0,48,42,2,0,56,42,2,0,64,42,2,0,72,42,2,0,80,42,2,0,144,11,2,0,88,42,2,0,96,42,2,0,192,11,2,0,104,42,2,0,112,42,2,0,120,42,2,0,128,42,2,0,136,42,2,0,144,42,2,0,152,42,2,0,160,42,2,0,168,42,2,0,176,42,2,0,216,8,2,0,232,8,2,0,240,8,2,0,184,42,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,42,2,0,208,42,2,0,104,11,2,0,64,13,2,0,72,11,2,0,72,12,2,0,216,42,2,0,224,42,2,0,232,42,2,0,240,42,2,0,248,42,2,0,8,43,2,0,24,43,2,0,32,43,2,0,48,43,2,0,144,10,2,0,88,11,2,0,64,43,2,0,120,11,2,0,104,32,2,0,72,43,2,0,152,11,2,0,184,10,2,0,16,13,2,0,40,11,2,0,88,43,2,0,80,12,2,0,136,12,2,0,104,43,2,0,120,43,2,0,136,43,2,0,152,43,2,0,160,43,2,0,176,43,2,0,192,43,2,0,208,43,2,0,224,43,2,0,240,43,2,0,0,44,2,0,16,44,2,0,24,44,2,0,40,44,2,0,56,44,2,0,72,44,2,0,88,44,2,0,104,44,2,0,112,44,2,0,128,44,2,0,136,44,2,0,152,44,2,0,168,44,2,0,184,44,2,0,184,11,2,0,64,12,2,0,200,44,2,0,48,12,2,0,208,44,2,0,224,44,2,0,240,44,2,0,0,45,2,0,16,45,2,0,32,45,2,0,48,45,2,0,24,13,2,0,64,45,2,0,80,45,2,0,96,45,2,0,112,45,2,0,168,11,2,0,128,45,2,0,144,45,2,0,160,45,2,0,176,45,2,0,192,45,2,0,208,45,2,0,224,45,2,0,240,45,2,0,0,46,2,0,16,46,2,0,0,0,0,0,24,46,2,0,200,11,2,0,40,46,2,0,56,46,2,0,72,46,2,0,88,46,2,0,104,46,2,0,120,46,2,0,136,46,2,0,152,46,2,0,168,46,2,0,184,46,2,0,200,46,2,0,216,46,2,0,0,0,0,0,97,49,0,0,0,0,0,0,97,50,0,0,0,0,0,0,97,50,48,50,0,0,0,0,97,51,0,0,0,0,0,0,97,52,0,0,0,0,0,0,97,53,0,0,0,0,0,0,97,49,49,57,0,0,0,0,97,49,49,56,0,0,0,0,97,49,49,55,0,0,0,0,97,49,49,0,0,0,0,0,97,49,50,0,0,0,0,0,97,49,51,0,0,0,0,0,97,49,52,0,0,0,0,0,97,49,53,0,0,0,0,0,97,49,54,0,0,0,0,0,97,49,48,53,0,0,0,0,97,49,55,0,0,0,0,0,97,49,56,0,0,0,0,0,97,49,57,0,0,0,0,0,97,50,48,0,0,0,0,0,97,50,49,0,0,0,0,0,97,50,50,0,0,0,0,0,97,50,51,0,0,0,0,0,97,50,52,0,0,0,0,0,97,50,53,0,0,0,0,0,97,50,54,0,0,0,0,0,97,50,55,0,0,0,0,0,97,50,56,0,0,0,0,0,97,54,0,0,0,0,0,0,97,55,0,0,0,0,0,0,97,56,0,0,0,0,0,0,97,57,0,0,0,0,0,0,97,49,48,0,0,0,0,0,97,50,57,0,0,0,0,0,97,51,48,0,0,0,0,0,97,51,49,0,0,0,0,0,97,51,50,0,0,0,0,0,97,51,51,0,0,0,0,0,97,51,52,0,0,0,0,0,97,51,53,0,0,0,0,0,97,51,54,0,0,0,0,0,97,51,55,0,0,0,0,0,97,51,56,0,0,0,0,0,97,51,57,0,0,0,0,0,97,52,48,0,0,0,0,0,97,52,49,0,0,0,0,0,97,52,50,0,0,0,0,0,97,52,51,0,0,0,0,0,97,52,52,0,0,0,0,0,97,52,53,0,0,0,0,0,97,52,54,0,0,0,0,0,97,52,55,0,0,0,0,0,97,52,56,0,0,0,0,0,97,52,57,0,0,0,0,0,97,53,48,0,0,0,0,0,97,53,49,0,0,0,0,0,97,53,50,0,0,0,0,0,97,53,51,0,0,0,0,0,97,53,52,0,0,0,0,0,97,53,53,0,0,0,0,0,97,53,54,0,0,0,0,0,97,53,55,0,0,0,0,0,97,53,56,0,0,0,0,0,97,53,57,0,0,0,0,0,97,54,48,0,0,0,0,0,97,54,49,0,0,0,0,0,97,54,50,0,0,0,0,0,97,54,51,0,0,0,0,0,97,54,52,0,0,0,0,0,97,54,53,0,0,0,0,0,97,54,54,0,0,0,0,0,97,54,55,0,0,0,0,0,97,54,56,0,0,0,0,0,97,54,57,0,0,0,0,0,97,55,48,0,0,0,0,0,97,55,49,0,0,0,0,0,97,55,50,0,0,0,0,0,97,55,51,0,0,0,0,0,97,55,52,0,0,0,0,0,97,50,48,51,0,0,0,0,97,55,53,0,0,0,0,0,97,50,48,52,0,0,0,0,97,55,54,0,0,0,0,0,97,55,55,0,0,0,0,0,97,55,56,0,0,0,0,0,97,55,57,0,0,0,0,0,97,56,49,0,0,0,0,0,97,56,50,0,0,0,0,0,97,56,51,0,0,0,0,0,97,56,52,0,0,0,0,0,97,57,55,0,0,0,0,0,97,57,56,0,0,0,0,0,97,57,57,0,0,0,0,0,97,49,48,48,0,0,0,0,97,49,48,49,0,0,0,0,97,49,48,50,0,0,0,0,97,49,48,51,0,0,0,0,97,49,48,52,0,0,0,0,97,49,48,54,0,0,0,0,97,49,48,55,0,0,0,0,97,49,48,56,0,0,0,0,97,49,49,50,0,0,0,0,97,49,49,49,0,0,0,0,97,49,49,48,0,0,0,0,97,49,48,57,0,0,0,0,97,49,50,48,0,0,0,0,97,49,50,49,0,0,0,0,97,49,50,50,0,0,0,0,97,49,50,51,0,0,0,0,97,49,50,52,0,0,0,0,97,49,50,53,0,0,0,0,97,49,50,54,0,0,0,0,97,49,50,55,0,0,0,0,97,49,50,56,0,0,0,0,97,49,50,57,0,0,0,0,97,49,51,48,0,0,0,0,97,49,51
|
||
|
/* memory initializer */ allocate([64,0,0,0,0,0,0,0,84,109,0,0,6,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,84,114,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,84,115,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,84,119,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,84,122,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,0,0,0,0,0,0,87,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,0,0,0,87,42,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,98,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,98,42,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,0,0,0,0,0,99,0,0,0,6,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,0,0,0,0,99,109,0,0,6,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,0,0,0,0,0,0,99,115,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,100,0,0,0,2,0,0,0,5,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,100,48,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||
|
/* memory initializer */ allocate([88,142,2,0,136,141,2,0,112,142,2,0,184,141,2,0,144,142,2,0,184,141,2,0,176,142,2,0,136,141,2,0,200,142,2,0,232,141,2,0,224,142,2,0,232,141,2,0,0,143,2,0,96,141,2,0,24,143,2,0,136,141,2,0,48,143,2,0,184,141,2,0,80,143,2,0,232,141,2,0,70,111,110,116,77,97,116,114,105,120,0,0,0,0,0,0,67,104,97,114,80,114,111,99,115,0,0,0,0,0,0,0,77,105,115,115,105,110,103,32,111,114,32,105,110,118,97,108,105,100,32,67,104,97,114,80,114,111,99,115,32,100,105,99,116,105,111,110,97,114,121,32,105,110,32,84,121,112,101,32,51,32,102,111,110,116,0,0,82,101,115,111,117,114,99,101,115,0,0,0,0,0,0,0,69,110,99,111,100,105,110,103,0,0,0,0,0,0,0,0,66,97,115,101,69,110,99,111,100,105,110,103,0,0,0,0,77,97,99,82,111,109,97,110,69,110,99,111,100,105,110,103,0,0,0,0,0,0,0,0,77,97,99,69,120,112,101,114,116,69,110,99,111,100,105,110,103,0,0,0,0,0,0,0,87,105,110,65,110,115,105,69,110,99,111,100,105,110,103,0,68,105,102,102,101,114,101,110,99,101,115,0,0,0,0,0,87,114,111,110,103,32,116,121,112,101,32,105,110,32,102,111,110,116,32,101,110,99,111,100,105,110,103,32,114,101,115,111,117,114,99,101,32,100,105,102,102,101,114,101,110,99,101,115,32,40,37,115,41,0,0,0,46,110,111,116,100,101,102,0,70,105,114,115,116,67,104,97,114,0,0,0,0,0,0,0,76,97,115,116,67,104,97,114,0,0,0,0,0,0,0,0,87,105,100,116,104,115,0,0,115,112,97,99,101,0,0,0,0,0,0,0,32,137,2,0,106,0,0,0,107,0,0,0,108,0,0,0,2,0,0,0,164,0,0,0,165,0,0,0,68,101,115,99,101,110,100,97,110,116,70,111,110,116,115,0,77,105,115,115,105,110,103,32,68,101,115,99,101,110,100,97,110,116,70,111,110,116,115,32,101,110,116,114,121,32,105,110,32,84,121,112,101,32,48,32,102,111,110,116,0,0,0,0,66,97,100,32,100,101,115,99,101,110,100,97,110,116,32,102,111,110,116,32,105,110,32,84,121,112,101,32,48,32,102,111,110,116,0,0,0,0,0,0,77,105,115,115,105,110,103,32,83,117,98,116,121,112,101,32,101,110,116,114,121,32,105,110,32,84,121,112,101,32,48,32,100,101,115,99,101,110,100,97,110,116,32,102,111,110,116,0,67,73,68,70,111,110,116,84,121,112,101,48,0,0,0,0,67,73,68,70,111,110,116,84,121,112,101,50,0,0,0,0,85,110,107,110,111,119,110,32,84,121,112,101,32,48,32,100,101,115,99,101,110,100,97,110,116,32,102,111,110,116,32,116,121,112,101,32,39,37,115,39,0,0,0,0,0,0,0,0,67,73,68,83,121,115,116,101,109,73,110,102,111,0,0,0,77,105,115,115,105,110,103,32,67,73,68,83,121,115,116,101,109,73,110,102,111,32,100,105,99,116,105,111,110,97,114,121,32,105,110,32,84,121,112,101,32,48,32,100,101,115,99,101,110,100,97,110,116,32,102,111,110,116,0,0,0,0,0,0,82,101,103,105,115,116,114,121,0,0,0,0,0,0,0,0,79,114,100,101,114,105,110,103,0,0,0,0,0,0,0,0,73,110,118,97,108,105,100,32,67,73,68,83,121,115,116,101,109,73,110,102,111,32,100,105,99,116,105,111,110,97,114,121,32,105,110,32,84,121,112,101,32,48,32,100,101,115,99,101,110,100,97,110,116,32,102,111,110,116,0,0,0,0,0,0,65,100,111,98,101,45,73,100,101,110,116,105,116,121,0,0,65,100,111,98,101,45,85,67,83,0,0,0,0,0,0,0,240,131,2,0,0,132,2,0,16,132,2,0,32,132,2,0,48,132,2,0,0,0,0,0,65,100,111,98,101,45,67,78,83,49,0,0,0,0,0,0,65,100,111,98,101,45,71,66,49,0,0,0,0,0,0,0,65,100,111,98,101,45,74,97,112,97,110,49,0,0,0,0,65,100,111,98,101,45,74,97,112,97,110,50,0,0,0,0,65,100,111,98,101,45,75,111,114,101,97,49,0,0,0,0,77,105,115,115,105,110,103,32,108,97,110,103,117,97,103,101,32,112,97,99,107,32,102,111,114,32,39,37,115,39,32,109,97,112,112,105,110,103,0,0,85,110,107,110,111,119,110,32,99,104,97,114,97,99,116,101,114,32,99,111,108,108,101,99,116,105,111,110,32,39,37,115,39,0,0,0,0,0,0,0,67,77,97,112,78,97,109,101,0,0,0,0,0,0,0,0,77,105,115,115,105,110,103,32,111,114,32,105,110,118,97,108,105,100,32,69,110,99,111,100,105,110,103,32,101,110,116,114,121,32,105,110,32,84,121,112,101,32,48,32,102,111,110,116,0,0,0,0,0,0,0,0,85,110,107,110,111,119,110,32,67,77,97,112,32,39,37,115,39,32,102,111,114,32,99,104,97,114,97,99,116,101,114,32,99,111,108,108,101,99,116,105,111,110,32,39,37,115,39,0,67,73,68,84,111,71,73,68,77,97,112,0,0,0,0,0,73,100,101,110,116,105,116,121,0,0,0,0,0,0,0,0,73,110,118,97,108,105,100,32,67,73,68,84,111,71,73,68,77,97,112,32,101,110,116,114,121,32,105,110,32,6
|
||
|
/* memory initializer */ allocate([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,0,29,0,8,0,29,0,8,0,30,0,8,0,30,0,8,0,45,0,8,0,45,0,8,0,46,0,8,0,46,0,7,0,22,0,7,0,22,0,7,0,22,0,7,0,22,0,7,0,23,0,7,0,23,0,7,0,23,0,7,0,23,0,8,0,47,0,8,0,47,0,8,0,48,0,8,0,48,0,6,0,13,0,6,0,13,0,6,0,13,0,6,0,13,0,6,0,13,0,6,0,13,0,6,0,13,0,6,0,13,0,7,0,20,0,7,0,20,0,7,0,20,0,7,0,20,0,8,0,33,0,8,0,33,0,8,0,34,0,8,0,34,0,8,0,35,0,8,0,35,0,8,0,36,0,8,0,36,0,8,0,37,0,8,0,37,0,8,0,38,0,8,0,38,0,7,0,19,0,7,0,19,0,7,0,19,0,7,0,19,0,8,0,31,0,8,0,31,0,8,0,32,0,8,0,32,0,6,0,1,0,6,0,1,0,6,0,1,0,6,0,1,0,6,0,1,0,6,0,1,0,6,0,1,0,6,0,1,0,6,0,12,0,6,0,12,0,6,0,12,0,6,0,12,0,6,0,12,0,6,0,12,0,6,0,12,0,6,0,12,0,8,0,53,0,8,0,53,0,8,0,54,0,8,0,54,0,7,0,26,0,7,0,26,0,7,0,26,0,7,0,26,0,8,0,39,0,8,0,39,0,8,0,40,0,8,0,40,0,8,0,41,0,8,0,41,0,8,0,42,0,8,0,42,0,8,0,43,0,8,0,43,0,8,0,44,0,8,0,44,0,7,0,21,0,7,0,21,0,7,0,21,0,7,0,21,0,7,0,28,0,7,0,28,0,7,0,28,0,7,0,28,0,8,0,61,0,8,0,61,0,8,0,62,0,8,0,62,0,8,0,63,0,8,0,63,0,8,0,0,0,8,0,0,0,8,0,64,1,8,0,64,1,8,0,128,1,8,0,128,1,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,10,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,5,0,11,0,7,0,27,0,7,0,27,0,7,0,27,0,7,0,27,0,8,0,59,0,8,0,59,0,8,0,60,0,8,0,60,0,9,0,192,5,9,0,0,6,9,0,64,6,9,0,192,6,7,0,18,0,7,0,18,0,7,0,18,0,7,0,18,0,7,0,24,0,7,0,24,0,7,0,24,0,7,0,24,0,8,0,49,0,8,0,49,0,8,0,50,0,8,0,50,0,8,0,51,0,8,0,51,0,8,0,52,0,8,0,52,0,7,0,25,0,7,0,25,0,7,0,25,0,7,0,25,0,8,0,55,0,8,0,55,0,8,0,56,0,8,0,56,0,8,0,57,0,8,0,57,0,8,0,58,0,8,0,58,0,6,0,192,0,6,0,192,0,6,0,192,0,6,0,192,0,6,0,192,0,6,0,192,0,6,0,192,0,6,0,192,0,6,0,128,6,6,0,128,6,6,0,128,6,6,0,128,6,6,0,128,6,6,0,128,6,6,0,128,6,6,0,128,6,8,0,192,1,8,0,192,1,8,0,0,2,8,0,0,2,9,0,192,2,9,0,0,3,8,0,128,2,8,0,128,2,8,0,64,2,8,0,64,2,9,0,64,3,9,0,128,3,9,0,192,3,9,0,0,4,9,0,64,4,9,0,128,4,9,0,192,4,9,0,0,5,9,0,64,5,9,0,128,5,7,0,0,1,7,0,0,1,7,0,0,1,7,0,0,1,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,2,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,4,0,3,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,128,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,8,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,5,0,9,0,6,0,16,0,6,0,16,0,6,0,16,0,6,0,16,0,6,0,16,0,6,0,16,0,6,0,16,0,6,0,16,0,6,0,17,0,6,0,17,0,6,0,17,0,6,0,17,0,6,0,17,0,6,0,17,0,6,0,17,0,6,0,17,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,4,0,5,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,14,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,6,0,15,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,5,0,64,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,0,4,0,6,
|
||
|
/* memory initializer */ allocate([7,0,0,0,8,0,0,0,4,0,0,0,8,0,0,0,8,0,0,0,4,0,0,0,8,0,0,0,3,0,0,0,5,0,0,0,1,0,0,0,3,0,0,0,6,0,0,0,4,0,0,0,3,0,0,0,6,0,0,0,7,0,0,0,3,0,0,0,6,0,0,0,8,0,0,0,3,0,0,0,6,0,0,0,8,0,0,0,7,0,0,0,7,0,0,0,2,0,0,0,7,0,0,0,7,0,0,0,5,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,7,0,0,0,2,0,0,0,8,0,0,0,7,0,0,0,5,0,0,0,8,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,7,0,0,0,8,0,0,0,4,0,0,0,8,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,5,0,0,0,4,0,0,0,8,0,0,0,7,0,0,0,4,0,0,0,8,0,0,0,8,0,0,0,4,0,0,0,8,0,0,0,8,0,0,0,7,0,0,0,8,0,0,0,2,0,0,0,7,0,0,0,8,0,0,0,5,0,0,0,7,0,0,0,8,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,2,0,0,0,8,0,0,0,8,0,0,0,5,0,0,0,8,0,0,0,8,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,13,0,0,0,1,0,0,0,13,0,0,0,1,0,0,0,12,0,0,0,1,0,0,0,11,0,0,0,1,0,0,0,11,0,0,0,1,0,0,0,13,0,0,0,1,0,0,0,13,0,0,0,1,0,0,0,12,0,0,0,1,0,0,0,11,0,0,0,1,0,0,0,11,0,0,0,1,0,0,0,10,0,0,0,1,0,0,0,10,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,74,80,88,32,115,116,114,101,97,109,32,99,111,110,116,97,105,110,115,32,97,32,98,111,120,32,108,97,114,103,101,114,32,116,104,97,110,32,50,94,51,50,32,98,121,116,101,115,0,0,0,0,0,0,0,0,57,74,80,88,83,116,114,101,97,109,0,0,0,0,0,0,128,113,4,0,240,210,2,0,200,188,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,97,100,108,121,32,102,111,114,109,97,116,116,101,100,32,110,117,109,98,101,114,0,0,85,110,116,101,114,109,105,110,97,116,101,100,32,115,116,114,105,110,103,0,0,0,0,0,73,108,108,101,103,97,108,32,100,105,103,105,116,32,105,110,32,104,101,120,32,99,104,97,114,32,105,110,32,110,97,109,101,0,0,0,0,0,0,0,87,97,114,110,105,110,103,58,32,110,97,109,101,32,116,111,107,101,110,32,105,115,32,108,111,110,103,101,114,32,116,104,97,110,32,119,104,97,116,32,116,104,101,32,115,112,101,99,105,102,105,99,97,116,105,111,110,32,115,97,121,115,32,105,116,32,99,97,110,32,98,101,0,0,0,0,0,0,0,0,78,97,109,101,32,116,111,107,101,110,32,116,111,111,32,108,111,110,103,0,0,0,0,0,85,110,116,101,114,109,105,110,97,116,101,100,32,104,101,120,32,115,116,114,105,110,103,0,73,108,108,101,103,97,108,32,99,104,97,114,97,99,116,101,114,32,60,37,48,50,120,62,32,105,110,32,104,101,120,32,115,116,114,105,110,103,0,0,73,108,108,101,103,97,108,32,99,104,97,114,97,99,116,101,114,32,39,62,39,0,0,0,73,108,108,101,103,97,108,32,99,104,97,114,97,99,116,101,114,32,39,37,99,39,0,0,67,111,109,109,97,110,100,32,116,111,107,101,110,32,116,111,111,32,108,111,110,103,0,0,116,114,117,101,0,0,0,0,102,97,108,115,101,0,0,0,110,117,108,108,0,0,0,0,67,97,108,108,32,116,111,32,79,98,106,101,99,116,32,119,104,101,114,101,32,116,104,101,32,111,98,106,101,99,116,32,119,97,115,32,116,121,112,101,32,37,100,44,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,116,121,112,101,32,37,100,0,0,0,111,98,106,0,0,0,0,0,76,105,110,101,97,114,105,122,101,100,0,0,0,0,0,0,76,0,0,0,0,0,0,0,76,101,110,103,116,104,32,105,110,32,108,105,110,101,97,114,105,122,97,116,105,111,110,32,116,97,98,108,101,32,105,115,32,105,110,118,97,108,105,100,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,105,110,116,115,32,116,97,98,108,101,32,111,102,102,115,101,116,32,105,110,32,108,105,110,101,97,114,105,122,97,116,105,111,110,32,116,97,98,108,101,32,105,115,32,105,110,118,97,108,105,100,0,0,0,0,72,105,110,116,115,32,116,97,98,108,101,32,108,101,110,103,116,104,32,105,110,32,108,105,110,101,97,114,105,122,97,116,105,1
|
||
|
/* memory initializer */ allocate([120,244,2,0,0,0,0,0,128,244,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,244,2,0,152,244,2,0,160,244,2,0,168,244,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,244,2,0,0,0,0,0,0,0,0,0,0,0,0,0,192,244,2,0,0,0,0,0,0,0,0,0,208,244,2,0,216,244,2,0,224,244,2,0,232,244,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,120,99,108,97,109,115,109,97,108,108,0,0,0,0,0,72,117,110,103,97,114,117,109,108,97,117,116,115,109,97,108,108,0,0,0,0,0,0,0,100,111,108,108,97,114,111,108,100,115,116,121,108,101,0,0,100,111,108,108,97,114,115,117,112,101,114,105,111,114,0,0,97,109,112,101,114,115,97,110,100,115,109,97,108,108,0,0,65,99,117,116,101,115,109,97,108,108,0,0,0,0,0,0,112,97,114,101,110,108,101,102,116,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,112,97,114,101,110,114,105,103,104,116,115,117,112,101,114,105,111,114,0,0,0,0,0,0,116,119,111,100,111,116,101,110,108,101,97,100,101,114,0,0,111,110,101,100,111,116,101,110,108,101,97,100,101,114,0,0,122,101,114,111,111,108,100,115,116,121,108,101,0,0,0,0,111,110,101,111,108,100,115,116,121,108,101,0,0,0,0,0,116,119,111,111,108,100,115,116,121,108,101,0,0,0,0,0,116,104,114,101,101,111,108,100,115,116,121,108,101,0,0,0,102,111,117,114,111,108,100,115,116,121,108,101,0,0,0,0,102,105,118,101,111,108,100,115,116,121,108,101,0,0,0,0,115,105,120,111,108,100,115,116,121,108,101,0,0,0,0,0,115,101,118,101,110,111,108,100,115,116,121,108,101,0,0,0,101,105,103,104,116,111,108,100,115,116,121,108,101,0,0,0,110,105,110,101,111,108,100,115,116,121,108,101,0,0,0,0,99,111,109,109,97,115,117,112,101,114,105,111,114,0,0,0,116,104,114,101,101,113,117,97,114,116,101,114,115,101,109,100,97,115,104,0,0,0,0,0,112,101,114,105,111,100,115,117,112,101,114,105,111,114,0,0,113,117,101,115,116,105,111,110,115,109,97,108,108,0,0,0,97,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,98,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,99,101,110,116,115,117,112,101,114,105,111,114,0,0,0,0,100,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,101,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,105,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,108,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,109,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,110,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,111,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,114,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,115,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,116,115,117,112,101,114,105,111,114,0,0,0,0,0,0,0,102,102,0,0,0,0,0,0,102,102,105,0,0,0,0,0,102,102,108,0,0,0,0,0,112,97,114,101,110,108,101,102,116,105,110,102,101,114,105,111,114,0,0,0,0,0,0,0,112,97,114,101,110,114,105,103,104,116,105,110,102,101,114,105,111,114,0,0,0,0,0,0,67,105,114,99,117,109,102,108,101,120,115,109,97,108,108,0,104,121,112,104,101,110,115,117,112,101,114,105,111,114,0,0,71,114,97,118,101,115,109,97,108,108,0,0,0,0,0,0,65,115,109,97,108,108,0,0,66,115,109,97,108,108,0,0,67,115,109,97,108,108,0,0,68,115,109,97,108,108,0,0,69,115,109,97,108,108,0,0,70,115,109,97,108,108,0,0,71,115,109,97,108,108,0,0,72,115,109,97,108,108,0,0,73,115,109,97,108,108,0,0,74,115,109,97,108,108,0,0,75,115,109,97,108,108,0,0,76,115,109,97,108,108,0,0,77,115,109,97,108,108,0,0,78,115,109,97,108,108,0,0,79,115,109,97,108,108,0,0,80,115,109,97,108,108,0,0,81,115,109,97,108,108,0,0,82,115,109,97,108,108,0,0,83,115,109,97,108,108,0,0,84,115,109,97,108,108,0,0,85,115,109,97,108,108,0,0,86,115,109,97,108,108,0,0,87,115,109,97,108,108,0,0,88,115,109,97,108,108,0,0,89,115,109,97,108,108,0,0,90,115,109,97,108,108,0,0,99,111,108,111,110,109,111,110,101,116,97,114,121,0,0,0,111,110,101,102,105,116,116,101,100,0,0,0,0,0,0,0,114,117,112,105,97,104,0,0,84,105,108,100,101,115,109,97,108,108,0,0,0,0,0,0,101,120,99,108,97,109,100,111,119,110,115,109,97,108,108,0,99,101,110,116,111,108,100,115,116,121,108,101,0,0,0,0,76,115,108,97,115,104,115,109,97,108,108,0,0,0,0,0,83,99,97,114,111,110,115,109,97,108,108,0,0,0,0,0,90,99,97,114,111,110,115,109,97,108,108,0,0,0,0,0,68,105,101,114,101,115,105,115,115,109,97,108,108,0,0,0,66,114,101,118,101,115,109,97,108,108,0,0,0,0,0,0,67,97,114,111,110,115,109,97,108,
|
||
|
/* memory initializer */ allocate([108,116,0,0,0,0,0,0,109,111,100,0,0,0,0,0,109,117,108,0,0,0,0,0,110,101,0,0,0,0,0,0,110,101,103,0,0,0,0,0,110,111,116,0,0,0,0,0,111,114,0,0,0,0,0,0,112,111,112,0,0,0,0,0,114,111,108,108,0,0,0,0,114,111,117,110,100,0,0,0,115,105,110,0,0,0,0,0,115,113,114,116,0,0,0,0,115,117,98,0,0,0,0,0,116,114,117,101,0,0,0,0,116,114,117,110,99,97,116,101,0,0,0,0,0,0,0,0,120,111,114,0,0,0,0,0,0,0,0,0,56,33,3,0,6,1,0,0,7,1,0,0,23,0,0,0,0,0,0,0,50,49,80,111,115,116,83,99,114,105,112,116,70,117,110,99,116,105,111,110,75,101,121,0,128,113,4,0,32,33,3,0,88,235,2,0,0,0,0,0,0,0,0,0,120,33,3,0,8,1,0,0,9,1,0,0,50,50,80,111,115,116,83,99,114,105,112,116,70,117,110,99,116,105,111,110,73,116,101,109,0,0,0,0,0,0,0,0,128,113,4,0,88,33,3,0,120,235,2,0,0,0,0,0,83,116,97,99,107,32,111,118,101,114,102,108,111,119,32,105,110,32,80,111,115,116,83,99,114,105,112,116,32,102,117,110,99,116,105,111,110,0,0,0,67,97,108,108,32,116,111,32,79,98,106,101,99,116,32,119,104,101,114,101,32,116,104,101,32,111,98,106,101,99,116,32,119,97,115,32,116,121,112,101,32,37,100,44,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,116,121,112,101,32,37,100,0,0,0,67,97,108,108,32,116,111,32,79,98,106,101,99,116,32,119,104,101,114,101,32,116,104,101,32,111,98,106,101,99,116,32,119,97,115,32,116,121,112,101,32,37,100,44,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,116,121,112,101,32,37,100,32,111,114,32,37,100,0,0,0,0,0,0,0,1,86,0,0,1,52,0,0,1,24,0,0,193,10,0,0,33,5,0,0,33,2,0,0,1,86,0,0,1,84,0,0,1,72,0,0,1,56,0,0,1,48,0,0,1,36,0,0,1,28,0,0,1,22,0,0,1,86,0,0,1,84,0,0,1,81,0,0,1,72,0,0,1,56,0,0,1,52,0,0,1,48,0,0,1,40,0,0,1,36,0,0,1,34,0,0,1,28,0,0,1,24,0,0,1,22,0,0,1,20,0,0,1,18,0,0,1,17,0,0,193,10,0,0,193,9,0,0,161,8,0,0,33,5,0,0,65,4,0,0,161,2,0,0,33,2,0,0,65,1,0,0,17,1,0,0,133,0,0,0,73,0,0,0,37,0,0,0,21,0,0,0,9,0,0,0,5,0,0,0,1,0,0,0,1,86,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,38,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,29,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,45,0,0,0,46,0,0,0,0,0,0,0,1,0,0,0,6,0,0,0,9,0,0,0,12,0,0,0,29,0,0,0,33,0,0,0,6,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,17,0,0,0,18,0,0,0,20,0,0,0,21,0,0,0,14,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,46,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,37,3,0,10,1,0,0,11,1,0,0,2,0,0,0,3,0,0,0,24,0,0,0,2,0,0,0,25,0,0,0,26,0,0,0,25,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,49,50,83,112,108,97,115,104,70,84,70,111,110,116,0,0,128,113,4,0,128,37,3,0,56,21,3,0,0,0,0,0,116,114,117,101,116,121,112,101,0,0,0,0,0,0,0,0,103,108,121,112,104,45,100,105,99,116,0,0,0,0,0,0,116,116,45,99,109,97,112,115,0,0,0,0,0,0,0,0,116,121,112,101,52,50,0,0,208,37,3,0,0,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,8,0,0,0,1,0,0,0,9,0,0,0,2,0,0,0,10,0,0,0,3,0,0,0,11,0,0,0,4,0,0,0,12,0,0,0,5,0,0,0,13,0,0,0,6,0,0,0,14,0,0,0,7,0,0,0,15,0,0,0,8,0,0,0,46,65,112,112,108,101,68,111,117,98,108,101,47,0,0,0,37,0,0,0,0,0,0,0,46,114,101,115,111,117,114,99,101,47,0,0,0,0,0,0,114,101,115,111,117,114,99,101,46,102,114,107,47,0,0,0,47,114,115,114,99,0,0,0,47,46,46,110,97,109,101,100,102,111,114,107,47,114,115,114,99,0,0,0,0,0,0,0,46,95,0,0,0,0,0,0,79,84,84,79,0,0,0,0,99,102,102,0,0,0,0,0,116,121,112,101,49,0,0,0,99,105,100,0,0,0,0,0,52,0,0
|
||
|
/* memory initializer */ allocate([129,9,136,9,143,9,150,9,157,9,164,9,171,9,178,9,185,9,192,9,199,9,206,9,213,9,220,9,227,9,234,9,241,9,248,9,255,9,6,10,13,10,20,10,27,10,34,10,41,10,55,10,65,10,72,10,83,10,99,10,112,10,124,10,136,10,148,10,162,10,173,10,184,10,199,10,211,10,222,10,237,10,249,10,3,11,16,11,34,11,44,11,57,11,69,11,82,11,91,11,101,11,114,11,127,11,140,11,152,11,166,11,180,11,193,11,206,11,218,11,230,11,244,11,1,12,14,12,26,12,40,12,54,12,67,12,80,12,95,12,110,12,124,12,136,12,148,12,165,12,177,12,192,12,203,12,211,12,225,12,237,12,249,12,10,13,25,13,37,13,49,13,66,13,81,13,90,13,102,13,114,13,126,13,143,13,155,13,170,13,178,13,190,13,202,13,214,13,231,13,246,13,2,14,13,14,28,14,36,14,44,14,52,14,60,14,66,14,71,14,76,14,82,14,89,14,97,14,103,14,0,0,253,0,0,0,6,0,5,1,11,1,18,1,27,1,38,1,45,1,53,1,246,2,74,1,84,1,95,1,104,1,109,1,115,1,122,1,129,1,135,1,140,1,144,1,148,1,154,1,159,1,164,1,168,1,174,1,180,1,185,1,191,1,201,1,206,1,212,1,220,1,229,1,232,1,234,1,236,1,238,1,240,1,242,1,244,1,246,1,248,1,250,1,252,1,254,1,0,2,2,2,4,2,6,2,8,2,10,2,12,2,14,2,16,2,18,2,20,2,22,2,24,2,26,2,28,2,40,2,50,2,63,2,75,2,211,3,96,2,98,2,100,2,102,2,104,2,106,2,108,2,110,2,112,2,114,2,116,2,118,2,120,2,122,2,124,2,126,2,128,2,130,2,132,2,134,2,136,2,138,2,140,2,142,2,144,2,146,2,148,2,158,2,162,2,173,2,95,5,112,5,125,5,134,5,206,5,232,5,26,6,67,6,96,6,74,6,86,6,109,6,103,6,116,6,125,6,154,6,132,6,144,6,161,6,190,6,168,6,180,6,197,6,204,6,233,6,211,6,223,6,240,6,254,6,27,7,5,7,17,7,71,3,239,4,195,2,200,2,229,2,113,3,103,3,136,4,22,5,66,5,173,4,217,3,7,4,23,0,62,4,84,4,32,0,195,4,41,0,51,0,218,2,170,4,64,0,76,0,86,0,94,0,97,0,65,4,94,4,106,0,107,4,126,4,198,3,184,2,159,4,112,0,222,2,120,0,132,0,15,3,162,3,177,3,138,0,105,5,118,5,249,5,91,4,133,4,64,3,55,4,2,3,148,3,86,2,63,1,222,4,155,0,41,7,50,6,209,2,237,2,29,3,43,3,58,3,61,3,78,3,88,3,120,3,135,3,186,3,83,5,141,5,76,5,153,5,163,5,170,5,177,5,189,5,199,5,213,5,220,5,163,0,242,5,7,6,14,6,36,6,110,4,223,3,234,3,240,3,247,3,253,3,16,4,21,4,29,4,42,4,49,4,77,4,119,4,0,6,247,6,60,6,51,7,229,4,183,4,39,5,43,6,34,7,205,4,246,4,33,5,43,5,147,4,10,5,52,5,187,4,211,4,252,4,169,0,175,0,182,0,189,0,200,0,209,0,218,0,225,0,232,0,239,0,246,0,0,0,0,0,148,3,0,0,169,3,0,0,21,34,0,0,173,0,0,0,201,2,0,0,188,3,0,0,25,34,0,0,160,0,0,0,26,2,0,0,27,2,0,0,68,101,108,116,97,0,79,109,101,103,97,0,102,114,97,99,116,105,111,110,0,104,121,112,104,101,110,0,109,97,99,114,111,110,0,109,117,0,112,101,114,105,111,100,99,101,110,116,101,114,101,100,0,115,112,97,99,101,0,84,99,111,109,109,97,97,99,99,101,110,116,0,116,99,111,109,109,97,97,99,99,101,110,116,0,0,0,0,0,0,0,0,6,0,0,0,12,0,0,0,21,0,0,0,28,0,0,0,35,0,0,0,38,0,0,0,53,0,0,0,59,0,0,0,72,0,0,0,0,52,0,106,2,167,3,63,4,220,6,125,9,143,10,23,11,137,12,199,14,246,15,87,16,233,17,219,18,104,19,88,22,110,23,32,23,71,24,77,27,156,29,73,31,247,32,107,32,222,33,55,34,154,35,218,53,84,59,196,68,6,75,183,83,178,88,135,93,242,101,165,109,185,111,55,117,254,123,73,130,238,138,206,145,31,153,182,156,189,163,249,178,221,193,17,197,99,199,240,204,27,204,155,210,100,65,143,0,65,0,140,0,175,0,193,1,15,1,147,1,233,1,251,2,7,2,40,2,57,2,82,2,91,2,128,2,136,2,154,69,131,0,198,0,150,0,158,0,167,225,227,245,244,101,128,1,252,237,225,227,242,239,110,128,1,226,243,237,225,236,108,128,247,230,225,227,245,244,101,129,0,193,0,185,243,237,225,236,108,128,247,225,226,242,229,246,101,134,1,2,0,213,0,221,0,232,0,243,0,251,1,7,225,227,245,244,101,128,30,174,227,249,242,233,236,236,233,99,128,4,208,228,239,244,226,229,236,239,119,128,30,182,231,242,225,246,101,128,30,176,232,239,239,235,225,226,239,246,101,128,30,178,244,233,236,228,101,128,30,180,99,4,1,25,1,32,1,121,1,137,225,242,239,110,128,1,205,233,242,99,2,1,40,1,45,236,101,128,36,182,245,237,230,236,229,120,134,0,194,1,66,1,74,1,85,1,93,1,105,1,113,225,227,245,244,101,128,30,164,228,239,244,226,229,236,239,119,128,30,172,231,242,225,246,101,128,30,166,232,239,239,235,225,226,239,246,101,128,30,168,243,237,225,236,108,128,247,226,244,233,236,228,101,128,30,170,245,244,101,129,246,201,1,129,243,237,225,236,108,128,247,180,249,24
|
||
|
/* memory initializer */ allocate([236,243,233,231,110,3,36,116,36,126,36,133,226,229,238,231,225,236,105,128,9,190,228,229,246,97,128,9,62,231,245,234,225,242,225,244,105,128,10,190,98,4,36,154,36,195,36,204,36,214,226,242,229,246,233,225,244,233,239,110,2,36,169,36,184,237,225,242,235,225,242,237,229,238,233,225,110,128,5,95,243,233,231,238,228,229,246,97,128,9,112,229,238,231,225,236,105,128,9,133,239,240,239,237,239,230,111,128,49,26,242,229,246,101,134,1,3,36,233,36,241,36,252,37,7,37,15,37,27,225,227,245,244,101,128,30,175,227,249,242,233,236,236,233,99,128,4,209,228,239,244,226,229,236,239,119,128,30,183,231,242,225,246,101,128,30,177,232,239,239,235,225,226,239,246,101,128,30,179,244,233,236,228,101,128,30,181,99,4,37,45,37,52,37,131,37,201,225,242,239,110,128,1,206,233,242,99,2,37,60,37,65,236,101,128,36,208,245,237,230,236,229,120,133,0,226,37,84,37,92,37,103,37,111,37,123,225,227,245,244,101,128,30,165,228,239,244,226,229,236,239,119,128,30,173,231,242,225,246,101,128,30,167,232,239,239,235,225,226,239,246,101,128,30,169,244,233,236,228,101,128,30,171,245,244,101,133,0,180,37,147,37,158,37,175,37,182,37,191,226,229,236,239,247,227,237,98,128,3,23,99,2,37,164,37,169,237,98,128,3,1,239,237,98,128,3,1,228,229,246,97,128,9,84,236,239,247,237,239,100,128,2,207,244,239,238,229,227,237,98,128,3,65,249,242,233,236,236,233,99,128,4,48,100,5,37,223,37,233,37,247,37,253,38,31,226,236,231,242,225,246,101,128,2,1,228,225,235,231,245,242,237,245,235,232,105,128,10,113,229,246,97,128,9,5,233,229,242,229,243,233,115,130,0,228,38,11,38,22,227,249,242,233,236,236,233,99,128,4,211,237,225,227,242,239,110,128,1,223,239,116,2,38,38,38,46,226,229,236,239,119,128,30,161,237,225,227,242,239,110,128,1,225,101,131,0,230,38,65,38,73,38,82,225,227,245,244,101,128,1,253,235,239,242,229,225,110,128,49,80,237,225,227,242,239,110,128,1,227,230,233,105,6,38,107,38,127,41,64,41,70,41,85,44,185,48,2,38,113,38,120,176,178,176,56,128,32,21,184,185,180,49,128,32,164,177,48,3,38,136,40,160,41,39,48,9,38,156,38,176,38,238,39,44,39,106,39,168,39,230,40,36,40,98,49,3,38,164,38,168,38,172,55,128,4,16,56,128,4,17,57,128,4,18,50,10,38,198,38,202,38,206,38,210,38,214,38,218,38,222,38,226,38,230,38,234,48,128,4,19,49,128,4,20,50,128,4,21,51,128,4,1,52,128,4,22,53,128,4,23,54,128,4,24,55,128,4,25,56,128,4,26,57,128,4,27,51,10,39,4,39,8,39,12,39,16,39,20,39,24,39,28,39,32,39,36,39,40,48,128,4,28,49,128,4,29,50,128,4,30,51,128,4,31,52,128,4,32,53,128,4,33,54,128,4,34,55,128,4,35,56,128,4,36,57,128,4,37,52,10,39,66,39,70,39,74,39,78,39,82,39,86,39,90,39,94,39,98,39,102,48,128,4,38,49,128,4,39,50,128,4,40,51,128,4,41,52,128,4,42,53,128,4,43,54,128,4,44,55,128,4,45,56,128,4,46,57,128,4,47,53,10,39,128,39,132,39,136,39,140,39,144,39,148,39,152,39,156,39,160,39,164,48,128,4,144,49,128,4,2,50,128,4,3,51,128,4,4,52,128,4,5,53,128,4,6,54,128,4,7,55,128,4,8,56,128,4,9,57,128,4,10,54,10,39,190,39,194,39,198,39,202,39,206,39,210,39,214,39,218,39,222,39,226,48,128,4,11,49,128,4,12,50,128,4,14,51,128,246,196,52,128,246,197,53,128,4,48,54,128,4,49,55,128,4,50,56,128,4,51,57,128,4,52,55,10,39,252,40,0,40,4,40,8,40,12,40,16,40,20,40,24,40,28,40,32,48,128,4,53,49,128,4,81,50,128,4,54,51,128,4,55,52,128,4,56,53,128,4,57,54,128,4,58,55,128,4,59,56,128,4,60,57,128,4,61,56,10,40,58,40,62,40,66,40,70,40,74,40,78,40,82,40,86,40,90,40,94,48,128,4,62,49,128,4,63,50,128,4,64,51,128,4,65,52,128,4,66,53,128,4,67,54,128,4,68,55,128,4,69,56,128,4,70,57,128,4,71,57,10,40,120,40,124,40,128,40,132,40,136,40,140,40,144,40,148,40,152,40,156,48,128,4,72,49,128,4,73,50,128,4,74,51,128,4,75,52,128,4,76,53,128,4,77,54,128,4,78,55,128,4,79,56,128,4,145,57,128,4,82,49,4,40,170,40,232,40,237,41,7,48,10,40,192,40,196,40,200,40,204,40,208,40,212,40,216,40,220,40,224,40,228,48,128,4,83,49,128,4,84,50,128,4,85,51,128,4,86,52,128,4,87,53,128,4,88,54,128,4,89,55,128,4,90,56,128,4,91,57,128,4,92,177,48,128,4,94,52,4,40,247,40,251,40,255,41,3,53,128,4,15,54,128,4,98,55,128,4,114,56,128,4,116,57,5,41,19,41,23,41,27,41,31,41,35,50,128,246,198,51,128,4,95,52,128,4,99,53,128,4,115,54,128,4,117,56,2,41,45,41,59,
|
||
|
/* memory initializer */ allocate([244,105,128,10,197,242,239,110,128,1,27,229,228,233,236,236,225,226,242,229,246,101,128,30,29,104,2,76,135,76,146,225,242,237,229,238,233,225,110,128,5,101,249,233,247,238,225,242,237,229,238,233,225,110,128,5,135,233,242,99,2,76,169,76,174,236,101,128,36,212,245,237,230,236,229,120,134,0,234,76,195,76,203,76,211,76,222,76,230,76,242,225,227,245,244,101,128,30,191,226,229,236,239,119,128,30,25,228,239,244,226,229,236,239,119,128,30,199,231,242,225,246,101,128,30,193,232,239,239,235,225,226,239,246,101,128,30,195,244,233,236,228,101,128,30,197,249,242,233,236,236,233,99,128,4,84,100,4,77,14,77,24,77,30,77,40,226,236,231,242,225,246,101,128,2,5,229,246,97,128,9,15,233,229,242,229,243,233,115,128,0,235,239,116,130,1,23,77,49,77,58,225,227,227,229,238,116,128,1,23,226,229,236,239,119,128,30,185,101,2,77,72,77,83,231,245,242,237,245,235,232,105,128,10,15,237,225,244,242,225,231,245,242,237,245,235,232,105,128,10,71,230,227,249,242,233,236,236,233,99,128,4,68,103,2,77,117,77,124,242,225,246,101,128,0,232,245,234,225,242,225,244,105,128,10,143,104,4,77,144,77,155,77,166,77,176,225,242,237,229,238,233,225,110,128,5,103,226,239,240,239,237,239,230,111,128,49,29,233,242,225,231,225,238,97,128,48,72,239,239,235,225,226,239,246,101,128,30,187,105,4,77,197,77,208,79,10,79,25,226,239,240,239,237,239,230,111,128,49,31,231,232,116,142,0,56,77,242,77,251,78,5,78,35,78,42,78,80,78,105,78,150,78,184,78,196,78,207,78,240,78,248,79,3,225,242,225,226,233,99,128,6,104,226,229,238,231,225,236,105,128,9,238,227,233,242,227,236,101,129,36,103,78,16,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,102,128,39,145,228,229,246,97,128,9,110,229,229,110,2,78,50,78,59,227,233,242,227,236,101,128,36,113,112,2,78,65,78,72,225,242,229,110,128,36,133,229,242,233,239,100,128,36,153,231,117,2,78,87,78,96,234,225,242,225,244,105,128,10,238,242,237,245,235,232,105,128,10,110,104,2,78,111,78,137,97,2,78,117,78,128,227,235,225,242,225,226,233,99,128,6,104,238,231,250,232,239,117,128,48,40,238,239,244,229,226,229,225,237,229,100,128,38,107,105,2,78,156,78,174,228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,128,50,39,238,230,229,242,233,239,114,128,32,136,237,239,238,239,243,240,225,227,101,128,255,24,239,236,228,243,244,249,236,101,128,247,56,112,2,78,213,78,220,225,242,229,110,128,36,123,229,114,2,78,227,78,233,233,239,100,128,36,143,243,233,225,110,128,6,248,242,239,237,225,110,128,33,119,243,245,240,229,242,233,239,114,128,32,120,244,232,225,105,128,14,88,238,246,229,242,244,229,228,226,242,229,246,101,128,2,7,239,244,233,230,233,229,228,227,249,242,233,236,236,233,99,128,4,101,107,2,79,49,79,73,225,244,225,235,225,238,97,129,48,168,79,61,232,225,236,230,247,233,228,244,104,128,255,116,111,2,79,79,79,94,238,235,225,242,231,245,242,237,245,235,232,105,128,10,116,242,229,225,110,128,49,84,108,3,79,109,79,120,79,181,227,249,242,233,236,236,233,99,128,4,59,101,2,79,126,79,133,237,229,238,116,128,34,8,246,229,110,3,79,143,79,152,79,173,227,233,242,227,236,101,128,36,106,112,2,79,158,79,165,225,242,229,110,128,36,126,229,242,233,239,100,128,36,146,242,239,237,225,110,128,33,122,236,233,240,243,233,115,129,32,38,79,192,246,229,242,244,233,227,225,108,128,34,238,109,5,79,215,79,243,79,254,80,18,80,29,225,227,242,239,110,130,1,19,79,227,79,235,225,227,245,244,101,128,30,23,231,242,225,246,101,128,30,21,227,249,242,233,236,236,233,99,128,4,60,228,225,243,104,129,32,20,80,7,246,229,242,244,233,227,225,108,128,254,49,239,238,239,243,240,225,227,101,128,255,69,112,2,80,35,80,55,232,225,243,233,243,237,225,242,235,225,242,237,229,238,233,225,110,128,5,91,244,249,243,229,116,128,34,5,110,6,80,77,80,88,80,99,80,143,80,175,80,190,226,239,240,239,237,239,230,111,128,49,35,227,249,242,233,236,236,233,99,128,4,61,100,2,80,105,80,124,225,243,104,129,32,19,80,113,246,229,242,244,233,227,225,108,128,254,50,229,243,227,229,238,228,229,242,227,249,242,233,236,236,233,99,128,4,163,103,130,1,75,80,151,80,162,226,239,240,239,237,239,230,111,128,49,37,232,229,227,249,242,233,236,236,233,99,128,4,165,232,239,239,235,227,249,242,233,
|
||
|
/* memory initializer */ allocate([235,239,242,229,225,110,128,50,14,227,233,242,227,236,229,235,239,242,229,225,110,128,50,96,235,239,242,229,225,110,128,49,49,240,225,242,229,238,235,239,242,229,225,110,128,50,0,243,233,239,243,235,239,242,229,225,110,128,49,51,234,229,227,249,242,233,236,236,233,99,128,4,92,108,2,116,183,116,194,233,238,229,226,229,236,239,119,128,30,53,243,241,245,225,242,101,128,51,152,109,3,116,211,116,225,116,236,227,245,226,229,228,243,241,245,225,242,101,128,51,166,239,238,239,243,240,225,227,101,128,255,75,243,241,245,225,242,229,228,243,241,245,225,242,101,128,51,162,111,5,117,8,117,34,117,72,117,84,117,98,104,2,117,14,117,24,233,242,225,231,225,238,97,128,48,83,237,243,241,245,225,242,101,128,51,192,235,97,2,117,41,117,49,233,244,232,225,105,128,14,1,244,225,235,225,238,97,129,48,179,117,60,232,225,236,230,247,233,228,244,104,128,255,122,239,240,239,243,241,245,225,242,101,128,51,30,240,240,225,227,249,242,233,236,236,233,99,128,4,129,114,2,117,104,117,124,229,225,238,243,244,225,238,228,225,242,228,243,249,237,226,239,108,128,50,127,239,238,233,243,227,237,98,128,3,67,240,97,2,117,141,117,147,242,229,110,128,36,166,243,241,245,225,242,101,128,51,170,243,233,227,249,242,233,236,236,233,99,128,4,111,116,2,117,175,117,184,243,241,245,225,242,101,128,51,207,245,242,238,229,100,128,2,158,117,2,117,198,117,209,232,233,242,225,231,225,238,97,128,48,79,235,225,244,225,235,225,238,97,129,48,175,117,222,232,225,236,230,247,233,228,244,104,128,255,120,246,243,241,245,225,242,101,128,51,184,247,243,241,245,225,242,101,128,51,190,108,146,0,108,118,38,120,65,120,94,120,160,120,198,121,94,121,103,121,119,121,143,121,161,122,23,122,64,122,199,122,207,122,240,122,249,123,1,123,63,97,7,118,54,118,64,118,71,118,78,118,103,118,119,120,53,226,229,238,231,225,236,105,128,9,178,227,245,244,101,128,1,58,228,229,246,97,128,9,50,231,117,2,118,85,118,94,234,225,242,225,244,105,128,10,178,242,237,245,235,232,105,128,10,50,235,235,232,225,238,231,249,225,239,244,232,225,105,128,14,69,109,10,118,141,119,80,119,97,119,135,119,149,119,168,119,184,119,204,119,224,119,247,97,2,118,147,119,72,236,229,102,4,118,159,118,173,119,9,119,26,230,233,238,225,236,225,242,225,226,233,99,128,254,252,232,225,237,250,97,2,118,183,118,224,225,226,239,246,101,2,118,193,118,207,230,233,238,225,236,225,242,225,226,233,99,128,254,248,233,243,239,236,225,244,229,228,225,242,225,226,233,99,128,254,247,226,229,236,239,119,2,118,234,118,248,230,233,238,225,236,225,242,225,226,233,99,128,254,250,233,243,239,236,225,244,229,228,225,242,225,226,233,99,128,254,249,233,243,239,236,225,244,229,228,225,242,225,226,233,99,128,254,251,237,225,228,228,225,225,226,239,246,101,2,119,41,119,55,230,233,238,225,236,225,242,225,226,233,99,128,254,246,233,243,239,236,225,244,229,228,225,242,225,226,233,99,128,254,245,242,225,226,233,99,128,6,68,226,228,97,129,3,187,119,88,243,244,242,239,235,101,128,1,155,229,100,130,5,220,119,106,119,126,228,225,231,229,243,104,129,251,60,119,117,232,229,226,242,229,119,128,251,60,232,229,226,242,229,119,128,5,220,230,233,238,225,236,225,242,225,226,233,99,128,254,222,232,225,232,233,238,233,244,233,225,236,225,242,225,226,233,99,128,252,202,233,238,233,244,233,225,236,225,242,225,226,233,99,128,254,223,234,229,229,237,233,238,233,244,233,225,236,225,242,225,226,233,99,128,252,201,235,232,225,232,233,238,233,244,233,225,236,225,242,225,226,233,99,128,252,203,236,225,237,232,229,232,233,243,239,236,225,244,229,228,225,242,225,226,233,99,128,253,242,237,101,2,119,254,120,11,228,233,225,236,225,242,225,226,233,99,128,254,224,229,109,2,120,18,120,37,232,225,232,233,238,233,244,233,225,236,225,242,225,226,233,99,128,253,136,233,238,233,244,233,225,236,225,242,225,226,233,99,128,252,204,242,231,229,227,233,242,227,236,101,128,37,239,98,3,120,73,120,78,120,84,225,114,128,1,154,229,236,116,128,2,108,239,240,239,237,239,230,111,128,49,12,99,4,120,104,120,111,120,120,120,147,225,242,239,110,128,1,62,229,228,233,236,236,97,128,1,60,233,242,99,2,120,128,120,133,236,101,128,36,219,245,237,230,236,229,248,226,229,236,239,119,128,30,61,239,237
|
||
|
/* memory initializer */ allocate([29,236,229,230,116,129,32,24,156,114,242,229,246,229,242,243,229,100,128,32,27,114,2,156,131,156,141,229,246,229,242,243,229,100,128,32,27,233,231,232,116,129,32,25,156,150,110,128,1,73,243,233,238,231,108,2,156,164,156,171,226,225,243,101,128,32,26,101,129,0,39,156,177,237,239,238,239,243,240,225,227,101,128,255,7,114,145,0,114,156,227,157,231,157,242,158,33,158,84,159,101,159,125,159,220,161,254,162,35,162,47,162,101,162,109,163,15,163,26,163,61,163,161,97,11,156,251,157,6,157,16,157,23,157,88,157,104,157,129,157,140,157,165,157,188,157,225,225,242,237,229,238,233,225,110,128,5,124,226,229,238,231,225,236,105,128,9,176,227,245,244,101,128,1,85,100,4,157,33,157,39,157,53,157,79,229,246,97,128,9,48,233,227,225,108,129,34,26,157,48,229,120,128,248,229,239,246,229,242,243,243,241,245,225,242,101,129,51,174,157,69,228,243,241,245,225,242,101,128,51,175,243,241,245,225,242,101,128,51,173,230,101,129,5,191,157,95,232,229,226,242,229,119,128,5,191,231,117,2,157,111,157,120,234,225,242,225,244,105,128,10,176,242,237,245,235,232,105,128,10,48,232,233,242,225,231,225,238,97,128,48,137,235,225,244,225,235,225,238,97,129,48,233,157,153,232,225,236,230,247,233,228,244,104,128,255,151,236,239,247,229,242,228,233,225,231,239,238,225,236,226,229,238,231,225,236,105,128,9,241,109,2,157,194,157,217,233,228,228,236,229,228,233,225,231,239,238,225,236,226,229,238,231,225,236,105,128,9,240,243,232,239,242,110,128,2,100,244,233,111,128,34,54,226,239,240,239,237,239,230,111,128,49,22,99,4,157,252,158,3,158,12,158,20,225,242,239,110,128,1,89,229,228,233,236,236,97,128,1,87,233,242,227,236,101,128,36,225,239,237,237,225,225,227,227,229,238,116,128,1,87,100,2,158,39,158,49,226,236,231,242,225,246,101,128,2,17,239,116,2,158,56,158,65,225,227,227,229,238,116,128,30,89,226,229,236,239,119,129,30,91,158,75,237,225,227,242,239,110,128,30,93,101,6,158,98,158,143,158,178,158,233,159,2,159,35,102,2,158,104,158,117,229,242,229,238,227,229,237,225,242,107,128,32,59,236,229,248,243,117,2,158,127,158,134,226,243,229,116,128,34,134,240,229,242,243,229,116,128,34,135,231,233,243,244,229,114,2,158,154,158,159,229,100,128,0,174,115,2,158,165,158,171,225,238,115,128,248,232,229,242,233,102,128,246,218,104,3,158,186,158,209,158,223,225,114,2,158,193,158,200,225,226,233,99,128,6,49,237,229,238,233,225,110,128,5,128,230,233,238,225,236,225,242,225,226,233,99,128,254,174,233,242,225,231,225,238,97,128,48,140,235,225,244,225,235,225,238,97,129,48,236,158,246,232,225,236,230,247,233,228,244,104,128,255,154,243,104,130,5,232,159,11,159,26,228,225,231,229,243,232,232,229,226,242,229,119,128,251,72,232,229,226,242,229,119,128,5,232,118,3,159,43,159,56,159,88,229,242,243,229,228,244,233,236,228,101,128,34,61,233,97,2,159,63,159,72,232,229,226,242,229,119,128,5,151,237,245,231,242,225,243,232,232,229,226,242,229,119,128,5,151,236,239,231,233,227,225,236,238,239,116,128,35,16,230,233,243,232,232,239,239,107,129,2,126,159,114,242,229,246,229,242,243,229,100,128,2,127,104,2,159,131,159,154,97,2,159,137,159,147,226,229,238,231,225,236,105,128,9,221,228,229,246,97,128,9,93,111,131,3,193,159,164,159,193,159,207,239,107,129,2,125,159,171,244,245,242,238,229,100,129,2,123,159,182,243,245,240,229,242,233,239,114,128,2,181,243,249,237,226,239,236,231,242,229,229,107,128,3,241,244,233,227,232,239,239,235,237,239,100,128,2,222,105,6,159,234,161,22,161,68,161,79,161,104,161,240,229,245,108,9,160,0,160,35,160,50,160,64,160,110,160,124,160,210,160,223,161,2,97,2,160,6,160,21,227,233,242,227,236,229,235,239,242,229,225,110,128,50,113,240,225,242,229,238,235,239,242,229,225,110,128,50,17,227,233,242,227,236,229,235,239,242,229,225,110,128,50,99,232,233,229,245,232,235,239,242,229,225,110,128,49,64,107,2,160,70,160,102,233,249,229,239,107,2,160,80,160,89,235,239,242,229,225,110,128,49,58,243,233,239,243,235,239,242,229,225,110,128,49,105,239,242,229,225,110,128,49,57,237,233,229,245,237,235,239,242,229,225,110,128,49,59,112,3,160,132,160,164,160,179,97,2,160,138,160,152,238,243,233,239,243,235,239,242,229,225,110,128,49,108,242,229,238,235,239,242,229,225
|
||
|
/* memory initializer */ allocate([235,225,244,225,235,225,238,97,129,48,165,196,117,232,225,236,230,247,233,228,244,104,128,255,105,244,242,225,233,231,232,116,2,196,141,196,152,227,249,242,233,236,236,233,99,128,4,175,243,244,242,239,235,229,227,249,242,233,236,236,233,99,128,4,177,244,233,236,228,101,130,1,105,196,181,196,189,225,227,245,244,101,128,30,121,226,229,236,239,119,128,30,117,117,5,196,209,196,219,196,226,196,251,197,11,226,229,238,231,225,236,105,128,9,138,228,229,246,97,128,9,10,231,117,2,196,233,196,242,234,225,242,225,244,105,128,10,138,242,237,245,235,232,105,128,10,10,237,225,244,242,225,231,245,242,237,245,235,232,105,128,10,66,246,239,247,229,236,243,233,231,110,3,197,27,197,37,197,44,226,229,238,231,225,236,105,128,9,194,228,229,246,97,128,9,66,231,245,234,225,242,225,244,105,128,10,194,246,239,247,229,236,243,233,231,110,3,197,71,197,81,197,88,226,229,238,231,225,236,105,128,9,193,228,229,246,97,128,9,65,231,245,234,225,242,225,244,105,128,10,193,118,139,0,118,197,125,198,17,198,26,198,37,198,222,198,229,199,71,199,83,199,183,199,191,199,212,97,4,197,135,197,142,197,167,197,178,228,229,246,97,128,9,53,231,117,2,197,149,197,158,234,225,242,225,244,105,128,10,181,242,237,245,235,232,105,128,10,53,235,225,244,225,235,225,238,97,128,48,247,118,132,5,213,197,190,197,217,197,249,198,5,228,225,231,229,243,104,130,251,53,197,203,197,208,182,53,128,251,53,232,229,226,242,229,119,128,251,53,104,2,197,223,197,231,229,226,242,229,119,128,5,213,239,236,225,109,129,251,75,197,240,232,229,226,242,229,119,128,251,75,246,225,246,232,229,226,242,229,119,128,5,240,249,239,228,232,229,226,242,229,119,128,5,241,227,233,242,227,236,101,128,36,229,228,239,244,226,229,236,239,119,128,30,127,101,6,198,51,198,62,198,126,198,137,198,143,198,210,227,249,242,233,236,236,233,99,128,4,50,104,4,198,72,198,81,198,95,198,111,225,242,225,226,233,99,128,6,164,230,233,238,225,236,225,242,225,226,233,99,128,251,107,233,238,233,244,233,225,236,225,242,225,226,233,99,128,251,108,237,229,228,233,225,236,225,242,225,226,233,99,128,251,109,235,225,244,225,235,225,238,97,128,48,249,238,245,115,128,38,64,242,244,233,227,225,108,2,198,154,198,160,226,225,114,128,0,124,236,233,238,101,4,198,173,198,184,198,195,198,204,225,226,239,246,229,227,237,98,128,3,13,226,229,236,239,247,227,237,98,128,3,41,236,239,247,237,239,100,128,2,204,237,239,100,128,2,200,247,225,242,237,229,238,233,225,110,128,5,126,232,239,239,107,128,2,139,105,3,198,237,198,248,199,31,235,225,244,225,235,225,238,97,128,48,248,242,225,237,97,3,199,3,199,13,199,20,226,229,238,231,225,236,105,128,9,205,228,229,246,97,128,9,77,231,245,234,225,242,225,244,105,128,10,205,243,225,242,231,97,3,199,43,199,53,199,60,226,229,238,231,225,236,105,128,9,131,228,229,246,97,128,9,3,231,245,234,225,242,225,244,105,128,10,131,237,239,238,239,243,240,225,227,101,128,255,86,111,3,199,91,199,102,199,172,225,242,237,229,238,233,225,110,128,5,120,233,227,229,100,2,199,111,199,147,233,244,229,242,225,244,233,239,110,2,199,125,199,136,232,233,242,225,231,225,238,97,128,48,158,235,225,244,225,235,225,238,97,128,48,254,237,225,242,235,235,225,238,97,129,48,155,199,160,232,225,236,230,247,233,228,244,104,128,255,158,235,225,244,225,235,225,238,97,128,48,250,240,225,242,229,110,128,36,177,116,2,199,197,199,204,233,236,228,101,128,30,125,245,242,238,229,100,128,2,140,117,2,199,218,199,229,232,233,242,225,231,225,238,97,128,48,148,235,225,244,225,235,225,238,97,128,48,244,119,143,0,119,200,18,200,251,201,5,201,28,201,68,201,135,201,143,203,114,203,155,203,167,203,242,203,250,204,1,204,12,204,21,97,8,200,36,200,43,200,53,200,64,200,102,200,134,200,146,200,182,227,245,244,101,128,30,131,229,235,239,242,229,225,110,128,49,89,232,233,242,225,231,225,238,97,128,48,143,107,2,200,70,200,94,225,244,225,235,225,238,97,129,48,239,200,82,232,225,236,230,247,233,228,244,104,128,255,156,239,242,229,225,110,128,49,88,243,237,225,236,108,2,200,112,200,123,232,233,242,225,231,225,238,97,128,48,142,235,225,244,225,235,225,238,97,128,48,238,244,244,239,243,241,245,225,242,101,128,51,87,118,2,200,152,200,160,229,228,225,243,1
|
||
|
/* memory initializer */ allocate([70,97,109,105,108,121,78,97,109,101,0,0,0,0,0,0,87,101,105,103,104,116,0,0,73,116,97,108,105,99,65,110,103,108,101,0,0,0,0,0,105,115,70,105,120,101,100,80,105,116,99,104,0,0,0,0,85,110,100,101,114,108,105,110,101,80,111,115,105,116,105,111,110,0,0,0,0,0,0,0,85,110,100,101,114,108,105,110,101,84,104,105,99,107,110,101,115,115,0,0,0,0,0,0,70,83,84,121,112,101,0,0,85,110,105,113,117,101,73,68,0,0,0,0,0,0,0,0,108,101,110,73,86,0,0,0,76,97,110,103,117,97,103,101,71,114,111,117,112,0,0,0,112,97,115,115,119,111,114,100,0,0,0,0,0,0,0,0,66,108,117,101,83,99,97,108,101,0,0,0,0,0,0,0,66,108,117,101,83,104,105,102,116,0,0,0,0,0,0,0,66,108,117,101,70,117,122,122,0,0,0,0,0,0,0,0,66,108,117,101,86,97,108,117,101,115,0,0,0,0,0,0,79,116,104,101,114,66,108,117,101,115,0,0,0,0,0,0,70,97,109,105,108,121,66,108,117,101,115,0,0,0,0,0,70,97,109,105,108,121,79,116,104,101,114,66,108,117,101,115,0,0,0,0,0,0,0,0,83,116,100,72,87,0,0,0,83,116,100,86,87,0,0,0,77,105,110,70,101,97,116,117,114,101,0,0,0,0,0,0,83,116,101,109,83,110,97,112,72,0,0,0,0,0,0,0,83,116,101,109,83,110,97,112,86,0,0,0,0,0,0,0,69,120,112,97,110,115,105,111,110,70,97,99,116,111,114,0,70,111,114,99,101,66,111,108,100,0,0,0,0,0,0,0,70,111,110,116,78,97,109,101,0,0,0,0,0,0,0,0,80,97,105,110,116,84,121,112,101,0,0,0,0,0,0,0,70,111,110,116,84,121,112,101,0,0,0,0,0,0,0,0,83,116,114,111,107,101,87,105,100,116,104,0,0,0,0,0,70,111,110,116,66,66,111,120,0,0,0,0,0,0,0,0,78,68,86,0,0,0,0,0,67,68,86,0,0,0,0,0,68,101,115,105,103,110,86,101,99,116,111,114,0,0,0,0,70,111,110,116,77,97,116,114,105,120,0,0,0,0,0,0,69,110,99,111,100,105,110,103,0,0,0,0,0,0,0,0,83,117,98,114,115,0,0,0,80,114,105,118,97,116,101,0,66,108,101,110,100,68,101,115,105,103,110,80,111,115,105,116,105,111,110,115,0,0,0,0,66,108,101,110,100,68,101,115,105,103,110,77,97,112,0,0,66,108,101,110,100,65,120,105,115,84,121,112,101,115,0,0,87,101,105,103,104,116,86,101,99,116,111,114,0,0,0,0,66,117,105,108,100,67,104,97,114,65,114,114,97,121,0,0,139,247,225,13,14,0,0,0,100,117,112,0,0,0,0,0,112,117,116,0,0,0,0,0,83,116,97,110,100,97,114,100,69,110,99,111,100,105,110,103,0,0,0,0,0,0,0,0,69,120,112,101,114,116,69,110,99,111,100,105,110,103,0,0,73,83,79,76,97,116,105,110,49,69,110,99,111,100,105,110,103,0,0,0,0,0,0,0,37,33,80,83,45,65,100,111,98,101,70,111,110,116,0,0,37,33,70,111,110,116,84,121,112,101,0,0,0,0,0,0,168,59,4,0,192,59,4,0,200,59,4,0,216,59,4,0,224,59,4,0,248,59,4,0,0,60,4,0,16,60,4,0,32,60,4,0,40,60,4,0,48,60,4,0,64,60,4,0,0,0,0,0,0,0,0,0,112,111,115,116,115,99,114,105,112,116,45,102,111,110,116,45,110,97,109,101,0,0,0,0,228,0,0,0,0,0,0,0,103,108,121,112,104,45,100,105,99,116,0,0,0,0,0,0,28,0,0,0,131,0,0,0,120,102,56,54,45,100,114,105,118,101,114,45,110,97,109,101,0,0,0,0,0,0,0,0,84,121,112,101,32,49,0,0,112,111,115,116,115,99,114,105,112,116,45,105,110,102,111,0,132,0,0,0,133,0,0,0,229,0,0,0,134,0,0,0,107,101,114,110,105,110,103,0,29,0,0,0,0,0,0,0,109,117,108,116,105,45,109,97,115,116,101,114,115,0,0,0,135,0,0,0,60,0,0,0,61,0,0,0,136,0,0,0,62,0,0,0,0,0,0,0,87,105,100,116,104,0,0,0,79,112,116,105,99,97,108,83,105,122,101,0,0,0,0,0,116,49,99,105,100,0,0,0,1,5,0,0,40,0,0,0,112,60,4,0,0,0,1,0,0,0,2,0,0,0,0,0,230,0,0,0,48,1,0,0,137,0,0,0,76,1,0,0,48,0,0,0,172,0,0,0,32,0,0,0,49,1,0,0,231,0,0,0,50,1,0,0,232,0,0,0,51,1,0,0,17,0,0,0,26,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,0,0,0,0,0,0,112,115,104,105,110,116,101,114,0,0,0,0,0,0,0,0,112,115,97,117,120,0,0,0,82,101,103,117,108,97,114,0,66,111,108,100,0,0,0,0,66,108,97,99,107,0,0,0,37,65,68,79,66,101,103,105,110,70,111,110,116,68,105,99,116,0,0,0,0,0,0,0,88,68,4,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,68,4,0,0,0,0,0,3,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,68,4,0,0,0,0,0,2,0,0,0,0,0,0,0,8,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,68,4,0,0,0,0,0,5,0,0,0,0,0,0,0,12,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,68,4,0,0,0,0,0,5,0,0,0,0,0,0,0,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,68,4,0,0,0,0,0,2,0,0,0,0,0,0,0,20,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,68,4,0,0,0,0,0,2,0,0,0,0,0,0,0,72,0,
|
||
|
/* memory initializer */ allocate([95,77,85,76,69,95,82,69,76,65,84,73,86,69,95,67,79,77,80,79,83,69,0,0,72,83,4,0,176,96,4,0,184,96,4,0,208,96,4,0,0,0,0,0,0,0,0,0,68,0,0,0,69,0,0,0,120,102,56,54,45,100,114,105,118,101,114,45,110,97,109,101,0,0,0,0,0,0,0,0,66,68,70,0,0,0,0,0,99,102,102,0,0,0,0,0,1,5,0,0,44,0,0,0,216,96,4,0,0,0,1,0,0,0,2,0,0,0,0,0,240,0,0,0,60,1,0,0,169,0,0,0,56,3,0,0,48,0,0,0,172,0,0,0,37,0,0,0,61,1,0,0,241,0,0,0,62,1,0,0,242,0,0,0,63,1,0,0,17,0,0,0,26,0,0,0,36,0,0,0,37,0,0,0,0,0,0,0,38,0,0,0,170,0,0,0,171,0,0,0,20,0,0,0,172,0,0,0,64,1,0,0,173,0,0,0,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,175,0,0,0,65,1,0,0,176,0,0,0,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,102,110,116,0,0,0,0,112,111,115,116,115,99,114,105,112,116,45,99,109,97,112,115,0,0,0,0,0,0,0,0,112,115,104,105,110,116,101,114,0,0,0,0,0,0,0,0,82,101,103,117,108,97,114,0,66,111,108,100,0,0,0,0,66,108,97,99,107,0,0,0,4,0,4,0,8,1,16,0,8,1,17,0,8,1,18,0,8,1,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0,31,0,32,0,33,0,34,0,35,0,36,0,37,0,38,0,39,0,40,0,41,0,42,0,43,0,44,0,45,0,46,0,47,0,48,0,49,0,50,0,51,0,52,0,53,0,54,0,55,0,56,0,57,0,58,0,59,0,60,0,61,0,62,0,63,0,64,0,65,0,66,0,67,0,68,0,69,0,70,0,71,0,72,0,73,0,74,0,75,0,76,0,77,0,78,0,79,0,80,0,81,0,82,0,83,0,84,0,85,0,86,0,87,0,88,0,89,0,90,0,91,0,92,0,93,0,94,0,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,97,0,98,0,99,0,100,0,101,0,102,0,103,0,104,0,105,0,106,0,107,0,108,0,109,0,110,0,0,0,111,0,112,0,113,0,114,0,0,0,115,0,116,0,117,0,118,0,119,0,120,0,121,0,122,0,0,0,123,0,0,0,124,0,125,0,126,0,127,0,128,0,129,0,130,0,131,0,0,0,132,0,133,0,0,0,134,0,135,0,136,0,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,0,0,139,0,0,0,0,0,0,0,0,0,140,0,141,0,142,0,143,0,0,0,0,0,0,0,0,0,0,0,144,0,0,0,0,0,0,0,145,0,0,0,0,0,146,0,147,0,148,0,149,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,229,0,230,0,0,0,231,0,232,0,233,0,234,0,235,0,236,0,237,0,238,0,13,0,14,0,15,0,99,0,239,0,240,0,241,0,242,0,243,0,244,0,245,0,246,0,247,0,248,0,27,0,28,0,249,0,250,0,251,0,252,0,0,0,253,0,254,0,255,0,0,1,1,1,0,0,0,0,0,0,2,1,0,0,0,0,3,1,4,1,5,1,6,1,0,0,0,0,7,1,8,1,9,1,0,0,10,1,109,0,110,0,11,1,12,1,13,1,0,0,14,1,15,1,16,1,17,1,18,1,19,1,20,1,21,1,22,1,23,1,24,1,25,1,26,1,27,1,28,1,29,1,30,1,31,1,32,1,33,1,34,1,35,1,36,1,37,1,38,1,39,1,40,1,41,1,42,1,43,1,44,1,45,1,46,1,47,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,1,49,1,50,1,0,0,0,0,51,1,52,1,53,1,54,1,55,1,0,0,56,1,0,0,0,0,56,1,0,0,0,0,58,1,59,1,0,0,0,0,60,1,61,1,62,1,0,0,0,0,0,0,158,0,155,0,163,0,63,1,64,1,65,1,66,1,67,1,68,1,69,1,0,0,0,0,70,1,150,0,164,0,169,0,71,1,72,1,73,1,74,1,75,1,76,1,77,1,78,1,79,1,80,1,81,1,82,1,83,1,84,1,85,1,86,1,87,1,88,1,89,1,90,1,91,1,92,1,93,1,94,1,95,1,96,1,97,1,98,1,99,1,100,1,101,1,102,1,103,1,104,1,105,1,106,1,107,1,108,1,109,1,110,1,111,1,112,1,113,1,114,1,115,1,116,1,117,1,118,1,119,1,120,1,121,1,122,1,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0,31,0,32,0,33,0,34,0,35,0,36,0,37,0,38,0,39,0,40,0,41,0,42,0,43,0,44,0,45,0,46,0,47,0,48,0,49,0,50,0,51,0,52,0,53,0,54,0,55,0,56,0,57,0,58,0,59,0,60,0,61,0,62,0,63,0,64,0,65,0,66,0,67,0,68,0,69,0,70,0,71,0,72,0,73,0,74,0,75,0,76,0,77,0,78,0,79,0,80,0,81,0,82,0,83,0,84,0,85,0,86,0,87,0,88,0,89,0,90,0,91,0,92,0,93,0,94,0,95,0,96,0,97,0,98,0,99,0,100,0,101,0,102,0,103,0,104,0,105,0,106,0,107,0,108,0,109,0,110,0,111,0,112,0,113,0,114,0,115,0,116,0,117,0,118,0,119,0,120,0,121,0,122,0,123,0,124,0,125,0,126,0,127,0,12
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
var tempDoublePtr = Runtime.alignMemory(allocate(12, "i8", ALLOC_STATIC), 8);
|
||
|
|
||
|
assert(tempDoublePtr % 8 == 0);
|
||
|
|
||
|
function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much
|
||
|
|
||
|
HEAP8[tempDoublePtr] = HEAP8[ptr];
|
||
|
|
||
|
HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
|
||
|
|
||
|
HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
|
||
|
|
||
|
HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
|
||
|
|
||
|
}
|
||
|
|
||
|
function copyTempDouble(ptr) {
|
||
|
|
||
|
HEAP8[tempDoublePtr] = HEAP8[ptr];
|
||
|
|
||
|
HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
|
||
|
|
||
|
HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
|
||
|
|
||
|
HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
|
||
|
|
||
|
HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];
|
||
|
|
||
|
HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];
|
||
|
|
||
|
HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];
|
||
|
|
||
|
HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
Module["_tolower"] = _tolower;
|
||
|
Module["_strncasecmp"] = _strncasecmp;
|
||
|
|
||
|
function _FcPatternGetInteger() {
|
||
|
Module['printErr']('missing function: FcPatternGetInteger'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _DtoILow=true;
|
||
|
|
||
|
var _UItoD=true;
|
||
|
|
||
|
function _rand() {
|
||
|
return Math.floor(Math.random()*0x80000000);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};
|
||
|
|
||
|
var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};
|
||
|
|
||
|
|
||
|
var ___errno_state=0;function ___setErrNo(value) {
|
||
|
// For convenient setting and returning of errno.
|
||
|
HEAP32[((___errno_state)>>2)]=value;
|
||
|
return value;
|
||
|
}
|
||
|
|
||
|
var PATH={splitPath:function (filename) {
|
||
|
var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
||
|
return splitPathRe.exec(filename).slice(1);
|
||
|
},normalizeArray:function (parts, allowAboveRoot) {
|
||
|
// if the path tries to go above the root, `up` ends up > 0
|
||
|
var up = 0;
|
||
|
for (var i = parts.length - 1; i >= 0; i--) {
|
||
|
var last = parts[i];
|
||
|
if (last === '.') {
|
||
|
parts.splice(i, 1);
|
||
|
} else if (last === '..') {
|
||
|
parts.splice(i, 1);
|
||
|
up++;
|
||
|
} else if (up) {
|
||
|
parts.splice(i, 1);
|
||
|
up--;
|
||
|
}
|
||
|
}
|
||
|
// if the path is allowed to go above the root, restore leading ..s
|
||
|
if (allowAboveRoot) {
|
||
|
for (; up--; up) {
|
||
|
parts.unshift('..');
|
||
|
}
|
||
|
}
|
||
|
return parts;
|
||
|
},normalize:function (path) {
|
||
|
var isAbsolute = path.charAt(0) === '/',
|
||
|
trailingSlash = path.substr(-1) === '/';
|
||
|
// Normalize the path
|
||
|
path = PATH.normalizeArray(path.split('/').filter(function(p) {
|
||
|
return !!p;
|
||
|
}), !isAbsolute).join('/');
|
||
|
if (!path && !isAbsolute) {
|
||
|
path = '.';
|
||
|
}
|
||
|
if (path && trailingSlash) {
|
||
|
path += '/';
|
||
|
}
|
||
|
return (isAbsolute ? '/' : '') + path;
|
||
|
},dirname:function (path) {
|
||
|
var result = PATH.splitPath(path),
|
||
|
root = result[0],
|
||
|
dir = result[1];
|
||
|
if (!root && !dir) {
|
||
|
// No dirname whatsoever
|
||
|
return '.';
|
||
|
}
|
||
|
if (dir) {
|
||
|
// It has a dirname, strip trailing slash
|
||
|
dir = dir.substr(0, dir.length - 1);
|
||
|
}
|
||
|
return root + dir;
|
||
|
},basename:function (path) {
|
||
|
// EMSCRIPTEN return '/'' for '/', not an empty string
|
||
|
if (path === '/') return '/';
|
||
|
var lastSlash = path.lastIndexOf('/');
|
||
|
if (lastSlash === -1) return path;
|
||
|
return path.substr(lastSlash+1);
|
||
|
},extname:function (path) {
|
||
|
return PATH.splitPath(path)[3];
|
||
|
},join:function () {
|
||
|
var paths = Array.prototype.slice.call(arguments, 0);
|
||
|
return PATH.normalize(paths.join('/'));
|
||
|
},join2:function (l, r) {
|
||
|
return PATH.normalize(l + '/' + r);
|
||
|
},resolve:function () {
|
||
|
var resolvedPath = '',
|
||
|
resolvedAbsolute = false;
|
||
|
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||
|
var path = (i >= 0) ? arguments[i] : FS.cwd();
|
||
|
// Skip empty and invalid entries
|
||
|
if (typeof path !== 'string') {
|
||
|
throw new TypeError('Arguments to path.resolve must be strings');
|
||
|
} else if (!path) {
|
||
|
continue;
|
||
|
}
|
||
|
resolvedPath = path + '/' + resolvedPath;
|
||
|
resolvedAbsolute = path.charAt(0) === '/';
|
||
|
}
|
||
|
// At this point the path should be resolved to a full absolute path, but
|
||
|
// handle relative paths to be safe (might happen when process.cwd() fails)
|
||
|
resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {
|
||
|
return !!p;
|
||
|
}), !resolvedAbsolute).join('/');
|
||
|
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
||
|
},relative:function (from, to) {
|
||
|
from = PATH.resolve(from).substr(1);
|
||
|
to = PATH.resolve(to).substr(1);
|
||
|
function trim(arr) {
|
||
|
var start = 0;
|
||
|
for (; start < arr.length; start++) {
|
||
|
if (arr[start] !== '') break;
|
||
|
}
|
||
|
var end = arr.length - 1;
|
||
|
for (; end >= 0; end--) {
|
||
|
if (arr[end] !== '') break;
|
||
|
}
|
||
|
if (start > end) return [];
|
||
|
return arr.slice(start, end - start + 1);
|
||
|
}
|
||
|
var fromParts = trim(from.split('/'));
|
||
|
var toParts = trim(to.split('/'));
|
||
|
var length = Math.min(fromParts.length, toParts.length);
|
||
|
var samePartsLength = length;
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
if (fromParts[i] !== toParts[i]) {
|
||
|
samePartsLength = i;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
var outputParts = [];
|
||
|
for (var i = samePartsLength; i < fromParts.length; i++) {
|
||
|
outputParts.push('..');
|
||
|
}
|
||
|
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
||
|
return outputParts.join('/');
|
||
|
}};
|
||
|
|
||
|
var TTY={ttys:[],init:function () {
|
||
|
// https://github.com/kripken/emscripten/pull/1555
|
||
|
// if (ENVIRONMENT_IS_NODE) {
|
||
|
// // currently, FS.init does not distinguish if process.stdin is a file or TTY
|
||
|
// // device, it always assumes it's a TTY device. because of this, we're forcing
|
||
|
// // process.stdin to UTF8 encoding to at least make stdin reading compatible
|
||
|
// // with text files until FS.init can be refactored.
|
||
|
// process['stdin']['setEncoding']('utf8');
|
||
|
// }
|
||
|
},shutdown:function () {
|
||
|
// https://github.com/kripken/emscripten/pull/1555
|
||
|
// if (ENVIRONMENT_IS_NODE) {
|
||
|
// // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
|
||
|
// // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation
|
||
|
// // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
|
||
|
// // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
|
||
|
// // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
|
||
|
// process['stdin']['pause']();
|
||
|
// }
|
||
|
},register:function (dev, ops) {
|
||
|
TTY.ttys[dev] = { input: [], output: [], ops: ops };
|
||
|
FS.registerDevice(dev, TTY.stream_ops);
|
||
|
},stream_ops:{open:function (stream) {
|
||
|
var tty = TTY.ttys[stream.node.rdev];
|
||
|
if (!tty) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
stream.tty = tty;
|
||
|
stream.seekable = false;
|
||
|
},close:function (stream) {
|
||
|
// flush any pending line data
|
||
|
if (stream.tty.output.length) {
|
||
|
stream.tty.ops.put_char(stream.tty, 10);
|
||
|
}
|
||
|
},read:function (stream, buffer, offset, length, pos /* ignored */) {
|
||
|
if (!stream.tty || !stream.tty.ops.get_char) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
|
||
|
}
|
||
|
var bytesRead = 0;
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
var result;
|
||
|
try {
|
||
|
result = stream.tty.ops.get_char(stream.tty);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
if (result === undefined && bytesRead === 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
|
||
|
}
|
||
|
if (result === null || result === undefined) break;
|
||
|
bytesRead++;
|
||
|
buffer[offset+i] = result;
|
||
|
}
|
||
|
if (bytesRead) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return bytesRead;
|
||
|
},write:function (stream, buffer, offset, length, pos) {
|
||
|
if (!stream.tty || !stream.tty.ops.put_char) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
|
||
|
}
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
try {
|
||
|
stream.tty.ops.put_char(stream.tty, buffer[offset+i]);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
}
|
||
|
if (length) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return i;
|
||
|
}},default_tty_ops:{get_char:function (tty) {
|
||
|
if (!tty.input.length) {
|
||
|
var result = null;
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
result = process['stdin']['read']();
|
||
|
if (!result) {
|
||
|
if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {
|
||
|
return null; // EOF
|
||
|
}
|
||
|
return undefined; // no data available
|
||
|
}
|
||
|
} else if (typeof window != 'undefined' &&
|
||
|
typeof window.prompt == 'function') {
|
||
|
// Browser.
|
||
|
result = window.prompt('Input: '); // returns null on cancel
|
||
|
if (result !== null) {
|
||
|
result += '\n';
|
||
|
}
|
||
|
} else if (typeof readline == 'function') {
|
||
|
// Command line.
|
||
|
result = readline();
|
||
|
if (result !== null) {
|
||
|
result += '\n';
|
||
|
}
|
||
|
}
|
||
|
if (!result) {
|
||
|
return null;
|
||
|
}
|
||
|
tty.input = intArrayFromString(result, true);
|
||
|
}
|
||
|
return tty.input.shift();
|
||
|
},put_char:function (tty, val) {
|
||
|
if (val === null || val === 10) {
|
||
|
Module['print'](tty.output.join(''));
|
||
|
tty.output = [];
|
||
|
} else {
|
||
|
tty.output.push(TTY.utf8.processCChar(val));
|
||
|
}
|
||
|
}},default_tty1_ops:{put_char:function (tty, val) {
|
||
|
if (val === null || val === 10) {
|
||
|
Module['printErr'](tty.output.join(''));
|
||
|
tty.output = [];
|
||
|
} else {
|
||
|
tty.output.push(TTY.utf8.processCChar(val));
|
||
|
}
|
||
|
}}};
|
||
|
|
||
|
var MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function (mount) {
|
||
|
return MEMFS.createNode(null, '/', 16384 | 0777, 0);
|
||
|
},createNode:function (parent, name, mode, dev) {
|
||
|
if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
|
||
|
// no supported
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
if (!MEMFS.ops_table) {
|
||
|
MEMFS.ops_table = {
|
||
|
dir: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr,
|
||
|
lookup: MEMFS.node_ops.lookup,
|
||
|
mknod: MEMFS.node_ops.mknod,
|
||
|
mknod: MEMFS.node_ops.mknod,
|
||
|
rename: MEMFS.node_ops.rename,
|
||
|
unlink: MEMFS.node_ops.unlink,
|
||
|
rmdir: MEMFS.node_ops.rmdir,
|
||
|
readdir: MEMFS.node_ops.readdir,
|
||
|
symlink: MEMFS.node_ops.symlink
|
||
|
},
|
||
|
stream: {
|
||
|
llseek: MEMFS.stream_ops.llseek
|
||
|
}
|
||
|
},
|
||
|
file: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr
|
||
|
},
|
||
|
stream: {
|
||
|
llseek: MEMFS.stream_ops.llseek,
|
||
|
read: MEMFS.stream_ops.read,
|
||
|
write: MEMFS.stream_ops.write,
|
||
|
allocate: MEMFS.stream_ops.allocate,
|
||
|
mmap: MEMFS.stream_ops.mmap
|
||
|
}
|
||
|
},
|
||
|
link: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr,
|
||
|
readlink: MEMFS.node_ops.readlink
|
||
|
},
|
||
|
stream: {}
|
||
|
},
|
||
|
chrdev: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr
|
||
|
},
|
||
|
stream: FS.chrdev_stream_ops
|
||
|
},
|
||
|
};
|
||
|
}
|
||
|
var node = FS.createNode(parent, name, mode, dev);
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.dir.node;
|
||
|
node.stream_ops = MEMFS.ops_table.dir.stream;
|
||
|
node.contents = {};
|
||
|
} else if (FS.isFile(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.file.node;
|
||
|
node.stream_ops = MEMFS.ops_table.file.stream;
|
||
|
node.contents = [];
|
||
|
node.contentMode = MEMFS.CONTENT_FLEXIBLE;
|
||
|
} else if (FS.isLink(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.link.node;
|
||
|
node.stream_ops = MEMFS.ops_table.link.stream;
|
||
|
} else if (FS.isChrdev(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.chrdev.node;
|
||
|
node.stream_ops = MEMFS.ops_table.chrdev.stream;
|
||
|
}
|
||
|
node.timestamp = Date.now();
|
||
|
// add the new node to the parent
|
||
|
if (parent) {
|
||
|
parent.contents[name] = node;
|
||
|
}
|
||
|
return node;
|
||
|
},ensureFlexible:function (node) {
|
||
|
if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {
|
||
|
var contents = node.contents;
|
||
|
node.contents = Array.prototype.slice.call(contents);
|
||
|
node.contentMode = MEMFS.CONTENT_FLEXIBLE;
|
||
|
}
|
||
|
},node_ops:{getattr:function (node) {
|
||
|
var attr = {};
|
||
|
// device numbers reuse inode numbers.
|
||
|
attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
|
||
|
attr.ino = node.id;
|
||
|
attr.mode = node.mode;
|
||
|
attr.nlink = 1;
|
||
|
attr.uid = 0;
|
||
|
attr.gid = 0;
|
||
|
attr.rdev = node.rdev;
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
attr.size = 4096;
|
||
|
} else if (FS.isFile(node.mode)) {
|
||
|
attr.size = node.contents.length;
|
||
|
} else if (FS.isLink(node.mode)) {
|
||
|
attr.size = node.link.length;
|
||
|
} else {
|
||
|
attr.size = 0;
|
||
|
}
|
||
|
attr.atime = new Date(node.timestamp);
|
||
|
attr.mtime = new Date(node.timestamp);
|
||
|
attr.ctime = new Date(node.timestamp);
|
||
|
// NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),
|
||
|
// but this is not required by the standard.
|
||
|
attr.blksize = 4096;
|
||
|
attr.blocks = Math.ceil(attr.size / attr.blksize);
|
||
|
return attr;
|
||
|
},setattr:function (node, attr) {
|
||
|
if (attr.mode !== undefined) {
|
||
|
node.mode = attr.mode;
|
||
|
}
|
||
|
if (attr.timestamp !== undefined) {
|
||
|
node.timestamp = attr.timestamp;
|
||
|
}
|
||
|
if (attr.size !== undefined) {
|
||
|
MEMFS.ensureFlexible(node);
|
||
|
var contents = node.contents;
|
||
|
if (attr.size < contents.length) contents.length = attr.size;
|
||
|
else while (attr.size > contents.length) contents.push(0);
|
||
|
}
|
||
|
},lookup:function (parent, name) {
|
||
|
throw FS.genericErrors[ERRNO_CODES.ENOENT];
|
||
|
},mknod:function (parent, name, mode, dev) {
|
||
|
return MEMFS.createNode(parent, name, mode, dev);
|
||
|
},rename:function (old_node, new_dir, new_name) {
|
||
|
// if we're overwriting a directory at new_name, make sure it's empty.
|
||
|
if (FS.isDir(old_node.mode)) {
|
||
|
var new_node;
|
||
|
try {
|
||
|
new_node = FS.lookupNode(new_dir, new_name);
|
||
|
} catch (e) {
|
||
|
}
|
||
|
if (new_node) {
|
||
|
for (var i in new_node.contents) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// do the internal rewiring
|
||
|
delete old_node.parent.contents[old_node.name];
|
||
|
old_node.name = new_name;
|
||
|
new_dir.contents[new_name] = old_node;
|
||
|
old_node.parent = new_dir;
|
||
|
},unlink:function (parent, name) {
|
||
|
delete parent.contents[name];
|
||
|
},rmdir:function (parent, name) {
|
||
|
var node = FS.lookupNode(parent, name);
|
||
|
for (var i in node.contents) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
|
||
|
}
|
||
|
delete parent.contents[name];
|
||
|
},readdir:function (node) {
|
||
|
var entries = ['.', '..']
|
||
|
for (var key in node.contents) {
|
||
|
if (!node.contents.hasOwnProperty(key)) {
|
||
|
continue;
|
||
|
}
|
||
|
entries.push(key);
|
||
|
}
|
||
|
return entries;
|
||
|
},symlink:function (parent, newname, oldpath) {
|
||
|
var node = MEMFS.createNode(parent, newname, 0777 | 40960, 0);
|
||
|
node.link = oldpath;
|
||
|
return node;
|
||
|
},readlink:function (node) {
|
||
|
if (!FS.isLink(node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
return node.link;
|
||
|
}},stream_ops:{read:function (stream, buffer, offset, length, position) {
|
||
|
var contents = stream.node.contents;
|
||
|
if (position >= contents.length)
|
||
|
return 0;
|
||
|
var size = Math.min(contents.length - position, length);
|
||
|
assert(size >= 0);
|
||
|
if (size > 8 && contents.subarray) { // non-trivial, and typed array
|
||
|
buffer.set(contents.subarray(position, position + size), offset);
|
||
|
} else
|
||
|
{
|
||
|
for (var i = 0; i < size; i++) {
|
||
|
buffer[offset + i] = contents[position + i];
|
||
|
}
|
||
|
}
|
||
|
return size;
|
||
|
},write:function (stream, buffer, offset, length, position, canOwn) {
|
||
|
var node = stream.node;
|
||
|
node.timestamp = Date.now();
|
||
|
var contents = node.contents;
|
||
|
if (length && contents.length === 0 && position === 0 && buffer.subarray) {
|
||
|
// just replace it with the new data
|
||
|
if (canOwn && offset === 0) {
|
||
|
node.contents = buffer; // this could be a subarray of Emscripten HEAP, or allocated from some other source.
|
||
|
node.contentMode = (buffer.buffer === HEAP8.buffer) ? MEMFS.CONTENT_OWNING : MEMFS.CONTENT_FIXED;
|
||
|
} else {
|
||
|
node.contents = new Uint8Array(buffer.subarray(offset, offset+length));
|
||
|
node.contentMode = MEMFS.CONTENT_FIXED;
|
||
|
}
|
||
|
return length;
|
||
|
}
|
||
|
MEMFS.ensureFlexible(node);
|
||
|
var contents = node.contents;
|
||
|
while (contents.length < position) contents.push(0);
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
contents[position + i] = buffer[offset + i];
|
||
|
}
|
||
|
return length;
|
||
|
},llseek:function (stream, offset, whence) {
|
||
|
var position = offset;
|
||
|
if (whence === 1) { // SEEK_CUR.
|
||
|
position += stream.position;
|
||
|
} else if (whence === 2) { // SEEK_END.
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
position += stream.node.contents.length;
|
||
|
}
|
||
|
}
|
||
|
if (position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
stream.ungotten = [];
|
||
|
stream.position = position;
|
||
|
return position;
|
||
|
},allocate:function (stream, offset, length) {
|
||
|
MEMFS.ensureFlexible(stream.node);
|
||
|
var contents = stream.node.contents;
|
||
|
var limit = offset + length;
|
||
|
while (limit > contents.length) contents.push(0);
|
||
|
},mmap:function (stream, buffer, offset, length, position, prot, flags) {
|
||
|
if (!FS.isFile(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
var ptr;
|
||
|
var allocated;
|
||
|
var contents = stream.node.contents;
|
||
|
// Only make a new copy when MAP_PRIVATE is specified.
|
||
|
if ( !(flags & 2) &&
|
||
|
(contents.buffer === buffer || contents.buffer === buffer.buffer) ) {
|
||
|
// We can't emulate MAP_SHARED when the file is not backed by the buffer
|
||
|
// we're mapping to (e.g. the HEAP buffer).
|
||
|
allocated = false;
|
||
|
ptr = contents.byteOffset;
|
||
|
} else {
|
||
|
// Try to avoid unnecessary slices.
|
||
|
if (position > 0 || position + length < contents.length) {
|
||
|
if (contents.subarray) {
|
||
|
contents = contents.subarray(position, position + length);
|
||
|
} else {
|
||
|
contents = Array.prototype.slice.call(contents, position, position + length);
|
||
|
}
|
||
|
}
|
||
|
allocated = true;
|
||
|
ptr = _malloc(length);
|
||
|
if (!ptr) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
|
||
|
}
|
||
|
buffer.set(contents, ptr);
|
||
|
}
|
||
|
return { ptr: ptr, allocated: allocated };
|
||
|
}}};
|
||
|
|
||
|
var IDBFS={dbs:{},indexedDB:function () {
|
||
|
return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
||
|
},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",mount:function (mount) {
|
||
|
return MEMFS.mount.apply(null, arguments);
|
||
|
},syncfs:function (mount, populate, callback) {
|
||
|
IDBFS.getLocalSet(mount, function(err, local) {
|
||
|
if (err) return callback(err);
|
||
|
|
||
|
IDBFS.getRemoteSet(mount, function(err, remote) {
|
||
|
if (err) return callback(err);
|
||
|
|
||
|
var src = populate ? remote : local;
|
||
|
var dst = populate ? local : remote;
|
||
|
|
||
|
IDBFS.reconcile(src, dst, callback);
|
||
|
});
|
||
|
});
|
||
|
},reconcile:function (src, dst, callback) {
|
||
|
var total = 0;
|
||
|
|
||
|
var create = {};
|
||
|
for (var key in src.files) {
|
||
|
if (!src.files.hasOwnProperty(key)) continue;
|
||
|
var e = src.files[key];
|
||
|
var e2 = dst.files[key];
|
||
|
if (!e2 || e.timestamp > e2.timestamp) {
|
||
|
create[key] = e;
|
||
|
total++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var remove = {};
|
||
|
for (var key in dst.files) {
|
||
|
if (!dst.files.hasOwnProperty(key)) continue;
|
||
|
var e = dst.files[key];
|
||
|
var e2 = src.files[key];
|
||
|
if (!e2) {
|
||
|
remove[key] = e;
|
||
|
total++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (!total) {
|
||
|
// early out
|
||
|
return callback(null);
|
||
|
}
|
||
|
|
||
|
var completed = 0;
|
||
|
function done(err) {
|
||
|
if (err) return callback(err);
|
||
|
if (++completed >= total) {
|
||
|
return callback(null);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// create a single transaction to handle and IDB reads / writes we'll need to do
|
||
|
var db = src.type === 'remote' ? src.db : dst.db;
|
||
|
var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');
|
||
|
transaction.onerror = function transaction_onerror() { callback(this.error); };
|
||
|
var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
|
||
|
|
||
|
for (var path in create) {
|
||
|
if (!create.hasOwnProperty(path)) continue;
|
||
|
var entry = create[path];
|
||
|
|
||
|
if (dst.type === 'local') {
|
||
|
// save file to local
|
||
|
try {
|
||
|
if (FS.isDir(entry.mode)) {
|
||
|
FS.mkdir(path, entry.mode);
|
||
|
} else if (FS.isFile(entry.mode)) {
|
||
|
var stream = FS.open(path, 'w+', 0666);
|
||
|
FS.write(stream, entry.contents, 0, entry.contents.length, 0, true /* canOwn */);
|
||
|
FS.close(stream);
|
||
|
}
|
||
|
done(null);
|
||
|
} catch (e) {
|
||
|
return done(e);
|
||
|
}
|
||
|
} else {
|
||
|
// save file to IDB
|
||
|
var req = store.put(entry, path);
|
||
|
req.onsuccess = function req_onsuccess() { done(null); };
|
||
|
req.onerror = function req_onerror() { done(this.error); };
|
||
|
}
|
||
|
}
|
||
|
|
||
|
for (var path in remove) {
|
||
|
if (!remove.hasOwnProperty(path)) continue;
|
||
|
var entry = remove[path];
|
||
|
|
||
|
if (dst.type === 'local') {
|
||
|
// delete file from local
|
||
|
try {
|
||
|
if (FS.isDir(entry.mode)) {
|
||
|
// TODO recursive delete?
|
||
|
FS.rmdir(path);
|
||
|
} else if (FS.isFile(entry.mode)) {
|
||
|
FS.unlink(path);
|
||
|
}
|
||
|
done(null);
|
||
|
} catch (e) {
|
||
|
return done(e);
|
||
|
}
|
||
|
} else {
|
||
|
// delete file from IDB
|
||
|
var req = store.delete(path);
|
||
|
req.onsuccess = function req_onsuccess() { done(null); };
|
||
|
req.onerror = function req_onerror() { done(this.error); };
|
||
|
}
|
||
|
}
|
||
|
},getLocalSet:function (mount, callback) {
|
||
|
var files = {};
|
||
|
|
||
|
function isRealDir(p) {
|
||
|
return p !== '.' && p !== '..';
|
||
|
};
|
||
|
function toAbsolute(root) {
|
||
|
return function(p) {
|
||
|
return PATH.join2(root, p);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var check = FS.readdir(mount.mountpoint)
|
||
|
.filter(isRealDir)
|
||
|
.map(toAbsolute(mount.mountpoint));
|
||
|
|
||
|
while (check.length) {
|
||
|
var path = check.pop();
|
||
|
var stat, node;
|
||
|
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path);
|
||
|
node = lookup.node;
|
||
|
stat = FS.stat(path);
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
|
||
|
if (FS.isDir(stat.mode)) {
|
||
|
check.push.apply(check, FS.readdir(path)
|
||
|
.filter(isRealDir)
|
||
|
.map(toAbsolute(path)));
|
||
|
|
||
|
files[path] = { mode: stat.mode, timestamp: stat.mtime };
|
||
|
} else if (FS.isFile(stat.mode)) {
|
||
|
files[path] = { contents: node.contents, mode: stat.mode, timestamp: stat.mtime };
|
||
|
} else {
|
||
|
return callback(new Error('node type not supported'));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return callback(null, { type: 'local', files: files });
|
||
|
},getDB:function (name, callback) {
|
||
|
// look it up in the cache
|
||
|
var db = IDBFS.dbs[name];
|
||
|
if (db) {
|
||
|
return callback(null, db);
|
||
|
}
|
||
|
var req;
|
||
|
try {
|
||
|
req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
|
||
|
} catch (e) {
|
||
|
return onerror(e);
|
||
|
}
|
||
|
req.onupgradeneeded = function req_onupgradeneeded() {
|
||
|
db = req.result;
|
||
|
db.createObjectStore(IDBFS.DB_STORE_NAME);
|
||
|
};
|
||
|
req.onsuccess = function req_onsuccess() {
|
||
|
db = req.result;
|
||
|
// add to the cache
|
||
|
IDBFS.dbs[name] = db;
|
||
|
callback(null, db);
|
||
|
};
|
||
|
req.onerror = function req_onerror() {
|
||
|
callback(this.error);
|
||
|
};
|
||
|
},getRemoteSet:function (mount, callback) {
|
||
|
var files = {};
|
||
|
|
||
|
IDBFS.getDB(mount.mountpoint, function(err, db) {
|
||
|
if (err) return callback(err);
|
||
|
|
||
|
var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');
|
||
|
transaction.onerror = function transaction_onerror() { callback(this.error); };
|
||
|
|
||
|
var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
|
||
|
store.openCursor().onsuccess = function store_openCursor_onsuccess(event) {
|
||
|
var cursor = event.target.result;
|
||
|
if (!cursor) {
|
||
|
return callback(null, { type: 'remote', db: db, files: files });
|
||
|
}
|
||
|
|
||
|
files[cursor.key] = cursor.value;
|
||
|
cursor.continue();
|
||
|
};
|
||
|
});
|
||
|
}};
|
||
|
|
||
|
var NODEFS={isWindows:false,staticInit:function () {
|
||
|
NODEFS.isWindows = !!process.platform.match(/^win/);
|
||
|
},mount:function (mount) {
|
||
|
assert(ENVIRONMENT_IS_NODE);
|
||
|
return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);
|
||
|
},createNode:function (parent, name, mode, dev) {
|
||
|
if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var node = FS.createNode(parent, name, mode);
|
||
|
node.node_ops = NODEFS.node_ops;
|
||
|
node.stream_ops = NODEFS.stream_ops;
|
||
|
return node;
|
||
|
},getMode:function (path) {
|
||
|
var stat;
|
||
|
try {
|
||
|
stat = fs.lstatSync(path);
|
||
|
if (NODEFS.isWindows) {
|
||
|
// On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so
|
||
|
// propagate write bits to execute bits.
|
||
|
stat.mode = stat.mode | ((stat.mode & 146) >> 1);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
return stat.mode;
|
||
|
},realPath:function (node) {
|
||
|
var parts = [];
|
||
|
while (node.parent !== node) {
|
||
|
parts.push(node.name);
|
||
|
node = node.parent;
|
||
|
}
|
||
|
parts.push(node.mount.opts.root);
|
||
|
parts.reverse();
|
||
|
return PATH.join.apply(null, parts);
|
||
|
},flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function (flags) {
|
||
|
if (flags in NODEFS.flagsToPermissionStringMap) {
|
||
|
return NODEFS.flagsToPermissionStringMap[flags];
|
||
|
} else {
|
||
|
return flags;
|
||
|
}
|
||
|
},node_ops:{getattr:function (node) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
var stat;
|
||
|
try {
|
||
|
stat = fs.lstatSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
// node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.
|
||
|
// See http://support.microsoft.com/kb/140365
|
||
|
if (NODEFS.isWindows && !stat.blksize) {
|
||
|
stat.blksize = 4096;
|
||
|
}
|
||
|
if (NODEFS.isWindows && !stat.blocks) {
|
||
|
stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;
|
||
|
}
|
||
|
return {
|
||
|
dev: stat.dev,
|
||
|
ino: stat.ino,
|
||
|
mode: stat.mode,
|
||
|
nlink: stat.nlink,
|
||
|
uid: stat.uid,
|
||
|
gid: stat.gid,
|
||
|
rdev: stat.rdev,
|
||
|
size: stat.size,
|
||
|
atime: stat.atime,
|
||
|
mtime: stat.mtime,
|
||
|
ctime: stat.ctime,
|
||
|
blksize: stat.blksize,
|
||
|
blocks: stat.blocks
|
||
|
};
|
||
|
},setattr:function (node, attr) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
if (attr.mode !== undefined) {
|
||
|
fs.chmodSync(path, attr.mode);
|
||
|
// update the common node structure mode as well
|
||
|
node.mode = attr.mode;
|
||
|
}
|
||
|
if (attr.timestamp !== undefined) {
|
||
|
var date = new Date(attr.timestamp);
|
||
|
fs.utimesSync(path, date, date);
|
||
|
}
|
||
|
if (attr.size !== undefined) {
|
||
|
fs.truncateSync(path, attr.size);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},lookup:function (parent, name) {
|
||
|
var path = PATH.join2(NODEFS.realPath(parent), name);
|
||
|
var mode = NODEFS.getMode(path);
|
||
|
return NODEFS.createNode(parent, name, mode);
|
||
|
},mknod:function (parent, name, mode, dev) {
|
||
|
var node = NODEFS.createNode(parent, name, mode, dev);
|
||
|
// create the backing node for this in the fs root as well
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
fs.mkdirSync(path, node.mode);
|
||
|
} else {
|
||
|
fs.writeFileSync(path, '', { mode: node.mode });
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
return node;
|
||
|
},rename:function (oldNode, newDir, newName) {
|
||
|
var oldPath = NODEFS.realPath(oldNode);
|
||
|
var newPath = PATH.join2(NODEFS.realPath(newDir), newName);
|
||
|
try {
|
||
|
fs.renameSync(oldPath, newPath);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},unlink:function (parent, name) {
|
||
|
var path = PATH.join2(NODEFS.realPath(parent), name);
|
||
|
try {
|
||
|
fs.unlinkSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},rmdir:function (parent, name) {
|
||
|
var path = PATH.join2(NODEFS.realPath(parent), name);
|
||
|
try {
|
||
|
fs.rmdirSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},readdir:function (node) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
return fs.readdirSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},symlink:function (parent, newName, oldPath) {
|
||
|
var newPath = PATH.join2(NODEFS.realPath(parent), newName);
|
||
|
try {
|
||
|
fs.symlinkSync(oldPath, newPath);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},readlink:function (node) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
return fs.readlinkSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
}},stream_ops:{open:function (stream) {
|
||
|
var path = NODEFS.realPath(stream.node);
|
||
|
try {
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},close:function (stream) {
|
||
|
try {
|
||
|
if (FS.isFile(stream.node.mode) && stream.nfd) {
|
||
|
fs.closeSync(stream.nfd);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},read:function (stream, buffer, offset, length, position) {
|
||
|
// FIXME this is terrible.
|
||
|
var nbuffer = new Buffer(length);
|
||
|
var res;
|
||
|
try {
|
||
|
res = fs.readSync(stream.nfd, nbuffer, 0, length, position);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
if (res > 0) {
|
||
|
for (var i = 0; i < res; i++) {
|
||
|
buffer[offset + i] = nbuffer[i];
|
||
|
}
|
||
|
}
|
||
|
return res;
|
||
|
},write:function (stream, buffer, offset, length, position) {
|
||
|
// FIXME this is terrible.
|
||
|
var nbuffer = new Buffer(buffer.subarray(offset, offset + length));
|
||
|
var res;
|
||
|
try {
|
||
|
res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
return res;
|
||
|
},llseek:function (stream, offset, whence) {
|
||
|
var position = offset;
|
||
|
if (whence === 1) { // SEEK_CUR.
|
||
|
position += stream.position;
|
||
|
} else if (whence === 2) { // SEEK_END.
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
try {
|
||
|
var stat = fs.fstatSync(stream.nfd);
|
||
|
position += stat.size;
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
|
||
|
stream.position = position;
|
||
|
return position;
|
||
|
}}};
|
||
|
|
||
|
var _stdin=allocate(1, "i32*", ALLOC_STATIC);
|
||
|
|
||
|
var _stdout=allocate(1, "i32*", ALLOC_STATIC);
|
||
|
|
||
|
var _stderr=allocate(1, "i32*", ALLOC_STATIC);
|
||
|
|
||
|
function _fflush(stream) {
|
||
|
// int fflush(FILE *stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html
|
||
|
// we don't currently perform any user-space buffering of data
|
||
|
}var FS={root:null,mounts:[],devices:[null],streams:[null],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {
|
||
|
if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();
|
||
|
return ___setErrNo(e.errno);
|
||
|
},lookupPath:function (path, opts) {
|
||
|
path = PATH.resolve(FS.cwd(), path);
|
||
|
opts = opts || { recurse_count: 0 };
|
||
|
|
||
|
if (opts.recurse_count > 8) { // max recursive lookup of 8
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
|
||
|
}
|
||
|
|
||
|
// split the path
|
||
|
var parts = PATH.normalizeArray(path.split('/').filter(function(p) {
|
||
|
return !!p;
|
||
|
}), false);
|
||
|
|
||
|
// start at the root
|
||
|
var current = FS.root;
|
||
|
var current_path = '/';
|
||
|
|
||
|
for (var i = 0; i < parts.length; i++) {
|
||
|
var islast = (i === parts.length-1);
|
||
|
if (islast && opts.parent) {
|
||
|
// stop resolving
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
current = FS.lookupNode(current, parts[i]);
|
||
|
current_path = PATH.join2(current_path, parts[i]);
|
||
|
|
||
|
// jump to the mount's root node if this is a mountpoint
|
||
|
if (FS.isMountpoint(current)) {
|
||
|
current = current.mount.root;
|
||
|
}
|
||
|
|
||
|
// follow symlinks
|
||
|
// by default, lookupPath will not follow a symlink if it is the final path component.
|
||
|
// setting opts.follow = true will override this behavior.
|
||
|
if (!islast || opts.follow) {
|
||
|
var count = 0;
|
||
|
while (FS.isLink(current.mode)) {
|
||
|
var link = FS.readlink(current_path);
|
||
|
current_path = PATH.resolve(PATH.dirname(current_path), link);
|
||
|
|
||
|
var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
|
||
|
current = lookup.node;
|
||
|
|
||
|
if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return { path: current_path, node: current };
|
||
|
},getPath:function (node) {
|
||
|
var path;
|
||
|
while (true) {
|
||
|
if (FS.isRoot(node)) {
|
||
|
var mount = node.mount.mountpoint;
|
||
|
if (!path) return mount;
|
||
|
return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;
|
||
|
}
|
||
|
path = path ? node.name + '/' + path : node.name;
|
||
|
node = node.parent;
|
||
|
}
|
||
|
},hashName:function (parentid, name) {
|
||
|
var hash = 0;
|
||
|
|
||
|
|
||
|
for (var i = 0; i < name.length; i++) {
|
||
|
hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
|
||
|
}
|
||
|
return ((parentid + hash) >>> 0) % FS.nameTable.length;
|
||
|
},hashAddNode:function (node) {
|
||
|
var hash = FS.hashName(node.parent.id, node.name);
|
||
|
node.name_next = FS.nameTable[hash];
|
||
|
FS.nameTable[hash] = node;
|
||
|
},hashRemoveNode:function (node) {
|
||
|
var hash = FS.hashName(node.parent.id, node.name);
|
||
|
if (FS.nameTable[hash] === node) {
|
||
|
FS.nameTable[hash] = node.name_next;
|
||
|
} else {
|
||
|
var current = FS.nameTable[hash];
|
||
|
while (current) {
|
||
|
if (current.name_next === node) {
|
||
|
current.name_next = node.name_next;
|
||
|
break;
|
||
|
}
|
||
|
current = current.name_next;
|
||
|
}
|
||
|
}
|
||
|
},lookupNode:function (parent, name) {
|
||
|
var err = FS.mayLookup(parent);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
var hash = FS.hashName(parent.id, name);
|
||
|
for (var node = FS.nameTable[hash]; node; node = node.name_next) {
|
||
|
var nodeName = node.name;
|
||
|
if (node.parent.id === parent.id && nodeName === name) {
|
||
|
return node;
|
||
|
}
|
||
|
}
|
||
|
// if we failed to find it in the cache, call into the VFS
|
||
|
return FS.lookup(parent, name);
|
||
|
},createNode:function (parent, name, mode, rdev) {
|
||
|
if (!FS.FSNode) {
|
||
|
FS.FSNode = function(parent, name, mode, rdev) {
|
||
|
this.id = FS.nextInode++;
|
||
|
this.name = name;
|
||
|
this.mode = mode;
|
||
|
this.node_ops = {};
|
||
|
this.stream_ops = {};
|
||
|
this.rdev = rdev;
|
||
|
this.parent = null;
|
||
|
this.mount = null;
|
||
|
if (!parent) {
|
||
|
parent = this; // root node sets parent to itself
|
||
|
}
|
||
|
this.parent = parent;
|
||
|
this.mount = parent.mount;
|
||
|
FS.hashAddNode(this);
|
||
|
};
|
||
|
|
||
|
// compatibility
|
||
|
var readMode = 292 | 73;
|
||
|
var writeMode = 146;
|
||
|
|
||
|
FS.FSNode.prototype = {};
|
||
|
|
||
|
// NOTE we must use Object.defineProperties instead of individual calls to
|
||
|
// Object.defineProperty in order to make closure compiler happy
|
||
|
Object.defineProperties(FS.FSNode.prototype, {
|
||
|
read: {
|
||
|
get: function() { return (this.mode & readMode) === readMode; },
|
||
|
set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }
|
||
|
},
|
||
|
write: {
|
||
|
get: function() { return (this.mode & writeMode) === writeMode; },
|
||
|
set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }
|
||
|
},
|
||
|
isFolder: {
|
||
|
get: function() { return FS.isDir(this.mode); },
|
||
|
},
|
||
|
isDevice: {
|
||
|
get: function() { return FS.isChrdev(this.mode); },
|
||
|
},
|
||
|
});
|
||
|
}
|
||
|
return new FS.FSNode(parent, name, mode, rdev);
|
||
|
},destroyNode:function (node) {
|
||
|
FS.hashRemoveNode(node);
|
||
|
},isRoot:function (node) {
|
||
|
return node === node.parent;
|
||
|
},isMountpoint:function (node) {
|
||
|
return node.mounted;
|
||
|
},isFile:function (mode) {
|
||
|
return (mode & 61440) === 32768;
|
||
|
},isDir:function (mode) {
|
||
|
return (mode & 61440) === 16384;
|
||
|
},isLink:function (mode) {
|
||
|
return (mode & 61440) === 40960;
|
||
|
},isChrdev:function (mode) {
|
||
|
return (mode & 61440) === 8192;
|
||
|
},isBlkdev:function (mode) {
|
||
|
return (mode & 61440) === 24576;
|
||
|
},isFIFO:function (mode) {
|
||
|
return (mode & 61440) === 4096;
|
||
|
},isSocket:function (mode) {
|
||
|
return (mode & 49152) === 49152;
|
||
|
},flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function (str) {
|
||
|
var flags = FS.flagModes[str];
|
||
|
if (typeof flags === 'undefined') {
|
||
|
throw new Error('Unknown file open mode: ' + str);
|
||
|
}
|
||
|
return flags;
|
||
|
},flagsToPermissionString:function (flag) {
|
||
|
var accmode = flag & 2097155;
|
||
|
var perms = ['r', 'w', 'rw'][accmode];
|
||
|
if ((flag & 512)) {
|
||
|
perms += 'w';
|
||
|
}
|
||
|
return perms;
|
||
|
},nodePermissions:function (node, perms) {
|
||
|
if (FS.ignorePermissions) {
|
||
|
return 0;
|
||
|
}
|
||
|
// return 0 if any user, group or owner bits are set.
|
||
|
if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {
|
||
|
return ERRNO_CODES.EACCES;
|
||
|
} else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {
|
||
|
return ERRNO_CODES.EACCES;
|
||
|
} else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {
|
||
|
return ERRNO_CODES.EACCES;
|
||
|
}
|
||
|
return 0;
|
||
|
},mayLookup:function (dir) {
|
||
|
return FS.nodePermissions(dir, 'x');
|
||
|
},mayCreate:function (dir, name) {
|
||
|
try {
|
||
|
var node = FS.lookupNode(dir, name);
|
||
|
return ERRNO_CODES.EEXIST;
|
||
|
} catch (e) {
|
||
|
}
|
||
|
return FS.nodePermissions(dir, 'wx');
|
||
|
},mayDelete:function (dir, name, isdir) {
|
||
|
var node;
|
||
|
try {
|
||
|
node = FS.lookupNode(dir, name);
|
||
|
} catch (e) {
|
||
|
return e.errno;
|
||
|
}
|
||
|
var err = FS.nodePermissions(dir, 'wx');
|
||
|
if (err) {
|
||
|
return err;
|
||
|
}
|
||
|
if (isdir) {
|
||
|
if (!FS.isDir(node.mode)) {
|
||
|
return ERRNO_CODES.ENOTDIR;
|
||
|
}
|
||
|
if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
|
||
|
return ERRNO_CODES.EBUSY;
|
||
|
}
|
||
|
} else {
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
return ERRNO_CODES.EISDIR;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
},mayOpen:function (node, flags) {
|
||
|
if (!node) {
|
||
|
return ERRNO_CODES.ENOENT;
|
||
|
}
|
||
|
if (FS.isLink(node.mode)) {
|
||
|
return ERRNO_CODES.ELOOP;
|
||
|
} else if (FS.isDir(node.mode)) {
|
||
|
if ((flags & 2097155) !== 0 || // opening for write
|
||
|
(flags & 512)) {
|
||
|
return ERRNO_CODES.EISDIR;
|
||
|
}
|
||
|
}
|
||
|
return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
|
||
|
},MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {
|
||
|
fd_start = fd_start || 1;
|
||
|
fd_end = fd_end || FS.MAX_OPEN_FDS;
|
||
|
for (var fd = fd_start; fd <= fd_end; fd++) {
|
||
|
if (!FS.streams[fd]) {
|
||
|
return fd;
|
||
|
}
|
||
|
}
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
|
||
|
},getStream:function (fd) {
|
||
|
return FS.streams[fd];
|
||
|
},createStream:function (stream, fd_start, fd_end) {
|
||
|
if (!FS.FSStream) {
|
||
|
FS.FSStream = function(){};
|
||
|
FS.FSStream.prototype = {};
|
||
|
// compatibility
|
||
|
Object.defineProperties(FS.FSStream.prototype, {
|
||
|
object: {
|
||
|
get: function() { return this.node; },
|
||
|
set: function(val) { this.node = val; }
|
||
|
},
|
||
|
isRead: {
|
||
|
get: function() { return (this.flags & 2097155) !== 1; }
|
||
|
},
|
||
|
isWrite: {
|
||
|
get: function() { return (this.flags & 2097155) !== 0; }
|
||
|
},
|
||
|
isAppend: {
|
||
|
get: function() { return (this.flags & 1024); }
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
if (0) {
|
||
|
// reuse the object
|
||
|
stream.__proto__ = FS.FSStream.prototype;
|
||
|
} else {
|
||
|
var newStream = new FS.FSStream();
|
||
|
for (var p in stream) {
|
||
|
newStream[p] = stream[p];
|
||
|
}
|
||
|
stream = newStream;
|
||
|
}
|
||
|
var fd = FS.nextfd(fd_start, fd_end);
|
||
|
stream.fd = fd;
|
||
|
FS.streams[fd] = stream;
|
||
|
return stream;
|
||
|
},closeStream:function (fd) {
|
||
|
FS.streams[fd] = null;
|
||
|
},chrdev_stream_ops:{open:function (stream) {
|
||
|
var device = FS.getDevice(stream.node.rdev);
|
||
|
// override node's stream ops with the device's
|
||
|
stream.stream_ops = device.stream_ops;
|
||
|
// forward the open call
|
||
|
if (stream.stream_ops.open) {
|
||
|
stream.stream_ops.open(stream);
|
||
|
}
|
||
|
},llseek:function () {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
|
||
|
}},major:function (dev) {
|
||
|
return ((dev) >> 8);
|
||
|
},minor:function (dev) {
|
||
|
return ((dev) & 0xff);
|
||
|
},makedev:function (ma, mi) {
|
||
|
return ((ma) << 8 | (mi));
|
||
|
},registerDevice:function (dev, ops) {
|
||
|
FS.devices[dev] = { stream_ops: ops };
|
||
|
},getDevice:function (dev) {
|
||
|
return FS.devices[dev];
|
||
|
},syncfs:function (populate, callback) {
|
||
|
if (typeof(populate) === 'function') {
|
||
|
callback = populate;
|
||
|
populate = false;
|
||
|
}
|
||
|
|
||
|
var completed = 0;
|
||
|
var total = FS.mounts.length;
|
||
|
function done(err) {
|
||
|
if (err) {
|
||
|
return callback(err);
|
||
|
}
|
||
|
if (++completed >= total) {
|
||
|
callback(null);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// sync all mounts
|
||
|
for (var i = 0; i < FS.mounts.length; i++) {
|
||
|
var mount = FS.mounts[i];
|
||
|
if (!mount.type.syncfs) {
|
||
|
done(null);
|
||
|
continue;
|
||
|
}
|
||
|
mount.type.syncfs(mount, populate, done);
|
||
|
}
|
||
|
},mount:function (type, opts, mountpoint) {
|
||
|
var lookup;
|
||
|
if (mountpoint) {
|
||
|
lookup = FS.lookupPath(mountpoint, { follow: false });
|
||
|
mountpoint = lookup.path; // use the absolute path
|
||
|
}
|
||
|
var mount = {
|
||
|
type: type,
|
||
|
opts: opts,
|
||
|
mountpoint: mountpoint,
|
||
|
root: null
|
||
|
};
|
||
|
// create a root node for the fs
|
||
|
var root = type.mount(mount);
|
||
|
root.mount = mount;
|
||
|
mount.root = root;
|
||
|
// assign the mount info to the mountpoint's node
|
||
|
if (lookup) {
|
||
|
lookup.node.mount = mount;
|
||
|
lookup.node.mounted = true;
|
||
|
// compatibility update FS.root if we mount to /
|
||
|
if (mountpoint === '/') {
|
||
|
FS.root = mount.root;
|
||
|
}
|
||
|
}
|
||
|
// add to our cached list of mounts
|
||
|
FS.mounts.push(mount);
|
||
|
return root;
|
||
|
},lookup:function (parent, name) {
|
||
|
return parent.node_ops.lookup(parent, name);
|
||
|
},mknod:function (path, mode, dev) {
|
||
|
var lookup = FS.lookupPath(path, { parent: true });
|
||
|
var parent = lookup.node;
|
||
|
var name = PATH.basename(path);
|
||
|
var err = FS.mayCreate(parent, name);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.mknod) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
return parent.node_ops.mknod(parent, name, mode, dev);
|
||
|
},create:function (path, mode) {
|
||
|
mode = mode !== undefined ? mode : 0666;
|
||
|
mode &= 4095;
|
||
|
mode |= 32768;
|
||
|
return FS.mknod(path, mode, 0);
|
||
|
},mkdir:function (path, mode) {
|
||
|
mode = mode !== undefined ? mode : 0777;
|
||
|
mode &= 511 | 512;
|
||
|
mode |= 16384;
|
||
|
return FS.mknod(path, mode, 0);
|
||
|
},mkdev:function (path, mode, dev) {
|
||
|
if (typeof(dev) === 'undefined') {
|
||
|
dev = mode;
|
||
|
mode = 0666;
|
||
|
}
|
||
|
mode |= 8192;
|
||
|
return FS.mknod(path, mode, dev);
|
||
|
},symlink:function (oldpath, newpath) {
|
||
|
var lookup = FS.lookupPath(newpath, { parent: true });
|
||
|
var parent = lookup.node;
|
||
|
var newname = PATH.basename(newpath);
|
||
|
var err = FS.mayCreate(parent, newname);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.symlink) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
return parent.node_ops.symlink(parent, newname, oldpath);
|
||
|
},rename:function (old_path, new_path) {
|
||
|
var old_dirname = PATH.dirname(old_path);
|
||
|
var new_dirname = PATH.dirname(new_path);
|
||
|
var old_name = PATH.basename(old_path);
|
||
|
var new_name = PATH.basename(new_path);
|
||
|
// parents must exist
|
||
|
var lookup, old_dir, new_dir;
|
||
|
try {
|
||
|
lookup = FS.lookupPath(old_path, { parent: true });
|
||
|
old_dir = lookup.node;
|
||
|
lookup = FS.lookupPath(new_path, { parent: true });
|
||
|
new_dir = lookup.node;
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
|
||
|
}
|
||
|
// need to be part of the same mount
|
||
|
if (old_dir.mount !== new_dir.mount) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
|
||
|
}
|
||
|
// source must exist
|
||
|
var old_node = FS.lookupNode(old_dir, old_name);
|
||
|
// old path should not be an ancestor of the new path
|
||
|
var relative = PATH.relative(old_path, new_dirname);
|
||
|
if (relative.charAt(0) !== '.') {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
// new path should not be an ancestor of the old path
|
||
|
relative = PATH.relative(new_path, old_dirname);
|
||
|
if (relative.charAt(0) !== '.') {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
|
||
|
}
|
||
|
// see if the new path already exists
|
||
|
var new_node;
|
||
|
try {
|
||
|
new_node = FS.lookupNode(new_dir, new_name);
|
||
|
} catch (e) {
|
||
|
// not fatal
|
||
|
}
|
||
|
// early out if nothing needs to change
|
||
|
if (old_node === new_node) {
|
||
|
return;
|
||
|
}
|
||
|
// we'll need to delete the old entry
|
||
|
var isdir = FS.isDir(old_node.mode);
|
||
|
var err = FS.mayDelete(old_dir, old_name, isdir);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
// need delete permissions if we'll be overwriting.
|
||
|
// need create permissions if new doesn't already exist.
|
||
|
err = new_node ?
|
||
|
FS.mayDelete(new_dir, new_name, isdir) :
|
||
|
FS.mayCreate(new_dir, new_name);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!old_dir.node_ops.rename) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
|
||
|
}
|
||
|
// if we are going to change the parent, check write permissions
|
||
|
if (new_dir !== old_dir) {
|
||
|
err = FS.nodePermissions(old_dir, 'w');
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
}
|
||
|
// remove the node from the lookup hash
|
||
|
FS.hashRemoveNode(old_node);
|
||
|
// do the underlying fs rename
|
||
|
try {
|
||
|
old_dir.node_ops.rename(old_node, new_dir, new_name);
|
||
|
} catch (e) {
|
||
|
throw e;
|
||
|
} finally {
|
||
|
// add the node back to the hash (in case node_ops.rename
|
||
|
// changed its name)
|
||
|
FS.hashAddNode(old_node);
|
||
|
}
|
||
|
},rmdir:function (path) {
|
||
|
var lookup = FS.lookupPath(path, { parent: true });
|
||
|
var parent = lookup.node;
|
||
|
var name = PATH.basename(path);
|
||
|
var node = FS.lookupNode(parent, name);
|
||
|
var err = FS.mayDelete(parent, name, true);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.rmdir) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
if (FS.isMountpoint(node)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
|
||
|
}
|
||
|
parent.node_ops.rmdir(parent, name);
|
||
|
FS.destroyNode(node);
|
||
|
},readdir:function (path) {
|
||
|
var lookup = FS.lookupPath(path, { follow: true });
|
||
|
var node = lookup.node;
|
||
|
if (!node.node_ops.readdir) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
|
||
|
}
|
||
|
return node.node_ops.readdir(node);
|
||
|
},unlink:function (path) {
|
||
|
var lookup = FS.lookupPath(path, { parent: true });
|
||
|
var parent = lookup.node;
|
||
|
var name = PATH.basename(path);
|
||
|
var node = FS.lookupNode(parent, name);
|
||
|
var err = FS.mayDelete(parent, name, false);
|
||
|
if (err) {
|
||
|
// POSIX says unlink should set EPERM, not EISDIR
|
||
|
if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.unlink) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
if (FS.isMountpoint(node)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
|
||
|
}
|
||
|
parent.node_ops.unlink(parent, name);
|
||
|
FS.destroyNode(node);
|
||
|
},readlink:function (path) {
|
||
|
var lookup = FS.lookupPath(path, { follow: false });
|
||
|
var link = lookup.node;
|
||
|
if (!link.node_ops.readlink) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
return link.node_ops.readlink(link);
|
||
|
},stat:function (path, dontFollow) {
|
||
|
var lookup = FS.lookupPath(path, { follow: !dontFollow });
|
||
|
var node = lookup.node;
|
||
|
if (!node.node_ops.getattr) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
return node.node_ops.getattr(node);
|
||
|
},lstat:function (path) {
|
||
|
return FS.stat(path, true);
|
||
|
},chmod:function (path, mode, dontFollow) {
|
||
|
var node;
|
||
|
if (typeof path === 'string') {
|
||
|
var lookup = FS.lookupPath(path, { follow: !dontFollow });
|
||
|
node = lookup.node;
|
||
|
} else {
|
||
|
node = path;
|
||
|
}
|
||
|
if (!node.node_ops.setattr) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
node.node_ops.setattr(node, {
|
||
|
mode: (mode & 4095) | (node.mode & ~4095),
|
||
|
timestamp: Date.now()
|
||
|
});
|
||
|
},lchmod:function (path, mode) {
|
||
|
FS.chmod(path, mode, true);
|
||
|
},fchmod:function (fd, mode) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
FS.chmod(stream.node, mode);
|
||
|
},chown:function (path, uid, gid, dontFollow) {
|
||
|
var node;
|
||
|
if (typeof path === 'string') {
|
||
|
var lookup = FS.lookupPath(path, { follow: !dontFollow });
|
||
|
node = lookup.node;
|
||
|
} else {
|
||
|
node = path;
|
||
|
}
|
||
|
if (!node.node_ops.setattr) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
node.node_ops.setattr(node, {
|
||
|
timestamp: Date.now()
|
||
|
// we ignore the uid / gid for now
|
||
|
});
|
||
|
},lchown:function (path, uid, gid) {
|
||
|
FS.chown(path, uid, gid, true);
|
||
|
},fchown:function (fd, uid, gid) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
FS.chown(stream.node, uid, gid);
|
||
|
},truncate:function (path, len) {
|
||
|
if (len < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var node;
|
||
|
if (typeof path === 'string') {
|
||
|
var lookup = FS.lookupPath(path, { follow: true });
|
||
|
node = lookup.node;
|
||
|
} else {
|
||
|
node = path;
|
||
|
}
|
||
|
if (!node.node_ops.setattr) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
|
||
|
}
|
||
|
if (!FS.isFile(node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var err = FS.nodePermissions(node, 'w');
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
node.node_ops.setattr(node, {
|
||
|
size: len,
|
||
|
timestamp: Date.now()
|
||
|
});
|
||
|
},ftruncate:function (fd, len) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
FS.truncate(stream.node, len);
|
||
|
},utime:function (path, atime, mtime) {
|
||
|
var lookup = FS.lookupPath(path, { follow: true });
|
||
|
var node = lookup.node;
|
||
|
node.node_ops.setattr(node, {
|
||
|
timestamp: Math.max(atime, mtime)
|
||
|
});
|
||
|
},open:function (path, flags, mode, fd_start, fd_end) {
|
||
|
flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
|
||
|
mode = typeof mode === 'undefined' ? 0666 : mode;
|
||
|
if ((flags & 64)) {
|
||
|
mode = (mode & 4095) | 32768;
|
||
|
} else {
|
||
|
mode = 0;
|
||
|
}
|
||
|
var node;
|
||
|
if (typeof path === 'object') {
|
||
|
node = path;
|
||
|
} else {
|
||
|
path = PATH.normalize(path);
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: !(flags & 131072)
|
||
|
});
|
||
|
node = lookup.node;
|
||
|
} catch (e) {
|
||
|
// ignore
|
||
|
}
|
||
|
}
|
||
|
// perhaps we need to create the node
|
||
|
if ((flags & 64)) {
|
||
|
if (node) {
|
||
|
// if O_CREAT and O_EXCL are set, error out if the node already exists
|
||
|
if ((flags & 128)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
|
||
|
}
|
||
|
} else {
|
||
|
// node doesn't exist, try to create it
|
||
|
node = FS.mknod(path, mode, 0);
|
||
|
}
|
||
|
}
|
||
|
if (!node) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
|
||
|
}
|
||
|
// can't truncate a device
|
||
|
if (FS.isChrdev(node.mode)) {
|
||
|
flags &= ~512;
|
||
|
}
|
||
|
// check permissions
|
||
|
var err = FS.mayOpen(node, flags);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
// do truncation if necessary
|
||
|
if ((flags & 512)) {
|
||
|
FS.truncate(node, 0);
|
||
|
}
|
||
|
// we've already handled these, don't pass down to the underlying vfs
|
||
|
flags &= ~(128 | 512);
|
||
|
|
||
|
// register the stream with the filesystem
|
||
|
var stream = FS.createStream({
|
||
|
node: node,
|
||
|
path: FS.getPath(node), // we want the absolute path to the node
|
||
|
flags: flags,
|
||
|
seekable: true,
|
||
|
position: 0,
|
||
|
stream_ops: node.stream_ops,
|
||
|
// used by the file family libc calls (fopen, fwrite, ferror, etc.)
|
||
|
ungotten: [],
|
||
|
error: false
|
||
|
}, fd_start, fd_end);
|
||
|
// call the new stream's open function
|
||
|
if (stream.stream_ops.open) {
|
||
|
stream.stream_ops.open(stream);
|
||
|
}
|
||
|
if (Module['logReadFiles'] && !(flags & 1)) {
|
||
|
if (!FS.readFiles) FS.readFiles = {};
|
||
|
if (!(path in FS.readFiles)) {
|
||
|
FS.readFiles[path] = 1;
|
||
|
Module['printErr']('read file: ' + path);
|
||
|
}
|
||
|
}
|
||
|
return stream;
|
||
|
},close:function (stream) {
|
||
|
try {
|
||
|
if (stream.stream_ops.close) {
|
||
|
stream.stream_ops.close(stream);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
throw e;
|
||
|
} finally {
|
||
|
FS.closeStream(stream.fd);
|
||
|
}
|
||
|
},llseek:function (stream, offset, whence) {
|
||
|
if (!stream.seekable || !stream.stream_ops.llseek) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
|
||
|
}
|
||
|
return stream.stream_ops.llseek(stream, offset, whence);
|
||
|
},read:function (stream, buffer, offset, length, position) {
|
||
|
if (length < 0 || position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 1) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
if (FS.isDir(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
|
||
|
}
|
||
|
if (!stream.stream_ops.read) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var seeking = true;
|
||
|
if (typeof position === 'undefined') {
|
||
|
position = stream.position;
|
||
|
seeking = false;
|
||
|
} else if (!stream.seekable) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
|
||
|
}
|
||
|
var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
|
||
|
if (!seeking) stream.position += bytesRead;
|
||
|
return bytesRead;
|
||
|
},write:function (stream, buffer, offset, length, position, canOwn) {
|
||
|
if (length < 0 || position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
if (FS.isDir(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
|
||
|
}
|
||
|
if (!stream.stream_ops.write) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var seeking = true;
|
||
|
if (typeof position === 'undefined') {
|
||
|
position = stream.position;
|
||
|
seeking = false;
|
||
|
} else if (!stream.seekable) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
|
||
|
}
|
||
|
if (stream.flags & 1024) {
|
||
|
// seek to the end before writing in append mode
|
||
|
FS.llseek(stream, 0, 2);
|
||
|
}
|
||
|
var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
|
||
|
if (!seeking) stream.position += bytesWritten;
|
||
|
return bytesWritten;
|
||
|
},allocate:function (stream, offset, length) {
|
||
|
if (offset < 0 || length <= 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
if (!stream.stream_ops.allocate) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
|
||
|
}
|
||
|
stream.stream_ops.allocate(stream, offset, length);
|
||
|
},mmap:function (stream, buffer, offset, length, position, prot, flags) {
|
||
|
// TODO if PROT is PROT_WRITE, make sure we have write access
|
||
|
if ((stream.flags & 2097155) === 1) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EACCES);
|
||
|
}
|
||
|
if (!stream.stream_ops.mmap) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);
|
||
|
},ioctl:function (stream, cmd, arg) {
|
||
|
if (!stream.stream_ops.ioctl) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);
|
||
|
}
|
||
|
return stream.stream_ops.ioctl(stream, cmd, arg);
|
||
|
},readFile:function (path, opts) {
|
||
|
opts = opts || {};
|
||
|
opts.flags = opts.flags || 'r';
|
||
|
opts.encoding = opts.encoding || 'binary';
|
||
|
var ret;
|
||
|
var stream = FS.open(path, opts.flags);
|
||
|
var stat = FS.stat(path);
|
||
|
var length = stat.size;
|
||
|
var buf = new Uint8Array(length);
|
||
|
FS.read(stream, buf, 0, length, 0);
|
||
|
if (opts.encoding === 'utf8') {
|
||
|
ret = '';
|
||
|
var utf8 = new Runtime.UTF8Processor();
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
ret += utf8.processCChar(buf[i]);
|
||
|
}
|
||
|
} else if (opts.encoding === 'binary') {
|
||
|
ret = buf;
|
||
|
} else {
|
||
|
throw new Error('Invalid encoding type "' + opts.encoding + '"');
|
||
|
}
|
||
|
FS.close(stream);
|
||
|
return ret;
|
||
|
},writeFile:function (path, data, opts) {
|
||
|
opts = opts || {};
|
||
|
opts.flags = opts.flags || 'w';
|
||
|
opts.encoding = opts.encoding || 'utf8';
|
||
|
var stream = FS.open(path, opts.flags, opts.mode);
|
||
|
if (opts.encoding === 'utf8') {
|
||
|
var utf8 = new Runtime.UTF8Processor();
|
||
|
var buf = new Uint8Array(utf8.processJSString(data));
|
||
|
FS.write(stream, buf, 0, buf.length, 0);
|
||
|
} else if (opts.encoding === 'binary') {
|
||
|
FS.write(stream, data, 0, data.length, 0);
|
||
|
} else {
|
||
|
throw new Error('Invalid encoding type "' + opts.encoding + '"');
|
||
|
}
|
||
|
FS.close(stream);
|
||
|
},cwd:function () {
|
||
|
return FS.currentPath;
|
||
|
},chdir:function (path) {
|
||
|
var lookup = FS.lookupPath(path, { follow: true });
|
||
|
if (!FS.isDir(lookup.node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
|
||
|
}
|
||
|
var err = FS.nodePermissions(lookup.node, 'x');
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
FS.currentPath = lookup.path;
|
||
|
},createDefaultDirectories:function () {
|
||
|
FS.mkdir('/tmp');
|
||
|
},createDefaultDevices:function () {
|
||
|
// create /dev
|
||
|
FS.mkdir('/dev');
|
||
|
// setup /dev/null
|
||
|
FS.registerDevice(FS.makedev(1, 3), {
|
||
|
read: function() { return 0; },
|
||
|
write: function() { return 0; }
|
||
|
});
|
||
|
FS.mkdev('/dev/null', FS.makedev(1, 3));
|
||
|
// setup /dev/tty and /dev/tty1
|
||
|
// stderr needs to print output using Module['printErr']
|
||
|
// so we register a second tty just for it.
|
||
|
TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
|
||
|
TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
|
||
|
FS.mkdev('/dev/tty', FS.makedev(5, 0));
|
||
|
FS.mkdev('/dev/tty1', FS.makedev(6, 0));
|
||
|
// we're not going to emulate the actual shm device,
|
||
|
// just create the tmp dirs that reside in it commonly
|
||
|
FS.mkdir('/dev/shm');
|
||
|
FS.mkdir('/dev/shm/tmp');
|
||
|
},createStandardStreams:function () {
|
||
|
// TODO deprecate the old functionality of a single
|
||
|
// input / output callback and that utilizes FS.createDevice
|
||
|
// and instead require a unique set of stream ops
|
||
|
|
||
|
// by default, we symlink the standard streams to the
|
||
|
// default tty devices. however, if the standard streams
|
||
|
// have been overwritten we create a unique device for
|
||
|
// them instead.
|
||
|
if (Module['stdin']) {
|
||
|
FS.createDevice('/dev', 'stdin', Module['stdin']);
|
||
|
} else {
|
||
|
FS.symlink('/dev/tty', '/dev/stdin');
|
||
|
}
|
||
|
if (Module['stdout']) {
|
||
|
FS.createDevice('/dev', 'stdout', null, Module['stdout']);
|
||
|
} else {
|
||
|
FS.symlink('/dev/tty', '/dev/stdout');
|
||
|
}
|
||
|
if (Module['stderr']) {
|
||
|
FS.createDevice('/dev', 'stderr', null, Module['stderr']);
|
||
|
} else {
|
||
|
FS.symlink('/dev/tty1', '/dev/stderr');
|
||
|
}
|
||
|
|
||
|
// open default streams for the stdin, stdout and stderr devices
|
||
|
var stdin = FS.open('/dev/stdin', 'r');
|
||
|
HEAP32[((_stdin)>>2)]=stdin.fd;
|
||
|
assert(stdin.fd === 1, 'invalid handle for stdin (' + stdin.fd + ')');
|
||
|
|
||
|
var stdout = FS.open('/dev/stdout', 'w');
|
||
|
HEAP32[((_stdout)>>2)]=stdout.fd;
|
||
|
assert(stdout.fd === 2, 'invalid handle for stdout (' + stdout.fd + ')');
|
||
|
|
||
|
var stderr = FS.open('/dev/stderr', 'w');
|
||
|
HEAP32[((_stderr)>>2)]=stderr.fd;
|
||
|
assert(stderr.fd === 3, 'invalid handle for stderr (' + stderr.fd + ')');
|
||
|
},ensureErrnoError:function () {
|
||
|
if (FS.ErrnoError) return;
|
||
|
FS.ErrnoError = function ErrnoError(errno) {
|
||
|
this.errno = errno;
|
||
|
for (var key in ERRNO_CODES) {
|
||
|
if (ERRNO_CODES[key] === errno) {
|
||
|
this.code = key;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
this.message = ERRNO_MESSAGES[errno];
|
||
|
};
|
||
|
FS.ErrnoError.prototype = new Error();
|
||
|
FS.ErrnoError.prototype.constructor = FS.ErrnoError;
|
||
|
// Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
|
||
|
[ERRNO_CODES.ENOENT].forEach(function(code) {
|
||
|
FS.genericErrors[code] = new FS.ErrnoError(code);
|
||
|
FS.genericErrors[code].stack = '<generic error, no stack>';
|
||
|
});
|
||
|
},staticInit:function () {
|
||
|
FS.ensureErrnoError();
|
||
|
|
||
|
FS.nameTable = new Array(4096);
|
||
|
|
||
|
FS.root = FS.createNode(null, '/', 16384 | 0777, 0);
|
||
|
FS.mount(MEMFS, {}, '/');
|
||
|
|
||
|
FS.createDefaultDirectories();
|
||
|
FS.createDefaultDevices();
|
||
|
},init:function (input, output, error) {
|
||
|
assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');
|
||
|
FS.init.initialized = true;
|
||
|
|
||
|
FS.ensureErrnoError();
|
||
|
|
||
|
// Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
|
||
|
Module['stdin'] = input || Module['stdin'];
|
||
|
Module['stdout'] = output || Module['stdout'];
|
||
|
Module['stderr'] = error || Module['stderr'];
|
||
|
|
||
|
FS.createStandardStreams();
|
||
|
},quit:function () {
|
||
|
FS.init.initialized = false;
|
||
|
for (var i = 0; i < FS.streams.length; i++) {
|
||
|
var stream = FS.streams[i];
|
||
|
if (!stream) {
|
||
|
continue;
|
||
|
}
|
||
|
FS.close(stream);
|
||
|
}
|
||
|
},getMode:function (canRead, canWrite) {
|
||
|
var mode = 0;
|
||
|
if (canRead) mode |= 292 | 73;
|
||
|
if (canWrite) mode |= 146;
|
||
|
return mode;
|
||
|
},joinPath:function (parts, forceRelative) {
|
||
|
var path = PATH.join.apply(null, parts);
|
||
|
if (forceRelative && path[0] == '/') path = path.substr(1);
|
||
|
return path;
|
||
|
},absolutePath:function (relative, base) {
|
||
|
return PATH.resolve(base, relative);
|
||
|
},standardizePath:function (path) {
|
||
|
return PATH.normalize(path);
|
||
|
},findObject:function (path, dontResolveLastLink) {
|
||
|
var ret = FS.analyzePath(path, dontResolveLastLink);
|
||
|
if (ret.exists) {
|
||
|
return ret.object;
|
||
|
} else {
|
||
|
___setErrNo(ret.error);
|
||
|
return null;
|
||
|
}
|
||
|
},analyzePath:function (path, dontResolveLastLink) {
|
||
|
// operate from within the context of the symlink's target
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
|
||
|
path = lookup.path;
|
||
|
} catch (e) {
|
||
|
}
|
||
|
var ret = {
|
||
|
isRoot: false, exists: false, error: 0, name: null, path: null, object: null,
|
||
|
parentExists: false, parentPath: null, parentObject: null
|
||
|
};
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, { parent: true });
|
||
|
ret.parentExists = true;
|
||
|
ret.parentPath = lookup.path;
|
||
|
ret.parentObject = lookup.node;
|
||
|
ret.name = PATH.basename(path);
|
||
|
lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
|
||
|
ret.exists = true;
|
||
|
ret.path = lookup.path;
|
||
|
ret.object = lookup.node;
|
||
|
ret.name = lookup.node.name;
|
||
|
ret.isRoot = lookup.path === '/';
|
||
|
} catch (e) {
|
||
|
ret.error = e.errno;
|
||
|
};
|
||
|
return ret;
|
||
|
},createFolder:function (parent, name, canRead, canWrite) {
|
||
|
var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
|
||
|
var mode = FS.getMode(canRead, canWrite);
|
||
|
return FS.mkdir(path, mode);
|
||
|
},createPath:function (parent, path, canRead, canWrite) {
|
||
|
parent = typeof parent === 'string' ? parent : FS.getPath(parent);
|
||
|
var parts = path.split('/').reverse();
|
||
|
while (parts.length) {
|
||
|
var part = parts.pop();
|
||
|
if (!part) continue;
|
||
|
var current = PATH.join2(parent, part);
|
||
|
try {
|
||
|
FS.mkdir(current);
|
||
|
} catch (e) {
|
||
|
// ignore EEXIST
|
||
|
}
|
||
|
parent = current;
|
||
|
}
|
||
|
return current;
|
||
|
},createFile:function (parent, name, properties, canRead, canWrite) {
|
||
|
var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
|
||
|
var mode = FS.getMode(canRead, canWrite);
|
||
|
return FS.create(path, mode);
|
||
|
},createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {
|
||
|
var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
|
||
|
var mode = FS.getMode(canRead, canWrite);
|
||
|
var node = FS.create(path, mode);
|
||
|
if (data) {
|
||
|
if (typeof data === 'string') {
|
||
|
var arr = new Array(data.length);
|
||
|
for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
|
||
|
data = arr;
|
||
|
}
|
||
|
// make sure we can write to the file
|
||
|
FS.chmod(node, mode | 146);
|
||
|
var stream = FS.open(node, 'w');
|
||
|
FS.write(stream, data, 0, data.length, 0, canOwn);
|
||
|
FS.close(stream);
|
||
|
FS.chmod(node, mode);
|
||
|
}
|
||
|
return node;
|
||
|
},createDevice:function (parent, name, input, output) {
|
||
|
var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
|
||
|
var mode = FS.getMode(!!input, !!output);
|
||
|
if (!FS.createDevice.major) FS.createDevice.major = 64;
|
||
|
var dev = FS.makedev(FS.createDevice.major++, 0);
|
||
|
// Create a fake device that a set of stream ops to emulate
|
||
|
// the old behavior.
|
||
|
FS.registerDevice(dev, {
|
||
|
open: function(stream) {
|
||
|
stream.seekable = false;
|
||
|
},
|
||
|
close: function(stream) {
|
||
|
// flush any pending line data
|
||
|
if (output && output.buffer && output.buffer.length) {
|
||
|
output(10);
|
||
|
}
|
||
|
},
|
||
|
read: function(stream, buffer, offset, length, pos /* ignored */) {
|
||
|
var bytesRead = 0;
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
var result;
|
||
|
try {
|
||
|
result = input();
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
if (result === undefined && bytesRead === 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
|
||
|
}
|
||
|
if (result === null || result === undefined) break;
|
||
|
bytesRead++;
|
||
|
buffer[offset+i] = result;
|
||
|
}
|
||
|
if (bytesRead) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return bytesRead;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, pos) {
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
try {
|
||
|
output(buffer[offset+i]);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
}
|
||
|
if (length) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
});
|
||
|
return FS.mkdev(path, mode, dev);
|
||
|
},createLink:function (parent, name, target, canRead, canWrite) {
|
||
|
var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
|
||
|
return FS.symlink(target, path);
|
||
|
},forceLoadFile:function (obj) {
|
||
|
if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
|
||
|
var success = true;
|
||
|
if (typeof XMLHttpRequest !== 'undefined') {
|
||
|
throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
||
|
} else if (Module['read']) {
|
||
|
// Command-line.
|
||
|
try {
|
||
|
// WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
|
||
|
// read() will try to parse UTF8.
|
||
|
obj.contents = intArrayFromString(Module['read'](obj.url), true);
|
||
|
} catch (e) {
|
||
|
success = false;
|
||
|
}
|
||
|
} else {
|
||
|
throw new Error('Cannot load without read() or XMLHttpRequest.');
|
||
|
}
|
||
|
if (!success) ___setErrNo(ERRNO_CODES.EIO);
|
||
|
return success;
|
||
|
},createLazyFile:function (parent, name, url, canRead, canWrite) {
|
||
|
if (typeof XMLHttpRequest !== 'undefined') {
|
||
|
if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';
|
||
|
// Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
|
||
|
function LazyUint8Array() {
|
||
|
this.lengthKnown = false;
|
||
|
this.chunks = []; // Loaded chunks. Index is the chunk number
|
||
|
}
|
||
|
LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {
|
||
|
if (idx > this.length-1 || idx < 0) {
|
||
|
return undefined;
|
||
|
}
|
||
|
var chunkOffset = idx % this.chunkSize;
|
||
|
var chunkNum = Math.floor(idx / this.chunkSize);
|
||
|
return this.getter(chunkNum)[chunkOffset];
|
||
|
}
|
||
|
LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {
|
||
|
this.getter = getter;
|
||
|
}
|
||
|
LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {
|
||
|
// Find length
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open('HEAD', url, false);
|
||
|
xhr.send(null);
|
||
|
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
|
||
|
var datalength = Number(xhr.getResponseHeader("Content-length"));
|
||
|
var header;
|
||
|
var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
|
||
|
var chunkSize = 1024*1024; // Chunk size in bytes
|
||
|
|
||
|
if (!hasByteServing) chunkSize = datalength;
|
||
|
|
||
|
// Function to get a range from the remote URL.
|
||
|
var doXHR = (function(from, to) {
|
||
|
if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
|
||
|
if (to > datalength-1) throw new Error("only " + datalength + " bytes available! programmer error!");
|
||
|
|
||
|
// TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open('GET', url, false);
|
||
|
if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
|
||
|
|
||
|
// Some hints to the browser that we want binary data.
|
||
|
if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';
|
||
|
if (xhr.overrideMimeType) {
|
||
|
xhr.overrideMimeType('text/plain; charset=x-user-defined');
|
||
|
}
|
||
|
|
||
|
xhr.send(null);
|
||
|
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
|
||
|
if (xhr.response !== undefined) {
|
||
|
return new Uint8Array(xhr.response || []);
|
||
|
} else {
|
||
|
return intArrayFromString(xhr.responseText || '', true);
|
||
|
}
|
||
|
});
|
||
|
var lazyArray = this;
|
||
|
lazyArray.setDataGetter(function(chunkNum) {
|
||
|
var start = chunkNum * chunkSize;
|
||
|
var end = (chunkNum+1) * chunkSize - 1; // including this byte
|
||
|
end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block
|
||
|
if (typeof(lazyArray.chunks[chunkNum]) === "undefined") {
|
||
|
lazyArray.chunks[chunkNum] = doXHR(start, end);
|
||
|
}
|
||
|
if (typeof(lazyArray.chunks[chunkNum]) === "undefined") throw new Error("doXHR failed!");
|
||
|
return lazyArray.chunks[chunkNum];
|
||
|
});
|
||
|
|
||
|
this._length = datalength;
|
||
|
this._chunkSize = chunkSize;
|
||
|
this.lengthKnown = true;
|
||
|
}
|
||
|
|
||
|
var lazyArray = new LazyUint8Array();
|
||
|
Object.defineProperty(lazyArray, "length", {
|
||
|
get: function() {
|
||
|
if(!this.lengthKnown) {
|
||
|
this.cacheLength();
|
||
|
}
|
||
|
return this._length;
|
||
|
}
|
||
|
});
|
||
|
Object.defineProperty(lazyArray, "chunkSize", {
|
||
|
get: function() {
|
||
|
if(!this.lengthKnown) {
|
||
|
this.cacheLength();
|
||
|
}
|
||
|
return this._chunkSize;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var properties = { isDevice: false, contents: lazyArray };
|
||
|
} else {
|
||
|
var properties = { isDevice: false, url: url };
|
||
|
}
|
||
|
|
||
|
var node = FS.createFile(parent, name, properties, canRead, canWrite);
|
||
|
// This is a total hack, but I want to get this lazy file code out of the
|
||
|
// core of MEMFS. If we want to keep this lazy file concept I feel it should
|
||
|
// be its own thin LAZYFS proxying calls to MEMFS.
|
||
|
if (properties.contents) {
|
||
|
node.contents = properties.contents;
|
||
|
} else if (properties.url) {
|
||
|
node.contents = null;
|
||
|
node.url = properties.url;
|
||
|
}
|
||
|
// override each stream op with one that tries to force load the lazy file first
|
||
|
var stream_ops = {};
|
||
|
var keys = Object.keys(node.stream_ops);
|
||
|
keys.forEach(function(key) {
|
||
|
var fn = node.stream_ops[key];
|
||
|
stream_ops[key] = function forceLoadLazyFile() {
|
||
|
if (!FS.forceLoadFile(node)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
return fn.apply(null, arguments);
|
||
|
};
|
||
|
});
|
||
|
// use a custom read function
|
||
|
stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {
|
||
|
if (!FS.forceLoadFile(node)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
var contents = stream.node.contents;
|
||
|
if (position >= contents.length)
|
||
|
return 0;
|
||
|
var size = Math.min(contents.length - position, length);
|
||
|
assert(size >= 0);
|
||
|
if (contents.slice) { // normal array
|
||
|
for (var i = 0; i < size; i++) {
|
||
|
buffer[offset + i] = contents[position + i];
|
||
|
}
|
||
|
} else {
|
||
|
for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR
|
||
|
buffer[offset + i] = contents.get(position + i);
|
||
|
}
|
||
|
}
|
||
|
return size;
|
||
|
};
|
||
|
node.stream_ops = stream_ops;
|
||
|
return node;
|
||
|
},createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {
|
||
|
Browser.init();
|
||
|
// TODO we should allow people to just pass in a complete filename instead
|
||
|
// of parent and name being that we just join them anyways
|
||
|
var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
|
||
|
function processData(byteArray) {
|
||
|
function finish(byteArray) {
|
||
|
if (!dontCreateFile) {
|
||
|
FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
|
||
|
}
|
||
|
if (onload) onload();
|
||
|
removeRunDependency('cp ' + fullname);
|
||
|
}
|
||
|
var handled = false;
|
||
|
Module['preloadPlugins'].forEach(function(plugin) {
|
||
|
if (handled) return;
|
||
|
if (plugin['canHandle'](fullname)) {
|
||
|
plugin['handle'](byteArray, fullname, finish, function() {
|
||
|
if (onerror) onerror();
|
||
|
removeRunDependency('cp ' + fullname);
|
||
|
});
|
||
|
handled = true;
|
||
|
}
|
||
|
});
|
||
|
if (!handled) finish(byteArray);
|
||
|
}
|
||
|
addRunDependency('cp ' + fullname);
|
||
|
if (typeof url == 'string') {
|
||
|
Browser.asyncLoad(url, function(byteArray) {
|
||
|
processData(byteArray);
|
||
|
}, onerror);
|
||
|
} else {
|
||
|
processData(url);
|
||
|
}
|
||
|
},indexedDB:function () {
|
||
|
return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
||
|
},DB_NAME:function () {
|
||
|
return 'EM_FS_' + window.location.pathname;
|
||
|
},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function (paths, onload, onerror) {
|
||
|
onload = onload || function(){};
|
||
|
onerror = onerror || function(){};
|
||
|
var indexedDB = FS.indexedDB();
|
||
|
try {
|
||
|
var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
|
||
|
} catch (e) {
|
||
|
return onerror(e);
|
||
|
}
|
||
|
openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {
|
||
|
console.log('creating db');
|
||
|
var db = openRequest.result;
|
||
|
db.createObjectStore(FS.DB_STORE_NAME);
|
||
|
};
|
||
|
openRequest.onsuccess = function openRequest_onsuccess() {
|
||
|
var db = openRequest.result;
|
||
|
var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
|
||
|
var files = transaction.objectStore(FS.DB_STORE_NAME);
|
||
|
var ok = 0, fail = 0, total = paths.length;
|
||
|
function finish() {
|
||
|
if (fail == 0) onload(); else onerror();
|
||
|
}
|
||
|
paths.forEach(function(path) {
|
||
|
var putRequest = files.put(FS.analyzePath(path).object.contents, path);
|
||
|
putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };
|
||
|
putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };
|
||
|
});
|
||
|
transaction.onerror = onerror;
|
||
|
};
|
||
|
openRequest.onerror = onerror;
|
||
|
},loadFilesFromDB:function (paths, onload, onerror) {
|
||
|
onload = onload || function(){};
|
||
|
onerror = onerror || function(){};
|
||
|
var indexedDB = FS.indexedDB();
|
||
|
try {
|
||
|
var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
|
||
|
} catch (e) {
|
||
|
return onerror(e);
|
||
|
}
|
||
|
openRequest.onupgradeneeded = onerror; // no database to load from
|
||
|
openRequest.onsuccess = function openRequest_onsuccess() {
|
||
|
var db = openRequest.result;
|
||
|
try {
|
||
|
var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
|
||
|
} catch(e) {
|
||
|
onerror(e);
|
||
|
return;
|
||
|
}
|
||
|
var files = transaction.objectStore(FS.DB_STORE_NAME);
|
||
|
var ok = 0, fail = 0, total = paths.length;
|
||
|
function finish() {
|
||
|
if (fail == 0) onload(); else onerror();
|
||
|
}
|
||
|
paths.forEach(function(path) {
|
||
|
var getRequest = files.get(path);
|
||
|
getRequest.onsuccess = function getRequest_onsuccess() {
|
||
|
if (FS.analyzePath(path).exists) {
|
||
|
FS.unlink(path);
|
||
|
}
|
||
|
FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
|
||
|
ok++;
|
||
|
if (ok + fail == total) finish();
|
||
|
};
|
||
|
getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };
|
||
|
});
|
||
|
transaction.onerror = onerror;
|
||
|
};
|
||
|
openRequest.onerror = onerror;
|
||
|
}};function _close(fildes) {
|
||
|
// int close(int fildes);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/close.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
try {
|
||
|
FS.close(stream);
|
||
|
return 0;
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _fsync(fildes) {
|
||
|
// int fsync(int fildes);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fsync.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (stream) {
|
||
|
// We write directly to the file system, so there's nothing to do here.
|
||
|
return 0;
|
||
|
} else {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _fclose(stream) {
|
||
|
// int fclose(FILE *stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fclose.html
|
||
|
_fsync(stream);
|
||
|
return _close(stream);
|
||
|
}
|
||
|
|
||
|
function _pthread_mutex_lock() {}
|
||
|
|
||
|
function _FcPatternBuild() {
|
||
|
Module['printErr']('missing function: FcPatternBuild'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _UItoF=true;
|
||
|
|
||
|
|
||
|
var _emscripten_check_longjmp=true;
|
||
|
|
||
|
|
||
|
|
||
|
function _isspace(chr) {
|
||
|
return (chr == 32) || (chr >= 9 && chr <= 13);
|
||
|
}function __parseInt(str, endptr, base, min, max, bits, unsign) {
|
||
|
// Skip space.
|
||
|
while (_isspace(HEAP8[(str)])) str++;
|
||
|
|
||
|
// Check for a plus/minus sign.
|
||
|
var multiplier = 1;
|
||
|
if (HEAP8[(str)] == 45) {
|
||
|
multiplier = -1;
|
||
|
str++;
|
||
|
} else if (HEAP8[(str)] == 43) {
|
||
|
str++;
|
||
|
}
|
||
|
|
||
|
// Find base.
|
||
|
var finalBase = base;
|
||
|
if (!finalBase) {
|
||
|
if (HEAP8[(str)] == 48) {
|
||
|
if (HEAP8[((str+1)|0)] == 120 ||
|
||
|
HEAP8[((str+1)|0)] == 88) {
|
||
|
finalBase = 16;
|
||
|
str += 2;
|
||
|
} else {
|
||
|
finalBase = 8;
|
||
|
str++;
|
||
|
}
|
||
|
}
|
||
|
} else if (finalBase==16) {
|
||
|
if (HEAP8[(str)] == 48) {
|
||
|
if (HEAP8[((str+1)|0)] == 120 ||
|
||
|
HEAP8[((str+1)|0)] == 88) {
|
||
|
str += 2;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (!finalBase) finalBase = 10;
|
||
|
|
||
|
// Get digits.
|
||
|
var chr;
|
||
|
var ret = 0;
|
||
|
while ((chr = HEAP8[(str)]) != 0) {
|
||
|
var digit = parseInt(String.fromCharCode(chr), finalBase);
|
||
|
if (isNaN(digit)) {
|
||
|
break;
|
||
|
} else {
|
||
|
ret = ret * finalBase + digit;
|
||
|
str++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Apply sign.
|
||
|
ret *= multiplier;
|
||
|
|
||
|
// Set end pointer.
|
||
|
if (endptr) {
|
||
|
HEAP32[((endptr)>>2)]=str;
|
||
|
}
|
||
|
|
||
|
// Unsign if needed.
|
||
|
if (unsign) {
|
||
|
if (Math.abs(ret) > max) {
|
||
|
ret = max;
|
||
|
___setErrNo(ERRNO_CODES.ERANGE);
|
||
|
} else {
|
||
|
ret = unSign(ret, bits);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Validate range.
|
||
|
if (ret > max || ret < min) {
|
||
|
ret = ret > max ? max : min;
|
||
|
___setErrNo(ERRNO_CODES.ERANGE);
|
||
|
}
|
||
|
|
||
|
if (bits == 64) {
|
||
|
return ((asm["setTempRet0"]((tempDouble=ret,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)),ret>>>0)|0);
|
||
|
}
|
||
|
|
||
|
return ret;
|
||
|
}function _strtol(str, endptr, base) {
|
||
|
return __parseInt(str, endptr, base, -2147483648, 2147483647, 32); // LONG_MIN, LONG_MAX.
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
var _mkport=undefined;var SOCKFS={mount:function (mount) {
|
||
|
return FS.createNode(null, '/', 16384 | 0777, 0);
|
||
|
},createSocket:function (family, type, protocol) {
|
||
|
var streaming = type == 1;
|
||
|
if (protocol) {
|
||
|
assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp
|
||
|
}
|
||
|
|
||
|
// create our internal socket structure
|
||
|
var sock = {
|
||
|
family: family,
|
||
|
type: type,
|
||
|
protocol: protocol,
|
||
|
server: null,
|
||
|
peers: {},
|
||
|
pending: [],
|
||
|
recv_queue: [],
|
||
|
sock_ops: SOCKFS.websocket_sock_ops
|
||
|
};
|
||
|
|
||
|
// create the filesystem node to store the socket structure
|
||
|
var name = SOCKFS.nextname();
|
||
|
var node = FS.createNode(SOCKFS.root, name, 49152, 0);
|
||
|
node.sock = sock;
|
||
|
|
||
|
// and the wrapping stream that enables library functions such
|
||
|
// as read and write to indirectly interact with the socket
|
||
|
var stream = FS.createStream({
|
||
|
path: name,
|
||
|
node: node,
|
||
|
flags: FS.modeStringToFlags('r+'),
|
||
|
seekable: false,
|
||
|
stream_ops: SOCKFS.stream_ops
|
||
|
});
|
||
|
|
||
|
// map the new stream to the socket structure (sockets have a 1:1
|
||
|
// relationship with a stream)
|
||
|
sock.stream = stream;
|
||
|
|
||
|
return sock;
|
||
|
},getSocket:function (fd) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream || !FS.isSocket(stream.node.mode)) {
|
||
|
return null;
|
||
|
}
|
||
|
return stream.node.sock;
|
||
|
},stream_ops:{poll:function (stream) {
|
||
|
var sock = stream.node.sock;
|
||
|
return sock.sock_ops.poll(sock);
|
||
|
},ioctl:function (stream, request, varargs) {
|
||
|
var sock = stream.node.sock;
|
||
|
return sock.sock_ops.ioctl(sock, request, varargs);
|
||
|
},read:function (stream, buffer, offset, length, position /* ignored */) {
|
||
|
var sock = stream.node.sock;
|
||
|
var msg = sock.sock_ops.recvmsg(sock, length);
|
||
|
if (!msg) {
|
||
|
// socket is closed
|
||
|
return 0;
|
||
|
}
|
||
|
buffer.set(msg.buffer, offset);
|
||
|
return msg.buffer.length;
|
||
|
},write:function (stream, buffer, offset, length, position /* ignored */) {
|
||
|
var sock = stream.node.sock;
|
||
|
return sock.sock_ops.sendmsg(sock, buffer, offset, length);
|
||
|
},close:function (stream) {
|
||
|
var sock = stream.node.sock;
|
||
|
sock.sock_ops.close(sock);
|
||
|
}},nextname:function () {
|
||
|
if (!SOCKFS.nextname.current) {
|
||
|
SOCKFS.nextname.current = 0;
|
||
|
}
|
||
|
return 'socket[' + (SOCKFS.nextname.current++) + ']';
|
||
|
},websocket_sock_ops:{createPeer:function (sock, addr, port) {
|
||
|
var ws;
|
||
|
|
||
|
if (typeof addr === 'object') {
|
||
|
ws = addr;
|
||
|
addr = null;
|
||
|
port = null;
|
||
|
}
|
||
|
|
||
|
if (ws) {
|
||
|
// for sockets that've already connected (e.g. we're the server)
|
||
|
// we can inspect the _socket property for the address
|
||
|
if (ws._socket) {
|
||
|
addr = ws._socket.remoteAddress;
|
||
|
port = ws._socket.remotePort;
|
||
|
}
|
||
|
// if we're just now initializing a connection to the remote,
|
||
|
// inspect the url property
|
||
|
else {
|
||
|
var result = /ws[s]?:\/\/([^:]+):(\d+)/.exec(ws.url);
|
||
|
if (!result) {
|
||
|
throw new Error('WebSocket URL must be in the format ws(s)://address:port');
|
||
|
}
|
||
|
addr = result[1];
|
||
|
port = parseInt(result[2], 10);
|
||
|
}
|
||
|
} else {
|
||
|
// create the actual websocket object and connect
|
||
|
try {
|
||
|
var url = 'ws://' + addr + ':' + port;
|
||
|
// the node ws library API is slightly different than the browser's
|
||
|
var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];
|
||
|
// If node we use the ws library.
|
||
|
var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];
|
||
|
ws = new WebSocket(url, opts);
|
||
|
ws.binaryType = 'arraybuffer';
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
var peer = {
|
||
|
addr: addr,
|
||
|
port: port,
|
||
|
socket: ws,
|
||
|
dgram_send_queue: []
|
||
|
};
|
||
|
|
||
|
SOCKFS.websocket_sock_ops.addPeer(sock, peer);
|
||
|
SOCKFS.websocket_sock_ops.handlePeerEvents(sock, peer);
|
||
|
|
||
|
// if this is a bound dgram socket, send the port number first to allow
|
||
|
// us to override the ephemeral port reported to us by remotePort on the
|
||
|
// remote end.
|
||
|
if (sock.type === 2 && typeof sock.sport !== 'undefined') {
|
||
|
peer.dgram_send_queue.push(new Uint8Array([
|
||
|
255, 255, 255, 255,
|
||
|
'p'.charCodeAt(0), 'o'.charCodeAt(0), 'r'.charCodeAt(0), 't'.charCodeAt(0),
|
||
|
((sock.sport & 0xff00) >> 8) , (sock.sport & 0xff)
|
||
|
]));
|
||
|
}
|
||
|
|
||
|
return peer;
|
||
|
},getPeer:function (sock, addr, port) {
|
||
|
return sock.peers[addr + ':' + port];
|
||
|
},addPeer:function (sock, peer) {
|
||
|
sock.peers[peer.addr + ':' + peer.port] = peer;
|
||
|
},removePeer:function (sock, peer) {
|
||
|
delete sock.peers[peer.addr + ':' + peer.port];
|
||
|
},handlePeerEvents:function (sock, peer) {
|
||
|
var first = true;
|
||
|
|
||
|
var handleOpen = function () {
|
||
|
try {
|
||
|
var queued = peer.dgram_send_queue.shift();
|
||
|
while (queued) {
|
||
|
peer.socket.send(queued);
|
||
|
queued = peer.dgram_send_queue.shift();
|
||
|
}
|
||
|
} catch (e) {
|
||
|
// not much we can do here in the way of proper error handling as we've already
|
||
|
// lied and said this data was sent. shut it down.
|
||
|
peer.socket.close();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function handleMessage(data) {
|
||
|
assert(typeof data !== 'string' && data.byteLength !== undefined); // must receive an ArrayBuffer
|
||
|
data = new Uint8Array(data); // make a typed array view on the array buffer
|
||
|
|
||
|
|
||
|
// if this is the port message, override the peer's port with it
|
||
|
var wasfirst = first;
|
||
|
first = false;
|
||
|
if (wasfirst &&
|
||
|
data.length === 10 &&
|
||
|
data[0] === 255 && data[1] === 255 && data[2] === 255 && data[3] === 255 &&
|
||
|
data[4] === 'p'.charCodeAt(0) && data[5] === 'o'.charCodeAt(0) && data[6] === 'r'.charCodeAt(0) && data[7] === 't'.charCodeAt(0)) {
|
||
|
// update the peer's port and it's key in the peer map
|
||
|
var newport = ((data[8] << 8) | data[9]);
|
||
|
SOCKFS.websocket_sock_ops.removePeer(sock, peer);
|
||
|
peer.port = newport;
|
||
|
SOCKFS.websocket_sock_ops.addPeer(sock, peer);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
sock.recv_queue.push({ addr: peer.addr, port: peer.port, data: data });
|
||
|
};
|
||
|
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
peer.socket.on('open', handleOpen);
|
||
|
peer.socket.on('message', function(data, flags) {
|
||
|
if (!flags.binary) {
|
||
|
return;
|
||
|
}
|
||
|
handleMessage((new Uint8Array(data)).buffer); // copy from node Buffer -> ArrayBuffer
|
||
|
});
|
||
|
peer.socket.on('error', function() {
|
||
|
// don't throw
|
||
|
});
|
||
|
} else {
|
||
|
peer.socket.onopen = handleOpen;
|
||
|
peer.socket.onmessage = function peer_socket_onmessage(event) {
|
||
|
handleMessage(event.data);
|
||
|
};
|
||
|
}
|
||
|
},poll:function (sock) {
|
||
|
if (sock.type === 1 && sock.server) {
|
||
|
// listen sockets should only say they're available for reading
|
||
|
// if there are pending clients.
|
||
|
return sock.pending.length ? (64 | 1) : 0;
|
||
|
}
|
||
|
|
||
|
var mask = 0;
|
||
|
var dest = sock.type === 1 ? // we only care about the socket state for connection-based sockets
|
||
|
SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport) :
|
||
|
null;
|
||
|
|
||
|
if (sock.recv_queue.length ||
|
||
|
!dest || // connection-less sockets are always ready to read
|
||
|
(dest && dest.socket.readyState === dest.socket.CLOSING) ||
|
||
|
(dest && dest.socket.readyState === dest.socket.CLOSED)) { // let recv return 0 once closed
|
||
|
mask |= (64 | 1);
|
||
|
}
|
||
|
|
||
|
if (!dest || // connection-less sockets are always ready to write
|
||
|
(dest && dest.socket.readyState === dest.socket.OPEN)) {
|
||
|
mask |= 4;
|
||
|
}
|
||
|
|
||
|
if ((dest && dest.socket.readyState === dest.socket.CLOSING) ||
|
||
|
(dest && dest.socket.readyState === dest.socket.CLOSED)) {
|
||
|
mask |= 16;
|
||
|
}
|
||
|
|
||
|
return mask;
|
||
|
},ioctl:function (sock, request, arg) {
|
||
|
switch (request) {
|
||
|
case 21531:
|
||
|
var bytes = 0;
|
||
|
if (sock.recv_queue.length) {
|
||
|
bytes = sock.recv_queue[0].data.length;
|
||
|
}
|
||
|
HEAP32[((arg)>>2)]=bytes;
|
||
|
return 0;
|
||
|
default:
|
||
|
return ERRNO_CODES.EINVAL;
|
||
|
}
|
||
|
},close:function (sock) {
|
||
|
// if we've spawned a listen server, close it
|
||
|
if (sock.server) {
|
||
|
try {
|
||
|
sock.server.close();
|
||
|
} catch (e) {
|
||
|
}
|
||
|
sock.server = null;
|
||
|
}
|
||
|
// close any peer connections
|
||
|
var peers = Object.keys(sock.peers);
|
||
|
for (var i = 0; i < peers.length; i++) {
|
||
|
var peer = sock.peers[peers[i]];
|
||
|
try {
|
||
|
peer.socket.close();
|
||
|
} catch (e) {
|
||
|
}
|
||
|
SOCKFS.websocket_sock_ops.removePeer(sock, peer);
|
||
|
}
|
||
|
return 0;
|
||
|
},bind:function (sock, addr, port) {
|
||
|
if (typeof sock.saddr !== 'undefined' || typeof sock.sport !== 'undefined') {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound
|
||
|
}
|
||
|
sock.saddr = addr;
|
||
|
sock.sport = port || _mkport();
|
||
|
// in order to emulate dgram sockets, we need to launch a listen server when
|
||
|
// binding on a connection-less socket
|
||
|
// note: this is only required on the server side
|
||
|
if (sock.type === 2) {
|
||
|
// close the existing server if it exists
|
||
|
if (sock.server) {
|
||
|
sock.server.close();
|
||
|
sock.server = null;
|
||
|
}
|
||
|
// swallow error operation not supported error that occurs when binding in the
|
||
|
// browser where this isn't supported
|
||
|
try {
|
||
|
sock.sock_ops.listen(sock, 0);
|
||
|
} catch (e) {
|
||
|
if (!(e instanceof FS.ErrnoError)) throw e;
|
||
|
if (e.errno !== ERRNO_CODES.EOPNOTSUPP) throw e;
|
||
|
}
|
||
|
}
|
||
|
},connect:function (sock, addr, port) {
|
||
|
if (sock.server) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);
|
||
|
}
|
||
|
|
||
|
// TODO autobind
|
||
|
// if (!sock.addr && sock.type == 2) {
|
||
|
// }
|
||
|
|
||
|
// early out if we're already connected / in the middle of connecting
|
||
|
if (typeof sock.daddr !== 'undefined' && typeof sock.dport !== 'undefined') {
|
||
|
var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);
|
||
|
if (dest) {
|
||
|
if (dest.socket.readyState === dest.socket.CONNECTING) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EALREADY);
|
||
|
} else {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EISCONN);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// add the socket to our peer list and set our
|
||
|
// destination address / port to match
|
||
|
var peer = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);
|
||
|
sock.daddr = peer.addr;
|
||
|
sock.dport = peer.port;
|
||
|
|
||
|
// always "fail" in non-blocking mode
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);
|
||
|
},listen:function (sock, backlog) {
|
||
|
if (!ENVIRONMENT_IS_NODE) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
|
||
|
}
|
||
|
if (sock.server) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening
|
||
|
}
|
||
|
var WebSocketServer = require('ws').Server;
|
||
|
var host = sock.saddr;
|
||
|
sock.server = new WebSocketServer({
|
||
|
host: host,
|
||
|
port: sock.sport
|
||
|
// TODO support backlog
|
||
|
});
|
||
|
|
||
|
sock.server.on('connection', function(ws) {
|
||
|
if (sock.type === 1) {
|
||
|
var newsock = SOCKFS.createSocket(sock.family, sock.type, sock.protocol);
|
||
|
|
||
|
// create a peer on the new socket
|
||
|
var peer = SOCKFS.websocket_sock_ops.createPeer(newsock, ws);
|
||
|
newsock.daddr = peer.addr;
|
||
|
newsock.dport = peer.port;
|
||
|
|
||
|
// push to queue for accept to pick up
|
||
|
sock.pending.push(newsock);
|
||
|
} else {
|
||
|
// create a peer on the listen socket so calling sendto
|
||
|
// with the listen socket and an address will resolve
|
||
|
// to the correct client
|
||
|
SOCKFS.websocket_sock_ops.createPeer(sock, ws);
|
||
|
}
|
||
|
});
|
||
|
sock.server.on('closed', function() {
|
||
|
sock.server = null;
|
||
|
});
|
||
|
sock.server.on('error', function() {
|
||
|
// don't throw
|
||
|
});
|
||
|
},accept:function (listensock) {
|
||
|
if (!listensock.server) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var newsock = listensock.pending.shift();
|
||
|
newsock.stream.flags = listensock.stream.flags;
|
||
|
return newsock;
|
||
|
},getname:function (sock, peer) {
|
||
|
var addr, port;
|
||
|
if (peer) {
|
||
|
if (sock.daddr === undefined || sock.dport === undefined) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
|
||
|
}
|
||
|
addr = sock.daddr;
|
||
|
port = sock.dport;
|
||
|
} else {
|
||
|
// TODO saddr and sport will be set for bind()'d UDP sockets, but what
|
||
|
// should we be returning for TCP sockets that've been connect()'d?
|
||
|
addr = sock.saddr || 0;
|
||
|
port = sock.sport || 0;
|
||
|
}
|
||
|
return { addr: addr, port: port };
|
||
|
},sendmsg:function (sock, buffer, offset, length, addr, port) {
|
||
|
if (sock.type === 2) {
|
||
|
// connection-less sockets will honor the message address,
|
||
|
// and otherwise fall back to the bound destination address
|
||
|
if (addr === undefined || port === undefined) {
|
||
|
addr = sock.daddr;
|
||
|
port = sock.dport;
|
||
|
}
|
||
|
// if there was no address to fall back to, error out
|
||
|
if (addr === undefined || port === undefined) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);
|
||
|
}
|
||
|
} else {
|
||
|
// connection-based sockets will only use the bound
|
||
|
addr = sock.daddr;
|
||
|
port = sock.dport;
|
||
|
}
|
||
|
|
||
|
// find the peer for the destination address
|
||
|
var dest = SOCKFS.websocket_sock_ops.getPeer(sock, addr, port);
|
||
|
|
||
|
// early out if not connected with a connection-based socket
|
||
|
if (sock.type === 1) {
|
||
|
if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
|
||
|
} else if (dest.socket.readyState === dest.socket.CONNECTING) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// create a copy of the incoming data to send, as the WebSocket API
|
||
|
// doesn't work entirely with an ArrayBufferView, it'll just send
|
||
|
// the entire underlying buffer
|
||
|
var data;
|
||
|
if (buffer instanceof Array || buffer instanceof ArrayBuffer) {
|
||
|
data = buffer.slice(offset, offset + length);
|
||
|
} else { // ArrayBufferView
|
||
|
data = buffer.buffer.slice(buffer.byteOffset + offset, buffer.byteOffset + offset + length);
|
||
|
}
|
||
|
|
||
|
// if we're emulating a connection-less dgram socket and don't have
|
||
|
// a cached connection, queue the buffer to send upon connect and
|
||
|
// lie, saying the data was sent now.
|
||
|
if (sock.type === 2) {
|
||
|
if (!dest || dest.socket.readyState !== dest.socket.OPEN) {
|
||
|
// if we're not connected, open a new connection
|
||
|
if (!dest || dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {
|
||
|
dest = SOCKFS.websocket_sock_ops.createPeer(sock, addr, port);
|
||
|
}
|
||
|
dest.dgram_send_queue.push(data);
|
||
|
return length;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
// send the actual data
|
||
|
dest.socket.send(data);
|
||
|
return length;
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
},recvmsg:function (sock, length) {
|
||
|
// http://pubs.opengroup.org/onlinepubs/7908799/xns/recvmsg.html
|
||
|
if (sock.type === 1 && sock.server) {
|
||
|
// tcp servers should not be recv()'ing on the listen socket
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
|
||
|
}
|
||
|
|
||
|
var queued = sock.recv_queue.shift();
|
||
|
if (!queued) {
|
||
|
if (sock.type === 1) {
|
||
|
var dest = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);
|
||
|
|
||
|
if (!dest) {
|
||
|
// if we have a destination address but are not connected, error out
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
|
||
|
}
|
||
|
else if (dest.socket.readyState === dest.socket.CLOSING || dest.socket.readyState === dest.socket.CLOSED) {
|
||
|
// return null if the socket has closed
|
||
|
return null;
|
||
|
}
|
||
|
else {
|
||
|
// else, our socket is in a valid state but truly has nothing available
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
|
||
|
}
|
||
|
} else {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// queued.data will be an ArrayBuffer if it's unadulterated, but if it's
|
||
|
// requeued TCP data it'll be an ArrayBufferView
|
||
|
var queuedLength = queued.data.byteLength || queued.data.length;
|
||
|
var queuedOffset = queued.data.byteOffset || 0;
|
||
|
var queuedBuffer = queued.data.buffer || queued.data;
|
||
|
var bytesRead = Math.min(length, queuedLength);
|
||
|
var res = {
|
||
|
buffer: new Uint8Array(queuedBuffer, queuedOffset, bytesRead),
|
||
|
addr: queued.addr,
|
||
|
port: queued.port
|
||
|
};
|
||
|
|
||
|
|
||
|
// push back any unread data for TCP connections
|
||
|
if (sock.type === 1 && bytesRead < queuedLength) {
|
||
|
var bytesRemaining = queuedLength - bytesRead;
|
||
|
queued.data = new Uint8Array(queuedBuffer, queuedOffset + bytesRead, bytesRemaining);
|
||
|
sock.recv_queue.unshift(queued);
|
||
|
}
|
||
|
|
||
|
return res;
|
||
|
}}};function _send(fd, buf, len, flags) {
|
||
|
var sock = SOCKFS.getSocket(fd);
|
||
|
if (!sock) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
// TODO honor flags
|
||
|
return _write(fd, buf, len);
|
||
|
}
|
||
|
|
||
|
function _pwrite(fildes, buf, nbyte, offset) {
|
||
|
// ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
try {
|
||
|
var slab = HEAP8;
|
||
|
return FS.write(stream, slab, buf, nbyte, offset);
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _write(fildes, buf, nbyte) {
|
||
|
// ssize_t write(int fildes, const void *buf, size_t nbyte);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
|
||
|
try {
|
||
|
var slab = HEAP8;
|
||
|
return FS.write(stream, slab, buf, nbyte);
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _fputc(c, stream) {
|
||
|
// int fputc(int c, FILE *stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fputc.html
|
||
|
var chr = unSign(c & 0xFF);
|
||
|
HEAP8[((_fputc.ret)|0)]=chr;
|
||
|
var ret = _write(stream, _fputc.ret, 1);
|
||
|
if (ret == -1) {
|
||
|
var streamObj = FS.getStream(stream);
|
||
|
if (streamObj) streamObj.error = true;
|
||
|
return -1;
|
||
|
} else {
|
||
|
return chr;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _fwrite(ptr, size, nitems, stream) {
|
||
|
// size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html
|
||
|
var bytesToWrite = nitems * size;
|
||
|
if (bytesToWrite == 0) return 0;
|
||
|
var bytesWritten = _write(stream, ptr, bytesToWrite);
|
||
|
if (bytesWritten == -1) {
|
||
|
var streamObj = FS.getStream(stream);
|
||
|
if (streamObj) streamObj.error = true;
|
||
|
return 0;
|
||
|
} else {
|
||
|
return Math.floor(bytesWritten / size);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _FcPatternAddInteger() {
|
||
|
Module['printErr']('missing function: FcPatternAddInteger'); abort(-1);
|
||
|
}
|
||
|
|
||
|
function _pthread_mutex_init() {}
|
||
|
|
||
|
|
||
|
function _putchar(c) {
|
||
|
// int putchar(int c);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/putchar.html
|
||
|
return _fputc(c, HEAP32[((_stdout)>>2)]);
|
||
|
}
|
||
|
Module["_saveSetjmp"] = _saveSetjmp;
|
||
|
|
||
|
|
||
|
|
||
|
Module["_strlen"] = _strlen;function _fputs(s, stream) {
|
||
|
// int fputs(const char *restrict s, FILE *restrict stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fputs.html
|
||
|
return _write(stream, s, _strlen(s));
|
||
|
}
|
||
|
|
||
|
var Browser={mainLoop:{scheduler:null,shouldPause:false,paused:false,queue:[],pause:function () {
|
||
|
Browser.mainLoop.shouldPause = true;
|
||
|
},resume:function () {
|
||
|
if (Browser.mainLoop.paused) {
|
||
|
Browser.mainLoop.paused = false;
|
||
|
Browser.mainLoop.scheduler();
|
||
|
}
|
||
|
Browser.mainLoop.shouldPause = false;
|
||
|
},updateStatus:function () {
|
||
|
if (Module['setStatus']) {
|
||
|
var message = Module['statusMessage'] || 'Please wait...';
|
||
|
var remaining = Browser.mainLoop.remainingBlockers;
|
||
|
var expected = Browser.mainLoop.expectedBlockers;
|
||
|
if (remaining) {
|
||
|
if (remaining < expected) {
|
||
|
Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');
|
||
|
} else {
|
||
|
Module['setStatus'](message);
|
||
|
}
|
||
|
} else {
|
||
|
Module['setStatus']('');
|
||
|
}
|
||
|
}
|
||
|
}},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {
|
||
|
if (!Module["preloadPlugins"]) Module["preloadPlugins"] = []; // needs to exist even in workers
|
||
|
|
||
|
if (Browser.initted || ENVIRONMENT_IS_WORKER) return;
|
||
|
Browser.initted = true;
|
||
|
|
||
|
try {
|
||
|
new Blob();
|
||
|
Browser.hasBlobConstructor = true;
|
||
|
} catch(e) {
|
||
|
Browser.hasBlobConstructor = false;
|
||
|
console.log("warning: no blob constructor, cannot create blobs with mimetypes");
|
||
|
}
|
||
|
Browser.BlobBuilder = typeof MozBlobBuilder != "undefined" ? MozBlobBuilder : (typeof WebKitBlobBuilder != "undefined" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log("warning: no BlobBuilder") : null));
|
||
|
Browser.URLObject = typeof window != "undefined" ? (window.URL ? window.URL : window.webkitURL) : undefined;
|
||
|
if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {
|
||
|
console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");
|
||
|
Module.noImageDecoding = true;
|
||
|
}
|
||
|
|
||
|
// Support for plugins that can process preloaded files. You can add more of these to
|
||
|
// your app by creating and appending to Module.preloadPlugins.
|
||
|
//
|
||
|
// Each plugin is asked if it can handle a file based on the file's name. If it can,
|
||
|
// it is given the file's raw data. When it is done, it calls a callback with the file's
|
||
|
// (possibly modified) data. For example, a plugin might decompress a file, or it
|
||
|
// might create some side data structure for use later (like an Image element, etc.).
|
||
|
|
||
|
var imagePlugin = {};
|
||
|
imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {
|
||
|
return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/i.test(name);
|
||
|
};
|
||
|
imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {
|
||
|
var b = null;
|
||
|
if (Browser.hasBlobConstructor) {
|
||
|
try {
|
||
|
b = new Blob([byteArray], { type: Browser.getMimetype(name) });
|
||
|
if (b.size !== byteArray.length) { // Safari bug #118630
|
||
|
// Safari's Blob can only take an ArrayBuffer
|
||
|
b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });
|
||
|
}
|
||
|
} catch(e) {
|
||
|
Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');
|
||
|
}
|
||
|
}
|
||
|
if (!b) {
|
||
|
var bb = new Browser.BlobBuilder();
|
||
|
bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range
|
||
|
b = bb.getBlob();
|
||
|
}
|
||
|
var url = Browser.URLObject.createObjectURL(b);
|
||
|
var img = new Image();
|
||
|
img.onload = function img_onload() {
|
||
|
assert(img.complete, 'Image ' + name + ' could not be decoded');
|
||
|
var canvas = document.createElement('canvas');
|
||
|
canvas.width = img.width;
|
||
|
canvas.height = img.height;
|
||
|
var ctx = canvas.getContext('2d');
|
||
|
ctx.drawImage(img, 0, 0);
|
||
|
Module["preloadedImages"][name] = canvas;
|
||
|
Browser.URLObject.revokeObjectURL(url);
|
||
|
if (onload) onload(byteArray);
|
||
|
};
|
||
|
img.onerror = function img_onerror(event) {
|
||
|
console.log('Image ' + url + ' could not be decoded');
|
||
|
if (onerror) onerror();
|
||
|
};
|
||
|
img.src = url;
|
||
|
};
|
||
|
Module['preloadPlugins'].push(imagePlugin);
|
||
|
|
||
|
var audioPlugin = {};
|
||
|
audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {
|
||
|
return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
|
||
|
};
|
||
|
audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {
|
||
|
var done = false;
|
||
|
function finish(audio) {
|
||
|
if (done) return;
|
||
|
done = true;
|
||
|
Module["preloadedAudios"][name] = audio;
|
||
|
if (onload) onload(byteArray);
|
||
|
}
|
||
|
function fail() {
|
||
|
if (done) return;
|
||
|
done = true;
|
||
|
Module["preloadedAudios"][name] = new Audio(); // empty shim
|
||
|
if (onerror) onerror();
|
||
|
}
|
||
|
if (Browser.hasBlobConstructor) {
|
||
|
try {
|
||
|
var b = new Blob([byteArray], { type: Browser.getMimetype(name) });
|
||
|
} catch(e) {
|
||
|
return fail();
|
||
|
}
|
||
|
var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!
|
||
|
var audio = new Audio();
|
||
|
audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926
|
||
|
audio.onerror = function audio_onerror(event) {
|
||
|
if (done) return;
|
||
|
console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');
|
||
|
function encode64(data) {
|
||
|
var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||
|
var PAD = '=';
|
||
|
var ret = '';
|
||
|
var leftchar = 0;
|
||
|
var leftbits = 0;
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
leftchar = (leftchar << 8) | data[i];
|
||
|
leftbits += 8;
|
||
|
while (leftbits >= 6) {
|
||
|
var curr = (leftchar >> (leftbits-6)) & 0x3f;
|
||
|
leftbits -= 6;
|
||
|
ret += BASE[curr];
|
||
|
}
|
||
|
}
|
||
|
if (leftbits == 2) {
|
||
|
ret += BASE[(leftchar&3) << 4];
|
||
|
ret += PAD + PAD;
|
||
|
} else if (leftbits == 4) {
|
||
|
ret += BASE[(leftchar&0xf) << 2];
|
||
|
ret += PAD;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);
|
||
|
finish(audio); // we don't wait for confirmation this worked - but it's worth trying
|
||
|
};
|
||
|
audio.src = url;
|
||
|
// workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror
|
||
|
Browser.safeSetTimeout(function() {
|
||
|
finish(audio); // try to use it even though it is not necessarily ready to play
|
||
|
}, 10000);
|
||
|
} else {
|
||
|
return fail();
|
||
|
}
|
||
|
};
|
||
|
Module['preloadPlugins'].push(audioPlugin);
|
||
|
|
||
|
// Canvas event setup
|
||
|
|
||
|
var canvas = Module['canvas'];
|
||
|
canvas.requestPointerLock = canvas['requestPointerLock'] ||
|
||
|
canvas['mozRequestPointerLock'] ||
|
||
|
canvas['webkitRequestPointerLock'];
|
||
|
canvas.exitPointerLock = document['exitPointerLock'] ||
|
||
|
document['mozExitPointerLock'] ||
|
||
|
document['webkitExitPointerLock'] ||
|
||
|
function(){}; // no-op if function does not exist
|
||
|
canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
|
||
|
|
||
|
function pointerLockChange() {
|
||
|
Browser.pointerLock = document['pointerLockElement'] === canvas ||
|
||
|
document['mozPointerLockElement'] === canvas ||
|
||
|
document['webkitPointerLockElement'] === canvas;
|
||
|
}
|
||
|
|
||
|
document.addEventListener('pointerlockchange', pointerLockChange, false);
|
||
|
document.addEventListener('mozpointerlockchange', pointerLockChange, false);
|
||
|
document.addEventListener('webkitpointerlockchange', pointerLockChange, false);
|
||
|
|
||
|
if (Module['elementPointerLock']) {
|
||
|
canvas.addEventListener("click", function(ev) {
|
||
|
if (!Browser.pointerLock && canvas.requestPointerLock) {
|
||
|
canvas.requestPointerLock();
|
||
|
ev.preventDefault();
|
||
|
}
|
||
|
}, false);
|
||
|
}
|
||
|
},createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {
|
||
|
var ctx;
|
||
|
try {
|
||
|
if (useWebGL) {
|
||
|
var contextAttributes = {
|
||
|
antialias: false,
|
||
|
alpha: false
|
||
|
};
|
||
|
|
||
|
if (webGLContextAttributes) {
|
||
|
for (var attribute in webGLContextAttributes) {
|
||
|
contextAttributes[attribute] = webGLContextAttributes[attribute];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
var errorInfo = '?';
|
||
|
function onContextCreationError(event) {
|
||
|
errorInfo = event.statusMessage || errorInfo;
|
||
|
}
|
||
|
canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);
|
||
|
try {
|
||
|
['experimental-webgl', 'webgl'].some(function(webglId) {
|
||
|
return ctx = canvas.getContext(webglId, contextAttributes);
|
||
|
});
|
||
|
} finally {
|
||
|
canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);
|
||
|
}
|
||
|
} else {
|
||
|
ctx = canvas.getContext('2d');
|
||
|
}
|
||
|
if (!ctx) throw ':(';
|
||
|
} catch (e) {
|
||
|
Module.print('Could not create canvas: ' + [errorInfo, e]);
|
||
|
return null;
|
||
|
}
|
||
|
if (useWebGL) {
|
||
|
// Set the background of the WebGL canvas to black
|
||
|
canvas.style.backgroundColor = "black";
|
||
|
|
||
|
// Warn on context loss
|
||
|
canvas.addEventListener('webglcontextlost', function(event) {
|
||
|
alert('WebGL context lost. You will need to reload the page.');
|
||
|
}, false);
|
||
|
}
|
||
|
if (setInModule) {
|
||
|
GLctx = Module.ctx = ctx;
|
||
|
Module.useWebGL = useWebGL;
|
||
|
Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });
|
||
|
Browser.init();
|
||
|
}
|
||
|
return ctx;
|
||
|
},destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {
|
||
|
Browser.lockPointer = lockPointer;
|
||
|
Browser.resizeCanvas = resizeCanvas;
|
||
|
if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;
|
||
|
if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;
|
||
|
|
||
|
var canvas = Module['canvas'];
|
||
|
function fullScreenChange() {
|
||
|
Browser.isFullScreen = false;
|
||
|
if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
|
||
|
document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
|
||
|
document['fullScreenElement'] || document['fullscreenElement']) === canvas) {
|
||
|
canvas.cancelFullScreen = document['cancelFullScreen'] ||
|
||
|
document['mozCancelFullScreen'] ||
|
||
|
document['webkitCancelFullScreen'];
|
||
|
canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);
|
||
|
if (Browser.lockPointer) canvas.requestPointerLock();
|
||
|
Browser.isFullScreen = true;
|
||
|
if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();
|
||
|
} else if (Browser.resizeCanvas){
|
||
|
Browser.setWindowedCanvasSize();
|
||
|
}
|
||
|
if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);
|
||
|
}
|
||
|
|
||
|
if (!Browser.fullScreenHandlersInstalled) {
|
||
|
Browser.fullScreenHandlersInstalled = true;
|
||
|
document.addEventListener('fullscreenchange', fullScreenChange, false);
|
||
|
document.addEventListener('mozfullscreenchange', fullScreenChange, false);
|
||
|
document.addEventListener('webkitfullscreenchange', fullScreenChange, false);
|
||
|
}
|
||
|
|
||
|
canvas.requestFullScreen = canvas['requestFullScreen'] ||
|
||
|
canvas['mozRequestFullScreen'] ||
|
||
|
(canvas['webkitRequestFullScreen'] ? function() { canvas['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
|
||
|
canvas.requestFullScreen();
|
||
|
},requestAnimationFrame:function requestAnimationFrame(func) {
|
||
|
if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)
|
||
|
setTimeout(func, 1000/60);
|
||
|
} else {
|
||
|
if (!window.requestAnimationFrame) {
|
||
|
window.requestAnimationFrame = window['requestAnimationFrame'] ||
|
||
|
window['mozRequestAnimationFrame'] ||
|
||
|
window['webkitRequestAnimationFrame'] ||
|
||
|
window['msRequestAnimationFrame'] ||
|
||
|
window['oRequestAnimationFrame'] ||
|
||
|
window['setTimeout'];
|
||
|
}
|
||
|
window.requestAnimationFrame(func);
|
||
|
}
|
||
|
},safeCallback:function (func) {
|
||
|
return function() {
|
||
|
if (!ABORT) return func.apply(null, arguments);
|
||
|
};
|
||
|
},safeRequestAnimationFrame:function (func) {
|
||
|
return Browser.requestAnimationFrame(function() {
|
||
|
if (!ABORT) func();
|
||
|
});
|
||
|
},safeSetTimeout:function (func, timeout) {
|
||
|
return setTimeout(function() {
|
||
|
if (!ABORT) func();
|
||
|
}, timeout);
|
||
|
},safeSetInterval:function (func, timeout) {
|
||
|
return setInterval(function() {
|
||
|
if (!ABORT) func();
|
||
|
}, timeout);
|
||
|
},getMimetype:function (name) {
|
||
|
return {
|
||
|
'jpg': 'image/jpeg',
|
||
|
'jpeg': 'image/jpeg',
|
||
|
'png': 'image/png',
|
||
|
'bmp': 'image/bmp',
|
||
|
'ogg': 'audio/ogg',
|
||
|
'wav': 'audio/wav',
|
||
|
'mp3': 'audio/mpeg'
|
||
|
}[name.substr(name.lastIndexOf('.')+1)];
|
||
|
},getUserMedia:function (func) {
|
||
|
if(!window.getUserMedia) {
|
||
|
window.getUserMedia = navigator['getUserMedia'] ||
|
||
|
navigator['mozGetUserMedia'];
|
||
|
}
|
||
|
window.getUserMedia(func);
|
||
|
},getMovementX:function (event) {
|
||
|
return event['movementX'] ||
|
||
|
event['mozMovementX'] ||
|
||
|
event['webkitMovementX'] ||
|
||
|
0;
|
||
|
},getMovementY:function (event) {
|
||
|
return event['movementY'] ||
|
||
|
event['mozMovementY'] ||
|
||
|
event['webkitMovementY'] ||
|
||
|
0;
|
||
|
},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup
|
||
|
if (Browser.pointerLock) {
|
||
|
// When the pointer is locked, calculate the coordinates
|
||
|
// based on the movement of the mouse.
|
||
|
// Workaround for Firefox bug 764498
|
||
|
if (event.type != 'mousemove' &&
|
||
|
('mozMovementX' in event)) {
|
||
|
Browser.mouseMovementX = Browser.mouseMovementY = 0;
|
||
|
} else {
|
||
|
Browser.mouseMovementX = Browser.getMovementX(event);
|
||
|
Browser.mouseMovementY = Browser.getMovementY(event);
|
||
|
}
|
||
|
|
||
|
// check if SDL is available
|
||
|
if (typeof SDL != "undefined") {
|
||
|
Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
|
||
|
Browser.mouseY = SDL.mouseY + Browser.mouseMovementY;
|
||
|
} else {
|
||
|
// just add the mouse delta to the current absolut mouse position
|
||
|
// FIXME: ideally this should be clamped against the canvas size and zero
|
||
|
Browser.mouseX += Browser.mouseMovementX;
|
||
|
Browser.mouseY += Browser.mouseMovementY;
|
||
|
}
|
||
|
} else {
|
||
|
// Otherwise, calculate the movement based on the changes
|
||
|
// in the coordinates.
|
||
|
var rect = Module["canvas"].getBoundingClientRect();
|
||
|
var x, y;
|
||
|
|
||
|
// Neither .scrollX or .pageXOffset are defined in a spec, but
|
||
|
// we prefer .scrollX because it is currently in a spec draft.
|
||
|
// (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)
|
||
|
var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);
|
||
|
var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);
|
||
|
if (event.type == 'touchstart' ||
|
||
|
event.type == 'touchend' ||
|
||
|
event.type == 'touchmove') {
|
||
|
var t = event.touches.item(0);
|
||
|
if (t) {
|
||
|
x = t.pageX - (scrollX + rect.left);
|
||
|
y = t.pageY - (scrollY + rect.top);
|
||
|
} else {
|
||
|
return;
|
||
|
}
|
||
|
} else {
|
||
|
x = event.pageX - (scrollX + rect.left);
|
||
|
y = event.pageY - (scrollY + rect.top);
|
||
|
}
|
||
|
|
||
|
// the canvas might be CSS-scaled compared to its backbuffer;
|
||
|
// SDL-using content will want mouse coordinates in terms
|
||
|
// of backbuffer units.
|
||
|
var cw = Module["canvas"].width;
|
||
|
var ch = Module["canvas"].height;
|
||
|
x = x * (cw / rect.width);
|
||
|
y = y * (ch / rect.height);
|
||
|
|
||
|
Browser.mouseMovementX = x - Browser.mouseX;
|
||
|
Browser.mouseMovementY = y - Browser.mouseY;
|
||
|
Browser.mouseX = x;
|
||
|
Browser.mouseY = y;
|
||
|
}
|
||
|
},xhrLoad:function (url, onload, onerror) {
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open('GET', url, true);
|
||
|
xhr.responseType = 'arraybuffer';
|
||
|
xhr.onload = function xhr_onload() {
|
||
|
if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||
|
onload(xhr.response);
|
||
|
} else {
|
||
|
onerror();
|
||
|
}
|
||
|
};
|
||
|
xhr.onerror = onerror;
|
||
|
xhr.send(null);
|
||
|
},asyncLoad:function (url, onload, onerror, noRunDep) {
|
||
|
Browser.xhrLoad(url, function(arrayBuffer) {
|
||
|
assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).');
|
||
|
onload(new Uint8Array(arrayBuffer));
|
||
|
if (!noRunDep) removeRunDependency('al ' + url);
|
||
|
}, function(event) {
|
||
|
if (onerror) {
|
||
|
onerror();
|
||
|
} else {
|
||
|
throw 'Loading data file "' + url + '" failed.';
|
||
|
}
|
||
|
});
|
||
|
if (!noRunDep) addRunDependency('al ' + url);
|
||
|
},resizeListeners:[],updateResizeListeners:function () {
|
||
|
var canvas = Module['canvas'];
|
||
|
Browser.resizeListeners.forEach(function(listener) {
|
||
|
listener(canvas.width, canvas.height);
|
||
|
});
|
||
|
},setCanvasSize:function (width, height, noUpdates) {
|
||
|
var canvas = Module['canvas'];
|
||
|
canvas.width = width;
|
||
|
canvas.height = height;
|
||
|
if (!noUpdates) Browser.updateResizeListeners();
|
||
|
},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {
|
||
|
var canvas = Module['canvas'];
|
||
|
this.windowedWidth = canvas.width;
|
||
|
this.windowedHeight = canvas.height;
|
||
|
canvas.width = screen.width;
|
||
|
canvas.height = screen.height;
|
||
|
// check if SDL is available
|
||
|
if (typeof SDL != "undefined") {
|
||
|
var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
|
||
|
flags = flags | 0x00800000; // set SDL_FULLSCREEN flag
|
||
|
HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
|
||
|
}
|
||
|
Browser.updateResizeListeners();
|
||
|
},setWindowedCanvasSize:function () {
|
||
|
var canvas = Module['canvas'];
|
||
|
canvas.width = this.windowedWidth;
|
||
|
canvas.height = this.windowedHeight;
|
||
|
// check if SDL is available
|
||
|
if (typeof SDL != "undefined") {
|
||
|
var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
|
||
|
flags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag
|
||
|
HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
|
||
|
}
|
||
|
Browser.updateResizeListeners();
|
||
|
}};
|
||
|
|
||
|
|
||
|
|
||
|
Module["_bitshift64Ashr"] = _bitshift64Ashr;
|
||
|
|
||
|
|
||
|
function _recv(fd, buf, len, flags) {
|
||
|
var sock = SOCKFS.getSocket(fd);
|
||
|
if (!sock) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
// TODO honor flags
|
||
|
return _read(fd, buf, len);
|
||
|
}
|
||
|
|
||
|
function _pread(fildes, buf, nbyte, offset) {
|
||
|
// ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
try {
|
||
|
var slab = HEAP8;
|
||
|
return FS.read(stream, slab, buf, nbyte, offset);
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _read(fildes, buf, nbyte) {
|
||
|
// ssize_t read(int fildes, void *buf, size_t nbyte);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
|
||
|
try {
|
||
|
var slab = HEAP8;
|
||
|
return FS.read(stream, slab, buf, nbyte);
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _FcFontSetDestroy() {
|
||
|
Module['printErr']('missing function: FcFontSetDestroy'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _ceil=Math_ceil;
|
||
|
|
||
|
function _FcDefaultSubstitute() {
|
||
|
Module['printErr']('missing function: FcDefaultSubstitute'); abort(-1);
|
||
|
}
|
||
|
|
||
|
function _getpwnam() { throw 'getpwnam: TODO' }
|
||
|
|
||
|
|
||
|
Module["_memcpy"] = _memcpy;
|
||
|
|
||
|
function _strstr(ptr1, ptr2) {
|
||
|
var check = 0, start;
|
||
|
do {
|
||
|
if (!check) {
|
||
|
start = ptr1;
|
||
|
check = ptr2;
|
||
|
}
|
||
|
var curr1 = HEAP8[((ptr1++)|0)];
|
||
|
var curr2 = HEAP8[((check++)|0)];
|
||
|
if (curr2 == 0) return start;
|
||
|
if (curr2 != curr1) {
|
||
|
// rewind to one character after start, to find ez in eeez
|
||
|
ptr1 = start + 1;
|
||
|
check = 0;
|
||
|
}
|
||
|
} while (curr1);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
Module["_memmove"] = _memmove;
|
||
|
|
||
|
function _inflateInit2_() {
|
||
|
Module['printErr']('dead function: inflateInit2_'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _emscripten_preinvoke=true;
|
||
|
|
||
|
|
||
|
function _open(path, oflag, varargs) {
|
||
|
// int open(const char *path, int oflag, ...);
|
||
|
// http://pubs.opengroup.org/onlinepubs/009695399/functions/open.html
|
||
|
var mode = HEAP32[((varargs)>>2)];
|
||
|
path = Pointer_stringify(path);
|
||
|
try {
|
||
|
var stream = FS.open(path, oflag, mode);
|
||
|
return stream.fd;
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _opendir(dirname) {
|
||
|
// DIR *opendir(const char *dirname);
|
||
|
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/opendir.html
|
||
|
// NOTE: Calculating absolute path redundantly since we need to associate it
|
||
|
// with the opened stream.
|
||
|
var path = Pointer_stringify(dirname);
|
||
|
if (!path) {
|
||
|
___setErrNo(ERRNO_CODES.ENOENT);
|
||
|
return 0;
|
||
|
}
|
||
|
var node;
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, { follow: true });
|
||
|
node = lookup.node;
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return 0;
|
||
|
}
|
||
|
if (!FS.isDir(node.mode)) {
|
||
|
___setErrNo(ERRNO_CODES.ENOTDIR);
|
||
|
return 0;
|
||
|
}
|
||
|
var err = _open(dirname, 0, allocate([0, 0, 0, 0], 'i32', ALLOC_STACK));
|
||
|
// open returns 0 on failure, not -1
|
||
|
return err === -1 ? 0 : err;
|
||
|
}
|
||
|
|
||
|
function _fmod(x, y) {
|
||
|
return x % y;
|
||
|
}
|
||
|
|
||
|
|
||
|
function _strncmp(px, py, n) {
|
||
|
var i = 0;
|
||
|
while (i < n) {
|
||
|
var x = HEAPU8[(((px)+(i))|0)];
|
||
|
var y = HEAPU8[(((py)+(i))|0)];
|
||
|
if (x == y && x == 0) return 0;
|
||
|
if (x == 0) return -1;
|
||
|
if (y == 0) return 1;
|
||
|
if (x == y) {
|
||
|
i ++;
|
||
|
continue;
|
||
|
} else {
|
||
|
return x > y ? 1 : -1;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}function _strcmp(px, py) {
|
||
|
return _strncmp(px, py, TOTAL_MEMORY);
|
||
|
}
|
||
|
|
||
|
function _memchr(ptr, chr, num) {
|
||
|
chr = unSign(chr);
|
||
|
for (var i = 0; i < num; i++) {
|
||
|
if (HEAP8[(ptr)] == chr) return ptr;
|
||
|
ptr++;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function __reallyNegative(x) {
|
||
|
return x < 0 || (x === 0 && (1/x) === -Infinity);
|
||
|
}function __formatString(format, varargs) {
|
||
|
var textIndex = format;
|
||
|
var argIndex = 0;
|
||
|
function getNextArg(type) {
|
||
|
// NOTE: Explicitly ignoring type safety. Otherwise this fails:
|
||
|
// int x = 4; printf("%c\n", (char)x);
|
||
|
var ret;
|
||
|
if (type === 'double') {
|
||
|
ret = (HEAP32[((tempDoublePtr)>>2)]=HEAP32[(((varargs)+(argIndex))>>2)],HEAP32[(((tempDoublePtr)+(4))>>2)]=HEAP32[(((varargs)+((argIndex)+(4)))>>2)],(+(HEAPF64[(tempDoublePtr)>>3])));
|
||
|
} else if (type == 'i64') {
|
||
|
ret = [HEAP32[(((varargs)+(argIndex))>>2)],
|
||
|
HEAP32[(((varargs)+(argIndex+4))>>2)]];
|
||
|
|
||
|
} else {
|
||
|
type = 'i32'; // varargs are always i32, i64, or double
|
||
|
ret = HEAP32[(((varargs)+(argIndex))>>2)];
|
||
|
}
|
||
|
argIndex += Runtime.getNativeFieldSize(type);
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
var ret = [];
|
||
|
var curr, next, currArg;
|
||
|
while(1) {
|
||
|
var startTextIndex = textIndex;
|
||
|
curr = HEAP8[(textIndex)];
|
||
|
if (curr === 0) break;
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
if (curr == 37) {
|
||
|
// Handle flags.
|
||
|
var flagAlwaysSigned = false;
|
||
|
var flagLeftAlign = false;
|
||
|
var flagAlternative = false;
|
||
|
var flagZeroPad = false;
|
||
|
var flagPadSign = false;
|
||
|
flagsLoop: while (1) {
|
||
|
switch (next) {
|
||
|
case 43:
|
||
|
flagAlwaysSigned = true;
|
||
|
break;
|
||
|
case 45:
|
||
|
flagLeftAlign = true;
|
||
|
break;
|
||
|
case 35:
|
||
|
flagAlternative = true;
|
||
|
break;
|
||
|
case 48:
|
||
|
if (flagZeroPad) {
|
||
|
break flagsLoop;
|
||
|
} else {
|
||
|
flagZeroPad = true;
|
||
|
break;
|
||
|
}
|
||
|
case 32:
|
||
|
flagPadSign = true;
|
||
|
break;
|
||
|
default:
|
||
|
break flagsLoop;
|
||
|
}
|
||
|
textIndex++;
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
}
|
||
|
|
||
|
// Handle width.
|
||
|
var width = 0;
|
||
|
if (next == 42) {
|
||
|
width = getNextArg('i32');
|
||
|
textIndex++;
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
} else {
|
||
|
while (next >= 48 && next <= 57) {
|
||
|
width = width * 10 + (next - 48);
|
||
|
textIndex++;
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Handle precision.
|
||
|
var precisionSet = false, precision = -1;
|
||
|
if (next == 46) {
|
||
|
precision = 0;
|
||
|
precisionSet = true;
|
||
|
textIndex++;
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
if (next == 42) {
|
||
|
precision = getNextArg('i32');
|
||
|
textIndex++;
|
||
|
} else {
|
||
|
while(1) {
|
||
|
var precisionChr = HEAP8[((textIndex+1)|0)];
|
||
|
if (precisionChr < 48 ||
|
||
|
precisionChr > 57) break;
|
||
|
precision = precision * 10 + (precisionChr - 48);
|
||
|
textIndex++;
|
||
|
}
|
||
|
}
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
}
|
||
|
if (precision === -1) {
|
||
|
precision = 6; // Standard default.
|
||
|
precisionSet = false;
|
||
|
}
|
||
|
|
||
|
// Handle integer sizes. WARNING: These assume a 32-bit architecture!
|
||
|
var argSize;
|
||
|
switch (String.fromCharCode(next)) {
|
||
|
case 'h':
|
||
|
var nextNext = HEAP8[((textIndex+2)|0)];
|
||
|
if (nextNext == 104) {
|
||
|
textIndex++;
|
||
|
argSize = 1; // char (actually i32 in varargs)
|
||
|
} else {
|
||
|
argSize = 2; // short (actually i32 in varargs)
|
||
|
}
|
||
|
break;
|
||
|
case 'l':
|
||
|
var nextNext = HEAP8[((textIndex+2)|0)];
|
||
|
if (nextNext == 108) {
|
||
|
textIndex++;
|
||
|
argSize = 8; // long long
|
||
|
} else {
|
||
|
argSize = 4; // long
|
||
|
}
|
||
|
break;
|
||
|
case 'L': // long long
|
||
|
case 'q': // int64_t
|
||
|
case 'j': // intmax_t
|
||
|
argSize = 8;
|
||
|
break;
|
||
|
case 'z': // size_t
|
||
|
case 't': // ptrdiff_t
|
||
|
case 'I': // signed ptrdiff_t or unsigned size_t
|
||
|
argSize = 4;
|
||
|
break;
|
||
|
default:
|
||
|
argSize = null;
|
||
|
}
|
||
|
if (argSize) textIndex++;
|
||
|
next = HEAP8[((textIndex+1)|0)];
|
||
|
|
||
|
// Handle type specifier.
|
||
|
switch (String.fromCharCode(next)) {
|
||
|
case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {
|
||
|
// Integer.
|
||
|
var signed = next == 100 || next == 105;
|
||
|
argSize = argSize || 4;
|
||
|
var currArg = getNextArg('i' + (argSize * 8));
|
||
|
var origArg = currArg;
|
||
|
var argText;
|
||
|
// Flatten i64-1 [low, high] into a (slightly rounded) double
|
||
|
if (argSize == 8) {
|
||
|
currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);
|
||
|
}
|
||
|
// Truncate to requested size.
|
||
|
if (argSize <= 4) {
|
||
|
var limit = Math.pow(256, argSize) - 1;
|
||
|
currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);
|
||
|
}
|
||
|
// Format the number.
|
||
|
var currAbsArg = Math.abs(currArg);
|
||
|
var prefix = '';
|
||
|
if (next == 100 || next == 105) {
|
||
|
if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else
|
||
|
argText = reSign(currArg, 8 * argSize, 1).toString(10);
|
||
|
} else if (next == 117) {
|
||
|
if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else
|
||
|
argText = unSign(currArg, 8 * argSize, 1).toString(10);
|
||
|
currArg = Math.abs(currArg);
|
||
|
} else if (next == 111) {
|
||
|
argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);
|
||
|
} else if (next == 120 || next == 88) {
|
||
|
prefix = (flagAlternative && currArg != 0) ? '0x' : '';
|
||
|
if (argSize == 8 && i64Math) {
|
||
|
if (origArg[1]) {
|
||
|
argText = (origArg[1]>>>0).toString(16);
|
||
|
var lower = (origArg[0]>>>0).toString(16);
|
||
|
while (lower.length < 8) lower = '0' + lower;
|
||
|
argText += lower;
|
||
|
} else {
|
||
|
argText = (origArg[0]>>>0).toString(16);
|
||
|
}
|
||
|
} else
|
||
|
if (currArg < 0) {
|
||
|
// Represent negative numbers in hex as 2's complement.
|
||
|
currArg = -currArg;
|
||
|
argText = (currAbsArg - 1).toString(16);
|
||
|
var buffer = [];
|
||
|
for (var i = 0; i < argText.length; i++) {
|
||
|
buffer.push((0xF - parseInt(argText[i], 16)).toString(16));
|
||
|
}
|
||
|
argText = buffer.join('');
|
||
|
while (argText.length < argSize * 2) argText = 'f' + argText;
|
||
|
} else {
|
||
|
argText = currAbsArg.toString(16);
|
||
|
}
|
||
|
if (next == 88) {
|
||
|
prefix = prefix.toUpperCase();
|
||
|
argText = argText.toUpperCase();
|
||
|
}
|
||
|
} else if (next == 112) {
|
||
|
if (currAbsArg === 0) {
|
||
|
argText = '(nil)';
|
||
|
} else {
|
||
|
prefix = '0x';
|
||
|
argText = currAbsArg.toString(16);
|
||
|
}
|
||
|
}
|
||
|
if (precisionSet) {
|
||
|
while (argText.length < precision) {
|
||
|
argText = '0' + argText;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Add sign if needed
|
||
|
if (currArg >= 0) {
|
||
|
if (flagAlwaysSigned) {
|
||
|
prefix = '+' + prefix;
|
||
|
} else if (flagPadSign) {
|
||
|
prefix = ' ' + prefix;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Move sign to prefix so we zero-pad after the sign
|
||
|
if (argText.charAt(0) == '-') {
|
||
|
prefix = '-' + prefix;
|
||
|
argText = argText.substr(1);
|
||
|
}
|
||
|
|
||
|
// Add padding.
|
||
|
while (prefix.length + argText.length < width) {
|
||
|
if (flagLeftAlign) {
|
||
|
argText += ' ';
|
||
|
} else {
|
||
|
if (flagZeroPad) {
|
||
|
argText = '0' + argText;
|
||
|
} else {
|
||
|
prefix = ' ' + prefix;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Insert the result into the buffer.
|
||
|
argText = prefix + argText;
|
||
|
argText.split('').forEach(function(chr) {
|
||
|
ret.push(chr.charCodeAt(0));
|
||
|
});
|
||
|
break;
|
||
|
}
|
||
|
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {
|
||
|
// Float.
|
||
|
var currArg = getNextArg('double');
|
||
|
var argText;
|
||
|
if (isNaN(currArg)) {
|
||
|
argText = 'nan';
|
||
|
flagZeroPad = false;
|
||
|
} else if (!isFinite(currArg)) {
|
||
|
argText = (currArg < 0 ? '-' : '') + 'inf';
|
||
|
flagZeroPad = false;
|
||
|
} else {
|
||
|
var isGeneral = false;
|
||
|
var effectivePrecision = Math.min(precision, 20);
|
||
|
|
||
|
// Convert g/G to f/F or e/E, as per:
|
||
|
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html
|
||
|
if (next == 103 || next == 71) {
|
||
|
isGeneral = true;
|
||
|
precision = precision || 1;
|
||
|
var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);
|
||
|
if (precision > exponent && exponent >= -4) {
|
||
|
next = ((next == 103) ? 'f' : 'F').charCodeAt(0);
|
||
|
precision -= exponent + 1;
|
||
|
} else {
|
||
|
next = ((next == 103) ? 'e' : 'E').charCodeAt(0);
|
||
|
precision--;
|
||
|
}
|
||
|
effectivePrecision = Math.min(precision, 20);
|
||
|
}
|
||
|
|
||
|
if (next == 101 || next == 69) {
|
||
|
argText = currArg.toExponential(effectivePrecision);
|
||
|
// Make sure the exponent has at least 2 digits.
|
||
|
if (/[eE][-+]\d$/.test(argText)) {
|
||
|
argText = argText.slice(0, -1) + '0' + argText.slice(-1);
|
||
|
}
|
||
|
} else if (next == 102 || next == 70) {
|
||
|
argText = currArg.toFixed(effectivePrecision);
|
||
|
if (currArg === 0 && __reallyNegative(currArg)) {
|
||
|
argText = '-' + argText;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var parts = argText.split('e');
|
||
|
if (isGeneral && !flagAlternative) {
|
||
|
// Discard trailing zeros and periods.
|
||
|
while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&
|
||
|
(parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {
|
||
|
parts[0] = parts[0].slice(0, -1);
|
||
|
}
|
||
|
} else {
|
||
|
// Make sure we have a period in alternative mode.
|
||
|
if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';
|
||
|
// Zero pad until required precision.
|
||
|
while (precision > effectivePrecision++) parts[0] += '0';
|
||
|
}
|
||
|
argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');
|
||
|
|
||
|
// Capitalize 'E' if needed.
|
||
|
if (next == 69) argText = argText.toUpperCase();
|
||
|
|
||
|
// Add sign.
|
||
|
if (currArg >= 0) {
|
||
|
if (flagAlwaysSigned) {
|
||
|
argText = '+' + argText;
|
||
|
} else if (flagPadSign) {
|
||
|
argText = ' ' + argText;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Add padding.
|
||
|
while (argText.length < width) {
|
||
|
if (flagLeftAlign) {
|
||
|
argText += ' ';
|
||
|
} else {
|
||
|
if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {
|
||
|
argText = argText[0] + '0' + argText.slice(1);
|
||
|
} else {
|
||
|
argText = (flagZeroPad ? '0' : ' ') + argText;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Adjust case.
|
||
|
if (next < 97) argText = argText.toUpperCase();
|
||
|
|
||
|
// Insert the result into the buffer.
|
||
|
argText.split('').forEach(function(chr) {
|
||
|
ret.push(chr.charCodeAt(0));
|
||
|
});
|
||
|
break;
|
||
|
}
|
||
|
case 's': {
|
||
|
// String.
|
||
|
var arg = getNextArg('i8*');
|
||
|
var argLength = arg ? _strlen(arg) : '(null)'.length;
|
||
|
if (precisionSet) argLength = Math.min(argLength, precision);
|
||
|
if (!flagLeftAlign) {
|
||
|
while (argLength < width--) {
|
||
|
ret.push(32);
|
||
|
}
|
||
|
}
|
||
|
if (arg) {
|
||
|
for (var i = 0; i < argLength; i++) {
|
||
|
ret.push(HEAPU8[((arg++)|0)]);
|
||
|
}
|
||
|
} else {
|
||
|
ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));
|
||
|
}
|
||
|
if (flagLeftAlign) {
|
||
|
while (argLength < width--) {
|
||
|
ret.push(32);
|
||
|
}
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
case 'c': {
|
||
|
// Character.
|
||
|
if (flagLeftAlign) ret.push(getNextArg('i8'));
|
||
|
while (--width > 0) {
|
||
|
ret.push(32);
|
||
|
}
|
||
|
if (!flagLeftAlign) ret.push(getNextArg('i8'));
|
||
|
break;
|
||
|
}
|
||
|
case 'n': {
|
||
|
// Write the length written so far to the next parameter.
|
||
|
var ptr = getNextArg('i32*');
|
||
|
HEAP32[((ptr)>>2)]=ret.length;
|
||
|
break;
|
||
|
}
|
||
|
case '%': {
|
||
|
// Literal percent sign.
|
||
|
ret.push(curr);
|
||
|
break;
|
||
|
}
|
||
|
default: {
|
||
|
// Unknown specifiers remain untouched.
|
||
|
for (var i = startTextIndex; i < textIndex + 2; i++) {
|
||
|
ret.push(HEAP8[(i)]);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
textIndex += 2;
|
||
|
// TODO: Support a/A (hex float) and m (last error) specifiers.
|
||
|
// TODO: Support %1${specifier} for arg selection.
|
||
|
} else {
|
||
|
ret.push(curr);
|
||
|
textIndex += 1;
|
||
|
}
|
||
|
}
|
||
|
return ret;
|
||
|
}function _snprintf(s, n, format, varargs) {
|
||
|
// int snprintf(char *restrict s, size_t n, const char *restrict format, ...);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
|
||
|
var result = __formatString(format, varargs);
|
||
|
var limit = (n === undefined) ? result.length
|
||
|
: Math.min(result.length, Math.max(n - 1, 0));
|
||
|
if (s < 0) {
|
||
|
s = -s;
|
||
|
var buf = _malloc(limit+1);
|
||
|
HEAP32[((s)>>2)]=buf;
|
||
|
s = buf;
|
||
|
}
|
||
|
for (var i = 0; i < limit; i++) {
|
||
|
HEAP8[(((s)+(i))|0)]=result[i];
|
||
|
}
|
||
|
if (limit < n || (n === undefined)) HEAP8[(((s)+(i))|0)]=0;
|
||
|
return result.length;
|
||
|
}
|
||
|
|
||
|
|
||
|
function _fread(ptr, size, nitems, stream) {
|
||
|
// size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fread.html
|
||
|
var bytesToRead = nitems * size;
|
||
|
if (bytesToRead == 0) {
|
||
|
return 0;
|
||
|
}
|
||
|
var bytesRead = 0;
|
||
|
var streamObj = FS.getStream(stream);
|
||
|
if (!streamObj) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return 0;
|
||
|
}
|
||
|
while (streamObj.ungotten.length && bytesToRead > 0) {
|
||
|
HEAP8[((ptr++)|0)]=streamObj.ungotten.pop();
|
||
|
bytesToRead--;
|
||
|
bytesRead++;
|
||
|
}
|
||
|
var err = _read(stream, ptr, bytesToRead);
|
||
|
if (err == -1) {
|
||
|
if (streamObj) streamObj.error = true;
|
||
|
return 0;
|
||
|
}
|
||
|
bytesRead += err;
|
||
|
if (bytesRead < bytesToRead) streamObj.eof = true;
|
||
|
return Math.floor(bytesRead / size);
|
||
|
}function _fgetc(stream) {
|
||
|
// int fgetc(FILE *stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fgetc.html
|
||
|
var streamObj = FS.getStream(stream);
|
||
|
if (!streamObj) return -1;
|
||
|
if (streamObj.eof || streamObj.error) return -1;
|
||
|
var ret = _fread(_fgetc.ret, 1, 1, stream);
|
||
|
if (ret == 0) {
|
||
|
return -1;
|
||
|
} else if (ret == -1) {
|
||
|
streamObj.error = true;
|
||
|
return -1;
|
||
|
} else {
|
||
|
return HEAPU8[((_fgetc.ret)|0)];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
Module["_memset"] = _memset;
|
||
|
|
||
|
var _BDtoILow=true;
|
||
|
|
||
|
|
||
|
Module["_strcat"] = _strcat;
|
||
|
|
||
|
|
||
|
function _readdir_r(dirp, entry, result) {
|
||
|
// int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
|
||
|
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/readdir_r.html
|
||
|
var stream = FS.getStream(dirp);
|
||
|
if (!stream) {
|
||
|
return ___setErrNo(ERRNO_CODES.EBADF);
|
||
|
}
|
||
|
var entries;
|
||
|
try {
|
||
|
entries = FS.readdir(stream.path);
|
||
|
} catch (e) {
|
||
|
return FS.handleFSError(e);
|
||
|
}
|
||
|
if (stream.position < 0 || stream.position >= entries.length) {
|
||
|
HEAP32[((result)>>2)]=0;
|
||
|
return 0;
|
||
|
}
|
||
|
var id;
|
||
|
var type;
|
||
|
var name = entries[stream.position];
|
||
|
var offset = stream.position + 1;
|
||
|
if (!name.indexOf('.')) {
|
||
|
id = 1;
|
||
|
type = 4;
|
||
|
} else {
|
||
|
var child = FS.lookupNode(stream.node, name);
|
||
|
id = child.id;
|
||
|
type = FS.isChrdev(child.mode) ? 2 : // DT_CHR, character device.
|
||
|
FS.isDir(child.mode) ? 4 : // DT_DIR, directory.
|
||
|
FS.isLink(child.mode) ? 10 : // DT_LNK, symbolic link.
|
||
|
8; // DT_REG, regular file.
|
||
|
}
|
||
|
HEAP32[((entry)>>2)]=id;
|
||
|
HEAP32[(((entry)+(4))>>2)]=offset;
|
||
|
HEAP32[(((entry)+(8))>>2)]=name.length + 1;
|
||
|
for (var i = 0; i < name.length; i++) {
|
||
|
HEAP8[(((entry + 11)+(i))|0)]=name.charCodeAt(i);
|
||
|
}
|
||
|
HEAP8[(((entry + 11)+(i))|0)]=0;
|
||
|
HEAP8[(((entry)+(10))|0)]=type;
|
||
|
HEAP32[((result)>>2)]=entry;
|
||
|
stream.position++;
|
||
|
return 0;
|
||
|
}function _readdir(dirp) {
|
||
|
// struct dirent *readdir(DIR *dirp);
|
||
|
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/readdir_r.html
|
||
|
var stream = FS.getStream(dirp);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return 0;
|
||
|
}
|
||
|
// TODO Is it supposed to be safe to execute multiple readdirs?
|
||
|
if (!_readdir.entry) _readdir.entry = _malloc(268);
|
||
|
if (!_readdir.result) _readdir.result = _malloc(4);
|
||
|
var err = _readdir_r(dirp, _readdir.entry, _readdir.result);
|
||
|
if (err) {
|
||
|
___setErrNo(err);
|
||
|
return 0;
|
||
|
}
|
||
|
return HEAP32[((_readdir.result)>>2)];
|
||
|
}
|
||
|
|
||
|
|
||
|
function _strerror_r(errnum, strerrbuf, buflen) {
|
||
|
if (errnum in ERRNO_MESSAGES) {
|
||
|
if (ERRNO_MESSAGES[errnum].length > buflen - 1) {
|
||
|
return ___setErrNo(ERRNO_CODES.ERANGE);
|
||
|
} else {
|
||
|
var msg = ERRNO_MESSAGES[errnum];
|
||
|
writeAsciiToMemory(msg, strerrbuf);
|
||
|
return 0;
|
||
|
}
|
||
|
} else {
|
||
|
return ___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
}function _strerror(errnum) {
|
||
|
if (!_strerror.buffer) _strerror.buffer = _malloc(256);
|
||
|
_strerror_r(errnum, _strerror.buffer, 256);
|
||
|
return _strerror.buffer;
|
||
|
}
|
||
|
|
||
|
|
||
|
Module["_bitshift64Shl"] = _bitshift64Shl;
|
||
|
|
||
|
var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;
|
||
|
|
||
|
function ___assert_fail(condition, filename, line, func) {
|
||
|
ABORT = true;
|
||
|
throw 'Assertion failed: ' + Pointer_stringify(condition) + ', at: ' + [filename ? Pointer_stringify(filename) : 'unknown filename', line, func ? Pointer_stringify(func) : 'unknown function'] + ' at ' + stackTrace();
|
||
|
}
|
||
|
|
||
|
|
||
|
function _getgid() {
|
||
|
// gid_t getgid(void);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/getgid.html
|
||
|
// We have just one process/group/user, all with ID 0.
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
function _strchr(ptr, chr) {
|
||
|
ptr--;
|
||
|
do {
|
||
|
ptr++;
|
||
|
var val = HEAP8[(ptr)];
|
||
|
if (val == chr) return ptr;
|
||
|
} while (val);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
var _asin=Math_asin;
|
||
|
|
||
|
function _puts(s) {
|
||
|
// int puts(const char *s);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/puts.html
|
||
|
// NOTE: puts() always writes an extra newline.
|
||
|
var stdout = HEAP32[((_stdout)>>2)];
|
||
|
var ret = _fputs(s, stdout);
|
||
|
if (ret < 0) {
|
||
|
return ret;
|
||
|
} else {
|
||
|
var newlineRet = _fputc(10, stdout);
|
||
|
return (newlineRet < 0) ? -1 : ret + 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _isxdigit(chr) {
|
||
|
return (chr >= 48 && chr <= 57) ||
|
||
|
(chr >= 97 && chr <= 102) ||
|
||
|
(chr >= 65 && chr <= 70);
|
||
|
}
|
||
|
|
||
|
function _ftell(stream) {
|
||
|
// long ftell(FILE *stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/ftell.html
|
||
|
stream = FS.getStream(stream);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
if (FS.isChrdev(stream.node.mode)) {
|
||
|
___setErrNo(ERRNO_CODES.ESPIPE);
|
||
|
return -1;
|
||
|
} else {
|
||
|
return stream.position;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
function __exit(status) {
|
||
|
// void _exit(int status);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html
|
||
|
Module['exit'](status);
|
||
|
}function _exit(status) {
|
||
|
__exit(status);
|
||
|
}
|
||
|
|
||
|
function _sprintf(s, format, varargs) {
|
||
|
// int sprintf(char *restrict s, const char *restrict format, ...);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
|
||
|
return _snprintf(s, undefined, format, varargs);
|
||
|
}
|
||
|
|
||
|
var _emscripten_get_longjmp_result=true;
|
||
|
|
||
|
function _strrchr(ptr, chr) {
|
||
|
var ptr2 = ptr + _strlen(ptr);
|
||
|
do {
|
||
|
if (HEAP8[(ptr2)] == chr) return ptr2;
|
||
|
ptr2--;
|
||
|
} while (ptr2 >= ptr);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
function _munmap(start, num) {
|
||
|
if (!_mmap.mappings) _mmap.mappings = {};
|
||
|
// TODO: support unmmap'ing parts of allocations
|
||
|
var info = _mmap.mappings[start];
|
||
|
if (!info) return 0;
|
||
|
if (num == info.num) {
|
||
|
_mmap.mappings[start] = null;
|
||
|
if (info.allocated) {
|
||
|
_free(info.malloc);
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
function _fcntl(fildes, cmd, varargs, dup2) {
|
||
|
// int fcntl(int fildes, int cmd, ...);
|
||
|
// http://pubs.opengroup.org/onlinepubs/009695399/functions/fcntl.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
switch (cmd) {
|
||
|
case 0:
|
||
|
var arg = HEAP32[((varargs)>>2)];
|
||
|
if (arg < 0) {
|
||
|
___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
return -1;
|
||
|
}
|
||
|
var newStream;
|
||
|
try {
|
||
|
newStream = FS.open(stream.path, stream.flags, 0, arg);
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
return newStream.fd;
|
||
|
case 1:
|
||
|
case 2:
|
||
|
return 0; // FD_CLOEXEC makes no sense for a single process.
|
||
|
case 3:
|
||
|
return stream.flags;
|
||
|
case 4:
|
||
|
var arg = HEAP32[((varargs)>>2)];
|
||
|
stream.flags |= arg;
|
||
|
return 0;
|
||
|
case 12:
|
||
|
case 12:
|
||
|
var arg = HEAP32[((varargs)>>2)];
|
||
|
var offset = 0;
|
||
|
// We're always unlocked.
|
||
|
HEAP16[(((arg)+(offset))>>1)]=2;
|
||
|
return 0;
|
||
|
case 13:
|
||
|
case 14:
|
||
|
case 13:
|
||
|
case 14:
|
||
|
// Pretend that the locking is successful.
|
||
|
return 0;
|
||
|
case 8:
|
||
|
case 9:
|
||
|
// These are for sockets. We don't have them fully implemented yet.
|
||
|
___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
return -1;
|
||
|
default:
|
||
|
___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
return -1;
|
||
|
}
|
||
|
// Should never be reached. Only to silence strict warnings.
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
function _strcspn(pstr, pset) {
|
||
|
var str = pstr, set, strcurr, setcurr;
|
||
|
while (1) {
|
||
|
strcurr = HEAP8[(str)];
|
||
|
if (!strcurr) return str - pstr;
|
||
|
set = pset;
|
||
|
while (1) {
|
||
|
setcurr = HEAP8[(set)];
|
||
|
if (!setcurr || setcurr == strcurr) break;
|
||
|
set++;
|
||
|
}
|
||
|
if (setcurr) return str - pstr;
|
||
|
str++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _copysign(a, b) {
|
||
|
return __reallyNegative(a) === __reallyNegative(b) ? a : -a;
|
||
|
}
|
||
|
|
||
|
function _FcConfigSubstitute() {
|
||
|
Module['printErr']('missing function: FcConfigSubstitute'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _log=Math_log;
|
||
|
|
||
|
var _cos=Math_cos;
|
||
|
|
||
|
|
||
|
|
||
|
function _lseek(fildes, offset, whence) {
|
||
|
// off_t lseek(int fildes, off_t offset, int whence);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/lseek.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
try {
|
||
|
return FS.llseek(stream, offset, whence);
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _fseek(stream, offset, whence) {
|
||
|
// int fseek(FILE *stream, long offset, int whence);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fseek.html
|
||
|
var ret = _lseek(stream, offset, whence);
|
||
|
if (ret == -1) {
|
||
|
return -1;
|
||
|
}
|
||
|
stream = FS.getStream(stream);
|
||
|
stream.eof = false;
|
||
|
return 0;
|
||
|
}var _fseeko=_fseek;
|
||
|
|
||
|
function _FcFontSort() {
|
||
|
Module['printErr']('missing function: FcFontSort'); abort(-1);
|
||
|
}
|
||
|
|
||
|
function _isalnum(chr) {
|
||
|
return (chr >= 48 && chr <= 57) ||
|
||
|
(chr >= 97 && chr <= 122) ||
|
||
|
(chr >= 65 && chr <= 90);
|
||
|
}
|
||
|
|
||
|
function __ZNSt9exceptionD2Ev() {}
|
||
|
|
||
|
|
||
|
Module["_strcpy"] = _strcpy;
|
||
|
|
||
|
function _mmap(start, num, prot, flags, stream, offset) {
|
||
|
/* FIXME: Since mmap is normally implemented at the kernel level,
|
||
|
* this implementation simply uses malloc underneath the call to
|
||
|
* mmap.
|
||
|
*/
|
||
|
var MAP_PRIVATE = 2;
|
||
|
var ptr;
|
||
|
var allocated = false;
|
||
|
|
||
|
if (!_mmap.mappings) _mmap.mappings = {};
|
||
|
|
||
|
if (stream == -1) {
|
||
|
ptr = _malloc(num);
|
||
|
if (!ptr) return -1;
|
||
|
_memset(ptr, 0, num);
|
||
|
allocated = true;
|
||
|
} else {
|
||
|
var info = FS.getStream(stream);
|
||
|
if (!info) return -1;
|
||
|
try {
|
||
|
var res = FS.mmap(info, HEAPU8, start, num, offset, prot, flags);
|
||
|
ptr = res.ptr;
|
||
|
allocated = res.allocated;
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
_mmap.mappings[ptr] = { malloc: ptr, num: num, allocated: allocated };
|
||
|
return ptr;
|
||
|
}
|
||
|
|
||
|
var _acos=Math_acos;
|
||
|
|
||
|
function _FcPatternDestroy() {
|
||
|
Module['printErr']('missing function: FcPatternDestroy'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _llvm_memset_p0i8_i32=_memset;
|
||
|
|
||
|
|
||
|
Module["_i64Subtract"] = _i64Subtract;
|
||
|
|
||
|
|
||
|
Module["_i64Add"] = _i64Add;
|
||
|
|
||
|
var _pow=Math_pow;
|
||
|
|
||
|
|
||
|
function __ZSt18uncaught_exceptionv() { // std::uncaught_exception()
|
||
|
return !!__ZSt18uncaught_exceptionv.uncaught_exception;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function ___cxa_is_number_type(type) {
|
||
|
var isNumber = false;
|
||
|
try { if (type == __ZTIi) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIj) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIl) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIm) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIx) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIy) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIf) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTId) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIe) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIc) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIa) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIh) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIs) isNumber = true } catch(e){}
|
||
|
try { if (type == __ZTIt) isNumber = true } catch(e){}
|
||
|
return isNumber;
|
||
|
}function ___cxa_does_inherit(definiteType, possibilityType, possibility) {
|
||
|
if (possibility == 0) return false;
|
||
|
if (possibilityType == 0 || possibilityType == definiteType)
|
||
|
return true;
|
||
|
var possibility_type_info;
|
||
|
if (___cxa_is_number_type(possibilityType)) {
|
||
|
possibility_type_info = possibilityType;
|
||
|
} else {
|
||
|
var possibility_type_infoAddr = HEAP32[((possibilityType)>>2)] - 8;
|
||
|
possibility_type_info = HEAP32[((possibility_type_infoAddr)>>2)];
|
||
|
}
|
||
|
switch (possibility_type_info) {
|
||
|
case 0: // possibility is a pointer
|
||
|
// See if definite type is a pointer
|
||
|
var definite_type_infoAddr = HEAP32[((definiteType)>>2)] - 8;
|
||
|
var definite_type_info = HEAP32[((definite_type_infoAddr)>>2)];
|
||
|
if (definite_type_info == 0) {
|
||
|
// Also a pointer; compare base types of pointers
|
||
|
var defPointerBaseAddr = definiteType+8;
|
||
|
var defPointerBaseType = HEAP32[((defPointerBaseAddr)>>2)];
|
||
|
var possPointerBaseAddr = possibilityType+8;
|
||
|
var possPointerBaseType = HEAP32[((possPointerBaseAddr)>>2)];
|
||
|
return ___cxa_does_inherit(defPointerBaseType, possPointerBaseType, possibility);
|
||
|
} else
|
||
|
return false; // one pointer and one non-pointer
|
||
|
case 1: // class with no base class
|
||
|
return false;
|
||
|
case 2: // class with base class
|
||
|
var parentTypeAddr = possibilityType + 8;
|
||
|
var parentType = HEAP32[((parentTypeAddr)>>2)];
|
||
|
return ___cxa_does_inherit(definiteType, parentType, possibility);
|
||
|
default:
|
||
|
return false; // some unencountered type
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___resumeException(ptr) {
|
||
|
if (!___cxa_last_thrown_exception) { ___cxa_last_thrown_exception = ptr; }
|
||
|
throw ptr + " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";
|
||
|
}
|
||
|
|
||
|
var ___cxa_last_thrown_exception=0;
|
||
|
|
||
|
var ___cxa_exception_header_size=8;function ___cxa_find_matching_catch(thrown, throwntype) {
|
||
|
if (thrown == -1) thrown = ___cxa_last_thrown_exception;
|
||
|
header = thrown - ___cxa_exception_header_size;
|
||
|
if (throwntype == -1) throwntype = HEAP32[((header)>>2)];
|
||
|
var typeArray = Array.prototype.slice.call(arguments, 2);
|
||
|
|
||
|
// If throwntype is a pointer, this means a pointer has been
|
||
|
// thrown. When a pointer is thrown, actually what's thrown
|
||
|
// is a pointer to the pointer. We'll dereference it.
|
||
|
if (throwntype != 0 && !___cxa_is_number_type(throwntype)) {
|
||
|
var throwntypeInfoAddr= HEAP32[((throwntype)>>2)] - 8;
|
||
|
var throwntypeInfo= HEAP32[((throwntypeInfoAddr)>>2)];
|
||
|
if (throwntypeInfo == 0)
|
||
|
thrown = HEAP32[((thrown)>>2)];
|
||
|
}
|
||
|
// The different catch blocks are denoted by different types.
|
||
|
// Due to inheritance, those types may not precisely match the
|
||
|
// type of the thrown object. Find one which matches, and
|
||
|
// return the type of the catch block which should be called.
|
||
|
for (var i = 0; i < typeArray.length; i++) {
|
||
|
if (___cxa_does_inherit(typeArray[i], throwntype, thrown))
|
||
|
return ((asm["setTempRet0"](typeArray[i]),thrown)|0);
|
||
|
}
|
||
|
// Shouldn't happen unless we have bogus data in typeArray
|
||
|
// or encounter a type for which emscripten doesn't have suitable
|
||
|
// typeinfo defined. Best-efforts match just in case.
|
||
|
return ((asm["setTempRet0"](throwntype),thrown)|0);
|
||
|
}function ___cxa_throw(ptr, type, destructor) {
|
||
|
if (!___cxa_throw.initialized) {
|
||
|
try {
|
||
|
HEAP32[((__ZTVN10__cxxabiv119__pointer_type_infoE)>>2)]=0; // Workaround for libcxxabi integration bug
|
||
|
} catch(e){}
|
||
|
try {
|
||
|
HEAP32[((__ZTVN10__cxxabiv117__class_type_infoE)>>2)]=1; // Workaround for libcxxabi integration bug
|
||
|
} catch(e){}
|
||
|
try {
|
||
|
HEAP32[((__ZTVN10__cxxabiv120__si_class_type_infoE)>>2)]=2; // Workaround for libcxxabi integration bug
|
||
|
} catch(e){}
|
||
|
___cxa_throw.initialized = true;
|
||
|
}
|
||
|
var header = ptr - ___cxa_exception_header_size;
|
||
|
HEAP32[((header)>>2)]=type
|
||
|
HEAP32[(((header)+(4))>>2)]=destructor
|
||
|
___cxa_last_thrown_exception = ptr;
|
||
|
if (!("uncaught_exception" in __ZSt18uncaught_exceptionv)) {
|
||
|
__ZSt18uncaught_exceptionv.uncaught_exception = 1;
|
||
|
} else {
|
||
|
__ZSt18uncaught_exceptionv.uncaught_exception++;
|
||
|
}
|
||
|
throw ptr + " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";
|
||
|
}
|
||
|
|
||
|
var _FtoIHigh=true;
|
||
|
|
||
|
|
||
|
|
||
|
function _fprintf(stream, format, varargs) {
|
||
|
// int fprintf(FILE *restrict stream, const char *restrict format, ...);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
|
||
|
var result = __formatString(format, varargs);
|
||
|
var stack = Runtime.stackSave();
|
||
|
var ret = _fwrite(allocate(result, 'i8', ALLOC_STACK), 1, result.length, stream);
|
||
|
Runtime.stackRestore(stack);
|
||
|
return ret;
|
||
|
}function _printf(format, varargs) {
|
||
|
// int printf(const char *restrict format, ...);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
|
||
|
var stdout = HEAP32[((_stdout)>>2)];
|
||
|
return _fprintf(stdout, format, varargs);
|
||
|
}
|
||
|
|
||
|
function _fopen(filename, mode) {
|
||
|
// FILE *fopen(const char *restrict filename, const char *restrict mode);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fopen.html
|
||
|
var flags;
|
||
|
mode = Pointer_stringify(mode);
|
||
|
if (mode[0] == 'r') {
|
||
|
if (mode.indexOf('+') != -1) {
|
||
|
flags = 2;
|
||
|
} else {
|
||
|
flags = 0;
|
||
|
}
|
||
|
} else if (mode[0] == 'w') {
|
||
|
if (mode.indexOf('+') != -1) {
|
||
|
flags = 2;
|
||
|
} else {
|
||
|
flags = 1;
|
||
|
}
|
||
|
flags |= 64;
|
||
|
flags |= 512;
|
||
|
} else if (mode[0] == 'a') {
|
||
|
if (mode.indexOf('+') != -1) {
|
||
|
flags = 2;
|
||
|
} else {
|
||
|
flags = 1;
|
||
|
}
|
||
|
flags |= 64;
|
||
|
flags |= 1024;
|
||
|
} else {
|
||
|
___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
return 0;
|
||
|
}
|
||
|
var ret = _open(filename, flags, allocate([0x1FF, 0, 0, 0], 'i32', ALLOC_STACK)); // All creation permissions.
|
||
|
return (ret == -1) ? 0 : ret;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
Module["_strncpy"] = _strncpy;
|
||
|
|
||
|
function _inflateEnd() {
|
||
|
Module['printErr']('dead function: inflateEnd'); abort(-1);
|
||
|
}
|
||
|
|
||
|
var _emscripten_postinvoke=true;
|
||
|
|
||
|
var _copysignl=_copysign;
|
||
|
|
||
|
function _FcPatternGetString() {
|
||
|
Module['printErr']('missing function: FcPatternGetString'); abort(-1);
|
||
|
}
|
||
|
|
||
|
function _qsort(base, num, size, cmp) {
|
||
|
if (num == 0 || size == 0) return;
|
||
|
// forward calls to the JavaScript sort method
|
||
|
// first, sort the items logically
|
||
|
var keys = [];
|
||
|
for (var i = 0; i < num; i++) keys.push(i);
|
||
|
keys.sort(function(a, b) {
|
||
|
return Module['dynCall_iii'](cmp, base+a*size, base+b*size);
|
||
|
});
|
||
|
// apply the sort
|
||
|
var temp = _malloc(num*size);
|
||
|
_memcpy(temp, base, num*size);
|
||
|
for (var i = 0; i < num; i++) {
|
||
|
if (keys[i] == i) continue; // already in place
|
||
|
_memcpy(base+i*size, temp+keys[i]*size, size);
|
||
|
}
|
||
|
_free(temp);
|
||
|
}
|
||
|
|
||
|
function _isalpha(chr) {
|
||
|
return (chr >= 97 && chr <= 122) ||
|
||
|
(chr >= 65 && chr <= 90);
|
||
|
}
|
||
|
|
||
|
|
||
|
Module["_memcmp"] = _memcmp;
|
||
|
|
||
|
function _strdup(ptr) {
|
||
|
var len = _strlen(ptr);
|
||
|
var newStr = _malloc(len + 1);
|
||
|
(_memcpy(newStr, ptr, len)|0);
|
||
|
HEAP8[(((newStr)+(len))|0)]=0;
|
||
|
return newStr;
|
||
|
}
|
||
|
|
||
|
function _log10(x) {
|
||
|
return Math.log(x) / Math.LN10;
|
||
|
}
|
||
|
|
||
|
|
||
|
Module["_bitshift64Lshr"] = _bitshift64Lshr;
|
||
|
|
||
|
function _srand(seed) {}
|
||
|
|
||
|
var _emscripten_prep_setjmp=true;
|
||
|
|
||
|
var _BDtoIHigh=true;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
Module["_testSetjmp"] = _testSetjmp;function _longjmp(env, value) {
|
||
|
asm['setThrew'](env, value || 1);
|
||
|
throw 'longjmp';
|
||
|
}function _emscripten_longjmp(env, value) {
|
||
|
_longjmp(env, value);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
var _environ=allocate(1, "i32*", ALLOC_STATIC);var ___environ=_environ;function ___buildEnvironment(env) {
|
||
|
// WARNING: Arbitrary limit!
|
||
|
var MAX_ENV_VALUES = 64;
|
||
|
var TOTAL_ENV_SIZE = 1024;
|
||
|
|
||
|
// Statically allocate memory for the environment.
|
||
|
var poolPtr;
|
||
|
var envPtr;
|
||
|
if (!___buildEnvironment.called) {
|
||
|
___buildEnvironment.called = true;
|
||
|
// Set default values. Use string keys for Closure Compiler compatibility.
|
||
|
ENV['USER'] = 'root';
|
||
|
ENV['PATH'] = '/';
|
||
|
ENV['PWD'] = '/';
|
||
|
ENV['HOME'] = '/home/emscripten';
|
||
|
ENV['LANG'] = 'en_US.UTF-8';
|
||
|
ENV['_'] = './this.program';
|
||
|
// Allocate memory.
|
||
|
poolPtr = allocate(TOTAL_ENV_SIZE, 'i8', ALLOC_STATIC);
|
||
|
envPtr = allocate(MAX_ENV_VALUES * 4,
|
||
|
'i8*', ALLOC_STATIC);
|
||
|
HEAP32[((envPtr)>>2)]=poolPtr;
|
||
|
HEAP32[((_environ)>>2)]=envPtr;
|
||
|
} else {
|
||
|
envPtr = HEAP32[((_environ)>>2)];
|
||
|
poolPtr = HEAP32[((envPtr)>>2)];
|
||
|
}
|
||
|
|
||
|
// Collect key=value lines.
|
||
|
var strings = [];
|
||
|
var totalSize = 0;
|
||
|
for (var key in env) {
|
||
|
if (typeof env[key] === 'string') {
|
||
|
var line = key + '=' + env[key];
|
||
|
strings.push(line);
|
||
|
totalSize += line.length;
|
||
|
}
|
||
|
}
|
||
|
if (totalSize > TOTAL_ENV_SIZE) {
|
||
|
throw new Error('Environment size exceeded TOTAL_ENV_SIZE!');
|
||
|
}
|
||
|
|
||
|
// Make new.
|
||
|
var ptrSize = 4;
|
||
|
for (var i = 0; i < strings.length; i++) {
|
||
|
var line = strings[i];
|
||
|
writeAsciiToMemory(line, poolPtr);
|
||
|
HEAP32[(((envPtr)+(i * ptrSize))>>2)]=poolPtr;
|
||
|
poolPtr += line.length + 1;
|
||
|
}
|
||
|
HEAP32[(((envPtr)+(strings.length * ptrSize))>>2)]=0;
|
||
|
}var ENV={};function _getenv(name) {
|
||
|
// char *getenv(const char *name);
|
||
|
// http://pubs.opengroup.org/onlinepubs/009695399/functions/getenv.html
|
||
|
if (name === 0) return 0;
|
||
|
name = Pointer_stringify(name);
|
||
|
if (!ENV.hasOwnProperty(name)) return 0;
|
||
|
|
||
|
if (_getenv.ret) _free(_getenv.ret);
|
||
|
_getenv.ret = allocate(intArrayFromString(ENV[name]), 'i8', ALLOC_NORMAL);
|
||
|
return _getenv.ret;
|
||
|
}
|
||
|
|
||
|
function _gettimeofday(ptr) {
|
||
|
var now = Date.now();
|
||
|
HEAP32[((ptr)>>2)]=Math.floor(now/1000); // seconds
|
||
|
HEAP32[(((ptr)+(4))>>2)]=Math.floor((now-1000*Math.floor(now/1000))*1000); // microseconds
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
function _atoi(ptr) {
|
||
|
return _strtol(ptr, null, 10);
|
||
|
}
|
||
|
|
||
|
function _vfprintf(s, f, va_arg) {
|
||
|
return _fprintf(s, f, HEAP32[((va_arg)>>2)]);
|
||
|
}
|
||
|
|
||
|
var _atol=_atoi;
|
||
|
|
||
|
function _pthread_mutex_unlock() {}
|
||
|
|
||
|
|
||
|
function _inflate() {
|
||
|
Module['printErr']('dead function: inflate'); abort(-1);
|
||
|
}
|
||
|
|
||
|
function _sbrk(bytes) {
|
||
|
// Implement a Linux-like 'memory area' for our 'process'.
|
||
|
// Changes the size of the memory area by |bytes|; returns the
|
||
|
// address of the previous top ('break') of the memory area
|
||
|
// We control the "dynamic" memory - DYNAMIC_BASE to DYNAMICTOP
|
||
|
var self = _sbrk;
|
||
|
if (!self.called) {
|
||
|
DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned
|
||
|
self.called = true;
|
||
|
assert(Runtime.dynamicAlloc);
|
||
|
self.alloc = Runtime.dynamicAlloc;
|
||
|
Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };
|
||
|
}
|
||
|
var ret = DYNAMICTOP;
|
||
|
if (bytes != 0) self.alloc(bytes);
|
||
|
return ret; // Previous break location.
|
||
|
}
|
||
|
|
||
|
function _localeconv() {
|
||
|
// %struct.timeval = type { char* decimal point, other stuff... }
|
||
|
// var indexes = Runtime.calculateStructAlignment({ fields: ['i32', 'i32'] });
|
||
|
var me = _localeconv;
|
||
|
if (!me.ret) {
|
||
|
me.ret = allocate([allocate(intArrayFromString('.'), 'i8', ALLOC_NORMAL)], 'i8*', ALLOC_NORMAL); // just decimal point, for now
|
||
|
}
|
||
|
return me.ret;
|
||
|
}
|
||
|
|
||
|
function ___errno_location() {
|
||
|
return ___errno_state;
|
||
|
}
|
||
|
|
||
|
var _BItoD=true;
|
||
|
|
||
|
function _pthread_mutex_destroy() {}
|
||
|
|
||
|
|
||
|
function _stat(path, buf, dontResolveLastLink) {
|
||
|
// http://pubs.opengroup.org/onlinepubs/7908799/xsh/stat.html
|
||
|
// int stat(const char *path, struct stat *buf);
|
||
|
// NOTE: dontResolveLastLink is a shortcut for lstat(). It should never be
|
||
|
// used in client code.
|
||
|
path = typeof path !== 'string' ? Pointer_stringify(path) : path;
|
||
|
try {
|
||
|
var stat = dontResolveLastLink ? FS.lstat(path) : FS.stat(path);
|
||
|
HEAP32[((buf)>>2)]=stat.dev;
|
||
|
HEAP32[(((buf)+(4))>>2)]=0;
|
||
|
HEAP32[(((buf)+(8))>>2)]=stat.ino;
|
||
|
HEAP32[(((buf)+(12))>>2)]=stat.mode;
|
||
|
HEAP32[(((buf)+(16))>>2)]=stat.nlink;
|
||
|
HEAP32[(((buf)+(20))>>2)]=stat.uid;
|
||
|
HEAP32[(((buf)+(24))>>2)]=stat.gid;
|
||
|
HEAP32[(((buf)+(28))>>2)]=stat.rdev;
|
||
|
HEAP32[(((buf)+(32))>>2)]=0;
|
||
|
HEAP32[(((buf)+(36))>>2)]=stat.size;
|
||
|
HEAP32[(((buf)+(40))>>2)]=4096;
|
||
|
HEAP32[(((buf)+(44))>>2)]=stat.blocks;
|
||
|
HEAP32[(((buf)+(48))>>2)]=Math.floor(stat.atime.getTime() / 1000);
|
||
|
HEAP32[(((buf)+(52))>>2)]=0;
|
||
|
HEAP32[(((buf)+(56))>>2)]=Math.floor(stat.mtime.getTime() / 1000);
|
||
|
HEAP32[(((buf)+(60))>>2)]=0;
|
||
|
HEAP32[(((buf)+(64))>>2)]=Math.floor(stat.ctime.getTime() / 1000);
|
||
|
HEAP32[(((buf)+(68))>>2)]=0;
|
||
|
HEAP32[(((buf)+(72))>>2)]=stat.ino;
|
||
|
return 0;
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}function _fstat(fildes, buf) {
|
||
|
// int fstat(int fildes, struct stat *buf);
|
||
|
// http://pubs.opengroup.org/onlinepubs/7908799/xsh/fstat.html
|
||
|
var stream = FS.getStream(fildes);
|
||
|
if (!stream) {
|
||
|
___setErrNo(ERRNO_CODES.EBADF);
|
||
|
return -1;
|
||
|
}
|
||
|
return _stat(stream.path, buf);
|
||
|
}
|
||
|
|
||
|
function _ungetc(c, stream) {
|
||
|
// int ungetc(int c, FILE *stream);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/ungetc.html
|
||
|
stream = FS.getStream(stream);
|
||
|
if (!stream) {
|
||
|
return -1;
|
||
|
}
|
||
|
if (c === -1) {
|
||
|
// do nothing for EOF character
|
||
|
return c;
|
||
|
}
|
||
|
c = unSign(c & 0xFF);
|
||
|
stream.ungotten.push(c);
|
||
|
stream.eof = false;
|
||
|
return c;
|
||
|
}
|
||
|
|
||
|
function _getpwuid(uid) {
|
||
|
return 0; // NULL
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function __getFloat(text) {
|
||
|
return /^[+-]?[0-9]*\.?[0-9]+([eE][+-]?[0-9]+)?/.exec(text);
|
||
|
}function __scanString(format, get, unget, varargs) {
|
||
|
if (!__scanString.whiteSpace) {
|
||
|
__scanString.whiteSpace = {};
|
||
|
__scanString.whiteSpace[32] = 1;
|
||
|
__scanString.whiteSpace[9] = 1;
|
||
|
__scanString.whiteSpace[10] = 1;
|
||
|
__scanString.whiteSpace[11] = 1;
|
||
|
__scanString.whiteSpace[12] = 1;
|
||
|
__scanString.whiteSpace[13] = 1;
|
||
|
}
|
||
|
// Supports %x, %4x, %d.%d, %lld, %s, %f, %lf.
|
||
|
// TODO: Support all format specifiers.
|
||
|
format = Pointer_stringify(format);
|
||
|
var soFar = 0;
|
||
|
if (format.indexOf('%n') >= 0) {
|
||
|
// need to track soFar
|
||
|
var _get = get;
|
||
|
get = function get() {
|
||
|
soFar++;
|
||
|
return _get();
|
||
|
}
|
||
|
var _unget = unget;
|
||
|
unget = function unget() {
|
||
|
soFar--;
|
||
|
return _unget();
|
||
|
}
|
||
|
}
|
||
|
var formatIndex = 0;
|
||
|
var argsi = 0;
|
||
|
var fields = 0;
|
||
|
var argIndex = 0;
|
||
|
var next;
|
||
|
|
||
|
mainLoop:
|
||
|
for (var formatIndex = 0; formatIndex < format.length;) {
|
||
|
if (format[formatIndex] === '%' && format[formatIndex+1] == 'n') {
|
||
|
var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];
|
||
|
argIndex += Runtime.getAlignSize('void*', null, true);
|
||
|
HEAP32[((argPtr)>>2)]=soFar;
|
||
|
formatIndex += 2;
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
if (format[formatIndex] === '%') {
|
||
|
var nextC = format.indexOf('c', formatIndex+1);
|
||
|
if (nextC > 0) {
|
||
|
var maxx = 1;
|
||
|
if (nextC > formatIndex+1) {
|
||
|
var sub = format.substring(formatIndex+1, nextC);
|
||
|
maxx = parseInt(sub);
|
||
|
if (maxx != sub) maxx = 0;
|
||
|
}
|
||
|
if (maxx) {
|
||
|
var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];
|
||
|
argIndex += Runtime.getAlignSize('void*', null, true);
|
||
|
fields++;
|
||
|
for (var i = 0; i < maxx; i++) {
|
||
|
next = get();
|
||
|
HEAP8[((argPtr++)|0)]=next;
|
||
|
}
|
||
|
formatIndex += nextC - formatIndex + 1;
|
||
|
continue;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// handle %[...]
|
||
|
if (format[formatIndex] === '%' && format.indexOf('[', formatIndex+1) > 0) {
|
||
|
var match = /\%([0-9]*)\[(\^)?(\]?[^\]]*)\]/.exec(format.substring(formatIndex));
|
||
|
if (match) {
|
||
|
var maxNumCharacters = parseInt(match[1]) || Infinity;
|
||
|
var negateScanList = (match[2] === '^');
|
||
|
var scanList = match[3];
|
||
|
|
||
|
// expand "middle" dashs into character sets
|
||
|
var middleDashMatch;
|
||
|
while ((middleDashMatch = /([^\-])\-([^\-])/.exec(scanList))) {
|
||
|
var rangeStartCharCode = middleDashMatch[1].charCodeAt(0);
|
||
|
var rangeEndCharCode = middleDashMatch[2].charCodeAt(0);
|
||
|
for (var expanded = ''; rangeStartCharCode <= rangeEndCharCode; expanded += String.fromCharCode(rangeStartCharCode++));
|
||
|
scanList = scanList.replace(middleDashMatch[1] + '-' + middleDashMatch[2], expanded);
|
||
|
}
|
||
|
|
||
|
var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];
|
||
|
argIndex += Runtime.getAlignSize('void*', null, true);
|
||
|
fields++;
|
||
|
|
||
|
for (var i = 0; i < maxNumCharacters; i++) {
|
||
|
next = get();
|
||
|
if (negateScanList) {
|
||
|
if (scanList.indexOf(String.fromCharCode(next)) < 0) {
|
||
|
HEAP8[((argPtr++)|0)]=next;
|
||
|
} else {
|
||
|
unget();
|
||
|
break;
|
||
|
}
|
||
|
} else {
|
||
|
if (scanList.indexOf(String.fromCharCode(next)) >= 0) {
|
||
|
HEAP8[((argPtr++)|0)]=next;
|
||
|
} else {
|
||
|
unget();
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// write out null-terminating character
|
||
|
HEAP8[((argPtr++)|0)]=0;
|
||
|
formatIndex += match[0].length;
|
||
|
|
||
|
continue;
|
||
|
}
|
||
|
}
|
||
|
// remove whitespace
|
||
|
while (1) {
|
||
|
next = get();
|
||
|
if (next == 0) return fields;
|
||
|
if (!(next in __scanString.whiteSpace)) break;
|
||
|
}
|
||
|
unget();
|
||
|
|
||
|
if (format[formatIndex] === '%') {
|
||
|
formatIndex++;
|
||
|
var suppressAssignment = false;
|
||
|
if (format[formatIndex] == '*') {
|
||
|
suppressAssignment = true;
|
||
|
formatIndex++;
|
||
|
}
|
||
|
var maxSpecifierStart = formatIndex;
|
||
|
while (format[formatIndex].charCodeAt(0) >= 48 &&
|
||
|
format[formatIndex].charCodeAt(0) <= 57) {
|
||
|
formatIndex++;
|
||
|
}
|
||
|
var max_;
|
||
|
if (formatIndex != maxSpecifierStart) {
|
||
|
max_ = parseInt(format.slice(maxSpecifierStart, formatIndex), 10);
|
||
|
}
|
||
|
var long_ = false;
|
||
|
var half = false;
|
||
|
var longLong = false;
|
||
|
if (format[formatIndex] == 'l') {
|
||
|
long_ = true;
|
||
|
formatIndex++;
|
||
|
if (format[formatIndex] == 'l') {
|
||
|
longLong = true;
|
||
|
formatIndex++;
|
||
|
}
|
||
|
} else if (format[formatIndex] == 'h') {
|
||
|
half = true;
|
||
|
formatIndex++;
|
||
|
}
|
||
|
var type = format[formatIndex];
|
||
|
formatIndex++;
|
||
|
var curr = 0;
|
||
|
var buffer = [];
|
||
|
// Read characters according to the format. floats are trickier, they may be in an unfloat state in the middle, then be a valid float later
|
||
|
if (type == 'f' || type == 'e' || type == 'g' ||
|
||
|
type == 'F' || type == 'E' || type == 'G') {
|
||
|
next = get();
|
||
|
while (next > 0 && (!(next in __scanString.whiteSpace))) {
|
||
|
buffer.push(String.fromCharCode(next));
|
||
|
next = get();
|
||
|
}
|
||
|
var m = __getFloat(buffer.join(''));
|
||
|
var last = m ? m[0].length : 0;
|
||
|
for (var i = 0; i < buffer.length - last + 1; i++) {
|
||
|
unget();
|
||
|
}
|
||
|
buffer.length = last;
|
||
|
} else {
|
||
|
next = get();
|
||
|
var first = true;
|
||
|
|
||
|
// Strip the optional 0x prefix for %x.
|
||
|
if ((type == 'x' || type == 'X') && (next == 48)) {
|
||
|
var peek = get();
|
||
|
if (peek == 120 || peek == 88) {
|
||
|
next = get();
|
||
|
} else {
|
||
|
unget();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
while ((curr < max_ || isNaN(max_)) && next > 0) {
|
||
|
if (!(next in __scanString.whiteSpace) && // stop on whitespace
|
||
|
(type == 's' ||
|
||
|
((type === 'd' || type == 'u' || type == 'i') && ((next >= 48 && next <= 57) ||
|
||
|
(first && next == 45))) ||
|
||
|
((type === 'x' || type === 'X') && (next >= 48 && next <= 57 ||
|
||
|
next >= 97 && next <= 102 ||
|
||
|
next >= 65 && next <= 70))) &&
|
||
|
(formatIndex >= format.length || next !== format[formatIndex].charCodeAt(0))) { // Stop when we read something that is coming up
|
||
|
buffer.push(String.fromCharCode(next));
|
||
|
next = get();
|
||
|
curr++;
|
||
|
first = false;
|
||
|
} else {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
unget();
|
||
|
}
|
||
|
if (buffer.length === 0) return 0; // Failure.
|
||
|
if (suppressAssignment) continue;
|
||
|
|
||
|
var text = buffer.join('');
|
||
|
var argPtr = HEAP32[(((varargs)+(argIndex))>>2)];
|
||
|
argIndex += Runtime.getAlignSize('void*', null, true);
|
||
|
switch (type) {
|
||
|
case 'd': case 'u': case 'i':
|
||
|
if (half) {
|
||
|
HEAP16[((argPtr)>>1)]=parseInt(text, 10);
|
||
|
} else if (longLong) {
|
||
|
(tempI64 = [parseInt(text, 10)>>>0,(tempDouble=parseInt(text, 10),(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((argPtr)>>2)]=tempI64[0],HEAP32[(((argPtr)+(4))>>2)]=tempI64[1]);
|
||
|
} else {
|
||
|
HEAP32[((argPtr)>>2)]=parseInt(text, 10);
|
||
|
}
|
||
|
break;
|
||
|
case 'X':
|
||
|
case 'x':
|
||
|
HEAP32[((argPtr)>>2)]=parseInt(text, 16);
|
||
|
break;
|
||
|
case 'F':
|
||
|
case 'f':
|
||
|
case 'E':
|
||
|
case 'e':
|
||
|
case 'G':
|
||
|
case 'g':
|
||
|
case 'E':
|
||
|
// fallthrough intended
|
||
|
if (long_) {
|
||
|
HEAPF64[((argPtr)>>3)]=parseFloat(text);
|
||
|
} else {
|
||
|
HEAPF32[((argPtr)>>2)]=parseFloat(text);
|
||
|
}
|
||
|
break;
|
||
|
case 's':
|
||
|
var array = intArrayFromString(text);
|
||
|
for (var j = 0; j < array.length; j++) {
|
||
|
HEAP8[(((argPtr)+(j))|0)]=array[j];
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
fields++;
|
||
|
} else if (format[formatIndex].charCodeAt(0) in __scanString.whiteSpace) {
|
||
|
next = get();
|
||
|
while (next in __scanString.whiteSpace) {
|
||
|
if (next <= 0) break mainLoop; // End of input.
|
||
|
next = get();
|
||
|
}
|
||
|
unget(next);
|
||
|
formatIndex++;
|
||
|
} else {
|
||
|
// Not a specifier.
|
||
|
next = get();
|
||
|
if (format[formatIndex].charCodeAt(0) !== next) {
|
||
|
unget(next);
|
||
|
break mainLoop;
|
||
|
}
|
||
|
formatIndex++;
|
||
|
}
|
||
|
}
|
||
|
return fields;
|
||
|
}function _sscanf(s, format, varargs) {
|
||
|
// int sscanf(const char *restrict s, const char *restrict format, ... );
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/scanf.html
|
||
|
var index = 0;
|
||
|
function get() { return HEAP8[(((s)+(index++))|0)]; };
|
||
|
function unget() { index--; };
|
||
|
return __scanString(format, get, unget, varargs);
|
||
|
}
|
||
|
|
||
|
function _sysconf(name) {
|
||
|
// long sysconf(int name);
|
||
|
// http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
|
||
|
switch(name) {
|
||
|
case 30: return PAGE_SIZE;
|
||
|
case 132:
|
||
|
case 133:
|
||
|
case 12:
|
||
|
case 137:
|
||
|
case 138:
|
||
|
case 15:
|
||
|
case 235:
|
||
|
case 16:
|
||
|
case 17:
|
||
|
case 18:
|
||
|
case 19:
|
||
|
case 20:
|
||
|
case 149:
|
||
|
case 13:
|
||
|
case 10:
|
||
|
case 236:
|
||
|
case 153:
|
||
|
case 9:
|
||
|
case 21:
|
||
|
case 22:
|
||
|
case 159:
|
||
|
case 154:
|
||
|
case 14:
|
||
|
case 77:
|
||
|
case 78:
|
||
|
case 139:
|
||
|
case 80:
|
||
|
case 81:
|
||
|
case 79:
|
||
|
case 82:
|
||
|
case 68:
|
||
|
case 67:
|
||
|
case 164:
|
||
|
case 11:
|
||
|
case 29:
|
||
|
case 47:
|
||
|
case 48:
|
||
|
case 95:
|
||
|
case 52:
|
||
|
case 51:
|
||
|
case 46:
|
||
|
return 200809;
|
||
|
case 27:
|
||
|
case 246:
|
||
|
case 127:
|
||
|
case 128:
|
||
|
case 23:
|
||
|
case 24:
|
||
|
case 160:
|
||
|
case 161:
|
||
|
case 181:
|
||
|
case 182:
|
||
|
case 242:
|
||
|
case 183:
|
||
|
case 184:
|
||
|
case 243:
|
||
|
case 244:
|
||
|
case 245:
|
||
|
case 165:
|
||
|
case 178:
|
||
|
case 179:
|
||
|
case 49:
|
||
|
case 50:
|
||
|
case 168:
|
||
|
case 169:
|
||
|
case 175:
|
||
|
case 170:
|
||
|
case 171:
|
||
|
case 172:
|
||
|
case 97:
|
||
|
case 76:
|
||
|
case 32:
|
||
|
case 173:
|
||
|
case 35:
|
||
|
return -1;
|
||
|
case 176:
|
||
|
case 177:
|
||
|
case 7:
|
||
|
case 155:
|
||
|
case 8:
|
||
|
case 157:
|
||
|
case 125:
|
||
|
case 126:
|
||
|
case 92:
|
||
|
case 93:
|
||
|
case 129:
|
||
|
case 130:
|
||
|
case 131:
|
||
|
case 94:
|
||
|
case 91:
|
||
|
return 1;
|
||
|
case 74:
|
||
|
case 60:
|
||
|
case 69:
|
||
|
case 70:
|
||
|
case 4:
|
||
|
return 1024;
|
||
|
case 31:
|
||
|
case 42:
|
||
|
case 72:
|
||
|
return 32;
|
||
|
case 87:
|
||
|
case 26:
|
||
|
case 33:
|
||
|
return 2147483647;
|
||
|
case 34:
|
||
|
case 1:
|
||
|
return 47839;
|
||
|
case 38:
|
||
|
case 36:
|
||
|
return 99;
|
||
|
case 43:
|
||
|
case 37:
|
||
|
return 2048;
|
||
|
case 0: return 2097152;
|
||
|
case 3: return 65536;
|
||
|
case 28: return 32768;
|
||
|
case 44: return 32767;
|
||
|
case 75: return 16384;
|
||
|
case 39: return 1000;
|
||
|
case 89: return 700;
|
||
|
case 71: return 256;
|
||
|
case 40: return 255;
|
||
|
case 2: return 100;
|
||
|
case 180: return 64;
|
||
|
case 25: return 20;
|
||
|
case 5: return 16;
|
||
|
case 6: return 6;
|
||
|
case 73: return 4;
|
||
|
case 84: return 1;
|
||
|
}
|
||
|
___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
var _SItoD=true;
|
||
|
|
||
|
var _SItoF=true;
|
||
|
|
||
|
var _llvm_memmove_p0i8_p0i8_i32=_memmove;
|
||
|
|
||
|
var _ftello=_ftell;
|
||
|
|
||
|
function _strtok_r(s, delim, lasts) {
|
||
|
var skip_leading_delim = 1;
|
||
|
var spanp;
|
||
|
var c, sc;
|
||
|
var tok;
|
||
|
|
||
|
|
||
|
if (s == 0 && (s = getValue(lasts, 'i8*')) == 0) {
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cont: while (1) {
|
||
|
c = getValue(s++, 'i8');
|
||
|
for (spanp = delim; (sc = getValue(spanp++, 'i8')) != 0;) {
|
||
|
if (c == sc) {
|
||
|
if (skip_leading_delim) {
|
||
|
continue cont;
|
||
|
} else {
|
||
|
setValue(lasts, s, 'i8*');
|
||
|
setValue(s - 1, 0, 'i8');
|
||
|
return s - 1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
if (c == 0) {
|
||
|
setValue(lasts, 0, 'i8*');
|
||
|
return 0;
|
||
|
}
|
||
|
tok = s - 1;
|
||
|
|
||
|
for (;;) {
|
||
|
c = getValue(s++, 'i8');
|
||
|
spanp = delim;
|
||
|
do {
|
||
|
if ((sc = getValue(spanp++, 'i8')) == c) {
|
||
|
if (c == 0) {
|
||
|
s = 0;
|
||
|
} else {
|
||
|
setValue(s - 1, 0, 'i8');
|
||
|
}
|
||
|
setValue(lasts, s, 'i8*');
|
||
|
return tok;
|
||
|
}
|
||
|
} while (sc != 0);
|
||
|
}
|
||
|
abort('strtok_r error!');
|
||
|
}
|
||
|
|
||
|
var _DtoIHigh=true;
|
||
|
|
||
|
function _abort() {
|
||
|
Module['abort']();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
var _fabs=Math_abs;
|
||
|
|
||
|
var _floor=Math_floor;
|
||
|
|
||
|
|
||
|
var _sqrt=Math_sqrt;
|
||
|
|
||
|
function _inflateReset() {
|
||
|
Module['printErr']('dead function: inflateReset'); abort(-1);
|
||
|
}
|
||
|
|
||
|
function ___cxa_allocate_exception(size) {
|
||
|
var ptr = _malloc(size + ___cxa_exception_header_size);
|
||
|
return ptr + ___cxa_exception_header_size;
|
||
|
}
|
||
|
|
||
|
var _sin=Math_sin;
|
||
|
|
||
|
var _fmodl=_fmod;
|
||
|
|
||
|
|
||
|
function ___cxa_pure_virtual() {
|
||
|
ABORT = true;
|
||
|
throw 'Pure virtual function called!';
|
||
|
}
|
||
|
|
||
|
|
||
|
function _time(ptr) {
|
||
|
var ret = Math.floor(Date.now()/1000);
|
||
|
if (ptr) {
|
||
|
HEAP32[((ptr)>>2)]=ret;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function _closedir(dirp) {
|
||
|
// int closedir(DIR *dirp);
|
||
|
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/closedir.html
|
||
|
return _close(dirp);
|
||
|
}
|
||
|
|
||
|
function _unlink(path) {
|
||
|
// int unlink(const char *path);
|
||
|
// http://pubs.opengroup.org/onlinepubs/000095399/functions/unlink.html
|
||
|
path = Pointer_stringify(path);
|
||
|
try {
|
||
|
FS.unlink(path);
|
||
|
return 0;
|
||
|
} catch (e) {
|
||
|
FS.handleFSError(e);
|
||
|
return -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var _emscripten_setjmp=true;
|
||
|
|
||
|
var _getuid=_getgid;
|
||
|
|
||
|
var _atan2=Math_atan2;
|
||
|
|
||
|
var _FtoILow=true;
|
||
|
|
||
|
function __ZTISt9exception() {
|
||
|
Module['printErr']('missing function: _ZTISt9exception'); abort(-1);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
FS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module["FS_createFolder"] = FS.createFolder;Module["FS_createPath"] = FS.createPath;Module["FS_createDataFile"] = FS.createDataFile;Module["FS_createPreloadedFile"] = FS.createPreloadedFile;Module["FS_createLazyFile"] = FS.createLazyFile;Module["FS_createLink"] = FS.createLink;Module["FS_createDevice"] = FS.createDevice;
|
||
|
___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;
|
||
|
__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();
|
||
|
if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); NODEFS.staticInit(); }
|
||
|
_fputc.ret = allocate([0], "i8", ALLOC_STATIC);
|
||
|
__ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });
|
||
|
Module["requestFullScreen"] = function Module_requestFullScreen(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };
|
||
|
Module["requestAnimationFrame"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };
|
||
|
Module["setCanvasSize"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };
|
||
|
Module["pauseMainLoop"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };
|
||
|
Module["resumeMainLoop"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };
|
||
|
Module["getUserMedia"] = function Module_getUserMedia() { Browser.getUserMedia() }
|
||
|
_fgetc.ret = allocate([0], "i8", ALLOC_STATIC);
|
||
|
___buildEnvironment(ENV);
|
||
|
STACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);
|
||
|
|
||
|
staticSealed = true; // seal the static portion of memory
|
||
|
|
||
|
STACK_MAX = STACK_BASE + 5242880;
|
||
|
|
||
|
DYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);
|
||
|
|
||
|
assert(DYNAMIC_BASE < TOTAL_MEMORY, "TOTAL_MEMORY not big enough for stack");
|
||
|
|
||
|
var ctlz_i8 = allocate([8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "i8", ALLOC_DYNAMIC);
|
||
|
var cttz_i8 = allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0], "i8", ALLOC_DYNAMIC);
|
||
|
|
||
|
var Math_min = Math.min;
|
||
|
function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiii(index,a1,a2,a3,a4,a5) {
|
||
|
try {
|
||
|
Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_vi(index,a1) {
|
||
|
try {
|
||
|
Module["dynCall_vi"](index,a1);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiidd(index,a1,a2,a3,a4,a5) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiidd"](index,a1,a2,a3,a4,a5);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_vii(index,a1,a2) {
|
||
|
try {
|
||
|
Module["dynCall_vii"](index,a1,a2);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiiiii"](index,a1,a2,a3,a4,a5,a6);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_ii(index,a1) {
|
||
|
try {
|
||
|
return Module["dynCall_ii"](index,a1);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viidd(index,a1,a2,a3,a4) {
|
||
|
try {
|
||
|
Module["dynCall_viidd"](index,a1,a2,a3,a4);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viddii(index,a1,a2,a3,a4,a5) {
|
||
|
try {
|
||
|
Module["dynCall_viddii"](index,a1,a2,a3,a4,a5);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiddddddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) {
|
||
|
try {
|
||
|
Module["dynCall_viiddddddiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiiiiiiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiiiiiiiiiidd"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_vidii(index,a1,a2,a3,a4) {
|
||
|
try {
|
||
|
Module["dynCall_vidii"](index,a1,a2,a3,a4);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiii(index,a1,a2,a3,a4) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiii"](index,a1,a2,a3,a4);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiddddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiddddiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) {
|
||
|
try {
|
||
|
Module["dynCall_viiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiii(index,a1,a2,a3) {
|
||
|
try {
|
||
|
return Module["dynCall_iiii"](index,a1,a2,a3);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiddiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiddiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {
|
||
|
try {
|
||
|
Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) {
|
||
|
try {
|
||
|
Module["dynCall_viiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_di(index,a1) {
|
||
|
try {
|
||
|
return Module["dynCall_di"](index,a1);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
|
||
|
try {
|
||
|
Module["dynCall_viiiiiii"](index,a1,a2,a3,a4,a5,a6,a7);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
|
||
|
try {
|
||
|
Module["dynCall_viiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) {
|
||
|
try {
|
||
|
Module["dynCall_viiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iii(index,a1,a2) {
|
||
|
try {
|
||
|
return Module["dynCall_iii"](index,a1,a2);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiiii(index,a1,a2,a3,a4,a5) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiiii"](index,a1,a2,a3,a4,a5);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_dii(index,a1,a2) {
|
||
|
try {
|
||
|
return Module["dynCall_dii"](index,a1,a2);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viidddddd(index,a1,a2,a3,a4,a5,a6,a7,a8) {
|
||
|
try {
|
||
|
Module["dynCall_viidddddd"](index,a1,a2,a3,a4,a5,a6,a7,a8);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
|
||
|
try {
|
||
|
return Module["dynCall_iiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viii(index,a1,a2,a3) {
|
||
|
try {
|
||
|
Module["dynCall_viii"](index,a1,a2,a3);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_v(index) {
|
||
|
try {
|
||
|
Module["dynCall_v"](index);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viid(index,a1,a2,a3) {
|
||
|
try {
|
||
|
Module["dynCall_viid"](index,a1,a2,a3);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function invoke_viiii(index,a1,a2,a3,a4) {
|
||
|
try {
|
||
|
Module["dynCall_viiii"](index,a1,a2,a3,a4);
|
||
|
} catch(e) {
|
||
|
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
||
|
asm["setThrew"](1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function asmPrintInt(x, y) {
|
||
|
Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack);
|
||
|
}
|
||
|
function asmPrintFloat(x, y) {
|
||
|
Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack);
|
||
|
}
|
||
|
// EMSCRIPTEN_START_ASM
|
||
|
var asm=(function(global,env,buffer){"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=env.ctlz_i8|0;var o=env.__ZTISt9exception|0;var p=env._stderr|0;var q=env._stdin|0;var r=env._stdout|0;var s=0;var t=0;var u=0;var v=0;var w=+env.NaN,x=+env.Infinity;var y=0,z=0,A=0,B=0,C=0.0,D=0,E=0,F=0,G=0.0;var H=0;var I=0;var J=0;var K=0;var L=0;var M=0;var N=0;var O=0;var P=0;var Q=0;var R=global.Math.floor;var S=global.Math.abs;var T=global.Math.sqrt;var U=global.Math.pow;var V=global.Math.cos;var W=global.Math.sin;var X=global.Math.tan;var Y=global.Math.acos;var Z=global.Math.asin;var _=global.Math.atan;var $=global.Math.atan2;var aa=global.Math.exp;var ba=global.Math.log;var ca=global.Math.ceil;var da=global.Math.imul;var ea=env.abort;var fa=env.assert;var ga=env.asmPrintInt;var ha=env.asmPrintFloat;var ia=env.min;var ja=env.invoke_iiiiiiii;var ka=env.invoke_viiiii;var la=env.invoke_vi;var ma=env.invoke_iiiidd;var na=env.invoke_vii;var oa=env.invoke_iiiiiii;var pa=env.invoke_ii;var qa=env.invoke_viidd;var ra=env.invoke_viddii;var sa=env.invoke_viiddddddiiii;var ta=env.invoke_iiiiiiiiiiiidd;var ua=env.invoke_vidii;var va=env.invoke_iiiii;var wa=env.invoke_iiiddddiii;var xa=env.invoke_viiiiiiiiiii;var ya=env.invoke_iiii;var za=env.invoke_iiiddiiiiiiiiiii;var Aa=env.invoke_viiiiii;var Ba=env.invoke_viiiiiiiiiiiii;var Ca=env.invoke_di;var Da=env.invoke_iiiiiiiiiii;var Ea=env.invoke_viiiiiii;var Fa=env.invoke_viiiiiiiii;var Ga=env.invoke_viiiiiiiiii;var Ha=env.invoke_iii;var Ia=env.invoke_iiiiii;var Ja=env.invoke_dii;var Ka=env.invoke_viidddddd;var La=env.invoke_iiiiiiiiii;var Ma=env.invoke_viii;var Na=env.invoke_v;var Oa=env.invoke_viid;var Pa=env.invoke_viiii;var Qa=env._isalnum;var Ra=env._fabs;var Sa=env._strrchr;var Ta=env._fread;var Ua=env._memchr;var Va=env._inflateReset;var Wa=env.__reallyNegative;var Xa=env._fstat;var Ya=env.___assert_fail;var Za=env.__ZSt18uncaught_exceptionv;var _a=env._longjmp;var $a=env._fsync;var ab=env._sbrk;var bb=env._sysconf;var cb=env._close;var db=env._cos;var eb=env._readdir;var fb=env._puts;var gb=env._FcPatternBuild;var hb=env._unlink;var ib=env._write;var jb=env._ftell;var kb=env._rand;var lb=env.__ZNSt9exceptionD2Ev;var mb=env.___cxa_does_inherit;var nb=env._strstr;var ob=env._FcPatternDestroy;var pb=env._qsort;var qb=env._closedir;var rb=env._FcPatternGetInteger;var sb=env._send;var tb=env._pow;var ub=env._atan2;var vb=env.___cxa_is_number_type;var wb=env._FcConfigSubstitute;var xb=env._fcntl;var yb=env.___cxa_find_matching_catch;var zb=env._opendir;var Ab=env._isalpha;var Bb=env._strtol;var Cb=env.___setErrNo;var Db=env.___resumeException;var Eb=env._srand;var Fb=env._strchr;var Gb=env._ceil;var Hb=env._putchar;var Ib=env.___buildEnvironment;var Jb=env._localeconv;var Kb=env._printf;var Lb=env._sprintf;var Mb=env._strtok_r;var Nb=env._stat;var Ob=env._FcPatternAddInteger;var Pb=env._getpwnam;var Qb=env._read;var Rb=env._fwrite;var Sb=env._FcPatternGetString;var Tb=env._time;var Ub=env._pthread_mutex_lock;var Vb=env._gettimeofday;var Wb=env._munmap;var Xb=env._mmap;var Yb=env._exit;var Zb=env._readdir_r;var _b=env._inflate;var $b=env._fmod;var ac=env._lseek;var bc=env._vfprintf;var cc=env.___cxa_allocate_exception;var dc=env._asin;var ec=env._atoi;var fc=env._pwrite;var gc=env._open;var hc=env._snprintf;var ic=env._FcFontSort;var jc=env._fseek;var kc=env._pthread_mutex_destroy;var lc=env._isxdigit;var mc=env._fclose;var nc=env.__parseInt;var oc=env._log;var pc=env._recv;var qc=env._fgetc;var rc=env.__getFloat;var sc=env._fputc;var tc=env._abort;var uc=env.___cxa_throw;var vc=env._strncmp;var wc=env._inflateInit2_;var xc=env._isspace;var yc=env._fopen;var zc=env._floor;var Ac=env._getgid;var Bc=env._sin;var Cc=env._acos;var Dc=env.
|
||
|
// EMSCRIPTEN_START_FUNCS
|
||
|
function Kd(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+7&-8;return b|0}function Ld(){return i|0}function Md(a){a=a|0;i=a}function Nd(a,b){a=a|0;b=b|0;if((s|0)==0){s=a;t=b}}function Od(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0]}function Pd(b){b=b|0;a[k]=a[b];a[k+1|0]=a[b+1|0];a[k+2|0]=a[b+2|0];a[k+3|0]=a[b+3|0];a[k+4|0]=a[b+4|0];a[k+5|0]=a[b+5|0];a[k+6|0]=a[b+6|0];a[k+7|0]=a[b+7|0]}function Qd(a){a=a|0;H=a}function Rd(a){a=a|0;I=a}function Sd(a){a=a|0;J=a}function Td(a){a=a|0;K=a}function Ud(a){a=a|0;L=a}function Vd(a){a=a|0;M=a}function Wd(a){a=a|0;N=a}function Xd(a){a=a|0;O=a}function Yd(a){a=a|0;P=a}function Zd(a){a=a|0;Q=a}function _d(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0,y=0.0;e=i;j=i;i=i+24|0;g=j;v=i;i=i+8|0;u=v;r=i;i=i+8|0;q=r;t=i;i=i+8|0;s=t;l=i;i=i+8|0;f=i;i=i+512|0;m=i;i=i+8|0;n=m;o=i;i=i+8|0;c[l>>2]=b;b=ae(8,l,d)|0;if((a[608]&1)!=0){b=(a[616]&1)==0&b}w=+h[78];do{if(w!=0.0){if(!(+h[79]==150.0|+h[80]==150.0)){break}h[79]=w;h[80]=w}}while(0);do{if(b){b=c[l>>2]|0;if((b|0)>3){break}if((a[648]&1)!=0){break}if((a[656]&1)!=0){break}do{if((b|0)>1){q=FW(32)|0;fe(q,c[d+4>>2]|0);if((c[l>>2]|0)!=3){l=q;d=0;break}l=q;d=c[d+8>>2]|0}else{l=0;d=0}}while(0);q=FW(232)|0;Ue(q,0);c[834]=q;do{if((a[872]|0)!=0){if(Af(q,872)|0){break}Rb(888,38,1,c[p>>2]|0)|0}}while(0);do{if((a[928]|0)!=0){if(Bf(c[834]|0,928)|0){break}Rb(944,32,1,c[p>>2]|0)|0}}while(0);do{if((a[984]|0)!=0){if(Cf(c[834]|0,984)|0){break}Rb(1e3,38,1,c[p>>2]|0)|0}}while(0);if((a[1040]&1)!=0){Df(c[834]|0,1)}if((a[1048]|0)==0){q=0}else{q=FW(32)|0;fe(q,1048)}if((a[1088]|0)==0){r=0}else{r=FW(32)|0;fe(r,1088)}if((l|0)==0){l=FW(32)|0;fe(l,1128)}if((te(l,1136)|0)==0){if((l|0)!=0){ke(l);HW(l)}s=FW(32)|0;fe(s,1128)}else{s=l}eg(o,0);l=gg(o,s,q,r,0)|0;fg(o);if((s|0)!=0){ke(s);HW(s)}if((r|0)!=0){ke(r);HW(r)}if((q|0)!=0){ke(q);HW(q)}do{if((a[l+52|0]&1)==0){f=1}else{if((c[286]|0)<1){c[286]=1}o=c[288]|0;if((o|0)<1){k=50}else{if((o|0)>(_f(l)|0)){k=50}}if((k|0)==50){c[288]=_f(l)|0}a[m]=-1;a[n+1|0]=-1;a[n+2|0]=-1;m=FW(256)|0;if((a[608]&1)==0){o=(a[616]&1)!=0?1:2}else{o=0}Mg(m,o,4,0,n,1,1);Qg(m,c[l+28>>2]|0);n=c[290]|0;if((n|0)!=0){c[292]=n;c[294]=n}n=_f(l)|0;if(n>>>0>9){o=1;while(1){o=o+1|0;if(n>>>0>99){n=(n>>>0)/10|0}else{break}}}else{o=1}q=c[286]|0;a:do{if((q|0)<=(c[288]|0)){n=(d|0)==0;while(1){if((a[1184]&1)==0){k=61}else{if((q&1|0)!=0){k=61}}do{if((k|0)==61){k=0;if((a[1192]&1)!=0){if(((q|0)%2|0|0)==1){break}}b=(a[1200]&1)==0;k=($f(l,q)|0)==0;do{if(b){if(k){x=0.0}else{b=c[($f(l,q)|0)+36>>2]|0;x=+h[b+16>>3]- +h[b>>3]}if(($f(l,q)|0)==0){w=0.0;break}b=c[($f(l,q)|0)+36>>2]|0;w=+h[b+24>>3]- +h[b+8>>3]}else{if(k){x=0.0}else{b=c[($f(l,q)|0)+36>>2]|0;x=+h[b+48>>3]- +h[b+32>>3]}if(($f(l,q)|0)==0){w=0.0;break}b=c[($f(l,q)|0)+36>>2]|0;w=+h[b+56>>3]- +h[b+40>>3]}}while(0);k=c[302]|0;do{if((k|0)==0){k=c[304]|0;if((k|0)!=0){h[79]=+(k|0)*72.0/x}k=c[306]|0;if((k|0)==0){y=+h[80];break}else{y=+(k|0)*72.0/w;h[80]=y;break}}else{y=+(k|0)*72.0/(x>w?x:w);h[78]=y;h[80]=y;h[79]=y}}while(0);x=x*(+h[79]/72.0);y=w*(y/72.0);if(($f(l,q)|0)==0){k=81}else{if((c[(c[($f(l,q)|0)+36>>2]|0)+168>>2]|0)==90){k=83}else{k=81}}do{if((k|0)==81){k=0;if(($f(l,q)|0)==0){w=y;break}if((c[(c[($f(l,q)|0)+36>>2]|0)+168>>2]|0)==270){k=83}else{w=y}}}while(0);if((k|0)==83){k=0;w=x;x=y}if(n){$d(l,m,q,c[318]|0,c[320]|0,c[294]|0,c[292]|0,x,w,0);break}if((a[608]&1)==0){r=(a[616]&1)!=0?1256:1264}else{r=1248}c[j>>2]=480;c[g+4>>2]=d;c[g+8>>2]=o;c[g+12>>2]=q;c[g+16>>2]=r;hc(f|0,512,1232,g|0)|0;$d(l,m,q,c[318]|0,c[320]|0,c[294]|0,c[292]|0,x,w,f)}}while(0);if((q|0)>=(c[288]|0)){break a}q=q+1|0}}}while(0);if((m|0)==0){f=0;break}fd[c[(c[m>>2]|0)+4>>2]&511](m);f=0}}while(0);if((l|0)!=0){Zf(l);HW(l)}g=c[834]|0;if((g|0)==0){b=f;i=e;return b|0}af(g);HW(g);b=f;i=e;return b|0}}while(0);f=c[p>>2]|0;c[t>>2]=688;Gc(f|0,664,s|0)|0;c[r>>2]=704;Gc(f|0,696,q|0)|0;c[v>>2]=784;Gc(f|0,696,u|0)|0;f=a[648]|0;if((f&1)==0){be(824,840,8);f=a[648]|0}do{if((f&1)==0){if((a[656]&1)==0){f=99}else{break}i=e;return f|0}}while(0);b=0;i=e;return b|0}function $d(b,d,e,f,g,j,k,l,m,n){b=b|0;d=d|0;e=e|0;f=f|0;g
|
||
|
|
||
|
|
||
|
|
||
|
function Ip(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=+f;g=g|0;var j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0;j=i;k=FW(12)|0;Pq(k,d,e,f,1);e=c[k+4>>2]|0;if((e|0)==4){l=8}else if((e|0)==0){m=+h[b+8>>3]+-1.0;h[b+24>>3]=m;f=+h[b+16>>3]+-1.0;h[b+32>>3]=f;if(m<=0.0){m=+R(+m)}c[b+48>>2]=~~m;if(f<=0.0){f=+R(+f)}c[b+52>>2]=~~f;if((k|0)==0){i=j;return 0}Uq(k);HW(k);i=j;return 0}do{if((l|0)==8){e=c[k>>2]|0;f=+h[e>>3];m=+h[e+16>>3];do{if(f==m){if(f!=+h[e+56>>3]){l=20;break}if(f!=+h[e+184>>3]){l=20;break}o=+h[e+112>>3];if(o!=+h[e+128>>3]){l=20;break}if(o!=+h[e+72>>3]){l=20;break}if(o!=+h[e+168>>3]){l=20;break}n=+h[e+64>>3];if(n!=+h[e+80>>3]){l=20;break}if(n!=+h[e+24>>3]){l=20;break}p=+h[e+120>>3];if(n!=p){l=20;break}q=+h[e+176>>3];if(q!=+h[e+192>>3]){l=20;break}n=+h[e+8>>3];if(q!=n){l=20;break}if(q!=+h[e+136>>3]){l=20}}else{l=20}}while(0);if((l|0)==20){n=+h[e+8>>3];if(n!=+h[e+24>>3]){break}if(n!=+h[e+64>>3]){break}if(n!=+h[e+192>>3]){break}p=+h[e+120>>3];if(p!=+h[e+136>>3]){break}if(p!=+h[e+80>>3]){break}if(p!=+h[e+176>>3]){break}q=+h[e+56>>3];if(!(q==+h[e+72>>3]&q==m)){break}o=+h[e+112>>3];if(q!=o){break}m=+h[e+168>>3];if(!(m==+h[e+184>>3]&m==f)){break}if(m!=+h[e+128>>3]){break}}Hp(b,f,n,o,p)|0;if((k|0)==0){i=j;return 0}Uq(k);HW(k);i=j;return 0}}while(0);l=b+68|0;s=c[l>>2]|0;d=s+1|0;e=b+72|0;r=c[e>>2]|0;if((s|0)>=(r|0)){if((r|0)==0){c[e>>2]=32;r=32}if((r|0)<(d|0)){do{r=r<<1;}while((r|0)<(d|0));c[e>>2]=r}s=b+56|0;c[s>>2]=Ce(c[s>>2]|0,r,4)|0;s=b+60|0;c[s>>2]=Ce(c[s>>2]|0,c[e>>2]|0,1)|0;s=b+64|0;c[s>>2]=Ce(c[s>>2]|0,c[e>>2]|0,4)|0}if((a[b]&1)!=0){Vq(k)}Wq(k);c[(c[b+56>>2]|0)+(c[l>>2]<<2)>>2]=k;a[(c[b+60>>2]|0)+(c[l>>2]|0)|0]=g&1;s=FW(52)|0;$q(s,k,g);c[(c[b+64>>2]|0)+(c[l>>2]<<2)>>2]=s;c[l>>2]=(c[l>>2]|0)+1;i=j;return 0}function Jp(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;g=i;j=+(e+1|0);k=+h[a+8>>3];if(j<=k){e=1;i=g;return e|0}m=+(b|0);l=+h[a+24>>3];if(m>l){e=1;i=g;return e|0}o=+(f+1|0);n=+h[a+16>>3];if(o<=n){e=1;i=g;return e|0}p=+(d|0);q=+h[a+32>>3];if(p>q){e=1;i=g;return e|0}do{if(!(m<k|j>l|p<n|o>q)){if((c[a+68>>2]|0)==0){a=0}else{break}i=g;return a|0}}while(0);e=2;i=g;return e|0}function Kp(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0;g=i;r=+(e+1|0);q=+h[b+8>>3];if(r<=q){t=1;i=g;return t|0}p=+(d|0);l=+h[b+24>>3];if(p>l){t=1;i=g;return t|0}n=+(f+1|0);m=+h[b+16>>3];if(n<=m){t=1;i=g;return t|0}o=+(f|0);k=+h[b+32>>3];if(o>k){t=1;i=g;return t|0}if(p<q|r>l|o<m|n>k){t=2;i=g;return t|0}j=b+68|0;s=(c[j>>2]|0)>0;if((a[b]&1)==0){if(!s){t=0;i=g;return t|0}t=b+64|0;s=0;while(1){b=s+1|0;if(!(er(c[(c[t>>2]|0)+(s<<2)>>2]|0,d,e,f)|0)){e=2;f=15;break}if((b|0)<(c[j>>2]|0)){s=b}else{e=0;f=15;break}}if((f|0)==15){i=g;return e|0}}else{if(!s){t=0;i=g;return t|0}b=b+64|0;d=d<<2;e=e<<2|3;f=f<<2;s=0;while(1){t=s+1|0;if(!(er(c[(c[b>>2]|0)+(s<<2)>>2]|0,d,e,f)|0)){e=2;f=15;break}if((t|0)<(c[j>>2]|0)){s=t}else{e=0;f=15;break}}if((f|0)==15){i=g;return e|0}}return 0}function Lp(b,e,f,g,j){b=b|0;e=e|0;f=f|0;g=g|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0;k=i;n=c[f>>2]|0;s=n<<2;l=b+8|0;v=+h[l>>3]*4.0;if(v<=0.0){v=+R(+v)}m=~~v;o=c[e>>2]|0;m=(m|0)>(o|0)?o:m;if((s|0)<(m|0)){o=s&-8;q=e+20|0;p=e+12|0;r=n>>1;n=255>>>(m&7);u=(c[q>>2]|0)+r|0;do{if((s|7|0)<(m|0)){t=o;while(1){s=u+1|0;a[u]=0;u=t+8|0;if((t+15|0)<(m|0)){t=u;u=s}else{break}}if((u|0)<(m|0)){a[s]=(d[s]|0)&n}u=(c[q>>2]|0)+((c[p>>2]|0)+r)|0;t=o;while(1){s=u+1|0;a[u]=0;u=t+8|0;if((t+15|0)<(m|0)){t=u;u=s}else{break}}if((u|0)<(m|0)){a[s]=(d[s]|0)&n}u=(c[q>>2]|0)+((c[p>>2]<<1)+r)|0;s=o;while(1){t=u+1|0;a[u]=0;u=s+8|0;if((s+15|0)<(m|0)){s=u;u=t}else{break}}if((u|0)<(m|0)){a[t]=(d[t]|0)&n}p=(c[q>>2]|0)+(((c[p>>2]|0)*3|0)+r)|0;while(1){q=p+1|0;a[p]=0;p=o+8|0;if((o+15|0)<(m|0)){o=p;p=q}else{break}}if((p|0)>=(m|0)){break}a[q]=(d[q]|0)&n}else{if((o|0)>=(m|0)){break}a[u]=(d[u]|0)&n;u=(c[q>>2]|0)+((c[p>>2]|0)+r)|0;a[u]=(d[u]|0)&n;u=(c[q>>2]|0)+((c[p>>2]<<1)+r)|0;a[u]=(d[u]|0)&n;u=(c[q>>2]|0)+(((c[p>>2]|0)*3|0)+r)|0;a[u]=(d[u]|0)&n}}while(0);v=+h[l>>3];if(v<=0.0){v=+R(+v)}c[f>>2]=~~v}l=b+24|0;v=+h[l>
|
||
|
|
||
|
|
||
|
|
||
|
function $K(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=i;do{if((d|b|e|0)<0){a=6}else{if((e|0)==0|(b|0)==0){if((f|0)==0){f=0;a=0;break}hd[c[a+8>>2]&127](a,f);f=0;a=0;break}if((2147483647/(b|0)|0|0)<(e|0)){a=10;break}if((d|0)!=0){d=da(d,b)|0;b=da(e,b)|0;b=pd[c[a+12>>2]&63](a,d,b,f)|0;a=(b|0)==0;f=a?f:b;a=a?64:0;break}b=da(e,b)|0;if((b|0)<=0){f=0;a=b>>31&6;break}f=Bd[c[a+4>>2]&255](a,b)|0;e=(f|0)==0;a=e?64:0;if(e){f=0;break}bX(f|0,0,b|0)|0}}while(0);c[g>>2]=a;i=h;return f|0}function aL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;g=i;e=(b|0)==0;do{if(e){j=0;f=4}else{h=(ZW(b|0)|0)+1|0;if((h|0)<=0){j=h;f=4;break}j=Bd[c[a+4>>2]&255](a,h)|0;a=j;j=(j|0)==0?64:0}}while(0);if((f|0)==4){h=j;a=0;j=j>>31&6}if((j|0)!=0|e){h=d;c[h>>2]=j;i=g;return a|0}$W(a|0,b|0,h|0)|0;h=d;c[h>>2]=j;i=g;return a|0}function bL(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=i;a:do{if(d>>>0>1){while(1){g=a[c]|0;if(g<<24>>24==0){break a}c=c+1|0;f=b+1|0;a[b]=g;d=d+ -1|0;if(d>>>0>1){b=f}else{b=f;break}}}}while(0);a[b]=0;i=e;return(a[c]|0)!=0|0}function cL(a){a=a|0;var b=0,c=0;b=i;while(1){c=a+ -1&a;if((c|0)==0){break}else{a=c}}i=b;return a|0}function dL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;a=i;c[e>>2]=0;if((b|0)==0){d=81;i=a;return d|0}d=nL(b,333319,f)|0;i=a;return d|0}function eL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;a=i;c[e>>2]=0;if((b|0)==0){d=81;i=a;return d|0}d=nL(b,333312,f)|0;i=a;return d|0}function fL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;k=i;i=i+32|0;j=k;h=i;i=i+8|0;b=c[a>>2]|0;d=mL(b,d,206480)|0;if((d|0)==0){k=64;i=g;return k|0}c[k>>2]=4;c[j+12>>2]=d;a=xJ(a,j,h)|0;do{if((a|0)==0){a=c[h>>2]|0;if((a|0)==0){f=81;break}f=nL(a,333319,f)|0;h=c[a+28>>2]|0;j=c[a+24>>2]|0;if((j|0)!=0){fd[j&511](a)}hd[c[h+8>>2]&127](h,a);if((f|0)!=0){break}c[e>>2]=d;k=0;i=g;return k|0}else{f=a}}while(0);hd[c[b+8>>2]&127](b,d);k=f;i=g;return k|0}function gL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;b=ZW(d|0)|0;h=b+18|0;a=c[a>>2]|0;do{if((h|0)>0){j=Bd[c[a+4>>2]&255](a,h)|0;k=(j|0)==0;a=k?64:0;if(k){j=0;break}bX(j|0,0,h|0)|0}else{j=0;a=h>>31&6}}while(0);if((a|0)!=0){k=a;i=g;return k|0}$W(j|0,d|0,b|0)|0;$W(j+b|0,206456,18)|0;c[e>>2]=j;c[f>>2]=0;k=0;i=g;return k|0}function hL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;b=ZW(d|0)|0;h=b+6|0;a=c[a>>2]|0;do{if((h|0)>0){j=Bd[c[a+4>>2]&255](a,h)|0;k=(j|0)==0;a=k?64:0;if(k){j=0;break}bX(j|0,0,h|0)|0}else{j=0;a=h>>31&6}}while(0);if((a|0)!=0){k=a;i=g;return k|0}$W(j|0,d|0,b|0)|0;$W(j+b|0,206448,6)|0;c[e>>2]=j;c[f>>2]=0;k=0;i=g;return k|0}function iL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;b=i;d=mL(c[a>>2]|0,d,206432)|0;if((d|0)==0){a=64;i=b;return a|0}c[e>>2]=d;c[f>>2]=0;a=0;i=b;return a|0}function jL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;b=i;d=mL(c[a>>2]|0,d,206416)|0;if((d|0)==0){a=64;i=b;return a|0}c[e>>2]=d;c[f>>2]=0;a=0;i=b;return a|0}function kL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;k=i;i=i+32|0;j=k;h=i;i=i+8|0;b=c[a>>2]|0;d=mL(b,d,206408)|0;if((d|0)==0){k=64;i=g;return k|0}c[k>>2]=4;c[j+12>>2]=d;a=xJ(a,j,h)|0;do{if((a|0)==0){a=c[h>>2]|0;if((a|0)==0){f=81;break}f=nL(a,333319,f)|0;h=c[a+28>>2]|0;j=c[a+24>>2]|0;if((j|0)!=0){fd[j&511](a)}hd[c[h+8>>2]&127](h,a);if((f|0)!=0){break}c[e>>2]=d;k=0;i=g;return k|0}else{f=a}}while(0);hd[c[b+8>>2]&127](b,d);k=f;i=g;return k|0}function lL(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;k=i;i=i+32|0;j=k;h=i;i=i+8|0;b=c[a>>2]|0;d=mL(b,d,206392)|0;if((d|0)==0){k=64;i=g;return k|0}c[k>>2]=4;c[j+12>>2]=d;a=xJ(a,j,h)|0;do{if((a|0)==0){a=c[h>>2]|0;if((a|0)==0){f=81;break}f=nL(a,333319,f)|0;h=c[a+28>>2]|0;j=c[a+24>>2]|0;if((j|0)!=0){fd[j&511](a)}hd[c[h+8>>2]&127](h,a);if((f|0)!=0){break}c[e>>2]=d;k=0;i=g;return k|0}else{f=a}}while(0);hd[c[b+8>>2]&127](b,d);k=f;i=g;return k|0}function mL(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;g=ZW(d|0)|0;g=g+1+(ZW(e|0)|0)|0;do{if((g|0)>0){b=Bd[c[b+4>>2]&255](b,g)|0;j=(b|0)==0;h=j?64:0;if(j){b=0;break}bX(b|0,0,g|0)|0}else{b=0;h=g>>31&6}}while(0);if((h|0)!=0){j=0;i=f;return j|0}g=Sa(d|0,47)|0;if((g|0)==0){a[b]=0}else{j=g-d
|
||
|
|
||
|
|
||
|
|
||
|
function zD(b,e,f,g,h,j,k,l,m,n,o){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,ea=0;p=i;w=i;i=i+8|0;E=i;i=i+8|0;K=i;i=i+8|0;I=i;i=i+8|0;J=I;R=i;i=i+8|0;P=i;i=i+8|0;S=P;O=i;i=i+8|0;U=i;i=i+8|0;x=U;y=i;i=i+8|0;T=y;M=i;i=i+8|0;N=M;G=i;i=i+8|0;H=G;C=i;i=i+8|0;B=C;F=i;i=i+8|0;D=F;Q=i;i=i+8|0;L=Q;A=i;i=i+8|0;z=A;V=i;i=i+8|0;W=i;i=i+8|0;q=FW(24)|0;c[q+4>>2]=0;c[q>>2]=177856;v=q+8|0;c[v>>2]=f;u=q+12|0;c[u>>2]=g;s=f+7>>3;r=q+16|0;c[r>>2]=s;do{if((f|0)<1){t=5}else{if((g|0)<1|(s|0)<1){t=5;break}if((2147483646/(s|0)|0|0)<=(g|0)){t=5;break}s=we((da(s,g)|0)+1|0)|0;W=q+20|0;c[W>>2]=s;a[s+(da(c[r>>2]|0,c[u>>2]|0)|0)|0]=0;W=c[W>>2]|0;s=q+20|0;if((W|0)==0){break}bX(W|0,0,da(c[r>>2]|0,c[u>>2]|0)|0)|0;if(e){j=b+148|0;ea=c[j>>2]|0;c[ea+4>>2]=0;c[ea+8>>2]=0;c[ea+12>>2]=0;if((f|0)>2147483645){f=c[b+64>>2]|0;Qe(jd[c[(c[f>>2]|0)+48>>2]&511](f)|0,182160,V);f=-3}h=f+1|0;n=ye(h,4)|0;t=ye(f+2|0,4)|0;if((f|0)>-1){k=0;do{c[n+(k<<2)>>2]=f;k=k+1|0;}while((k|0)<(h|0))}if((g|0)>0){h=b+64|0;k=0;do{v=c[n>>2]|0;if((v|0)<(f|0)){u=0;while(1){c[t+(u<<2)>>2]=v;u=u+1|0;v=c[n+(u<<2)>>2]|0;if((v|0)<(f|0)){}else{break}}}else{u=0}c[t+(u<<2)>>2]=f;c[t+(u+1<<2)>>2]=f;c[n>>2]=0;if((f|0)>0){l=n;m=0;u=0;v=0;do{a:do{switch(PC(c[j>>2]|0)|0){case 1:{if((v|0)==0){e=0;while(1){ea=QC(c[j>>2]|0)|0;e=ea+e|0;if((ea|0)>63){}else{V=0;break}}while(1){ea=RC(c[j>>2]|0)|0;V=ea+V|0;if((ea|0)>63){}else{break}}}else{e=0;while(1){ea=RC(c[j>>2]|0)|0;e=ea+e|0;if((ea|0)>63){}else{V=0;break}}while(1){ea=QC(c[j>>2]|0)|0;V=ea+V|0;if((ea|0)>63){}else{break}}}l=(c[l>>2]|0)+e|0;if((e|0)>0){if((l|0)>(f|0)){ea=c[h>>2]|0;ea=jd[c[(c[ea>>2]|0)+48>>2]&511](ea)|0;c[Q>>2]=l;Qe(ea,182680,L);l=f}m=m+((m&1|0)!=(v|0))|0;c[n+(m<<2)>>2]=l}else{l=c[n+(m<<2)>>2]|0}do{if((l|0)<(f|0)){e=l+V|0;if((V|0)<=0){break}if((e|0)>(f|0)){l=c[h>>2]|0;l=jd[c[(c[l>>2]|0)+48>>2]&511](l)|0;c[F>>2]=e;Qe(l,182680,D);l=f}else{l=e}m=m+((m&1|0)!=(v^1|0))|0;c[n+(m<<2)>>2]=l}}while(0);while(1){ea=c[t+(u<<2)>>2]|0;if((ea|0)<=(l|0)&(ea|0)<(f|0)){u=u+2|0}else{break}}break};case 7:{V=(c[t+(u<<2)>>2]|0)+3|0;if((c[l>>2]|0)<(V|0)){if((V|0)>(f|0)){l=c[h>>2]|0;l=jd[c[(c[l>>2]|0)+48>>2]&511](l)|0;c[C>>2]=V;Qe(l,182680,B);l=f}else{l=V}m=m+((m&1|0)!=(v|0))|0;c[n+(m<<2)>>2]=l}else{l=c[n+(m<<2)>>2]|0}v=v^1;if((l|0)>=(f|0)){break a}u=u+1|0;while(1){ea=c[t+(u<<2)>>2]|0;if((ea|0)<=(l|0)&(ea|0)<(f|0)){u=u+2|0}else{break}}break};case 0:{V=t+(u+1<<2)|0;e=c[V>>2]|0;if((c[l>>2]|0)<(e|0)){if((e|0)>(f|0)){ea=c[h>>2]|0;ea=jd[c[(c[ea>>2]|0)+48>>2]&511](ea)|0;c[A>>2]=e;Qe(ea,182680,z);e=f}m=m+((m&1|0)!=(v|0))|0;c[n+(m<<2)>>2]=e;e=c[V>>2]|0}u=(e|0)<(f|0)?u+2|0:u;break};case 2:{V=c[t+(u<<2)>>2]|0;if((c[l>>2]|0)<(V|0)){if((V|0)>(f|0)){l=c[h>>2]|0;l=jd[c[(c[l>>2]|0)+48>>2]&511](l)|0;c[y>>2]=V;Qe(l,182680,T);l=f}else{l=V}m=m+((m&1|0)!=(v|0))|0;c[n+(m<<2)>>2]=l}else{l=c[n+(m<<2)>>2]|0}v=v^1;if((l|0)>=(f|0)){break a}u=u+1|0;while(1){ea=c[t+(u<<2)>>2]|0;if((ea|0)<=(l|0)&(ea|0)<(f|0)){u=u+2|0}else{break}}break};case 8:{V=(c[t+(u<<2)>>2]|0)+ -3|0;l=c[l>>2]|0;do{if((l|0)<(V|0)){if((V|0)>(f|0)){l=c[h>>2]|0;l=jd[c[(c[l>>2]|0)+48>>2]&511](l)|0;c[U>>2]=V;Qe(l,182680,x);l=f}else{l=V}m=m+((m&1|0)!=(v|0))|0;c[n+(m<<2)>>2]=l}else{if((l|0)<=(V|0)){l=c[n+(m<<2)>>2]|0;break}if((V|0)<0){l=c[h>>2]|0;Qe(jd[c[(c[l>>2]|0)+48>>2]&511](l)|0,182720,O);l=0}else{l=V}b:do{if((m|0)>0){while(1){V=m+ -1|0;if((l|0)>(c[n+(V<<2)>>2]|0)){break b}if((V|0)>0){m=V}else{m=V;break}}}}while(0);c[n+(m<<2)>>2]=l}}while(0);v=v^1;if((l|0)>=(f|0)){break a}if((u|0)>0){u=u+ -1|0}else{u=u+1|0}while(1){ea=c[t+(u<<2)>>2]|0;if((ea|0)<=(l|0)&(ea|0)<(f|0)){u=u+2|0}else{break}}break};case 6:{V=(c[t+(u<<2)>>2]|0)+ -2|0;l=c[l>>2]|0;do{if((l|0)<(V|0)){if((V|0)>(f|0)){l=c[h>>2]|0;l=jd[c[(c[l>>2]|0)+48>>2]&511](l)|0;c[P>>2]=V;Qe(l,182680,S);l=f}else{l=V}m=m+((m&1|0)!=(v|0))|0;c[n+(m<<2)>>2]=l}else{if((l|0)<=(V|0)){l=c[n+(m<<2)>>2]|0;break}if((V|0)<0){l=c[h>>2]|0;Qe(jd[c[(c[l>>2]|0)+48>>2]&511](l)|0,182720,R);l=0}else{l=V}c:do{if((m|0)>
|
||
|
|
||
|
|
||
|
|
||
|
function wx(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;e=i;l=i;i=i+8|0;m=l;k=i;i=i+8|0;n=i;i=i+8|0;p=i;i=i+8|0;o=i;i=i+8|0;w=o;u=i;i=i+16|0;v=u;j=i;i=i+528|0;t=i;i=i+24|0;c[u>>2]=13;q=v+8|0;c[q>>2]=0;c[q+4>>2]=0;f=j+528|0;g=j;do{c[g>>2]=13;J=g+8|0;c[J>>2]=0;c[J+4>>2]=0;g=g+16|0;}while((g|0)!=(f|0));g=b+32|0;f=b+40|0;h=c[f>>2]|0;if((h|0)==(c[b+44>>2]|0)){eu(b+36|0,g)}else{if((h|0)==0){h=0}else{c[h>>2]=c[g>>2];h=c[f>>2]|0}c[f>>2]=h+4}h=b+24|0;c[h>>2]=0;A=b+120|0;cG(c[A>>2]|0,v,0,0,0,0,0)|0;H=c[u>>2]|0;a:do{if((H|0)==12){Of(v)}else{C=b+18|0;y=b+13|0;x=b+14|0;B=b+8|0;D=b+124|0;E=b+128|0;z=c[r>>2]|0;F=0;G=0;b:while(1){a[C]=0;do{if((H|0)==10){if((a[y]&1)!=0){Qf(v,z);if((G|0)>0){H=0;do{Hb(32)|0;Qf(j+(H<<4)|0,z);H=H+1|0;}while((H|0)<(G|0))}Hb(10)|0;Fc(z|0)|0}dH(t);xx(b,v,j,G);do{if((a[x]&1)!=0){I=c[B>>2]|0;I=jd[c[(c[I>>2]|0)+372>>2]&511](I)|0;if((I|0)==0){break}H=FW(32)|0;J=c[u>>2]|0;if((J|0)!=10){s=19;break b}fe(H,c[q>>2]|0);J=oo(I,H)|0;if((J|0)==0){J=FW(32)|0;AG(J);lo(I,H,J)}BG(J,+eH(t))}}while(0);Of(v);if((G|0)>0){H=0;do{Of(j+(H<<4)|0);H=H+1|0;}while((H|0)<(G|0))}J=c[h>>2]|0;H=J+1|0;c[h>>2]=H;if((J|0)>19998){H=c[B>>2]|0;fd[c[(c[H>>2]|0)+68>>2]&511](H);c[h>>2]=0;H=0}if((a[C]&1)!=0){s=28;break b}G=c[D>>2]|0;if((G|0)==0){G=0;break}if((H-F|0)<=10){G=0;break}if(jd[G&511](c[E>>2]|0)|0){break b}F=c[h>>2]|0;G=0}else{if((G|0)<33){$W(j+(G<<4)|0,u|0,16)|0;G=G+1|0;break}H=c[A>>2]|0;do{if((H|0)==0){H=-1}else{H=c[H+4>>2]|0;if((c[H+16>>2]|0)!=8){H=-1;break}H=c[H+24>>2]|0;H=jd[c[(c[H>>2]|0)+48>>2]&511](H)|0}}while(0);Qe(H,159504,p);if((a[y]&1)!=0){Kb(159536,n|0)|0;Qf(v,z);Hb(10)|0;Fc(z|0)|0}Of(v)}}while(0);cG(c[A>>2]|0,v,0,0,0,0,0)|0;H=c[u>>2]|0;if((H|0)==12){s=43;break}}if((s|0)==19){c[o>>2]=J;c[w+4>>2]=10;Qe(0,162256,w);tc()}else if((s|0)==28){a[C]=0}else if((s|0)==43){Of(v);if((G|0)<=0){break}n=c[A>>2]|0;do{if((n|0)==0){n=-1}else{n=c[n+4>>2]|0;if((c[n+16>>2]|0)!=8){n=-1;break}n=c[n+24>>2]|0;n=jd[c[(c[n>>2]|0)+48>>2]&511](n)|0}}while(0);Qe(n,159560,k);if((a[b+13|0]&1)==0){k=0}else{c[l>>2]=G;Kb(159592,m|0)|0;l=c[r>>2]|0;k=0;do{Hb(32)|0;Qf(j+(k<<4)|0,l);k=k+1|0;}while((k|0)<(G|0));Hb(10)|0;Fc(c[r>>2]|0)|0;k=0}while(1){Of(j+(k<<4)|0);k=k+1|0;if((k|0)>=(G|0)){break a}}}Of(v)}}while(0);k=b+28|0;n=c[f>>2]|0;j=b+36|0;J=c[j>>2]|0;c:do{if((c[g>>2]|0)>(c[J+((n-J>>2)+ -1<<2)>>2]|0)){l=b+8|0;do{m=c[k>>2]|0;if((c[m+656>>2]|0)==0){break c}I=YB(m)|0;c[k>>2]=I;n=c[l>>2]|0;hd[c[(c[n>>2]|0)+84>>2]&127](n,I);I=(c[g>>2]|0)+ -1|0;c[g>>2]=I;n=c[f>>2]|0;J=c[j>>2]|0;}while((I|0)>(c[J+((n-J>>2)+ -1<<2)>>2]|0))}}while(0);c[f>>2]=n+ -4;if(!d){i=e;return}if((c[h>>2]|0)<=0){i=e;return}J=c[b+8>>2]|0;fd[c[(c[J>>2]|0)+68>>2]&511](J);i=e;return}function xx(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;h=i;k=i;i=i+16|0;l=k;n=i;i=i+8|0;o=n;p=i;i=i+8|0;m=p;r=i;i=i+8|0;q=r;j=i;i=i+8|0;s=j;t=c[e>>2]|0;if((t|0)!=10){c[j>>2]=t;c[s+4>>2]=10;Qe(0,162256,s);tc()}j=c[e+8>>2]|0;s=-1;t=73;u=0;a:while(1){while(1){if((t-s|0)<=1){break a}e=(s+t|0)/2|0;u=Qc(148384+(e*148|0)|0,j|0)|0;if((u|0)<0){s=e}else{break}}s=(u|0)>0?s:e;t=e}do{if((u|0)==0){if((148384+(s*148|0)|0)==0){break}q=c[148388+(s*148|0)>>2]|0;do{if((q|0)>-1){if((q|0)<=(g|0)){if((q|0)>=(g|0)){m=g;break}m=q;f=f+(g-q<<4)|0;break}k=c[b+120>>2]|0;do{if((k|0)==0){k=-1}else{k=c[k+4>>2]|0;if((c[k+16>>2]|0)!=8){k=-1;break}k=c[k+24>>2]|0;k=jd[c[(c[k>>2]|0)+48>>2]&511](k)|0}}while(0);c[p>>2]=g;c[m+4>>2]=j;Qe(k,159632,m);a[b+18|0]=1;i=h;return}else{if((g|0)<=(0-q|0)){m=g;break}b=c[b+120>>2]|0;do{if((b|0)==0){b=-1}else{b=c[b+4>>2]|0;if((c[b+16>>2]|0)!=8){b=-1;break}b=c[b+24>>2]|0;b=jd[c[(c[b>>2]|0)+48>>2]&511](b)|0}}while(0);c[n>>2]=g;c[o+4>>2]=j;Qe(b,159672,o);i=h;return}}while(0);b:do{if((m|0)>0){g=0;c:while(1){n=f+(g<<4)|0;switch(c[148392+(s*148|0)+(g<<2)>>2]|0){case 2:{if(((c[n>>2]|0)+ -1|0)>>>0>=2){break c}break};case 1:{if((c[n>>2]|0)!=1){break c}break};case 6:{u=c[n>>2]|0;if(!((u|0)==4|(u|0)==7)){break c}break};case 0:{if((c[n>>2]|0)!=0){break c}break};case 3:{if((c[n>>2]|0)!=3){break c}break};
|
||
|
|
||
|
|
||
|
|
||
|
function ZR(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;h=i;g=i;i=i+8|0;q=g;j=i;i=i+8|0;k=i;i=i+8|0;l=k;f=c[d+28>>2]|0;m=c[a+712>>2]|0;if((m|0)==0){c[g>>2]=0;B=0;A=0;z=0;lJ(f,z);lJ(f,A);lJ(f,B);B=g;B=c[B>>2]|0;i=h;return B|0}n=a+672|0;if((c[n>>2]|0)==0){c[g>>2]=0;B=0;A=0;z=0;lJ(f,z);lJ(f,A);lJ(f,B);B=g;B=c[B>>2]|0;i=h;return B|0}B=pd[c[a+508>>2]&63](a,1668702578,d,j)|0;c[g>>2]=B;if((B|0)!=0){c[g>>2]=0;B=0;A=0;z=0;lJ(f,z);lJ(f,A);lJ(f,B);B=g;B=c[B>>2]|0;i=h;return B|0}B=MK(d,c[j>>2]|0)|0;c[g>>2]=B;if((B|0)!=0){c[g>>2]=0;B=0;A=0;z=0;lJ(f,z);lJ(f,A);lJ(f,B);B=g;B=c[B>>2]|0;i=h;return B|0}p=d+32|0;u=(c[p>>2]|0)-(c[d>>2]|0)|0;do{if((TK(d)|0)==65536){j=oJ(f,4,0,c[m>>2]|0,0,q)|0;if((c[g>>2]|0)!=0){r=0;o=0;break}o=oJ(f,4,0,c[m>>2]|0,0,q)|0;if((c[g>>2]|0)!=0){r=0;break}r=oJ(f,4,0,c[m>>2]|0,0,q)|0;if((c[g>>2]|0)!=0){break}q=(RK(d)|0)&65535;v=RK(d)|0;q=q&4095;if((q|0)==0){break}a=a+668|0;s=0;v=u+(v&65535)|0;while(1){u=(RK(d)|0)&65535;w=RK(d)|0;x=w&65535;do{if((x&32768|0)==0){if((x&16384|0)==0){break}if((c[m>>2]&2147483647|0)==0){break}else{w=0}do{RK(d)|0;w=w+1|0;}while(w>>>0<c[m>>2]<<1>>>0)}else{if((c[m>>2]|0)==0){z=0}else{y=0;while(1){c[j+(y<<2)>>2]=(RK(d)|0)<<16>>16<<2;y=y+1|0;z=c[m>>2]|0;if(y>>>0<z>>>0){}else{break}}}do{if(!((x&16384|0)==0|(z|0)==0)){z=0;do{c[o+(z<<2)>>2]=(RK(d)|0)<<16>>16<<2;z=z+1|0;y=c[m>>2]|0;}while(z>>>0<y>>>0);if((y|0)==0){break}else{y=0}do{c[r+(y<<2)>>2]=(RK(d)|0)<<16>>16<<2;y=y+1|0;}while(y>>>0<(c[m>>2]|0)>>>0)}}while(0);w=_R(m,w,j,o,r)|0;if((w|0)==0){break}if((x&8192|0)==0){break}x=c[d>>2]|0;y=(c[p>>2]|0)-x|0;c[p>>2]=x+v;x=$R(d,l)|0;A=c[k>>2]|0;B=(A|0)==0;if(B){z=c[a>>2]|0}else{z=A}z=aS(d,z)|0;do{if((x|0)==0|(z|0)==0){t=36}else{if((x|0)==-1){if((c[a>>2]|0)==0){break}else{t=0}while(1){B=e[(c[n>>2]|0)+(t<<1)>>1]|0;B=(aJ(b[z+(t<<1)>>1]|0,w)|0)+B&65535;b[(c[n>>2]|0)+(t<<1)>>1]=B;t=t+1|0;if(t>>>0<(c[a>>2]|0)>>>0){}else{t=36;break}}}else{if(B){t=37;break}else{t=0}while(1){B=e[x+(t<<1)>>1]|0;C=e[(c[n>>2]|0)+(B<<1)>>1]|0;C=(aJ(b[z+(t<<1)>>1]|0,w)|0)+C&65535;b[(c[n>>2]|0)+(B<<1)>>1]=C;t=t+1|0;if(t>>>0<A>>>0){}else{t=36;break}}}}}while(0);if((t|0)==36){t=0;if((x|0)!=-1){t=37}}if((t|0)==37){t=0;lJ(f,x)}lJ(f,z);c[p>>2]=(c[d>>2]|0)+y}}while(0);s=s+1|0;if(s>>>0<q>>>0){v=u+v|0}else{break}}}else{c[g>>2]=0;r=0;o=0;j=0}}while(0);PK(d);C=r;B=o;A=j;lJ(f,A);lJ(f,B);lJ(f,C);C=g;C=c[C>>2]|0;i=h;return C|0}function _R(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;g=a+4|0;n=c[a>>2]|0;if((n|0)==0){o=65536;i=h;return o|0}if((b&16384)==0){b=65536;l=0;while(1){m=c[d+(l<<2)>>2]|0;if((m|0)!=0){n=c[(c[g>>2]|0)+(l<<2)>>2]|0;if((n|0)==0){b=0;l=19;break}if((n|0)<0&(m|0)>0){b=0;l=19;break}o=(n|0)>0;if(o&(m|0)<0){b=0;l=19;break}b=_I(b,o?n:0-n|0,65536)|0;n=c[a>>2]|0}l=l+1|0;if(l>>>0>=n>>>0){l=19;break}}if((l|0)==19){i=h;return b|0}}else{k=65536;j=0}a:while(1){m=c[d+(j<<2)>>2]|0;do{if((m|0)!=0){l=c[(c[g>>2]|0)+(j<<2)>>2]|0;if((l|0)==0){b=0;l=19;break a}if((l|0)<0&(m|0)>0){b=0;l=19;break a}if((l|0)>0&(m|0)<0){b=0;l=19;break a}b=c[e+(j<<2)>>2]|0;if((l|0)<=(b|0)){b=0;l=19;break a}n=c[f+(j<<2)>>2]|0;if((l|0)>=(n|0)){b=0;l=19;break a}if((l|0)<(m|0)){k=_I(k,_I(l-b|0,65536,m-b|0)|0,65536)|0;break}else{k=_I(k,_I(n-l|0,65536,n-m|0)|0,65536)|0;break}}}while(0);j=j+1|0;if(j>>>0>=(c[a>>2]|0)>>>0){b=k;l=19;break}}if((l|0)==19){i=h;return b|0}return 0}function $R(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;h=i;i=i+8|0;g=c[a+28>>2]|0;c[h>>2]=0;m=QK(a)|0;f=m&255;c[d>>2]=f;if(m<<24>>24==0){m=-1;i=e;return m|0}if((f&128|0)!=0){f=(QK(a)|0)&255|f<<8&32512}g=oJ(g,2,0,f,0,h)|0;if((c[h>>2]|0)!=0){m=0;i=e;return m|0}if((f|0)>0){j=0}else{m=g;i=e;return m|0}while(1){k=QK(a)|0;h=k&255;if((h&128|0)==0){l=QK(a)|0;d=j+1|0;b[g+(j<<1)>>1]=l&255;if(k<<24>>24==0){a=18;break}if((h+d|0)>=(f|0)){a=18;break}j=h>>>0>1?h:1;l=l&255;k=d;m=0;while(1){l=((QK(a)|0)&255)+l|0;b[g+(k<<1)>>1]=l;m=m+1|0;if((m|0)<(h|0)){k=k+1|0}else{break}}j=d+j|0}else{h=h&127;l=RK(a)|0;d=j+1|0;b[g+(j<<1)>>1]=l;if((h|0)==0){a=18;break}if((h+d|0)>=(f|0)){a=18;break}j=k&127;j=j>>>0>1?j:1;m=l&655
|
||
|
|
||
|
|
||
|
|
||
|
function MW(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,I=0,J=0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0;g=i;r=i;i=i+512|0;k=r;if((e|0)==1){e=53;h=-1074}else if((e|0)==2){e=53;h=-1074}else if((e|0)==0){e=24;h=-149}else{M=0.0;i=g;return+M}n=b+4|0;o=b+100|0;do{j=c[n>>2]|0;if(j>>>0<(c[o>>2]|0)>>>0){c[n>>2]=j+1;F=d[j]|0}else{F=PW(b)|0}}while((xc(F|0)|0)!=0);do{if((F|0)==43|(F|0)==45){j=1-(((F|0)==45)<<1)|0;l=c[n>>2]|0;if(l>>>0<(c[o>>2]|0)>>>0){c[n>>2]=l+1;F=d[l]|0;break}else{F=PW(b)|0;break}}else{j=1}}while(0);l=0;do{if((F|32|0)!=(a[291864+l|0]|0)){break}do{if(l>>>0<7){m=c[n>>2]|0;if(m>>>0<(c[o>>2]|0)>>>0){c[n>>2]=m+1;F=d[m]|0;break}else{F=PW(b)|0;break}}}while(0);l=l+1|0;}while(l>>>0<8);do{if((l|0)==3){q=23}else if((l|0)!=8){p=(f|0)==0;if(!(l>>>0<4|p)){if((l|0)==8){break}else{q=23;break}}a:do{if((l|0)==0){l=0;do{if((F|32|0)!=(a[291880+l|0]|0)){break a}do{if(l>>>0<2){m=c[n>>2]|0;if(m>>>0<(c[o>>2]|0)>>>0){c[n>>2]=m+1;F=d[m]|0;break}else{F=PW(b)|0;break}}}while(0);l=l+1|0;}while(l>>>0<3)}}while(0);if((l|0)==3){e=c[n>>2]|0;if(e>>>0<(c[o>>2]|0)>>>0){c[n>>2]=e+1;e=d[e]|0}else{e=PW(b)|0}if((e|0)==40){e=1}else{if((c[o>>2]|0)==0){M=+w;i=g;return+M}c[n>>2]=(c[n>>2]|0)+ -1;M=+w;i=g;return+M}while(1){h=c[n>>2]|0;if(h>>>0<(c[o>>2]|0)>>>0){c[n>>2]=h+1;h=d[h]|0}else{h=PW(b)|0}if(!((h+ -48|0)>>>0<10|(h+ -65|0)>>>0<26)){if(!((h+ -97|0)>>>0<26|(h|0)==95)){break}}e=e+1|0}if((h|0)==41){M=+w;i=g;return+M}h=(c[o>>2]|0)==0;if(!h){c[n>>2]=(c[n>>2]|0)+ -1}if(p){c[(Pc()|0)>>2]=22;OW(b,0);M=0.0;i=g;return+M}if((e|0)==0|h){M=+w;i=g;return+M}while(1){e=e+ -1|0;c[n>>2]=(c[n>>2]|0)+ -1;if((e|0)==0){s=+w;break}else{}}i=g;return+s}else if((l|0)==0){do{if((F|0)==48){l=c[n>>2]|0;if(l>>>0<(c[o>>2]|0)>>>0){c[n>>2]=l+1;l=d[l]|0}else{l=PW(b)|0}if((l|32|0)!=120){if((c[o>>2]|0)==0){F=48;break}c[n>>2]=(c[n>>2]|0)+ -1;F=48;break}k=c[n>>2]|0;if(k>>>0<(c[o>>2]|0)>>>0){c[n>>2]=k+1;z=d[k]|0;v=0}else{z=PW(b)|0;v=0}while(1){if((z|0)==46){q=70;break}else if((z|0)!=48){m=0;r=0;l=0;k=0;u=0;y=0;K=1.0;t=0;s=0.0;break}k=c[n>>2]|0;if(k>>>0<(c[o>>2]|0)>>>0){c[n>>2]=k+1;z=d[k]|0;v=1;continue}else{z=PW(b)|0;v=1;continue}}b:do{if((q|0)==70){k=c[n>>2]|0;if(k>>>0<(c[o>>2]|0)>>>0){c[n>>2]=k+1;z=d[k]|0}else{z=PW(b)|0}if((z|0)==48){m=-1;r=-1}else{m=0;r=0;l=0;k=0;u=1;y=0;K=1.0;t=0;s=0.0;break}while(1){k=c[n>>2]|0;if(k>>>0<(c[o>>2]|0)>>>0){c[n>>2]=k+1;z=d[k]|0}else{z=PW(b)|0}if((z|0)!=48){l=0;k=0;v=1;u=1;y=0;K=1.0;t=0;s=0.0;break b}J=gX(m|0,r|0,-1,-1)|0;m=J;r=H}}}while(0);c:while(1){B=z+ -48|0;do{if(B>>>0<10){q=84}else{A=z|32;C=(z|0)==46;if(!((A+ -97|0)>>>0<6|C)){break c}if(C){if((u|0)==0){m=l;r=k;u=1;break}else{z=46;break c}}else{B=(z|0)>57?A+ -87|0:B;q=84;break}}}while(0);if((q|0)==84){q=0;do{if((k|0)<0|(k|0)==0&l>>>0<8){L=K;t=B+(t<<4)|0}else{if((k|0)<0|(k|0)==0&l>>>0<14){M=K*.0625;L=M;s=s+M*+(B|0);break}if(!((B|0)!=0&(y|0)==0)){L=K;break}y=1;L=K;s=s+K*.5}}while(0);l=gX(l|0,k|0,1,0)|0;k=H;v=1;K=L}z=c[n>>2]|0;if(z>>>0<(c[o>>2]|0)>>>0){c[n>>2]=z+1;z=d[z]|0;continue}else{z=PW(b)|0;continue}}if((v|0)==0){e=(c[o>>2]|0)==0;if(!e){c[n>>2]=(c[n>>2]|0)+ -1}do{if(p){OW(b,0)}else{if(e){break}e=c[n>>2]|0;c[n>>2]=e+ -1;if((u|0)==0){break}c[n>>2]=e+ -2}}while(0);M=+(j|0)*0.0;i=g;return+M}q=(u|0)==0;m=q?l:m;q=q?k:r;if((k|0)<0|(k|0)==0&l>>>0<8){while(1){t=t<<4;l=gX(l|0,k|0,1,0)|0;k=H;if((k|0)<0|(k|0)==0&l>>>0<8){}else{break}}}do{if((z|32|0)==112){l=NW(b,f)|0;k=H;if(!((l|0)==0&(k|0)==-2147483648)){break}if(p){OW(b,0);M=0.0;i=g;return+M}else{if((c[o>>2]|0)==0){l=0;k=0;break}c[n>>2]=(c[n>>2]|0)+ -1;l=0;k=0;break}}else{if((c[o>>2]|0)==0){l=0;k=0;break}c[n>>2]=(c[n>>2]|0)+ -1;l=0;k=0}}while(0);J=dX(m|0,q|0,2)|0;J=gX(J|0,H|0,-32,-1)|0;k=gX(J|0,H|0,l|0,k|0)|0;l=H;if((t|0)==0){M=+(j|0)*0.0;i=g;return+M}if((l|0)>0|(l|0)==0&k>>>0>(0-h|0)>>>0){c[(Pc()|0)>>2]=34;M=+(j|0)*1.7976931348623157e+308*1.7976931348623157e+308;i=g;return+M}m=h+ -106|0;J=(m|0)<0?-1:0;if((l|0)<(J|0)|(l|0)==(J|0)&k>>>0<m>>>0){c[(Pc()|0)>>2]=34;M=+(j|0)*1.2882297539194267e-231*1.2882297539194267e-231;i=g;return+M}if((t|0)>-1){do{t=t<<1;if(s<.5){K=s}else{K=s+-1.0;t=t|1}s=s+
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// EMSCRIPTEN_END_FUNCS
|
||
|
var dd=[$X,bQ];var ed=[aY,LM,xW,wW];var fd=[bY,Te,Se,tg,sg,Gg,Fg,Jg,Ig,Pg,Og,Sg,hi,WF,Oi,Pi,hj,ij,tj,sj,kj,jj,vj,wj,rm,Fj,Ej,Hj,Ij,Ql,Nj,Mj,Pj,Qj,dm,Vj,Uj,Xj,Yj,km,ak,Pm,Rm,ik,hk,jk,ok,nk,pk,vk,uk,Bk,Fk,Ek,Gk,Kk,Jk,Mk,Lk,Vk,Uk,Xk,$k,Wk,sl,rl,ul,tl,Hl,Gl,Cm,yn,zn,ln,An,Gn,Fn,Xn,Wn,Yp,Xp,fq,eq,sq,rq,uq,jt,kt,lt,mt,sr,rr,nt,ot,pt,qt,Cr,Br,Kr,Jr,Or,Nr,Rr,Qr,Wr,Vr,_r,Zr,bs,as,fs,es,ks,js,us,ts,zs,ys,Cs,Bs,Fs,Es,Js,Is,Ms,Ls,Ps,Os,Ss,Rs,Ws,Vs,$s,_s,Hu,Gu,Iu,iv,hv,Sv,lv,kv,ov,Tv,Uv,qv,sv,rv,Vv,Wv,xv,wv,zv,Dv,Cv,Gv,Fv,Jv,Iv,Kv,Wx,Vx,ey,dy,oy,ny,Iy,Uy,az,hz,pz,wz,Cz,Kz,Jz,Uz,Tz,bA,aA,iA,hA,pA,oA,zA,yA,DA,CA,GA,FA,PA,OA,UA,TA,ZA,YA,cB,bB,jB,iB,TC,SC,YC,XC,_C,ZC,aD,$C,dD,cD,eD,gD,HD,GD,ID,KD,yE,xE,BE,AE,EE,DE,HE,GE,JE,IE,ME,LE,PE,OE,SE,RE,VE,UE,YE,XE,_E,ZE,xF,yF,wG,xG,vG,yG,MG,NG,QG,PG,$G,_G,rH,qH,wH,vH,DH,HH,LH,KH,OH,TH,SH,$H,_H,cI,sI,uI,vI,NI,MI,tL,xL,QL,VL,cM,kM,mM,vM,xM,zM,AM,BM,MM,SM,UM,XM,_M,dN,hN,tN,dO,jP,IP,SP,UP,cQ,dQ,kQ,IQ,aR,dR,fR,mS,pS,rS,tS,dT,gT,iT,kT,yT,BT,DT,FT,WT,tU,MU,RU,eV,hV,jV,lV,sV,wV,nW,qW,oW,pW,rW,KW,JW,rL,IL,KL,IN,DN,vN,mO,rO,yO,vO,UQ,YR,wU,cW,iW,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY,bY];var gd=[cY,Ph,Bi,cY];var hd=[dY,wg,zh,NF,Tg,Ug,Vg,Xg,Yg,Zg,_g,$g,ah,bh,ii,ji,ki,li,ch,eh,fh,gh,hh,mi,ni,oi,ih,qi,ri,si,ti,ui,vi,wi,kh,mh,nh,oh,ph,qh,Ei,Fi,Hi,th,wh,xh,QF,SF,Ki,Ih,Lh,Nh,Kj,Sj,_j,nm,gk,$y,fz,oz,uz,Bz,Hz,Rz,_z,gA,nA,uA,vL,AL,HM,FS,GS,HS,IS,JS,KS,LS,MS,NS,OS,oT,pT,qT,JT,KT,LT,MT,gU,kU,oU,LL,GN,fW,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY,dY];var id=[eY,UN,$P,eY];var jd=[fY,vg,yg,zg,Ag,Bg,Cg,Dg,Eg,Sh,Uh,Vh,Wh,Qh,Rh,Yh,Zh,_h,ai,bi,ci,di,Mi,XF,Mh,lj,Tl,Ul,Vl,Il,Kl,Ll,Yl,Zl,qm,sm,tm,um,vm,wm,Ml,Nl,Ol,Pl,Rl,Wl,_l,$l,am,bm,cm,em,fm,gm,hm,im,jm,lm,mm,Om,ck,dk,Qm,Sm,fk,om,pm,kk,xm,ym,qk,Hm,wk,yk,Ak,Im,Jm,Km,zm,Am,Nk,Lm,al,cl,Mm,vl,xl,Al,Nm,Bm,Dm,Em,wq,xq,et,gt,ht,it,Ou,Ku,Mu,Ju,Pu,xy,yy,gy,zy,ry,qy,Vy,dC,eC,fC,gC,cC,bz,pC,aC,bC,qC,iz,hC,iC,jC,kC,qz,rC,sC,xz,lC,mC,Dz,tC,uC,Lz,vC,Qz,wC,Vz,xC,yC,zC,cA,AC,BC,CC,jA,DC,EC,FC,qA,nC,oC,AA,EA,QA,VA,_A,dB,lB,AD,BD,CD,DD,ED,hD,iD,jD,aE,LD,ND,$E,aF,bF,cF,dF,eF,fF,gF,hF,iF,jF,kF,nF,oF,lF,mF,pF,qF,rF,sF,tF,uF,dI,eI,fI,gI,hI,iI,jI,kI,lI,mI,nI,oI,pI,qI,rI,lM,CM,QM,YM,LN,MN,NN,sN,TN,XN,YN,eO,CP,JQ,$Q,eR,gR,lS,qS,sS,bT,ZS,cT,hT,jT,wT,xT,CT,ET,RT,PT,sU,dV,iV,kV,GV,HV,IV,JV,XV,VV,LW,zt,At,nu,pu,VR,WR,XR,nR,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY,fY];var kd=[gY,uh];var ld=[hY,OF,PF,hY];var md=[iY,rh];var nd=[jY,yi];var od=[kY,Hg];var pd=[lY,Th,Kg,vq,VI,WL,gM,nM,oM,wM,GM,WM,fO,gO,mP,xP,JP,ZP,yP,KQ,LQ,OQ,PQ,YQ,hR,iR,uS,vS,$S,WS,lT,rT,GT,ST,XT,SU,mV,nV,TV,PV,NL,qN,eK,UR,dW,hW,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY,lY];var qd=[mY,sh];var rd=[nY,Xh];var sd=[oY,ug,zi,Ai,Ci,Oh,Di,oj,pj,mj,Xl,lk,rk,Ck,Hk,Sk,ol,Bl,wl,Fm,kD,OD,KG,LG,sH,UI,tK,$L,aM,hM,qM,rM,sM,tM,uM,FM,PM,RM,VM,bO,iO,nP,pP,qP,KP,MP,aQ,AP,eQ,gQ,iQ,lQ,mQ,vP,wP,NQ,XQ,iS,kS,dS,SS,TS,VS,tT,eU,iU,mU,qU,bV,cV,RV,s
|
||
|
|
||
|
|
||
|
// EMSCRIPTEN_END_ASM
|
||
|
({ "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array": Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array": Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array }, { "abort": abort, "assert": assert, "asmPrintInt": asmPrintInt, "asmPrintFloat": asmPrintFloat, "min": Math_min, "invoke_iiiiiiii": invoke_iiiiiiii, "invoke_viiiii": invoke_viiiii, "invoke_vi": invoke_vi, "invoke_iiiidd": invoke_iiiidd, "invoke_vii": invoke_vii, "invoke_iiiiiii": invoke_iiiiiii, "invoke_ii": invoke_ii, "invoke_viidd": invoke_viidd, "invoke_viddii": invoke_viddii, "invoke_viiddddddiiii": invoke_viiddddddiiii, "invoke_iiiiiiiiiiiidd": invoke_iiiiiiiiiiiidd, "invoke_vidii": invoke_vidii, "invoke_iiiii": invoke_iiiii, "invoke_iiiddddiii": invoke_iiiddddiii, "invoke_viiiiiiiiiii": invoke_viiiiiiiiiii, "invoke_iiii": invoke_iiii, "invoke_iiiddiiiiiiiiiii": invoke_iiiddiiiiiiiiiii, "invoke_viiiiii": invoke_viiiiii, "invoke_viiiiiiiiiiiii": invoke_viiiiiiiiiiiii, "invoke_di": invoke_di, "invoke_iiiiiiiiiii": invoke_iiiiiiiiiii, "invoke_viiiiiii": invoke_viiiiiii, "invoke_viiiiiiiii": invoke_viiiiiiiii, "invoke_viiiiiiiiii": invoke_viiiiiiiiii, "invoke_iii": invoke_iii, "invoke_iiiiii": invoke_iiiiii, "invoke_dii": invoke_dii, "invoke_viidddddd": invoke_viidddddd, "invoke_iiiiiiiiii": invoke_iiiiiiiiii, "invoke_viii": invoke_viii, "invoke_v": invoke_v, "invoke_viid": invoke_viid, "invoke_viiii": invoke_viiii, "_isalnum": _isalnum, "_fabs": _fabs, "_strrchr": _strrchr, "_fread": _fread, "_memchr": _memchr, "_inflateReset": _inflateReset, "__reallyNegative": __reallyNegative, "_fstat": _fstat, "___assert_fail": ___assert_fail, "__ZSt18uncaught_exceptionv": __ZSt18uncaught_exceptionv, "_longjmp": _longjmp, "_fsync": _fsync, "_sbrk": _sbrk, "_sysconf": _sysconf, "_close": _close, "_cos": _cos, "_readdir": _readdir, "_puts": _puts, "_FcPatternBuild": _FcPatternBuild, "_unlink": _unlink, "_write": _write, "_ftell": _ftell, "_rand": _rand, "__ZNSt9exceptionD2Ev": __ZNSt9exceptionD2Ev, "___cxa_does_inherit": ___cxa_does_inherit, "_strstr": _strstr, "_FcPatternDestroy": _FcPatternDestroy, "_qsort": _qsort, "_closedir": _closedir, "_FcPatternGetInteger": _FcPatternGetInteger, "_send": _send, "_pow": _pow, "_atan2": _atan2, "___cxa_is_number_type": ___cxa_is_number_type, "_FcConfigSubstitute": _FcConfigSubstitute, "_fcntl": _fcntl, "___cxa_find_matching_catch": ___cxa_find_matching_catch, "_opendir": _opendir, "_isalpha": _isalpha, "_strtol": _strtol, "___setErrNo": ___setErrNo, "___resumeException": ___resumeException, "_srand": _srand, "_strchr": _strchr, "_ceil": _ceil, "_putchar": _putchar, "___buildEnvironment": ___buildEnvironment, "_localeconv": _localeconv, "_printf": _printf, "_sprintf": _sprintf, "_strtok_r": _strtok_r, "_stat": _stat, "_FcPatternAddInteger": _FcPatternAddInteger, "_getpwnam": _getpwnam, "_read": _read, "_fwrite": _fwrite, "_FcPatternGetString": _FcPatternGetString, "_time": _time, "_pthread_mutex_lock": _pthread_mutex_lock, "_gettimeofday": _gettimeofday, "_munmap": _munmap, "_mmap": _mmap, "_exit": _exit, "_readdir_r": _readdir_r, "_inflate": _inflate, "_fmod": _fmod, "_lseek": _lseek, "_vfprintf": _vfprintf, "___cxa_allocate_exception": ___cxa_allocate_exception, "_asin": _asin, "_atoi": _atoi, "_pwrite": _pwrite, "_open": _open, "_snprintf": _snprintf, "_FcFontSort": _FcFontSort, "_fseek": _fseek, "_pthread_mutex_destroy": _pthread_mutex_destroy, "_isxdigit": _isxdigit, "_fclose": _fclose, "__parseInt": __parseInt, "_log": _log, "_recv": _recv, "_fgetc": _fgetc, "__getFloat": __getFloat, "_fputc": _fputc, "_abort": _abort, "___cxa_throw": ___cxa_throw, "_strncmp": _strncmp, "_inflateInit2_": _inflateInit2_, "_isspace": _isspace, "_fopen": _fopen, "_floor": _floor, "_getgid": _getgid, "_sin": _sin, "_acos": _acos, "___cxa_pure_virtual": ___cxa_pure_virtual, "_ungetc": _ungetc, "_fflush": _fflush, "_fprintf": _fprintf, "_sscanf": _sscanf, "_strdup": _strdup, "__exit": __exit, "_strcspn": _strcspn, "_log10": _log10, "_pthread_mutex_unlock": _pthread_mutex_unlock,
|
||
|
var _saveSetjmp = Module["_saveSetjmp"] = asm["_saveSetjmp"];
|
||
|
var _memcmp = Module["_memcmp"] = asm["_memcmp"];
|
||
|
var _strncasecmp = Module["_strncasecmp"] = asm["_strncasecmp"];
|
||
|
var _strcat = Module["_strcat"] = asm["_strcat"];
|
||
|
var _free = Module["_free"] = asm["_free"];
|
||
|
var _main = Module["_main"] = asm["_main"];
|
||
|
var _realloc = Module["_realloc"] = asm["_realloc"];
|
||
|
var _i64Add = Module["_i64Add"] = asm["_i64Add"];
|
||
|
var _memmove = Module["_memmove"] = asm["_memmove"];
|
||
|
var _tolower = Module["_tolower"] = asm["_tolower"];
|
||
|
var _strlen = Module["_strlen"] = asm["_strlen"];
|
||
|
var _memset = Module["_memset"] = asm["_memset"];
|
||
|
var _malloc = Module["_malloc"] = asm["_malloc"];
|
||
|
var _bitshift64Ashr = Module["_bitshift64Ashr"] = asm["_bitshift64Ashr"];
|
||
|
var _memcpy = Module["_memcpy"] = asm["_memcpy"];
|
||
|
var _strncpy = Module["_strncpy"] = asm["_strncpy"];
|
||
|
var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"];
|
||
|
var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"];
|
||
|
var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"];
|
||
|
var _strcpy = Module["_strcpy"] = asm["_strcpy"];
|
||
|
var _testSetjmp = Module["_testSetjmp"] = asm["_testSetjmp"];
|
||
|
var runPostSets = Module["runPostSets"] = asm["runPostSets"];
|
||
|
var dynCall_iiiiiiii = Module["dynCall_iiiiiiii"] = asm["dynCall_iiiiiiii"];
|
||
|
var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"];
|
||
|
var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
|
||
|
var dynCall_iiiidd = Module["dynCall_iiiidd"] = asm["dynCall_iiiidd"];
|
||
|
var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"];
|
||
|
var dynCall_iiiiiii = Module["dynCall_iiiiiii"] = asm["dynCall_iiiiiii"];
|
||
|
var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"];
|
||
|
var dynCall_viidd = Module["dynCall_viidd"] = asm["dynCall_viidd"];
|
||
|
var dynCall_viddii = Module["dynCall_viddii"] = asm["dynCall_viddii"];
|
||
|
var dynCall_viiddddddiiii = Module["dynCall_viiddddddiiii"] = asm["dynCall_viiddddddiiii"];
|
||
|
var dynCall_iiiiiiiiiiiidd = Module["dynCall_iiiiiiiiiiiidd"] = asm["dynCall_iiiiiiiiiiiidd"];
|
||
|
var dynCall_vidii = Module["dynCall_vidii"] = asm["dynCall_vidii"];
|
||
|
var dynCall_iiiii = Module["dynCall_iiiii"] = asm["dynCall_iiiii"];
|
||
|
var dynCall_iiiddddiii = Module["dynCall_iiiddddiii"] = asm["dynCall_iiiddddiii"];
|
||
|
var dynCall_viiiiiiiiiii = Module["dynCall_viiiiiiiiiii"] = asm["dynCall_viiiiiiiiiii"];
|
||
|
var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"];
|
||
|
var dynCall_iiiddiiiiiiiiiii = Module["dynCall_iiiddiiiiiiiiiii"] = asm["dynCall_iiiddiiiiiiiiiii"];
|
||
|
var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"];
|
||
|
var dynCall_viiiiiiiiiiiii = Module["dynCall_viiiiiiiiiiiii"] = asm["dynCall_viiiiiiiiiiiii"];
|
||
|
var dynCall_di = Module["dynCall_di"] = asm["dynCall_di"];
|
||
|
var dynCall_iiiiiiiiiii = Module["dynCall_iiiiiiiiiii"] = asm["dynCall_iiiiiiiiiii"];
|
||
|
var dynCall_viiiiiii = Module["dynCall_viiiiiii"] = asm["dynCall_viiiiiii"];
|
||
|
var dynCall_viiiiiiiii = Module["dynCall_viiiiiiiii"] = asm["dynCall_viiiiiiiii"];
|
||
|
var dynCall_viiiiiiiiii = Module["dynCall_viiiiiiiiii"] = asm["dynCall_viiiiiiiiii"];
|
||
|
var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"];
|
||
|
var dynCall_iiiiii = Module["dynCall_iiiiii"] = asm["dynCall_iiiiii"];
|
||
|
var dynCall_dii = Module["dynCall_dii"] = asm["dynCall_dii"];
|
||
|
var dynCall_viidddddd = Module["dynCall_viidddddd"] = asm["dynCall_viidddddd"];
|
||
|
var dynCall_iiiiiiiiii = Module["dynCall_iiiiiiiiii"] = asm["dynCall_iiiiiiiiii"];
|
||
|
var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
|
||
|
var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"];
|
||
|
var dynCall_viid = Module["dynCall_viid"] = asm["dynCall_viid"];
|
||
|
var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"];
|
||
|
|
||
|
Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) };
|
||
|
Runtime.stackSave = function() { return asm['stackSave']() };
|
||
|
Runtime.stackRestore = function(top) { asm['stackRestore'](top) };
|
||
|
|
||
|
|
||
|
// TODO: strip out parts of this we do not need
|
||
|
|
||
|
//======= begin closure i64 code =======
|
||
|
|
||
|
// Copyright 2009 The Closure Library Authors. All Rights Reserved.
|
||
|
//
|
||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
// you may not use this file except in compliance with the License.
|
||
|
// You may obtain a copy of the License at
|
||
|
//
|
||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||
|
//
|
||
|
// Unless required by applicable law or agreed to in writing, software
|
||
|
// distributed under the License is distributed on an "AS-IS" BASIS,
|
||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
// See the License for the specific language governing permissions and
|
||
|
// limitations under the License.
|
||
|
|
||
|
/**
|
||
|
* @fileoverview Defines a Long class for representing a 64-bit two's-complement
|
||
|
* integer value, which faithfully simulates the behavior of a Java "long". This
|
||
|
* implementation is derived from LongLib in GWT.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
var i64Math = (function() { // Emscripten wrapper
|
||
|
var goog = { math: {} };
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Constructs a 64-bit two's-complement integer, given its low and high 32-bit
|
||
|
* values as *signed* integers. See the from* functions below for more
|
||
|
* convenient ways of constructing Longs.
|
||
|
*
|
||
|
* The internal representation of a long is the two given signed, 32-bit values.
|
||
|
* We use 32-bit pieces because these are the size of integers on which
|
||
|
* Javascript performs bit-operations. For operations like addition and
|
||
|
* multiplication, we split each number into 16-bit pieces, which can easily be
|
||
|
* multiplied within Javascript's floating-point representation without overflow
|
||
|
* or change in sign.
|
||
|
*
|
||
|
* In the algorithms below, we frequently reduce the negative case to the
|
||
|
* positive case by negating the input(s) and then post-processing the result.
|
||
|
* Note that we must ALWAYS check specially whether those values are MIN_VALUE
|
||
|
* (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
|
||
|
* a positive number, it overflows back into a negative). Not handling this
|
||
|
* case would often result in infinite recursion.
|
||
|
*
|
||
|
* @param {number} low The low (signed) 32 bits of the long.
|
||
|
* @param {number} high The high (signed) 32 bits of the long.
|
||
|
* @constructor
|
||
|
*/
|
||
|
goog.math.Long = function(low, high) {
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
this.low_ = low | 0; // force into 32 signed bits.
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
this.high_ = high | 0; // force into 32 signed bits.
|
||
|
};
|
||
|
|
||
|
|
||
|
// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
|
||
|
// from* methods on which they depend.
|
||
|
|
||
|
|
||
|
/**
|
||
|
* A cache of the Long representations of small integer values.
|
||
|
* @type {!Object}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.IntCache_ = {};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns a Long representing the given (32-bit) integer value.
|
||
|
* @param {number} value The 32-bit integer in question.
|
||
|
* @return {!goog.math.Long} The corresponding Long value.
|
||
|
*/
|
||
|
goog.math.Long.fromInt = function(value) {
|
||
|
if (-128 <= value && value < 128) {
|
||
|
var cachedObj = goog.math.Long.IntCache_[value];
|
||
|
if (cachedObj) {
|
||
|
return cachedObj;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var obj = new goog.math.Long(value | 0, value < 0 ? -1 : 0);
|
||
|
if (-128 <= value && value < 128) {
|
||
|
goog.math.Long.IntCache_[value] = obj;
|
||
|
}
|
||
|
return obj;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns a Long representing the given value, provided that it is a finite
|
||
|
* number. Otherwise, zero is returned.
|
||
|
* @param {number} value The number in question.
|
||
|
* @return {!goog.math.Long} The corresponding Long value.
|
||
|
*/
|
||
|
goog.math.Long.fromNumber = function(value) {
|
||
|
if (isNaN(value) || !isFinite(value)) {
|
||
|
return goog.math.Long.ZERO;
|
||
|
} else if (value <= -goog.math.Long.TWO_PWR_63_DBL_) {
|
||
|
return goog.math.Long.MIN_VALUE;
|
||
|
} else if (value + 1 >= goog.math.Long.TWO_PWR_63_DBL_) {
|
||
|
return goog.math.Long.MAX_VALUE;
|
||
|
} else if (value < 0) {
|
||
|
return goog.math.Long.fromNumber(-value).negate();
|
||
|
} else {
|
||
|
return new goog.math.Long(
|
||
|
(value % goog.math.Long.TWO_PWR_32_DBL_) | 0,
|
||
|
(value / goog.math.Long.TWO_PWR_32_DBL_) | 0);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns a Long representing the 64-bit integer that comes by concatenating
|
||
|
* the given high and low bits. Each is assumed to use 32 bits.
|
||
|
* @param {number} lowBits The low 32-bits.
|
||
|
* @param {number} highBits The high 32-bits.
|
||
|
* @return {!goog.math.Long} The corresponding Long value.
|
||
|
*/
|
||
|
goog.math.Long.fromBits = function(lowBits, highBits) {
|
||
|
return new goog.math.Long(lowBits, highBits);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns a Long representation of the given string, written using the given
|
||
|
* radix.
|
||
|
* @param {string} str The textual representation of the Long.
|
||
|
* @param {number=} opt_radix The radix in which the text is written.
|
||
|
* @return {!goog.math.Long} The corresponding Long value.
|
||
|
*/
|
||
|
goog.math.Long.fromString = function(str, opt_radix) {
|
||
|
if (str.length == 0) {
|
||
|
throw Error('number format error: empty string');
|
||
|
}
|
||
|
|
||
|
var radix = opt_radix || 10;
|
||
|
if (radix < 2 || 36 < radix) {
|
||
|
throw Error('radix out of range: ' + radix);
|
||
|
}
|
||
|
|
||
|
if (str.charAt(0) == '-') {
|
||
|
return goog.math.Long.fromString(str.substring(1), radix).negate();
|
||
|
} else if (str.indexOf('-') >= 0) {
|
||
|
throw Error('number format error: interior "-" character: ' + str);
|
||
|
}
|
||
|
|
||
|
// Do several (8) digits each time through the loop, so as to
|
||
|
// minimize the calls to the very expensive emulated div.
|
||
|
var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 8));
|
||
|
|
||
|
var result = goog.math.Long.ZERO;
|
||
|
for (var i = 0; i < str.length; i += 8) {
|
||
|
var size = Math.min(8, str.length - i);
|
||
|
var value = parseInt(str.substring(i, i + size), radix);
|
||
|
if (size < 8) {
|
||
|
var power = goog.math.Long.fromNumber(Math.pow(radix, size));
|
||
|
result = result.multiply(power).add(goog.math.Long.fromNumber(value));
|
||
|
} else {
|
||
|
result = result.multiply(radixToPower);
|
||
|
result = result.add(goog.math.Long.fromNumber(value));
|
||
|
}
|
||
|
}
|
||
|
return result;
|
||
|
};
|
||
|
|
||
|
|
||
|
// NOTE: the compiler should inline these constant values below and then remove
|
||
|
// these variables, so there should be no runtime penalty for these.
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Number used repeated below in calculations. This must appear before the
|
||
|
* first call to any from* function below.
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_16_DBL_ = 1 << 16;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_24_DBL_ = 1 << 24;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_32_DBL_ =
|
||
|
goog.math.Long.TWO_PWR_16_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_31_DBL_ =
|
||
|
goog.math.Long.TWO_PWR_32_DBL_ / 2;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_48_DBL_ =
|
||
|
goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_16_DBL_;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_64_DBL_ =
|
||
|
goog.math.Long.TWO_PWR_32_DBL_ * goog.math.Long.TWO_PWR_32_DBL_;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {number}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_63_DBL_ =
|
||
|
goog.math.Long.TWO_PWR_64_DBL_ / 2;
|
||
|
|
||
|
|
||
|
/** @type {!goog.math.Long} */
|
||
|
goog.math.Long.ZERO = goog.math.Long.fromInt(0);
|
||
|
|
||
|
|
||
|
/** @type {!goog.math.Long} */
|
||
|
goog.math.Long.ONE = goog.math.Long.fromInt(1);
|
||
|
|
||
|
|
||
|
/** @type {!goog.math.Long} */
|
||
|
goog.math.Long.NEG_ONE = goog.math.Long.fromInt(-1);
|
||
|
|
||
|
|
||
|
/** @type {!goog.math.Long} */
|
||
|
goog.math.Long.MAX_VALUE =
|
||
|
goog.math.Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);
|
||
|
|
||
|
|
||
|
/** @type {!goog.math.Long} */
|
||
|
goog.math.Long.MIN_VALUE = goog.math.Long.fromBits(0, 0x80000000 | 0);
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @type {!goog.math.Long}
|
||
|
* @private
|
||
|
*/
|
||
|
goog.math.Long.TWO_PWR_24_ = goog.math.Long.fromInt(1 << 24);
|
||
|
|
||
|
|
||
|
/** @return {number} The value, assuming it is a 32-bit integer. */
|
||
|
goog.math.Long.prototype.toInt = function() {
|
||
|
return this.low_;
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {number} The closest floating-point representation to this value. */
|
||
|
goog.math.Long.prototype.toNumber = function() {
|
||
|
return this.high_ * goog.math.Long.TWO_PWR_32_DBL_ +
|
||
|
this.getLowBitsUnsigned();
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {number=} opt_radix The radix in which the text should be written.
|
||
|
* @return {string} The textual representation of this value.
|
||
|
*/
|
||
|
goog.math.Long.prototype.toString = function(opt_radix) {
|
||
|
var radix = opt_radix || 10;
|
||
|
if (radix < 2 || 36 < radix) {
|
||
|
throw Error('radix out of range: ' + radix);
|
||
|
}
|
||
|
|
||
|
if (this.isZero()) {
|
||
|
return '0';
|
||
|
}
|
||
|
|
||
|
if (this.isNegative()) {
|
||
|
if (this.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
// We need to change the Long value before it can be negated, so we remove
|
||
|
// the bottom-most digit in this base and then recurse to do the rest.
|
||
|
var radixLong = goog.math.Long.fromNumber(radix);
|
||
|
var div = this.div(radixLong);
|
||
|
var rem = div.multiply(radixLong).subtract(this);
|
||
|
return div.toString(radix) + rem.toInt().toString(radix);
|
||
|
} else {
|
||
|
return '-' + this.negate().toString(radix);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Do several (6) digits each time through the loop, so as to
|
||
|
// minimize the calls to the very expensive emulated div.
|
||
|
var radixToPower = goog.math.Long.fromNumber(Math.pow(radix, 6));
|
||
|
|
||
|
var rem = this;
|
||
|
var result = '';
|
||
|
while (true) {
|
||
|
var remDiv = rem.div(radixToPower);
|
||
|
var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
|
||
|
var digits = intval.toString(radix);
|
||
|
|
||
|
rem = remDiv;
|
||
|
if (rem.isZero()) {
|
||
|
return digits + result;
|
||
|
} else {
|
||
|
while (digits.length < 6) {
|
||
|
digits = '0' + digits;
|
||
|
}
|
||
|
result = '' + digits + result;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {number} The high 32-bits as a signed value. */
|
||
|
goog.math.Long.prototype.getHighBits = function() {
|
||
|
return this.high_;
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {number} The low 32-bits as a signed value. */
|
||
|
goog.math.Long.prototype.getLowBits = function() {
|
||
|
return this.low_;
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {number} The low 32-bits as an unsigned value. */
|
||
|
goog.math.Long.prototype.getLowBitsUnsigned = function() {
|
||
|
return (this.low_ >= 0) ?
|
||
|
this.low_ : goog.math.Long.TWO_PWR_32_DBL_ + this.low_;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @return {number} Returns the number of bits needed to represent the absolute
|
||
|
* value of this Long.
|
||
|
*/
|
||
|
goog.math.Long.prototype.getNumBitsAbs = function() {
|
||
|
if (this.isNegative()) {
|
||
|
if (this.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
return 64;
|
||
|
} else {
|
||
|
return this.negate().getNumBitsAbs();
|
||
|
}
|
||
|
} else {
|
||
|
var val = this.high_ != 0 ? this.high_ : this.low_;
|
||
|
for (var bit = 31; bit > 0; bit--) {
|
||
|
if ((val & (1 << bit)) != 0) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
return this.high_ != 0 ? bit + 33 : bit + 1;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {boolean} Whether this value is zero. */
|
||
|
goog.math.Long.prototype.isZero = function() {
|
||
|
return this.high_ == 0 && this.low_ == 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {boolean} Whether this value is negative. */
|
||
|
goog.math.Long.prototype.isNegative = function() {
|
||
|
return this.high_ < 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {boolean} Whether this value is odd. */
|
||
|
goog.math.Long.prototype.isOdd = function() {
|
||
|
return (this.low_ & 1) == 1;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {boolean} Whether this Long equals the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.equals = function(other) {
|
||
|
return (this.high_ == other.high_) && (this.low_ == other.low_);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {boolean} Whether this Long does not equal the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.notEquals = function(other) {
|
||
|
return (this.high_ != other.high_) || (this.low_ != other.low_);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {boolean} Whether this Long is less than the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.lessThan = function(other) {
|
||
|
return this.compare(other) < 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {boolean} Whether this Long is less than or equal to the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.lessThanOrEqual = function(other) {
|
||
|
return this.compare(other) <= 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {boolean} Whether this Long is greater than the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.greaterThan = function(other) {
|
||
|
return this.compare(other) > 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {boolean} Whether this Long is greater than or equal to the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.greaterThanOrEqual = function(other) {
|
||
|
return this.compare(other) >= 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Compares this Long with the given one.
|
||
|
* @param {goog.math.Long} other Long to compare against.
|
||
|
* @return {number} 0 if they are the same, 1 if the this is greater, and -1
|
||
|
* if the given one is greater.
|
||
|
*/
|
||
|
goog.math.Long.prototype.compare = function(other) {
|
||
|
if (this.equals(other)) {
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
var thisNeg = this.isNegative();
|
||
|
var otherNeg = other.isNegative();
|
||
|
if (thisNeg && !otherNeg) {
|
||
|
return -1;
|
||
|
}
|
||
|
if (!thisNeg && otherNeg) {
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
// at this point, the signs are the same, so subtraction will not overflow
|
||
|
if (this.subtract(other).isNegative()) {
|
||
|
return -1;
|
||
|
} else {
|
||
|
return 1;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {!goog.math.Long} The negation of this value. */
|
||
|
goog.math.Long.prototype.negate = function() {
|
||
|
if (this.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
return goog.math.Long.MIN_VALUE;
|
||
|
} else {
|
||
|
return this.not().add(goog.math.Long.ONE);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns the sum of this and the given Long.
|
||
|
* @param {goog.math.Long} other Long to add to this one.
|
||
|
* @return {!goog.math.Long} The sum of this and the given Long.
|
||
|
*/
|
||
|
goog.math.Long.prototype.add = function(other) {
|
||
|
// Divide each number into 4 chunks of 16 bits, and then sum the chunks.
|
||
|
|
||
|
var a48 = this.high_ >>> 16;
|
||
|
var a32 = this.high_ & 0xFFFF;
|
||
|
var a16 = this.low_ >>> 16;
|
||
|
var a00 = this.low_ & 0xFFFF;
|
||
|
|
||
|
var b48 = other.high_ >>> 16;
|
||
|
var b32 = other.high_ & 0xFFFF;
|
||
|
var b16 = other.low_ >>> 16;
|
||
|
var b00 = other.low_ & 0xFFFF;
|
||
|
|
||
|
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
||
|
c00 += a00 + b00;
|
||
|
c16 += c00 >>> 16;
|
||
|
c00 &= 0xFFFF;
|
||
|
c16 += a16 + b16;
|
||
|
c32 += c16 >>> 16;
|
||
|
c16 &= 0xFFFF;
|
||
|
c32 += a32 + b32;
|
||
|
c48 += c32 >>> 16;
|
||
|
c32 &= 0xFFFF;
|
||
|
c48 += a48 + b48;
|
||
|
c48 &= 0xFFFF;
|
||
|
return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns the difference of this and the given Long.
|
||
|
* @param {goog.math.Long} other Long to subtract from this.
|
||
|
* @return {!goog.math.Long} The difference of this and the given Long.
|
||
|
*/
|
||
|
goog.math.Long.prototype.subtract = function(other) {
|
||
|
return this.add(other.negate());
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns the product of this and the given long.
|
||
|
* @param {goog.math.Long} other Long to multiply with this.
|
||
|
* @return {!goog.math.Long} The product of this and the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.multiply = function(other) {
|
||
|
if (this.isZero()) {
|
||
|
return goog.math.Long.ZERO;
|
||
|
} else if (other.isZero()) {
|
||
|
return goog.math.Long.ZERO;
|
||
|
}
|
||
|
|
||
|
if (this.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
return other.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;
|
||
|
} else if (other.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
return this.isOdd() ? goog.math.Long.MIN_VALUE : goog.math.Long.ZERO;
|
||
|
}
|
||
|
|
||
|
if (this.isNegative()) {
|
||
|
if (other.isNegative()) {
|
||
|
return this.negate().multiply(other.negate());
|
||
|
} else {
|
||
|
return this.negate().multiply(other).negate();
|
||
|
}
|
||
|
} else if (other.isNegative()) {
|
||
|
return this.multiply(other.negate()).negate();
|
||
|
}
|
||
|
|
||
|
// If both longs are small, use float multiplication
|
||
|
if (this.lessThan(goog.math.Long.TWO_PWR_24_) &&
|
||
|
other.lessThan(goog.math.Long.TWO_PWR_24_)) {
|
||
|
return goog.math.Long.fromNumber(this.toNumber() * other.toNumber());
|
||
|
}
|
||
|
|
||
|
// Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.
|
||
|
// We can skip products that would overflow.
|
||
|
|
||
|
var a48 = this.high_ >>> 16;
|
||
|
var a32 = this.high_ & 0xFFFF;
|
||
|
var a16 = this.low_ >>> 16;
|
||
|
var a00 = this.low_ & 0xFFFF;
|
||
|
|
||
|
var b48 = other.high_ >>> 16;
|
||
|
var b32 = other.high_ & 0xFFFF;
|
||
|
var b16 = other.low_ >>> 16;
|
||
|
var b00 = other.low_ & 0xFFFF;
|
||
|
|
||
|
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
||
|
c00 += a00 * b00;
|
||
|
c16 += c00 >>> 16;
|
||
|
c00 &= 0xFFFF;
|
||
|
c16 += a16 * b00;
|
||
|
c32 += c16 >>> 16;
|
||
|
c16 &= 0xFFFF;
|
||
|
c16 += a00 * b16;
|
||
|
c32 += c16 >>> 16;
|
||
|
c16 &= 0xFFFF;
|
||
|
c32 += a32 * b00;
|
||
|
c48 += c32 >>> 16;
|
||
|
c32 &= 0xFFFF;
|
||
|
c32 += a16 * b16;
|
||
|
c48 += c32 >>> 16;
|
||
|
c32 &= 0xFFFF;
|
||
|
c32 += a00 * b32;
|
||
|
c48 += c32 >>> 16;
|
||
|
c32 &= 0xFFFF;
|
||
|
c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
|
||
|
c48 &= 0xFFFF;
|
||
|
return goog.math.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns this Long divided by the given one.
|
||
|
* @param {goog.math.Long} other Long by which to divide.
|
||
|
* @return {!goog.math.Long} This Long divided by the given one.
|
||
|
*/
|
||
|
goog.math.Long.prototype.div = function(other) {
|
||
|
if (other.isZero()) {
|
||
|
throw Error('division by zero');
|
||
|
} else if (this.isZero()) {
|
||
|
return goog.math.Long.ZERO;
|
||
|
}
|
||
|
|
||
|
if (this.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
if (other.equals(goog.math.Long.ONE) ||
|
||
|
other.equals(goog.math.Long.NEG_ONE)) {
|
||
|
return goog.math.Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
|
||
|
} else if (other.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
return goog.math.Long.ONE;
|
||
|
} else {
|
||
|
// At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
|
||
|
var halfThis = this.shiftRight(1);
|
||
|
var approx = halfThis.div(other).shiftLeft(1);
|
||
|
if (approx.equals(goog.math.Long.ZERO)) {
|
||
|
return other.isNegative() ? goog.math.Long.ONE : goog.math.Long.NEG_ONE;
|
||
|
} else {
|
||
|
var rem = this.subtract(other.multiply(approx));
|
||
|
var result = approx.add(rem.div(other));
|
||
|
return result;
|
||
|
}
|
||
|
}
|
||
|
} else if (other.equals(goog.math.Long.MIN_VALUE)) {
|
||
|
return goog.math.Long.ZERO;
|
||
|
}
|
||
|
|
||
|
if (this.isNegative()) {
|
||
|
if (other.isNegative()) {
|
||
|
return this.negate().div(other.negate());
|
||
|
} else {
|
||
|
return this.negate().div(other).negate();
|
||
|
}
|
||
|
} else if (other.isNegative()) {
|
||
|
return this.div(other.negate()).negate();
|
||
|
}
|
||
|
|
||
|
// Repeat the following until the remainder is less than other: find a
|
||
|
// floating-point that approximates remainder / other *from below*, add this
|
||
|
// into the result, and subtract it from the remainder. It is critical that
|
||
|
// the approximate value is less than or equal to the real value so that the
|
||
|
// remainder never becomes negative.
|
||
|
var res = goog.math.Long.ZERO;
|
||
|
var rem = this;
|
||
|
while (rem.greaterThanOrEqual(other)) {
|
||
|
// Approximate the result of division. This may be a little greater or
|
||
|
// smaller than the actual value.
|
||
|
var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
|
||
|
|
||
|
// We will tweak the approximate result by changing it in the 48-th digit or
|
||
|
// the smallest non-fractional digit, whichever is larger.
|
||
|
var log2 = Math.ceil(Math.log(approx) / Math.LN2);
|
||
|
var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);
|
||
|
|
||
|
// Decrease the approximation until it is smaller than the remainder. Note
|
||
|
// that if it is too large, the product overflows and is negative.
|
||
|
var approxRes = goog.math.Long.fromNumber(approx);
|
||
|
var approxRem = approxRes.multiply(other);
|
||
|
while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
|
||
|
approx -= delta;
|
||
|
approxRes = goog.math.Long.fromNumber(approx);
|
||
|
approxRem = approxRes.multiply(other);
|
||
|
}
|
||
|
|
||
|
// We know the answer can't be zero... and actually, zero would cause
|
||
|
// infinite recursion since we would make no progress.
|
||
|
if (approxRes.isZero()) {
|
||
|
approxRes = goog.math.Long.ONE;
|
||
|
}
|
||
|
|
||
|
res = res.add(approxRes);
|
||
|
rem = rem.subtract(approxRem);
|
||
|
}
|
||
|
return res;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns this Long modulo the given one.
|
||
|
* @param {goog.math.Long} other Long by which to mod.
|
||
|
* @return {!goog.math.Long} This Long modulo the given one.
|
||
|
*/
|
||
|
goog.math.Long.prototype.modulo = function(other) {
|
||
|
return this.subtract(this.div(other).multiply(other));
|
||
|
};
|
||
|
|
||
|
|
||
|
/** @return {!goog.math.Long} The bitwise-NOT of this value. */
|
||
|
goog.math.Long.prototype.not = function() {
|
||
|
return goog.math.Long.fromBits(~this.low_, ~this.high_);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns the bitwise-AND of this Long and the given one.
|
||
|
* @param {goog.math.Long} other The Long with which to AND.
|
||
|
* @return {!goog.math.Long} The bitwise-AND of this and the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.and = function(other) {
|
||
|
return goog.math.Long.fromBits(this.low_ & other.low_,
|
||
|
this.high_ & other.high_);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns the bitwise-OR of this Long and the given one.
|
||
|
* @param {goog.math.Long} other The Long with which to OR.
|
||
|
* @return {!goog.math.Long} The bitwise-OR of this and the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.or = function(other) {
|
||
|
return goog.math.Long.fromBits(this.low_ | other.low_,
|
||
|
this.high_ | other.high_);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns the bitwise-XOR of this Long and the given one.
|
||
|
* @param {goog.math.Long} other The Long with which to XOR.
|
||
|
* @return {!goog.math.Long} The bitwise-XOR of this and the other.
|
||
|
*/
|
||
|
goog.math.Long.prototype.xor = function(other) {
|
||
|
return goog.math.Long.fromBits(this.low_ ^ other.low_,
|
||
|
this.high_ ^ other.high_);
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns this Long with bits shifted to the left by the given amount.
|
||
|
* @param {number} numBits The number of bits by which to shift.
|
||
|
* @return {!goog.math.Long} This shifted to the left by the given amount.
|
||
|
*/
|
||
|
goog.math.Long.prototype.shiftLeft = function(numBits) {
|
||
|
numBits &= 63;
|
||
|
if (numBits == 0) {
|
||
|
return this;
|
||
|
} else {
|
||
|
var low = this.low_;
|
||
|
if (numBits < 32) {
|
||
|
var high = this.high_;
|
||
|
return goog.math.Long.fromBits(
|
||
|
low << numBits,
|
||
|
(high << numBits) | (low >>> (32 - numBits)));
|
||
|
} else {
|
||
|
return goog.math.Long.fromBits(0, low << (numBits - 32));
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns this Long with bits shifted to the right by the given amount.
|
||
|
* @param {number} numBits The number of bits by which to shift.
|
||
|
* @return {!goog.math.Long} This shifted to the right by the given amount.
|
||
|
*/
|
||
|
goog.math.Long.prototype.shiftRight = function(numBits) {
|
||
|
numBits &= 63;
|
||
|
if (numBits == 0) {
|
||
|
return this;
|
||
|
} else {
|
||
|
var high = this.high_;
|
||
|
if (numBits < 32) {
|
||
|
var low = this.low_;
|
||
|
return goog.math.Long.fromBits(
|
||
|
(low >>> numBits) | (high << (32 - numBits)),
|
||
|
high >> numBits);
|
||
|
} else {
|
||
|
return goog.math.Long.fromBits(
|
||
|
high >> (numBits - 32),
|
||
|
high >= 0 ? 0 : -1);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Returns this Long with bits shifted to the right by the given amount, with
|
||
|
* the new top bits matching the current sign bit.
|
||
|
* @param {number} numBits The number of bits by which to shift.
|
||
|
* @return {!goog.math.Long} This shifted to the right by the given amount, with
|
||
|
* zeros placed into the new leading bits.
|
||
|
*/
|
||
|
goog.math.Long.prototype.shiftRightUnsigned = function(numBits) {
|
||
|
numBits &= 63;
|
||
|
if (numBits == 0) {
|
||
|
return this;
|
||
|
} else {
|
||
|
var high = this.high_;
|
||
|
if (numBits < 32) {
|
||
|
var low = this.low_;
|
||
|
return goog.math.Long.fromBits(
|
||
|
(low >>> numBits) | (high << (32 - numBits)),
|
||
|
high >>> numBits);
|
||
|
} else if (numBits == 32) {
|
||
|
return goog.math.Long.fromBits(high, 0);
|
||
|
} else {
|
||
|
return goog.math.Long.fromBits(high >>> (numBits - 32), 0);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
//======= begin jsbn =======
|
||
|
|
||
|
var navigator = { appName: 'Modern Browser' }; // polyfill a little
|
||
|
|
||
|
// Copyright (c) 2005 Tom Wu
|
||
|
// All Rights Reserved.
|
||
|
// http://www-cs-students.stanford.edu/~tjw/jsbn/
|
||
|
|
||
|
/*
|
||
|
* Copyright (c) 2003-2005 Tom Wu
|
||
|
* All Rights Reserved.
|
||
|
*
|
||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||
|
* a copy of this software and associated documentation files (the
|
||
|
* "Software"), to deal in the Software without restriction, including
|
||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||
|
* the following conditions:
|
||
|
*
|
||
|
* The above copyright notice and this permission notice shall be
|
||
|
* included in all copies or substantial portions of the Software.
|
||
|
*
|
||
|
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||
|
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||
|
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||
|
*
|
||
|
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
||
|
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
|
||
|
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
|
||
|
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
|
||
|
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
|
*
|
||
|
* In addition, the following condition applies:
|
||
|
*
|
||
|
* All redistributions must retain an intact copy of this copyright notice
|
||
|
* and disclaimer.
|
||
|
*/
|
||
|
|
||
|
// Basic JavaScript BN library - subset useful for RSA encryption.
|
||
|
|
||
|
// Bits per digit
|
||
|
var dbits;
|
||
|
|
||
|
// JavaScript engine analysis
|
||
|
var canary = 0xdeadbeefcafe;
|
||
|
var j_lm = ((canary&0xffffff)==0xefcafe);
|
||
|
|
||
|
// (public) Constructor
|
||
|
function BigInteger(a,b,c) {
|
||
|
if(a != null)
|
||
|
if("number" == typeof a) this.fromNumber(a,b,c);
|
||
|
else if(b == null && "string" != typeof a) this.fromString(a,256);
|
||
|
else this.fromString(a,b);
|
||
|
}
|
||
|
|
||
|
// return new, unset BigInteger
|
||
|
function nbi() { return new BigInteger(null); }
|
||
|
|
||
|
// am: Compute w_j += (x*this_i), propagate carries,
|
||
|
// c is initial carry, returns final carry.
|
||
|
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
|
||
|
// We need to select the fastest one that works in this environment.
|
||
|
|
||
|
// am1: use a single mult and divide to get the high bits,
|
||
|
// max digit bits should be 26 because
|
||
|
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
|
||
|
function am1(i,x,w,j,c,n) {
|
||
|
while(--n >= 0) {
|
||
|
var v = x*this[i++]+w[j]+c;
|
||
|
c = Math.floor(v/0x4000000);
|
||
|
w[j++] = v&0x3ffffff;
|
||
|
}
|
||
|
return c;
|
||
|
}
|
||
|
// am2 avoids a big mult-and-extract completely.
|
||
|
// Max digit bits should be <= 30 because we do bitwise ops
|
||
|
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
|
||
|
function am2(i,x,w,j,c,n) {
|
||
|
var xl = x&0x7fff, xh = x>>15;
|
||
|
while(--n >= 0) {
|
||
|
var l = this[i]&0x7fff;
|
||
|
var h = this[i++]>>15;
|
||
|
var m = xh*l+h*xl;
|
||
|
l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
|
||
|
c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
|
||
|
w[j++] = l&0x3fffffff;
|
||
|
}
|
||
|
return c;
|
||
|
}
|
||
|
// Alternately, set max digit bits to 28 since some
|
||
|
// browsers slow down when dealing with 32-bit numbers.
|
||
|
function am3(i,x,w,j,c,n) {
|
||
|
var xl = x&0x3fff, xh = x>>14;
|
||
|
while(--n >= 0) {
|
||
|
var l = this[i]&0x3fff;
|
||
|
var h = this[i++]>>14;
|
||
|
var m = xh*l+h*xl;
|
||
|
l = xl*l+((m&0x3fff)<<14)+w[j]+c;
|
||
|
c = (l>>28)+(m>>14)+xh*h;
|
||
|
w[j++] = l&0xfffffff;
|
||
|
}
|
||
|
return c;
|
||
|
}
|
||
|
if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
|
||
|
BigInteger.prototype.am = am2;
|
||
|
dbits = 30;
|
||
|
}
|
||
|
else if(j_lm && (navigator.appName != "Netscape")) {
|
||
|
BigInteger.prototype.am = am1;
|
||
|
dbits = 26;
|
||
|
}
|
||
|
else { // Mozilla/Netscape seems to prefer am3
|
||
|
BigInteger.prototype.am = am3;
|
||
|
dbits = 28;
|
||
|
}
|
||
|
|
||
|
BigInteger.prototype.DB = dbits;
|
||
|
BigInteger.prototype.DM = ((1<<dbits)-1);
|
||
|
BigInteger.prototype.DV = (1<<dbits);
|
||
|
|
||
|
var BI_FP = 52;
|
||
|
BigInteger.prototype.FV = Math.pow(2,BI_FP);
|
||
|
BigInteger.prototype.F1 = BI_FP-dbits;
|
||
|
BigInteger.prototype.F2 = 2*dbits-BI_FP;
|
||
|
|
||
|
// Digit conversions
|
||
|
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||
|
var BI_RC = new Array();
|
||
|
var rr,vv;
|
||
|
rr = "0".charCodeAt(0);
|
||
|
for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
|
||
|
rr = "a".charCodeAt(0);
|
||
|
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
|
||
|
rr = "A".charCodeAt(0);
|
||
|
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
|
||
|
|
||
|
function int2char(n) { return BI_RM.charAt(n); }
|
||
|
function intAt(s,i) {
|
||
|
var c = BI_RC[s.charCodeAt(i)];
|
||
|
return (c==null)?-1:c;
|
||
|
}
|
||
|
|
||
|
// (protected) copy this to r
|
||
|
function bnpCopyTo(r) {
|
||
|
for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
|
||
|
r.t = this.t;
|
||
|
r.s = this.s;
|
||
|
}
|
||
|
|
||
|
// (protected) set from integer value x, -DV <= x < DV
|
||
|
function bnpFromInt(x) {
|
||
|
this.t = 1;
|
||
|
this.s = (x<0)?-1:0;
|
||
|
if(x > 0) this[0] = x;
|
||
|
else if(x < -1) this[0] = x+DV;
|
||
|
else this.t = 0;
|
||
|
}
|
||
|
|
||
|
// return bigint initialized to value
|
||
|
function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
|
||
|
|
||
|
// (protected) set from string and radix
|
||
|
function bnpFromString(s,b) {
|
||
|
var k;
|
||
|
if(b == 16) k = 4;
|
||
|
else if(b == 8) k = 3;
|
||
|
else if(b == 256) k = 8; // byte array
|
||
|
else if(b == 2) k = 1;
|
||
|
else if(b == 32) k = 5;
|
||
|
else if(b == 4) k = 2;
|
||
|
else { this.fromRadix(s,b); return; }
|
||
|
this.t = 0;
|
||
|
this.s = 0;
|
||
|
var i = s.length, mi = false, sh = 0;
|
||
|
while(--i >= 0) {
|
||
|
var x = (k==8)?s[i]&0xff:intAt(s,i);
|
||
|
if(x < 0) {
|
||
|
if(s.charAt(i) == "-") mi = true;
|
||
|
continue;
|
||
|
}
|
||
|
mi = false;
|
||
|
if(sh == 0)
|
||
|
this[this.t++] = x;
|
||
|
else if(sh+k > this.DB) {
|
||
|
this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
|
||
|
this[this.t++] = (x>>(this.DB-sh));
|
||
|
}
|
||
|
else
|
||
|
this[this.t-1] |= x<<sh;
|
||
|
sh += k;
|
||
|
if(sh >= this.DB) sh -= this.DB;
|
||
|
}
|
||
|
if(k == 8 && (s[0]&0x80) != 0) {
|
||
|
this.s = -1;
|
||
|
if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
|
||
|
}
|
||
|
this.clamp();
|
||
|
if(mi) BigInteger.ZERO.subTo(this,this);
|
||
|
}
|
||
|
|
||
|
// (protected) clamp off excess high words
|
||
|
function bnpClamp() {
|
||
|
var c = this.s&this.DM;
|
||
|
while(this.t > 0 && this[this.t-1] == c) --this.t;
|
||
|
}
|
||
|
|
||
|
// (public) return string representation in given radix
|
||
|
function bnToString(b) {
|
||
|
if(this.s < 0) return "-"+this.negate().toString(b);
|
||
|
var k;
|
||
|
if(b == 16) k = 4;
|
||
|
else if(b == 8) k = 3;
|
||
|
else if(b == 2) k = 1;
|
||
|
else if(b == 32) k = 5;
|
||
|
else if(b == 4) k = 2;
|
||
|
else return this.toRadix(b);
|
||
|
var km = (1<<k)-1, d, m = false, r = "", i = this.t;
|
||
|
var p = this.DB-(i*this.DB)%k;
|
||
|
if(i-- > 0) {
|
||
|
if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
|
||
|
while(i >= 0) {
|
||
|
if(p < k) {
|
||
|
d = (this[i]&((1<<p)-1))<<(k-p);
|
||
|
d |= this[--i]>>(p+=this.DB-k);
|
||
|
}
|
||
|
else {
|
||
|
d = (this[i]>>(p-=k))&km;
|
||
|
if(p <= 0) { p += this.DB; --i; }
|
||
|
}
|
||
|
if(d > 0) m = true;
|
||
|
if(m) r += int2char(d);
|
||
|
}
|
||
|
}
|
||
|
return m?r:"0";
|
||
|
}
|
||
|
|
||
|
// (public) -this
|
||
|
function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
|
||
|
|
||
|
// (public) |this|
|
||
|
function bnAbs() { return (this.s<0)?this.negate():this; }
|
||
|
|
||
|
// (public) return + if this > a, - if this < a, 0 if equal
|
||
|
function bnCompareTo(a) {
|
||
|
var r = this.s-a.s;
|
||
|
if(r != 0) return r;
|
||
|
var i = this.t;
|
||
|
r = i-a.t;
|
||
|
if(r != 0) return (this.s<0)?-r:r;
|
||
|
while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
// returns bit length of the integer x
|
||
|
function nbits(x) {
|
||
|
var r = 1, t;
|
||
|
if((t=x>>>16) != 0) { x = t; r += 16; }
|
||
|
if((t=x>>8) != 0) { x = t; r += 8; }
|
||
|
if((t=x>>4) != 0) { x = t; r += 4; }
|
||
|
if((t=x>>2) != 0) { x = t; r += 2; }
|
||
|
if((t=x>>1) != 0) { x = t; r += 1; }
|
||
|
return r;
|
||
|
}
|
||
|
|
||
|
// (public) return the number of bits in "this"
|
||
|
function bnBitLength() {
|
||
|
if(this.t <= 0) return 0;
|
||
|
return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
|
||
|
}
|
||
|
|
||
|
// (protected) r = this << n*DB
|
||
|
function bnpDLShiftTo(n,r) {
|
||
|
var i;
|
||
|
for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
|
||
|
for(i = n-1; i >= 0; --i) r[i] = 0;
|
||
|
r.t = this.t+n;
|
||
|
r.s = this.s;
|
||
|
}
|
||
|
|
||
|
// (protected) r = this >> n*DB
|
||
|
function bnpDRShiftTo(n,r) {
|
||
|
for(var i = n; i < this.t; ++i) r[i-n] = this[i];
|
||
|
r.t = Math.max(this.t-n,0);
|
||
|
r.s = this.s;
|
||
|
}
|
||
|
|
||
|
// (protected) r = this << n
|
||
|
function bnpLShiftTo(n,r) {
|
||
|
var bs = n%this.DB;
|
||
|
var cbs = this.DB-bs;
|
||
|
var bm = (1<<cbs)-1;
|
||
|
var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
|
||
|
for(i = this.t-1; i >= 0; --i) {
|
||
|
r[i+ds+1] = (this[i]>>cbs)|c;
|
||
|
c = (this[i]&bm)<<bs;
|
||
|
}
|
||
|
for(i = ds-1; i >= 0; --i) r[i] = 0;
|
||
|
r[ds] = c;
|
||
|
r.t = this.t+ds+1;
|
||
|
r.s = this.s;
|
||
|
r.clamp();
|
||
|
}
|
||
|
|
||
|
// (protected) r = this >> n
|
||
|
function bnpRShiftTo(n,r) {
|
||
|
r.s = this.s;
|
||
|
var ds = Math.floor(n/this.DB);
|
||
|
if(ds >= this.t) { r.t = 0; return; }
|
||
|
var bs = n%this.DB;
|
||
|
var cbs = this.DB-bs;
|
||
|
var bm = (1<<bs)-1;
|
||
|
r[0] = this[ds]>>bs;
|
||
|
for(var i = ds+1; i < this.t; ++i) {
|
||
|
r[i-ds-1] |= (this[i]&bm)<<cbs;
|
||
|
r[i-ds] = this[i]>>bs;
|
||
|
}
|
||
|
if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
|
||
|
r.t = this.t-ds;
|
||
|
r.clamp();
|
||
|
}
|
||
|
|
||
|
// (protected) r = this - a
|
||
|
function bnpSubTo(a,r) {
|
||
|
var i = 0, c = 0, m = Math.min(a.t,this.t);
|
||
|
while(i < m) {
|
||
|
c += this[i]-a[i];
|
||
|
r[i++] = c&this.DM;
|
||
|
c >>= this.DB;
|
||
|
}
|
||
|
if(a.t < this.t) {
|
||
|
c -= a.s;
|
||
|
while(i < this.t) {
|
||
|
c += this[i];
|
||
|
r[i++] = c&this.DM;
|
||
|
c >>= this.DB;
|
||
|
}
|
||
|
c += this.s;
|
||
|
}
|
||
|
else {
|
||
|
c += this.s;
|
||
|
while(i < a.t) {
|
||
|
c -= a[i];
|
||
|
r[i++] = c&this.DM;
|
||
|
c >>= this.DB;
|
||
|
}
|
||
|
c -= a.s;
|
||
|
}
|
||
|
r.s = (c<0)?-1:0;
|
||
|
if(c < -1) r[i++] = this.DV+c;
|
||
|
else if(c > 0) r[i++] = c;
|
||
|
r.t = i;
|
||
|
r.clamp();
|
||
|
}
|
||
|
|
||
|
// (protected) r = this * a, r != this,a (HAC 14.12)
|
||
|
// "this" should be the larger one if appropriate.
|
||
|
function bnpMultiplyTo(a,r) {
|
||
|
var x = this.abs(), y = a.abs();
|
||
|
var i = x.t;
|
||
|
r.t = i+y.t;
|
||
|
while(--i >= 0) r[i] = 0;
|
||
|
for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
|
||
|
r.s = 0;
|
||
|
r.clamp();
|
||
|
if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
|
||
|
}
|
||
|
|
||
|
// (protected) r = this^2, r != this (HAC 14.16)
|
||
|
function bnpSquareTo(r) {
|
||
|
var x = this.abs();
|
||
|
var i = r.t = 2*x.t;
|
||
|
while(--i >= 0) r[i] = 0;
|
||
|
for(i = 0; i < x.t-1; ++i) {
|
||
|
var c = x.am(i,x[i],r,2*i,0,1);
|
||
|
if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
|
||
|
r[i+x.t] -= x.DV;
|
||
|
r[i+x.t+1] = 1;
|
||
|
}
|
||
|
}
|
||
|
if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
|
||
|
r.s = 0;
|
||
|
r.clamp();
|
||
|
}
|
||
|
|
||
|
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
|
||
|
// r != q, this != m. q or r may be null.
|
||
|
function bnpDivRemTo(m,q,r) {
|
||
|
var pm = m.abs();
|
||
|
if(pm.t <= 0) return;
|
||
|
var pt = this.abs();
|
||
|
if(pt.t < pm.t) {
|
||
|
if(q != null) q.fromInt(0);
|
||
|
if(r != null) this.copyTo(r);
|
||
|
return;
|
||
|
}
|
||
|
if(r == null) r = nbi();
|
||
|
var y = nbi(), ts = this.s, ms = m.s;
|
||
|
var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
|
||
|
if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
|
||
|
else { pm.copyTo(y); pt.copyTo(r); }
|
||
|
var ys = y.t;
|
||
|
var y0 = y[ys-1];
|
||
|
if(y0 == 0) return;
|
||
|
var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
|
||
|
var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
|
||
|
var i = r.t, j = i-ys, t = (q==null)?nbi():q;
|
||
|
y.dlShiftTo(j,t);
|
||
|
if(r.compareTo(t) >= 0) {
|
||
|
r[r.t++] = 1;
|
||
|
r.subTo(t,r);
|
||
|
}
|
||
|
BigInteger.ONE.dlShiftTo(ys,t);
|
||
|
t.subTo(y,y); // "negative" y so we can replace sub with am later
|
||
|
while(y.t < ys) y[y.t++] = 0;
|
||
|
while(--j >= 0) {
|
||
|
// Estimate quotient digit
|
||
|
var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
|
||
|
if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
|
||
|
y.dlShiftTo(j,t);
|
||
|
r.subTo(t,r);
|
||
|
while(r[i] < --qd) r.subTo(t,r);
|
||
|
}
|
||
|
}
|
||
|
if(q != null) {
|
||
|
r.drShiftTo(ys,q);
|
||
|
if(ts != ms) BigInteger.ZERO.subTo(q,q);
|
||
|
}
|
||
|
r.t = ys;
|
||
|
r.clamp();
|
||
|
if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
|
||
|
if(ts < 0) BigInteger.ZERO.subTo(r,r);
|
||
|
}
|
||
|
|
||
|
// (public) this mod a
|
||
|
function bnMod(a) {
|
||
|
var r = nbi();
|
||
|
this.abs().divRemTo(a,null,r);
|
||
|
if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
|
||
|
return r;
|
||
|
}
|
||
|
|
||
|
// Modular reduction using "classic" algorithm
|
||
|
function Classic(m) { this.m = m; }
|
||
|
function cConvert(x) {
|
||
|
if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
|
||
|
else return x;
|
||
|
}
|
||
|
function cRevert(x) { return x; }
|
||
|
function cReduce(x) { x.divRemTo(this.m,null,x); }
|
||
|
function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
|
||
|
function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
|
||
|
|
||
|
Classic.prototype.convert = cConvert;
|
||
|
Classic.prototype.revert = cRevert;
|
||
|
Classic.prototype.reduce = cReduce;
|
||
|
Classic.prototype.mulTo = cMulTo;
|
||
|
Classic.prototype.sqrTo = cSqrTo;
|
||
|
|
||
|
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
|
||
|
// justification:
|
||
|
// xy == 1 (mod m)
|
||
|
// xy = 1+km
|
||
|
// xy(2-xy) = (1+km)(1-km)
|
||
|
// x[y(2-xy)] = 1-k^2m^2
|
||
|
// x[y(2-xy)] == 1 (mod m^2)
|
||
|
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
|
||
|
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
|
||
|
// JS multiply "overflows" differently from C/C++, so care is needed here.
|
||
|
function bnpInvDigit() {
|
||
|
if(this.t < 1) return 0;
|
||
|
var x = this[0];
|
||
|
if((x&1) == 0) return 0;
|
||
|
var y = x&3; // y == 1/x mod 2^2
|
||
|
y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
|
||
|
y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
|
||
|
y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
|
||
|
// last step - calculate inverse mod DV directly;
|
||
|
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
|
||
|
y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
|
||
|
// we really want the negative inverse, and -DV < y < DV
|
||
|
return (y>0)?this.DV-y:-y;
|
||
|
}
|
||
|
|
||
|
// Montgomery reduction
|
||
|
function Montgomery(m) {
|
||
|
this.m = m;
|
||
|
this.mp = m.invDigit();
|
||
|
this.mpl = this.mp&0x7fff;
|
||
|
this.mph = this.mp>>15;
|
||
|
this.um = (1<<(m.DB-15))-1;
|
||
|
this.mt2 = 2*m.t;
|
||
|
}
|
||
|
|
||
|
// xR mod m
|
||
|
function montConvert(x) {
|
||
|
var r = nbi();
|
||
|
x.abs().dlShiftTo(this.m.t,r);
|
||
|
r.divRemTo(this.m,null,r);
|
||
|
if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
|
||
|
return r;
|
||
|
}
|
||
|
|
||
|
// x/R mod m
|
||
|
function montRevert(x) {
|
||
|
var r = nbi();
|
||
|
x.copyTo(r);
|
||
|
this.reduce(r);
|
||
|
return r;
|
||
|
}
|
||
|
|
||
|
// x = x/R mod m (HAC 14.32)
|
||
|
function montReduce(x) {
|
||
|
while(x.t <= this.mt2) // pad x so am has enough room later
|
||
|
x[x.t++] = 0;
|
||
|
for(var i = 0; i < this.m.t; ++i) {
|
||
|
// faster way of calculating u0 = x[i]*mp mod DV
|
||
|
var j = x[i]&0x7fff;
|
||
|
var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
|
||
|
// use am to combine the multiply-shift-add into one call
|
||
|
j = i+this.m.t;
|
||
|
x[j] += this.m.am(0,u0,x,i,0,this.m.t);
|
||
|
// propagate carry
|
||
|
while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
|
||
|
}
|
||
|
x.clamp();
|
||
|
x.drShiftTo(this.m.t,x);
|
||
|
if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
|
||
|
}
|
||
|
|
||
|
// r = "x^2/R mod m"; x != r
|
||
|
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
|
||
|
|
||
|
// r = "xy/R mod m"; x,y != r
|
||
|
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
|
||
|
|
||
|
Montgomery.prototype.convert = montConvert;
|
||
|
Montgomery.prototype.revert = montRevert;
|
||
|
Montgomery.prototype.reduce = montReduce;
|
||
|
Montgomery.prototype.mulTo = montMulTo;
|
||
|
Montgomery.prototype.sqrTo = montSqrTo;
|
||
|
|
||
|
// (protected) true iff this is even
|
||
|
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
|
||
|
|
||
|
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
|
||
|
function bnpExp(e,z) {
|
||
|
if(e > 0xffffffff || e < 1) return BigInteger.ONE;
|
||
|
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
|
||
|
g.copyTo(r);
|
||
|
while(--i >= 0) {
|
||
|
z.sqrTo(r,r2);
|
||
|
if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
|
||
|
else { var t = r; r = r2; r2 = t; }
|
||
|
}
|
||
|
return z.revert(r);
|
||
|
}
|
||
|
|
||
|
// (public) this^e % m, 0 <= e < 2^32
|
||
|
function bnModPowInt(e,m) {
|
||
|
var z;
|
||
|
if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
|
||
|
return this.exp(e,z);
|
||
|
}
|
||
|
|
||
|
// protected
|
||
|
BigInteger.prototype.copyTo = bnpCopyTo;
|
||
|
BigInteger.prototype.fromInt = bnpFromInt;
|
||
|
BigInteger.prototype.fromString = bnpFromString;
|
||
|
BigInteger.prototype.clamp = bnpClamp;
|
||
|
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
|
||
|
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
|
||
|
BigInteger.prototype.lShiftTo = bnpLShiftTo;
|
||
|
BigInteger.prototype.rShiftTo = bnpRShiftTo;
|
||
|
BigInteger.prototype.subTo = bnpSubTo;
|
||
|
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
|
||
|
BigInteger.prototype.squareTo = bnpSquareTo;
|
||
|
BigInteger.prototype.divRemTo = bnpDivRemTo;
|
||
|
BigInteger.prototype.invDigit = bnpInvDigit;
|
||
|
BigInteger.prototype.isEven = bnpIsEven;
|
||
|
BigInteger.prototype.exp = bnpExp;
|
||
|
|
||
|
// public
|
||
|
BigInteger.prototype.toString = bnToString;
|
||
|
BigInteger.prototype.negate = bnNegate;
|
||
|
BigInteger.prototype.abs = bnAbs;
|
||
|
BigInteger.prototype.compareTo = bnCompareTo;
|
||
|
BigInteger.prototype.bitLength = bnBitLength;
|
||
|
BigInteger.prototype.mod = bnMod;
|
||
|
BigInteger.prototype.modPowInt = bnModPowInt;
|
||
|
|
||
|
// "constants"
|
||
|
BigInteger.ZERO = nbv(0);
|
||
|
BigInteger.ONE = nbv(1);
|
||
|
|
||
|
// jsbn2 stuff
|
||
|
|
||
|
// (protected) convert from radix string
|
||
|
function bnpFromRadix(s,b) {
|
||
|
this.fromInt(0);
|
||
|
if(b == null) b = 10;
|
||
|
var cs = this.chunkSize(b);
|
||
|
var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
|
||
|
for(var i = 0; i < s.length; ++i) {
|
||
|
var x = intAt(s,i);
|
||
|
if(x < 0) {
|
||
|
if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
|
||
|
continue;
|
||
|
}
|
||
|
w = b*w+x;
|
||
|
if(++j >= cs) {
|
||
|
this.dMultiply(d);
|
||
|
this.dAddOffset(w,0);
|
||
|
j = 0;
|
||
|
w = 0;
|
||
|
}
|
||
|
}
|
||
|
if(j > 0) {
|
||
|
this.dMultiply(Math.pow(b,j));
|
||
|
this.dAddOffset(w,0);
|
||
|
}
|
||
|
if(mi) BigInteger.ZERO.subTo(this,this);
|
||
|
}
|
||
|
|
||
|
// (protected) return x s.t. r^x < DV
|
||
|
function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
|
||
|
|
||
|
// (public) 0 if this == 0, 1 if this > 0
|
||
|
function bnSigNum() {
|
||
|
if(this.s < 0) return -1;
|
||
|
else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
|
||
|
else return 1;
|
||
|
}
|
||
|
|
||
|
// (protected) this *= n, this >= 0, 1 < n < DV
|
||
|
function bnpDMultiply(n) {
|
||
|
this[this.t] = this.am(0,n-1,this,0,0,this.t);
|
||
|
++this.t;
|
||
|
this.clamp();
|
||
|
}
|
||
|
|
||
|
// (protected) this += n << w words, this >= 0
|
||
|
function bnpDAddOffset(n,w) {
|
||
|
if(n == 0) return;
|
||
|
while(this.t <= w) this[this.t++] = 0;
|
||
|
this[w] += n;
|
||
|
while(this[w] >= this.DV) {
|
||
|
this[w] -= this.DV;
|
||
|
if(++w >= this.t) this[this.t++] = 0;
|
||
|
++this[w];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// (protected) convert to radix string
|
||
|
function bnpToRadix(b) {
|
||
|
if(b == null) b = 10;
|
||
|
if(this.signum() == 0 || b < 2 || b > 36) return "0";
|
||
|
var cs = this.chunkSize(b);
|
||
|
var a = Math.pow(b,cs);
|
||
|
var d = nbv(a), y = nbi(), z = nbi(), r = "";
|
||
|
this.divRemTo(d,y,z);
|
||
|
while(y.signum() > 0) {
|
||
|
r = (a+z.intValue()).toString(b).substr(1) + r;
|
||
|
y.divRemTo(d,y,z);
|
||
|
}
|
||
|
return z.intValue().toString(b) + r;
|
||
|
}
|
||
|
|
||
|
// (public) return value as integer
|
||
|
function bnIntValue() {
|
||
|
if(this.s < 0) {
|
||
|
if(this.t == 1) return this[0]-this.DV;
|
||
|
else if(this.t == 0) return -1;
|
||
|
}
|
||
|
else if(this.t == 1) return this[0];
|
||
|
else if(this.t == 0) return 0;
|
||
|
// assumes 16 < DB < 32
|
||
|
return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
|
||
|
}
|
||
|
|
||
|
// (protected) r = this + a
|
||
|
function bnpAddTo(a,r) {
|
||
|
var i = 0, c = 0, m = Math.min(a.t,this.t);
|
||
|
while(i < m) {
|
||
|
c += this[i]+a[i];
|
||
|
r[i++] = c&this.DM;
|
||
|
c >>= this.DB;
|
||
|
}
|
||
|
if(a.t < this.t) {
|
||
|
c += a.s;
|
||
|
while(i < this.t) {
|
||
|
c += this[i];
|
||
|
r[i++] = c&this.DM;
|
||
|
c >>= this.DB;
|
||
|
}
|
||
|
c += this.s;
|
||
|
}
|
||
|
else {
|
||
|
c += this.s;
|
||
|
while(i < a.t) {
|
||
|
c += a[i];
|
||
|
r[i++] = c&this.DM;
|
||
|
c >>= this.DB;
|
||
|
}
|
||
|
c += a.s;
|
||
|
}
|
||
|
r.s = (c<0)?-1:0;
|
||
|
if(c > 0) r[i++] = c;
|
||
|
else if(c < -1) r[i++] = this.DV+c;
|
||
|
r.t = i;
|
||
|
r.clamp();
|
||
|
}
|
||
|
|
||
|
BigInteger.prototype.fromRadix = bnpFromRadix;
|
||
|
BigInteger.prototype.chunkSize = bnpChunkSize;
|
||
|
BigInteger.prototype.signum = bnSigNum;
|
||
|
BigInteger.prototype.dMultiply = bnpDMultiply;
|
||
|
BigInteger.prototype.dAddOffset = bnpDAddOffset;
|
||
|
BigInteger.prototype.toRadix = bnpToRadix;
|
||
|
BigInteger.prototype.intValue = bnIntValue;
|
||
|
BigInteger.prototype.addTo = bnpAddTo;
|
||
|
|
||
|
//======= end jsbn =======
|
||
|
|
||
|
// Emscripten wrapper
|
||
|
var Wrapper = {
|
||
|
abs: function(l, h) {
|
||
|
var x = new goog.math.Long(l, h);
|
||
|
var ret;
|
||
|
if (x.isNegative()) {
|
||
|
ret = x.negate();
|
||
|
} else {
|
||
|
ret = x;
|
||
|
}
|
||
|
HEAP32[tempDoublePtr>>2] = ret.low_;
|
||
|
HEAP32[tempDoublePtr+4>>2] = ret.high_;
|
||
|
},
|
||
|
ensureTemps: function() {
|
||
|
if (Wrapper.ensuredTemps) return;
|
||
|
Wrapper.ensuredTemps = true;
|
||
|
Wrapper.two32 = new BigInteger();
|
||
|
Wrapper.two32.fromString('4294967296', 10);
|
||
|
Wrapper.two64 = new BigInteger();
|
||
|
Wrapper.two64.fromString('18446744073709551616', 10);
|
||
|
Wrapper.temp1 = new BigInteger();
|
||
|
Wrapper.temp2 = new BigInteger();
|
||
|
},
|
||
|
lh2bignum: function(l, h) {
|
||
|
var a = new BigInteger();
|
||
|
a.fromString(h.toString(), 10);
|
||
|
var b = new BigInteger();
|
||
|
a.multiplyTo(Wrapper.two32, b);
|
||
|
var c = new BigInteger();
|
||
|
c.fromString(l.toString(), 10);
|
||
|
var d = new BigInteger();
|
||
|
c.addTo(b, d);
|
||
|
return d;
|
||
|
},
|
||
|
stringify: function(l, h, unsigned) {
|
||
|
var ret = new goog.math.Long(l, h).toString();
|
||
|
if (unsigned && ret[0] == '-') {
|
||
|
// unsign slowly using jsbn bignums
|
||
|
Wrapper.ensureTemps();
|
||
|
var bignum = new BigInteger();
|
||
|
bignum.fromString(ret, 10);
|
||
|
ret = new BigInteger();
|
||
|
Wrapper.two64.addTo(bignum, ret);
|
||
|
ret = ret.toString(10);
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
fromString: function(str, base, min, max, unsigned) {
|
||
|
Wrapper.ensureTemps();
|
||
|
var bignum = new BigInteger();
|
||
|
bignum.fromString(str, base);
|
||
|
var bigmin = new BigInteger();
|
||
|
bigmin.fromString(min, 10);
|
||
|
var bigmax = new BigInteger();
|
||
|
bigmax.fromString(max, 10);
|
||
|
if (unsigned && bignum.compareTo(BigInteger.ZERO) < 0) {
|
||
|
var temp = new BigInteger();
|
||
|
bignum.addTo(Wrapper.two64, temp);
|
||
|
bignum = temp;
|
||
|
}
|
||
|
var error = false;
|
||
|
if (bignum.compareTo(bigmin) < 0) {
|
||
|
bignum = bigmin;
|
||
|
error = true;
|
||
|
} else if (bignum.compareTo(bigmax) > 0) {
|
||
|
bignum = bigmax;
|
||
|
error = true;
|
||
|
}
|
||
|
var ret = goog.math.Long.fromString(bignum.toString()); // min-max checks should have clamped this to a range goog.math.Long can handle well
|
||
|
HEAP32[tempDoublePtr>>2] = ret.low_;
|
||
|
HEAP32[tempDoublePtr+4>>2] = ret.high_;
|
||
|
if (error) throw 'range error';
|
||
|
}
|
||
|
};
|
||
|
return Wrapper;
|
||
|
})();
|
||
|
|
||
|
//======= end closure i64 code =======
|
||
|
|
||
|
|
||
|
|
||
|
// === Auto-generated postamble setup entry stuff ===
|
||
|
|
||
|
if (memoryInitializer) {
|
||
|
function applyData(data) {
|
||
|
HEAPU8.set(data, STATIC_BASE);
|
||
|
}
|
||
|
if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
|
||
|
applyData(Module['readBinary'](memoryInitializer));
|
||
|
} else {
|
||
|
addRunDependency('memory initializer');
|
||
|
Browser.asyncLoad(memoryInitializer, function(data) {
|
||
|
applyData(data);
|
||
|
removeRunDependency('memory initializer');
|
||
|
}, function(data) {
|
||
|
throw 'could not load memory initializer ' + memoryInitializer;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ExitStatus(status) {
|
||
|
this.name = "ExitStatus";
|
||
|
this.message = "Program terminated with exit(" + status + ")";
|
||
|
this.status = status;
|
||
|
};
|
||
|
ExitStatus.prototype = new Error();
|
||
|
ExitStatus.prototype.constructor = ExitStatus;
|
||
|
|
||
|
var initialStackTop;
|
||
|
var preloadStartTime = null;
|
||
|
var calledMain = false;
|
||
|
|
||
|
dependenciesFulfilled = function runCaller() {
|
||
|
// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
|
||
|
if (!Module['calledRun'] && shouldRunNow) run();
|
||
|
if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
|
||
|
}
|
||
|
|
||
|
Module['callMain'] = Module.callMain = function callMain(args) {
|
||
|
assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
|
||
|
assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
|
||
|
|
||
|
args = args || [];
|
||
|
|
||
|
if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {
|
||
|
Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');
|
||
|
}
|
||
|
|
||
|
ensureInitRuntime();
|
||
|
|
||
|
var argc = args.length+1;
|
||
|
function pad() {
|
||
|
for (var i = 0; i < 4-1; i++) {
|
||
|
argv.push(0);
|
||
|
}
|
||
|
}
|
||
|
var argv = [allocate(intArrayFromString("/bin/this.program"), 'i8', ALLOC_NORMAL) ];
|
||
|
pad();
|
||
|
for (var i = 0; i < argc-1; i = i + 1) {
|
||
|
argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));
|
||
|
pad();
|
||
|
}
|
||
|
argv.push(0);
|
||
|
argv = allocate(argv, 'i32', ALLOC_NORMAL);
|
||
|
|
||
|
initialStackTop = STACKTOP;
|
||
|
|
||
|
try {
|
||
|
|
||
|
var ret = Module['_main'](argc, argv, 0);
|
||
|
|
||
|
|
||
|
// if we're not running an evented main loop, it's time to exit
|
||
|
if (!Module['noExitRuntime']) {
|
||
|
exit(ret);
|
||
|
}
|
||
|
}
|
||
|
catch(e) {
|
||
|
if (e instanceof ExitStatus) {
|
||
|
// exit() throws this once it's done to make sure execution
|
||
|
// has been stopped completely
|
||
|
return;
|
||
|
} else if (e == 'SimulateInfiniteLoop') {
|
||
|
// running an evented main loop, don't immediately exit
|
||
|
Module['noExitRuntime'] = true;
|
||
|
return;
|
||
|
} else {
|
||
|
if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
|
||
|
throw e;
|
||
|
}
|
||
|
} finally {
|
||
|
calledMain = true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function run(args) {
|
||
|
args = args || Module['arguments'];
|
||
|
|
||
|
if (preloadStartTime === null) preloadStartTime = Date.now();
|
||
|
|
||
|
if (runDependencies > 0) {
|
||
|
Module.printErr('run() called, but dependencies remain, so not running');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
preRun();
|
||
|
|
||
|
if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
|
||
|
if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame
|
||
|
|
||
|
function doRun() {
|
||
|
if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening
|
||
|
Module['calledRun'] = true;
|
||
|
|
||
|
ensureInitRuntime();
|
||
|
|
||
|
preMain();
|
||
|
|
||
|
if (Module['_main'] && shouldRunNow) {
|
||
|
Module['callMain'](args);
|
||
|
}
|
||
|
|
||
|
postRun();
|
||
|
}
|
||
|
|
||
|
if (Module['setStatus']) {
|
||
|
Module['setStatus']('Running...');
|
||
|
setTimeout(function() {
|
||
|
setTimeout(function() {
|
||
|
Module['setStatus']('');
|
||
|
}, 1);
|
||
|
if (!ABORT) doRun();
|
||
|
}, 1);
|
||
|
} else {
|
||
|
doRun();
|
||
|
}
|
||
|
}
|
||
|
Module['run'] = Module.run = run;
|
||
|
|
||
|
function exit(status) {
|
||
|
ABORT = true;
|
||
|
EXITSTATUS = status;
|
||
|
STACKTOP = initialStackTop;
|
||
|
|
||
|
// exit the runtime
|
||
|
exitRuntime();
|
||
|
|
||
|
// TODO We should handle this differently based on environment.
|
||
|
// In the browser, the best we can do is throw an exception
|
||
|
// to halt execution, but in node we could process.exit and
|
||
|
// I'd imagine SM shell would have something equivalent.
|
||
|
// This would let us set a proper exit status (which
|
||
|
// would be great for checking test exit statuses).
|
||
|
// https://github.com/kripken/emscripten/issues/1371
|
||
|
|
||
|
// throw an exception to halt the current execution
|
||
|
throw new ExitStatus(status);
|
||
|
}
|
||
|
Module['exit'] = Module.exit = exit;
|
||
|
|
||
|
function abort(text) {
|
||
|
if (text) {
|
||
|
Module.print(text);
|
||
|
Module.printErr(text);
|
||
|
}
|
||
|
|
||
|
ABORT = true;
|
||
|
EXITSTATUS = 1;
|
||
|
|
||
|
throw 'abort() at ' + stackTrace();
|
||
|
}
|
||
|
Module['abort'] = Module.abort = abort;
|
||
|
|
||
|
// {{PRE_RUN_ADDITIONS}}
|
||
|
|
||
|
if (Module['preInit']) {
|
||
|
if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
|
||
|
while (Module['preInit'].length > 0) {
|
||
|
Module['preInit'].pop()();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// shouldRunNow refers to calling main(), not run().
|
||
|
var shouldRunNow = true;//false;
|
||
|
if (Module['noInitialRun']) {
|
||
|
shouldRunNow = false;
|
||
|
}
|
||
|
|
||
|
run();
|
||
|
assertEquals(0, EXITSTATUS);
|