Skip to content

Instantly share code, notes, and snippets.

@schneiderfelipe
Created July 6, 2021 19:43
Show Gist options
  • Save schneiderfelipe/93f6b88cab8576a6d8a25e5bc958f1dc to your computer and use it in GitHub Desktop.
Save schneiderfelipe/93f6b88cab8576a6d8a25e5bc958f1dc to your computer and use it in GitHub Desktop.
unrolled.js
/* Generated by the Nim Compiler v1.4.8 */
var framePtr = null;
var excHandler = 0;
var lastJSError = null;
function toJSStr(s_1455096) {
var Tmp5;
var Tmp7;
var result_1455097 = null;
var res_1455170 = newSeq_1455128((s_1455096).length);
var i_1455172 = 0;
var j_1455174 = 0;
L1: do {
L2: while (true) {
if (!(i_1455172 < (s_1455096).length)) break L2;
var c_1455175 = s_1455096[i_1455172];
if ((c_1455175 < 128)) {
res_1455170[j_1455174] = String.fromCharCode(c_1455175);
i_1455172 += 1;
}
else {
var helper_1455198 = newSeq_1455128(0);
L3: do {
L4: while (true) {
if (!true) break L4;
var code_1455199 = c_1455175.toString(16);
if ((((code_1455199) == null ? 0 : (code_1455199).length) == 1)) {
helper_1455198.push("%0");;
}
else {
helper_1455198.push("%");;
}
helper_1455198.push(code_1455199);;
i_1455172 += 1;
if (((s_1455096).length <= i_1455172)) Tmp5 = true; else { Tmp5 = (s_1455096[i_1455172] < 128); } if (Tmp5) {
break L3;
}
c_1455175 = s_1455096[i_1455172];
}
} while(false);
++excHandler;
Tmp7 = framePtr;
try {
res_1455170[j_1455174] = decodeURIComponent(helper_1455198.join(""));
--excHandler;
} catch (EXC) {
var prevJSError = lastJSError;
lastJSError = EXC;
--excHandler;
framePtr = Tmp7;
res_1455170[j_1455174] = helper_1455198.join("");
lastJSError = prevJSError;
} finally {
framePtr = Tmp7;
}
}
j_1455174 += 1;
}
} while(false);
if (res_1455170.length < j_1455174) { for (var i=res_1455170.length;i<j_1455174;++i) res_1455170.push(null); }
else { res_1455170.length = j_1455174; };
result_1455097 = res_1455170.join("");
return result_1455097;
}
function rawEcho() {
var buf = "";
for (var i = 0; i < arguments.length; ++i) {
buf += toJSStr(arguments[i]);
}
console.log(buf);
}
function cstrToNimstr(c_1455079) {
var ln = c_1455079.length;
var result = new Array(ln);
var r = 0;
for (var i = 0; i < ln; ++i) {
var ch = c_1455079.charCodeAt(i);
if (ch < 128) {
result[r] = ch;
}
else {
if (ch < 2048) {
result[r] = (ch >> 6) | 192;
}
else {
if (ch < 55296 || ch >= 57344) {
result[r] = (ch >> 12) | 224;
}
else {
++i;
ch = 65536 + (((ch & 1023) << 10) | (c_1455079.charCodeAt(i) & 1023));
result[r] = (ch >> 18) | 240;
++r;
result[r] = ((ch >> 12) & 63) | 128;
}
++r;
result[r] = ((ch >> 6) & 63) | 128;
}
++r;
result[r] = (ch & 63) | 128;
}
++r;
}
return result;
}
function makeNimstrLit(c_1455062) {
var ln = c_1455062.length;
var result = new Array(ln);
for (var i = 0; i < ln; ++i) {
result[i] = c_1455062.charCodeAt(i);
}
return result;
}
if (!Math.trunc) {
Math.trunc = function(v) {
v = +v;
if (!isFinite(v)) return v;
return (v - v % 1) || (v < 0 ? -0 : v === 0 ? v : 0);
};
}
function newSeq_1455128(len_1455131) {
var result_1455133 = [];
result_1455133 = new Array(len_1455131); for (var i=0;i<len_1455131;++i) {result_1455133[i]=null;}
return result_1455133;
}
L1: do {
var x_10670015 = [0];
L2: do {
var j_10670026 = [2];
x_10670015[0] += j_10670026[0];
} while(false);
L3: do {
var j_10670026 = [3];
x_10670015[0] += j_10670026[0];
} while(false);
L4: do {
var j_10670026 = [4];
x_10670015[0] += j_10670026[0];
} while(false);
rawEcho(cstrToNimstr((x_10670015[0])+""));
} while(false);
L5: do {
var total_10680004 = [0];
L6: do {
} while(false);
total_10680004[0] += 1;
L7: do {
} while(false);
total_10680004[0] += 2;
L8: do {
} while(false);
total_10680004[0] += 3;
rawEcho(cstrToNimstr((total_10680004[0])+""));
} while(false);
L9: do {
var total_10690001 = [0];
L10: do {
L11: do {
} while(false);
total_10690001[0] += 2;
L12: do {
} while(false);
total_10690001[0] += 3;
L13: do {
} while(false);
total_10690001[0] += 4;
} while(false);
L14: do {
L15: do {
} while(false);
total_10690001[0] += 3;
L16: do {
} while(false);
total_10690001[0] += 4;
L17: do {
} while(false);
total_10690001[0] += 5;
} while(false);
L18: do {
L19: do {
} while(false);
total_10690001[0] += 4;
L20: do {
} while(false);
total_10690001[0] += 5;
L21: do {
} while(false);
total_10690001[0] += 6;
} while(false);
rawEcho(cstrToNimstr((total_10690001[0])+""));
} while(false);
L22: do {
var cats_10700001 = [[]];
cats_10700001[0].push.apply(cats_10700001[0], makeNimstrLit("Sandy, "));;
cats_10700001[0].push.apply(cats_10700001[0], makeNimstrLit("Pel\xC3\xA9, "));;
cats_10700001[0].push.apply(cats_10700001[0], makeNimstrLit("Chamuscado, "));;
rawEcho(cats_10700001[0]);
} while(false);
L23: do {
var total_10705001 = [0];
L24: do {
} while(false);
total_10705001[0] += 1;
L25: do {
} while(false);
total_10705001[0] += 2;
L26: do {
} while(false);
total_10705001[0] += 3;
rawEcho(cstrToNimstr((total_10705001[0])+""));
} while(false);
L27: do {
var args_10715004 = [1, 2, 3];
var total_10715005 = [0];
L28: do {
} while(false);
total_10715005[0] += args_10715004[0];
L29: do {
} while(false);
total_10715005[0] += args_10715004[1];
L30: do {
} while(false);
total_10715005[0] += args_10715004[2];
rawEcho(cstrToNimstr((total_10715005[0])+""));
} while(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment